gitlab.com/danp128/sqlite@v1.0.0/internal/bin/bin_linux_amd64.go (about)

     1  // Code generated by ccgo. DO NOT EDIT.
     2  
     3  /*
     4  
     5  SQLite Is Public Domain
     6  
     7  All of the code and documentation in SQLite has been dedicated to the public
     8  domain by the authors. All code authors, and representatives of the companies
     9  they work for, have signed affidavits dedicating their contributions to the
    10  public domain and originals of those signed affidavits are stored in a firesafe
    11  at the main offices of Hwaci. Anyone is free to copy, modify, publish, use,
    12  compile, sell, or distribute the original SQLite code, either in source code
    13  form or as a compiled binary, for any purpose, commercial or non-commercial,
    14  and by any means.
    15  
    16  The previous paragraph applies to the deliverable code and documentation in
    17  SQLite - those parts of the SQLite library that you actually bundle and ship
    18  with a larger application. Some scripts used as part of the build process (for
    19  example the "configure" scripts generated by autoconf) might fall under other
    20  open-source licenses. Nothing from these build scripts ever reaches the final
    21  deliverable SQLite library, however, and so the licenses associated with those
    22  scripts should not be a factor in assessing your rights to copy and use the
    23  SQLite library.
    24  
    25  All of the deliverable code in SQLite has been written from scratch. No code
    26  has been taken from other projects or from the open internet. Every line of
    27  code can be traced back to its original author, and all of those authors have
    28  public domain dedications on file. So the SQLite code base is clean and is
    29  uncontaminated with licensed code from other projects.
    30  
    31  */
    32  
    33  // Package sqlite is an in-process implementation of a self-contained,
    34  // serverless, zero-configuration, transactional SQL database engine. (Work In Progress)
    35  //  /******************************************************************************
    36  //  ** This file is an amalgamation of many separate C source files from SQLite
    37  //  ** version 3.19.3.  By combining all the individual C code files into this
    38  //  ** single large file, the entire code can be compiled as a single translation
    39  //  ** unit.  This allows many compilers to do optimizations that would not be
    40  //  ** possible if the files were compiled separately.  Performance improvements
    41  //  ** of 5% or more are commonly seen when SQLite is compiled as a single
    42  //  ** translation unit.
    43  //  **
    44  //  ** This file is all you need to compile SQLite.  To use SQLite in other
    45  //  ** programs, you need this file and the "sqlite3.h" header file that defines
    46  //  ** the programming interface to the SQLite library.  (If you do not have
    47  //  ** the "sqlite3.h" header file at hand, you will find a copy embedded within
    48  //  ** the text of this file.  Search for "Begin file sqlite3.h" to find the start
    49  //  ** of the embedded sqlite3.h header file.) Additional code files may be needed
    50  //  ** if you want a wrapper to interface SQLite with your choice of programming
    51  //  ** language. The code for the "sqlite3" command-line shell is also in a
    52  //  ** separate file. This file contains only code for the core SQLite library.
    53  //  */
    54  package bin // import "modernc.org/sqlite/internal/bin"
    55  
    56  import (
    57  	"fmt"
    58  	"math"
    59  	"os"
    60  	"path"
    61  	"runtime"
    62  	"unsafe"
    63  
    64  	"modernc.org/ccgo/crt"
    65  )
    66  
    67  func ftrace(s string, args ...interface{}) {
    68  	_, fn, fl, _ := runtime.Caller(1)
    69  	fmt.Fprintf(os.Stderr, "# %s:%d: %v\n", path.Base(fn), fl, fmt.Sprintf(s, args...))
    70  	os.Stderr.Sync()
    71  }
    72  
    73  const (
    74  	XFTS5_TOKENIZE_AUX                     = 8
    75  	XFTS5_TOKENIZE_DOCUMENT                = 4
    76  	XFTS5_TOKENIZE_PREFIX                  = 2
    77  	XFTS5_TOKENIZE_QUERY                   = 1
    78  	XFTS5_TOKEN_COLOCATED                  = 1
    79  	XFULLY_WITHIN                          = 2
    80  	XNOT_WITHIN                            = 0
    81  	XPARTLY_WITHIN                         = 1
    82  	XSQLITE3_TEXT                          = 3
    83  	XSQLITE_ABORT                          = 4
    84  	XSQLITE_ABORT_ROLLBACK                 = 516
    85  	XSQLITE_ACCESS_EXISTS                  = 0
    86  	XSQLITE_ACCESS_READ                    = 2
    87  	XSQLITE_ACCESS_READWRITE               = 1
    88  	XSQLITE_ALTER_TABLE                    = 26
    89  	XSQLITE_ANALYZE                        = 28
    90  	XSQLITE_ANY                            = 5
    91  	XSQLITE_ATTACH                         = 24
    92  	XSQLITE_AUTH                           = 23
    93  	XSQLITE_AUTH_USER                      = 279
    94  	XSQLITE_BLOB                           = 4
    95  	XSQLITE_BUSY                           = 5
    96  	XSQLITE_BUSY_RECOVERY                  = 261
    97  	XSQLITE_BUSY_SNAPSHOT                  = 517
    98  	XSQLITE_CANTOPEN                       = 14
    99  	XSQLITE_CANTOPEN_CONVPATH              = 1038
   100  	XSQLITE_CANTOPEN_FULLPATH              = 782
   101  	XSQLITE_CANTOPEN_ISDIR                 = 526
   102  	XSQLITE_CANTOPEN_NOTEMPDIR             = 270
   103  	XSQLITE_CHECKPOINT_FULL                = 1
   104  	XSQLITE_CHECKPOINT_PASSIVE             = 0
   105  	XSQLITE_CHECKPOINT_RESTART             = 2
   106  	XSQLITE_CHECKPOINT_TRUNCATE            = 3
   107  	XSQLITE_CONFIG_COVERING_INDEX_SCAN     = 20
   108  	XSQLITE_CONFIG_GETMALLOC               = 5
   109  	XSQLITE_CONFIG_GETMUTEX                = 11
   110  	XSQLITE_CONFIG_GETPCACHE               = 15
   111  	XSQLITE_CONFIG_GETPCACHE2              = 19
   112  	XSQLITE_CONFIG_HEAP                    = 8
   113  	XSQLITE_CONFIG_LOG                     = 16
   114  	XSQLITE_CONFIG_LOOKASIDE               = 13
   115  	XSQLITE_CONFIG_MALLOC                  = 4
   116  	XSQLITE_CONFIG_MEMSTATUS               = 9
   117  	XSQLITE_CONFIG_MMAP_SIZE               = 22
   118  	XSQLITE_CONFIG_MULTITHREAD             = 2
   119  	XSQLITE_CONFIG_MUTEX                   = 10
   120  	XSQLITE_CONFIG_PAGECACHE               = 7
   121  	XSQLITE_CONFIG_PCACHE                  = 14
   122  	XSQLITE_CONFIG_PCACHE2                 = 18
   123  	XSQLITE_CONFIG_PCACHE_HDRSZ            = 24
   124  	XSQLITE_CONFIG_PMASZ                   = 25
   125  	XSQLITE_CONFIG_SCRATCH                 = 6
   126  	XSQLITE_CONFIG_SERIALIZED              = 3
   127  	XSQLITE_CONFIG_SINGLETHREAD            = 1
   128  	XSQLITE_CONFIG_SQLLOG                  = 21
   129  	XSQLITE_CONFIG_STMTJRNL_SPILL          = 26
   130  	XSQLITE_CONFIG_URI                     = 17
   131  	XSQLITE_CONFIG_WIN32_HEAPSIZE          = 23
   132  	XSQLITE_CONSTRAINT                     = 19
   133  	XSQLITE_CONSTRAINT_CHECK               = 275
   134  	XSQLITE_CONSTRAINT_COMMITHOOK          = 531
   135  	XSQLITE_CONSTRAINT_FOREIGNKEY          = 787
   136  	XSQLITE_CONSTRAINT_FUNCTION            = 1043
   137  	XSQLITE_CONSTRAINT_NOTNULL             = 1299
   138  	XSQLITE_CONSTRAINT_PRIMARYKEY          = 1555
   139  	XSQLITE_CONSTRAINT_ROWID               = 2579
   140  	XSQLITE_CONSTRAINT_TRIGGER             = 1811
   141  	XSQLITE_CONSTRAINT_UNIQUE              = 2067
   142  	XSQLITE_CONSTRAINT_VTAB                = 2323
   143  	XSQLITE_COPY                           = 0
   144  	XSQLITE_CORRUPT                        = 11
   145  	XSQLITE_CORRUPT_VTAB                   = 267
   146  	XSQLITE_CREATE_INDEX                   = 1
   147  	XSQLITE_CREATE_TABLE                   = 2
   148  	XSQLITE_CREATE_TEMP_INDEX              = 3
   149  	XSQLITE_CREATE_TEMP_TABLE              = 4
   150  	XSQLITE_CREATE_TEMP_TRIGGER            = 5
   151  	XSQLITE_CREATE_TEMP_VIEW               = 6
   152  	XSQLITE_CREATE_TRIGGER                 = 7
   153  	XSQLITE_CREATE_VIEW                    = 8
   154  	XSQLITE_CREATE_VTABLE                  = 29
   155  	XSQLITE_DBCONFIG_ENABLE_FKEY           = 1002
   156  	XSQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004
   157  	XSQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005
   158  	XSQLITE_DBCONFIG_ENABLE_TRIGGER        = 1003
   159  	XSQLITE_DBCONFIG_LOOKASIDE             = 1001
   160  	XSQLITE_DBCONFIG_MAINDBNAME            = 1000
   161  	XSQLITE_DBCONFIG_NO_CKPT_ON_CLOSE      = 1006
   162  	XSQLITE_DBSTATUS_CACHE_HIT             = 7
   163  	XSQLITE_DBSTATUS_CACHE_MISS            = 8
   164  	XSQLITE_DBSTATUS_CACHE_USED            = 1
   165  	XSQLITE_DBSTATUS_CACHE_USED_SHARED     = 11
   166  	XSQLITE_DBSTATUS_CACHE_WRITE           = 9
   167  	XSQLITE_DBSTATUS_DEFERRED_FKS          = 10
   168  	XSQLITE_DBSTATUS_LOOKASIDE_HIT         = 4
   169  	XSQLITE_DBSTATUS_LOOKASIDE_MISS_FULL   = 6
   170  	XSQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE   = 5
   171  	XSQLITE_DBSTATUS_LOOKASIDE_USED        = 0
   172  	XSQLITE_DBSTATUS_MAX                   = 11
   173  	XSQLITE_DBSTATUS_SCHEMA_USED           = 2
   174  	XSQLITE_DBSTATUS_STMT_USED             = 3
   175  	XSQLITE_DELETE                         = 9
   176  	XSQLITE_DENY                           = 1
   177  	XSQLITE_DETACH                         = 25
   178  	XSQLITE_DETERMINISTIC                  = 2048
   179  	XSQLITE_DONE                           = 101
   180  	XSQLITE_DROP_INDEX                     = 10
   181  	XSQLITE_DROP_TABLE                     = 11
   182  	XSQLITE_DROP_TEMP_INDEX                = 12
   183  	XSQLITE_DROP_TEMP_TABLE                = 13
   184  	XSQLITE_DROP_TEMP_TRIGGER              = 14
   185  	XSQLITE_DROP_TEMP_VIEW                 = 15
   186  	XSQLITE_DROP_TRIGGER                   = 16
   187  	XSQLITE_DROP_VIEW                      = 17
   188  	XSQLITE_DROP_VTABLE                    = 30
   189  	XSQLITE_EMPTY                          = 16
   190  	XSQLITE_ERROR                          = 1
   191  	XSQLITE_EXTERN                         = 0
   192  	XSQLITE_FAIL                           = 3
   193  	XSQLITE_FCNTL_BUSYHANDLER              = 15
   194  	XSQLITE_FCNTL_CHUNK_SIZE               = 6
   195  	XSQLITE_FCNTL_COMMIT_PHASETWO          = 22
   196  	XSQLITE_FCNTL_FILE_POINTER             = 7
   197  	XSQLITE_FCNTL_GET_LOCKPROXYFILE        = 2
   198  	XSQLITE_FCNTL_HAS_MOVED                = 20
   199  	XSQLITE_FCNTL_JOURNAL_POINTER          = 28
   200  	XSQLITE_FCNTL_LAST_ERRNO               = 4
   201  	XSQLITE_FCNTL_LOCKSTATE                = 1
   202  	XSQLITE_FCNTL_MMAP_SIZE                = 18
   203  	XSQLITE_FCNTL_OVERWRITE                = 11
   204  	XSQLITE_FCNTL_PDB                      = 30
   205  	XSQLITE_FCNTL_PERSIST_WAL              = 10
   206  	XSQLITE_FCNTL_POWERSAFE_OVERWRITE      = 13
   207  	XSQLITE_FCNTL_PRAGMA                   = 14
   208  	XSQLITE_FCNTL_RBU                      = 26
   209  	XSQLITE_FCNTL_SET_LOCKPROXYFILE        = 3
   210  	XSQLITE_FCNTL_SIZE_HINT                = 5
   211  	XSQLITE_FCNTL_SYNC                     = 21
   212  	XSQLITE_FCNTL_SYNC_OMITTED             = 8
   213  	XSQLITE_FCNTL_TEMPFILENAME             = 16
   214  	XSQLITE_FCNTL_TRACE                    = 19
   215  	XSQLITE_FCNTL_VFSNAME                  = 12
   216  	XSQLITE_FCNTL_VFS_POINTER              = 27
   217  	XSQLITE_FCNTL_WAL_BLOCK                = 24
   218  	XSQLITE_FCNTL_WIN32_AV_RETRY           = 9
   219  	XSQLITE_FCNTL_WIN32_GET_HANDLE         = 29
   220  	XSQLITE_FCNTL_WIN32_SET_HANDLE         = 23
   221  	XSQLITE_FCNTL_ZIPVFS                   = 25
   222  	XSQLITE_FLOAT                          = 2
   223  	XSQLITE_FORMAT                         = 24
   224  	XSQLITE_FULL                           = 13
   225  	XSQLITE_FUNCTION                       = 31
   226  	XSQLITE_GET_LOCKPROXYFILE              = 2
   227  	XSQLITE_IGNORE                         = 2
   228  	XSQLITE_INDEX_CONSTRAINT_EQ            = 2
   229  	XSQLITE_INDEX_CONSTRAINT_GE            = 32
   230  	XSQLITE_INDEX_CONSTRAINT_GLOB          = 66
   231  	XSQLITE_INDEX_CONSTRAINT_GT            = 4
   232  	XSQLITE_INDEX_CONSTRAINT_LE            = 8
   233  	XSQLITE_INDEX_CONSTRAINT_LIKE          = 65
   234  	XSQLITE_INDEX_CONSTRAINT_LT            = 16
   235  	XSQLITE_INDEX_CONSTRAINT_MATCH         = 64
   236  	XSQLITE_INDEX_CONSTRAINT_REGEXP        = 67
   237  	XSQLITE_INDEX_SCAN_UNIQUE              = 1
   238  	XSQLITE_INSERT                         = 18
   239  	XSQLITE_INTEGER                        = 1
   240  	XSQLITE_INTERNAL                       = 2
   241  	XSQLITE_INTERRUPT                      = 9
   242  	XSQLITE_IOCAP_ATOMIC                   = 1
   243  	XSQLITE_IOCAP_ATOMIC16K                = 64
   244  	XSQLITE_IOCAP_ATOMIC1K                 = 4
   245  	XSQLITE_IOCAP_ATOMIC2K                 = 8
   246  	XSQLITE_IOCAP_ATOMIC32K                = 128
   247  	XSQLITE_IOCAP_ATOMIC4K                 = 16
   248  	XSQLITE_IOCAP_ATOMIC512                = 2
   249  	XSQLITE_IOCAP_ATOMIC64K                = 256
   250  	XSQLITE_IOCAP_ATOMIC8K                 = 32
   251  	XSQLITE_IOCAP_IMMUTABLE                = 8192
   252  	XSQLITE_IOCAP_POWERSAFE_OVERWRITE      = 4096
   253  	XSQLITE_IOCAP_SAFE_APPEND              = 512
   254  	XSQLITE_IOCAP_SEQUENTIAL               = 1024
   255  	XSQLITE_IOCAP_UNDELETABLE_WHEN_OPEN    = 2048
   256  	XSQLITE_IOERR                          = 10
   257  	XSQLITE_IOERR_ACCESS                   = 3338
   258  	XSQLITE_IOERR_AUTH                     = 7178
   259  	XSQLITE_IOERR_BLOCKED                  = 2826
   260  	XSQLITE_IOERR_CHECKRESERVEDLOCK        = 3594
   261  	XSQLITE_IOERR_CLOSE                    = 4106
   262  	XSQLITE_IOERR_CONVPATH                 = 6666
   263  	XSQLITE_IOERR_DELETE                   = 2570
   264  	XSQLITE_IOERR_DELETE_NOENT             = 5898
   265  	XSQLITE_IOERR_DIR_CLOSE                = 4362
   266  	XSQLITE_IOERR_DIR_FSYNC                = 1290
   267  	XSQLITE_IOERR_FSTAT                    = 1802
   268  	XSQLITE_IOERR_FSYNC                    = 1034
   269  	XSQLITE_IOERR_GETTEMPPATH              = 6410
   270  	XSQLITE_IOERR_LOCK                     = 3850
   271  	XSQLITE_IOERR_MMAP                     = 6154
   272  	XSQLITE_IOERR_NOMEM                    = 3082
   273  	XSQLITE_IOERR_RDLOCK                   = 2314
   274  	XSQLITE_IOERR_READ                     = 266
   275  	XSQLITE_IOERR_SEEK                     = 5642
   276  	XSQLITE_IOERR_SHMLOCK                  = 5130
   277  	XSQLITE_IOERR_SHMMAP                   = 5386
   278  	XSQLITE_IOERR_SHMOPEN                  = 4618
   279  	XSQLITE_IOERR_SHMSIZE                  = 4874
   280  	XSQLITE_IOERR_SHORT_READ               = 522
   281  	XSQLITE_IOERR_TRUNCATE                 = 1546
   282  	XSQLITE_IOERR_UNLOCK                   = 2058
   283  	XSQLITE_IOERR_VNODE                    = 6922
   284  	XSQLITE_IOERR_WRITE                    = 778
   285  	XSQLITE_LAST_ERRNO                     = 4
   286  	XSQLITE_LIMIT_ATTACHED                 = 7
   287  	XSQLITE_LIMIT_COLUMN                   = 2
   288  	XSQLITE_LIMIT_COMPOUND_SELECT          = 4
   289  	XSQLITE_LIMIT_EXPR_DEPTH               = 3
   290  	XSQLITE_LIMIT_FUNCTION_ARG             = 6
   291  	XSQLITE_LIMIT_LENGTH                   = 0
   292  	XSQLITE_LIMIT_LIKE_PATTERN_LENGTH      = 8
   293  	XSQLITE_LIMIT_SQL_LENGTH               = 1
   294  	XSQLITE_LIMIT_TRIGGER_DEPTH            = 10
   295  	XSQLITE_LIMIT_VARIABLE_NUMBER          = 9
   296  	XSQLITE_LIMIT_VDBE_OP                  = 5
   297  	XSQLITE_LIMIT_WORKER_THREADS           = 11
   298  	XSQLITE_LOCKED                         = 6
   299  	XSQLITE_LOCKED_SHAREDCACHE             = 262
   300  	XSQLITE_LOCK_EXCLUSIVE                 = 4
   301  	XSQLITE_LOCK_NONE                      = 0
   302  	XSQLITE_LOCK_PENDING                   = 3
   303  	XSQLITE_LOCK_RESERVED                  = 2
   304  	XSQLITE_LOCK_SHARED                    = 1
   305  	XSQLITE_MISMATCH                       = 20
   306  	XSQLITE_MISUSE                         = 21
   307  	XSQLITE_MUTEX_FAST                     = 0
   308  	XSQLITE_MUTEX_RECURSIVE                = 1
   309  	XSQLITE_MUTEX_STATIC_APP1              = 8
   310  	XSQLITE_MUTEX_STATIC_APP2              = 9
   311  	XSQLITE_MUTEX_STATIC_APP3              = 10
   312  	XSQLITE_MUTEX_STATIC_LRU               = 6
   313  	XSQLITE_MUTEX_STATIC_LRU2              = 7
   314  	XSQLITE_MUTEX_STATIC_MASTER            = 2
   315  	XSQLITE_MUTEX_STATIC_MEM               = 3
   316  	XSQLITE_MUTEX_STATIC_MEM2              = 4
   317  	XSQLITE_MUTEX_STATIC_OPEN              = 4
   318  	XSQLITE_MUTEX_STATIC_PMEM              = 7
   319  	XSQLITE_MUTEX_STATIC_PRNG              = 5
   320  	XSQLITE_MUTEX_STATIC_VFS1              = 11
   321  	XSQLITE_MUTEX_STATIC_VFS2              = 12
   322  	XSQLITE_MUTEX_STATIC_VFS3              = 13
   323  	XSQLITE_NOLFS                          = 22
   324  	XSQLITE_NOMEM                          = 7
   325  	XSQLITE_NOTADB                         = 26
   326  	XSQLITE_NOTFOUND                       = 12
   327  	XSQLITE_NOTICE                         = 27
   328  	XSQLITE_NOTICE_RECOVER_ROLLBACK        = 539
   329  	XSQLITE_NOTICE_RECOVER_WAL             = 283
   330  	XSQLITE_NULL                           = 5
   331  	XSQLITE_OK                             = 0
   332  	XSQLITE_OK_LOAD_PERMANENTLY            = 256
   333  	XSQLITE_OPEN_AUTOPROXY                 = 32
   334  	XSQLITE_OPEN_CREATE                    = 4
   335  	XSQLITE_OPEN_DELETEONCLOSE             = 8
   336  	XSQLITE_OPEN_EXCLUSIVE                 = 16
   337  	XSQLITE_OPEN_FULLMUTEX                 = 65536
   338  	XSQLITE_OPEN_MAIN_DB                   = 256
   339  	XSQLITE_OPEN_MAIN_JOURNAL              = 2048
   340  	XSQLITE_OPEN_MASTER_JOURNAL            = 16384
   341  	XSQLITE_OPEN_MEMORY                    = 128
   342  	XSQLITE_OPEN_NOMUTEX                   = 32768
   343  	XSQLITE_OPEN_PRIVATECACHE              = 262144
   344  	XSQLITE_OPEN_READONLY                  = 1
   345  	XSQLITE_OPEN_READWRITE                 = 2
   346  	XSQLITE_OPEN_SHAREDCACHE               = 131072
   347  	XSQLITE_OPEN_SUBJOURNAL                = 8192
   348  	XSQLITE_OPEN_TEMP_DB                   = 512
   349  	XSQLITE_OPEN_TEMP_JOURNAL              = 4096
   350  	XSQLITE_OPEN_TRANSIENT_DB              = 1024
   351  	XSQLITE_OPEN_URI                       = 64
   352  	XSQLITE_OPEN_WAL                       = 524288
   353  	XSQLITE_PERM                           = 3
   354  	XSQLITE_PRAGMA                         = 19
   355  	XSQLITE_PROTOCOL                       = 15
   356  	XSQLITE_RANGE                          = 25
   357  	XSQLITE_READ                           = 20
   358  	XSQLITE_READONLY                       = 8
   359  	XSQLITE_READONLY_CANTLOCK              = 520
   360  	XSQLITE_READONLY_DBMOVED               = 1032
   361  	XSQLITE_READONLY_RECOVERY              = 264
   362  	XSQLITE_READONLY_ROLLBACK              = 776
   363  	XSQLITE_RECURSIVE                      = 33
   364  	XSQLITE_REINDEX                        = 27
   365  	XSQLITE_REPLACE                        = 5
   366  	XSQLITE_ROLLBACK                       = 1
   367  	XSQLITE_ROW                            = 100
   368  	XSQLITE_SAVEPOINT                      = 32
   369  	XSQLITE_SCANSTAT_EST                   = 2
   370  	XSQLITE_SCANSTAT_EXPLAIN               = 4
   371  	XSQLITE_SCANSTAT_NAME                  = 3
   372  	XSQLITE_SCANSTAT_NLOOP                 = 0
   373  	XSQLITE_SCANSTAT_NVISIT                = 1
   374  	XSQLITE_SCANSTAT_SELECTID              = 5
   375  	XSQLITE_SCHEMA                         = 17
   376  	XSQLITE_SELECT                         = 21
   377  	XSQLITE_SET_LOCKPROXYFILE              = 3
   378  	XSQLITE_SHM_EXCLUSIVE                  = 8
   379  	XSQLITE_SHM_LOCK                       = 2
   380  	XSQLITE_SHM_NLOCK                      = 8
   381  	XSQLITE_SHM_SHARED                     = 4
   382  	XSQLITE_SHM_UNLOCK                     = 1
   383  	XSQLITE_SOURCE_ID                      = "2017-06-08 14:26:16 0ee482a1e0eae22e08edc8978c9733a96603d4509645f348ebf55b579e89636b"
   384  	XSQLITE_STATUS_MALLOC_COUNT            = 9
   385  	XSQLITE_STATUS_MALLOC_SIZE             = 5
   386  	XSQLITE_STATUS_MEMORY_USED             = 0
   387  	XSQLITE_STATUS_PAGECACHE_OVERFLOW      = 2
   388  	XSQLITE_STATUS_PAGECACHE_SIZE          = 7
   389  	XSQLITE_STATUS_PAGECACHE_USED          = 1
   390  	XSQLITE_STATUS_PARSER_STACK            = 6
   391  	XSQLITE_STATUS_SCRATCH_OVERFLOW        = 4
   392  	XSQLITE_STATUS_SCRATCH_SIZE            = 8
   393  	XSQLITE_STATUS_SCRATCH_USED            = 3
   394  	XSQLITE_STMTSTATUS_AUTOINDEX           = 3
   395  	XSQLITE_STMTSTATUS_FULLSCAN_STEP       = 1
   396  	XSQLITE_STMTSTATUS_SORT                = 2
   397  	XSQLITE_STMTSTATUS_VM_STEP             = 4
   398  	XSQLITE_SYNC_DATAONLY                  = 16
   399  	XSQLITE_SYNC_FULL                      = 3
   400  	XSQLITE_SYNC_NORMAL                    = 2
   401  	XSQLITE_TESTCTRL_ALWAYS                = 13
   402  	XSQLITE_TESTCTRL_ASSERT                = 12
   403  	XSQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS   = 10
   404  	XSQLITE_TESTCTRL_BITVEC_TEST           = 8
   405  	XSQLITE_TESTCTRL_BYTEORDER             = 22
   406  	XSQLITE_TESTCTRL_EXPLAIN_STMT          = 19
   407  	XSQLITE_TESTCTRL_FAULT_INSTALL         = 9
   408  	XSQLITE_TESTCTRL_FIRST                 = 5
   409  	XSQLITE_TESTCTRL_IMPOSTER              = 25
   410  	XSQLITE_TESTCTRL_ISINIT                = 23
   411  	XSQLITE_TESTCTRL_ISKEYWORD             = 16
   412  	XSQLITE_TESTCTRL_LAST                  = 25
   413  	XSQLITE_TESTCTRL_LOCALTIME_FAULT       = 18
   414  	XSQLITE_TESTCTRL_NEVER_CORRUPT         = 20
   415  	XSQLITE_TESTCTRL_ONCE_RESET_THRESHOLD  = 19
   416  	XSQLITE_TESTCTRL_OPTIMIZATIONS         = 15
   417  	XSQLITE_TESTCTRL_PENDING_BYTE          = 11
   418  	XSQLITE_TESTCTRL_PRNG_RESET            = 7
   419  	XSQLITE_TESTCTRL_PRNG_RESTORE          = 6
   420  	XSQLITE_TESTCTRL_PRNG_SAVE             = 5
   421  	XSQLITE_TESTCTRL_RESERVE               = 14
   422  	XSQLITE_TESTCTRL_SCRATCHMALLOC         = 17
   423  	XSQLITE_TESTCTRL_SORTER_MMAP           = 24
   424  	XSQLITE_TESTCTRL_VDBE_COVERAGE         = 21
   425  	XSQLITE_TEXT                           = 3
   426  	XSQLITE_TOOBIG                         = 18
   427  	XSQLITE_TRACE_CLOSE                    = 8
   428  	XSQLITE_TRACE_PROFILE                  = 2
   429  	XSQLITE_TRACE_ROW                      = 4
   430  	XSQLITE_TRACE_STMT                     = 1
   431  	XSQLITE_TRANSACTION                    = 22
   432  	XSQLITE_TRANSIENT                      = -1
   433  	XSQLITE_UPDATE                         = 23
   434  	XSQLITE_UTF16                          = 4
   435  	XSQLITE_UTF16BE                        = 3
   436  	XSQLITE_UTF16LE                        = 2
   437  	XSQLITE_UTF16_ALIGNED                  = 8
   438  	XSQLITE_UTF8                           = 1
   439  	XSQLITE_VERSION                        = "3.19.3"
   440  	XSQLITE_VERSION_NUMBER                 = 3019003
   441  	XSQLITE_VTAB_CONSTRAINT_SUPPORT        = 1
   442  	XSQLITE_WARNING                        = 28
   443  	XSQLITE_WARNING_AUTOINDEX              = 284
   444  	X_LP64                                 = 1
   445  	X_STDC_PREDEF_H                        = 1
   446  	X__ATOMIC_ACQUIRE                      = 2
   447  	X__ATOMIC_ACQ_REL                      = 4
   448  	X__ATOMIC_CONSUME                      = 1
   449  	X__ATOMIC_HLE_ACQUIRE                  = 65536
   450  	X__ATOMIC_HLE_RELEASE                  = 131072
   451  	X__ATOMIC_RELAXED                      = 0
   452  	X__ATOMIC_RELEASE                      = 3
   453  	X__ATOMIC_SEQ_CST                      = 5
   454  	X__BIGGEST_ALIGNMENT__                 = 16
   455  	X__BYTE_ORDER__                        = 1234
   456  	X__CHAR_BIT__                          = 8
   457  	X__DBL_DECIMAL_DIG__                   = 17
   458  	X__DBL_DIG__                           = 15
   459  	X__DBL_HAS_DENORM__                    = 1
   460  	X__DBL_HAS_INFINITY__                  = 1
   461  	X__DBL_HAS_QUIET_NAN__                 = 1
   462  	X__DBL_MANT_DIG__                      = 53
   463  	X__DBL_MAX_10_EXP__                    = 308
   464  	X__DBL_MAX_EXP__                       = 1024
   465  	X__DBL_MIN_10_EXP__                    = -307
   466  	X__DBL_MIN_EXP__                       = -1021
   467  	X__DEC128_MANT_DIG__                   = 34
   468  	X__DEC128_MAX_EXP__                    = 6145
   469  	X__DEC128_MIN_EXP__                    = -6142
   470  	X__DEC32_MANT_DIG__                    = 7
   471  	X__DEC32_MAX_EXP__                     = 97
   472  	X__DEC32_MIN_EXP__                     = -94
   473  	X__DEC64_MANT_DIG__                    = 16
   474  	X__DEC64_MAX_EXP__                     = 385
   475  	X__DEC64_MIN_EXP__                     = -382
   476  	X__DECIMAL_BID_FORMAT__                = 1
   477  	X__DECIMAL_DIG__                       = 21
   478  	X__DEC_EVAL_METHOD__                   = 2
   479  	X__FINITE_MATH_ONLY__                  = 0
   480  	X__FLOAT_WORD_ORDER__                  = 1234
   481  	X__FLT_DECIMAL_DIG__                   = 9
   482  	X__FLT_DENORM_MIN__                    = 1e-45
   483  	X__FLT_DIG__                           = 6
   484  	X__FLT_EPSILON__                       = 1.1920929e-07
   485  	X__FLT_EVAL_METHOD__                   = 0
   486  	X__FLT_HAS_DENORM__                    = 1
   487  	X__FLT_HAS_INFINITY__                  = 1
   488  	X__FLT_HAS_QUIET_NAN__                 = 1
   489  	X__FLT_MANT_DIG__                      = 24
   490  	X__FLT_MAX_10_EXP__                    = 38
   491  	X__FLT_MAX_EXP__                       = 128
   492  	X__FLT_MAX__                           = 3.4028235e+38
   493  	X__FLT_MIN_10_EXP__                    = -37
   494  	X__FLT_MIN_EXP__                       = -125
   495  	X__FLT_MIN__                           = 1.1754944e-38
   496  	X__FLT_RADIX__                         = 2
   497  	X__FUNCTION__                          = 0
   498  	X__FXSR__                              = 1
   499  	X__GXX_ABI_VERSION                     = 1010
   500  	X__INT16_MAX__                         = 32767
   501  	X__INT32_MAX__                         = 2147483647
   502  	X__INT32_TYPE__                        = 0
   503  	X__INT64_MAX__                         = 9223372036854775807
   504  	X__INT8_MAX__                          = 127
   505  	X__INTMAX_MAX__                        = 9223372036854775807
   506  	X__INTPTR_MAX__                        = 9223372036854775807
   507  	X__INT_FAST16_MAX__                    = 9223372036854775807
   508  	X__INT_FAST32_MAX__                    = 9223372036854775807
   509  	X__INT_FAST64_MAX__                    = 9223372036854775807
   510  	X__INT_FAST8_MAX__                     = 127
   511  	X__INT_LEAST16_MAX__                   = 32767
   512  	X__INT_LEAST32_MAX__                   = 2147483647
   513  	X__INT_LEAST32_TYPE__                  = 0
   514  	X__INT_LEAST64_MAX__                   = 9223372036854775807
   515  	X__INT_LEAST8_MAX__                    = 127
   516  	X__INT_MAX__                           = 2147483647
   517  	X__LDBL_DENORM_MIN__                   = 0
   518  	X__LDBL_DIG__                          = 18
   519  	X__LDBL_EPSILON__                      = 1.0842021724855044e-19
   520  	X__LDBL_HAS_DENORM__                   = 1
   521  	X__LDBL_HAS_INFINITY__                 = 1
   522  	X__LDBL_HAS_QUIET_NAN__                = 1
   523  	X__LDBL_MANT_DIG__                     = 64
   524  	X__LDBL_MAX_10_EXP__                   = 4932
   525  	X__LDBL_MAX_EXP__                      = 16384
   526  	X__LDBL_MAX__                          = 0
   527  	X__LDBL_MIN_10_EXP__                   = -4931
   528  	X__LDBL_MIN_EXP__                      = -16381
   529  	X__LDBL_MIN__                          = 0
   530  	X__LONG_LONG_MAX__                     = 9223372036854775807
   531  	X__LONG_MAX__                          = 9223372036854775807
   532  	X__LP64__                              = 1
   533  	X__MMX__                               = 1
   534  	X__NO_INLINE__                         = 1
   535  	X__ORDER_BIG_ENDIAN__                  = 4321
   536  	X__ORDER_LITTLE_ENDIAN__               = 1234
   537  	X__ORDER_PDP_ENDIAN__                  = 3412
   538  	X__PIC__                               = 2
   539  	X__PIE__                               = 2
   540  	X__PRAGMA_REDEFINE_EXTNAME             = 1
   541  	X__PTRDIFF_MAX__                       = 9223372036854775807
   542  	X__SCHAR_MAX__                         = 127
   543  	X__SEG_FS                              = 1
   544  	X__SEG_GS                              = 1
   545  	X__SHRT_MAX__                          = 32767
   546  	X__SIG_ATOMIC_MAX__                    = 2147483647
   547  	X__SIG_ATOMIC_MIN__                    = -2147483648
   548  	X__SIG_ATOMIC_TYPE__                   = 0
   549  	X__SIZEOF_DOUBLE__                     = 8
   550  	X__SIZEOF_FLOAT128__                   = 16
   551  	X__SIZEOF_FLOAT80__                    = 16
   552  	X__SIZEOF_FLOAT__                      = 4
   553  	X__SIZEOF_INT__                        = 4
   554  	X__SIZEOF_LONG_DOUBLE__                = 16
   555  	X__SIZEOF_LONG_LONG__                  = 8
   556  	X__SIZEOF_LONG__                       = 8
   557  	X__SIZEOF_POINTER__                    = 8
   558  	X__SIZEOF_PTRDIFF_T__                  = 8
   559  	X__SIZEOF_SHORT__                      = 2
   560  	X__SIZEOF_SIZE_T__                     = 8
   561  	X__SIZEOF_WCHAR_T__                    = 4
   562  	X__SIZEOF_WINT_T__                     = 4
   563  	X__SIZE_MAX__                          = 18446744073709551615
   564  	X__SSE2_MATH__                         = 1
   565  	X__SSE2__                              = 1
   566  	X__SSE_MATH__                          = 1
   567  	X__SSE__                               = 1
   568  	X__SSP_STRONG__                        = 3
   569  	X__STDC_HOSTED__                       = 1
   570  	X__STDC_IEC_559_COMPLEX__              = 1
   571  	X__STDC_IEC_559__                      = 1
   572  	X__STDC_ISO_10646__                    = 201505
   573  	X__STDC_NO_THREADS__                   = 1
   574  	X__STDC_VERSION__                      = 199901
   575  	X__STDC__                              = 1
   576  	X__STRICT_ANSI__                       = 1
   577  	X__UINT16_MAX__                        = 65535
   578  	X__UINT32_MAX__                        = 4294967295
   579  	X__UINT64_MAX__                        = 18446744073709551615
   580  	X__UINT8_MAX__                         = 255
   581  	X__UINTMAX_MAX__                       = 18446744073709551615
   582  	X__UINTPTR_MAX__                       = 18446744073709551615
   583  	X__UINT_FAST16_MAX__                   = 18446744073709551615
   584  	X__UINT_FAST32_MAX__                   = 18446744073709551615
   585  	X__UINT_FAST64_MAX__                   = 18446744073709551615
   586  	X__UINT_FAST8_MAX__                    = 255
   587  	X__UINT_LEAST16_MAX__                  = 65535
   588  	X__UINT_LEAST32_MAX__                  = 4294967295
   589  	X__UINT_LEAST64_MAX__                  = 18446744073709551615
   590  	X__UINT_LEAST8_MAX__                   = 255
   591  	X__VERSION__                           = "6.2.0 20161005"
   592  	X__WCHAR_MAX__                         = 2147483647
   593  	X__WCHAR_MIN__                         = -2147483648
   594  	X__WCHAR_TYPE__                        = 0
   595  	X__WINT_MAX__                          = 4294967295
   596  	X__WINT_MIN__                          = 0
   597  	X__amd64                               = 1
   598  	X__amd64__                             = 1
   599  	X__code_model_small__                  = 1
   600  	X__complex__                           = 0
   601  	X__const                               = 0
   602  	X__inline                              = 0
   603  	X__k8                                  = 1
   604  	X__k8__                                = 1
   605  	X__linux                               = 1
   606  	X__linux__                             = 1
   607  	X__pic__                               = 2
   608  	X__pie__                               = 2
   609  	X__restrict                            = 0
   610  	X__unix                                = 1
   611  	X__unix__                              = 1
   612  	X__volatile                            = 0
   613  	X__x86_64                              = 1
   614  	X__x86_64__                            = 1
   615  )
   616  
   617  func X_start(tls *crt.TLS, _argc int32, _argv **int8) {
   618  	crt.X__register_stdfiles(tls, Xstdin, Xstdout, Xstderr)
   619  	crt.X__builtin_exit(tls, Xmain(tls, _argc, _argv))
   620  }
   621  
   622  var Xstdin unsafe.Pointer
   623  
   624  func init() {
   625  	Xstdin = unsafe.Pointer(&X__stdfiles)
   626  }
   627  
   628  var X__stdfiles [3]unsafe.Pointer
   629  
   630  var Xstdout unsafe.Pointer
   631  
   632  func init() {
   633  	Xstdout = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 8)
   634  }
   635  
   636  var Xstderr unsafe.Pointer
   637  
   638  func init() {
   639  	Xstderr = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 16)
   640  }
   641  
   642  func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) {
   643  	return int32(0)
   644  }
   645  
   646  func Xsqlite3PendingByte() int32 { return _sqlite3PendingByte }
   647  
   648  // C comment
   649  //  /*
   650  //  ** CAPI3REF: Run-Time Library Version Numbers
   651  //  ** KEYWORDS: sqlite3_version sqlite3_sourceid
   652  //  **
   653  //  ** These interfaces provide the same information as the [SQLITE_VERSION],
   654  //  ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
   655  //  ** but are associated with the library instead of the header file.  ^(Cautious
   656  //  ** programmers might include assert() statements in their application to
   657  //  ** verify that values returned by these interfaces match the macros in
   658  //  ** the header, and thus ensure that the application is
   659  //  ** compiled with matching library and header files.
   660  //  **
   661  //  ** <blockquote><pre>
   662  //  ** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
   663  //  ** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
   664  //  ** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
   665  //  ** </pre></blockquote>)^
   666  //  **
   667  //  ** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
   668  //  ** macro.  ^The sqlite3_libversion() function returns a pointer to the
   669  //  ** to the sqlite3_version[] string constant.  The sqlite3_libversion()
   670  //  ** function is provided for use in DLLs since DLL users usually do not have
   671  //  ** direct access to string constants within the DLL.  ^The
   672  //  ** sqlite3_libversion_number() function returns an integer equal to
   673  //  ** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns
   674  //  ** a pointer to a string constant whose value is the same as the
   675  //  ** [SQLITE_SOURCE_ID] C preprocessor macro.
   676  //  **
   677  //  ** See also: [sqlite_version()] and [sqlite_source_id()].
   678  //  */
   679  var Xsqlite3_version [7]int8
   680  
   681  func init() {
   682  	crt.Xstrncpy(nil, &Xsqlite3_version[0], str(0), 7)
   683  }
   684  
   685  // C comment
   686  //  /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
   687  //  ** a pointer to the to the sqlite3_version[] string constant.
   688  //  */
   689  func Xsqlite3_libversion(tls *crt.TLS) (r0 *int8) {
   690  	return (*int8)(unsafe.Pointer(&Xsqlite3_version))
   691  }
   692  
   693  // C comment
   694  //  /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
   695  //  ** pointer to a string constant whose value is the same as the
   696  //  ** SQLITE_SOURCE_ID C preprocessor macro.
   697  //  */
   698  func Xsqlite3_sourceid(tls *crt.TLS) (r0 *int8) {
   699  	return str(7)
   700  }
   701  
   702  // C comment
   703  //  /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
   704  //  ** returns an integer equal to SQLITE_VERSION_NUMBER.
   705  //  */
   706  func Xsqlite3_libversion_number(tls *crt.TLS) (r0 int32) {
   707  	return int32(3019003)
   708  }
   709  
   710  // C comment
   711  //  /*
   712  //  ** Given the name of a compile-time option, return true if that option
   713  //  ** was used and false if not.
   714  //  **
   715  //  ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
   716  //  ** is not required for a match.
   717  //  */
   718  func Xsqlite3_compileoption_used(tls *crt.TLS, _zOptName *int8) (r0 int32) {
   719  	var _i, _n int32
   720  	if _zOptName == nil {
   721  		_sqlite3MisuseError(tls, int32(17883))
   722  		return int32(0)
   723  	}
   724  	if Xsqlite3_strnicmp(tls, _zOptName, str(92), int32(7)) == int32(0) {
   725  		*(*uintptr)(unsafe.Pointer(&_zOptName)) += uintptr(int32(7))
   726  	}
   727  	_n = _sqlite3Strlen30(tls, _zOptName)
   728  	_i = int32(0)
   729  _2:
   730  	if _i >= int32(6) {
   731  		goto _5
   732  	}
   733  	if (Xsqlite3_strnicmp(tls, _zOptName, *elem0((**int8)(unsafe.Pointer(&_azCompileOpt)), uintptr(_i)), _n) == int32(0)) && (_sqlite3IsIdChar(tls, uint8(*elem1(*elem0((**int8)(unsafe.Pointer(&_azCompileOpt)), uintptr(_i)), uintptr(_n)))) == int32(0)) {
   734  		return int32(1)
   735  	}
   736  	_i += 1
   737  	goto _2
   738  _5:
   739  	return int32(0)
   740  }
   741  
   742  func _sqlite3MisuseError(tls *crt.TLS, _lineno int32) (r0 int32) {
   743  	return _reportError(tls, int32(21), _lineno, str(100))
   744  }
   745  
   746  // C comment
   747  //  /*
   748  //  ** The following routines are substitutes for constants SQLITE_CORRUPT,
   749  //  ** SQLITE_MISUSE, SQLITE_CANTOPEN, SQLITE_NOMEM and possibly other error
   750  //  ** constants.  They serve two purposes:
   751  //  **
   752  //  **   1.  Serve as a convenient place to set a breakpoint in a debugger
   753  //  **       to detect when version error conditions occurs.
   754  //  **
   755  //  **   2.  Invoke sqlite3_log() to provide the source code location where
   756  //  **       a low-level error is first detected.
   757  //  */
   758  func _reportError(tls *crt.TLS, _iErr int32, _lineno int32, _zType *int8) (r0 int32) {
   759  	Xsqlite3_log(tls, _iErr, str(107), unsafe.Pointer(_zType), _lineno, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(int32(20))+uintptr(unsafe.Pointer(Xsqlite3_sourceid(tls)))))))
   760  	return _iErr
   761  }
   762  
   763  // C comment
   764  //  /*
   765  //  ** Format and write a message to the log if logging is enabled.
   766  //  */
   767  func Xsqlite3_log(tls *crt.TLS, _iErrCode int32, _zFormat *int8, args ...interface{}) {
   768  	var _ap []interface{}
   769  	if _sqlite3Config.XxLog != nil {
   770  		_ap = args
   771  		_renderLogMsg(tls, _iErrCode, _zFormat, _ap)
   772  		_ap = nil
   773  	}
   774  }
   775  
   776  // C comment
   777  //  /*
   778  //  ** The following singleton contains the global configuration for
   779  //  ** the SQLite library.
   780  //  */
   781  var _sqlite3Config TSqlite3Config
   782  
   783  func init() {
   784  	_sqlite3Config = TSqlite3Config{XbMemstat: int32(1), XbCoreMutex: int32(1), XbFullMutex: int32(1), XbOpenUri: int32(1), XbUseCis: int32(1), XmxStrlen: int32(2147483646), XszLookaside: int32(1200), XnLookaside: int32(100), XnStmtSpill: int32(65536), XmxMmap: int64(2147418112), XnPage: int32(20), XszPma: uint32(250), XiOnceResetThreshold: int32(2147483646)}
   785  }
   786  
   787  // C comment
   788  //  /*
   789  //  ** This is the routine that actually formats the sqlite3_log() message.
   790  //  ** We house it in a separate routine from sqlite3_log() to avoid using
   791  //  ** stack space on small-stack systems when logging is disabled.
   792  //  **
   793  //  ** sqlite3_log() must render into a static buffer.  It cannot dynamically
   794  //  ** allocate memory because it might be called while the memory allocator
   795  //  ** mutex is held.
   796  //  **
   797  //  ** sqlite3VXPrintf() might ask for *temporary* memory allocations for
   798  //  ** certain format characters (%q) or for very large precisions or widths.
   799  //  ** Care must be taken that any sqlite3_log() calls that occur while the
   800  //  ** memory mutex is held do not use these mechanisms.
   801  //  */
   802  func _renderLogMsg(tls *crt.TLS, _iErrCode int32, _zFormat *int8, _ap []interface{}) {
   803  	var _acc XStrAccum
   804  	var _zMsg [210]int8
   805  	_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zMsg)), int32(210), int32(0))
   806  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
   807  	_sqlite3Config.XxLog(tls, _sqlite3Config.XpLogArg, _iErrCode, _sqlite3StrAccumFinish(tls, &_acc))
   808  	_ = _zMsg
   809  }
   810  
   811  // C comment
   812  //  /*
   813  //  ** Initialize a string accumulator.
   814  //  **
   815  //  ** p:     The accumulator to be initialized.
   816  //  ** db:    Pointer to a database connection.  May be NULL.  Lookaside
   817  //  **        memory is used if not NULL. db->mallocFailed is set appropriately
   818  //  **        when not NULL.
   819  //  ** zBase: An initial buffer.  May be NULL in which case the initial buffer
   820  //  **        is malloced.
   821  //  ** n:     Size of zBase in bytes.  If total space requirements never exceed
   822  //  **        n then no memory allocations ever occur.
   823  //  ** mx:    Maximum number of bytes to accumulate.  If mx==0 then no memory
   824  //  **        allocations will ever occur.
   825  //  */
   826  func _sqlite3StrAccumInit(tls *crt.TLS, _p *XStrAccum, _db *Xsqlite3, _zBase *int8, _n int32, _mx int32) {
   827  	_p.XzText = store1(&_p.XzBase, _zBase)
   828  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
   829  	_p.XnChar = 0
   830  	_p.XnAlloc = uint32(_n)
   831  	_p.XmxAlloc = uint32(_mx)
   832  	_p.XaccError = 0
   833  	_p.XprintfFlags = 0
   834  }
   835  
   836  // C comment
   837  //  /*
   838  //  ** Render a string given by "fmt" into the StrAccum object.
   839  //  */
   840  func _sqlite3VXPrintf(tls *crt.TLS, _pAccum *XStrAccum, _fmt *int8, _ap []interface{}) {
   841  	var _c, _precision, _length, _idx, _width, _nOut, _exp, _e2, _nsd, _49_x, _54_nn, _54_ix, _96_i, _96_nPad, _110_i, _110_j, _110_k, _110_n, _110_isnull, _110_needQuote, _120_k int32
   842  	var _29_v int64
   843  	var _prefix, _57_x, _110_ch, _110_q int8
   844  	var _13_wx, _20_px uint32
   845  	var _longvalue, _47_n uint64
   846  	var _bufpt, _zOut, _zExtra, _51_cset, _57_pre, _110_escarg *int8
   847  	var _realvalue, _rounder, _64_scale float64
   848  	var _flag_leftjustify, _flag_prefix, _flag_alternateform, _flag_altform2, _flag_zeropad, _flag_long, _done, _cThousand, _xtype, _bArgList, _flag_dp, _flag_rtz, _51_base uint8
   849  	var _pArgList *XPrintfArguments
   850  	var _infop *Xet_info
   851  	var _buf [70]int8
   852  	var _118_pToken *XToken
   853  	var _120_pSrc *XSrcList
   854  	var _120_pItem *TSrcList_item
   855  	_xtype = uint8(17)
   856  	_zExtra = nil
   857  	_pArgList = nil
   858  	_bufpt = nil
   859  	if (int32(_pAccum.XprintfFlags) & int32(2)) != int32(0) {
   860  		_pArgList = (*XPrintfArguments)(crt.VAPointer(&_ap))
   861  		_bArgList = uint8(1)
   862  		goto _1
   863  	}
   864  	_bArgList = 0
   865  _1:
   866  	if store2(&_c, int32(*_fmt)) == int32(0) {
   867  		goto _5
   868  	}
   869  	if _c == int32(37) {
   870  		goto _6
   871  	}
   872  	_bufpt = _fmt
   873  _7:
   874  	*(*uintptr)(unsafe.Pointer(&_fmt)) += uintptr(1)
   875  	if ((*_fmt) != 0) && (int32(*_fmt) != int32(37)) {
   876  		goto _7
   877  	}
   878  	_sqlite3StrAccumAppend(tls, _pAccum, _bufpt, int32(int64(uintptr(unsafe.Pointer(_fmt))-uintptr(unsafe.Pointer(_bufpt)))))
   879  	if int32(*_fmt) == int32(0) {
   880  		goto _5
   881  	}
   882  _6:
   883  	if store2(&_c, int32(*preInc1(&_fmt, 1))) == int32(0) {
   884  		_sqlite3StrAccumAppend(tls, _pAccum, str(132), int32(1))
   885  		goto _5
   886  	}
   887  	_flag_leftjustify = store3(&_flag_prefix, store3(&_cThousand, store3(&_flag_alternateform, store3(&_flag_altform2, store3(&_flag_zeropad, 0)))))
   888  	_done = 0
   889  _11:
   890  	switch _c {
   891  	case int32(32):
   892  		goto _15
   893  	case int32(33):
   894  		goto _17
   895  	case int32(35):
   896  		goto _16
   897  	case int32(43):
   898  		goto _14
   899  	case int32(44):
   900  		goto _19
   901  	case int32(45):
   902  		goto _13
   903  	case int32(48):
   904  		goto _18
   905  	default:
   906  		goto _20
   907  	}
   908  
   909  _13:
   910  	_flag_leftjustify = uint8(1)
   911  	goto _21
   912  _14:
   913  	_flag_prefix = uint8(43)
   914  	goto _21
   915  _15:
   916  	_flag_prefix = uint8(32)
   917  	goto _21
   918  _16:
   919  	_flag_alternateform = uint8(1)
   920  	goto _21
   921  _17:
   922  	_flag_altform2 = uint8(1)
   923  	goto _21
   924  _18:
   925  	_flag_zeropad = uint8(1)
   926  	goto _21
   927  _19:
   928  	_cThousand = uint8(44)
   929  	goto _21
   930  _20:
   931  	_done = uint8(1)
   932  	goto _21
   933  _21:
   934  	if (_done == 0) && (store2(&_c, int32(*preInc1(&_fmt, 1))) != int32(0)) {
   935  		goto _11
   936  	}
   937  	if _c != int32(42) {
   938  		goto _23
   939  	}
   940  	if _bArgList != 0 {
   941  		_width = int32(_getIntArg(tls, _pArgList))
   942  		goto _25
   943  	}
   944  	_width = crt.VAInt32(&_ap)
   945  _25:
   946  	if _width < int32(0) {
   947  		_flag_leftjustify = uint8(1)
   948  		_width = func() int32 {
   949  			if _width >= int32(-2147483647) {
   950  				return (-_width)
   951  			}
   952  			return int32(0)
   953  		}()
   954  	}
   955  	_c = int32(*preInc1(&_fmt, 1))
   956  	goto _29
   957  _23:
   958  	_13_wx = 0
   959  _30:
   960  	if (_c >= int32(48)) && (_c <= int32(57)) {
   961  		_13_wx = ((_13_wx * uint32(10)) + uint32(_c)) - uint32(48)
   962  		_c = int32(*preInc1(&_fmt, 1))
   963  		goto _30
   964  	}
   965  	_width = int32(_13_wx & uint32(2147483647))
   966  _29:
   967  	func() {
   968  		if _width < int32(0) {
   969  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25327), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(228)))
   970  			crt.X__builtin_abort(tls)
   971  		}
   972  	}()
   973  	if _c != int32(46) {
   974  		goto _35
   975  	}
   976  	_c = int32(*preInc1(&_fmt, 1))
   977  	if _c != int32(42) {
   978  		goto _36
   979  	}
   980  	if _bArgList != 0 {
   981  		_precision = int32(_getIntArg(tls, _pArgList))
   982  		goto _38
   983  	}
   984  	_precision = crt.VAInt32(&_ap)
   985  _38:
   986  	_c = int32(*preInc1(&_fmt, 1))
   987  	if _precision < int32(0) {
   988  		_precision = func() int32 {
   989  			if _precision >= int32(-2147483647) {
   990  				return (-_precision)
   991  			}
   992  			return int32(-1)
   993  		}()
   994  	}
   995  	goto _42
   996  _36:
   997  	_20_px = 0
   998  _43:
   999  	if (_c >= int32(48)) && (_c <= int32(57)) {
  1000  		_20_px = ((_20_px * uint32(10)) + uint32(_c)) - uint32(48)
  1001  		_c = int32(*preInc1(&_fmt, 1))
  1002  		goto _43
  1003  	}
  1004  	_precision = int32(_20_px & uint32(2147483647))
  1005  _42:
  1006  	goto _46
  1007  _35:
  1008  	_precision = int32(-1)
  1009  _46:
  1010  	func() {
  1011  		if _precision < int32(-1) {
  1012  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25359), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(237)))
  1013  			crt.X__builtin_abort(tls)
  1014  		}
  1015  	}()
  1016  	if _c != int32(108) {
  1017  		goto _49
  1018  	}
  1019  	_flag_long = uint8(1)
  1020  	_c = int32(*preInc1(&_fmt, 1))
  1021  	if _c == int32(108) {
  1022  		_flag_long = uint8(2)
  1023  		_c = int32(*preInc1(&_fmt, 1))
  1024  	}
  1025  	goto _51
  1026  _49:
  1027  	_flag_long = 0
  1028  _51:
  1029  	_infop = elem4((*Xet_info)(unsafe.Pointer(&_fmtinfo)), 0)
  1030  	_xtype = uint8(17)
  1031  	_idx = int32(0)
  1032  _52:
  1033  	if _idx >= int32(23) {
  1034  		goto _55
  1035  	}
  1036  	if _c == int32(elem4((*Xet_info)(unsafe.Pointer(&_fmtinfo)), uintptr(_idx)).Xfmttype) {
  1037  		_infop = elem4((*Xet_info)(unsafe.Pointer(&_fmtinfo)), uintptr(_idx))
  1038  		_xtype = _infop.Xtype
  1039  		goto _55
  1040  	}
  1041  	_idx += 1
  1042  	goto _52
  1043  _55:
  1044  	switch int32(_xtype) {
  1045  	case int32(0):
  1046  		goto _59
  1047  	case int32(1):
  1048  		goto _62
  1049  	case int32(2):
  1050  		goto _62
  1051  	case int32(3):
  1052  		goto _62
  1053  	case int32(4):
  1054  		goto _65
  1055  	case int32(5):
  1056  		goto _68
  1057  	case int32(6):
  1058  		goto _68
  1059  	case int32(7):
  1060  		goto _66
  1061  	case int32(8):
  1062  		goto _67
  1063  	case int32(9):
  1064  		goto _70
  1065  	case int32(10):
  1066  		goto _70
  1067  	case int32(11):
  1068  		goto _73
  1069  	case int32(12):
  1070  		goto _74
  1071  	case int32(13):
  1072  		goto _58
  1073  	case int32(14):
  1074  		goto _70
  1075  	case int32(15):
  1076  		goto _59
  1077  	case int32(16):
  1078  		goto _61
  1079  	default:
  1080  		goto _75
  1081  	}
  1082  
  1083  _58:
  1084  	_flag_long = uint8(2)
  1085  _59:
  1086  	_cThousand = 0
  1087  _61:
  1088  	if (int32(_infop.Xflags) & int32(1)) == 0 {
  1089  		goto _76
  1090  	}
  1091  	if _bArgList != 0 {
  1092  		_29_v = _getIntArg(tls, _pArgList)
  1093  		goto _82
  1094  	}
  1095  	if _flag_long == 0 {
  1096  		goto _79
  1097  	}
  1098  	if int32(_flag_long) == int32(2) {
  1099  		_29_v = crt.VAInt64(&_ap)
  1100  		goto _81
  1101  	}
  1102  	_29_v = crt.VAInt64(&_ap)
  1103  _81:
  1104  	goto _82
  1105  _79:
  1106  	_29_v = int64(crt.VAInt32(&_ap))
  1107  _82:
  1108  	if _29_v >= (0) {
  1109  		goto _83
  1110  	}
  1111  	if _29_v == int64(-9223372036854775808) {
  1112  		_longvalue = uint64(9223372036854775808)
  1113  		goto _85
  1114  	}
  1115  	_longvalue = uint64(-_29_v)
  1116  _85:
  1117  	_prefix = int8(45)
  1118  	goto _86
  1119  _83:
  1120  	_longvalue = uint64(_29_v)
  1121  	_prefix = int8(_flag_prefix)
  1122  _86:
  1123  	goto _87
  1124  _76:
  1125  	if _bArgList != 0 {
  1126  		_longvalue = uint64(_getIntArg(tls, _pArgList))
  1127  		goto _93
  1128  	}
  1129  	if _flag_long == 0 {
  1130  		goto _90
  1131  	}
  1132  	if int32(_flag_long) == int32(2) {
  1133  		_longvalue = crt.VAUint64(&_ap)
  1134  		goto _92
  1135  	}
  1136  	_longvalue = crt.VAUint64(&_ap)
  1137  _92:
  1138  	goto _93
  1139  _90:
  1140  	_longvalue = uint64(crt.VAUint32(&_ap))
  1141  _93:
  1142  	_prefix = 0
  1143  _87:
  1144  	if _longvalue == (0) {
  1145  		_flag_alternateform = 0
  1146  	}
  1147  	if (_flag_zeropad != 0) && (_precision < (_width - bool2int(int32(_prefix) != int32(0)))) {
  1148  		_precision = _width - bool2int(int32(_prefix) != int32(0))
  1149  	}
  1150  	if _precision < int32(37) {
  1151  		_nOut = int32(70)
  1152  		_zOut = (*int8)(unsafe.Pointer(&_buf))
  1153  		goto _98
  1154  	}
  1155  	_47_n = (uint64(_precision) + uint64(10)) + uint64(_precision/int32(3))
  1156  	_zOut = store1(&_zExtra, (*int8)(_sqlite3Malloc(tls, _47_n)))
  1157  	if _zOut == nil {
  1158  		_setStrAccumError(tls, _pAccum, uint8(1))
  1159  		return
  1160  	}
  1161  	_nOut = int32(_47_n)
  1162  _98:
  1163  	_bufpt = elem1(_zOut, uintptr(_nOut-int32(1)))
  1164  	if int32(_xtype) != int32(15) {
  1165  		goto _100
  1166  	}
  1167  	_49_x = int32(_longvalue % uint64(10))
  1168  	if (_49_x >= int32(4)) || (((_longvalue / uint64(10)) % uint64(10)) == uint64(1)) {
  1169  		_49_x = int32(0)
  1170  	}
  1171  	*preInc1(&_bufpt, -1) = *elem1((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00zOrdØ001)), uintptr((_49_x*int32(2))+int32(1)))
  1172  	*preInc1(&_bufpt, -1) = *elem1((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00zOrdØ001)), uintptr(_49_x*int32(2)))
  1173  _100:
  1174  	_51_cset = elem1((*int8)(unsafe.Pointer(&_aDigits)), uintptr(_infop.Xcharset))
  1175  	_51_base = _infop.Xbase
  1176  _103:
  1177  	*preInc1(&_bufpt, -1) = *elem1(_51_cset, uintptr(_longvalue%uint64(_51_base)))
  1178  	_longvalue = _longvalue / uint64(_51_base)
  1179  	if _longvalue > (0) {
  1180  		goto _103
  1181  	}
  1182  	_length = int32(int64(uintptr(unsafe.Pointer(elem1(_zOut, uintptr(_nOut-int32(1))))) - uintptr(unsafe.Pointer(_bufpt))))
  1183  _104:
  1184  	if _precision > _length {
  1185  		*preInc1(&_bufpt, -1) = int8(48)
  1186  		_length += 1
  1187  		goto _104
  1188  	}
  1189  	if _cThousand == 0 {
  1190  		goto _106
  1191  	}
  1192  	_54_nn = (_length - int32(1)) / int32(3)
  1193  	_54_ix = ((_length - int32(1)) % int32(3)) + int32(1)
  1194  	*(*uintptr)(unsafe.Pointer(&_bufpt)) -= uintptr(_54_nn)
  1195  	_idx = int32(0)
  1196  _107:
  1197  	if _54_nn <= int32(0) {
  1198  		goto _110
  1199  	}
  1200  	*elem1(_bufpt, uintptr(_idx)) = *elem1(_bufpt, uintptr(_idx+_54_nn))
  1201  	_54_ix -= 1
  1202  	if _54_ix == int32(0) {
  1203  		*elem1(_bufpt, uintptr(preInc2(&_idx, 1))) = int8(_cThousand)
  1204  		_54_nn -= 1
  1205  		_54_ix = int32(3)
  1206  	}
  1207  	_idx += 1
  1208  	goto _107
  1209  _110:
  1210  _106:
  1211  	if _prefix != 0 {
  1212  		*preInc1(&_bufpt, -1) = _prefix
  1213  	}
  1214  	if _flag_alternateform == 0 || _infop.Xprefix == 0 {
  1215  		goto _114
  1216  	}
  1217  	_57_pre = elem1((*int8)(unsafe.Pointer(&_aPrefix)), uintptr(_infop.Xprefix))
  1218  _115:
  1219  	if int32(store5(&_57_x, *_57_pre)) == int32(0) {
  1220  		goto _118
  1221  	}
  1222  	*preInc1(&_bufpt, -1) = _57_x
  1223  	*(*uintptr)(unsafe.Pointer(&_57_pre)) += uintptr(1)
  1224  	goto _115
  1225  _118:
  1226  _114:
  1227  	_length = int32(int64(uintptr(unsafe.Pointer(elem1(_zOut, uintptr(_nOut-int32(1))))) - uintptr(unsafe.Pointer(_bufpt))))
  1228  	goto _119
  1229  _62:
  1230  	if _bArgList != 0 {
  1231  		_realvalue = _getDoubleArg(tls, _pArgList)
  1232  		goto _121
  1233  	}
  1234  	_realvalue = crt.VAOther(&_ap).(float64)
  1235  _121:
  1236  	if _precision < int32(0) {
  1237  		_precision = int32(6)
  1238  	}
  1239  	if _realvalue < float64(0) {
  1240  		_realvalue = -_realvalue
  1241  		_prefix = int8(45)
  1242  		goto _124
  1243  	}
  1244  	_prefix = int8(_flag_prefix)
  1245  _124:
  1246  	if (int32(_xtype) == int32(3)) && (_precision > int32(0)) {
  1247  		_precision -= 1
  1248  	}
  1249  	*func() *float64 { _idx = _precision & int32(4095); return &_rounder }() = 0.5
  1250  _127:
  1251  	if _idx <= int32(0) {
  1252  		goto _130
  1253  	}
  1254  	*func() *float64 { _idx -= 1; return &_rounder }() *= 0.1
  1255  	goto _127
  1256  _130:
  1257  	if int32(_xtype) == int32(1) {
  1258  		_realvalue += _rounder
  1259  	}
  1260  	_exp = int32(0)
  1261  	if _sqlite3IsNaN(tls, _realvalue) != 0 {
  1262  		_bufpt = str(253)
  1263  		_length = int32(3)
  1264  		goto _119
  1265  	}
  1266  	if _realvalue <= float64(0) {
  1267  		goto _133
  1268  	}
  1269  	_64_scale = float64(1)
  1270  _134:
  1271  	if (_realvalue >= (float64(1e+100) * _64_scale)) && (_exp <= int32(350)) {
  1272  		_64_scale *= float64(1e+100)
  1273  		_exp += int32(100)
  1274  		goto _134
  1275  	}
  1276  _135:
  1277  	if (_realvalue >= (float64(1e+10) * _64_scale)) && (_exp <= int32(350)) {
  1278  		_64_scale *= float64(1e+10)
  1279  		_exp += int32(10)
  1280  		goto _135
  1281  	}
  1282  _138:
  1283  	if (_realvalue >= (float64(10) * _64_scale)) && (_exp <= int32(350)) {
  1284  		_64_scale *= float64(10)
  1285  		_exp += 1
  1286  		goto _138
  1287  	}
  1288  	_realvalue /= _64_scale
  1289  _143:
  1290  	if _realvalue < float64(1e-08) {
  1291  		_realvalue *= float64(1e+08)
  1292  		_exp -= int32(8)
  1293  		goto _143
  1294  	}
  1295  _144:
  1296  	if _realvalue < float64(1) {
  1297  		_realvalue *= float64(10)
  1298  		_exp -= 1
  1299  		goto _144
  1300  	}
  1301  	if _exp > int32(350) {
  1302  		_bufpt = (*int8)(unsafe.Pointer(&_buf))
  1303  		*elem1((*int8)(unsafe.Pointer(&_buf)), 0) = _prefix
  1304  		crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_buf))+uintptr(bool2int(int32(_prefix) != int32(0)))))), unsafe.Pointer(str(257)), uint64(4))
  1305  		_length = int32(3) + bool2int(int32(_prefix) != int32(0))
  1306  		goto _119
  1307  	}
  1308  _133:
  1309  	_bufpt = (*int8)(unsafe.Pointer(&_buf))
  1310  	if int32(_xtype) == int32(1) {
  1311  		goto _148
  1312  	}
  1313  	_realvalue += _rounder
  1314  	if _realvalue >= float64(10) {
  1315  		_realvalue *= 0.1
  1316  		_exp += 1
  1317  	}
  1318  _148:
  1319  	if int32(_xtype) != int32(3) {
  1320  		goto _150
  1321  	}
  1322  	_flag_rtz = uint8(bool2int(_flag_alternateform == 0))
  1323  	if (_exp < int32(-4)) || (_exp > _precision) {
  1324  		_xtype = uint8(2)
  1325  		goto _153
  1326  	}
  1327  	_precision = _precision - _exp
  1328  	_xtype = uint8(1)
  1329  _153:
  1330  	goto _154
  1331  _150:
  1332  	_flag_rtz = _flag_altform2
  1333  _154:
  1334  	if int32(_xtype) == int32(2) {
  1335  		_e2 = int32(0)
  1336  		goto _156
  1337  	}
  1338  	_e2 = _exp
  1339  _156:
  1340  	if ((int64(func() int32 {
  1341  		if _e2 > int32(0) {
  1342  			return _e2
  1343  		}
  1344  		return int32(0)
  1345  	}()) + int64(_precision)) + int64(_width)) <= int64(55) {
  1346  		goto _159
  1347  	}
  1348  	_bufpt = store1(&_zExtra, (*int8)(_sqlite3Malloc(tls, uint64(((int64(func() int32 {
  1349  		if _e2 > int32(0) {
  1350  			return _e2
  1351  		}
  1352  		return int32(0)
  1353  	}())+int64(_precision))+int64(_width))+int64(15)))))
  1354  	if _bufpt == nil {
  1355  		_setStrAccumError(tls, _pAccum, uint8(1))
  1356  		return
  1357  	}
  1358  _159:
  1359  	_zOut = _bufpt
  1360  	_nsd = int32(16) + (int32(_flag_altform2) * int32(10))
  1361  	_flag_dp = uint8((func() int32 {
  1362  		if _precision > int32(0) {
  1363  			return int32(1)
  1364  		}
  1365  		return int32(0)
  1366  	}() | int32(_flag_alternateform)) | int32(_flag_altform2))
  1367  	if _prefix != 0 {
  1368  		*postInc1(&_bufpt, 1) = _prefix
  1369  	}
  1370  	if _e2 < int32(0) {
  1371  		*postInc1(&_bufpt, 1) = int8(48)
  1372  		goto _167
  1373  	}
  1374  _168:
  1375  	if _e2 < int32(0) {
  1376  		goto _171
  1377  	}
  1378  	*postInc1(&_bufpt, 1) = _et_getdigit(tls, &_realvalue, &_nsd)
  1379  	_e2 -= 1
  1380  	goto _168
  1381  _171:
  1382  _167:
  1383  	if _flag_dp != 0 {
  1384  		*postInc1(&_bufpt, 1) = int8(46)
  1385  	}
  1386  	_e2 += 1
  1387  _173:
  1388  	if _e2 >= int32(0) {
  1389  		goto _176
  1390  	}
  1391  	func() {
  1392  		if _precision <= int32(0) {
  1393  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25616), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(261)))
  1394  			crt.X__builtin_abort(tls)
  1395  		}
  1396  	}()
  1397  	*postInc1(&_bufpt, 1) = int8(48)
  1398  	*func() *int32 { _precision -= 1; return &_e2 }() += 1
  1399  	goto _173
  1400  _176:
  1401  	if postInc2(&_precision, -1) > int32(0) {
  1402  		*postInc1(&_bufpt, 1) = _et_getdigit(tls, &_realvalue, &_nsd)
  1403  		goto _176
  1404  	}
  1405  	if _flag_rtz == 0 || _flag_dp == 0 {
  1406  		goto _182
  1407  	}
  1408  _183:
  1409  	if int32(*elem1(_bufpt, uintptr(18446744073709551615))) == int32(48) {
  1410  		*preInc1(&_bufpt, -1) = 0
  1411  		goto _183
  1412  	}
  1413  	func() {
  1414  		if crt.P2U(unsafe.Pointer(_bufpt)) <= crt.P2U(unsafe.Pointer(_zOut)) {
  1415  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25626), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(273)))
  1416  			crt.X__builtin_abort(tls)
  1417  		}
  1418  	}()
  1419  	if int32(*elem1(_bufpt, uintptr(18446744073709551615))) != int32(46) {
  1420  		goto _187
  1421  	}
  1422  	if _flag_altform2 != 0 {
  1423  		*postInc1(&_bufpt, 1) = int8(48)
  1424  		goto _189
  1425  	}
  1426  	*preInc1(&_bufpt, -1) = 0
  1427  _189:
  1428  _187:
  1429  _182:
  1430  	if int32(_xtype) != int32(2) {
  1431  		goto _190
  1432  	}
  1433  	*postInc1(&_bufpt, 1) = *elem1((*int8)(unsafe.Pointer(&_aDigits)), uintptr(_infop.Xcharset))
  1434  	if _exp < int32(0) {
  1435  		*postInc1(&_bufpt, 1) = int8(45)
  1436  		_exp = -_exp
  1437  		goto _192
  1438  	}
  1439  	*postInc1(&_bufpt, 1) = int8(43)
  1440  _192:
  1441  	if _exp >= int32(100) {
  1442  		*postInc1(&_bufpt, 1) = int8((_exp / int32(100)) + int32(48))
  1443  		_exp %= int32(100)
  1444  	}
  1445  	*postInc1(&_bufpt, 1) = int8((_exp / int32(10)) + int32(48))
  1446  	*postInc1(&_bufpt, 1) = int8((_exp % int32(10)) + int32(48))
  1447  _190:
  1448  	*_bufpt = 0
  1449  	_length = int32(int64(uintptr(unsafe.Pointer(_bufpt)) - uintptr(unsafe.Pointer(_zOut))))
  1450  	_bufpt = _zOut
  1451  	if _flag_zeropad == 0 || _flag_leftjustify != 0 || _length >= _width {
  1452  		goto _196
  1453  	}
  1454  	_96_nPad = _width - _length
  1455  	_96_i = _width
  1456  _197:
  1457  	if _96_i < _96_nPad {
  1458  		goto _200
  1459  	}
  1460  	*elem1(_bufpt, uintptr(_96_i)) = *elem1(_bufpt, uintptr(_96_i-_96_nPad))
  1461  	_96_i -= 1
  1462  	goto _197
  1463  _200:
  1464  	_96_i = bool2int(int32(_prefix) != int32(0))
  1465  _201:
  1466  	if postInc2(&_96_nPad, -1) != 0 {
  1467  		*elem1(_bufpt, uintptr(postInc2(&_96_i, 1))) = int8(48)
  1468  		goto _201
  1469  	}
  1470  	_length = _width
  1471  _196:
  1472  	goto _119
  1473  _65:
  1474  	if _bArgList == 0 {
  1475  		*(*int32)(crt.VAPointer(&_ap)) = int32(_pAccum.XnChar)
  1476  	}
  1477  	_length = store2(&_width, int32(0))
  1478  	goto _119
  1479  _66:
  1480  	*elem1((*int8)(unsafe.Pointer(&_buf)), 0) = int8(37)
  1481  	_bufpt = (*int8)(unsafe.Pointer(&_buf))
  1482  	_length = int32(1)
  1483  	goto _119
  1484  _67:
  1485  	if _bArgList != 0 {
  1486  		_bufpt = _getTextArg(tls, _pArgList)
  1487  		_c = func() int32 {
  1488  			if _bufpt != nil {
  1489  				return int32(*elem1(_bufpt, 0))
  1490  			}
  1491  			return int32(0)
  1492  		}()
  1493  		goto _207
  1494  	}
  1495  	_c = crt.VAInt32(&_ap)
  1496  _207:
  1497  	if _precision <= int32(1) {
  1498  		goto _208
  1499  	}
  1500  	_width -= _precision - int32(1)
  1501  	if (_width > int32(1)) && (_flag_leftjustify == 0) {
  1502  		_sqlite3AppendChar(tls, _pAccum, _width-int32(1), int8(32))
  1503  		_width = int32(0)
  1504  	}
  1505  	_sqlite3AppendChar(tls, _pAccum, _precision-int32(1), int8(_c))
  1506  _208:
  1507  	_length = int32(1)
  1508  	*elem1((*int8)(unsafe.Pointer(&_buf)), 0) = int8(_c)
  1509  	_bufpt = (*int8)(unsafe.Pointer(&_buf))
  1510  	goto _119
  1511  _68:
  1512  	if _bArgList != 0 {
  1513  		_bufpt = _getTextArg(tls, _pArgList)
  1514  		_xtype = uint8(5)
  1515  		goto _212
  1516  	}
  1517  	_bufpt = (*int8)(crt.VAPointer(&_ap))
  1518  _212:
  1519  	if _bufpt == nil {
  1520  		_bufpt = str(284)
  1521  		goto _215
  1522  	}
  1523  	if int32(_xtype) == int32(6) {
  1524  		_zExtra = _bufpt
  1525  	}
  1526  _215:
  1527  	if _precision < int32(0) {
  1528  		goto _216
  1529  	}
  1530  	_length = int32(0)
  1531  _217:
  1532  	if _length >= _precision || (*elem1(_bufpt, uintptr(_length))) == 0 {
  1533  		goto _221
  1534  	}
  1535  	_length += 1
  1536  	goto _217
  1537  _221:
  1538  	goto _222
  1539  _216:
  1540  	_length = _sqlite3Strlen30(tls, _bufpt)
  1541  _222:
  1542  	goto _119
  1543  _70:
  1544  	_110_q = int8(func() int32 {
  1545  		if int32(_xtype) == int32(14) {
  1546  			return int32(34)
  1547  		}
  1548  		return int32(39)
  1549  	}())
  1550  	if _bArgList != 0 {
  1551  		_110_escarg = _getTextArg(tls, _pArgList)
  1552  		goto _226
  1553  	}
  1554  	_110_escarg = (*int8)(crt.VAPointer(&_ap))
  1555  _226:
  1556  	_110_isnull = bool2int(_110_escarg == nil)
  1557  	if _110_isnull != 0 {
  1558  		_110_escarg = func() *int8 {
  1559  			if int32(_xtype) == int32(10) {
  1560  				return str(285)
  1561  			}
  1562  			return str(290)
  1563  		}()
  1564  	}
  1565  	_110_k = _precision
  1566  	_110_i = store2(&_110_n, int32(0))
  1567  _230:
  1568  	if _110_k == int32(0) || int32(store5(&_110_ch, *elem1(_110_escarg, uintptr(_110_i)))) == int32(0) {
  1569  		goto _234
  1570  	}
  1571  	if int32(_110_ch) == int32(_110_q) {
  1572  		_110_n += 1
  1573  	}
  1574  	*func() *int32 { _110_i += 1; return &_110_k }() -= 1
  1575  	goto _230
  1576  _234:
  1577  	_110_needQuote = bool2int((_110_isnull == 0) && (int32(_xtype) == int32(10)))
  1578  	_110_n += _110_i + int32(3)
  1579  	if _110_n <= int32(70) {
  1580  		goto _237
  1581  	}
  1582  	_bufpt = store1(&_zExtra, (*int8)(_sqlite3Malloc(tls, uint64(_110_n))))
  1583  	if _bufpt == nil {
  1584  		_setStrAccumError(tls, _pAccum, uint8(1))
  1585  		return
  1586  	}
  1587  	goto _239
  1588  _237:
  1589  	_bufpt = (*int8)(unsafe.Pointer(&_buf))
  1590  _239:
  1591  	_110_j = int32(0)
  1592  	if _110_needQuote != 0 {
  1593  		*elem1(_bufpt, uintptr(postInc2(&_110_j, 1))) = _110_q
  1594  	}
  1595  	_110_k = _110_i
  1596  	_110_i = int32(0)
  1597  _241:
  1598  	if _110_i >= _110_k {
  1599  		goto _244
  1600  	}
  1601  	*elem1(_bufpt, uintptr(postInc2(&_110_j, 1))) = store5(&_110_ch, *elem1(_110_escarg, uintptr(_110_i)))
  1602  	if int32(_110_ch) == int32(_110_q) {
  1603  		*elem1(_bufpt, uintptr(postInc2(&_110_j, 1))) = _110_ch
  1604  	}
  1605  	_110_i += 1
  1606  	goto _241
  1607  _244:
  1608  	if _110_needQuote != 0 {
  1609  		*elem1(_bufpt, uintptr(postInc2(&_110_j, 1))) = _110_q
  1610  	}
  1611  	*elem1(_bufpt, uintptr(_110_j)) = 0
  1612  	_length = _110_j
  1613  	goto _119
  1614  _73:
  1615  	if (int32(_pAccum.XprintfFlags) & int32(1)) == int32(0) {
  1616  		return
  1617  	}
  1618  	_118_pToken = (*XToken)(crt.VAPointer(&_ap))
  1619  	func() {
  1620  		if int32(_bArgList) != int32(0) {
  1621  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25771), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(297)))
  1622  			crt.X__builtin_abort(tls)
  1623  		}
  1624  	}()
  1625  	if (_118_pToken != nil) && (_118_pToken.Xn != 0) {
  1626  		_sqlite3StrAccumAppend(tls, _pAccum, _118_pToken.Xz, int32(_118_pToken.Xn))
  1627  	}
  1628  	_length = store2(&_width, int32(0))
  1629  	goto _119
  1630  _74:
  1631  	if (int32(_pAccum.XprintfFlags) & int32(1)) == int32(0) {
  1632  		return
  1633  	}
  1634  	_120_pSrc = (*XSrcList)(crt.VAPointer(&_ap))
  1635  	_120_k = crt.VAInt32(&_ap)
  1636  	_120_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_120_pSrc.Xa)), uintptr(_120_k))
  1637  	func() {
  1638  		if int32(_bArgList) != int32(0) {
  1639  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25786), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(297)))
  1640  			crt.X__builtin_abort(tls)
  1641  		}
  1642  	}()
  1643  	func() {
  1644  		if _120_k < int32(0) || _120_k >= _120_pSrc.XnSrc {
  1645  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25787), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(309)))
  1646  			crt.X__builtin_abort(tls)
  1647  		}
  1648  	}()
  1649  	if _120_pItem.XzDatabase != nil {
  1650  		_sqlite3StrAccumAppendAll(tls, _pAccum, _120_pItem.XzDatabase)
  1651  		_sqlite3StrAccumAppend(tls, _pAccum, str(330), int32(1))
  1652  	}
  1653  	_sqlite3StrAccumAppendAll(tls, _pAccum, _120_pItem.XzName)
  1654  	_length = store2(&_width, int32(0))
  1655  	goto _119
  1656  _75:
  1657  	func() {
  1658  		if int32(_xtype) != int32(17) {
  1659  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25797), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(332)))
  1660  			crt.X__builtin_abort(tls)
  1661  		}
  1662  	}()
  1663  	return
  1664  _119:
  1665  	_width -= _length
  1666  	if _width <= int32(0) {
  1667  		goto _261
  1668  	}
  1669  	if _flag_leftjustify == 0 {
  1670  		_sqlite3AppendChar(tls, _pAccum, _width, int8(32))
  1671  	}
  1672  	_sqlite3StrAccumAppend(tls, _pAccum, _bufpt, _length)
  1673  	if _flag_leftjustify != 0 {
  1674  		_sqlite3AppendChar(tls, _pAccum, _width, int8(32))
  1675  	}
  1676  	goto _264
  1677  _261:
  1678  	_sqlite3StrAccumAppend(tls, _pAccum, _bufpt, _length)
  1679  _264:
  1680  	if _zExtra != nil {
  1681  		_sqlite3DbFree(tls, (*Xsqlite3)(_pAccum.Xdb), unsafe.Pointer(_zExtra))
  1682  		_zExtra = nil
  1683  	}
  1684  	*(*uintptr)(unsafe.Pointer(&_fmt)) += uintptr(1)
  1685  	goto _1
  1686  _5:
  1687  	_ = _buf
  1688  }
  1689  
  1690  // C comment
  1691  //  /*
  1692  //  ** Append N bytes of text from z to the StrAccum object.  Increase the
  1693  //  ** size of the memory allocation for StrAccum if necessary.
  1694  //  */
  1695  func _sqlite3StrAccumAppend(tls *crt.TLS, _p *XStrAccum, _z *int8, _N int32) {
  1696  	func() {
  1697  		if _z == nil && _N != int32(0) {
  1698  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25912), unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000), unsafe.Pointer(str(349)))
  1699  			crt.X__builtin_abort(tls)
  1700  		}
  1701  	}()
  1702  	func() {
  1703  		if _p.XzText == nil && _p.XnChar != (0) && _p.XaccError == 0 {
  1704  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25913), unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000), unsafe.Pointer(str(362)))
  1705  			crt.X__builtin_abort(tls)
  1706  		}
  1707  	}()
  1708  	func() {
  1709  		if _N < int32(0) {
  1710  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25914), unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000), unsafe.Pointer(str(404)))
  1711  			crt.X__builtin_abort(tls)
  1712  		}
  1713  	}()
  1714  	func() {
  1715  		if int32(_p.XaccError) != int32(0) && _p.XnAlloc != (0) {
  1716  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25915), unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000), unsafe.Pointer(str(409)))
  1717  			crt.X__builtin_abort(tls)
  1718  		}
  1719  	}()
  1720  	if (_p.XnChar + uint32(_N)) >= _p.XnAlloc {
  1721  		_enlargeAndAppend(tls, _p, _z, _N)
  1722  		goto _14
  1723  	}
  1724  	if _N != 0 {
  1725  		func() {
  1726  			if _p.XzText == nil {
  1727  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25919), unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000), unsafe.Pointer(str(440)))
  1728  				crt.X__builtin_abort(tls)
  1729  			}
  1730  		}()
  1731  		_p.XnChar += uint32(_N)
  1732  		crt.Xmemcpy(tls, unsafe.Pointer(elem1(_p.XzText, uintptr(_p.XnChar-uint32(_N)))), unsafe.Pointer(_z), uint64(_N))
  1733  	}
  1734  _14:
  1735  }
  1736  
  1737  var _sqlite3StrAccumAppendØ00__func__Ø000 [22]int8
  1738  
  1739  func init() {
  1740  	crt.Xstrncpy(nil, &_sqlite3StrAccumAppendØ00__func__Ø000[0], str(449), 22)
  1741  }
  1742  
  1743  // C comment
  1744  //  /*
  1745  //  ** The StrAccum "p" is not large enough to accept N new bytes of z[].
  1746  //  ** So enlarge if first, then do the append.
  1747  //  **
  1748  //  ** This is a helper routine to sqlite3StrAccumAppend() that does special-case
  1749  //  ** work (enlarging the buffer) using tail recursion, so that the
  1750  //  ** sqlite3StrAccumAppend() routine can use fast calling semantics.
  1751  //  */
  1752  func _enlargeAndAppend(tls *crt.TLS, _p *XStrAccum, _z *int8, _N int32) {
  1753  	_N = _sqlite3StrAccumEnlarge(tls, _p, _N)
  1754  	if _N > int32(0) {
  1755  		crt.Xmemcpy(tls, unsafe.Pointer(elem1(_p.XzText, uintptr(_p.XnChar))), unsafe.Pointer(_z), uint64(_N))
  1756  		_p.XnChar += uint32(_N)
  1757  	}
  1758  	func() {
  1759  		if ((_p.XzText == nil) || (_p.XzText == _p.XzBase)) != ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
  1760  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25904), unsafe.Pointer(&_enlargeAndAppendØ00__func__Ø000), unsafe.Pointer(str(471)))
  1761  			crt.X__builtin_abort(tls)
  1762  		}
  1763  	}()
  1764  }
  1765  
  1766  // C comment
  1767  //  /*
  1768  //  ** Enlarge the memory allocation on a StrAccum object so that it is
  1769  //  ** able to accept at least N more bytes of text.
  1770  //  **
  1771  //  ** Return the number of bytes of text that StrAccum is able to accept
  1772  //  ** after the attempted enlargement.  The value returned might be zero.
  1773  //  */
  1774  func _sqlite3StrAccumEnlarge(tls *crt.TLS, _p *XStrAccum, _N int32) (r0 int32) {
  1775  	var _3_szNew int64
  1776  	var _zNew, _3_zOld *int8
  1777  	func() {
  1778  		if (int64(_p.XnChar) + int64(_N)) < int64(_p.XnAlloc) {
  1779  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25831), unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000), unsafe.Pointer(str(523)))
  1780  			crt.X__builtin_abort(tls)
  1781  		}
  1782  	}()
  1783  	if _p.XaccError != 0 {
  1784  		return int32(0)
  1785  	}
  1786  	if _p.XmxAlloc == (0) {
  1787  		_N = int32((_p.XnAlloc - _p.XnChar) - uint32(1))
  1788  		_setStrAccumError(tls, _p, uint8(2))
  1789  		return _N
  1790  	}
  1791  	_3_zOld = func() *int8 {
  1792  		if (int32(_p.XprintfFlags) & int32(4)) != int32(0) {
  1793  			return _p.XzText
  1794  		}
  1795  		return nil
  1796  	}()
  1797  	_3_szNew = int64(_p.XnChar)
  1798  	func() {
  1799  		if ((_p.XzText == nil) || (_p.XzText == _p.XzBase)) != ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
  1800  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25844), unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000), unsafe.Pointer(str(471)))
  1801  			crt.X__builtin_abort(tls)
  1802  		}
  1803  	}()
  1804  	_3_szNew += int64(_N + int32(1))
  1805  	if (_3_szNew + int64(_p.XnChar)) <= int64(_p.XmxAlloc) {
  1806  		_3_szNew += int64(_p.XnChar)
  1807  	}
  1808  	if _3_szNew > int64(_p.XmxAlloc) {
  1809  		_sqlite3StrAccumReset(tls, _p)
  1810  		_setStrAccumError(tls, _p, uint8(2))
  1811  		return int32(0)
  1812  	}
  1813  	_p.XnAlloc = uint32(int32(_3_szNew))
  1814  	if _p.Xdb != nil {
  1815  		_zNew = (*int8)(_sqlite3DbRealloc(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_3_zOld), uint64(_p.XnAlloc)))
  1816  		goto _14
  1817  	}
  1818  	_zNew = (*int8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_3_zOld), uint64(_p.XnAlloc)))
  1819  _14:
  1820  	if _zNew == nil {
  1821  		goto _15
  1822  	}
  1823  	func() {
  1824  		if _p.XzText == nil && _p.XnChar != (0) {
  1825  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25864), unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000), unsafe.Pointer(str(552)))
  1826  			crt.X__builtin_abort(tls)
  1827  		}
  1828  	}()
  1829  	if ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) && (_p.XnChar > (0)) {
  1830  		crt.Xmemcpy(tls, unsafe.Pointer(_zNew), unsafe.Pointer(_p.XzText), uint64(_p.XnChar))
  1831  	}
  1832  	_p.XzText = _zNew
  1833  	_p.XnAlloc = uint32(_sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_zNew)))
  1834  	{
  1835  		p := &_p.XprintfFlags
  1836  		*p = uint8(int32(*p) | int32(4))
  1837  	}
  1838  	goto _21
  1839  _15:
  1840  	_sqlite3StrAccumReset(tls, _p)
  1841  	_setStrAccumError(tls, _p, uint8(1))
  1842  	return int32(0)
  1843  
  1844  _21:
  1845  	return _N
  1846  }
  1847  
  1848  var _sqlite3StrAccumEnlargeØ00__func__Ø000 [23]int8
  1849  
  1850  func init() {
  1851  	crt.Xstrncpy(nil, &_sqlite3StrAccumEnlargeØ00__func__Ø000[0], str(579), 23)
  1852  }
  1853  
  1854  // C comment
  1855  //  /*
  1856  //  ** Set the StrAccum object to an error mode.
  1857  //  */
  1858  func _setStrAccumError(tls *crt.TLS, _p *XStrAccum, _eError uint8) {
  1859  	func() {
  1860  		if int32(_eError) != int32(1) && int32(_eError) != int32(2) {
  1861  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25196), unsafe.Pointer(&_setStrAccumErrorØ00__func__Ø000), unsafe.Pointer(str(602)))
  1862  			crt.X__builtin_abort(tls)
  1863  		}
  1864  	}()
  1865  	_p.XaccError = _eError
  1866  	_p.XnAlloc = 0
  1867  }
  1868  
  1869  var _setStrAccumErrorØ00__func__Ø000 [17]int8
  1870  
  1871  func init() {
  1872  	crt.Xstrncpy(nil, &_setStrAccumErrorØ00__func__Ø000[0], str(652), 17)
  1873  }
  1874  
  1875  // C comment
  1876  //  /*
  1877  //  ** Reset an StrAccum string.  Reclaim all malloced memory.
  1878  //  */
  1879  func _sqlite3StrAccumReset(tls *crt.TLS, _p *XStrAccum) {
  1880  	func() {
  1881  		if ((_p.XzText == nil) || (_p.XzText == _p.XzBase)) != ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
  1882  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25964), unsafe.Pointer(&_sqlite3StrAccumResetØ00__func__Ø000), unsafe.Pointer(str(471)))
  1883  			crt.X__builtin_abort(tls)
  1884  		}
  1885  	}()
  1886  	if (int32(_p.XprintfFlags) & int32(4)) != int32(0) {
  1887  		_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p.XzText))
  1888  		{
  1889  			p := &_p.XprintfFlags
  1890  			*p = uint8(int32(*p) & int32(-5))
  1891  		}
  1892  	}
  1893  	_p.XzText = nil
  1894  }
  1895  
  1896  var _sqlite3StrAccumResetØ00__func__Ø000 [21]int8
  1897  
  1898  func init() {
  1899  	crt.Xstrncpy(nil, &_sqlite3StrAccumResetØ00__func__Ø000[0], str(669), 21)
  1900  }
  1901  
  1902  func _sqlite3DbFree(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) {
  1903  	func() {
  1904  		if _db != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
  1905  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24721), unsafe.Pointer(&_sqlite3DbFreeØ00__func__Ø000), unsafe.Pointer(str(690)))
  1906  			crt.X__builtin_abort(tls)
  1907  		}
  1908  	}()
  1909  	if _p != nil {
  1910  		_sqlite3DbFreeNN(tls, _db, _p)
  1911  	}
  1912  }
  1913  
  1914  // C comment
  1915  //  /*
  1916  //  ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
  1917  //  ** intended for use inside assert() statements.
  1918  //  */
  1919  func Xsqlite3_mutex_held(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
  1920  	func() {
  1921  		if _p != nil && (_sqlite3Config.Xmutex.XxMutexHeld) == nil {
  1922  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22902), unsafe.Pointer(&_sqlite3_mutex_heldØ00__func__Ø000), unsafe.Pointer(str(729)))
  1923  			crt.X__builtin_abort(tls)
  1924  		}
  1925  	}()
  1926  	return bool2int((_p == nil) || func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
  1927  		v := _sqlite3Config.Xmutex.XxMutexHeld
  1928  		return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
  1929  	}()(tls, _p) != 0)
  1930  }
  1931  
  1932  var _sqlite3_mutex_heldØ00__func__Ø000 [19]int8
  1933  
  1934  func init() {
  1935  	crt.Xstrncpy(nil, &_sqlite3_mutex_heldØ00__func__Ø000[0], str(774), 19)
  1936  }
  1937  
  1938  var _sqlite3DbFreeØ00__func__Ø000 [14]int8
  1939  
  1940  func init() {
  1941  	crt.Xstrncpy(nil, &_sqlite3DbFreeØ00__func__Ø000[0], str(793), 14)
  1942  }
  1943  
  1944  // C comment
  1945  //  /*
  1946  //  ** Free memory that might be associated with a particular database
  1947  //  ** connection.  Calling sqlite3DbFree(D,X) for X==0 is a harmless no-op.
  1948  //  ** The sqlite3DbFreeNN(D,X) version requires that X be non-NULL.
  1949  //  */
  1950  func _sqlite3DbFreeNN(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) {
  1951  	var _3_pBuf *XScratchFreeslot
  1952  	func() {
  1953  		if _db != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
  1954  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24695), unsafe.Pointer(&_sqlite3DbFreeNNØ00__func__Ø000), unsafe.Pointer(str(690)))
  1955  			crt.X__builtin_abort(tls)
  1956  		}
  1957  	}()
  1958  	func() {
  1959  		if _p == nil {
  1960  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24696), unsafe.Pointer(&_sqlite3DbFreeNNØ00__func__Ø000), unsafe.Pointer(str(807)))
  1961  			crt.X__builtin_abort(tls)
  1962  		}
  1963  	}()
  1964  	if _db == nil {
  1965  		goto _5
  1966  	}
  1967  	if _db.XpnBytesFreed != nil {
  1968  		_measureAllocationSize(tls, _db, _p)
  1969  		return
  1970  	}
  1971  	if _isLookaside(tls, _db, _p) != 0 {
  1972  		_3_pBuf = (*XScratchFreeslot)(_p)
  1973  		crt.Xmemset(tls, _p, int32(170), uint64(_db.Xlookaside.Xsz))
  1974  		*(**XScratchFreeslot)(unsafe.Pointer(&_3_pBuf.XpNext)) = (*XScratchFreeslot)(_db.Xlookaside.XpFree)
  1975  		*(**XScratchFreeslot)(unsafe.Pointer(&(_db.Xlookaside.XpFree))) = _3_pBuf
  1976  		_db.Xlookaside.XnOut -= 1
  1977  		return
  1978  	}
  1979  _5:
  1980  
  1981  	func() {
  1982  		if _db == nil && int32(1) == 0 {
  1983  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24716), unsafe.Pointer(&_sqlite3DbFreeNNØ00__func__Ø000), unsafe.Pointer(str(812)))
  1984  			crt.X__builtin_abort(tls)
  1985  		}
  1986  	}()
  1987  	Xsqlite3_free(tls, _p)
  1988  }
  1989  
  1990  var _sqlite3DbFreeNNØ00__func__Ø000 [16]int8
  1991  
  1992  func init() {
  1993  	crt.Xstrncpy(nil, &_sqlite3DbFreeNNØ00__func__Ø000[0], str(865), 16)
  1994  }
  1995  
  1996  // C comment
  1997  //  /*
  1998  //  ** Add the size of memory allocation "p" to the count in
  1999  //  ** *db->pnBytesFreed.
  2000  //  */
  2001  func _measureAllocationSize(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) {
  2002  	*_db.XpnBytesFreed += _sqlite3DbMallocSize(tls, _db, _p)
  2003  }
  2004  
  2005  func _sqlite3DbMallocSize(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) (r0 int32) {
  2006  	func() {
  2007  		if _p == nil {
  2008  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24640), unsafe.Pointer(&_sqlite3DbMallocSizeØ00__func__Ø000), unsafe.Pointer(str(807)))
  2009  			crt.X__builtin_abort(tls)
  2010  		}
  2011  	}()
  2012  	if _db != nil && _isLookaside(tls, _db, _p) != 0 {
  2013  		goto _3
  2014  	}
  2015  	if _db == nil {
  2016  		goto _5
  2017  	}
  2018  
  2019  _5:
  2020  	return (_sqlite3Config.Xm.XxSize)(tls, _p)
  2021  
  2022  _3:
  2023  	func() {
  2024  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
  2025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24653), unsafe.Pointer(&_sqlite3DbMallocSizeØ00__func__Ø000), unsafe.Pointer(str(881)))
  2026  			crt.X__builtin_abort(tls)
  2027  		}
  2028  	}()
  2029  	return int32(_db.Xlookaside.Xsz)
  2030  }
  2031  
  2032  var _sqlite3DbMallocSizeØ00__func__Ø000 [20]int8
  2033  
  2034  func init() {
  2035  	crt.Xstrncpy(nil, &_sqlite3DbMallocSizeØ00__func__Ø000[0], str(911), 20)
  2036  }
  2037  
  2038  func _isLookaside(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) (r0 int32) {
  2039  	return bool2int((uint64(crt.P2U(_p)) >= uint64(crt.P2U(_db.Xlookaside.XpStart))) && (uint64(crt.P2U(_p)) < uint64(crt.P2U(_db.Xlookaside.XpEnd))))
  2040  }
  2041  
  2042  // C comment
  2043  //  /*
  2044  //  ** Free memory previously obtained from sqlite3Malloc().
  2045  //  */
  2046  func Xsqlite3_free(tls *crt.TLS, _p unsafe.Pointer) {
  2047  	if _p == nil {
  2048  		return
  2049  	}
  2050  
  2051  	if _sqlite3Config.XbMemstat != 0 {
  2052  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2053  		_sqlite3StatusDown(tls, int32(0), _sqlite3MallocSize(tls, _p))
  2054  		_sqlite3StatusDown(tls, int32(9), int32(1))
  2055  		(_sqlite3Config.Xm.XxFree)(tls, _p)
  2056  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2057  		goto _2
  2058  	}
  2059  	(_sqlite3Config.Xm.XxFree)(tls, _p)
  2060  _2:
  2061  }
  2062  
  2063  // C comment
  2064  //  /*
  2065  //  ** Obtain the mutex p. If some other thread already has the mutex, block
  2066  //  ** until it can be obtained.
  2067  //  */
  2068  func Xsqlite3_mutex_enter(tls *crt.TLS, _p *Xsqlite3_mutex) {
  2069  	if _p != nil {
  2070  		func() {
  2071  			if (_sqlite3Config.Xmutex.XxMutexEnter) == nil {
  2072  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22865), unsafe.Pointer(&_sqlite3_mutex_enterØ00__func__Ø000), unsafe.Pointer(str(931)))
  2073  				crt.X__builtin_abort(tls)
  2074  			}
  2075  		}()
  2076  		func() func(*crt.TLS, *Xsqlite3_mutex) {
  2077  			v := _sqlite3Config.Xmutex.XxMutexEnter
  2078  			return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
  2079  		}()(tls, _p)
  2080  	}
  2081  }
  2082  
  2083  var _sqlite3_mutex_enterØ00__func__Ø000 [20]int8
  2084  
  2085  func init() {
  2086  	crt.Xstrncpy(nil, &_sqlite3_mutex_enterØ00__func__Ø000[0], str(969), 20)
  2087  }
  2088  
  2089  // C comment
  2090  //  /*
  2091  //  ** State information local to the memory allocation subsystem.
  2092  //  */
  2093  var _mem0 TMem0Global
  2094  
  2095  func _sqlite3StatusDown(tls *crt.TLS, _op int32, _N int32) {
  2096  	func() {
  2097  		if _N < int32(0) {
  2098  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18574), unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000), unsafe.Pointer(str(404)))
  2099  			crt.X__builtin_abort(tls)
  2100  		}
  2101  	}()
  2102  	func() {
  2103  		if _op < int32(0) || _op >= int32(10) {
  2104  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18575), unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000), unsafe.Pointer(str(989)))
  2105  			crt.X__builtin_abort(tls)
  2106  		}
  2107  	}()
  2108  	func() {
  2109  		if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
  2110  			if (*elem1((*int8)(unsafe.Pointer(&_statMutex)), uintptr(_op))) != 0 {
  2111  				return _sqlite3Pcache1Mutex(tls)
  2112  			}
  2113  			return _sqlite3MallocMutex(tls)
  2114  		}()) == 0 {
  2115  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18576), unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000), unsafe.Pointer(str(1022)))
  2116  			crt.X__builtin_abort(tls)
  2117  		}
  2118  	}()
  2119  	func() {
  2120  		if _op < int32(0) || _op >= int32(10) {
  2121  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18578), unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000), unsafe.Pointer(str(1103)))
  2122  			crt.X__builtin_abort(tls)
  2123  		}
  2124  	}()
  2125  	*elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op)) -= int64(_N)
  2126  }
  2127  
  2128  var _sqlite3StatusDownØ00__func__Ø000 [18]int8
  2129  
  2130  func init() {
  2131  	crt.Xstrncpy(nil, &_sqlite3StatusDownØ00__func__Ø000[0], str(1143), 18)
  2132  }
  2133  
  2134  // C comment
  2135  //  /*
  2136  //  ** Elements of sqlite3Stat[] are protected by either the memory allocator
  2137  //  ** mutex, or by the pcache1 mutex.  The following array determines which.
  2138  //  */
  2139  var _statMutex [10]int8
  2140  
  2141  func init() {
  2142  	_statMutex = [10]int8{0, 1, 1, 0, 0, 0, 0, 1, 0, 0}
  2143  }
  2144  
  2145  // C comment
  2146  //  /*
  2147  //  ** Return the global mutex used by this PCACHE implementation.  The
  2148  //  ** sqlite3_status() routine needs access to this mutex.
  2149  //  */
  2150  func _sqlite3Pcache1Mutex(tls *crt.TLS) (r0 *Xsqlite3_mutex) {
  2151  	return (*Xsqlite3_mutex)(_pcache1_g.Xmutex)
  2152  }
  2153  
  2154  // C comment
  2155  //  /*
  2156  //  ** Global data used by this cache.
  2157  //  */
  2158  var _pcache1_g TPCacheGlobal
  2159  
  2160  // C comment
  2161  //  /*
  2162  //  ** Return the memory allocator mutex. sqlite3_status() needs it.
  2163  //  */
  2164  func _sqlite3MallocMutex(tls *crt.TLS) (r0 *Xsqlite3_mutex) {
  2165  	return (*Xsqlite3_mutex)(_mem0.Xmutex)
  2166  }
  2167  
  2168  var _sqlite3Stat Tsqlite3StatType
  2169  
  2170  // C comment
  2171  //  /*
  2172  //  ** Return the size of a memory allocation previously obtained from
  2173  //  ** sqlite3Malloc() or sqlite3_malloc().
  2174  //  */
  2175  func _sqlite3MallocSize(tls *crt.TLS, _p unsafe.Pointer) (r0 int32) {
  2176  	return (_sqlite3Config.Xm.XxSize)(tls, _p)
  2177  }
  2178  
  2179  // C comment
  2180  //  /*
  2181  //  ** The sqlite3_mutex_leave() routine exits a mutex that was previously
  2182  //  ** entered by the same thread.  The behavior is undefined if the mutex
  2183  //  ** is not currently entered. If a NULL pointer is passed as an argument
  2184  //  ** this function is a no-op.
  2185  //  */
  2186  func Xsqlite3_mutex_leave(tls *crt.TLS, _p *Xsqlite3_mutex) {
  2187  	if _p != nil {
  2188  		func() {
  2189  			if (_sqlite3Config.Xmutex.XxMutexLeave) == nil {
  2190  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22891), unsafe.Pointer(&_sqlite3_mutex_leaveØ00__func__Ø000), unsafe.Pointer(str(1161)))
  2191  				crt.X__builtin_abort(tls)
  2192  			}
  2193  		}()
  2194  		func() func(*crt.TLS, *Xsqlite3_mutex) {
  2195  			v := _sqlite3Config.Xmutex.XxMutexLeave
  2196  			return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
  2197  		}()(tls, _p)
  2198  	}
  2199  }
  2200  
  2201  var _sqlite3_mutex_leaveØ00__func__Ø000 [20]int8
  2202  
  2203  func init() {
  2204  	crt.Xstrncpy(nil, &_sqlite3_mutex_leaveØ00__func__Ø000[0], str(1199), 20)
  2205  }
  2206  
  2207  // C comment
  2208  //  /*
  2209  //  ** Resize the block of memory pointed to by p to n bytes. If the
  2210  //  ** resize fails, set the mallocFailed flag in the connection object.
  2211  //  */
  2212  func _sqlite3DbRealloc(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
  2213  	func() {
  2214  		if _db == nil {
  2215  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24904), unsafe.Pointer(&_sqlite3DbReallocØ00__func__Ø000), unsafe.Pointer(str(1219)))
  2216  			crt.X__builtin_abort(tls)
  2217  		}
  2218  	}()
  2219  	if _p == nil {
  2220  		return _sqlite3DbMallocRawNN(tls, _db, _n)
  2221  	}
  2222  	func() {
  2223  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
  2224  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24906), unsafe.Pointer(&_sqlite3DbReallocØ00__func__Ø000), unsafe.Pointer(str(881)))
  2225  			crt.X__builtin_abort(tls)
  2226  		}
  2227  	}()
  2228  	if _isLookaside(tls, _db, _p) != 0 && (_n <= uint64(_db.Xlookaside.Xsz)) {
  2229  		return _p
  2230  	}
  2231  	return _dbReallocFinish(tls, _db, _p, _n)
  2232  }
  2233  
  2234  var _sqlite3DbReallocØ00__func__Ø000 [17]int8
  2235  
  2236  func init() {
  2237  	crt.Xstrncpy(nil, &_sqlite3DbReallocØ00__func__Ø000[0], str(1225), 17)
  2238  }
  2239  
  2240  func _sqlite3DbMallocRawNN(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
  2241  	var _pBuf *XScratchFreeslot
  2242  	func() {
  2243  		if _db == nil {
  2244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24864), unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000), unsafe.Pointer(str(1219)))
  2245  			crt.X__builtin_abort(tls)
  2246  		}
  2247  	}()
  2248  	func() {
  2249  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
  2250  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24865), unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000), unsafe.Pointer(str(881)))
  2251  			crt.X__builtin_abort(tls)
  2252  		}
  2253  	}()
  2254  	func() {
  2255  		if _db.XpnBytesFreed != nil {
  2256  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24866), unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000), unsafe.Pointer(str(1242)))
  2257  			crt.X__builtin_abort(tls)
  2258  		}
  2259  	}()
  2260  	if (_db.Xlookaside.XbDisable) != (0) {
  2261  		goto _6
  2262  	}
  2263  	func() {
  2264  		if int32(_db.XmallocFailed) != int32(0) {
  2265  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24868), unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000), unsafe.Pointer(str(1262)))
  2266  			crt.X__builtin_abort(tls)
  2267  		}
  2268  	}()
  2269  	if _n > uint64(_db.Xlookaside.Xsz) {
  2270  		*elem8((*int32)(unsafe.Pointer(&(_db.Xlookaside.XanStat))), uintptr(1)) += 1
  2271  		goto _12
  2272  	}
  2273  	if store9(&_pBuf, (*XScratchFreeslot)(_db.Xlookaside.XpFree)) == nil {
  2274  		*elem8((*int32)(unsafe.Pointer(&(_db.Xlookaside.XanStat))), uintptr(2)) += 1
  2275  		goto _12
  2276  	}
  2277  	*(**XScratchFreeslot)(unsafe.Pointer(&(_db.Xlookaside.XpFree))) = (*XScratchFreeslot)(_pBuf.XpNext)
  2278  	_db.Xlookaside.XnOut += 1
  2279  	*elem8((*int32)(unsafe.Pointer(&(_db.Xlookaside.XanStat))), 0) += 1
  2280  	if (_db.Xlookaside.XnOut) > (_db.Xlookaside.XmxOut) {
  2281  		_db.Xlookaside.XmxOut = _db.Xlookaside.XnOut
  2282  	}
  2283  	return unsafe.Pointer(_pBuf)
  2284  
  2285  _12:
  2286  	goto _15
  2287  _6:
  2288  	if _db.XmallocFailed != 0 {
  2289  		return nil
  2290  	}
  2291  _15:
  2292  	return _dbMallocRawFinish(tls, _db, _n)
  2293  }
  2294  
  2295  var _sqlite3DbMallocRawNNØ00__func__Ø000 [21]int8
  2296  
  2297  func init() {
  2298  	crt.Xstrncpy(nil, &_sqlite3DbMallocRawNNØ00__func__Ø000[0], str(1282), 21)
  2299  }
  2300  
  2301  // C comment
  2302  //  /* Finish the work of sqlite3DbMallocRawNN for the unusual and
  2303  //  ** slower case when the allocation cannot be fulfilled using lookaside.
  2304  //  */
  2305  func _dbMallocRawFinish(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
  2306  	var _p unsafe.Pointer
  2307  	func() {
  2308  		if _db == nil {
  2309  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24824), unsafe.Pointer(&_dbMallocRawFinishØ00__func__Ø000), unsafe.Pointer(str(1219)))
  2310  			crt.X__builtin_abort(tls)
  2311  		}
  2312  	}()
  2313  	_p = _sqlite3Malloc(tls, _n)
  2314  	if _p == nil {
  2315  		_sqlite3OomFault(tls, _db)
  2316  	}
  2317  	return _p
  2318  }
  2319  
  2320  var _dbMallocRawFinishØ00__func__Ø000 [18]int8
  2321  
  2322  func init() {
  2323  	crt.Xstrncpy(nil, &_dbMallocRawFinishØ00__func__Ø000[0], str(1303), 18)
  2324  }
  2325  
  2326  // C comment
  2327  //  /*
  2328  //  ** Allocate memory.  This routine is like sqlite3_malloc() except that it
  2329  //  ** assumes the memory subsystem has already been initialized.
  2330  //  */
  2331  func _sqlite3Malloc(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) {
  2332  	var _p unsafe.Pointer
  2333  	if (_n == (0)) || (_n >= uint64(2147483392)) {
  2334  		_p = nil
  2335  		goto _4
  2336  	}
  2337  	if _sqlite3Config.XbMemstat != 0 {
  2338  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2339  		_mallocWithAlarm(tls, int32(_n), &_p)
  2340  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2341  		goto _4
  2342  	}
  2343  	_p = (_sqlite3Config.Xm.XxMalloc)(tls, int32(_n))
  2344  _4:
  2345  	func() {
  2346  		if (int64(uintptr(_p)) & int64(7)) != (0) {
  2347  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24499), unsafe.Pointer(&_sqlite3MallocØ00__func__Ø000), unsafe.Pointer(str(1321)))
  2348  			crt.X__builtin_abort(tls)
  2349  		}
  2350  	}()
  2351  	return _p
  2352  }
  2353  
  2354  // C comment
  2355  //  /*
  2356  //  ** Do a memory allocation with statistics and alarms.  Assume the
  2357  //  ** lock is already held.
  2358  //  */
  2359  func _mallocWithAlarm(tls *crt.TLS, _n int32, _pp *unsafe.Pointer) {
  2360  	var _nFull int32
  2361  	var _1_nUsed int64
  2362  	var _p unsafe.Pointer
  2363  	func() {
  2364  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_mem0.Xmutex)) == 0 {
  2365  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24437), unsafe.Pointer(&_mallocWithAlarmØ00__func__Ø000), unsafe.Pointer(str(1345)))
  2366  			crt.X__builtin_abort(tls)
  2367  		}
  2368  	}()
  2369  	func() {
  2370  		if _n <= int32(0) {
  2371  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24438), unsafe.Pointer(&_mallocWithAlarmØ00__func__Ø000), unsafe.Pointer(str(1376)))
  2372  			crt.X__builtin_abort(tls)
  2373  		}
  2374  	}()
  2375  	_nFull = (_sqlite3Config.Xm.XxRoundup)(tls, _n)
  2376  	_sqlite3StatusHighwater(tls, int32(5), _n)
  2377  	if _mem0.XalarmThreshold <= (0) {
  2378  		goto _4
  2379  	}
  2380  	_1_nUsed = _sqlite3StatusValue(tls, int32(0))
  2381  	if _1_nUsed >= (_mem0.XalarmThreshold - int64(_nFull)) {
  2382  		_mem0.XnearlyFull = int32(1)
  2383  		_sqlite3MallocAlarm(tls, _nFull)
  2384  		goto _6
  2385  	}
  2386  	_mem0.XnearlyFull = int32(0)
  2387  _6:
  2388  _4:
  2389  	_p = (_sqlite3Config.Xm.XxMalloc)(tls, _nFull)
  2390  	if _p != nil {
  2391  		_nFull = _sqlite3MallocSize(tls, _p)
  2392  		_sqlite3StatusUp(tls, int32(0), _nFull)
  2393  		_sqlite3StatusUp(tls, int32(9), int32(1))
  2394  	}
  2395  	*_pp = _p
  2396  }
  2397  
  2398  var _mallocWithAlarmØ00__func__Ø000 [16]int8
  2399  
  2400  func init() {
  2401  	crt.Xstrncpy(nil, &_mallocWithAlarmØ00__func__Ø000[0], str(1380), 16)
  2402  }
  2403  
  2404  // C comment
  2405  //  /*
  2406  //  ** Adjust the highwater mark if necessary.
  2407  //  ** The caller must hold the appropriate mutex.
  2408  //  */
  2409  func _sqlite3StatusHighwater(tls *crt.TLS, _op int32, _X int32) {
  2410  	var _newValue int64
  2411  	func() {
  2412  		if _X < int32(0) {
  2413  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18589), unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000), unsafe.Pointer(str(1396)))
  2414  			crt.X__builtin_abort(tls)
  2415  		}
  2416  	}()
  2417  	_newValue = int64(_X)
  2418  	func() {
  2419  		if _op < int32(0) || _op >= int32(10) {
  2420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18591), unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000), unsafe.Pointer(str(1103)))
  2421  			crt.X__builtin_abort(tls)
  2422  		}
  2423  	}()
  2424  	func() {
  2425  		if _op < int32(0) || _op >= int32(10) {
  2426  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18592), unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000), unsafe.Pointer(str(989)))
  2427  			crt.X__builtin_abort(tls)
  2428  		}
  2429  	}()
  2430  	func() {
  2431  		if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
  2432  			if (*elem1((*int8)(unsafe.Pointer(&_statMutex)), uintptr(_op))) != 0 {
  2433  				return _sqlite3Pcache1Mutex(tls)
  2434  			}
  2435  			return _sqlite3MallocMutex(tls)
  2436  		}()) == 0 {
  2437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18593), unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000), unsafe.Pointer(str(1022)))
  2438  			crt.X__builtin_abort(tls)
  2439  		}
  2440  	}()
  2441  	func() {
  2442  		if _op != int32(5) && _op != int32(7) && _op != int32(8) && _op != int32(6) {
  2443  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18595), unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000), unsafe.Pointer(str(1401)))
  2444  			crt.X__builtin_abort(tls)
  2445  		}
  2446  	}()
  2447  	if _newValue > (*elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op))) {
  2448  		*elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op)) = _newValue
  2449  	}
  2450  }
  2451  
  2452  var _sqlite3StatusHighwaterØ00__func__Ø000 [23]int8
  2453  
  2454  func init() {
  2455  	crt.Xstrncpy(nil, &_sqlite3StatusHighwaterØ00__func__Ø000[0], str(1535), 23)
  2456  }
  2457  
  2458  // C comment
  2459  //  /*
  2460  //  ** Return the current value of a status parameter.  The caller must
  2461  //  ** be holding the appropriate mutex.
  2462  //  */
  2463  func _sqlite3StatusValue(tls *crt.TLS, _op int32) (r0 int64) {
  2464  	func() {
  2465  		if _op < int32(0) || _op >= int32(10) {
  2466  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18543), unsafe.Pointer(&_sqlite3StatusValueØ00__func__Ø000), unsafe.Pointer(str(1103)))
  2467  			crt.X__builtin_abort(tls)
  2468  		}
  2469  	}()
  2470  	func() {
  2471  		if _op < int32(0) || _op >= int32(10) {
  2472  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18544), unsafe.Pointer(&_sqlite3StatusValueØ00__func__Ø000), unsafe.Pointer(str(989)))
  2473  			crt.X__builtin_abort(tls)
  2474  		}
  2475  	}()
  2476  	func() {
  2477  		if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
  2478  			if (*elem1((*int8)(unsafe.Pointer(&_statMutex)), uintptr(_op))) != 0 {
  2479  				return _sqlite3Pcache1Mutex(tls)
  2480  			}
  2481  			return _sqlite3MallocMutex(tls)
  2482  		}()) == 0 {
  2483  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18545), unsafe.Pointer(&_sqlite3StatusValueØ00__func__Ø000), unsafe.Pointer(str(1022)))
  2484  			crt.X__builtin_abort(tls)
  2485  		}
  2486  	}()
  2487  	return *elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op))
  2488  }
  2489  
  2490  var _sqlite3StatusValueØ00__func__Ø000 [19]int8
  2491  
  2492  func init() {
  2493  	crt.Xstrncpy(nil, &_sqlite3StatusValueØ00__func__Ø000[0], str(1558), 19)
  2494  }
  2495  
  2496  // C comment
  2497  //  /*
  2498  //  ** Trigger the alarm
  2499  //  */
  2500  func _sqlite3MallocAlarm(tls *crt.TLS, _nByte int32) {
  2501  	if _mem0.XalarmThreshold <= (0) {
  2502  		return
  2503  	}
  2504  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2505  	Xsqlite3_release_memory(tls, _nByte)
  2506  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2507  }
  2508  
  2509  // C comment
  2510  //  /*
  2511  //  ** Attempt to release up to n bytes of non-essential memory currently
  2512  //  ** held by SQLite. An example of non-essential memory is memory used to
  2513  //  ** cache database pages that are not currently in use.
  2514  //  */
  2515  func Xsqlite3_release_memory(tls *crt.TLS, _n int32) (r0 int32) {
  2516  	return int32(0)
  2517  }
  2518  
  2519  // C comment
  2520  //  /*
  2521  //  ** Add N to the value of a status record.  The caller must hold the
  2522  //  ** appropriate mutex.  (Locking is checked by assert()).
  2523  //  **
  2524  //  ** The StatusUp() routine can accept positive or negative values for N.
  2525  //  ** The value of N is added to the current status value and the high-water
  2526  //  ** mark is adjusted if necessary.
  2527  //  **
  2528  //  ** The StatusDown() routine lowers the current value by N.  The highwater
  2529  //  ** mark is unchanged.  N must be non-negative for StatusDown().
  2530  //  */
  2531  func _sqlite3StatusUp(tls *crt.TLS, _op int32, _N int32) {
  2532  	func() {
  2533  		if _op < int32(0) || _op >= int32(10) {
  2534  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18563), unsafe.Pointer(&_sqlite3StatusUpØ00__func__Ø000), unsafe.Pointer(str(1103)))
  2535  			crt.X__builtin_abort(tls)
  2536  		}
  2537  	}()
  2538  	func() {
  2539  		if _op < int32(0) || _op >= int32(10) {
  2540  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18564), unsafe.Pointer(&_sqlite3StatusUpØ00__func__Ø000), unsafe.Pointer(str(989)))
  2541  			crt.X__builtin_abort(tls)
  2542  		}
  2543  	}()
  2544  	func() {
  2545  		if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
  2546  			if (*elem1((*int8)(unsafe.Pointer(&_statMutex)), uintptr(_op))) != 0 {
  2547  				return _sqlite3Pcache1Mutex(tls)
  2548  			}
  2549  			return _sqlite3MallocMutex(tls)
  2550  		}()) == 0 {
  2551  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18565), unsafe.Pointer(&_sqlite3StatusUpØ00__func__Ø000), unsafe.Pointer(str(1022)))
  2552  			crt.X__builtin_abort(tls)
  2553  		}
  2554  	}()
  2555  	*elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op)) += int64(_N)
  2556  	if (*elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op))) > (*elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op))) {
  2557  		*elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op)) = *elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op))
  2558  	}
  2559  }
  2560  
  2561  var _sqlite3StatusUpØ00__func__Ø000 [16]int8
  2562  
  2563  func init() {
  2564  	crt.Xstrncpy(nil, &_sqlite3StatusUpØ00__func__Ø000[0], str(1577), 16)
  2565  }
  2566  
  2567  var _sqlite3MallocØ00__func__Ø000 [14]int8
  2568  
  2569  func init() {
  2570  	crt.Xstrncpy(nil, &_sqlite3MallocØ00__func__Ø000[0], str(1593), 14)
  2571  }
  2572  
  2573  // C comment
  2574  //  /*
  2575  //  ** Call this routine to record the fact that an OOM (out-of-memory) error
  2576  //  ** has happened.  This routine will set db->mallocFailed, and also
  2577  //  ** temporarily disable the lookaside memory allocator and interrupt
  2578  //  ** any running VDBEs.
  2579  //  */
  2580  func _sqlite3OomFault(tls *crt.TLS, _db *Xsqlite3) {
  2581  	if int32(_db.XmallocFailed) != int32(0) || int32(_db.XbBenignMalloc) != int32(0) {
  2582  		goto _1
  2583  	}
  2584  	_db.XmallocFailed = uint8(1)
  2585  	if _db.XnVdbeExec > int32(0) {
  2586  		*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(1)
  2587  	}
  2588  	_db.Xlookaside.XbDisable += 1
  2589  _1:
  2590  }
  2591  
  2592  func _dbReallocFinish(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
  2593  	var _pNew unsafe.Pointer
  2594  	_pNew = nil
  2595  	func() {
  2596  		if _db == nil {
  2597  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24912), unsafe.Pointer(&_dbReallocFinishØ00__func__Ø000), unsafe.Pointer(str(1219)))
  2598  			crt.X__builtin_abort(tls)
  2599  		}
  2600  	}()
  2601  	func() {
  2602  		if _p == nil {
  2603  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24913), unsafe.Pointer(&_dbReallocFinishØ00__func__Ø000), unsafe.Pointer(str(807)))
  2604  			crt.X__builtin_abort(tls)
  2605  		}
  2606  	}()
  2607  	if int32(_db.XmallocFailed) != int32(0) {
  2608  		goto _4
  2609  	}
  2610  	if _isLookaside(tls, _db, _p) == 0 {
  2611  		goto _5
  2612  	}
  2613  	_pNew = _sqlite3DbMallocRawNN(tls, _db, _n)
  2614  	if _pNew != nil {
  2615  		crt.Xmemcpy(tls, _pNew, _p, uint64(_db.Xlookaside.Xsz))
  2616  		_sqlite3DbFree(tls, _db, _p)
  2617  	}
  2618  	goto _7
  2619  _5:
  2620  
  2621  	_pNew = Xsqlite3_realloc64(tls, _p, _n)
  2622  	if _pNew == nil {
  2623  		_sqlite3OomFault(tls, _db)
  2624  	}
  2625  _7:
  2626  _4:
  2627  	return _pNew
  2628  }
  2629  
  2630  var _dbReallocFinishØ00__func__Ø000 [16]int8
  2631  
  2632  func init() {
  2633  	crt.Xstrncpy(nil, &_dbReallocFinishØ00__func__Ø000[0], str(1607), 16)
  2634  }
  2635  
  2636  func Xsqlite3_realloc64(tls *crt.TLS, _pOld unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
  2637  	if Xsqlite3_initialize(tls) != 0 {
  2638  		return nil
  2639  	}
  2640  	return _sqlite3Realloc(tls, _pOld, _n)
  2641  }
  2642  
  2643  // C comment
  2644  //  /*
  2645  //  ** Initialize SQLite.
  2646  //  **
  2647  //  ** This routine must be called to initialize the memory allocation,
  2648  //  ** VFS, and mutex subsystems prior to doing any serious work with
  2649  //  ** SQLite.  But as long as you do not compile with SQLITE_OMIT_AUTOINIT
  2650  //  ** this routine will be called automatically by key routines such as
  2651  //  ** sqlite3_open().
  2652  //  **
  2653  //  ** This routine is a no-op except on its very first call for the process,
  2654  //  ** or for the first call after a call to sqlite3_shutdown.
  2655  //  **
  2656  //  ** The first thread to call this routine runs the initialization to
  2657  //  ** completion.  If subsequent threads call this routine before the first
  2658  //  ** thread has finished the initialization process, then the subsequent
  2659  //  ** threads must block until the first thread finishes with the initialization.
  2660  //  **
  2661  //  ** The first thread might call this routine recursively.  Recursive
  2662  //  ** calls to this routine should not block, of course.  Otherwise the
  2663  //  ** initialization process would never complete.
  2664  //  **
  2665  //  ** Let X be the first thread to enter this routine.  Let Y be some other
  2666  //  ** thread.  Then while the initial invocation of this routine by X is
  2667  //  ** incomplete, it is required that:
  2668  //  **
  2669  //  **    *  Calls to this routine from Y must block until the outer-most
  2670  //  **       call by X completes.
  2671  //  **
  2672  //  **    *  Recursive calls to this routine from thread X return immediately
  2673  //  **       without blocking.
  2674  //  */
  2675  func Xsqlite3_initialize(tls *crt.TLS) (r0 int32) {
  2676  	var _rc int32
  2677  	var _12_x uint64
  2678  	var _12_y float64
  2679  	var _pMaster *Xsqlite3_mutex
  2680  
  2681  	if _sqlite3Config.XisInit != 0 {
  2682  		return int32(0)
  2683  	}
  2684  	_rc = _sqlite3MutexInit(tls)
  2685  	if _rc != 0 {
  2686  		return _rc
  2687  	}
  2688  	_pMaster = _sqlite3MutexAlloc(tls, int32(2))
  2689  	Xsqlite3_mutex_enter(tls, _pMaster)
  2690  	_sqlite3Config.XisMutexInit = int32(1)
  2691  	if _sqlite3Config.XisMallocInit == 0 {
  2692  		_rc = _sqlite3MallocInit(tls)
  2693  	}
  2694  	if _rc != int32(0) {
  2695  		goto _3
  2696  	}
  2697  	_sqlite3Config.XisMallocInit = int32(1)
  2698  	if _sqlite3Config.XpInitMutex != nil {
  2699  		goto _4
  2700  	}
  2701  	*(**Xsqlite3_mutex)(unsafe.Pointer(&_sqlite3Config.XpInitMutex)) = _sqlite3MutexAlloc(tls, int32(1))
  2702  	if _sqlite3Config.XbCoreMutex != 0 && (_sqlite3Config.XpInitMutex == nil) {
  2703  		_rc = _sqlite3NomemError(tls, int32(140658))
  2704  	}
  2705  _4:
  2706  _3:
  2707  	if _rc == int32(0) {
  2708  		_sqlite3Config.XnRefInitMutex += 1
  2709  	}
  2710  	Xsqlite3_mutex_leave(tls, _pMaster)
  2711  	if _rc != int32(0) {
  2712  		return _rc
  2713  	}
  2714  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_sqlite3Config.XpInitMutex))
  2715  	if _sqlite3Config.XisInit != int32(0) || _sqlite3Config.XinProgress != int32(0) {
  2716  		goto _10
  2717  	}
  2718  	_sqlite3Config.XinProgress = int32(1)
  2719  	crt.Xmemset(tls, unsafe.Pointer(&_sqlite3BuiltinFunctions), int32(0), uint64(184))
  2720  	_sqlite3RegisterBuiltinFunctions(tls)
  2721  	if _sqlite3Config.XisPCacheInit == int32(0) {
  2722  		_rc = _sqlite3PcacheInitialize(tls)
  2723  	}
  2724  	if _rc == int32(0) {
  2725  		_sqlite3Config.XisPCacheInit = int32(1)
  2726  		_rc = _sqlite3OsInit(tls)
  2727  	}
  2728  	if _rc == int32(0) {
  2729  		_sqlite3PCacheBufferSetup(tls, _sqlite3Config.XpPage, _sqlite3Config.XszPage, _sqlite3Config.XnPage)
  2730  		_sqlite3Config.XisInit = int32(1)
  2731  	}
  2732  	_sqlite3Config.XinProgress = int32(0)
  2733  _10:
  2734  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_sqlite3Config.XpInitMutex))
  2735  	Xsqlite3_mutex_enter(tls, _pMaster)
  2736  	_sqlite3Config.XnRefInitMutex -= 1
  2737  	if _sqlite3Config.XnRefInitMutex <= int32(0) {
  2738  		func() {
  2739  			if _sqlite3Config.XnRefInitMutex != int32(0) {
  2740  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(140723), unsafe.Pointer(&_sqlite3_initializeØ00__func__Ø000), unsafe.Pointer(str(1623)))
  2741  				crt.X__builtin_abort(tls)
  2742  			}
  2743  		}()
  2744  		Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_sqlite3Config.XpInitMutex))
  2745  		*(**Xsqlite3_mutex)(unsafe.Pointer(&_sqlite3Config.XpInitMutex)) = nil
  2746  	}
  2747  	Xsqlite3_mutex_leave(tls, _pMaster)
  2748  	if _rc == int32(0) {
  2749  		_12_x = uint64(9223372036854775807)
  2750  
  2751  		crt.Xmemcpy(tls, unsafe.Pointer(&_12_y), unsafe.Pointer(&_12_x), uint64(8))
  2752  		func() {
  2753  			if _sqlite3IsNaN(tls, _12_y) == 0 {
  2754  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(140743), unsafe.Pointer(&_sqlite3_initializeØ00__func__Ø000), unsafe.Pointer(str(1660)))
  2755  				crt.X__builtin_abort(tls)
  2756  			}
  2757  		}()
  2758  	}
  2759  	return _rc
  2760  
  2761  	_ = _12_x
  2762  	panic(0)
  2763  }
  2764  
  2765  // C comment
  2766  //  /*
  2767  //  ** Initialize the mutex system.
  2768  //  */
  2769  func _sqlite3MutexInit(tls *crt.TLS) (r0 int32) {
  2770  	var _rc int32
  2771  	var _1_pFrom, _1_pTo *Xsqlite3_mutex_methods
  2772  	_rc = int32(0)
  2773  	if (_sqlite3Config.Xmutex.XxMutexAlloc) != nil {
  2774  		goto _0
  2775  	}
  2776  	_1_pTo = &_sqlite3Config.Xmutex
  2777  	if _sqlite3Config.XbCoreMutex != 0 {
  2778  		_1_pFrom = _sqlite3DefaultMutex(tls)
  2779  		goto _2
  2780  	}
  2781  	_1_pFrom = _sqlite3NoopMutex(tls)
  2782  _2:
  2783  	_1_pTo.XxMutexInit = _1_pFrom.XxMutexInit
  2784  	_1_pTo.XxMutexEnd = _1_pFrom.XxMutexEnd
  2785  	*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&_1_pTo.XxMutexFree)) = func() func(*crt.TLS, *Xsqlite3_mutex) {
  2786  		v := _1_pFrom.XxMutexFree
  2787  		return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
  2788  	}()
  2789  	*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&_1_pTo.XxMutexEnter)) = func() func(*crt.TLS, *Xsqlite3_mutex) {
  2790  		v := _1_pFrom.XxMutexEnter
  2791  		return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
  2792  	}()
  2793  	*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&_1_pTo.XxMutexTry)) = func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
  2794  		v := _1_pFrom.XxMutexTry
  2795  		return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
  2796  	}()
  2797  	*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&_1_pTo.XxMutexLeave)) = func() func(*crt.TLS, *Xsqlite3_mutex) {
  2798  		v := _1_pFrom.XxMutexLeave
  2799  		return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
  2800  	}()
  2801  	*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&_1_pTo.XxMutexHeld)) = func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
  2802  		v := _1_pFrom.XxMutexHeld
  2803  		return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
  2804  	}()
  2805  	*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&_1_pTo.XxMutexNotheld)) = func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
  2806  		v := _1_pFrom.XxMutexNotheld
  2807  		return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
  2808  	}()
  2809  	_sqlite3MemoryBarrier(tls)
  2810  	*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&_1_pTo.XxMutexAlloc)) = func() func(*crt.TLS, int32) *Xsqlite3_mutex {
  2811  		v := _1_pFrom.XxMutexAlloc
  2812  		return *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&v))
  2813  	}()
  2814  _0:
  2815  	func() {
  2816  		if (_sqlite3Config.Xmutex.XxMutexInit) == nil {
  2817  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22801), unsafe.Pointer(&_sqlite3MutexInitØ00__func__Ø000), unsafe.Pointer(str(1676)))
  2818  			crt.X__builtin_abort(tls)
  2819  		}
  2820  	}()
  2821  	_rc = (_sqlite3Config.Xmutex.XxMutexInit)(tls)
  2822  	_mutexIsInit = int32(1)
  2823  	bug20530(_mutexIsInit)
  2824  	return _rc
  2825  }
  2826  
  2827  func _sqlite3DefaultMutex(tls *crt.TLS) (r0 *Xsqlite3_mutex_methods) {
  2828  	return &_sqlite3DefaultMutexØ00sMutexØ001
  2829  }
  2830  
  2831  var _sqlite3DefaultMutexØ00sMutexØ001 Xsqlite3_mutex_methods
  2832  
  2833  func init() {
  2834  	_sqlite3DefaultMutexØ00sMutexØ001 = Xsqlite3_mutex_methods{XxMutexInit: _pthreadMutexInit, XxMutexEnd: _pthreadMutexEnd, XxMutexAlloc: *(*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
  2835  		f func(*crt.TLS, int32) *Xsqlite3_mutex
  2836  	}{_pthreadMutexAlloc})), XxMutexFree: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  2837  		f func(*crt.TLS, *Xsqlite3_mutex)
  2838  	}{_pthreadMutexFree})), XxMutexEnter: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  2839  		f func(*crt.TLS, *Xsqlite3_mutex)
  2840  	}{_pthreadMutexEnter})), XxMutexTry: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  2841  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  2842  	}{_pthreadMutexTry})), XxMutexLeave: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  2843  		f func(*crt.TLS, *Xsqlite3_mutex)
  2844  	}{_pthreadMutexLeave})), XxMutexHeld: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  2845  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  2846  	}{_pthreadMutexHeld})), XxMutexNotheld: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  2847  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  2848  	}{_pthreadMutexNotheld}))}
  2849  }
  2850  
  2851  // C comment
  2852  //  /*
  2853  //  ** Initialize and deinitialize the mutex subsystem.
  2854  //  */
  2855  func _pthreadMutexInit(tls *crt.TLS) (r0 int32) {
  2856  	return int32(0)
  2857  }
  2858  
  2859  func _pthreadMutexEnd(tls *crt.TLS) (r0 int32) {
  2860  	return int32(0)
  2861  }
  2862  
  2863  // C comment
  2864  //  /*
  2865  //  ** The sqlite3_mutex_alloc() routine allocates a new
  2866  //  ** mutex and returns a pointer to it.  If it returns NULL
  2867  //  ** that means that a mutex could not be allocated.  SQLite
  2868  //  ** will unwind its stack and return an error.  The argument
  2869  //  ** to sqlite3_mutex_alloc() is one of these integer constants:
  2870  //  **
  2871  //  ** <ul>
  2872  //  ** <li>  SQLITE_MUTEX_FAST
  2873  //  ** <li>  SQLITE_MUTEX_RECURSIVE
  2874  //  ** <li>  SQLITE_MUTEX_STATIC_MASTER
  2875  //  ** <li>  SQLITE_MUTEX_STATIC_MEM
  2876  //  ** <li>  SQLITE_MUTEX_STATIC_OPEN
  2877  //  ** <li>  SQLITE_MUTEX_STATIC_PRNG
  2878  //  ** <li>  SQLITE_MUTEX_STATIC_LRU
  2879  //  ** <li>  SQLITE_MUTEX_STATIC_PMEM
  2880  //  ** <li>  SQLITE_MUTEX_STATIC_APP1
  2881  //  ** <li>  SQLITE_MUTEX_STATIC_APP2
  2882  //  ** <li>  SQLITE_MUTEX_STATIC_APP3
  2883  //  ** <li>  SQLITE_MUTEX_STATIC_VFS1
  2884  //  ** <li>  SQLITE_MUTEX_STATIC_VFS2
  2885  //  ** <li>  SQLITE_MUTEX_STATIC_VFS3
  2886  //  ** </ul>
  2887  //  **
  2888  //  ** The first two constants cause sqlite3_mutex_alloc() to create
  2889  //  ** a new mutex.  The new mutex is recursive when SQLITE_MUTEX_RECURSIVE
  2890  //  ** is used but not necessarily so when SQLITE_MUTEX_FAST is used.
  2891  //  ** The mutex implementation does not need to make a distinction
  2892  //  ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does
  2893  //  ** not want to.  But SQLite will only request a recursive mutex in
  2894  //  ** cases where it really needs one.  If a faster non-recursive mutex
  2895  //  ** implementation is available on the host platform, the mutex subsystem
  2896  //  ** might return such a mutex in response to SQLITE_MUTEX_FAST.
  2897  //  **
  2898  //  ** The other allowed parameters to sqlite3_mutex_alloc() each return
  2899  //  ** a pointer to a static preexisting mutex.  Six static mutexes are
  2900  //  ** used by the current version of SQLite.  Future versions of SQLite
  2901  //  ** may add additional static mutexes.  Static mutexes are for internal
  2902  //  ** use by SQLite only.  Applications that use SQLite mutexes should
  2903  //  ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or
  2904  //  ** SQLITE_MUTEX_RECURSIVE.
  2905  //  **
  2906  //  ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST
  2907  //  ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc()
  2908  //  ** returns a different mutex on every call.  But for the static
  2909  //  ** mutex types, the same mutex is returned on every call that has
  2910  //  ** the same type number.
  2911  //  */
  2912  func _pthreadMutexAlloc(tls *crt.TLS, _iType int32) (r0 *Xsqlite3_mutex) {
  2913  	var _3_recursiveAttr crt.Xpthread_mutexattr_t
  2914  	var _p *Xsqlite3_mutex
  2915  	switch _iType {
  2916  	case int32(0):
  2917  		goto _2
  2918  	case int32(1):
  2919  		goto _1
  2920  	default:
  2921  		goto _3
  2922  	}
  2923  
  2924  _1:
  2925  	_p = (*Xsqlite3_mutex)(_sqlite3MallocZero(tls, uint64(64)))
  2926  	if _p != nil {
  2927  		crt.Xpthread_mutexattr_init(tls, &_3_recursiveAttr)
  2928  		crt.Xpthread_mutexattr_settype(tls, &_3_recursiveAttr, int32(1))
  2929  		crt.Xpthread_mutex_init(tls, &_p.Xmutex, &_3_recursiveAttr)
  2930  		crt.Xpthread_mutexattr_destroy(tls, &_3_recursiveAttr)
  2931  	}
  2932  	goto _5
  2933  _2:
  2934  	_p = (*Xsqlite3_mutex)(_sqlite3MallocZero(tls, uint64(64)))
  2935  	if _p != nil {
  2936  		crt.Xpthread_mutex_init(tls, &_p.Xmutex, nil)
  2937  	}
  2938  	goto _5
  2939  _3:
  2940  	if ((_iType - int32(2)) < int32(0)) || ((_iType - int32(2)) >= int32(12)) {
  2941  		_sqlite3MisuseError(tls, int32(23329))
  2942  		return nil
  2943  	}
  2944  	_p = elem10((*Xsqlite3_mutex)(unsafe.Pointer(&_pthreadMutexAllocØ00staticMutexesØ001)), uintptr(_iType-int32(2)))
  2945  	goto _5
  2946  _5:
  2947  	if _p != nil {
  2948  		_p.Xid = _iType
  2949  	}
  2950  	return _p
  2951  }
  2952  
  2953  func _sqlite3MallocZero(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) {
  2954  	var _p unsafe.Pointer
  2955  	_p = _sqlite3Malloc(tls, _n)
  2956  	if _p != nil {
  2957  		crt.Xmemset(tls, _p, int32(0), _n)
  2958  	}
  2959  	return _p
  2960  }
  2961  
  2962  var _pthreadMutexAllocØ00staticMutexesØ001 [12]Xsqlite3_mutex
  2963  
  2964  // C comment
  2965  //  /*
  2966  //  ** This routine deallocates a previously
  2967  //  ** allocated mutex.  SQLite is careful to deallocate every
  2968  //  ** mutex that it allocates.
  2969  //  */
  2970  func _pthreadMutexFree(tls *crt.TLS, _p *Xsqlite3_mutex) {
  2971  	func() {
  2972  		if _p.XnRef != int32(0) {
  2973  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23350), unsafe.Pointer(&_pthreadMutexFreeØ00__func__Ø000), unsafe.Pointer(str(1713)))
  2974  			crt.X__builtin_abort(tls)
  2975  		}
  2976  	}()
  2977  	if (_p.Xid == int32(0)) || (_p.Xid == int32(1)) {
  2978  		crt.Xpthread_mutex_destroy(tls, &_p.Xmutex)
  2979  		Xsqlite3_free(tls, unsafe.Pointer(_p))
  2980  		goto _4
  2981  	}
  2982  	_sqlite3MisuseError(tls, int32(23360))
  2983  _4:
  2984  }
  2985  
  2986  var _pthreadMutexFreeØ00__func__Ø000 [17]int8
  2987  
  2988  func init() {
  2989  	crt.Xstrncpy(nil, &_pthreadMutexFreeØ00__func__Ø000[0], str(1724), 17)
  2990  }
  2991  
  2992  // C comment
  2993  //  /*
  2994  //  ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
  2995  //  ** to enter a mutex.  If another thread is already within the mutex,
  2996  //  ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return
  2997  //  ** SQLITE_BUSY.  The sqlite3_mutex_try() interface returns SQLITE_OK
  2998  //  ** upon successful entry.  Mutexes created using SQLITE_MUTEX_RECURSIVE can
  2999  //  ** be entered multiple times by the same thread.  In such cases the,
  3000  //  ** mutex must be exited an equal number of times before another thread
  3001  //  ** can enter.  If the same thread tries to enter any other kind of mutex
  3002  //  ** more than once, the behavior is undefined.
  3003  //  */
  3004  func _pthreadMutexEnter(tls *crt.TLS, _p *Xsqlite3_mutex) {
  3005  	func() {
  3006  		if _p.Xid != int32(1) && _pthreadMutexNotheld(tls, _p) == 0 {
  3007  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23377), unsafe.Pointer(&_pthreadMutexEnterØ00__func__Ø000), unsafe.Pointer(str(1741)))
  3008  			crt.X__builtin_abort(tls)
  3009  		}
  3010  	}()
  3011  	crt.Xpthread_mutex_lock(tls, &_p.Xmutex)
  3012  	func() {
  3013  		if _p.XnRef <= int32(0) && _p.Xowner != (0) {
  3014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23406), unsafe.Pointer(&_pthreadMutexEnterØ00__func__Ø000), unsafe.Pointer(str(1797)))
  3015  			crt.X__builtin_abort(tls)
  3016  		}
  3017  	}()
  3018  	_p.Xowner = crt.Xpthread_self(tls)
  3019  	_p.XnRef += 1
  3020  	if _p.Xtrace != 0 {
  3021  		crt.Xprintf(tls, str(1822), unsafe.Pointer(_p), _p.Xtrace, _p.XnRef)
  3022  	}
  3023  }
  3024  
  3025  func _pthreadMutexNotheld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
  3026  	return bool2int((_p.XnRef == int32(0)) || (crt.Xpthread_equal(tls, _p.Xowner, crt.Xpthread_self(tls)) == int32(0)))
  3027  }
  3028  
  3029  var _pthreadMutexEnterØ00__func__Ø000 [18]int8
  3030  
  3031  func init() {
  3032  	crt.Xstrncpy(nil, &_pthreadMutexEnterØ00__func__Ø000[0], str(1856), 18)
  3033  }
  3034  
  3035  func _pthreadMutexTry(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
  3036  	var _rc int32
  3037  	func() {
  3038  		if _p.Xid != int32(1) && _pthreadMutexNotheld(tls, _p) == 0 {
  3039  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23420), unsafe.Pointer(&_pthreadMutexTryØ00__func__Ø000), unsafe.Pointer(str(1741)))
  3040  			crt.X__builtin_abort(tls)
  3041  		}
  3042  	}()
  3043  	if crt.Xpthread_mutex_trylock(tls, &_p.Xmutex) == int32(0) {
  3044  		_p.Xowner = crt.Xpthread_self(tls)
  3045  		_p.XnRef += 1
  3046  		_rc = int32(0)
  3047  		goto _4
  3048  	}
  3049  	_rc = int32(5)
  3050  _4:
  3051  	if (_rc == int32(0)) && _p.Xtrace != 0 {
  3052  		crt.Xprintf(tls, str(1822), unsafe.Pointer(_p), _p.Xtrace, _p.XnRef)
  3053  	}
  3054  	return _rc
  3055  }
  3056  
  3057  var _pthreadMutexTryØ00__func__Ø000 [16]int8
  3058  
  3059  func init() {
  3060  	crt.Xstrncpy(nil, &_pthreadMutexTryØ00__func__Ø000[0], str(1874), 16)
  3061  }
  3062  
  3063  // C comment
  3064  //  /*
  3065  //  ** The sqlite3_mutex_leave() routine exits a mutex that was
  3066  //  ** previously entered by the same thread.  The behavior
  3067  //  ** is undefined if the mutex is not currently entered or
  3068  //  ** is not currently allocated.  SQLite will never do either.
  3069  //  */
  3070  func _pthreadMutexLeave(tls *crt.TLS, _p *Xsqlite3_mutex) {
  3071  	func() {
  3072  		if _pthreadMutexHeld(tls, _p) == 0 {
  3073  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23476), unsafe.Pointer(&_pthreadMutexLeaveØ00__func__Ø000), unsafe.Pointer(str(1890)))
  3074  			crt.X__builtin_abort(tls)
  3075  		}
  3076  	}()
  3077  	_p.XnRef -= 1
  3078  	if _p.XnRef == int32(0) {
  3079  		_p.Xowner = 0
  3080  	}
  3081  	func() {
  3082  		if _p.XnRef != int32(0) && _p.Xid != int32(1) {
  3083  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23481), unsafe.Pointer(&_pthreadMutexLeaveØ00__func__Ø000), unsafe.Pointer(str(1910)))
  3084  			crt.X__builtin_abort(tls)
  3085  		}
  3086  	}()
  3087  	crt.Xpthread_mutex_unlock(tls, &_p.Xmutex)
  3088  	if _p.Xtrace != 0 {
  3089  		crt.Xprintf(tls, str(1954), unsafe.Pointer(_p), _p.Xtrace, _p.XnRef)
  3090  	}
  3091  }
  3092  
  3093  func _pthreadMutexHeld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
  3094  	return bool2int((_p.XnRef != int32(0)) && crt.Xpthread_equal(tls, _p.Xowner, crt.Xpthread_self(tls)) != 0)
  3095  }
  3096  
  3097  var _pthreadMutexLeaveØ00__func__Ø000 [18]int8
  3098  
  3099  func init() {
  3100  	crt.Xstrncpy(nil, &_pthreadMutexLeaveØ00__func__Ø000[0], str(1988), 18)
  3101  }
  3102  
  3103  func _sqlite3NoopMutex(tls *crt.TLS) (r0 *Xsqlite3_mutex_methods) {
  3104  	return &_sqlite3NoopMutexØ00sMutexØ001
  3105  }
  3106  
  3107  var _sqlite3NoopMutexØ00sMutexØ001 Xsqlite3_mutex_methods
  3108  
  3109  func init() {
  3110  	_sqlite3NoopMutexØ00sMutexØ001 = Xsqlite3_mutex_methods{XxMutexInit: _debugMutexInit, XxMutexEnd: _debugMutexEnd, XxMutexAlloc: *(*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
  3111  		f func(*crt.TLS, int32) *Xsqlite3_mutex
  3112  	}{_debugMutexAlloc})), XxMutexFree: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  3113  		f func(*crt.TLS, *Xsqlite3_mutex)
  3114  	}{_debugMutexFree})), XxMutexEnter: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  3115  		f func(*crt.TLS, *Xsqlite3_mutex)
  3116  	}{_debugMutexEnter})), XxMutexTry: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  3117  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  3118  	}{_debugMutexTry})), XxMutexLeave: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  3119  		f func(*crt.TLS, *Xsqlite3_mutex)
  3120  	}{_debugMutexLeave})), XxMutexHeld: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  3121  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  3122  	}{_debugMutexHeld})), XxMutexNotheld: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  3123  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  3124  	}{_debugMutexNotheld}))}
  3125  }
  3126  
  3127  // C comment
  3128  //  /*
  3129  //  ** Initialize and deinitialize the mutex subsystem.
  3130  //  */
  3131  func _debugMutexInit(tls *crt.TLS) (r0 int32) {
  3132  	return int32(0)
  3133  }
  3134  
  3135  func _debugMutexEnd(tls *crt.TLS) (r0 int32) {
  3136  	return int32(0)
  3137  }
  3138  
  3139  // C comment
  3140  //  /*
  3141  //  ** The sqlite3_mutex_alloc() routine allocates a new
  3142  //  ** mutex and returns a pointer to it.  If it returns NULL
  3143  //  ** that means that a mutex could not be allocated.
  3144  //  */
  3145  func _debugMutexAlloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) {
  3146  	var _pNew *Xsqlite3_debug_mutex
  3147  	_pNew = nil
  3148  	switch _id {
  3149  	case int32(0):
  3150  		goto _1
  3151  	case int32(1):
  3152  		goto _1
  3153  	default:
  3154  		goto _3
  3155  	}
  3156  
  3157  _1:
  3158  	_pNew = (*Xsqlite3_debug_mutex)(_sqlite3Malloc(tls, uint64(8)))
  3159  	if _pNew != nil {
  3160  		_pNew.Xid = _id
  3161  		_pNew.Xcnt = int32(0)
  3162  	}
  3163  	goto _5
  3164  _3:
  3165  	if ((_id - int32(2)) < int32(0)) || ((_id - int32(2)) >= int32(12)) {
  3166  		_sqlite3MisuseError(tls, int32(23039))
  3167  		return nil
  3168  	}
  3169  	_pNew = elem11((*Xsqlite3_debug_mutex)(unsafe.Pointer(&_debugMutexAllocØ00aStaticØ001)), uintptr(_id-int32(2)))
  3170  	_pNew.Xid = _id
  3171  	goto _5
  3172  _5:
  3173  	return (*Xsqlite3_mutex)(unsafe.Pointer(_pNew))
  3174  }
  3175  
  3176  var _debugMutexAllocØ00aStaticØ001 [12]Xsqlite3_debug_mutex
  3177  
  3178  // C comment
  3179  //  /*
  3180  //  ** This routine deallocates a previously allocated mutex.
  3181  //  */
  3182  func _debugMutexFree(tls *crt.TLS, _pX *Xsqlite3_mutex) {
  3183  	var _p *Xsqlite3_debug_mutex
  3184  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3185  	func() {
  3186  		if _p.Xcnt != int32(0) {
  3187  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23056), unsafe.Pointer(&_debugMutexFreeØ00__func__Ø000), unsafe.Pointer(str(2006)))
  3188  			crt.X__builtin_abort(tls)
  3189  		}
  3190  	}()
  3191  	if (_p.Xid == int32(1)) || (_p.Xid == int32(0)) {
  3192  		Xsqlite3_free(tls, unsafe.Pointer(_p))
  3193  		goto _4
  3194  	}
  3195  	_sqlite3MisuseError(tls, int32(23061))
  3196  _4:
  3197  }
  3198  
  3199  var _debugMutexFreeØ00__func__Ø000 [15]int8
  3200  
  3201  func init() {
  3202  	crt.Xstrncpy(nil, &_debugMutexFreeØ00__func__Ø000[0], str(2016), 15)
  3203  }
  3204  
  3205  // C comment
  3206  //  /*
  3207  //  ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
  3208  //  ** to enter a mutex.  If another thread is already within the mutex,
  3209  //  ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return
  3210  //  ** SQLITE_BUSY.  The sqlite3_mutex_try() interface returns SQLITE_OK
  3211  //  ** upon successful entry.  Mutexes created using SQLITE_MUTEX_RECURSIVE can
  3212  //  ** be entered multiple times by the same thread.  In such cases the,
  3213  //  ** mutex must be exited an equal number of times before another thread
  3214  //  ** can enter.  If the same thread tries to enter any other kind of mutex
  3215  //  ** more than once, the behavior is undefined.
  3216  //  */
  3217  func _debugMutexEnter(tls *crt.TLS, _pX *Xsqlite3_mutex) {
  3218  	var _p *Xsqlite3_debug_mutex
  3219  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3220  	func() {
  3221  		if _p.Xid != int32(1) && _debugMutexNotheld(tls, _pX) == 0 {
  3222  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23079), unsafe.Pointer(&_debugMutexEnterØ00__func__Ø000), unsafe.Pointer(str(2031)))
  3223  			crt.X__builtin_abort(tls)
  3224  		}
  3225  	}()
  3226  	_p.Xcnt += 1
  3227  }
  3228  
  3229  func _debugMutexNotheld(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) {
  3230  	var _p *Xsqlite3_debug_mutex
  3231  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3232  	return bool2int((_p == nil) || (_p.Xcnt == int32(0)))
  3233  }
  3234  
  3235  var _debugMutexEnterØ00__func__Ø000 [16]int8
  3236  
  3237  func init() {
  3238  	crt.Xstrncpy(nil, &_debugMutexEnterØ00__func__Ø000[0], str(2086), 16)
  3239  }
  3240  
  3241  func _debugMutexTry(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) {
  3242  	var _p *Xsqlite3_debug_mutex
  3243  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3244  	func() {
  3245  		if _p.Xid != int32(1) && _debugMutexNotheld(tls, _pX) == 0 {
  3246  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23084), unsafe.Pointer(&_debugMutexTryØ00__func__Ø000), unsafe.Pointer(str(2031)))
  3247  			crt.X__builtin_abort(tls)
  3248  		}
  3249  	}()
  3250  	_p.Xcnt += 1
  3251  	return int32(0)
  3252  }
  3253  
  3254  var _debugMutexTryØ00__func__Ø000 [14]int8
  3255  
  3256  func init() {
  3257  	crt.Xstrncpy(nil, &_debugMutexTryØ00__func__Ø000[0], str(2102), 14)
  3258  }
  3259  
  3260  // C comment
  3261  //  /*
  3262  //  ** The sqlite3_mutex_leave() routine exits a mutex that was
  3263  //  ** previously entered by the same thread.  The behavior
  3264  //  ** is undefined if the mutex is not currently entered or
  3265  //  ** is not currently allocated.  SQLite will never do either.
  3266  //  */
  3267  func _debugMutexLeave(tls *crt.TLS, _pX *Xsqlite3_mutex) {
  3268  	var _p *Xsqlite3_debug_mutex
  3269  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3270  	func() {
  3271  		if _debugMutexHeld(tls, _pX) == 0 {
  3272  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23097), unsafe.Pointer(&_debugMutexLeaveØ00__func__Ø000), unsafe.Pointer(str(2116)))
  3273  			crt.X__builtin_abort(tls)
  3274  		}
  3275  	}()
  3276  	_p.Xcnt -= 1
  3277  	func() {
  3278  		if _p.Xid != int32(1) && _debugMutexNotheld(tls, _pX) == 0 {
  3279  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23099), unsafe.Pointer(&_debugMutexLeaveØ00__func__Ø000), unsafe.Pointer(str(2031)))
  3280  			crt.X__builtin_abort(tls)
  3281  		}
  3282  	}()
  3283  }
  3284  
  3285  // C comment
  3286  //  /*
  3287  //  ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
  3288  //  ** intended for use inside assert() statements.
  3289  //  */
  3290  func _debugMutexHeld(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) {
  3291  	var _p *Xsqlite3_debug_mutex
  3292  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3293  	return bool2int((_p == nil) || (_p.Xcnt > int32(0)))
  3294  }
  3295  
  3296  var _debugMutexLeaveØ00__func__Ø000 [16]int8
  3297  
  3298  func init() {
  3299  	crt.Xstrncpy(nil, &_debugMutexLeaveØ00__func__Ø000[0], str(2135), 16)
  3300  }
  3301  
  3302  // C comment
  3303  //  /*
  3304  //  ** Try to provide a memory barrier operation, needed for initialization
  3305  //  ** and also for the implementation of xShmBarrier in the VFS in cases
  3306  //  ** where SQLite is compiled without mutexes.
  3307  //  */
  3308  func _sqlite3MemoryBarrier(tls *crt.TLS) {
  3309  }
  3310  
  3311  var _sqlite3MutexInitØ00__func__Ø000 [17]int8
  3312  
  3313  func init() {
  3314  	crt.Xstrncpy(nil, &_sqlite3MutexInitØ00__func__Ø000[0], str(2151), 17)
  3315  }
  3316  
  3317  // C comment
  3318  //  /*
  3319  //  ** For debugging purposes, record when the mutex subsystem is initialized
  3320  //  ** and uninitialized so that we can assert() if there is an attempt to
  3321  //  ** allocate a mutex while the system is uninitialized.
  3322  //  */
  3323  var _mutexIsInit int32
  3324  
  3325  func _sqlite3MutexAlloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) {
  3326  	if _sqlite3Config.XbCoreMutex == 0 {
  3327  		return nil
  3328  	}
  3329  	func() {
  3330  		if _mutexIsInit == 0 {
  3331  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22844), unsafe.Pointer(&_sqlite3MutexAllocØ00__func__Ø000), unsafe.Pointer(str(2168)))
  3332  			crt.X__builtin_abort(tls)
  3333  		}
  3334  	}()
  3335  	func() {
  3336  		if (_sqlite3Config.Xmutex.XxMutexAlloc) == nil {
  3337  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22845), unsafe.Pointer(&_sqlite3MutexAllocØ00__func__Ø000), unsafe.Pointer(str(2193)))
  3338  			crt.X__builtin_abort(tls)
  3339  		}
  3340  	}()
  3341  	return func() func(*crt.TLS, int32) *Xsqlite3_mutex {
  3342  		v := _sqlite3Config.Xmutex.XxMutexAlloc
  3343  		return *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&v))
  3344  	}()(tls, _id)
  3345  }
  3346  
  3347  var _sqlite3MutexAllocØ00__func__Ø000 [18]int8
  3348  
  3349  func init() {
  3350  	crt.Xstrncpy(nil, &_sqlite3MutexAllocØ00__func__Ø000[0], str(2231), 18)
  3351  }
  3352  
  3353  // C comment
  3354  //  /*
  3355  //  ** Initialize the memory allocation subsystem.
  3356  //  */
  3357  func _sqlite3MallocInit(tls *crt.TLS) (r0 int32) {
  3358  	var _rc, _2_i, _2_n, _2_sz int32
  3359  	var _2_pSlot *XScratchFreeslot
  3360  	if (_sqlite3Config.Xm.XxMalloc) == nil {
  3361  		_sqlite3MemSetDefault(tls)
  3362  	}
  3363  	crt.Xmemset(tls, unsafe.Pointer(&_mem0), int32(0), uint64(40))
  3364  	*(**Xsqlite3_mutex)(unsafe.Pointer(&_mem0.Xmutex)) = _sqlite3MutexAlloc(tls, int32(3))
  3365  	if _sqlite3Config.XpScratch == nil || _sqlite3Config.XszScratch < int32(100) || _sqlite3Config.XnScratch <= int32(0) {
  3366  		goto _3
  3367  	}
  3368  	_2_sz = _sqlite3Config.XszScratch & int32(-8)
  3369  	_sqlite3Config.XszScratch = _2_sz
  3370  	_2_pSlot = (*XScratchFreeslot)(_sqlite3Config.XpScratch)
  3371  	_2_n = _sqlite3Config.XnScratch
  3372  	*(**XScratchFreeslot)(unsafe.Pointer(&_mem0.XpScratchFree)) = _2_pSlot
  3373  	_mem0.XnScratchFree = uint32(_2_n)
  3374  	_2_i = int32(0)
  3375  _4:
  3376  	if _2_i >= (_2_n - int32(1)) {
  3377  		goto _7
  3378  	}
  3379  	*(**XScratchFreeslot)(unsafe.Pointer(&_2_pSlot.XpNext)) = (*XScratchFreeslot)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_2_sz) + uintptr(unsafe.Pointer(_2_pSlot))))))
  3380  	_2_pSlot = (*XScratchFreeslot)(_2_pSlot.XpNext)
  3381  	_2_i += 1
  3382  	goto _4
  3383  _7:
  3384  	*(**XScratchFreeslot)(unsafe.Pointer(&_2_pSlot.XpNext)) = nil
  3385  	_mem0.XpScratchEnd = unsafe.Pointer(elem9(_2_pSlot, uintptr(1)))
  3386  	goto _8
  3387  _3:
  3388  	_mem0.XpScratchEnd = nil
  3389  	_sqlite3Config.XpScratch = nil
  3390  	_sqlite3Config.XszScratch = int32(0)
  3391  	_sqlite3Config.XnScratch = int32(0)
  3392  _8:
  3393  	if ((_sqlite3Config.XpPage == nil) || (_sqlite3Config.XszPage < int32(512))) || (_sqlite3Config.XnPage <= int32(0)) {
  3394  		_sqlite3Config.XpPage = nil
  3395  		_sqlite3Config.XszPage = int32(0)
  3396  	}
  3397  	_rc = (_sqlite3Config.Xm.XxInit)(tls, _sqlite3Config.Xm.XpAppData)
  3398  	if _rc != int32(0) {
  3399  		crt.Xmemset(tls, unsafe.Pointer(&_mem0), int32(0), uint64(40))
  3400  	}
  3401  	return _rc
  3402  }
  3403  
  3404  // C comment
  3405  //  /*
  3406  //  ** This routine is the only routine in this file with external linkage.
  3407  //  **
  3408  //  ** Populate the low-level memory allocation function pointers in
  3409  //  ** sqlite3GlobalConfig.m with pointers to the routines in this file.
  3410  //  */
  3411  func _sqlite3MemSetDefault(tls *crt.TLS) {
  3412  	Xsqlite3_config(tls, int32(4), unsafe.Pointer(&_sqlite3MemSetDefaultØ00defaultMethodsØ001))
  3413  }
  3414  
  3415  // C comment
  3416  //  /*
  3417  //  ** This API allows applications to modify the global configuration of
  3418  //  ** the SQLite library at run-time.
  3419  //  **
  3420  //  ** This routine should only be called when there are no outstanding
  3421  //  ** database connections or memory allocations.  This routine is not
  3422  //  ** threadsafe.  Failure to heed these warnings can lead to unpredictable
  3423  //  ** behavior.
  3424  //  */
  3425  func Xsqlite3_config(tls *crt.TLS, _op int32, args ...interface{}) (r0 int32) {
  3426  	var _rc int32
  3427  	var _22_szMmap, _22_mxMmap int64
  3428  	var _ap []interface{}
  3429  	_rc = int32(0)
  3430  	if _sqlite3Config.XisInit != 0 {
  3431  		return _sqlite3MisuseError(tls, int32(140829))
  3432  	}
  3433  	_ap = args
  3434  	switch _op {
  3435  	case int32(1):
  3436  		goto _2
  3437  	case int32(2):
  3438  		goto _3
  3439  	case int32(3):
  3440  		goto _4
  3441  	case int32(4):
  3442  		goto _7
  3443  	case int32(5):
  3444  		goto _8
  3445  	case int32(6):
  3446  		goto _10
  3447  	case int32(7):
  3448  		goto _11
  3449  	case int32(9):
  3450  		goto _9
  3451  	case int32(10):
  3452  		goto _5
  3453  	case int32(11):
  3454  		goto _6
  3455  	case int32(13):
  3456  		goto _17
  3457  	case int32(14):
  3458  		goto _13
  3459  	case int32(15):
  3460  		goto _14
  3461  	case int32(16):
  3462  		goto _18
  3463  	case int32(17):
  3464  		goto _19
  3465  	case int32(18):
  3466  		goto _15
  3467  	case int32(19):
  3468  		goto _16
  3469  	case int32(20):
  3470  		goto _20
  3471  	case int32(22):
  3472  		goto _21
  3473  	case int32(24):
  3474  		goto _12
  3475  	case int32(25):
  3476  		goto _22
  3477  	case int32(26):
  3478  		goto _23
  3479  	default:
  3480  		goto _24
  3481  	}
  3482  
  3483  _2:
  3484  	_sqlite3Config.XbCoreMutex = int32(0)
  3485  	_sqlite3Config.XbFullMutex = int32(0)
  3486  	goto _25
  3487  _3:
  3488  	_sqlite3Config.XbCoreMutex = int32(1)
  3489  	_sqlite3Config.XbFullMutex = int32(0)
  3490  	goto _25
  3491  _4:
  3492  	_sqlite3Config.XbCoreMutex = int32(1)
  3493  	_sqlite3Config.XbFullMutex = int32(1)
  3494  	goto _25
  3495  _5:
  3496  	_sqlite3Config.Xmutex = *(*Xsqlite3_mutex_methods)(crt.VAPointer(&_ap))
  3497  	goto _25
  3498  _6:
  3499  	*(*Xsqlite3_mutex_methods)(crt.VAPointer(&_ap)) = _sqlite3Config.Xmutex
  3500  	goto _25
  3501  _7:
  3502  	_sqlite3Config.Xm = *(*Xsqlite3_mem_methods)(crt.VAPointer(&_ap))
  3503  	goto _25
  3504  _8:
  3505  	if (_sqlite3Config.Xm.XxMalloc) == nil {
  3506  		_sqlite3MemSetDefault(tls)
  3507  	}
  3508  	*(*Xsqlite3_mem_methods)(crt.VAPointer(&_ap)) = _sqlite3Config.Xm
  3509  	goto _25
  3510  _9:
  3511  	_sqlite3Config.XbMemstat = crt.VAInt32(&_ap)
  3512  	goto _25
  3513  _10:
  3514  	_sqlite3Config.XpScratch = crt.VAPointer(&_ap)
  3515  	_sqlite3Config.XszScratch = crt.VAInt32(&_ap)
  3516  	_sqlite3Config.XnScratch = crt.VAInt32(&_ap)
  3517  	goto _25
  3518  _11:
  3519  	_sqlite3Config.XpPage = crt.VAPointer(&_ap)
  3520  	_sqlite3Config.XszPage = crt.VAInt32(&_ap)
  3521  	_sqlite3Config.XnPage = crt.VAInt32(&_ap)
  3522  	goto _25
  3523  _12:
  3524  	*(*int32)(crt.VAPointer(&_ap)) = (_sqlite3HeaderSizeBtree(tls) + _sqlite3HeaderSizePcache(tls)) + _sqlite3HeaderSizePcache1(tls)
  3525  	goto _25
  3526  _13:
  3527  	goto _25
  3528  _14:
  3529  	_rc = int32(1)
  3530  	goto _25
  3531  _15:
  3532  	_sqlite3Config.Xpcache2 = *(*Xsqlite3_pcache_methods2)(crt.VAPointer(&_ap))
  3533  	goto _25
  3534  _16:
  3535  	if (_sqlite3Config.Xpcache2.XxInit) == nil {
  3536  		_sqlite3PCacheSetDefault(tls)
  3537  	}
  3538  	*(*Xsqlite3_pcache_methods2)(crt.VAPointer(&_ap)) = _sqlite3Config.Xpcache2
  3539  	goto _25
  3540  _17:
  3541  	_sqlite3Config.XszLookaside = crt.VAInt32(&_ap)
  3542  	_sqlite3Config.XnLookaside = crt.VAInt32(&_ap)
  3543  	goto _25
  3544  _18:
  3545  	_sqlite3Config.XxLog = crt.VAOther(&_ap).(func(*crt.TLS, unsafe.Pointer, int32, *int8))
  3546  	_sqlite3Config.XpLogArg = crt.VAPointer(&_ap)
  3547  	goto _25
  3548  _19:
  3549  	_sqlite3Config.XbOpenUri = crt.VAInt32(&_ap)
  3550  	goto _25
  3551  _20:
  3552  	_sqlite3Config.XbUseCis = crt.VAInt32(&_ap)
  3553  	goto _25
  3554  _21:
  3555  	_22_szMmap = crt.VAInt64(&_ap)
  3556  	_22_mxMmap = crt.VAInt64(&_ap)
  3557  	if (_22_mxMmap < (0)) || (_22_mxMmap > int64(2147418112)) {
  3558  		_22_mxMmap = int64(2147418112)
  3559  	}
  3560  	if _22_szMmap < (0) {
  3561  		_22_szMmap = 0
  3562  	}
  3563  	if _22_szMmap > _22_mxMmap {
  3564  		_22_szMmap = _22_mxMmap
  3565  	}
  3566  	_sqlite3Config.XmxMmap = _22_mxMmap
  3567  	_sqlite3Config.XszMmap = _22_szMmap
  3568  	goto _25
  3569  _22:
  3570  	_sqlite3Config.XszPma = crt.VAUint32(&_ap)
  3571  	goto _25
  3572  _23:
  3573  	_sqlite3Config.XnStmtSpill = crt.VAInt32(&_ap)
  3574  	goto _25
  3575  _24:
  3576  	_rc = int32(1)
  3577  	goto _25
  3578  _25:
  3579  	_ap = nil
  3580  	return _rc
  3581  }
  3582  
  3583  // C comment
  3584  //  /*
  3585  //  ** Return the size of the header added to each page by this module.
  3586  //  */
  3587  func _sqlite3HeaderSizeBtree(tls *crt.TLS) (r0 int32) {
  3588  	return int32(136)
  3589  }
  3590  
  3591  // C comment
  3592  //  /*
  3593  //  ** Return the size of the header added by this middleware layer
  3594  //  ** in the page-cache hierarchy.
  3595  //  */
  3596  func _sqlite3HeaderSizePcache(tls *crt.TLS) (r0 int32) {
  3597  	return int32(72)
  3598  }
  3599  
  3600  // C comment
  3601  //  /*
  3602  //  ** Return the size of the header on each page of this PCACHE implementation.
  3603  //  */
  3604  func _sqlite3HeaderSizePcache1(tls *crt.TLS) (r0 int32) {
  3605  	return int32(56)
  3606  }
  3607  
  3608  // C comment
  3609  //  /*
  3610  //  ** This function is called during initialization (sqlite3_initialize()) to
  3611  //  ** install the default pluggable cache module, assuming the user has not
  3612  //  ** already provided an alternative.
  3613  //  */
  3614  func _sqlite3PCacheSetDefault(tls *crt.TLS) {
  3615  	Xsqlite3_config(tls, int32(18), unsafe.Pointer(&_sqlite3PCacheSetDefaultØ00defaultMethodsØ001))
  3616  }
  3617  
  3618  var _sqlite3PCacheSetDefaultØ00defaultMethodsØ001 Xsqlite3_pcache_methods2
  3619  
  3620  func init() {
  3621  	_sqlite3PCacheSetDefaultØ00defaultMethodsØ001 = Xsqlite3_pcache_methods2{XiVersion: int32(1), XxInit: _pcache1Init, XxShutdown: _pcache1Shutdown, XxCreate: _pcache1Create, XxCachesize: _pcache1Cachesize, XxPagecount: _pcache1Pagecount, XxFetch: *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
  3622  		f func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page
  3623  	}{_pcache1Fetch})), XxUnpin: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
  3624  		f func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32)
  3625  	}{_pcache1Unpin})), XxRekey: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint32, uint32))(unsafe.Pointer(&struct {
  3626  		f func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32)
  3627  	}{_pcache1Rekey})), XxTruncate: _pcache1Truncate, XxDestroy: _pcache1Destroy, XxShrink: _pcache1Shrink}
  3628  }
  3629  
  3630  // C comment
  3631  //  /*
  3632  //  ** Implementation of the sqlite3_pcache.xInit method.
  3633  //  */
  3634  func _pcache1Init(tls *crt.TLS, _NotUsed unsafe.Pointer) (r0 int32) {
  3635  	func() {
  3636  		if _pcache1_g.XisInit != int32(0) {
  3637  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45688), unsafe.Pointer(&_pcache1InitØ00__func__Ø000), unsafe.Pointer(str(2249)))
  3638  			crt.X__builtin_abort(tls)
  3639  		}
  3640  	}()
  3641  	crt.Xmemset(tls, unsafe.Pointer(&_pcache1_g), int32(0), uint64(144))
  3642  	_pcache1_g.XseparateCache = bool2int((_sqlite3Config.XpPage == nil) || (_sqlite3Config.XbCoreMutex > int32(0)))
  3643  	if _sqlite3Config.XbCoreMutex != 0 {
  3644  		*(**Xsqlite3_mutex)(unsafe.Pointer(&(_pcache1_g.Xgrp.Xmutex))) = _sqlite3MutexAlloc(tls, int32(6))
  3645  		*(**Xsqlite3_mutex)(unsafe.Pointer(&_pcache1_g.Xmutex)) = _sqlite3MutexAlloc(tls, int32(7))
  3646  	}
  3647  	if (_pcache1_g.XseparateCache != 0 && (_sqlite3Config.XnPage != int32(0))) && (_sqlite3Config.XpPage == nil) {
  3648  		_pcache1_g.XnInitPage = _sqlite3Config.XnPage
  3649  		goto _7
  3650  	}
  3651  	_pcache1_g.XnInitPage = int32(0)
  3652  _7:
  3653  	_pcache1_g.Xgrp.XmxPinned = uint32(10)
  3654  	_pcache1_g.XisInit = int32(1)
  3655  	return int32(0)
  3656  }
  3657  
  3658  var _pcache1InitØ00__func__Ø000 [12]int8
  3659  
  3660  func init() {
  3661  	crt.Xstrncpy(nil, &_pcache1InitØ00__func__Ø000[0], str(2267), 12)
  3662  }
  3663  
  3664  // C comment
  3665  //  /*
  3666  //  ** Implementation of the sqlite3_pcache.xShutdown method.
  3667  //  ** Note that the static mutex allocated in xInit does
  3668  //  ** not need to be freed.
  3669  //  */
  3670  func _pcache1Shutdown(tls *crt.TLS, _NotUsed unsafe.Pointer) {
  3671  	func() {
  3672  		if _pcache1_g.XisInit == int32(0) {
  3673  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45741), unsafe.Pointer(&_pcache1ShutdownØ00__func__Ø000), unsafe.Pointer(str(2279)))
  3674  			crt.X__builtin_abort(tls)
  3675  		}
  3676  	}()
  3677  	crt.Xmemset(tls, unsafe.Pointer(&_pcache1_g), int32(0), uint64(144))
  3678  }
  3679  
  3680  var _pcache1ShutdownØ00__func__Ø000 [16]int8
  3681  
  3682  func init() {
  3683  	crt.Xstrncpy(nil, &_pcache1ShutdownØ00__func__Ø000[0], str(2297), 16)
  3684  }
  3685  
  3686  // C comment
  3687  //  /*
  3688  //  ** Implementation of the sqlite3_pcache.xCreate method.
  3689  //  **
  3690  //  ** Allocate a new cache.
  3691  //  */
  3692  func _pcache1Create(tls *crt.TLS, _szPage int32, _szExtra int32, _bPurgeable int32) (r0 unsafe.Pointer) {
  3693  	var _sz int32
  3694  	var _pCache *XPCache1
  3695  	var _pGroup *XPGroup
  3696  	func() {
  3697  		if (_szPage&(_szPage-int32(1))) != int32(0) || _szPage < int32(512) || _szPage > int32(65536) {
  3698  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45758), unsafe.Pointer(&_pcache1CreateØ00__func__Ø000), unsafe.Pointer(str(2313)))
  3699  			crt.X__builtin_abort(tls)
  3700  		}
  3701  	}()
  3702  	func() {
  3703  		if _szExtra >= int32(300) {
  3704  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45759), unsafe.Pointer(&_pcache1CreateØ00__func__Ø000), unsafe.Pointer(str(2370)))
  3705  			crt.X__builtin_abort(tls)
  3706  		}
  3707  	}()
  3708  	_sz = int32(uint64(80) + (uint64(80) * uint64(_pcache1_g.XseparateCache)))
  3709  	_pCache = (*XPCache1)(_sqlite3MallocZero(tls, uint64(_sz)))
  3710  	if _pCache == nil {
  3711  		goto _6
  3712  	}
  3713  	if _pcache1_g.XseparateCache != 0 {
  3714  		_pGroup = (*XPGroup)(unsafe.Pointer(elem12(_pCache, uintptr(1))))
  3715  		_pGroup.XmxPinned = uint32(10)
  3716  		goto _8
  3717  	}
  3718  	_pGroup = &_pcache1_g.Xgrp
  3719  _8:
  3720  	if int32(_pGroup.Xlru.XisAnchor) == int32(0) {
  3721  		_pGroup.Xlru.XisAnchor = uint8(1)
  3722  		*(**XPgHdr1)(unsafe.Pointer(&(_pGroup.Xlru.XpLruPrev))) = store13((**XPgHdr1)(unsafe.Pointer(&(_pGroup.Xlru.XpLruNext))), &_pGroup.Xlru)
  3723  	}
  3724  	*(**XPGroup)(unsafe.Pointer(&_pCache.XpGroup)) = _pGroup
  3725  	_pCache.XszPage = _szPage
  3726  	_pCache.XszExtra = _szExtra
  3727  	_pCache.XszAlloc = int32(uint64(_szPage+_szExtra) + uint64(56))
  3728  	_pCache.XbPurgeable = func() int32 {
  3729  		if _bPurgeable != 0 {
  3730  			return int32(1)
  3731  		}
  3732  		return int32(0)
  3733  	}()
  3734  	func() {
  3735  		if (*Xsqlite3_mutex)(_pGroup.Xmutex) != nil {
  3736  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45779), unsafe.Pointer(&_pcache1CreateØ00__func__Ø000), unsafe.Pointer(str(2384)))
  3737  			crt.X__builtin_abort(tls)
  3738  		}
  3739  	}()
  3740  	_pcache1ResizeHash(tls, _pCache)
  3741  	if _bPurgeable != 0 {
  3742  		_pCache.XnMin = uint32(10)
  3743  		_pGroup.XnMinPage += _pCache.XnMin
  3744  		_pGroup.XmxPinned = (_pGroup.XnMaxPage + uint32(10)) - _pGroup.XnMinPage
  3745  	}
  3746  	func() {
  3747  		if (*Xsqlite3_mutex)(_pGroup.Xmutex) != nil {
  3748  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45786), unsafe.Pointer(&_pcache1CreateØ00__func__Ø000), unsafe.Pointer(str(2384)))
  3749  			crt.X__builtin_abort(tls)
  3750  		}
  3751  	}()
  3752  	if _pCache.XnHash == (0) {
  3753  		_pcache1Destroy(tls, unsafe.Pointer(_pCache))
  3754  		_pCache = nil
  3755  	}
  3756  _6:
  3757  	return unsafe.Pointer(_pCache)
  3758  }
  3759  
  3760  var _pcache1CreateØ00__func__Ø000 [14]int8
  3761  
  3762  func init() {
  3763  	crt.Xstrncpy(nil, &_pcache1CreateØ00__func__Ø000[0], str(2403), 14)
  3764  }
  3765  
  3766  // C comment
  3767  //  /*
  3768  //  ** This function is used to resize the hash table used by the cache passed
  3769  //  ** as the first argument.
  3770  //  **
  3771  //  ** The PCache mutex must be held when this function is called.
  3772  //  */
  3773  func _pcache1ResizeHash(tls *crt.TLS, _p *XPCache1) {
  3774  	var _nNew, _i, _6_h uint32
  3775  	var _5_pPage, _5_pNext *XPgHdr1
  3776  	var _apNew **XPgHdr1
  3777  	func() {
  3778  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_p.XpGroup).Xmutex)) == 0 {
  3779  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45528), unsafe.Pointer(&_pcache1ResizeHashØ00__func__Ø000), unsafe.Pointer(str(2417)))
  3780  			crt.X__builtin_abort(tls)
  3781  		}
  3782  	}()
  3783  	_nNew = _p.XnHash * uint32(2)
  3784  	if _nNew < uint32(256) {
  3785  		_nNew = uint32(256)
  3786  	}
  3787  	func() {
  3788  		if (*Xsqlite3_mutex)((*XPGroup)(_p.XpGroup).Xmutex) != nil {
  3789  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45535), unsafe.Pointer(&_pcache1ResizeHashØ00__func__Ø000), unsafe.Pointer(str(2454)))
  3790  			crt.X__builtin_abort(tls)
  3791  		}
  3792  	}()
  3793  	if _p.XnHash != 0 {
  3794  		_sqlite3BeginBenignMalloc(tls)
  3795  	}
  3796  	_apNew = (**XPgHdr1)(_sqlite3MallocZero(tls, uint64(8)*uint64(_nNew)))
  3797  	if _p.XnHash != 0 {
  3798  		_sqlite3EndBenignMalloc(tls)
  3799  	}
  3800  	func() {
  3801  		if (*Xsqlite3_mutex)((*XPGroup)(_p.XpGroup).Xmutex) != nil {
  3802  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45539), unsafe.Pointer(&_pcache1ResizeHashØ00__func__Ø000), unsafe.Pointer(str(2454)))
  3803  			crt.X__builtin_abort(tls)
  3804  		}
  3805  	}()
  3806  	if _apNew == nil {
  3807  		goto _9
  3808  	}
  3809  	_i = 0
  3810  _10:
  3811  	if _i >= _p.XnHash {
  3812  		goto _13
  3813  	}
  3814  	_5_pNext = *elem14((**XPgHdr1)(unsafe.Pointer(_p.XapHash)), uintptr(_i))
  3815  _14:
  3816  	if store13(&_5_pPage, _5_pNext) != nil {
  3817  		_6_h = _5_pPage.XiKey % _nNew
  3818  		_5_pNext = (*XPgHdr1)(_5_pPage.XpNext)
  3819  		*(**XPgHdr1)(unsafe.Pointer(&_5_pPage.XpNext)) = *elem14(_apNew, uintptr(_6_h))
  3820  		*elem14(_apNew, uintptr(_6_h)) = _5_pPage
  3821  		goto _14
  3822  	}
  3823  	_i += 1
  3824  	goto _10
  3825  _13:
  3826  	Xsqlite3_free(tls, unsafe.Pointer(_p.XapHash))
  3827  	*(***XPgHdr1)(unsafe.Pointer(&_p.XapHash)) = _apNew
  3828  	_p.XnHash = _nNew
  3829  _9:
  3830  }
  3831  
  3832  var _pcache1ResizeHashØ00__func__Ø000 [18]int8
  3833  
  3834  func init() {
  3835  	crt.Xstrncpy(nil, &_pcache1ResizeHashØ00__func__Ø000[0], str(2476), 18)
  3836  }
  3837  
  3838  // C comment
  3839  //  /*
  3840  //  ** This (sqlite3EndBenignMalloc()) is called by SQLite code to indicate that
  3841  //  ** subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc()
  3842  //  ** indicates that subsequent malloc failures are non-benign.
  3843  //  */
  3844  func _sqlite3BeginBenignMalloc(tls *crt.TLS) {
  3845  	if _sqlite3Hooks.XxBenignBegin != nil {
  3846  		_sqlite3Hooks.XxBenignBegin(tls)
  3847  	}
  3848  }
  3849  
  3850  var _sqlite3Hooks TBenignMallocHooks
  3851  
  3852  func _sqlite3EndBenignMalloc(tls *crt.TLS) {
  3853  	if _sqlite3Hooks.XxBenignEnd != nil {
  3854  		_sqlite3Hooks.XxBenignEnd(tls)
  3855  	}
  3856  }
  3857  
  3858  // C comment
  3859  //  /*
  3860  //  ** Implementation of the sqlite3_pcache.xDestroy method.
  3861  //  **
  3862  //  ** Destroy a cache allocated using pcache1Create().
  3863  //  */
  3864  func _pcache1Destroy(tls *crt.TLS, _p unsafe.Pointer) {
  3865  	var _pCache *XPCache1
  3866  	var _pGroup *XPGroup
  3867  	_pCache = (*XPCache1)(_p)
  3868  	_pGroup = (*XPGroup)(_pCache.XpGroup)
  3869  	func() {
  3870  		if _pCache.XbPurgeable == 0 && (_pCache.XnMax != (0) || _pCache.XnMin != (0)) {
  3871  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46152), unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000), unsafe.Pointer(str(2494)))
  3872  			crt.X__builtin_abort(tls)
  3873  		}
  3874  	}()
  3875  	func() {
  3876  		if (*Xsqlite3_mutex)(_pGroup.Xmutex) != nil {
  3877  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46153), unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000), unsafe.Pointer(str(2384)))
  3878  			crt.X__builtin_abort(tls)
  3879  		}
  3880  	}()
  3881  	if _pCache.XnPage != 0 {
  3882  		_pcache1TruncateUnsafe(tls, _pCache, 0)
  3883  	}
  3884  	func() {
  3885  		if _pGroup.XnMaxPage < _pCache.XnMax {
  3886  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46155), unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000), unsafe.Pointer(str(2553)))
  3887  			crt.X__builtin_abort(tls)
  3888  		}
  3889  	}()
  3890  	_pGroup.XnMaxPage -= _pCache.XnMax
  3891  	func() {
  3892  		if _pGroup.XnMinPage < _pCache.XnMin {
  3893  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46157), unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000), unsafe.Pointer(str(2586)))
  3894  			crt.X__builtin_abort(tls)
  3895  		}
  3896  	}()
  3897  	_pGroup.XnMinPage -= _pCache.XnMin
  3898  	_pGroup.XmxPinned = (_pGroup.XnMaxPage + uint32(10)) - _pGroup.XnMinPage
  3899  	_pcache1EnforceMaxPage(tls, _pCache)
  3900  	func() {
  3901  		if (*Xsqlite3_mutex)(_pGroup.Xmutex) != nil {
  3902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46161), unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000), unsafe.Pointer(str(2384)))
  3903  			crt.X__builtin_abort(tls)
  3904  		}
  3905  	}()
  3906  	Xsqlite3_free(tls, _pCache.XpBulk)
  3907  	Xsqlite3_free(tls, unsafe.Pointer(_pCache.XapHash))
  3908  	Xsqlite3_free(tls, unsafe.Pointer(_pCache))
  3909  }
  3910  
  3911  var _pcache1DestroyØ00__func__Ø000 [15]int8
  3912  
  3913  func init() {
  3914  	crt.Xstrncpy(nil, &_pcache1DestroyØ00__func__Ø000[0], str(2619), 15)
  3915  }
  3916  
  3917  // C comment
  3918  //  /*
  3919  //  ** Discard all pages from cache pCache with a page number (key value)
  3920  //  ** greater than or equal to iLimit. Any pinned pages that meet this
  3921  //  ** criteria are unpinned before they are discarded.
  3922  //  **
  3923  //  ** The PCache mutex must be held when this function is called.
  3924  //  */
  3925  func _pcache1TruncateUnsafe(tls *crt.TLS, _pCache *XPCache1, _iLimit uint32) {
  3926  	var _nPage int32
  3927  	var _h, _iStop uint32
  3928  	var _3_pPage *XPgHdr1
  3929  	var _3_pp **XPgHdr1
  3930  	_nPage = int32(0)
  3931  	func() {
  3932  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex)) == 0 {
  3933  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45641), unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000), unsafe.Pointer(str(2634)))
  3934  			crt.X__builtin_abort(tls)
  3935  		}
  3936  	}()
  3937  	func() {
  3938  		if _pCache.XiMaxKey < _iLimit {
  3939  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45642), unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000), unsafe.Pointer(str(2676)))
  3940  			crt.X__builtin_abort(tls)
  3941  		}
  3942  	}()
  3943  	func() {
  3944  		if _pCache.XnHash <= (0) {
  3945  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45643), unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000), unsafe.Pointer(str(2702)))
  3946  			crt.X__builtin_abort(tls)
  3947  		}
  3948  	}()
  3949  	if (_pCache.XiMaxKey - _iLimit) < _pCache.XnHash {
  3950  		_h = _iLimit % _pCache.XnHash
  3951  		_iStop = _pCache.XiMaxKey % _pCache.XnHash
  3952  		_nPage = int32(-10)
  3953  		goto _7
  3954  	}
  3955  	_h = _pCache.XnHash / uint32(2)
  3956  	_iStop = _h - uint32(1)
  3957  _7:
  3958  	func() {
  3959  		if _h >= _pCache.XnHash {
  3960  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45661), unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000), unsafe.Pointer(str(2720)))
  3961  			crt.X__builtin_abort(tls)
  3962  		}
  3963  	}()
  3964  	_3_pp = elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_h))
  3965  _13:
  3966  	if store13(&_3_pPage, *_3_pp) == nil {
  3967  		goto _14
  3968  	}
  3969  	if _3_pPage.XiKey < _iLimit {
  3970  		goto _15
  3971  	}
  3972  	_pCache.XnPage -= 1
  3973  	*_3_pp = (*XPgHdr1)(_3_pPage.XpNext)
  3974  	if _3_pPage.XisPinned == 0 {
  3975  		_pcache1PinPage(tls, _3_pPage)
  3976  	}
  3977  	_pcache1FreePage(tls, _3_pPage)
  3978  	goto _17
  3979  _15:
  3980  	_3_pp = (**XPgHdr1)(unsafe.Pointer(&_3_pPage.XpNext))
  3981  	if _nPage >= int32(0) {
  3982  		_nPage += 1
  3983  	}
  3984  _17:
  3985  	goto _13
  3986  _14:
  3987  	if _h == _iStop {
  3988  		goto _10
  3989  	}
  3990  	_h = (_h + uint32(1)) % _pCache.XnHash
  3991  	goto _7
  3992  _10:
  3993  	func() {
  3994  		if _nPage >= int32(0) && _pCache.XnPage != uint32(_nPage) {
  3995  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45677), unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000), unsafe.Pointer(str(2736)))
  3996  			crt.X__builtin_abort(tls)
  3997  		}
  3998  	}()
  3999  }
  4000  
  4001  var _pcache1TruncateUnsafeØ00__func__Ø000 [22]int8
  4002  
  4003  func init() {
  4004  	crt.Xstrncpy(nil, &_pcache1TruncateUnsafeØ00__func__Ø000[0], str(2778), 22)
  4005  }
  4006  
  4007  // C comment
  4008  //  /*
  4009  //  ** This function is used internally to remove the page pPage from the
  4010  //  ** PGroup LRU list, if is part of it. If pPage is not part of the PGroup
  4011  //  ** LRU list, then this function is a no-op.
  4012  //  **
  4013  //  ** The PGroup mutex must be held when this function is called.
  4014  //  */
  4015  func _pcache1PinPage(tls *crt.TLS, _pPage *XPgHdr1) (r0 *XPgHdr1) {
  4016  	var _pCache *XPCache1
  4017  	func() {
  4018  		if _pPage == nil {
  4019  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45567), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2800)))
  4020  			crt.X__builtin_abort(tls)
  4021  		}
  4022  	}()
  4023  	func() {
  4024  		if int32(_pPage.XisPinned) != int32(0) {
  4025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45568), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2809)))
  4026  			crt.X__builtin_abort(tls)
  4027  		}
  4028  	}()
  4029  	_pCache = (*XPCache1)(_pPage.XpCache)
  4030  	func() {
  4031  		if _pPage.XpLruNext == nil {
  4032  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45570), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2828)))
  4033  			crt.X__builtin_abort(tls)
  4034  		}
  4035  	}()
  4036  	func() {
  4037  		if _pPage.XpLruPrev == nil {
  4038  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45571), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2844)))
  4039  			crt.X__builtin_abort(tls)
  4040  		}
  4041  	}()
  4042  	func() {
  4043  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex)) == 0 {
  4044  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45572), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2634)))
  4045  			crt.X__builtin_abort(tls)
  4046  		}
  4047  	}()
  4048  	*(**XPgHdr1)(unsafe.Pointer(&((*XPgHdr1)(_pPage.XpLruPrev).XpLruNext))) = (*XPgHdr1)(_pPage.XpLruNext)
  4049  	*(**XPgHdr1)(unsafe.Pointer(&((*XPgHdr1)(_pPage.XpLruNext).XpLruPrev))) = (*XPgHdr1)(_pPage.XpLruPrev)
  4050  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruNext)) = nil
  4051  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruPrev)) = nil
  4052  	_pPage.XisPinned = uint8(1)
  4053  	func() {
  4054  		if int32(_pPage.XisAnchor) != int32(0) {
  4055  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45578), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2860)))
  4056  			crt.X__builtin_abort(tls)
  4057  		}
  4058  	}()
  4059  	func() {
  4060  		if int32(((*XPGroup)(_pCache.XpGroup).Xlru).XisAnchor) != int32(1) {
  4061  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45579), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2879)))
  4062  			crt.X__builtin_abort(tls)
  4063  		}
  4064  	}()
  4065  	_pCache.XnRecyclable -= 1
  4066  	return _pPage
  4067  }
  4068  
  4069  var _pcache1PinPageØ00__func__Ø000 [15]int8
  4070  
  4071  func init() {
  4072  	crt.Xstrncpy(nil, &_pcache1PinPageØ00__func__Ø000[0], str(2911), 15)
  4073  }
  4074  
  4075  // C comment
  4076  //  /*
  4077  //  ** Free a page object allocated by pcache1AllocPage().
  4078  //  */
  4079  func _pcache1FreePage(tls *crt.TLS, _p *XPgHdr1) {
  4080  	var _pCache *XPCache1
  4081  	func() {
  4082  		if _p == nil {
  4083  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45456), unsafe.Pointer(&_pcache1FreePageØ00__func__Ø000), unsafe.Pointer(str(807)))
  4084  			crt.X__builtin_abort(tls)
  4085  		}
  4086  	}()
  4087  	_pCache = (*XPCache1)(_p.XpCache)
  4088  	func() {
  4089  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)((*XPCache1)(_p.XpCache).XpGroup).Xmutex)) == 0 {
  4090  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45458), unsafe.Pointer(&_pcache1FreePageØ00__func__Ø000), unsafe.Pointer(str(2926)))
  4091  			crt.X__builtin_abort(tls)
  4092  		}
  4093  	}()
  4094  	if _p.XisBulkLocal != 0 {
  4095  		*(**XPgHdr1)(unsafe.Pointer(&_p.XpNext)) = (*XPgHdr1)(_pCache.XpFree)
  4096  		*(**XPgHdr1)(unsafe.Pointer(&_pCache.XpFree)) = _p
  4097  		goto _5
  4098  	}
  4099  	_pcache1Free(tls, _p.Xpage.XpBuf)
  4100  _5:
  4101  	if _pCache.XbPurgeable != 0 {
  4102  		(*XPGroup)(_pCache.XpGroup).XnCurrentPage -= 1
  4103  	}
  4104  }
  4105  
  4106  var _pcache1FreePageØ00__func__Ø000 [16]int8
  4107  
  4108  func init() {
  4109  	crt.Xstrncpy(nil, &_pcache1FreePageØ00__func__Ø000[0], str(2971), 16)
  4110  }
  4111  
  4112  // C comment
  4113  //  /*
  4114  //  ** Free an allocated buffer obtained from pcache1Alloc().
  4115  //  */
  4116  func _pcache1Free(tls *crt.TLS, _p unsafe.Pointer) {
  4117  	var _3_nFreed int32
  4118  	var _1_pSlot *XScratchFreeslot
  4119  	if _p == nil {
  4120  		return
  4121  	}
  4122  	if (uint64(crt.P2U(_p)) >= uint64(crt.P2U(_pcache1_g.XpStart))) && (uint64(crt.P2U(_p)) < uint64(crt.P2U(_pcache1_g.XpEnd))) {
  4123  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4124  		_sqlite3StatusDown(tls, int32(1), int32(1))
  4125  		_1_pSlot = (*XScratchFreeslot)(_p)
  4126  		*(**XScratchFreeslot)(unsafe.Pointer(&_1_pSlot.XpNext)) = (*XScratchFreeslot)(_pcache1_g.XpFree)
  4127  		*(**XScratchFreeslot)(unsafe.Pointer(&_pcache1_g.XpFree)) = _1_pSlot
  4128  		_pcache1_g.XnFreeSlot += 1
  4129  		_pcache1_g.XbUnderPressure = bool2int(_pcache1_g.XnFreeSlot < _pcache1_g.XnReserve)
  4130  		func() {
  4131  			if _pcache1_g.XnFreeSlot > _pcache1_g.XnSlot {
  4132  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45365), unsafe.Pointer(&_pcache1FreeØ00__func__Ø000), unsafe.Pointer(str(2987)))
  4133  				crt.X__builtin_abort(tls)
  4134  			}
  4135  		}()
  4136  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4137  		goto _5
  4138  	}
  4139  
  4140  	_3_nFreed = int32(0)
  4141  	_3_nFreed = _sqlite3MallocSize(tls, _p)
  4142  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4143  	_sqlite3StatusDown(tls, int32(2), _3_nFreed)
  4144  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4145  	Xsqlite3_free(tls, _p)
  4146  _5:
  4147  }
  4148  
  4149  var _pcache1FreeØ00__func__Ø000 [12]int8
  4150  
  4151  func init() {
  4152  	crt.Xstrncpy(nil, &_pcache1FreeØ00__func__Ø000[0], str(3020), 12)
  4153  }
  4154  
  4155  // C comment
  4156  //  /*
  4157  //  ** If there are currently more than nMaxPage pages allocated, try
  4158  //  ** to recycle pages to reduce the number allocated to nMaxPage.
  4159  //  */
  4160  func _pcache1EnforceMaxPage(tls *crt.TLS, _pCache *XPCache1) {
  4161  	var _p *XPgHdr1
  4162  	var _pGroup *XPGroup
  4163  	_pGroup = (*XPGroup)(_pCache.XpGroup)
  4164  	func() {
  4165  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pGroup.Xmutex)) == 0 {
  4166  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45613), unsafe.Pointer(&_pcache1EnforceMaxPageØ00__func__Ø000), unsafe.Pointer(str(3032)))
  4167  			crt.X__builtin_abort(tls)
  4168  		}
  4169  	}()
  4170  _2:
  4171  	if (_pGroup.XnCurrentPage > _pGroup.XnMaxPage) && (int32(store13(&_p, (*XPgHdr1)(_pGroup.Xlru.XpLruPrev)).XisAnchor) == int32(0)) {
  4172  		func() {
  4173  			if (*XPGroup)((*XPCache1)(_p.XpCache).XpGroup) != _pGroup {
  4174  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45617), unsafe.Pointer(&_pcache1EnforceMaxPageØ00__func__Ø000), unsafe.Pointer(str(3066)))
  4175  				crt.X__builtin_abort(tls)
  4176  			}
  4177  		}()
  4178  		func() {
  4179  			if int32(_p.XisPinned) != int32(0) {
  4180  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45618), unsafe.Pointer(&_pcache1EnforceMaxPageØ00__func__Ø000), unsafe.Pointer(str(3092)))
  4181  				crt.X__builtin_abort(tls)
  4182  			}
  4183  		}()
  4184  		_pcache1PinPage(tls, _p)
  4185  		_pcache1RemoveFromHash(tls, _p, int32(1))
  4186  		goto _2
  4187  	}
  4188  	if (_pCache.XnPage == (0)) && (_pCache.XpBulk != nil) {
  4189  		Xsqlite3_free(tls, _pCache.XpBulk)
  4190  		_pCache.XpBulk = unsafe.Pointer(store13((**XPgHdr1)(unsafe.Pointer(&_pCache.XpFree)), nil))
  4191  	}
  4192  }
  4193  
  4194  var _pcache1EnforceMaxPageØ00__func__Ø000 [22]int8
  4195  
  4196  func init() {
  4197  	crt.Xstrncpy(nil, &_pcache1EnforceMaxPageØ00__func__Ø000[0], str(3107), 22)
  4198  }
  4199  
  4200  // C comment
  4201  //  /*
  4202  //  ** Remove the page supplied as an argument from the hash table
  4203  //  ** (PCache1.apHash structure) that it is currently stored in.
  4204  //  ** Also free the page if freePage is true.
  4205  //  **
  4206  //  ** The PGroup mutex must be held when this function is called.
  4207  //  */
  4208  func _pcache1RemoveFromHash(tls *crt.TLS, _pPage *XPgHdr1, _freeFlag int32) {
  4209  	var _h uint32
  4210  	var _pCache *XPCache1
  4211  	var _pp **XPgHdr1
  4212  	_pCache = (*XPCache1)(_pPage.XpCache)
  4213  	func() {
  4214  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex)) == 0 {
  4215  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45597), unsafe.Pointer(&_pcache1RemoveFromHashØ00__func__Ø000), unsafe.Pointer(str(2634)))
  4216  			crt.X__builtin_abort(tls)
  4217  		}
  4218  	}()
  4219  	_h = _pPage.XiKey % _pCache.XnHash
  4220  	_pp = elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_h))
  4221  _2:
  4222  	if (*_pp) == _pPage {
  4223  		goto _5
  4224  	}
  4225  	_pp = (**XPgHdr1)(unsafe.Pointer(&((*_pp).XpNext)))
  4226  	goto _2
  4227  _5:
  4228  	*_pp = (*XPgHdr1)((*_pp).XpNext)
  4229  	_pCache.XnPage -= 1
  4230  	if _freeFlag != 0 {
  4231  		_pcache1FreePage(tls, _pPage)
  4232  	}
  4233  }
  4234  
  4235  var _pcache1RemoveFromHashØ00__func__Ø000 [22]int8
  4236  
  4237  func init() {
  4238  	crt.Xstrncpy(nil, &_pcache1RemoveFromHashØ00__func__Ø000[0], str(3129), 22)
  4239  }
  4240  
  4241  // C comment
  4242  //  /*
  4243  //  ** Implementation of the sqlite3_pcache.xCachesize method.
  4244  //  **
  4245  //  ** Configure the cache_size limit for a cache.
  4246  //  */
  4247  func _pcache1Cachesize(tls *crt.TLS, _p unsafe.Pointer, _nMax int32) {
  4248  	var _pCache *XPCache1
  4249  	var _1_pGroup *XPGroup
  4250  	_pCache = (*XPCache1)(_p)
  4251  	if _pCache.XbPurgeable != 0 {
  4252  		_1_pGroup = (*XPGroup)(_pCache.XpGroup)
  4253  		func() {
  4254  			if (*Xsqlite3_mutex)(_1_pGroup.Xmutex) != nil {
  4255  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45804), unsafe.Pointer(&_pcache1CachesizeØ00__func__Ø000), unsafe.Pointer(str(2384)))
  4256  				crt.X__builtin_abort(tls)
  4257  			}
  4258  		}()
  4259  		_1_pGroup.XnMaxPage += uint32(_nMax) - _pCache.XnMax
  4260  		_1_pGroup.XmxPinned = (_1_pGroup.XnMaxPage + uint32(10)) - _1_pGroup.XnMinPage
  4261  		_pCache.XnMax = uint32(_nMax)
  4262  		_pCache.Xn90pct = (_pCache.XnMax * uint32(9)) / uint32(10)
  4263  		_pcache1EnforceMaxPage(tls, _pCache)
  4264  		func() {
  4265  			if (*Xsqlite3_mutex)(_1_pGroup.Xmutex) != nil {
  4266  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45810), unsafe.Pointer(&_pcache1CachesizeØ00__func__Ø000), unsafe.Pointer(str(2384)))
  4267  				crt.X__builtin_abort(tls)
  4268  			}
  4269  		}()
  4270  	}
  4271  }
  4272  
  4273  var _pcache1CachesizeØ00__func__Ø000 [17]int8
  4274  
  4275  func init() {
  4276  	crt.Xstrncpy(nil, &_pcache1CachesizeØ00__func__Ø000[0], str(3151), 17)
  4277  }
  4278  
  4279  // C comment
  4280  //  /*
  4281  //  ** Implementation of the sqlite3_pcache.xPagecount method.
  4282  //  */
  4283  func _pcache1Pagecount(tls *crt.TLS, _p unsafe.Pointer) (r0 int32) {
  4284  	var _n int32
  4285  	var _pCache *XPCache1
  4286  	_pCache = (*XPCache1)(_p)
  4287  	func() {
  4288  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4289  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45839), unsafe.Pointer(&_pcache1PagecountØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4290  			crt.X__builtin_abort(tls)
  4291  		}
  4292  	}()
  4293  	_n = int32(_pCache.XnPage)
  4294  	func() {
  4295  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4296  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45841), unsafe.Pointer(&_pcache1PagecountØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4297  			crt.X__builtin_abort(tls)
  4298  		}
  4299  	}()
  4300  	return _n
  4301  }
  4302  
  4303  var _pcache1PagecountØ00__func__Ø000 [17]int8
  4304  
  4305  func init() {
  4306  	crt.Xstrncpy(nil, &_pcache1PagecountØ00__func__Ø000[0], str(3195), 17)
  4307  }
  4308  
  4309  func _pcache1Fetch(tls *crt.TLS, _p unsafe.Pointer, _iKey uint32, _createFlag int32) (r0 *Xsqlite3_pcache_page) {
  4310  	var _pCache *XPCache1
  4311  	_pCache = (*XPCache1)(_p)
  4312  
  4313  	func() {
  4314  		if _pCache.XbPurgeable == 0 && _createFlag == int32(1) {
  4315  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46037), unsafe.Pointer(&_pcache1FetchØ00__func__Ø000), unsafe.Pointer(str(3212)))
  4316  			crt.X__builtin_abort(tls)
  4317  		}
  4318  	}()
  4319  	func() {
  4320  		if _pCache.XbPurgeable == 0 && _pCache.XnMin != (0) {
  4321  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46038), unsafe.Pointer(&_pcache1FetchØ00__func__Ø000), unsafe.Pointer(str(3248)))
  4322  			crt.X__builtin_abort(tls)
  4323  		}
  4324  	}()
  4325  	func() {
  4326  		if _pCache.XbPurgeable != int32(0) && _pCache.XnMin != uint32(10) {
  4327  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46039), unsafe.Pointer(&_pcache1FetchØ00__func__Ø000), unsafe.Pointer(str(3286)))
  4328  			crt.X__builtin_abort(tls)
  4329  		}
  4330  	}()
  4331  	func() {
  4332  		if _pCache.XnMin != (0) && _pCache.XbPurgeable == 0 {
  4333  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46040), unsafe.Pointer(&_pcache1FetchØ00__func__Ø000), unsafe.Pointer(str(3328)))
  4334  			crt.X__builtin_abort(tls)
  4335  		}
  4336  	}()
  4337  	func() {
  4338  		if _pCache.XnHash <= (0) {
  4339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46041), unsafe.Pointer(&_pcache1FetchØ00__func__Ø000), unsafe.Pointer(str(3366)))
  4340  			crt.X__builtin_abort(tls)
  4341  		}
  4342  	}()
  4343  	return (*Xsqlite3_pcache_page)(unsafe.Pointer(_pcache1FetchNoMutex(tls, _p, _iKey, _createFlag)))
  4344  }
  4345  
  4346  var _pcache1FetchØ00__func__Ø000 [13]int8
  4347  
  4348  func init() {
  4349  	crt.Xstrncpy(nil, &_pcache1FetchØ00__func__Ø000[0], str(3382), 13)
  4350  }
  4351  
  4352  // C comment
  4353  //  /*
  4354  //  ** Implementation of the sqlite3_pcache.xFetch method.
  4355  //  **
  4356  //  ** Fetch a page by key value.
  4357  //  **
  4358  //  ** Whether or not a new page may be allocated by this function depends on
  4359  //  ** the value of the createFlag argument.  0 means do not allocate a new
  4360  //  ** page.  1 means allocate a new page if space is easily available.  2
  4361  //  ** means to try really hard to allocate a new page.
  4362  //  **
  4363  //  ** For a non-purgeable cache (a cache used as the storage for an in-memory
  4364  //  ** database) there is really no difference between createFlag 1 and 2.  So
  4365  //  ** the calling function (pcache.c) will never have a createFlag of 1 on
  4366  //  ** a non-purgeable cache.
  4367  //  **
  4368  //  ** There are three different approaches to obtaining space for a page,
  4369  //  ** depending on the value of parameter createFlag (which may be 0, 1 or 2).
  4370  //  **
  4371  //  **   1. Regardless of the value of createFlag, the cache is searched for a
  4372  //  **      copy of the requested page. If one is found, it is returned.
  4373  //  **
  4374  //  **   2. If createFlag==0 and the page is not already in the cache, NULL is
  4375  //  **      returned.
  4376  //  **
  4377  //  **   3. If createFlag is 1, and the page is not already in the cache, then
  4378  //  **      return NULL (do not allocate a new page) if any of the following
  4379  //  **      conditions are true:
  4380  //  **
  4381  //  **       (a) the number of pages pinned by the cache is greater than
  4382  //  **           PCache1.nMax, or
  4383  //  **
  4384  //  **       (b) the number of pages pinned by the cache is greater than
  4385  //  **           the sum of nMax for all purgeable caches, less the sum of
  4386  //  **           nMin for all other purgeable caches, or
  4387  //  **
  4388  //  **   4. If none of the first three conditions apply and the cache is marked
  4389  //  **      as purgeable, and if one of the following is true:
  4390  //  **
  4391  //  **       (a) The number of pages allocated for the cache is already
  4392  //  **           PCache1.nMax, or
  4393  //  **
  4394  //  **       (b) The number of pages allocated for all purgeable caches is
  4395  //  **           already equal to or greater than the sum of nMax for all
  4396  //  **           purgeable caches,
  4397  //  **
  4398  //  **       (c) The system is under memory pressure and wants to avoid
  4399  //  **           unnecessary pages cache entry allocations
  4400  //  **
  4401  //  **      then attempt to recycle a page from the LRU list. If it is the right
  4402  //  **      size, return the recycled buffer. Otherwise, free the buffer and
  4403  //  **      proceed to step 5.
  4404  //  **
  4405  //  **   5. Otherwise, allocate and return a new page buffer.
  4406  //  **
  4407  //  ** There are two versions of this routine.  pcache1FetchWithMutex() is
  4408  //  ** the general case.  pcache1FetchNoMutex() is a faster implementation for
  4409  //  ** the common case where pGroup->mutex is NULL.  The pcache1Fetch() wrapper
  4410  //  ** invokes the appropriate routine.
  4411  //  */
  4412  func _pcache1FetchNoMutex(tls *crt.TLS, _p unsafe.Pointer, _iKey uint32, _createFlag int32) (r0 *XPgHdr1) {
  4413  	var _pCache *XPCache1
  4414  	var _pPage *XPgHdr1
  4415  	_pCache = (*XPCache1)(_p)
  4416  	_pPage = nil
  4417  	_pPage = *elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_iKey%_pCache.XnHash))
  4418  _0:
  4419  	if (_pPage != nil) && (_pPage.XiKey != _iKey) {
  4420  		_pPage = (*XPgHdr1)(_pPage.XpNext)
  4421  		goto _0
  4422  	}
  4423  	if _pPage == nil {
  4424  		goto _3
  4425  	}
  4426  	if _pPage.XisPinned == 0 {
  4427  		return _pcache1PinPage(tls, _pPage)
  4428  	}
  4429  	return _pPage
  4430  
  4431  _3:
  4432  	if _createFlag != 0 {
  4433  		return _pcache1FetchStage2(tls, _pCache, _iKey, _createFlag)
  4434  	}
  4435  	return nil
  4436  }
  4437  
  4438  // C comment
  4439  //  /*
  4440  //  ** Implement steps 3, 4, and 5 of the pcache1Fetch() algorithm described
  4441  //  ** in the header of the pcache1Fetch() procedure.
  4442  //  **
  4443  //  ** This steps are broken out into a separate procedure because they are
  4444  //  ** usually not needed, and by avoiding the stack initialization required
  4445  //  ** for these steps, the main pcache1Fetch() procedure can run faster.
  4446  //  */
  4447  func _pcache1FetchStage2(tls *crt.TLS, _pCache *XPCache1, _iKey uint32, _createFlag int32) (r0 *XPgHdr1) {
  4448  	var _nPinned, _6_h uint32
  4449  	var _2_pOther *XPCache1
  4450  	var _pPage *XPgHdr1
  4451  	var _pGroup *XPGroup
  4452  	_pGroup = (*XPGroup)(_pCache.XpGroup)
  4453  	_pPage = nil
  4454  	func() {
  4455  		if _pCache.XnPage < _pCache.XnRecyclable {
  4456  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45864), unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000), unsafe.Pointer(str(3395)))
  4457  			crt.X__builtin_abort(tls)
  4458  		}
  4459  	}()
  4460  	_nPinned = _pCache.XnPage - _pCache.XnRecyclable
  4461  	func() {
  4462  		if _pGroup.XmxPinned != ((_pGroup.XnMaxPage + uint32(10)) - _pGroup.XnMinPage) {
  4463  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45866), unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000), unsafe.Pointer(str(3432)))
  4464  			crt.X__builtin_abort(tls)
  4465  		}
  4466  	}()
  4467  	func() {
  4468  		if _pCache.Xn90pct != ((_pCache.XnMax * uint32(9)) / uint32(10)) {
  4469  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45867), unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000), unsafe.Pointer(str(3493)))
  4470  			crt.X__builtin_abort(tls)
  4471  		}
  4472  	}()
  4473  	if (_createFlag == int32(1)) && (((_nPinned >= _pGroup.XmxPinned) || (_nPinned >= _pCache.Xn90pct)) || (_pcache1UnderMemoryPressure(tls, _pCache) != 0 && (_pCache.XnRecyclable < _nPinned))) {
  4474  		return nil
  4475  	}
  4476  	if _pCache.XnPage >= _pCache.XnHash {
  4477  		_pcache1ResizeHash(tls, _pCache)
  4478  	}
  4479  	func() {
  4480  		if _pCache.XnHash <= (0) || _pCache.XapHash == nil {
  4481  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45877), unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000), unsafe.Pointer(str(3529)))
  4482  			crt.X__builtin_abort(tls)
  4483  		}
  4484  	}()
  4485  	if _pCache.XbPurgeable == 0 || ((*XPgHdr1)(_pGroup.Xlru.XpLruPrev).XisAnchor) != 0 || (_pCache.XnPage+uint32(1)) < _pCache.XnMax && _pcache1UnderMemoryPressure(tls, _pCache) == 0 {
  4486  		goto _18
  4487  	}
  4488  	_pPage = (*XPgHdr1)(_pGroup.Xlru.XpLruPrev)
  4489  	func() {
  4490  		if int32(_pPage.XisPinned) != int32(0) {
  4491  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45886), unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000), unsafe.Pointer(str(2809)))
  4492  			crt.X__builtin_abort(tls)
  4493  		}
  4494  	}()
  4495  	_pcache1RemoveFromHash(tls, _pPage, int32(0))
  4496  	_pcache1PinPage(tls, _pPage)
  4497  	_2_pOther = (*XPCache1)(_pPage.XpCache)
  4498  	if _2_pOther.XszAlloc != _pCache.XszAlloc {
  4499  		_pcache1FreePage(tls, _pPage)
  4500  		_pPage = nil
  4501  		goto _22
  4502  	}
  4503  	_pGroup.XnCurrentPage -= uint32(_2_pOther.XbPurgeable - _pCache.XbPurgeable)
  4504  _22:
  4505  _18:
  4506  	if _pPage == nil {
  4507  		_pPage = _pcache1AllocPage(tls, _pCache, bool2int(_createFlag == int32(1)))
  4508  	}
  4509  	if _pPage == nil {
  4510  		goto _24
  4511  	}
  4512  	_6_h = _iKey % _pCache.XnHash
  4513  	_pCache.XnPage += 1
  4514  	_pPage.XiKey = _iKey
  4515  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpNext)) = *elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_6_h))
  4516  	*(**XPCache1)(unsafe.Pointer(&_pPage.XpCache)) = _pCache
  4517  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruPrev)) = nil
  4518  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruNext)) = nil
  4519  	_pPage.XisPinned = uint8(1)
  4520  	*(*unsafe.Pointer)(_pPage.Xpage.XpExtra) = nil
  4521  	*elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_6_h)) = _pPage
  4522  	if _iKey > _pCache.XiMaxKey {
  4523  		_pCache.XiMaxKey = _iKey
  4524  	}
  4525  _24:
  4526  	return _pPage
  4527  }
  4528  
  4529  var _pcache1FetchStage2Ø00__func__Ø000 [19]int8
  4530  
  4531  func init() {
  4532  	crt.Xstrncpy(nil, &_pcache1FetchStage2Ø00__func__Ø000[0], str(3563), 19)
  4533  }
  4534  
  4535  // C comment
  4536  //  /*
  4537  //  ** Return true if it desirable to avoid allocating a new page cache
  4538  //  ** entry.
  4539  //  **
  4540  //  ** If memory was allocated specifically to the page cache using
  4541  //  ** SQLITE_CONFIG_PAGECACHE but that memory has all been used, then
  4542  //  ** it is desirable to avoid allocating a new page cache entry because
  4543  //  ** presumably SQLITE_CONFIG_PAGECACHE was suppose to be sufficient
  4544  //  ** for all page cache needs and we should not need to spill the
  4545  //  ** allocation onto the heap.
  4546  //  **
  4547  //  ** Or, the heap is used for all page cache memory but the heap is
  4548  //  ** under memory pressure, then again it is desirable to avoid
  4549  //  ** allocating a new page cache entry in order to avoid stressing
  4550  //  ** the heap even further.
  4551  //  */
  4552  func _pcache1UnderMemoryPressure(tls *crt.TLS, _pCache *XPCache1) (r0 int32) {
  4553  	if _pcache1_g.XnSlot != 0 && ((_pCache.XszPage + _pCache.XszExtra) <= _pcache1_g.XszSlot) {
  4554  		return _pcache1_g.XbUnderPressure
  4555  	}
  4556  	return _sqlite3HeapNearlyFull(tls)
  4557  }
  4558  
  4559  // C comment
  4560  //  /*
  4561  //  ** Return true if the heap is currently under memory pressure - in other
  4562  //  ** words if the amount of heap used is close to the limit set by
  4563  //  ** sqlite3_soft_heap_limit().
  4564  //  */
  4565  func _sqlite3HeapNearlyFull(tls *crt.TLS) (r0 int32) {
  4566  	return _mem0.XnearlyFull
  4567  }
  4568  
  4569  // C comment
  4570  //  /*
  4571  //  ** Allocate a new page object initially associated with cache pCache.
  4572  //  */
  4573  func _pcache1AllocPage(tls *crt.TLS, _pCache *XPCache1, _benignMalloc int32) (r0 *XPgHdr1) {
  4574  	var _pPg unsafe.Pointer
  4575  	var _p *XPgHdr1
  4576  	_p = nil
  4577  	func() {
  4578  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex)) == 0 {
  4579  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45408), unsafe.Pointer(&_pcache1AllocPageØ00__func__Ø000), unsafe.Pointer(str(2634)))
  4580  			crt.X__builtin_abort(tls)
  4581  		}
  4582  	}()
  4583  	if (_pCache.XpFree != nil) || ((_pCache.XnPage == (0)) && _pcache1InitBulk(tls, _pCache) != 0) {
  4584  		_p = (*XPgHdr1)(_pCache.XpFree)
  4585  		*(**XPgHdr1)(unsafe.Pointer(&_pCache.XpFree)) = (*XPgHdr1)(_p.XpNext)
  4586  		*(**XPgHdr1)(unsafe.Pointer(&_p.XpNext)) = nil
  4587  		goto _5
  4588  	}
  4589  	if _benignMalloc != 0 {
  4590  		_sqlite3BeginBenignMalloc(tls)
  4591  	}
  4592  	_pPg = _pcache1Alloc(tls, _pCache.XszAlloc)
  4593  	_p = (*XPgHdr1)(unsafe.Pointer(elem15((*uint8)(_pPg), uintptr(_pCache.XszPage))))
  4594  	if _benignMalloc != 0 {
  4595  		_sqlite3EndBenignMalloc(tls)
  4596  	}
  4597  	if _pPg == nil {
  4598  		return nil
  4599  	}
  4600  	_p.Xpage.XpBuf = _pPg
  4601  	_p.Xpage.XpExtra = unsafe.Pointer(elem13(_p, uintptr(1)))
  4602  	_p.XisBulkLocal = 0
  4603  	_p.XisAnchor = 0
  4604  _5:
  4605  	if _pCache.XbPurgeable != 0 {
  4606  		(*XPGroup)(_pCache.XpGroup).XnCurrentPage += 1
  4607  	}
  4608  	return _p
  4609  }
  4610  
  4611  var _pcache1AllocPageØ00__func__Ø000 [17]int8
  4612  
  4613  func init() {
  4614  	crt.Xstrncpy(nil, &_pcache1AllocPageØ00__func__Ø000[0], str(3582), 17)
  4615  }
  4616  
  4617  // C comment
  4618  //  /*
  4619  //  ** Try to initialize the pCache->pFree and pCache->pBulk fields.  Return
  4620  //  ** true if pCache->pFree ends up containing one or more free pages.
  4621  //  */
  4622  func _pcache1InitBulk(tls *crt.TLS, _pCache *XPCache1) (r0 int32) {
  4623  	var _4_nBulk int32
  4624  	var _szBulk int64
  4625  	var _zBulk *int8
  4626  	var _5_pX *XPgHdr1
  4627  	if _pcache1_g.XnInitPage == int32(0) {
  4628  		return int32(0)
  4629  	}
  4630  	if _pCache.XnMax < uint32(3) {
  4631  		return int32(0)
  4632  	}
  4633  	_sqlite3BeginBenignMalloc(tls)
  4634  	if _pcache1_g.XnInitPage > int32(0) {
  4635  		_szBulk = int64(_pCache.XszAlloc) * int64(_pcache1_g.XnInitPage)
  4636  		goto _3
  4637  	}
  4638  	_szBulk = int64(-1024) * int64(_pcache1_g.XnInitPage)
  4639  _3:
  4640  	if _szBulk > (int64(_pCache.XszAlloc) * int64(_pCache.XnMax)) {
  4641  		_szBulk = int64(_pCache.XszAlloc) * int64(_pCache.XnMax)
  4642  	}
  4643  	_zBulk = (*int8)(store16(&_pCache.XpBulk, _sqlite3Malloc(tls, uint64(_szBulk))))
  4644  	_sqlite3EndBenignMalloc(tls)
  4645  	if _zBulk == nil {
  4646  		goto _5
  4647  	}
  4648  	_4_nBulk = _sqlite3MallocSize(tls, unsafe.Pointer(_zBulk)) / _pCache.XszAlloc
  4649  _6:
  4650  	_5_pX = (*XPgHdr1)(unsafe.Pointer(elem1(_zBulk, uintptr(_pCache.XszPage))))
  4651  	_5_pX.Xpage.XpBuf = unsafe.Pointer(_zBulk)
  4652  	_5_pX.Xpage.XpExtra = unsafe.Pointer(elem13(_5_pX, uintptr(1)))
  4653  	_5_pX.XisBulkLocal = uint8(1)
  4654  	_5_pX.XisAnchor = 0
  4655  	*(**XPgHdr1)(unsafe.Pointer(&_5_pX.XpNext)) = (*XPgHdr1)(_pCache.XpFree)
  4656  	*(**XPgHdr1)(unsafe.Pointer(&_pCache.XpFree)) = _5_pX
  4657  	*(*uintptr)(unsafe.Pointer(&_zBulk)) += uintptr(_pCache.XszAlloc)
  4658  	if preInc2(&_4_nBulk, -1) != 0 {
  4659  		goto _6
  4660  	}
  4661  _5:
  4662  	return bool2int((*XPgHdr1)(_pCache.XpFree) != nil)
  4663  
  4664  	_ = _4_nBulk
  4665  	panic(0)
  4666  }
  4667  
  4668  // C comment
  4669  //  /*
  4670  //  ** Malloc function used within this file to allocate space from the buffer
  4671  //  ** configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no
  4672  //  ** such buffer exists or there is no space left in it, this function falls
  4673  //  ** back to sqlite3Malloc().
  4674  //  **
  4675  //  ** Multiple threads can run this routine at the same time.  Global variables
  4676  //  ** in pcache1 need to be protected via mutex.
  4677  //  */
  4678  func _pcache1Alloc(tls *crt.TLS, _nByte int32) (r0 unsafe.Pointer) {
  4679  	var _4_sz int32
  4680  	var _p unsafe.Pointer
  4681  	_p = nil
  4682  	func() {
  4683  		if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)(_pcache1_g.Xgrp.Xmutex)) == 0 {
  4684  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45318), unsafe.Pointer(&_pcache1AllocØ00__func__Ø000), unsafe.Pointer(str(3599)))
  4685  			crt.X__builtin_abort(tls)
  4686  		}
  4687  	}()
  4688  	if _nByte > _pcache1_g.XszSlot {
  4689  		goto _2
  4690  	}
  4691  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4692  	_p = _pcache1_g.XpFree
  4693  	if _p != nil {
  4694  		*(**XScratchFreeslot)(unsafe.Pointer(&_pcache1_g.XpFree)) = (*XScratchFreeslot)((*XScratchFreeslot)(_pcache1_g.XpFree).XpNext)
  4695  		_pcache1_g.XnFreeSlot -= 1
  4696  		_pcache1_g.XbUnderPressure = bool2int(_pcache1_g.XnFreeSlot < _pcache1_g.XnReserve)
  4697  		func() {
  4698  			if _pcache1_g.XnFreeSlot < int32(0) {
  4699  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45326), unsafe.Pointer(&_pcache1AllocØ00__func__Ø000), unsafe.Pointer(str(3640)))
  4700  				crt.X__builtin_abort(tls)
  4701  			}
  4702  		}()
  4703  		_sqlite3StatusHighwater(tls, int32(7), _nByte)
  4704  		_sqlite3StatusUp(tls, int32(1), int32(1))
  4705  	}
  4706  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4707  _2:
  4708  	if _p != nil {
  4709  		goto _6
  4710  	}
  4711  	_p = _sqlite3Malloc(tls, uint64(_nByte))
  4712  	if _p != nil {
  4713  		_4_sz = _sqlite3MallocSize(tls, _p)
  4714  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4715  		_sqlite3StatusHighwater(tls, int32(7), _nByte)
  4716  		_sqlite3StatusUp(tls, int32(2), _4_sz)
  4717  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4718  	}
  4719  _6:
  4720  	return _p
  4721  }
  4722  
  4723  func Xsqlite3_mutex_notheld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
  4724  	func() {
  4725  		if _p != nil && (_sqlite3Config.Xmutex.XxMutexNotheld) == nil {
  4726  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22906), unsafe.Pointer(&_sqlite3_mutex_notheldØ00__func__Ø000), unsafe.Pointer(str(3661)))
  4727  			crt.X__builtin_abort(tls)
  4728  		}
  4729  	}()
  4730  	return bool2int((_p == nil) || func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
  4731  		v := _sqlite3Config.Xmutex.XxMutexNotheld
  4732  		return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
  4733  	}()(tls, _p) != 0)
  4734  }
  4735  
  4736  var _sqlite3_mutex_notheldØ00__func__Ø000 [22]int8
  4737  
  4738  func init() {
  4739  	crt.Xstrncpy(nil, &_sqlite3_mutex_notheldØ00__func__Ø000[0], str(3709), 22)
  4740  }
  4741  
  4742  var _pcache1AllocØ00__func__Ø000 [13]int8
  4743  
  4744  func init() {
  4745  	crt.Xstrncpy(nil, &_pcache1AllocØ00__func__Ø000[0], str(3731), 13)
  4746  }
  4747  
  4748  // C comment
  4749  //  /*
  4750  //  ** Implementation of the sqlite3_pcache.xUnpin method.
  4751  //  **
  4752  //  ** Mark a page as unpinned (eligible for asynchronous recycling).
  4753  //  */
  4754  func _pcache1Unpin(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, _reuseUnlikely int32) {
  4755  	var _pCache *XPCache1
  4756  	var _pPage *XPgHdr1
  4757  	var _2_ppFirst **XPgHdr1
  4758  	var _pGroup *XPGroup
  4759  	_pCache = (*XPCache1)(_p)
  4760  	_pPage = (*XPgHdr1)(unsafe.Pointer(_pPg))
  4761  	_pGroup = (*XPGroup)(_pCache.XpGroup)
  4762  	func() {
  4763  		if (*XPCache1)(_pPage.XpCache) != _pCache {
  4764  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46067), unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000), unsafe.Pointer(str(3744)))
  4765  			crt.X__builtin_abort(tls)
  4766  		}
  4767  	}()
  4768  	func() {
  4769  		if (*Xsqlite3_mutex)(_pGroup.Xmutex) != nil {
  4770  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46068), unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000), unsafe.Pointer(str(2384)))
  4771  			crt.X__builtin_abort(tls)
  4772  		}
  4773  	}()
  4774  	func() {
  4775  		if (*XPgHdr1)(_pPage.XpLruPrev) != nil || (*XPgHdr1)(_pPage.XpLruNext) != nil {
  4776  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46073), unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000), unsafe.Pointer(str(3766)))
  4777  			crt.X__builtin_abort(tls)
  4778  		}
  4779  	}()
  4780  	func() {
  4781  		if int32(_pPage.XisPinned) != int32(1) {
  4782  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46074), unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000), unsafe.Pointer(str(3807)))
  4783  			crt.X__builtin_abort(tls)
  4784  		}
  4785  	}()
  4786  	if _reuseUnlikely != 0 || (_pGroup.XnCurrentPage > _pGroup.XnMaxPage) {
  4787  		_pcache1RemoveFromHash(tls, _pPage, int32(1))
  4788  		goto _11
  4789  	}
  4790  	_2_ppFirst = (**XPgHdr1)(unsafe.Pointer(&(_pGroup.Xlru.XpLruNext)))
  4791  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruPrev)) = &_pGroup.Xlru
  4792  	*(**XPgHdr1)(unsafe.Pointer(&(store13((**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruNext)), *_2_ppFirst).XpLruPrev))) = _pPage
  4793  	*_2_ppFirst = _pPage
  4794  	_pCache.XnRecyclable += 1
  4795  	_pPage.XisPinned = 0
  4796  _11:
  4797  	func() {
  4798  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4799  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46088), unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4800  			crt.X__builtin_abort(tls)
  4801  		}
  4802  	}()
  4803  }
  4804  
  4805  var _pcache1UnpinØ00__func__Ø000 [13]int8
  4806  
  4807  func init() {
  4808  	crt.Xstrncpy(nil, &_pcache1UnpinØ00__func__Ø000[0], str(3826), 13)
  4809  }
  4810  
  4811  // C comment
  4812  //  /*
  4813  //  ** Implementation of the sqlite3_pcache.xRekey method.
  4814  //  */
  4815  func _pcache1Rekey(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, _iOld uint32, _iNew uint32) {
  4816  	var _h uint32
  4817  	var _pCache *XPCache1
  4818  	var _pPage *XPgHdr1
  4819  	var _pp **XPgHdr1
  4820  	_pCache = (*XPCache1)(_p)
  4821  	_pPage = (*XPgHdr1)(unsafe.Pointer(_pPg))
  4822  	func() {
  4823  		if _pPage.XiKey != _iOld {
  4824  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46104), unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000), unsafe.Pointer(str(3839)))
  4825  			crt.X__builtin_abort(tls)
  4826  		}
  4827  	}()
  4828  	func() {
  4829  		if (*XPCache1)(_pPage.XpCache) != _pCache {
  4830  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46105), unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000), unsafe.Pointer(str(3744)))
  4831  			crt.X__builtin_abort(tls)
  4832  		}
  4833  	}()
  4834  	func() {
  4835  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4836  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46107), unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4837  			crt.X__builtin_abort(tls)
  4838  		}
  4839  	}()
  4840  	_h = _iOld % _pCache.XnHash
  4841  	_pp = elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_h))
  4842  _6:
  4843  	if (*_pp) != _pPage {
  4844  		_pp = (**XPgHdr1)(unsafe.Pointer(&((*_pp).XpNext)))
  4845  		goto _6
  4846  	}
  4847  	*_pp = (*XPgHdr1)(_pPage.XpNext)
  4848  	_h = _iNew % _pCache.XnHash
  4849  	_pPage.XiKey = _iNew
  4850  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpNext)) = *elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_h))
  4851  	*elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_h)) = _pPage
  4852  	if _iNew > _pCache.XiMaxKey {
  4853  		_pCache.XiMaxKey = _iNew
  4854  	}
  4855  	func() {
  4856  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4857  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46124), unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4858  			crt.X__builtin_abort(tls)
  4859  		}
  4860  	}()
  4861  }
  4862  
  4863  var _pcache1RekeyØ00__func__Ø000 [13]int8
  4864  
  4865  func init() {
  4866  	crt.Xstrncpy(nil, &_pcache1RekeyØ00__func__Ø000[0], str(3857), 13)
  4867  }
  4868  
  4869  // C comment
  4870  //  /*
  4871  //  ** Implementation of the sqlite3_pcache.xTruncate method.
  4872  //  **
  4873  //  ** Discard all unpinned pages in the cache with a page number equal to
  4874  //  ** or greater than parameter iLimit. Any pinned pages with a page number
  4875  //  ** equal to or greater than iLimit are implicitly unpinned.
  4876  //  */
  4877  func _pcache1Truncate(tls *crt.TLS, _p unsafe.Pointer, _iLimit uint32) {
  4878  	var _pCache *XPCache1
  4879  	_pCache = (*XPCache1)(_p)
  4880  	func() {
  4881  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4882  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46136), unsafe.Pointer(&_pcache1TruncateØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4883  			crt.X__builtin_abort(tls)
  4884  		}
  4885  	}()
  4886  	if _iLimit <= _pCache.XiMaxKey {
  4887  		_pcache1TruncateUnsafe(tls, _pCache, _iLimit)
  4888  		_pCache.XiMaxKey = _iLimit - uint32(1)
  4889  	}
  4890  	func() {
  4891  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4892  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46141), unsafe.Pointer(&_pcache1TruncateØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4893  			crt.X__builtin_abort(tls)
  4894  		}
  4895  	}()
  4896  }
  4897  
  4898  var _pcache1TruncateØ00__func__Ø000 [16]int8
  4899  
  4900  func init() {
  4901  	crt.Xstrncpy(nil, &_pcache1TruncateØ00__func__Ø000[0], str(3870), 16)
  4902  }
  4903  
  4904  // C comment
  4905  //  /*
  4906  //  ** Implementation of the sqlite3_pcache.xShrink method.
  4907  //  **
  4908  //  ** Free up as much memory as possible.
  4909  //  */
  4910  func _pcache1Shrink(tls *crt.TLS, _p unsafe.Pointer) {
  4911  	var _1_savedMaxPage int32
  4912  	var _pCache *XPCache1
  4913  	var _1_pGroup *XPGroup
  4914  	_pCache = (*XPCache1)(_p)
  4915  	if _pCache.XbPurgeable != 0 {
  4916  		_1_pGroup = (*XPGroup)(_pCache.XpGroup)
  4917  		func() {
  4918  			if (*Xsqlite3_mutex)(_1_pGroup.Xmutex) != nil {
  4919  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45824), unsafe.Pointer(&_pcache1ShrinkØ00__func__Ø000), unsafe.Pointer(str(2384)))
  4920  				crt.X__builtin_abort(tls)
  4921  			}
  4922  		}()
  4923  		_1_savedMaxPage = int32(_1_pGroup.XnMaxPage)
  4924  		_1_pGroup.XnMaxPage = 0
  4925  		_pcache1EnforceMaxPage(tls, _pCache)
  4926  		_1_pGroup.XnMaxPage = uint32(_1_savedMaxPage)
  4927  		func() {
  4928  			if (*Xsqlite3_mutex)(_1_pGroup.Xmutex) != nil {
  4929  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45829), unsafe.Pointer(&_pcache1ShrinkØ00__func__Ø000), unsafe.Pointer(str(2384)))
  4930  				crt.X__builtin_abort(tls)
  4931  			}
  4932  		}()
  4933  	}
  4934  }
  4935  
  4936  var _pcache1ShrinkØ00__func__Ø000 [14]int8
  4937  
  4938  func init() {
  4939  	crt.Xstrncpy(nil, &_pcache1ShrinkØ00__func__Ø000[0], str(3886), 14)
  4940  }
  4941  
  4942  var _sqlite3MemSetDefaultØ00defaultMethodsØ001 Xsqlite3_mem_methods
  4943  
  4944  func init() {
  4945  	_sqlite3MemSetDefaultØ00defaultMethodsØ001 = Xsqlite3_mem_methods{XxMalloc: _sqlite3MemMalloc, XxFree: _sqlite3MemFree, XxRealloc: _sqlite3MemRealloc, XxSize: _sqlite3MemSize, XxRoundup: _sqlite3MemRoundup, XxInit: _sqlite3MemInit, XxShutdown: _sqlite3MemShutdown}
  4946  }
  4947  
  4948  // C comment
  4949  //  /*
  4950  //  ** Like malloc(), but remember the size of the allocation
  4951  //  ** so that we can find it later using sqlite3MemSize().
  4952  //  **
  4953  //  ** For this low-level routine, we are guaranteed that nByte>0 because
  4954  //  ** cases of nByte<=0 will be intercepted and dealt with by higher level
  4955  //  ** routines.
  4956  //  */
  4957  func _sqlite3MemMalloc(tls *crt.TLS, _nByte int32) (r0 unsafe.Pointer) {
  4958  	var _p unsafe.Pointer
  4959  	_p = crt.Xmalloc(tls, uint64(_nByte))
  4960  	if _p == nil {
  4961  		Xsqlite3_log(tls, int32(7), str(3900), _nByte)
  4962  	}
  4963  	return _p
  4964  }
  4965  
  4966  // C comment
  4967  //  /*
  4968  //  ** Like free() but works for allocations obtained from sqlite3MemMalloc()
  4969  //  ** or sqlite3MemRealloc().
  4970  //  **
  4971  //  ** For this low-level routine, we already know that pPrior!=0 since
  4972  //  ** cases where pPrior==0 will have been intecepted and dealt with
  4973  //  ** by higher-level routines.
  4974  //  */
  4975  func _sqlite3MemFree(tls *crt.TLS, _pPrior unsafe.Pointer) {
  4976  	crt.Xfree(tls, _pPrior)
  4977  }
  4978  
  4979  // C comment
  4980  //  /*
  4981  //  ** Like realloc().  Resize an allocation previously obtained from
  4982  //  ** sqlite3MemMalloc().
  4983  //  **
  4984  //  ** For this low-level interface, we know that pPrior!=0.  Cases where
  4985  //  ** pPrior==0 while have been intercepted by higher-level routine and
  4986  //  ** redirected to xMalloc.  Similarly, we know that nByte>0 because
  4987  //  ** cases where nByte<=0 will have been intercepted by higher-level
  4988  //  ** routines and redirected to xFree.
  4989  //  */
  4990  func _sqlite3MemRealloc(tls *crt.TLS, _pPrior unsafe.Pointer, _nByte int32) (r0 unsafe.Pointer) {
  4991  	var _p unsafe.Pointer
  4992  	_p = crt.Xrealloc(tls, _pPrior, uint64(_nByte))
  4993  	if _p == nil {
  4994  		Xsqlite3_log(tls, int32(7), str(3938), crt.Xmalloc_usable_size(tls, _pPrior), _nByte)
  4995  	}
  4996  	return _p
  4997  }
  4998  
  4999  // C comment
  5000  //  /*
  5001  //  ** Report the allocated size of a prior return from xMalloc()
  5002  //  ** or xRealloc().
  5003  //  */
  5004  func _sqlite3MemSize(tls *crt.TLS, _pPrior unsafe.Pointer) (r0 int32) {
  5005  	func() {
  5006  		if _pPrior == nil {
  5007  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20827), unsafe.Pointer(&_sqlite3MemSizeØ00__func__Ø000), unsafe.Pointer(str(3974)))
  5008  			crt.X__builtin_abort(tls)
  5009  		}
  5010  	}()
  5011  	return int32(crt.Xmalloc_usable_size(tls, _pPrior))
  5012  }
  5013  
  5014  var _sqlite3MemSizeØ00__func__Ø000 [15]int8
  5015  
  5016  func init() {
  5017  	crt.Xstrncpy(nil, &_sqlite3MemSizeØ00__func__Ø000[0], str(3984), 15)
  5018  }
  5019  
  5020  // C comment
  5021  //  /*
  5022  //  ** Round up a request size to the next valid allocation size.
  5023  //  */
  5024  func _sqlite3MemRoundup(tls *crt.TLS, _n int32) (r0 int32) {
  5025  	return (_n + int32(7)) & int32(-8)
  5026  }
  5027  
  5028  // C comment
  5029  //  /*
  5030  //  ** Initialize this module.
  5031  //  */
  5032  func _sqlite3MemInit(tls *crt.TLS, _NotUsed unsafe.Pointer) (r0 int32) {
  5033  	return int32(0)
  5034  }
  5035  
  5036  // C comment
  5037  //  /*
  5038  //  ** Deinitialize this module.
  5039  //  */
  5040  func _sqlite3MemShutdown(tls *crt.TLS, _NotUsed unsafe.Pointer) {
  5041  }
  5042  
  5043  func _sqlite3NomemError(tls *crt.TLS, _lineno int32) (r0 int32) {
  5044  	return _reportError(tls, int32(7), _lineno, str(3999))
  5045  }
  5046  
  5047  // C comment
  5048  //  /*
  5049  //  ** Hash table for global functions - functions common to all
  5050  //  ** database connections.  After initialization, this table is
  5051  //  ** read-only.
  5052  //  */
  5053  var _sqlite3BuiltinFunctions XFuncDefHash
  5054  
  5055  // C comment
  5056  //  /*
  5057  //  ** All of the FuncDef structures in the aBuiltinFunc[] array above
  5058  //  ** to the global function hash table.  This occurs at start-time (as
  5059  //  ** a consequence of calling sqlite3_initialize()).
  5060  //  **
  5061  //  ** After this routine runs
  5062  //  */
  5063  func _sqlite3RegisterBuiltinFunctions(tls *crt.TLS) {
  5064  	_sqlite3AlterFunctions(tls)
  5065  	_sqlite3RegisterDateTimeFunctions(tls)
  5066  	_sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3RegisterBuiltinFunctionsØ00aBuiltinFuncØ001)), int32(60))
  5067  }
  5068  
  5069  // C comment
  5070  //  /*
  5071  //  ** Register built-in functions used to help implement ALTER TABLE
  5072  //  */
  5073  func _sqlite3AlterFunctions(tls *crt.TLS) {
  5074  	_sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3AlterFunctionsØ00aAlterTableFuncsØ001)), int32(3))
  5075  }
  5076  
  5077  // C comment
  5078  //  /*
  5079  //  ** Insert a new FuncDef into a FuncDefHash hash table.
  5080  //  */
  5081  func _sqlite3InsertBuiltinFuncs(tls *crt.TLS, _aDef *XFuncDef, _nDef int32) {
  5082  	var _i, _1_nName, _1_h int32
  5083  	var _1_zName *int8
  5084  	var _1_pOther *XFuncDef
  5085  	_i = int32(0)
  5086  _0:
  5087  	if _i >= _nDef {
  5088  		goto _3
  5089  	}
  5090  	_1_zName = elem17(_aDef, uintptr(_i)).XzName
  5091  	_1_nName = _sqlite3Strlen30(tls, _1_zName)
  5092  	_1_h = (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_1_zName, 0))))) + _1_nName) % int32(23)
  5093  	_1_pOther = _functionSearch(tls, _1_h, _1_zName)
  5094  	if _1_pOther != nil {
  5095  		func() {
  5096  			if _1_pOther == elem17(_aDef, uintptr(_i)) || (*XFuncDef)(_1_pOther.XpNext) == elem17(_aDef, uintptr(_i)) {
  5097  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104459), unsafe.Pointer(&_sqlite3InsertBuiltinFuncsØ00__func__Ø000), unsafe.Pointer(str(4003)))
  5098  				crt.X__builtin_abort(tls)
  5099  			}
  5100  		}()
  5101  		*(**XFuncDef)(unsafe.Pointer(&(elem17(_aDef, uintptr(_i)).XpNext))) = (*XFuncDef)(_1_pOther.XpNext)
  5102  		*(**XFuncDef)(unsafe.Pointer(&_1_pOther.XpNext)) = elem17(_aDef, uintptr(_i))
  5103  		goto _8
  5104  	}
  5105  	*(**XFuncDef)(unsafe.Pointer(&(elem17(_aDef, uintptr(_i)).XpNext))) = nil
  5106  	*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem17(_aDef, uintptr(_i)).Xu))))) = *elem18((**XFuncDef)(unsafe.Pointer(&_sqlite3BuiltinFunctions.Xa)), uintptr(_1_h))
  5107  	*elem18((**XFuncDef)(unsafe.Pointer(&_sqlite3BuiltinFunctions.Xa)), uintptr(_1_h)) = elem17(_aDef, uintptr(_i))
  5108  _8:
  5109  	_i += 1
  5110  	goto _0
  5111  _3:
  5112  }
  5113  
  5114  // C comment
  5115  //  /*
  5116  //  ** Compute a string length that is limited to what can be stored in
  5117  //  ** lower 30 bits of a 32-bit signed integer.
  5118  //  **
  5119  //  ** The value returned will never be negative.  Nor will it ever be greater
  5120  //  ** than the actual length of the string.  For very long strings (greater
  5121  //  ** than 1GiB) the value returned might be less than the true string length.
  5122  //  */
  5123  func _sqlite3Strlen30(tls *crt.TLS, _z *int8) (r0 int32) {
  5124  	if _z == nil {
  5125  		return int32(0)
  5126  	}
  5127  	return int32(1073741823) & int32(crt.Xstrlen(tls, _z))
  5128  }
  5129  
  5130  // C comment
  5131  //  /* An array to map all upper-case characters into their corresponding
  5132  //  ** lower-case character.
  5133  //  **
  5134  //  ** SQLite only considers US-ASCII (or EBCDIC) characters.  We do not
  5135  //  ** handle case conversions for the UTF character set since the tables
  5136  //  ** involved are nearly as big or bigger than SQLite itself.
  5137  //  */
  5138  var _sqlite3UpperToLower [256]uint8
  5139  
  5140  func init() {
  5141  	_sqlite3UpperToLower = [256]uint8{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255}
  5142  }
  5143  
  5144  // C comment
  5145  //  /*
  5146  //  ** Search a FuncDefHash for a function with the given name.  Return
  5147  //  ** a pointer to the matching FuncDef if found, or 0 if there is no match.
  5148  //  */
  5149  func _functionSearch(tls *crt.TLS, _h int32, _zFunc *int8) (r0 *XFuncDef) {
  5150  	var _p *XFuncDef
  5151  	_p = *elem18((**XFuncDef)(unsafe.Pointer(&_sqlite3BuiltinFunctions.Xa)), uintptr(_h))
  5152  _0:
  5153  	if _p == nil {
  5154  		goto _3
  5155  	}
  5156  	if _sqlite3StrICmp(tls, _p.XzName, _zFunc) == int32(0) {
  5157  		return _p
  5158  	}
  5159  	_p = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
  5160  	goto _0
  5161  _3:
  5162  	return nil
  5163  }
  5164  
  5165  // C comment
  5166  //  /*
  5167  //  ** Internal function prototypes
  5168  //  */
  5169  func _sqlite3StrICmp(tls *crt.TLS, _zLeft *int8, _zRight *int8) (r0 int32) {
  5170  	var _c int32
  5171  	var _a, _b *uint8
  5172  	_a = (*uint8)(unsafe.Pointer(_zLeft))
  5173  	_b = (*uint8)(unsafe.Pointer(_zRight))
  5174  _0:
  5175  	_c = int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_a))) - int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_b)))
  5176  	if _c != 0 || (int32(*_a) == int32(0)) {
  5177  		goto _2
  5178  	}
  5179  	*(*uintptr)(unsafe.Pointer(&_a)) += uintptr(1)
  5180  	*(*uintptr)(unsafe.Pointer(&_b)) += uintptr(1)
  5181  	goto _0
  5182  _2:
  5183  	return _c
  5184  }
  5185  
  5186  var _sqlite3InsertBuiltinFuncsØ00__func__Ø000 [26]int8
  5187  
  5188  func init() {
  5189  	crt.Xstrncpy(nil, &_sqlite3InsertBuiltinFuncsØ00__func__Ø000[0], str(4047), 26)
  5190  }
  5191  
  5192  var _sqlite3AlterFunctionsØ00aAlterTableFuncsØ001 [3]XFuncDef
  5193  
  5194  func init() {
  5195  	_sqlite3AlterFunctionsØ00aAlterTableFuncsØ001 = [3]XFuncDef{XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  5196  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  5197  	}{_renameTableFunc})), XzName: str(4073)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  5198  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  5199  	}{_renameTriggerFunc})), XzName: str(4093)}, XFuncDef{XnArg: int8(3), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  5200  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  5201  	}{_renameParentFunc})), XzName: str(4115)}}
  5202  }
  5203  
  5204  // C comment
  5205  //  /*
  5206  //  ** This function is used by SQL generated to implement the
  5207  //  ** ALTER TABLE command. The first argument is the text of a CREATE TABLE or
  5208  //  ** CREATE INDEX command. The second is a table name. The table name in
  5209  //  ** the CREATE TABLE or CREATE INDEX statement is replaced with the third
  5210  //  ** argument and the result returned. Examples:
  5211  //  **
  5212  //  ** sqlite_rename_table('CREATE TABLE abc(a, b, c)', 'def')
  5213  //  **     -> 'CREATE TABLE def(a, b, c)'
  5214  //  **
  5215  //  ** sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def')
  5216  //  **     -> 'CREATE INDEX i ON def(a, b, c)'
  5217  //  */
  5218  func _renameTableFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
  5219  	var _token, _len int32
  5220  	var _zRet *int8
  5221  	var _zSql, _zTableName, _zCsr *uint8
  5222  	var _tname XToken
  5223  	var _db *Xsqlite3
  5224  	_zSql = Xsqlite3_value_text(tls, *elem19(_argv, 0))
  5225  	_zTableName = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
  5226  	_zCsr = _zSql
  5227  	_len = int32(0)
  5228  	_db = Xsqlite3_context_db_handle(tls, _context)
  5229  
  5230  	if _zSql == nil {
  5231  		goto _0
  5232  	}
  5233  _1:
  5234  	if (*_zCsr) == 0 {
  5235  		return
  5236  	}
  5237  	_tname.Xz = (*int8)(unsafe.Pointer(_zCsr))
  5238  	_tname.Xn = uint32(_len)
  5239  _3:
  5240  	*(*uintptr)(unsafe.Pointer(&_zCsr)) += uintptr(_len)
  5241  	_len = _sqlite3GetToken(tls, _zCsr, &_token)
  5242  	if _token == int32(163) {
  5243  		goto _3
  5244  	}
  5245  	func() {
  5246  		if _len <= int32(0) {
  5247  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96186), unsafe.Pointer(&_renameTableFuncØ00__func__Ø000), unsafe.Pointer(str(4136)))
  5248  			crt.X__builtin_abort(tls)
  5249  		}
  5250  	}()
  5251  	if (_token != int32(22)) && (_token != int32(125)) {
  5252  		goto _1
  5253  	}
  5254  	_zRet = _sqlite3MPrintf(tls, _db, str(4142), int32(int64(uintptr(unsafe.Pointer(_tname.Xz))-uintptr(unsafe.Pointer(_zSql)))), unsafe.Pointer(_zSql), unsafe.Pointer(_zTableName), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_tname.Xz))+uintptr(_tname.Xn)))))
  5255  	Xsqlite3_result_text(tls, _context, _zRet, int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  5256  		v := _sqlite3MallocSize
  5257  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  5258  	}())
  5259  _0:
  5260  }
  5261  
  5262  func Xsqlite3_value_text(tls *crt.TLS, _pVal *XMem) (r0 *uint8) {
  5263  	return (*uint8)(_sqlite3ValueText(tls, _pVal, uint8(1)))
  5264  }
  5265  
  5266  // C comment
  5267  //  /* This function is only available internally, it is not part of the
  5268  //  ** external API. It works in a similar way to sqlite3_value_text(),
  5269  //  ** except the data returned is in the encoding specified by the second
  5270  //  ** parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or
  5271  //  ** SQLITE_UTF8.
  5272  //  **
  5273  //  ** (2006-02-16:)  The enc value can be or-ed with SQLITE_UTF16_ALIGNED.
  5274  //  ** If that is the case, then the result must be aligned on an even byte
  5275  //  ** boundary.
  5276  //  */
  5277  func _sqlite3ValueText(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 unsafe.Pointer) {
  5278  	if _pVal == nil {
  5279  		return nil
  5280  	}
  5281  	func() {
  5282  		if (*Xsqlite3)(_pVal.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pVal.Xdb).Xmutex)) == 0 {
  5283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70759), unsafe.Pointer(&_sqlite3ValueTextØ00__func__Ø000), unsafe.Pointer(str(4153)))
  5284  			crt.X__builtin_abort(tls)
  5285  		}
  5286  	}()
  5287  	func() {
  5288  		if (int32(_enc) & int32(3)) != (int32(_enc) & int32(-9)) {
  5289  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70760), unsafe.Pointer(&_sqlite3ValueTextØ00__func__Ø000), unsafe.Pointer(str(4204)))
  5290  			crt.X__builtin_abort(tls)
  5291  		}
  5292  	}()
  5293  	func() {
  5294  		if (int32(_pVal.Xflags) & int32(32)) != int32(0) {
  5295  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70761), unsafe.Pointer(&_sqlite3ValueTextØ00__func__Ø000), unsafe.Pointer(str(4241)))
  5296  			crt.X__builtin_abort(tls)
  5297  		}
  5298  	}()
  5299  	if ((int32(_pVal.Xflags) & int32(514)) == int32(514)) && (int32(_pVal.Xenc) == int32(_enc)) {
  5300  		return unsafe.Pointer(_pVal.Xz)
  5301  	}
  5302  	if (int32(_pVal.Xflags) & int32(1)) != 0 {
  5303  		return nil
  5304  	}
  5305  	return _valueToText(tls, _pVal, _enc)
  5306  }
  5307  
  5308  var _sqlite3ValueTextØ00__func__Ø000 [17]int8
  5309  
  5310  func init() {
  5311  	crt.Xstrncpy(nil, &_sqlite3ValueTextØ00__func__Ø000[0], str(4271), 17)
  5312  }
  5313  
  5314  // C comment
  5315  //  /*
  5316  //  ** The pVal argument is known to be a value other than NULL.
  5317  //  ** Convert it into a string with encoding enc and return a pointer
  5318  //  ** to a zero-terminated version of that string.
  5319  //  */
  5320  func _valueToText(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 unsafe.Pointer) {
  5321  	func() {
  5322  		if _pVal == nil {
  5323  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70716), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4288)))
  5324  			crt.X__builtin_abort(tls)
  5325  		}
  5326  	}()
  5327  	func() {
  5328  		if (*Xsqlite3)(_pVal.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pVal.Xdb).Xmutex)) == 0 {
  5329  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70717), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4153)))
  5330  			crt.X__builtin_abort(tls)
  5331  		}
  5332  	}()
  5333  	func() {
  5334  		if (int32(_enc) & int32(3)) != (int32(_enc) & int32(-9)) {
  5335  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70718), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4204)))
  5336  			crt.X__builtin_abort(tls)
  5337  		}
  5338  	}()
  5339  	func() {
  5340  		if (int32(_pVal.Xflags) & int32(32)) != int32(0) {
  5341  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70719), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4241)))
  5342  			crt.X__builtin_abort(tls)
  5343  		}
  5344  	}()
  5345  	func() {
  5346  		if (int32(_pVal.Xflags) & int32(1)) != int32(0) {
  5347  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70720), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4296)))
  5348  			crt.X__builtin_abort(tls)
  5349  		}
  5350  	}()
  5351  	if (int32(_pVal.Xflags) & int32(18)) == 0 {
  5352  		goto _11
  5353  	}
  5354  	if func() int32 {
  5355  		if (int32(_pVal.Xflags) & int32(16384)) != 0 {
  5356  			return _sqlite3VdbeMemExpandBlob(tls, _pVal)
  5357  		}
  5358  		return int32(0)
  5359  	}() != 0 {
  5360  		return nil
  5361  	}
  5362  	{
  5363  		p := &_pVal.Xflags
  5364  		*p = uint16(int32(*p) | int32(2))
  5365  	}
  5366  	if int32(_pVal.Xenc) != (int32(_enc) & int32(-9)) {
  5367  		_sqlite3VdbeChangeEncoding(tls, _pVal, int32(_enc)&int32(-9))
  5368  	}
  5369  	if (int32(_enc)&int32(8)) == int32(0) || int32(1) != (int32(1)&int32(int64(crt.P2U(unsafe.Pointer(_pVal.Xz))))) {
  5370  		goto _17
  5371  	}
  5372  	func() {
  5373  		if (int32(_pVal.Xflags) & int32(6144)) == int32(0) {
  5374  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70728), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4326)))
  5375  			crt.X__builtin_abort(tls)
  5376  		}
  5377  	}()
  5378  	if _sqlite3VdbeMemMakeWriteable(tls, _pVal) != int32(0) {
  5379  		return nil
  5380  	}
  5381  _17:
  5382  	_sqlite3VdbeMemNulTerminate(tls, _pVal)
  5383  	goto _21
  5384  _11:
  5385  	_sqlite3VdbeMemStringify(tls, _pVal, _enc, 0)
  5386  	func() {
  5387  		if int32(0) != (int32(1) & int32(int64(crt.P2U(unsafe.Pointer(_pVal.Xz))))) {
  5388  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70736), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4368)))
  5389  			crt.X__builtin_abort(tls)
  5390  		}
  5391  	}()
  5392  _21:
  5393  	func() {
  5394  		if int32(_pVal.Xenc) != (int32(_enc)&int32(-9)) && (*Xsqlite3)(_pVal.Xdb) != nil && ((*Xsqlite3)(_pVal.Xdb).XmallocFailed) == 0 {
  5395  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70738), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4402)))
  5396  			crt.X__builtin_abort(tls)
  5397  		}
  5398  	}()
  5399  	if int32(_pVal.Xenc) == (int32(_enc) & int32(-9)) {
  5400  		return unsafe.Pointer(_pVal.Xz)
  5401  	}
  5402  	return nil
  5403  }
  5404  
  5405  var _valueToTextØ00__func__Ø000 [12]int8
  5406  
  5407  func init() {
  5408  	crt.Xstrncpy(nil, &_valueToTextØ00__func__Ø000[0], str(4484), 12)
  5409  }
  5410  
  5411  func _sqlite3VdbeMemExpandBlob(tls *crt.TLS, _pMem *XMem) (r0 int32) {
  5412  	var _nByte int32
  5413  	func() {
  5414  		if (int32(_pMem.Xflags) & int32(16384)) == 0 {
  5415  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69923), unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000), unsafe.Pointer(str(4496)))
  5416  			crt.X__builtin_abort(tls)
  5417  		}
  5418  	}()
  5419  	func() {
  5420  		if (int32(_pMem.Xflags) & int32(16)) == 0 {
  5421  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69924), unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000), unsafe.Pointer(str(4519)))
  5422  			crt.X__builtin_abort(tls)
  5423  		}
  5424  	}()
  5425  	func() {
  5426  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  5427  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69925), unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000), unsafe.Pointer(str(4540)))
  5428  			crt.X__builtin_abort(tls)
  5429  		}
  5430  	}()
  5431  	func() {
  5432  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  5433  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69926), unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000), unsafe.Pointer(str(4568)))
  5434  			crt.X__builtin_abort(tls)
  5435  		}
  5436  	}()
  5437  	_nByte = _pMem.Xn + (*(*int32)(unsafe.Pointer(&_pMem.Xu)))
  5438  	if _nByte <= int32(0) {
  5439  		_nByte = int32(1)
  5440  	}
  5441  	if _sqlite3VdbeMemGrow(tls, _pMem, _nByte, int32(1)) != 0 {
  5442  		return _sqlite3NomemError(tls, int32(69934))
  5443  	}
  5444  	crt.Xmemset(tls, unsafe.Pointer(elem1(_pMem.Xz, uintptr(_pMem.Xn))), int32(0), uint64(*(*int32)(unsafe.Pointer(&_pMem.Xu))))
  5445  	_pMem.Xn += *(*int32)(unsafe.Pointer(&_pMem.Xu))
  5446  	{
  5447  		p := &_pMem.Xflags
  5448  		*p = uint16(int32(*p) & int32(-16897))
  5449  	}
  5450  	return int32(0)
  5451  }
  5452  
  5453  var _sqlite3VdbeMemExpandBlobØ00__func__Ø000 [25]int8
  5454  
  5455  func init() {
  5456  	crt.Xstrncpy(nil, &_sqlite3VdbeMemExpandBlobØ00__func__Ø000[0], str(4619), 25)
  5457  }
  5458  
  5459  // C comment
  5460  //  /*
  5461  //  ** Make sure pMem->z points to a writable allocation of at least
  5462  //  ** min(n,32) bytes.
  5463  //  **
  5464  //  ** If the bPreserve argument is true, then copy of the content of
  5465  //  ** pMem->z into the new allocation.  pMem must be either a string or
  5466  //  ** blob if bPreserve is true.  If bPreserve is false, any prior content
  5467  //  ** in pMem->z is discarded.
  5468  //  */
  5469  func _sqlite3VdbeMemGrow(tls *crt.TLS, _pMem *XMem, _n int32, _bPreserve int32) (r0 int32) {
  5470  	func() {
  5471  		if _sqlite3VdbeCheckMemInvariants(tls, _pMem) == 0 {
  5472  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69822), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4644)))
  5473  			crt.X__builtin_abort(tls)
  5474  		}
  5475  	}()
  5476  	func() {
  5477  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  5478  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69823), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4540)))
  5479  			crt.X__builtin_abort(tls)
  5480  		}
  5481  	}()
  5482  	func() {
  5483  		if _bPreserve != int32(0) && (int32(_pMem.Xflags)&int32(18)) == 0 {
  5484  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69828), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4680)))
  5485  			crt.X__builtin_abort(tls)
  5486  		}
  5487  	}()
  5488  	func() {
  5489  		if _pMem.XszMalloc != int32(0) && _pMem.XszMalloc != _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.XzMalloc)) {
  5490  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69831), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4727)))
  5491  			crt.X__builtin_abort(tls)
  5492  		}
  5493  	}()
  5494  	if _n < int32(32) {
  5495  		_n = int32(32)
  5496  	}
  5497  	if (_bPreserve != 0 && (_pMem.XszMalloc > int32(0))) && (_pMem.Xz == _pMem.XzMalloc) {
  5498  		_pMem.Xz = store1(&_pMem.XzMalloc, (*int8)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.Xz), uint64(_n))))
  5499  		_bPreserve = int32(0)
  5500  		goto _14
  5501  	}
  5502  	if _pMem.XszMalloc > int32(0) {
  5503  		_sqlite3DbFreeNN(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.XzMalloc))
  5504  	}
  5505  	_pMem.XzMalloc = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pMem.Xdb), uint64(_n)))
  5506  _14:
  5507  	if _pMem.XzMalloc == nil {
  5508  		_sqlite3VdbeMemSetNull(tls, _pMem)
  5509  		_pMem.Xz = nil
  5510  		_pMem.XszMalloc = int32(0)
  5511  		return _sqlite3NomemError(tls, int32(69845))
  5512  	}
  5513  	_pMem.XszMalloc = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.XzMalloc))
  5514  	if (_bPreserve != 0 && (_pMem.Xz != nil)) && func() int32 {
  5515  		if _pMem.Xz != _pMem.XzMalloc {
  5516  			return int32(1)
  5517  		}
  5518  		return func() int32 {
  5519  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69850), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4809)))
  5520  			crt.X__builtin_abort(tls)
  5521  			return int32(0)
  5522  		}()
  5523  	}() != 0 {
  5524  		crt.Xmemcpy(tls, unsafe.Pointer(_pMem.XzMalloc), unsafe.Pointer(_pMem.Xz), uint64(_pMem.Xn))
  5525  	}
  5526  	if (int32(_pMem.Xflags) & int32(1024)) != int32(0) {
  5527  		func() {
  5528  			if _pMem.XxDel == nil || *(*uintptr)(unsafe.Pointer(&struct {
  5529  				f func(*crt.TLS, unsafe.Pointer)
  5530  			}{_pMem.XxDel})) == *(*uintptr)(unsafe.Pointer(&struct {
  5531  				f func(*crt.TLS, unsafe.Pointer)
  5532  			}{func() func(*crt.TLS, unsafe.Pointer) {
  5533  				v := _sqlite3MallocSize
  5534  				return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  5535  			}()})) {
  5536  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69854), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4811)))
  5537  				crt.X__builtin_abort(tls)
  5538  			}
  5539  		}()
  5540  		_pMem.XxDel(tls, unsafe.Pointer(_pMem.Xz))
  5541  	}
  5542  	_pMem.Xz = _pMem.XzMalloc
  5543  	{
  5544  		p := &_pMem.Xflags
  5545  		*p = uint16(int32(*p) & int32(-7169))
  5546  	}
  5547  	return int32(0)
  5548  }
  5549  
  5550  // C comment
  5551  //  /*
  5552  //  ** Check invariants on a Mem object.
  5553  //  **
  5554  //  ** This routine is intended for use inside of assert() statements, like
  5555  //  ** this:    assert( sqlite3VdbeCheckMemInvariants(pMem) );
  5556  //  */
  5557  func _sqlite3VdbeCheckMemInvariants(tls *crt.TLS, _p *XMem) (r0 int32) {
  5558  	func() {
  5559  		if (int32(_p.Xflags)&int32(1024)) != int32(0) && _p.XxDel == nil {
  5560  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69733), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(4855)))
  5561  			crt.X__builtin_abort(tls)
  5562  		}
  5563  	}()
  5564  	func() {
  5565  		if (int32(_p.Xflags)&int32(1024)) != int32(0) && _p.XszMalloc != int32(0) {
  5566  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69739), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(4893)))
  5567  			crt.X__builtin_abort(tls)
  5568  		}
  5569  	}()
  5570  	func() {
  5571  		if (int32(_p.Xflags) & int32(12)) == int32(12) {
  5572  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69742), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(4935)))
  5573  			crt.X__builtin_abort(tls)
  5574  		}
  5575  	}()
  5576  	func() {
  5577  		if (int32(_p.Xflags)&int32(1)) != int32(0) && (int32(_p.Xflags)&int32(30)) != int32(0) {
  5578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69745), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(4987)))
  5579  			crt.X__builtin_abort(tls)
  5580  		}
  5581  	}()
  5582  	func() {
  5583  		if _p.XszMalloc != int32(0) && _p.XszMalloc != _sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p.XzMalloc)) {
  5584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69749), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(5067)))
  5585  			crt.X__builtin_abort(tls)
  5586  		}
  5587  	}()
  5588  	if (int32(_p.Xflags)&int32(18)) != 0 && (_p.Xn > int32(0)) {
  5589  		func() {
  5590  			if (((func() int32 {
  5591  				if (_p.XszMalloc > int32(0)) && (_p.Xz == _p.XzMalloc) {
  5592  					return int32(1)
  5593  				}
  5594  				return int32(0)
  5595  			}() + func() int32 {
  5596  				if (int32(_p.Xflags) & int32(1024)) != int32(0) {
  5597  					return int32(1)
  5598  				}
  5599  				return int32(0)
  5600  			}()) + func() int32 {
  5601  				if (int32(_p.Xflags) & int32(4096)) != int32(0) {
  5602  					return int32(1)
  5603  				}
  5604  				return int32(0)
  5605  			}()) + func() int32 {
  5606  				if (int32(_p.Xflags) & int32(2048)) != int32(0) {
  5607  					return int32(1)
  5608  				}
  5609  				return int32(0)
  5610  			}()) != int32(1) {
  5611  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69761), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(5136)))
  5612  				crt.X__builtin_abort(tls)
  5613  			}
  5614  		}()
  5615  	}
  5616  	return int32(1)
  5617  }
  5618  
  5619  var _sqlite3VdbeCheckMemInvariantsØ00__func__Ø000 [30]int8
  5620  
  5621  func init() {
  5622  	crt.Xstrncpy(nil, &_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000[0], str(5293), 30)
  5623  }
  5624  
  5625  var _sqlite3VdbeMemGrowØ00__func__Ø000 [19]int8
  5626  
  5627  func init() {
  5628  	crt.Xstrncpy(nil, &_sqlite3VdbeMemGrowØ00__func__Ø000[0], str(5323), 19)
  5629  }
  5630  
  5631  // C comment
  5632  //  /*
  5633  //  ** Attempt to reallocate p.  If the reallocation fails, then free p
  5634  //  ** and set the mallocFailed flag in the database connection.
  5635  //  */
  5636  func _sqlite3DbReallocOrFree(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
  5637  	var _pNew unsafe.Pointer
  5638  	_pNew = _sqlite3DbRealloc(tls, _db, _p, _n)
  5639  	if _pNew == nil {
  5640  		_sqlite3DbFree(tls, _db, _p)
  5641  	}
  5642  	return _pNew
  5643  }
  5644  
  5645  // C comment
  5646  //  /*
  5647  //  ** Allocate memory, either lookaside (if possible) or heap.
  5648  //  ** If the allocation fails, set the mallocFailed flag in
  5649  //  ** the connection pointer.
  5650  //  **
  5651  //  ** If db!=0 and db->mallocFailed is true (indicating a prior malloc
  5652  //  ** failure on the same database connection) then always return 0.
  5653  //  ** Hence for a particular database connection, once malloc starts
  5654  //  ** failing, it fails consistently until mallocFailed is reset.
  5655  //  ** This is an important assumption.  There are many places in the
  5656  //  ** code that do things like this:
  5657  //  **
  5658  //  **         int *a = (int*)sqlite3DbMallocRaw(db, 100);
  5659  //  **         int *b = (int*)sqlite3DbMallocRaw(db, 200);
  5660  //  **         if( b ) a[10] = 9;
  5661  //  **
  5662  //  ** In other words, if a subsequent malloc (ex: "b") worked, it is assumed
  5663  //  ** that all prior mallocs (ex: "a") worked too.
  5664  //  **
  5665  //  ** The sqlite3MallocRawNN() variant guarantees that the "db" parameter is
  5666  //  ** not a NULL pointer.
  5667  //  */
  5668  func _sqlite3DbMallocRaw(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
  5669  	var _p unsafe.Pointer
  5670  	if _db != nil {
  5671  		return _sqlite3DbMallocRawNN(tls, _db, _n)
  5672  	}
  5673  	_p = _sqlite3Malloc(tls, _n)
  5674  	return _p
  5675  }
  5676  
  5677  // C comment
  5678  //  /*
  5679  //  ** Delete any previous value and set the value stored in *pMem to NULL.
  5680  //  **
  5681  //  ** This routine calls the Mem.xDel destructor to dispose of values that
  5682  //  ** require the destructor.  But it preserves the Mem.zMalloc memory allocation.
  5683  //  ** To free all resources, use sqlite3VdbeMemRelease(), which both calls this
  5684  //  ** routine to invoke the destructor and deallocates Mem.zMalloc.
  5685  //  **
  5686  //  ** Use this routine to reset the Mem prior to insert a new value.
  5687  //  **
  5688  //  ** Use sqlite3VdbeMemRelease() to complete erase the Mem prior to abandoning it.
  5689  //  */
  5690  func _sqlite3VdbeMemSetNull(tls *crt.TLS, _pMem *XMem) {
  5691  	if (int32(_pMem.Xflags) & int32(9312)) != int32(0) {
  5692  		_vdbeMemClearExternAndSetNull(tls, _pMem)
  5693  		goto _1
  5694  	}
  5695  	_pMem.Xflags = uint16(1)
  5696  _1:
  5697  }
  5698  
  5699  // C comment
  5700  //  /*
  5701  //  ** If the memory cell contains a value that must be freed by
  5702  //  ** invoking the external callback in Mem.xDel, then this routine
  5703  //  ** will free that value.  It also sets Mem.flags to MEM_Null.
  5704  //  **
  5705  //  ** This is a helper routine for sqlite3VdbeMemSetNull() and
  5706  //  ** for sqlite3VdbeMemRelease().  Use those other routines as the
  5707  //  ** entry point for releasing Mem resources.
  5708  //  */
  5709  func _vdbeMemClearExternAndSetNull(tls *crt.TLS, _p *XMem) {
  5710  	var _4_pFrame *XVdbeFrame
  5711  	func() {
  5712  		if (*Xsqlite3)(_p.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
  5713  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70064), unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000), unsafe.Pointer(str(5342)))
  5714  			crt.X__builtin_abort(tls)
  5715  		}
  5716  	}()
  5717  	func() {
  5718  		if (int32(_p.Xflags) & int32(9312)) == int32(0) {
  5719  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70065), unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000), unsafe.Pointer(str(5387)))
  5720  			crt.X__builtin_abort(tls)
  5721  		}
  5722  	}()
  5723  	if (int32(_p.Xflags) & int32(8192)) != 0 {
  5724  		_sqlite3VdbeMemFinalize(tls, _p, (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu))))
  5725  		func() {
  5726  			if (int32(_p.Xflags) & int32(8192)) != int32(0) {
  5727  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70068), unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000), unsafe.Pointer(str(5405)))
  5728  				crt.X__builtin_abort(tls)
  5729  			}
  5730  		}()
  5731  	}
  5732  	if (int32(_p.Xflags) & int32(1024)) != 0 {
  5733  		func() {
  5734  			if (int32(_p.Xflags) & int32(32)) != int32(0) {
  5735  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70072), unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000), unsafe.Pointer(str(5429)))
  5736  				crt.X__builtin_abort(tls)
  5737  			}
  5738  		}()
  5739  		func() {
  5740  			if *(*uintptr)(unsafe.Pointer(&struct {
  5741  				f func(*crt.TLS, unsafe.Pointer)
  5742  			}{_p.XxDel})) == *(*uintptr)(unsafe.Pointer(&struct {
  5743  				f func(*crt.TLS, unsafe.Pointer)
  5744  			}{func() func(*crt.TLS, unsafe.Pointer) {
  5745  				v := _sqlite3MallocSize
  5746  				return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  5747  			}()})) || _p.XxDel == nil {
  5748  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70073), unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000), unsafe.Pointer(str(5454)))
  5749  				crt.X__builtin_abort(tls)
  5750  			}
  5751  		}()
  5752  		_p.XxDel(tls, unsafe.Pointer(_p.Xz))
  5753  		goto _17
  5754  	}
  5755  	if (int32(_p.Xflags) & int32(32)) != 0 {
  5756  		_sqlite3RowSetClear(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu))))
  5757  		goto _17
  5758  	}
  5759  	if (int32(_p.Xflags) & int32(64)) != 0 {
  5760  		_4_pFrame = (*XVdbeFrame)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
  5761  		*(**XVdbeFrame)(unsafe.Pointer(&_4_pFrame.XpParent)) = (*XVdbeFrame)((*TVdbe)(_4_pFrame.Xv).XpDelFrame)
  5762  		*(**XVdbeFrame)(unsafe.Pointer(&((*TVdbe)(_4_pFrame.Xv).XpDelFrame))) = _4_pFrame
  5763  	}
  5764  _17:
  5765  	_p.Xflags = uint16(1)
  5766  }
  5767  
  5768  var _vdbeMemClearExternAndSetNullØ00__func__Ø000 [29]int8
  5769  
  5770  func init() {
  5771  	crt.Xstrncpy(nil, &_vdbeMemClearExternAndSetNullØ00__func__Ø000[0], str(5492), 29)
  5772  }
  5773  
  5774  // C comment
  5775  //  /*
  5776  //  ** Memory cell pMem contains the context of an aggregate function.
  5777  //  ** This routine calls the finalize method for that function.  The
  5778  //  ** result of the aggregate is stored back into pMem.
  5779  //  **
  5780  //  ** Return SQLITE_ERROR if the finalizer reports an error.  SQLITE_OK
  5781  //  ** otherwise.
  5782  //  */
  5783  func _sqlite3VdbeMemFinalize(tls *crt.TLS, _pMem *XMem, _pFunc *XFuncDef) (r0 int32) {
  5784  	var _rc int32
  5785  	var _1_ctx Xsqlite3_context
  5786  	var _1_t XMem
  5787  	_rc = int32(0)
  5788  	if func() int32 {
  5789  		if (_pFunc != nil) && (_pFunc.XxFinalize != nil) {
  5790  			return int32(1)
  5791  		}
  5792  		return func() int32 {
  5793  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70033), unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000), unsafe.Pointer(str(4809)))
  5794  			crt.X__builtin_abort(tls)
  5795  			return int32(0)
  5796  		}()
  5797  	}() == 0 {
  5798  		goto _3
  5799  	}
  5800  	func() {
  5801  		if (int32(_pMem.Xflags)&int32(1)) == int32(0) && _pFunc != (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_pMem.Xu))) {
  5802  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70036), unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000), unsafe.Pointer(str(5521)))
  5803  			crt.X__builtin_abort(tls)
  5804  		}
  5805  	}()
  5806  	func() {
  5807  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  5808  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70037), unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000), unsafe.Pointer(str(4568)))
  5809  			crt.X__builtin_abort(tls)
  5810  		}
  5811  	}()
  5812  	crt.Xmemset(tls, unsafe.Pointer(&_1_ctx), int32(0), uint64(56))
  5813  	crt.Xmemset(tls, unsafe.Pointer(&_1_t), int32(0), uint64(72))
  5814  	_1_t.Xflags = uint16(1)
  5815  	*(**Xsqlite3)(unsafe.Pointer(&_1_t.Xdb)) = (*Xsqlite3)(_pMem.Xdb)
  5816  	*(**XMem)(unsafe.Pointer(&_1_ctx.XpOut)) = &_1_t
  5817  	*(**XMem)(unsafe.Pointer(&_1_ctx.XpMem)) = _pMem
  5818  	*(**XFuncDef)(unsafe.Pointer(&_1_ctx.XpFunc)) = _pFunc
  5819  	func() func(*crt.TLS, *Xsqlite3_context) {
  5820  		v := _pFunc.XxFinalize
  5821  		return *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&v))
  5822  	}()(tls, &_1_ctx)
  5823  	func() {
  5824  		if (int32(_pMem.Xflags) & int32(1024)) != int32(0) {
  5825  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70046), unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000), unsafe.Pointer(str(5572)))
  5826  			crt.X__builtin_abort(tls)
  5827  		}
  5828  	}()
  5829  	if _pMem.XszMalloc > int32(0) {
  5830  		_sqlite3DbFreeNN(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.XzMalloc))
  5831  	}
  5832  	crt.Xmemcpy(tls, unsafe.Pointer(_pMem), unsafe.Pointer(&_1_t), uint64(72))
  5833  	_rc = _1_ctx.XisError
  5834  _3:
  5835  	return _rc
  5836  }
  5837  
  5838  var _sqlite3VdbeMemFinalizeØ00__func__Ø000 [23]int8
  5839  
  5840  func init() {
  5841  	crt.Xstrncpy(nil, &_sqlite3VdbeMemFinalizeØ00__func__Ø000[0], str(5599), 23)
  5842  }
  5843  
  5844  // C comment
  5845  //  /*
  5846  //  ** Deallocate all chunks from a RowSet.  This frees all memory that
  5847  //  ** the RowSet has allocated over its lifetime.  This routine is
  5848  //  ** the destructor for the RowSet.
  5849  //  */
  5850  func _sqlite3RowSetClear(tls *crt.TLS, _p *XRowSet) {
  5851  	var _pChunk, _pNextChunk *TRowSetChunk
  5852  	_pChunk = (*TRowSetChunk)(_p.XpChunk)
  5853  _0:
  5854  	if _pChunk == nil {
  5855  		goto _3
  5856  	}
  5857  	_pNextChunk = (*TRowSetChunk)(_pChunk.XpNextChunk)
  5858  	_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_pChunk))
  5859  	_pChunk = _pNextChunk
  5860  	goto _0
  5861  _3:
  5862  	*(**TRowSetChunk)(unsafe.Pointer(&_p.XpChunk)) = nil
  5863  	_p.XnFresh = 0
  5864  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpEntry)) = nil
  5865  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLast)) = nil
  5866  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpForest)) = nil
  5867  	_p.XrsFlags = uint16(1)
  5868  }
  5869  
  5870  // C comment
  5871  //  /*
  5872  //  ** If pMem is an object with a valid string representation, this routine
  5873  //  ** ensures the internal encoding for the string representation is
  5874  //  ** 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE.
  5875  //  **
  5876  //  ** If pMem is not a string object, or the encoding of the string
  5877  //  ** representation is already stored using the requested encoding, then this
  5878  //  ** routine is a no-op.
  5879  //  **
  5880  //  ** SQLITE_OK is returned if the conversion is successful (or not required).
  5881  //  ** SQLITE_NOMEM may be returned if a malloc() fails during conversion
  5882  //  ** between formats.
  5883  //  */
  5884  func _sqlite3VdbeChangeEncoding(tls *crt.TLS, _pMem *XMem, _desiredEnc int32) (r0 int32) {
  5885  	var _rc int32
  5886  	func() {
  5887  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  5888  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69790), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(4540)))
  5889  			crt.X__builtin_abort(tls)
  5890  		}
  5891  	}()
  5892  	func() {
  5893  		if _desiredEnc != int32(1) && _desiredEnc != int32(2) && _desiredEnc != int32(3) {
  5894  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69791), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(5622)))
  5895  			crt.X__builtin_abort(tls)
  5896  		}
  5897  	}()
  5898  	if ((int32(_pMem.Xflags) & int32(2)) == 0) || (int32(_pMem.Xenc) == _desiredEnc) {
  5899  		return int32(0)
  5900  	}
  5901  	func() {
  5902  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  5903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69796), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(4568)))
  5904  			crt.X__builtin_abort(tls)
  5905  		}
  5906  	}()
  5907  	_rc = _sqlite3VdbeMemTranslate(tls, _pMem, uint8(_desiredEnc))
  5908  	func() {
  5909  		if _rc != int32(0) && _rc != int32(7) {
  5910  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69805), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(5706)))
  5911  			crt.X__builtin_abort(tls)
  5912  		}
  5913  	}()
  5914  	func() {
  5915  		if _rc != int32(0) && int32(_pMem.Xenc) == _desiredEnc {
  5916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69806), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(5740)))
  5917  			crt.X__builtin_abort(tls)
  5918  		}
  5919  	}()
  5920  	func() {
  5921  		if _rc != int32(7) && int32(_pMem.Xenc) != _desiredEnc {
  5922  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69807), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(5779)))
  5923  			crt.X__builtin_abort(tls)
  5924  		}
  5925  	}()
  5926  	return _rc
  5927  }
  5928  
  5929  var _sqlite3VdbeChangeEncodingØ00__func__Ø000 [26]int8
  5930  
  5931  func init() {
  5932  	crt.Xstrncpy(nil, &_sqlite3VdbeChangeEncodingØ00__func__Ø000[0], str(5821), 26)
  5933  }
  5934  
  5935  // C comment
  5936  //  /*
  5937  //  ** This routine transforms the internal text encoding used by pMem to
  5938  //  ** desiredEnc. It is an error if the string is already of the desired
  5939  //  ** encoding, or if *pMem does not contain a string value.
  5940  //  */
  5941  func _sqlite3VdbeMemTranslate(tls *crt.TLS, _pMem *XMem, _desiredEnc uint8) (r0 int32) {
  5942  	var _len, _1_rc, _28_c2, _37_c2 int32
  5943  	var _c uint32
  5944  	var _1_temp uint8
  5945  	var _zOut, _zIn, _zTerm, _z *uint8
  5946  	func() {
  5947  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  5948  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27333), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(4568)))
  5949  			crt.X__builtin_abort(tls)
  5950  		}
  5951  	}()
  5952  	func() {
  5953  		if (int32(_pMem.Xflags) & int32(2)) == 0 {
  5954  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27334), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5847)))
  5955  			crt.X__builtin_abort(tls)
  5956  		}
  5957  	}()
  5958  	func() {
  5959  		if int32(_pMem.Xenc) == int32(_desiredEnc) {
  5960  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27335), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5867)))
  5961  			crt.X__builtin_abort(tls)
  5962  		}
  5963  	}()
  5964  	func() {
  5965  		if int32(_pMem.Xenc) == int32(0) {
  5966  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27336), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5889)))
  5967  			crt.X__builtin_abort(tls)
  5968  		}
  5969  	}()
  5970  	func() {
  5971  		if _pMem.Xn < int32(0) {
  5972  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27337), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5902)))
  5973  			crt.X__builtin_abort(tls)
  5974  		}
  5975  	}()
  5976  	if int32(_pMem.Xenc) == int32(1) || int32(_desiredEnc) == int32(1) {
  5977  		goto _12
  5978  	}
  5979  	_1_rc = _sqlite3VdbeMemMakeWriteable(tls, _pMem)
  5980  	if _1_rc != int32(0) {
  5981  		func() {
  5982  			if _1_rc != int32(7) {
  5983  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27356), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5913)))
  5984  				crt.X__builtin_abort(tls)
  5985  			}
  5986  		}()
  5987  		return _sqlite3NomemError(tls, int32(27357))
  5988  	}
  5989  	_zIn = (*uint8)(unsafe.Pointer(_pMem.Xz))
  5990  	_zTerm = elem15(_zIn, uintptr(_pMem.Xn&int32(-2)))
  5991  _16:
  5992  	if crt.P2U(unsafe.Pointer(_zIn)) < crt.P2U(unsafe.Pointer(_zTerm)) {
  5993  		_1_temp = *_zIn
  5994  		*_zIn = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + uintptr(int32(1))))
  5995  		*(*uintptr)(unsafe.Pointer(&_zIn)) += uintptr(1)
  5996  		*postInc15(&_zIn, 1) = _1_temp
  5997  		goto _16
  5998  	}
  5999  	_pMem.Xenc = _desiredEnc
  6000  	goto _translate_out
  6001  _12:
  6002  	if int32(_desiredEnc) == int32(1) {
  6003  		_pMem.Xn &= int32(-2)
  6004  		_len = (_pMem.Xn * int32(2)) + int32(1)
  6005  		goto _19
  6006  	}
  6007  	_len = (_pMem.Xn * int32(2)) + int32(2)
  6008  _19:
  6009  	_zIn = (*uint8)(unsafe.Pointer(_pMem.Xz))
  6010  	_zTerm = elem15(_zIn, uintptr(_pMem.Xn))
  6011  	_zOut = (*uint8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pMem.Xdb), uint64(_len)))
  6012  	if _zOut == nil {
  6013  		return _sqlite3NomemError(tls, int32(27399))
  6014  	}
  6015  	_z = _zOut
  6016  	if int32(_pMem.Xenc) != int32(1) {
  6017  		goto _21
  6018  	}
  6019  	if int32(_desiredEnc) != int32(2) {
  6020  		goto _22
  6021  	}
  6022  _23:
  6023  	if crt.P2U(unsafe.Pointer(_zIn)) >= crt.P2U(unsafe.Pointer(_zTerm)) {
  6024  		goto _24
  6025  	}
  6026  	_c = uint32(*postInc15(&_zIn, 1))
  6027  	if _c < uint32(192) {
  6028  		goto _25
  6029  	}
  6030  	_c = uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3Utf8Trans1)), uintptr(_c-uint32(192))))
  6031  _26:
  6032  	if (_zIn != _zTerm) && ((int32(*_zIn) & int32(192)) == int32(128)) {
  6033  		_c = (_c << 6) + uint32(int32(63)&int32(*postInc15(&_zIn, 1)))
  6034  		goto _26
  6035  	}
  6036  	if ((_c < uint32(128)) || ((_c & uint32(4294965248)) == uint32(55296))) || ((_c & uint32(4294967294)) == uint32(65534)) {
  6037  		_c = uint32(65533)
  6038  	}
  6039  _25:
  6040  	if _c <= uint32(65535) {
  6041  		*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6042  		*postInc15(&_z, 1) = uint8((_c >> 8) & uint32(255))
  6043  		goto _33
  6044  	}
  6045  	*postInc15(&_z, 1) = uint8(((_c >> 10) & uint32(63)) + (((_c - uint32(65536)) >> 10) & uint32(192)))
  6046  	*postInc15(&_z, 1) = uint8(uint32(216) + (((_c - uint32(65536)) >> 18) & uint32(3)))
  6047  	*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6048  	*postInc15(&_z, 1) = uint8(uint32(220) + ((_c >> 8) & uint32(3)))
  6049  _33:
  6050  	goto _23
  6051  _24:
  6052  	goto _34
  6053  _22:
  6054  	func() {
  6055  		if int32(_desiredEnc) != int32(3) {
  6056  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27411), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5930)))
  6057  			crt.X__builtin_abort(tls)
  6058  		}
  6059  	}()
  6060  _37:
  6061  	if crt.P2U(unsafe.Pointer(_zIn)) >= crt.P2U(unsafe.Pointer(_zTerm)) {
  6062  		goto _38
  6063  	}
  6064  	_c = uint32(*postInc15(&_zIn, 1))
  6065  	if _c < uint32(192) {
  6066  		goto _39
  6067  	}
  6068  	_c = uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3Utf8Trans1)), uintptr(_c-uint32(192))))
  6069  _40:
  6070  	if (_zIn != _zTerm) && ((int32(*_zIn) & int32(192)) == int32(128)) {
  6071  		_c = (_c << 6) + uint32(int32(63)&int32(*postInc15(&_zIn, 1)))
  6072  		goto _40
  6073  	}
  6074  	if ((_c < uint32(128)) || ((_c & uint32(4294965248)) == uint32(55296))) || ((_c & uint32(4294967294)) == uint32(65534)) {
  6075  		_c = uint32(65533)
  6076  	}
  6077  _39:
  6078  	if _c <= uint32(65535) {
  6079  		*postInc15(&_z, 1) = uint8((_c >> 8) & uint32(255))
  6080  		*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6081  		goto _47
  6082  	}
  6083  	*postInc15(&_z, 1) = uint8(uint32(216) + (((_c - uint32(65536)) >> 18) & uint32(3)))
  6084  	*postInc15(&_z, 1) = uint8(((_c >> 10) & uint32(63)) + (((_c - uint32(65536)) >> 10) & uint32(192)))
  6085  	*postInc15(&_z, 1) = uint8(uint32(220) + ((_c >> 8) & uint32(3)))
  6086  	*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6087  _47:
  6088  	goto _37
  6089  _38:
  6090  _34:
  6091  	_pMem.Xn = int32(int64(uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer(_zOut))))
  6092  	*postInc15(&_z, 1) = 0
  6093  	goto _48
  6094  _21:
  6095  	func() {
  6096  		if int32(_desiredEnc) != int32(1) {
  6097  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27421), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5957)))
  6098  			crt.X__builtin_abort(tls)
  6099  		}
  6100  	}()
  6101  	if int32(_pMem.Xenc) != int32(2) {
  6102  		goto _51
  6103  	}
  6104  _52:
  6105  	if crt.P2U(unsafe.Pointer(_zIn)) >= crt.P2U(unsafe.Pointer(_zTerm)) {
  6106  		goto _53
  6107  	}
  6108  	_c = uint32(*postInc15(&_zIn, 1))
  6109  	_c += uint32(int32(*postInc15(&_zIn, 1)) << 8)
  6110  	if ((_c >= uint32(55296)) && (_c < uint32(57344))) && (crt.P2U(unsafe.Pointer(_zIn)) < crt.P2U(unsafe.Pointer(_zTerm))) {
  6111  		_28_c2 = int32(*postInc15(&_zIn, 1))
  6112  		_28_c2 += int32(*postInc15(&_zIn, 1)) << 8
  6113  		_c = (uint32(_28_c2&int32(1023)) + ((_c & uint32(63)) << 10)) + (((_c & uint32(960)) + uint32(64)) << 10)
  6114  	}
  6115  	if _c < uint32(128) {
  6116  		*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6117  		goto _62
  6118  	}
  6119  	if _c < uint32(2048) {
  6120  		*postInc15(&_z, 1) = uint8(int32(192) + int32(uint8((_c>>6)&uint32(31))))
  6121  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6122  		goto _62
  6123  	}
  6124  	if _c < uint32(65536) {
  6125  		*postInc15(&_z, 1) = uint8(int32(224) + int32(uint8((_c>>12)&uint32(15))))
  6126  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>6)&uint32(63))))
  6127  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6128  		goto _62
  6129  	}
  6130  	*postInc15(&_z, 1) = uint8(int32(240) + int32(uint8((_c>>18)&uint32(7))))
  6131  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>12)&uint32(63))))
  6132  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>6)&uint32(63))))
  6133  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6134  _62:
  6135  	goto _52
  6136  _53:
  6137  	goto _63
  6138  _51:
  6139  _64:
  6140  	if crt.P2U(unsafe.Pointer(_zIn)) >= crt.P2U(unsafe.Pointer(_zTerm)) {
  6141  		goto _65
  6142  	}
  6143  	_c = uint32(int32(*postInc15(&_zIn, 1)) << 8)
  6144  	_c += uint32(*postInc15(&_zIn, 1))
  6145  	if ((_c >= uint32(55296)) && (_c < uint32(57344))) && (crt.P2U(unsafe.Pointer(_zIn)) < crt.P2U(unsafe.Pointer(_zTerm))) {
  6146  		_37_c2 = int32(*postInc15(&_zIn, 1)) << 8
  6147  		_37_c2 += int32(*postInc15(&_zIn, 1))
  6148  		_c = (uint32(_37_c2&int32(1023)) + ((_c & uint32(63)) << 10)) + (((_c & uint32(960)) + uint32(64)) << 10)
  6149  	}
  6150  	if _c < uint32(128) {
  6151  		*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6152  		goto _74
  6153  	}
  6154  	if _c < uint32(2048) {
  6155  		*postInc15(&_z, 1) = uint8(int32(192) + int32(uint8((_c>>6)&uint32(31))))
  6156  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6157  		goto _74
  6158  	}
  6159  	if _c < uint32(65536) {
  6160  		*postInc15(&_z, 1) = uint8(int32(224) + int32(uint8((_c>>12)&uint32(15))))
  6161  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>6)&uint32(63))))
  6162  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6163  		goto _74
  6164  	}
  6165  	*postInc15(&_z, 1) = uint8(int32(240) + int32(uint8((_c>>18)&uint32(7))))
  6166  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>12)&uint32(63))))
  6167  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>6)&uint32(63))))
  6168  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6169  _74:
  6170  	goto _64
  6171  _65:
  6172  _63:
  6173  	_pMem.Xn = int32(int64(uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer(_zOut))))
  6174  _48:
  6175  	*_z = 0
  6176  	func() {
  6177  		if (_pMem.Xn + func() int32 {
  6178  			if int32(_desiredEnc) == int32(1) {
  6179  				return int32(1)
  6180  			}
  6181  			return int32(2)
  6182  		}()) > _len {
  6183  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27438), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5981)))
  6184  			crt.X__builtin_abort(tls)
  6185  		}
  6186  	}()
  6187  	_c = uint32(_pMem.Xflags)
  6188  	_sqlite3VdbeMemRelease(tls, _pMem)
  6189  	_pMem.Xflags = uint16(uint32(514) | (_c & uint32(32799)))
  6190  	_pMem.Xenc = _desiredEnc
  6191  	_pMem.Xz = (*int8)(unsafe.Pointer(_zOut))
  6192  	_pMem.XzMalloc = _pMem.Xz
  6193  	_pMem.XszMalloc = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.Xz))
  6194  _translate_out:
  6195  	return int32(0)
  6196  }
  6197  
  6198  var _sqlite3VdbeMemTranslateØ00__func__Ø000 [24]int8
  6199  
  6200  func init() {
  6201  	crt.Xstrncpy(nil, &_sqlite3VdbeMemTranslateØ00__func__Ø000[0], str(6026), 24)
  6202  }
  6203  
  6204  // C comment
  6205  //  /*
  6206  //  ** Change pMem so that its MEM_Str or MEM_Blob value is stored in
  6207  //  ** MEM.zMalloc, where it can be safely written.
  6208  //  **
  6209  //  ** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
  6210  //  */
  6211  func _sqlite3VdbeMemMakeWriteable(tls *crt.TLS, _pMem *XMem) (r0 int32) {
  6212  	func() {
  6213  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  6214  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69895), unsafe.Pointer(&_sqlite3VdbeMemMakeWriteableØ00__func__Ø000), unsafe.Pointer(str(4568)))
  6215  			crt.X__builtin_abort(tls)
  6216  		}
  6217  	}()
  6218  	func() {
  6219  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  6220  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69896), unsafe.Pointer(&_sqlite3VdbeMemMakeWriteableØ00__func__Ø000), unsafe.Pointer(str(4540)))
  6221  			crt.X__builtin_abort(tls)
  6222  		}
  6223  	}()
  6224  	if (int32(_pMem.Xflags) & int32(18)) == int32(0) {
  6225  		goto _5
  6226  	}
  6227  	if func() int32 {
  6228  		if (int32(_pMem.Xflags) & int32(16384)) != 0 {
  6229  			return _sqlite3VdbeMemExpandBlob(tls, _pMem)
  6230  		}
  6231  		return int32(0)
  6232  	}() != 0 {
  6233  		return int32(7)
  6234  	}
  6235  	if _pMem.XszMalloc != int32(0) && _pMem.Xz == _pMem.XzMalloc {
  6236  		goto _10
  6237  	}
  6238  	if _sqlite3VdbeMemGrow(tls, _pMem, _pMem.Xn+int32(2), int32(1)) != 0 {
  6239  		return _sqlite3NomemError(tls, int32(69901))
  6240  	}
  6241  	*elem1(_pMem.Xz, uintptr(_pMem.Xn)) = 0
  6242  	*elem1(_pMem.Xz, uintptr(_pMem.Xn+int32(1))) = 0
  6243  	{
  6244  		p := &_pMem.Xflags
  6245  		*p = uint16(int32(*p) | int32(512))
  6246  	}
  6247  _10:
  6248  _5:
  6249  	{
  6250  		p := &_pMem.Xflags
  6251  		*p = uint16(int32(*p) & int32(-4097))
  6252  	}
  6253  	*(**XMem)(unsafe.Pointer(&_pMem.XpScopyFrom)) = nil
  6254  	return int32(0)
  6255  }
  6256  
  6257  var _sqlite3VdbeMemMakeWriteableØ00__func__Ø000 [28]int8
  6258  
  6259  func init() {
  6260  	crt.Xstrncpy(nil, &_sqlite3VdbeMemMakeWriteableØ00__func__Ø000[0], str(6050), 28)
  6261  }
  6262  
  6263  // C comment
  6264  //  /*
  6265  //  ** This lookup table is used to help decode the first byte of
  6266  //  ** a multi-byte UTF8 character.
  6267  //  */
  6268  var _sqlite3Utf8Trans1 [64]uint8
  6269  
  6270  func init() {
  6271  	_sqlite3Utf8Trans1 = [64]uint8{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 0, 0}
  6272  }
  6273  
  6274  // C comment
  6275  //  /*
  6276  //  ** Release any memory resources held by the Mem.  Both the memory that is
  6277  //  ** free by Mem.xDel and the Mem.zMalloc allocation are freed.
  6278  //  **
  6279  //  ** Use this routine prior to clean up prior to abandoning a Mem, or to
  6280  //  ** reset a Mem back to its minimum memory utilization.
  6281  //  **
  6282  //  ** Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space
  6283  //  ** prior to inserting new content into the Mem.
  6284  //  */
  6285  func _sqlite3VdbeMemRelease(tls *crt.TLS, _p *XMem) {
  6286  	func() {
  6287  		if _sqlite3VdbeCheckMemInvariants(tls, _p) == 0 {
  6288  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70115), unsafe.Pointer(&_sqlite3VdbeMemReleaseØ00__func__Ø000), unsafe.Pointer(str(6078)))
  6289  			crt.X__builtin_abort(tls)
  6290  		}
  6291  	}()
  6292  	if ((int32(_p.Xflags) & int32(9312)) != int32(0)) || _p.XszMalloc != 0 {
  6293  		_vdbeMemClear(tls, _p)
  6294  	}
  6295  }
  6296  
  6297  var _sqlite3VdbeMemReleaseØ00__func__Ø000 [22]int8
  6298  
  6299  func init() {
  6300  	crt.Xstrncpy(nil, &_sqlite3VdbeMemReleaseØ00__func__Ø000[0], str(6111), 22)
  6301  }
  6302  
  6303  // C comment
  6304  //  /*
  6305  //  ** Release memory held by the Mem p, both external memory cleared
  6306  //  ** by p->xDel and memory in p->zMalloc.
  6307  //  **
  6308  //  ** This is a helper routine invoked by sqlite3VdbeMemRelease() in
  6309  //  ** the unusual case where there really is memory in p that needs
  6310  //  ** to be freed.
  6311  //  */
  6312  func _vdbeMemClear(tls *crt.TLS, _p *XMem) {
  6313  	if (int32(_p.Xflags) & int32(9312)) != int32(0) {
  6314  		_vdbeMemClearExternAndSetNull(tls, _p)
  6315  	}
  6316  	if _p.XszMalloc != 0 {
  6317  		_sqlite3DbFreeNN(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p.XzMalloc))
  6318  		_p.XszMalloc = int32(0)
  6319  	}
  6320  	_p.Xz = nil
  6321  }
  6322  
  6323  // C comment
  6324  //  /*
  6325  //  ** Make sure the given Mem is \u0000 terminated.
  6326  //  */
  6327  func _sqlite3VdbeMemNulTerminate(tls *crt.TLS, _pMem *XMem) (r0 int32) {
  6328  	func() {
  6329  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  6330  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69962), unsafe.Pointer(&_sqlite3VdbeMemNulTerminateØ00__func__Ø000), unsafe.Pointer(str(4568)))
  6331  			crt.X__builtin_abort(tls)
  6332  		}
  6333  	}()
  6334  	if (int32(_pMem.Xflags) & int32(514)) != int32(2) {
  6335  		return int32(0)
  6336  	}
  6337  	return _vdbeMemAddTerminator(tls, _pMem)
  6338  }
  6339  
  6340  var _sqlite3VdbeMemNulTerminateØ00__func__Ø000 [27]int8
  6341  
  6342  func init() {
  6343  	crt.Xstrncpy(nil, &_sqlite3VdbeMemNulTerminateØ00__func__Ø000[0], str(6133), 27)
  6344  }
  6345  
  6346  // C comment
  6347  //  /*
  6348  //  ** It is already known that pMem contains an unterminated string.
  6349  //  ** Add the zero terminator.
  6350  //  */
  6351  func _vdbeMemAddTerminator(tls *crt.TLS, _pMem *XMem) (r0 int32) {
  6352  	if _sqlite3VdbeMemGrow(tls, _pMem, _pMem.Xn+int32(2), int32(1)) != 0 {
  6353  		return _sqlite3NomemError(tls, int32(69950))
  6354  	}
  6355  	*elem1(_pMem.Xz, uintptr(_pMem.Xn)) = 0
  6356  	*elem1(_pMem.Xz, uintptr(_pMem.Xn+int32(1))) = 0
  6357  	{
  6358  		p := &_pMem.Xflags
  6359  		*p = uint16(int32(*p) | int32(512))
  6360  	}
  6361  	return int32(0)
  6362  }
  6363  
  6364  // C comment
  6365  //  /*
  6366  //  ** Add MEM_Str to the set of representations for the given Mem.  Numbers
  6367  //  ** are converted using sqlite3_snprintf().  Converting a BLOB to a string
  6368  //  ** is a no-op.
  6369  //  **
  6370  //  ** Existing representations MEM_Int and MEM_Real are invalidated if
  6371  //  ** bForce is true but are retained if bForce is false.
  6372  //  **
  6373  //  ** A MEM_Null value will never be passed to this function. This function is
  6374  //  ** used for converting values to text for returning to the user (i.e. via
  6375  //  ** sqlite3_value_text()), or for ensuring that values to be used as btree
  6376  //  ** keys are strings. In the former case a NULL pointer is returned the
  6377  //  ** user and the latter is an internal programming error.
  6378  //  */
  6379  func _sqlite3VdbeMemStringify(tls *crt.TLS, _pMem *XMem, _enc uint8, _bForce uint8) (r0 int32) {
  6380  	var _fg, _nByte int32
  6381  	_fg = int32(_pMem.Xflags)
  6382  	_nByte = int32(32)
  6383  	func() {
  6384  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  6385  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69990), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(4568)))
  6386  			crt.X__builtin_abort(tls)
  6387  		}
  6388  	}()
  6389  	func() {
  6390  		if (_fg & int32(16384)) != 0 {
  6391  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69991), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(6160)))
  6392  			crt.X__builtin_abort(tls)
  6393  		}
  6394  	}()
  6395  	func() {
  6396  		if (_fg & int32(18)) != 0 {
  6397  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69992), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(6175)))
  6398  			crt.X__builtin_abort(tls)
  6399  		}
  6400  	}()
  6401  	func() {
  6402  		if (_fg & int32(12)) == 0 {
  6403  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69993), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(6200)))
  6404  			crt.X__builtin_abort(tls)
  6405  		}
  6406  	}()
  6407  	func() {
  6408  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  6409  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69994), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(4540)))
  6410  			crt.X__builtin_abort(tls)
  6411  		}
  6412  	}()
  6413  	func() {
  6414  		if (int64(uintptr(unsafe.Pointer(_pMem))) & int64(7)) != (0) {
  6415  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69995), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(6222)))
  6416  			crt.X__builtin_abort(tls)
  6417  		}
  6418  	}()
  6419  	if _sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte) != 0 {
  6420  		_pMem.Xenc = 0
  6421  		return _sqlite3NomemError(tls, int32(70000))
  6422  	}
  6423  	if (_fg & int32(4)) != 0 {
  6424  		Xsqlite3_snprintf(tls, _nByte, _pMem.Xz, str(6249), *(*int64)(unsafe.Pointer(&_pMem.Xu)))
  6425  		goto _15
  6426  	}
  6427  	func() {
  6428  		if (_fg & int32(8)) == 0 {
  6429  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70012), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(6254)))
  6430  			crt.X__builtin_abort(tls)
  6431  		}
  6432  	}()
  6433  	Xsqlite3_snprintf(tls, _nByte, _pMem.Xz, str(6268), *(*float64)(unsafe.Pointer(&_pMem.Xu)))
  6434  _15:
  6435  	_pMem.Xn = _sqlite3Strlen30(tls, _pMem.Xz)
  6436  	_pMem.Xenc = uint8(1)
  6437  	{
  6438  		p := &_pMem.Xflags
  6439  		*p = uint16(int32(*p) | int32(514))
  6440  	}
  6441  	if _bForce != 0 {
  6442  		{
  6443  			p := &_pMem.Xflags
  6444  			*p = uint16(int32(*p) & int32(-13))
  6445  		}
  6446  	}
  6447  	_sqlite3VdbeChangeEncoding(tls, _pMem, int32(_enc))
  6448  	return int32(0)
  6449  }
  6450  
  6451  var _sqlite3VdbeMemStringifyØ00__func__Ø000 [24]int8
  6452  
  6453  func init() {
  6454  	crt.Xstrncpy(nil, &_sqlite3VdbeMemStringifyØ00__func__Ø000[0], str(6275), 24)
  6455  }
  6456  
  6457  // C comment
  6458  //  /*
  6459  //  ** Change the pMem->zMalloc allocation to be at least szNew bytes.
  6460  //  ** If pMem->zMalloc already meets or exceeds the requested size, this
  6461  //  ** routine is a no-op.
  6462  //  **
  6463  //  ** Any prior string or blob content in the pMem object may be discarded.
  6464  //  ** The pMem->xDel destructor is called, if it exists.  Though MEM_Str
  6465  //  ** and MEM_Blob values may be discarded, MEM_Int, MEM_Real, and MEM_Null
  6466  //  ** values are preserved.
  6467  //  **
  6468  //  ** Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM)
  6469  //  ** if unable to complete the resizing.
  6470  //  */
  6471  func _sqlite3VdbeMemClearAndResize(tls *crt.TLS, _pMem *XMem, _szNew int32) (r0 int32) {
  6472  	func() {
  6473  		if _szNew <= int32(0) {
  6474  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69877), unsafe.Pointer(&_sqlite3VdbeMemClearAndResizeØ00__func__Ø000), unsafe.Pointer(str(6299)))
  6475  			crt.X__builtin_abort(tls)
  6476  		}
  6477  	}()
  6478  	func() {
  6479  		if (int32(_pMem.Xflags)&int32(1024)) != int32(0) && _pMem.XszMalloc != int32(0) {
  6480  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69878), unsafe.Pointer(&_sqlite3VdbeMemClearAndResizeØ00__func__Ø000), unsafe.Pointer(str(6307)))
  6481  			crt.X__builtin_abort(tls)
  6482  		}
  6483  	}()
  6484  	if _pMem.XszMalloc < _szNew {
  6485  		return _sqlite3VdbeMemGrow(tls, _pMem, _szNew, int32(0))
  6486  	}
  6487  	func() {
  6488  		if (int32(_pMem.Xflags) & int32(1024)) != int32(0) {
  6489  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69882), unsafe.Pointer(&_sqlite3VdbeMemClearAndResizeØ00__func__Ø000), unsafe.Pointer(str(5572)))
  6490  			crt.X__builtin_abort(tls)
  6491  		}
  6492  	}()
  6493  	_pMem.Xz = _pMem.XzMalloc
  6494  	{
  6495  		p := &_pMem.Xflags
  6496  		*p = uint16(int32(*p) & int32(13))
  6497  	}
  6498  	return int32(0)
  6499  }
  6500  
  6501  var _sqlite3VdbeMemClearAndResizeØ00__func__Ø000 [29]int8
  6502  
  6503  func init() {
  6504  	crt.Xstrncpy(nil, &_sqlite3VdbeMemClearAndResizeØ00__func__Ø000[0], str(6355), 29)
  6505  }
  6506  
  6507  func Xsqlite3_snprintf(tls *crt.TLS, _n int32, _zBuf *int8, _zFormat *int8, args ...interface{}) (r0 *int8) {
  6508  	var _z *int8
  6509  	var _ap []interface{}
  6510  	_ap = args
  6511  	_z = Xsqlite3_vsnprintf(tls, _n, _zBuf, _zFormat, _ap)
  6512  	_ap = nil
  6513  	return _z
  6514  }
  6515  
  6516  // C comment
  6517  //  /*
  6518  //  ** sqlite3_snprintf() works like snprintf() except that it ignores the
  6519  //  ** current locale settings.  This is important for SQLite because we
  6520  //  ** are not able to use a "," as the decimal point in place of "." as
  6521  //  ** specified by some locales.
  6522  //  **
  6523  //  ** Oops:  The first two arguments of sqlite3_snprintf() are backwards
  6524  //  ** from the snprintf() standard.  Unfortunately, it is too late to change
  6525  //  ** this without breaking compatibility, so we just have to live with the
  6526  //  ** mistake.
  6527  //  **
  6528  //  ** sqlite3_vsnprintf() is the varargs version.
  6529  //  */
  6530  func Xsqlite3_vsnprintf(tls *crt.TLS, _n int32, _zBuf *int8, _zFormat *int8, _ap []interface{}) (r0 *int8) {
  6531  	var _acc XStrAccum
  6532  	if _n <= int32(0) {
  6533  		return _zBuf
  6534  	}
  6535  	if _zBuf != nil && _zFormat != nil {
  6536  		goto _2
  6537  	}
  6538  	_sqlite3MisuseError(tls, int32(26087))
  6539  	if _zBuf != nil {
  6540  		*elem1(_zBuf, 0) = 0
  6541  	}
  6542  	return _zBuf
  6543  
  6544  _2:
  6545  	_sqlite3StrAccumInit(tls, &_acc, nil, _zBuf, _n, int32(0))
  6546  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
  6547  	*elem1(_zBuf, uintptr(_acc.XnChar)) = 0
  6548  	return _zBuf
  6549  }
  6550  
  6551  // C comment
  6552  //  /*
  6553  //  ** Extract the user data from a sqlite3_context structure and return a
  6554  //  ** pointer to it.
  6555  //  **
  6556  //  ** IMPLEMENTATION-OF: R-46798-50301 The sqlite3_context_db_handle() interface
  6557  //  ** returns a copy of the pointer to the database connection (the 1st
  6558  //  ** parameter) of the sqlite3_create_function() and
  6559  //  ** sqlite3_create_function16() routines that originally registered the
  6560  //  ** application defined function.
  6561  //  */
  6562  func Xsqlite3_context_db_handle(tls *crt.TLS, _p *Xsqlite3_context) (r0 *Xsqlite3) {
  6563  	func() {
  6564  		if _p == nil || _p.XpOut == nil {
  6565  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76814), unsafe.Pointer(&_sqlite3_context_db_handleØ00__func__Ø000), unsafe.Pointer(str(6384)))
  6566  			crt.X__builtin_abort(tls)
  6567  		}
  6568  	}()
  6569  	return (*Xsqlite3)((*XMem)(_p.XpOut).Xdb)
  6570  }
  6571  
  6572  var _sqlite3_context_db_handleØ00__func__Ø000 [26]int8
  6573  
  6574  func init() {
  6575  	crt.Xstrncpy(nil, &_sqlite3_context_db_handleØ00__func__Ø000[0], str(6397), 26)
  6576  }
  6577  
  6578  // C comment
  6579  //  /*
  6580  //  ** Return the length (in bytes) of the token that begins at z[0].
  6581  //  ** Store the token type in *tokenType before returning.
  6582  //  */
  6583  func _sqlite3GetToken(tls *crt.TLS, _z *uint8, _tokenType *int32) (r0 int32) {
  6584  	var _i, _c, _35_delim, _58_n int32
  6585  	switch int32(*elem15((*uint8)(unsafe.Pointer(&_aiClass)), uintptr(*_z))) {
  6586  	case int32(0):
  6587  		goto _26
  6588  	case int32(1):
  6589  		goto _25
  6590  	case int32(2):
  6591  		goto _27
  6592  	case int32(3):
  6593  		goto _20
  6594  	case int32(4):
  6595  		goto _23
  6596  	case int32(5):
  6597  		goto _23
  6598  	case int32(6):
  6599  		goto _22
  6600  	case int32(7):
  6601  		goto _1
  6602  	case int32(8):
  6603  		goto _18
  6604  	case int32(9):
  6605  		goto _21
  6606  	case int32(10):
  6607  		goto _14
  6608  	case int32(11):
  6609  		goto _2
  6610  	case int32(12):
  6611  		goto _11
  6612  	case int32(13):
  6613  		goto _12
  6614  	case int32(14):
  6615  		goto _10
  6616  	case int32(15):
  6617  		goto _13
  6618  	case int32(16):
  6619  		goto _8
  6620  	case int32(17):
  6621  		goto _3
  6622  	case int32(18):
  6623  		goto _4
  6624  	case int32(19):
  6625  		goto _5
  6626  	case int32(20):
  6627  		goto _6
  6628  	case int32(21):
  6629  		goto _7
  6630  	case int32(22):
  6631  		goto _9
  6632  	case int32(23):
  6633  		goto _15
  6634  	case int32(24):
  6635  		goto _16
  6636  	case int32(25):
  6637  		goto _17
  6638  	case int32(26):
  6639  		goto _19
  6640  	default:
  6641  		goto _28
  6642  	}
  6643  
  6644  _1:
  6645  	_i = int32(1)
  6646  _29:
  6647  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(1)) == 0 {
  6648  		goto _32
  6649  	}
  6650  	_i += 1
  6651  	goto _29
  6652  _32:
  6653  	*_tokenType = int32(163)
  6654  	return _i
  6655  
  6656  _2:
  6657  	if int32(*elem15(_z, uintptr(1))) != int32(45) {
  6658  		goto _33
  6659  	}
  6660  	_i = int32(2)
  6661  _34:
  6662  	if store2(&_c, int32(*elem15(_z, uintptr(_i)))) == int32(0) || _c == int32(10) {
  6663  		goto _38
  6664  	}
  6665  	_i += 1
  6666  	goto _34
  6667  _38:
  6668  	*_tokenType = int32(163)
  6669  	return _i
  6670  
  6671  _33:
  6672  	*_tokenType = int32(89)
  6673  	return int32(1)
  6674  
  6675  _3:
  6676  	*_tokenType = int32(22)
  6677  	return int32(1)
  6678  
  6679  _4:
  6680  	*_tokenType = int32(23)
  6681  	return int32(1)
  6682  
  6683  _5:
  6684  	*_tokenType = int32(1)
  6685  	return int32(1)
  6686  
  6687  _6:
  6688  	*_tokenType = int32(88)
  6689  	return int32(1)
  6690  
  6691  _7:
  6692  	*_tokenType = int32(90)
  6693  	return int32(1)
  6694  
  6695  _8:
  6696  	if (int32(*elem15(_z, uintptr(1))) != int32(42)) || (int32(*elem15(_z, uintptr(2))) == int32(0)) {
  6697  		*_tokenType = int32(91)
  6698  		return int32(1)
  6699  	}
  6700  	*func() *int32 { _i = int32(3); return &_c }() = int32(*elem15(_z, uintptr(2)))
  6701  _41:
  6702  	if _c == int32(42) && int32(*elem15(_z, uintptr(_i))) == int32(47) || store2(&_c, int32(*elem15(_z, uintptr(_i)))) == int32(0) {
  6703  		goto _46
  6704  	}
  6705  	_i += 1
  6706  	goto _41
  6707  _46:
  6708  	if _c != 0 {
  6709  		_i += 1
  6710  	}
  6711  	*_tokenType = int32(163)
  6712  	return _i
  6713  
  6714  _9:
  6715  	*_tokenType = int32(92)
  6716  	return int32(1)
  6717  
  6718  _10:
  6719  	*_tokenType = int32(78)
  6720  	return int32(1) + bool2int(int32(*elem15(_z, uintptr(1))) == int32(61))
  6721  
  6722  _11:
  6723  	if store2(&_c, int32(*elem15(_z, uintptr(1)))) == int32(61) {
  6724  		*_tokenType = int32(80)
  6725  		return int32(2)
  6726  	}
  6727  	if _c == int32(62) {
  6728  		*_tokenType = int32(77)
  6729  		return int32(2)
  6730  	}
  6731  	if _c == int32(60) {
  6732  		*_tokenType = int32(86)
  6733  		return int32(2)
  6734  	}
  6735  	*_tokenType = int32(81)
  6736  	return int32(1)
  6737  
  6738  _12:
  6739  	if store2(&_c, int32(*elem15(_z, uintptr(1)))) == int32(61) {
  6740  		*_tokenType = int32(82)
  6741  		return int32(2)
  6742  	}
  6743  	if _c == int32(62) {
  6744  		*_tokenType = int32(87)
  6745  		return int32(2)
  6746  	}
  6747  	*_tokenType = int32(79)
  6748  	return int32(1)
  6749  
  6750  _13:
  6751  	if int32(*elem15(_z, uintptr(1))) != int32(61) {
  6752  		*_tokenType = int32(164)
  6753  		return int32(1)
  6754  	}
  6755  	*_tokenType = int32(77)
  6756  	return int32(2)
  6757  
  6758  _14:
  6759  	if int32(*elem15(_z, uintptr(1))) != int32(124) {
  6760  		*_tokenType = int32(85)
  6761  		return int32(1)
  6762  	}
  6763  	*_tokenType = int32(93)
  6764  	return int32(2)
  6765  
  6766  _15:
  6767  	*_tokenType = int32(26)
  6768  	return int32(1)
  6769  
  6770  _16:
  6771  	*_tokenType = int32(84)
  6772  	return int32(1)
  6773  
  6774  _17:
  6775  	*_tokenType = int32(95)
  6776  	return int32(1)
  6777  
  6778  _18:
  6779  	_35_delim = int32(*elem15(_z, 0))
  6780  	_i = int32(1)
  6781  _62:
  6782  	if store2(&_c, int32(*elem15(_z, uintptr(_i)))) == int32(0) {
  6783  		goto _65
  6784  	}
  6785  	if _c != _35_delim {
  6786  		goto _66
  6787  	}
  6788  	if int32(*elem15(_z, uintptr(_i+int32(1)))) == _35_delim {
  6789  		_i += 1
  6790  		goto _68
  6791  	}
  6792  	goto _65
  6793  _68:
  6794  _66:
  6795  	_i += 1
  6796  	goto _62
  6797  _65:
  6798  	if _c == int32(39) {
  6799  		*_tokenType = int32(97)
  6800  		return _i + int32(1)
  6801  	}
  6802  	if _c != int32(0) {
  6803  		*_tokenType = int32(27)
  6804  		return _i + int32(1)
  6805  	}
  6806  	*_tokenType = int32(164)
  6807  	return _i
  6808  
  6809  _19:
  6810  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(1))))) & int32(4)) == 0 {
  6811  		*_tokenType = int32(122)
  6812  		return int32(1)
  6813  	}
  6814  _20:
  6815  	*_tokenType = int32(134)
  6816  	if int32(*elem15(_z, 0)) != int32(48) || int32(*elem15(_z, uintptr(1))) != int32(120) && int32(*elem15(_z, uintptr(1))) != int32(88) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(2)))))&int32(8)) == 0 {
  6817  		goto _77
  6818  	}
  6819  	_i = int32(3)
  6820  _78:
  6821  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(8)) == 0 {
  6822  		goto _81
  6823  	}
  6824  	_i += 1
  6825  	goto _78
  6826  _81:
  6827  	return _i
  6828  
  6829  _77:
  6830  	_i = int32(0)
  6831  _82:
  6832  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(4)) == 0 {
  6833  		goto _85
  6834  	}
  6835  	_i += 1
  6836  	goto _82
  6837  _85:
  6838  	if int32(*elem15(_z, uintptr(_i))) != int32(46) {
  6839  		goto _86
  6840  	}
  6841  	_i += 1
  6842  _87:
  6843  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(4)) != 0 {
  6844  		_i += 1
  6845  		goto _87
  6846  	}
  6847  	*_tokenType = int32(132)
  6848  _86:
  6849  	if int32(*elem15(_z, uintptr(_i))) != int32(101) && int32(*elem15(_z, uintptr(_i))) != int32(69) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i+int32(1))))))&int32(4)) == 0 && (int32(*elem15(_z, uintptr(_i+int32(1)))) != int32(43) && int32(*elem15(_z, uintptr(_i+int32(1)))) != int32(45) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i+int32(2))))))&int32(4)) == 0) {
  6850  		goto _94
  6851  	}
  6852  	_i += int32(2)
  6853  _95:
  6854  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(4)) != 0 {
  6855  		_i += 1
  6856  		goto _95
  6857  	}
  6858  	*_tokenType = int32(132)
  6859  _94:
  6860  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(70)) != int32(0) {
  6861  		*_tokenType = int32(164)
  6862  		_i += 1
  6863  		goto _94
  6864  	}
  6865  	return _i
  6866  
  6867  _21:
  6868  	*func() *int32 { _i = int32(1); return &_c }() = int32(*elem15(_z, 0))
  6869  _99:
  6870  	if _c == int32(93) || store2(&_c, int32(*elem15(_z, uintptr(_i)))) == int32(0) {
  6871  		goto _103
  6872  	}
  6873  	_i += 1
  6874  	goto _99
  6875  _103:
  6876  	*_tokenType = func() int32 {
  6877  		if _c == int32(93) {
  6878  			return int32(27)
  6879  		}
  6880  		return int32(164)
  6881  	}()
  6882  	return _i
  6883  
  6884  _22:
  6885  	*_tokenType = int32(135)
  6886  	_i = int32(1)
  6887  _106:
  6888  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(4)) == 0 {
  6889  		goto _109
  6890  	}
  6891  	_i += 1
  6892  	goto _106
  6893  _109:
  6894  	return _i
  6895  
  6896  _23:
  6897  	_58_n = int32(0)
  6898  	*_tokenType = int32(135)
  6899  	_i = int32(1)
  6900  _110:
  6901  	if store2(&_c, int32(*elem15(_z, uintptr(_i)))) == int32(0) {
  6902  		goto _113
  6903  	}
  6904  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(_c)))) & int32(70)) != int32(0) {
  6905  		_58_n += 1
  6906  		goto _126
  6907  	}
  6908  	if _c != int32(40) || _58_n <= int32(0) {
  6909  		goto _117
  6910  	}
  6911  _118:
  6912  	_i += 1
  6913  	if ((store2(&_c, int32(*elem15(_z, uintptr(_i)))) != int32(0)) && ((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(_c)))) & int32(1)) == 0)) && (_c != int32(41)) {
  6914  		goto _118
  6915  	}
  6916  	if _c == int32(41) {
  6917  		_i += 1
  6918  		goto _122
  6919  	}
  6920  	*_tokenType = int32(164)
  6921  _122:
  6922  	goto _113
  6923  _117:
  6924  	if (_c == int32(58)) && (int32(*elem15(_z, uintptr(_i+int32(1)))) == int32(58)) {
  6925  		_i += 1
  6926  		goto _126
  6927  	}
  6928  	goto _113
  6929  _126:
  6930  	_i += 1
  6931  	goto _110
  6932  _113:
  6933  	if _58_n == int32(0) {
  6934  		*_tokenType = int32(164)
  6935  	}
  6936  	return _i
  6937  
  6938  _25:
  6939  	_i = int32(1)
  6940  _128:
  6941  	if int32(*elem15((*uint8)(unsafe.Pointer(&_aiClass)), uintptr(*elem15(_z, uintptr(_i))))) > int32(1) {
  6942  		goto _131
  6943  	}
  6944  	_i += 1
  6945  	goto _128
  6946  _131:
  6947  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(70)) != int32(0) {
  6948  		_i += 1
  6949  		goto _133
  6950  	}
  6951  	*_tokenType = int32(27)
  6952  	return _keywordCode(tls, (*int8)(unsafe.Pointer(_z)), _i, _tokenType)
  6953  
  6954  _26:
  6955  	if int32(*elem15(_z, uintptr(1))) != int32(39) {
  6956  		goto _134
  6957  	}
  6958  	*_tokenType = int32(133)
  6959  	_i = int32(2)
  6960  _135:
  6961  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(8)) == 0 {
  6962  		goto _138
  6963  	}
  6964  	_i += 1
  6965  	goto _135
  6966  _138:
  6967  	if int32(*elem15(_z, uintptr(_i))) == int32(39) && (_i%int32(2)) == 0 {
  6968  		goto _140
  6969  	}
  6970  	*_tokenType = int32(164)
  6971  _141:
  6972  	if ((*elem15(_z, uintptr(_i))) != 0) && (int32(*elem15(_z, uintptr(_i))) != int32(39)) {
  6973  		_i += 1
  6974  		goto _141
  6975  	}
  6976  _140:
  6977  	if (*elem15(_z, uintptr(_i))) != 0 {
  6978  		_i += 1
  6979  	}
  6980  	return _i
  6981  
  6982  _134:
  6983  _27:
  6984  	_i = int32(1)
  6985  	goto _133
  6986  _28:
  6987  	*_tokenType = int32(164)
  6988  	return int32(1)
  6989  
  6990  _133:
  6991  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(70)) != int32(0) {
  6992  		_i += 1
  6993  		goto _133
  6994  	}
  6995  	*_tokenType = int32(27)
  6996  	return _i
  6997  }
  6998  
  6999  var _aiClass [256]uint8
  7000  
  7001  func init() {
  7002  	_aiClass = [256]uint8{27, 27, 27, 27, 27, 27, 27, 27, 27, 7, 7, 27, 7, 7, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 7, 15, 8, 5, 4, 22, 24, 8, 17, 18, 21, 20, 23, 11, 26, 16, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 19, 12, 14, 13, 6, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 9, 27, 27, 27, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 27, 10, 27, 25, 27, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}
  7003  }
  7004  
  7005  var _sqlite3CtypeMap [256]uint8
  7006  
  7007  func init() {
  7008  	_sqlite3CtypeMap = [256]uint8{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 128, 0, 64, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 128, 0, 0, 0, 64, 128, 42, 42, 42, 42, 42, 42, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64}
  7009  }
  7010  
  7011  // C comment
  7012  //  /*
  7013  //  ** The sqlite3KeywordCode function looks up an identifier to determine if
  7014  //  ** it is a keyword.  If it is a keyword, the token code of that keyword is
  7015  //  ** returned.  If the input is not a keyword, TK_ID is returned.
  7016  //  **
  7017  //  ** The implementation of this routine was generated by a program,
  7018  //  ** mkkeywordhash.c, located in the tool subdirectory of the distribution.
  7019  //  ** The output of the mkkeywordhash.c program is written into a file
  7020  //  ** named keywordhash.h and then included into this source file by
  7021  //  ** the #include below.
  7022  //  */
  7023  //  /************** Include keywordhash.h in the middle of tokenize.c ************/
  7024  //  /************** Begin file keywordhash.h *************************************/
  7025  //  /***** This file contains automatically generated code ******
  7026  //  **
  7027  //  ** The code in this file has been automatically generated by
  7028  //  **
  7029  //  **   sqlite/tool/mkkeywordhash.c
  7030  //  **
  7031  //  ** The code in this file implements a function that determines whether
  7032  //  ** or not a given identifier is really an SQL keyword.  The same thing
  7033  //  ** might be implemented more directly using a hand-written hash table.
  7034  //  ** But by using this automatically generated code, the size of the code
  7035  //  ** is substantially reduced.  This is important for embedded applications
  7036  //  ** on platforms with limited memory.
  7037  //  */
  7038  //  /* Hash score: 182 */
  7039  func _keywordCode(tls *crt.TLS, _z *int8, _n int32, _pType *int32) (r0 int32) {
  7040  	var _i, _j int32
  7041  	var _zKW *int8
  7042  	if _n < int32(2) {
  7043  		goto _0
  7044  	}
  7045  	_i = (((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_z, 0))))) * int32(4)) ^ (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_z, uintptr(_n-int32(1))))))) * int32(3))) ^ _n) % int32(127)
  7046  	_i = int32(*elem15((*uint8)(unsafe.Pointer(&_keywordCodeØ00aHashØ002)), uintptr(_i))) - int32(1)
  7047  _1:
  7048  	if _i < int32(0) {
  7049  		goto _4
  7050  	}
  7051  	if int32(*elem15((*uint8)(unsafe.Pointer(&_keywordCodeØ00aLenØ004)), uintptr(_i))) != _n {
  7052  		goto _2
  7053  	}
  7054  	_j = int32(0)
  7055  	_zKW = elem1((*int8)(unsafe.Pointer(&_keywordCodeØ00zTextØ001)), uintptr(*elem20((*uint16)(unsafe.Pointer(&_keywordCodeØ00aOffsetØ005)), uintptr(_i))))
  7056  _6:
  7057  	if (_j < _n) && ((int32(*elem1(_z, uintptr(_j))) & int32(-33)) == int32(*elem1(_zKW, uintptr(_j)))) {
  7058  		_j += 1
  7059  		goto _6
  7060  	}
  7061  	if _j < _n {
  7062  		goto _2
  7063  	}
  7064  	*_pType = int32(*elem15((*uint8)(unsafe.Pointer(&_keywordCodeØ00aCodeØ006)), uintptr(_i)))
  7065  	goto _4
  7066  _2:
  7067  	_i = int32(*elem15((*uint8)(unsafe.Pointer(&_keywordCodeØ00aNextØ003)), uintptr(_i))) - int32(1)
  7068  	goto _1
  7069  _4:
  7070  _0:
  7071  	return _n
  7072  }
  7073  
  7074  var _keywordCodeØ00aHashØ002 [127]uint8
  7075  
  7076  func init() {
  7077  	_keywordCodeØ00aHashØ002 = [127]uint8{76, 105, 117, 74, 0, 45, 0, 0, 82, 0, 77, 0, 0, 42, 12, 78, 15, 0, 116, 85, 54, 112, 0, 19, 0, 0, 121, 0, 119, 115, 0, 22, 93, 0, 9, 0, 0, 70, 71, 0, 69, 6, 0, 48, 90, 102, 0, 118, 101, 0, 0, 44, 0, 103, 24, 0, 17, 0, 122, 53, 23, 0, 5, 110, 25, 96, 0, 0, 124, 106, 60, 123, 57, 28, 55, 0, 91, 0, 100, 26, 0, 99, 0, 0, 0, 95, 92, 97, 88, 109, 14, 39, 108, 0, 81, 0, 18, 89, 111, 32, 0, 120, 80, 113, 62, 46, 84, 0, 0, 94, 40, 59, 114, 0, 36, 0, 0, 29, 0, 86, 63, 64, 0, 20, 61, 0, 56}
  7078  }
  7079  
  7080  var _keywordCodeØ00aLenØ004 [124]uint8
  7081  
  7082  func init() {
  7083  	_keywordCodeØ00aLenØ004 = [124]uint8{7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6, 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6, 11, 6, 2, 7, 5, 5, 9, 6, 9, 9, 7, 10, 10, 4, 6, 2, 3, 9, 4, 2, 6, 5, 7, 4, 5, 7, 6, 6, 5, 6, 5, 5, 9, 7, 7, 3, 2, 4, 4, 7, 3, 6, 4, 7, 6, 12, 6, 9, 4, 6, 5, 4, 7, 6, 5, 6, 7, 5, 4, 5, 6, 5, 7, 3, 7, 13, 2, 2, 4, 6, 6, 8, 5, 17, 12, 7, 8, 8, 2, 4, 4, 4, 4, 4, 2, 2, 6, 5, 8, 5, 8, 3, 5, 5, 6, 4, 9, 3}
  7084  }
  7085  
  7086  var _keywordCodeØ00zTextØ001 [553]int8
  7087  
  7088  func init() {
  7089  	_keywordCodeØ00zTextØ001 = [553]int8{82, 69, 73, 78, 68, 69, 88, 69, 68, 69, 83, 67, 65, 80, 69, 65, 67, 72, 69, 67, 75, 69, 89, 66, 69, 70, 79, 82, 69, 73, 71, 78, 79, 82, 69, 71, 69, 88, 80, 76, 65, 73, 78, 83, 84, 69, 65, 68, 68, 65, 84, 65, 66, 65, 83, 69, 76, 69, 67, 84, 65, 66, 76, 69, 70, 84, 72, 69, 78, 68, 69, 70, 69, 82, 82, 65, 66, 76, 69, 76, 83, 69, 88, 67, 69, 80, 84, 82, 65, 78, 83, 65, 67, 84, 73, 79, 78, 65, 84, 85, 82, 65, 76, 84, 69, 82, 65, 73, 83, 69, 88, 67, 76, 85, 83, 73, 86, 69, 88, 73, 83, 84, 83, 65, 86, 69, 80, 79, 73, 78, 84, 69, 82, 83, 69, 67, 84, 82, 73, 71, 71, 69, 82, 69, 70, 69, 82, 69, 78, 67, 69, 83, 67, 79, 78, 83, 84, 82, 65, 73, 78, 84, 79, 70, 70, 83, 69, 84, 69, 77, 80, 79, 82, 65, 82, 89, 85, 78, 73, 81, 85, 69, 82, 89, 87, 73, 84, 72, 79, 85, 84, 69, 82, 69, 76, 69, 65, 83, 69, 65, 84, 84, 65, 67, 72, 65, 86, 73, 78, 71, 82, 79, 85, 80, 68, 65, 84, 69, 66, 69, 71, 73, 78, 78, 69, 82, 69, 67, 85, 82, 83, 73, 86, 69, 66, 69, 84, 87, 69, 69, 78, 79, 84, 78, 85, 76, 76, 73, 75, 69, 67, 65, 83, 67, 65, 68, 69, 76, 69, 84, 69, 67, 65, 83, 69, 67, 79, 76, 76, 65, 84, 69, 67, 82, 69, 65, 84, 69, 67, 85, 82, 82, 69, 78, 84, 95, 68, 65, 84, 69, 68, 69, 84, 65, 67, 72, 73, 77, 77, 69, 68, 73, 65, 84, 69, 74, 79, 73, 78, 83, 69, 82, 84, 77, 65, 84, 67, 72, 80, 76, 65, 78, 65, 76, 89, 90, 69, 80, 82, 65, 71, 77, 65, 66, 79, 82, 84, 86, 65, 76, 85, 69, 83, 86, 73, 82, 84, 85, 65, 76, 73, 77, 73, 84, 87, 72, 69, 78, 87, 72, 69, 82, 69, 78, 65, 77, 69, 65, 70, 84, 69, 82, 69, 80, 76, 65, 67, 69, 65, 78, 68, 69, 70, 65, 85, 76, 84, 65, 85, 84, 79, 73, 78, 67, 82, 69, 77, 69, 78, 84, 67, 65, 83, 84, 67, 79, 76, 85, 77, 78, 67, 79, 77, 77, 73, 84, 67, 79, 78, 70, 76, 73, 67, 84, 67, 82, 79, 83, 83, 67, 85, 82, 82, 69, 78, 84, 95, 84, 73, 77, 69, 83, 84, 65, 77, 80, 82, 73, 77, 65, 82, 89, 68, 69, 70, 69, 82, 82, 69, 68, 73, 83, 84, 73, 78, 67, 84, 68, 82, 79, 80, 70, 65, 73, 76, 70, 82, 79, 77, 70, 85, 76, 76, 71, 76, 79, 66, 89, 73, 70, 73, 83, 78, 85, 76, 76, 79, 82, 68, 69, 82, 69, 83, 84, 82, 73, 67, 84, 82, 73, 71, 72, 84, 82, 79, 76, 76, 66, 65, 67, 75, 82, 79, 87, 85, 78, 73, 79, 78, 85, 83, 73, 78, 71, 86, 65, 67, 85, 85, 77, 86, 73, 69, 87, 73, 78, 73, 84, 73, 65, 76, 76, 89}
  7090  }
  7091  
  7092  var _keywordCodeØ00aOffsetØ005 [124]uint16
  7093  
  7094  func init() {
  7095  	_keywordCodeØ00aOffsetØ005 = [124]uint16{uint16(0), uint16(2), uint16(2), uint16(8), uint16(9), uint16(14), uint16(16), uint16(20), uint16(23), uint16(25), uint16(25), uint16(29), uint16(33), uint16(36), uint16(41), uint16(46), uint16(48), uint16(53), uint16(54), uint16(59), uint16(62), uint16(65), uint16(67), uint16(69), uint16(78), uint16(81), uint16(86), uint16(91), uint16(95), uint16(96), uint16(101), uint16(105), uint16(109), uint16(117), uint16(122), uint16(128), uint16(136), uint16(142), uint16(152), uint16(159), uint16(162), uint16(162), uint16(165), uint16(167), uint16(167), uint16(171), uint16(176), uint16(179), uint16(184), uint16(184), uint16(188), uint16(192), uint16(199), uint16(204), uint16(209), uint16(212), uint16(218), uint16(221), uint16(225), uint16(234), uint16(240), uint16(240), uint16(240), uint16(243), uint16(246), uint16(250), uint16(251), uint16(255), uint16(261), uint16(265), uint16(272), uint16(278), uint16(290), uint16(296), uint16(305), uint16(307), uint16(313), uint16(318), uint16(320), uint16(327), uint16(332), uint16(337), uint16(343), uint16(349), uint16(354), uint16(358), uint16(361), uint16(367), uint16(371), uint16(378), uint16(380), uint16(387), uint16(389), uint16(391), uint16(400), uint16(404), uint16(410), uint16(416), uint16(424), uint16(429), uint16(429), uint16(445), uint16(452), uint16(459), uint16(460), uint16(467), uint16(471), uint16(475), uint16(479), uint16(483), uint16(486), uint16(488), uint16(490), uint16(496), uint16(500), uint16(508), uint16(513), uint16(521), uint16(524), uint16(529), uint16(534), uint16(540), uint16(544), uint16(549)}
  7096  }
  7097  
  7098  var _keywordCodeØ00aCodeØ006 [124]uint8
  7099  
  7100  func init() {
  7101  	_keywordCodeØ00aCodeØ006 = [124]uint8{66, 96, 140, 41, 83, 43, 104, 52, 34, 113, 45, 46, 49, 2, 48, 142, 40, 24, 119, 16, 98, 138, 11, 112, 139, 117, 6, 29, 107, 98, 141, 56, 9, 20, 13, 118, 61, 105, 99, 131, 54, 53, 111, 21, 21, 70, 103, 3, 25, 65, 98, 14, 33, 128, 127, 110, 5, 98, 57, 73, 76, 19, 51, 101, 49, 36, 32, 109, 136, 94, 17, 68, 42, 8, 124, 108, 50, 4, 31, 55, 28, 120, 64, 129, 137, 130, 67, 30, 58, 71, 100, 106, 15, 74, 37, 38, 10, 39, 98, 68, 68, 102, 7, 121, 72, 114, 44, 123, 98, 49, 35, 18, 75, 126, 59, 98, 12, 60, 115, 125, 62, 63, 47, 116}
  7102  }
  7103  
  7104  var _keywordCodeØ00aNextØ003 [124]uint8
  7105  
  7106  func init() {
  7107  	_keywordCodeØ00aNextØ003 = [124]uint8{0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 21, 0, 0, 0, 0, 0, 50, 0, 43, 3, 47, 0, 0, 0, 0, 30, 0, 58, 0, 38, 0, 0, 0, 1, 66, 0, 0, 67, 0, 41, 0, 0, 0, 0, 0, 0, 49, 65, 0, 0, 0, 0, 31, 52, 16, 34, 10, 0, 0, 0, 0, 0, 0, 0, 11, 72, 79, 0, 8, 0, 104, 98, 0, 107, 0, 87, 0, 75, 51, 0, 27, 37, 73, 83, 0, 35, 68, 0, 0}
  7108  }
  7109  
  7110  var _renameTableFuncØ00__func__Ø000 [16]int8
  7111  
  7112  func init() {
  7113  	crt.Xstrncpy(nil, &_renameTableFuncØ00__func__Ø000[0], str(6423), 16)
  7114  }
  7115  
  7116  // C comment
  7117  //  /*
  7118  //  ** Print into memory obtained from sqliteMalloc().  Use the internal
  7119  //  ** %-conversion extensions.
  7120  //  */
  7121  func _sqlite3MPrintf(tls *crt.TLS, _db *Xsqlite3, _zFormat *int8, args ...interface{}) (r0 *int8) {
  7122  	var _z *int8
  7123  	var _ap []interface{}
  7124  	_ap = args
  7125  	_z = _sqlite3VMPrintf(tls, _db, _zFormat, _ap)
  7126  	_ap = nil
  7127  	return _z
  7128  }
  7129  
  7130  // C comment
  7131  //  /*
  7132  //  ** Print into memory obtained from sqliteMalloc().  Use the internal
  7133  //  ** %-conversion extensions.
  7134  //  */
  7135  func _sqlite3VMPrintf(tls *crt.TLS, _db *Xsqlite3, _zFormat *int8, _ap []interface{}) (r0 *int8) {
  7136  	var _z *int8
  7137  	var _acc XStrAccum
  7138  	var _zBase [70]int8
  7139  	func() {
  7140  		if _db == nil {
  7141  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26004), unsafe.Pointer(&_sqlite3VMPrintfØ00__func__Ø000), unsafe.Pointer(str(1219)))
  7142  			crt.X__builtin_abort(tls)
  7143  		}
  7144  	}()
  7145  	_sqlite3StrAccumInit(tls, &_acc, _db, (*int8)(unsafe.Pointer(&_zBase)), int32(70), *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0))
  7146  	_acc.XprintfFlags = uint8(1)
  7147  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
  7148  	_z = _sqlite3StrAccumFinish(tls, &_acc)
  7149  	if int32(_acc.XaccError) == int32(1) {
  7150  		_sqlite3OomFault(tls, _db)
  7151  	}
  7152  	return _z
  7153  
  7154  	_ = _zBase
  7155  	panic(0)
  7156  }
  7157  
  7158  var _sqlite3VMPrintfØ00__func__Ø000 [16]int8
  7159  
  7160  func init() {
  7161  	crt.Xstrncpy(nil, &_sqlite3VMPrintfØ00__func__Ø000[0], str(6439), 16)
  7162  }
  7163  
  7164  func _sqlite3StrAccumFinish(tls *crt.TLS, _p *XStrAccum) (r0 *int8) {
  7165  	if _p.XzText == nil {
  7166  		goto _0
  7167  	}
  7168  	func() {
  7169  		if (_p.XzText == _p.XzBase) != ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
  7170  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25951), unsafe.Pointer(&_sqlite3StrAccumFinishØ00__func__Ø000), unsafe.Pointer(str(6455)))
  7171  			crt.X__builtin_abort(tls)
  7172  		}
  7173  	}()
  7174  	*elem1(_p.XzText, uintptr(_p.XnChar)) = 0
  7175  	if (_p.XmxAlloc > (0)) && ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
  7176  		return _strAccumFinishRealloc(tls, _p)
  7177  	}
  7178  _0:
  7179  	return _p.XzText
  7180  }
  7181  
  7182  var _sqlite3StrAccumFinishØ00__func__Ø000 [22]int8
  7183  
  7184  func init() {
  7185  	crt.Xstrncpy(nil, &_sqlite3StrAccumFinishØ00__func__Ø000[0], str(6492), 22)
  7186  }
  7187  
  7188  // C comment
  7189  //  /*
  7190  //  ** Finish off a string by making sure it is zero-terminated.
  7191  //  ** Return a pointer to the resulting string.  Return a NULL
  7192  //  ** pointer if any kind of error was encountered.
  7193  //  */
  7194  func _strAccumFinishRealloc(tls *crt.TLS, _p *XStrAccum) (r0 *int8) {
  7195  	func() {
  7196  		if _p.XmxAlloc <= (0) || (int32(_p.XprintfFlags)&int32(4)) != int32(0) {
  7197  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25939), unsafe.Pointer(&_strAccumFinishReallocØ00__func__Ø000), unsafe.Pointer(str(6514)))
  7198  			crt.X__builtin_abort(tls)
  7199  		}
  7200  	}()
  7201  	_p.XzText = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_p.Xdb), uint64(_p.XnChar+uint32(1))))
  7202  	if _p.XzText != nil {
  7203  		crt.Xmemcpy(tls, unsafe.Pointer(_p.XzText), unsafe.Pointer(_p.XzBase), uint64(_p.XnChar+uint32(1)))
  7204  		{
  7205  			p := &_p.XprintfFlags
  7206  			*p = uint8(int32(*p) | int32(4))
  7207  		}
  7208  		goto _4
  7209  	}
  7210  	_setStrAccumError(tls, _p, uint8(1))
  7211  _4:
  7212  	return _p.XzText
  7213  }
  7214  
  7215  var _strAccumFinishReallocØ00__func__Ø000 [22]int8
  7216  
  7217  func init() {
  7218  	crt.Xstrncpy(nil, &_strAccumFinishReallocØ00__func__Ø000[0], str(6545), 22)
  7219  }
  7220  
  7221  func Xsqlite3_result_text(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
  7222  	func() {
  7223  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
  7224  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76488), unsafe.Pointer(&_sqlite3_result_textØ00__func__Ø000), unsafe.Pointer(str(6567)))
  7225  			crt.X__builtin_abort(tls)
  7226  		}
  7227  	}()
  7228  	_setResultStrOrError(tls, _pCtx, _z, _n, uint8(1), _xDel)
  7229  }
  7230  
  7231  var _sqlite3_result_textØ00__func__Ø000 [20]int8
  7232  
  7233  func init() {
  7234  	crt.Xstrncpy(nil, &_sqlite3_result_textØ00__func__Ø000[0], str(6609), 20)
  7235  }
  7236  
  7237  // C comment
  7238  //  /**************************** sqlite3_result_  *******************************
  7239  //  ** The following routines are used by user-defined functions to specify
  7240  //  ** the function result.
  7241  //  **
  7242  //  ** The setStrOrError() function calls sqlite3VdbeMemSetStr() to store the
  7243  //  ** result as a string or blob but if the string or blob is too large, it
  7244  //  ** then sets the error code to SQLITE_TOOBIG
  7245  //  **
  7246  //  ** The invokeValueDestructor(P,X) routine invokes destructor function X()
  7247  //  ** on value P is not going to be used and need to be destroyed.
  7248  //  */
  7249  func _setResultStrOrError(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) {
  7250  	if _sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.XpOut), _z, _n, _enc, _xDel) == int32(18) {
  7251  		Xsqlite3_result_error_toobig(tls, _pCtx)
  7252  	}
  7253  }
  7254  
  7255  // C comment
  7256  //  /*
  7257  //  ** Change the value of a Mem to be a string or a BLOB.
  7258  //  **
  7259  //  ** The memory management strategy depends on the value of the xDel
  7260  //  ** parameter. If the value passed is SQLITE_TRANSIENT, then the
  7261  //  ** string is copied into a (possibly existing) buffer managed by the
  7262  //  ** Mem structure. Otherwise, any existing buffer is freed and the
  7263  //  ** pointer copied.
  7264  //  **
  7265  //  ** If the string is too large (if it exceeds the SQLITE_LIMIT_LENGTH
  7266  //  ** size limit) then no memory allocation occurs.  If the string can be
  7267  //  ** stored without allocating memory, then it is.  If a memory allocation
  7268  //  ** is required to store the string, then value of pMem is unchanged.  In
  7269  //  ** either case, SQLITE_TOOBIG is returned.
  7270  //  */
  7271  func _sqlite3VdbeMemSetStr(tls *crt.TLS, _pMem *XMem, _z *int8, _n int32, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
  7272  	var _nByte, _iLimit, _8_nAlloc int32
  7273  	var _flags uint16
  7274  	_nByte = _n
  7275  	_flags = uint16(0)
  7276  	func() {
  7277  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  7278  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70571), unsafe.Pointer(&_sqlite3VdbeMemSetStrØ00__func__Ø000), unsafe.Pointer(str(4568)))
  7279  			crt.X__builtin_abort(tls)
  7280  		}
  7281  	}()
  7282  	func() {
  7283  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  7284  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70572), unsafe.Pointer(&_sqlite3VdbeMemSetStrØ00__func__Ø000), unsafe.Pointer(str(6629)))
  7285  			crt.X__builtin_abort(tls)
  7286  		}
  7287  	}()
  7288  	if _z == nil {
  7289  		_sqlite3VdbeMemSetNull(tls, _pMem)
  7290  		return int32(0)
  7291  	}
  7292  	if _pMem.Xdb != nil {
  7293  		_iLimit = *elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pMem.Xdb).XaLimit))), 0)
  7294  		goto _7
  7295  	}
  7296  	_iLimit = int32(1000000000)
  7297  _7:
  7298  	_flags = uint16(func() int32 {
  7299  		if int32(_enc) == int32(0) {
  7300  			return int32(16)
  7301  		}
  7302  		return int32(2)
  7303  	}())
  7304  	if _nByte >= int32(0) {
  7305  		goto _10
  7306  	}
  7307  	func() {
  7308  		if int32(_enc) == int32(0) {
  7309  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70587), unsafe.Pointer(&_sqlite3VdbeMemSetStrØ00__func__Ø000), unsafe.Pointer(str(6659)))
  7310  			crt.X__builtin_abort(tls)
  7311  		}
  7312  	}()
  7313  	if int32(_enc) != int32(1) {
  7314  		goto _13
  7315  	}
  7316  	_nByte = _sqlite3Strlen30(tls, _z)
  7317  	if _nByte > _iLimit {
  7318  		_nByte = _iLimit + int32(1)
  7319  	}
  7320  	goto _15
  7321  _13:
  7322  	_nByte = int32(0)
  7323  _16:
  7324  	if _nByte > _iLimit || (int32(*elem1(_z, uintptr(_nByte)))|int32(*elem1(_z, uintptr(_nByte+int32(1))))) == 0 {
  7325  		goto _20
  7326  	}
  7327  	_nByte += int32(2)
  7328  	goto _16
  7329  _20:
  7330  _15:
  7331  	{
  7332  		p := &_flags
  7333  		*p = uint16(int32(*p) | int32(512))
  7334  	}
  7335  _10:
  7336  	if *(*uintptr)(unsafe.Pointer(&struct {
  7337  		f func(*crt.TLS, unsafe.Pointer)
  7338  	}{_xDel})) != *(*uintptr)(unsafe.Pointer(&struct {
  7339  		f func(*crt.TLS, unsafe.Pointer)
  7340  	}{func() func(*crt.TLS, unsafe.Pointer) {
  7341  		v := uint64(18446744073709551615)
  7342  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  7343  	}()})) {
  7344  		goto _21
  7345  	}
  7346  	_8_nAlloc = _nByte
  7347  	if (int32(_flags) & int32(512)) != 0 {
  7348  		_8_nAlloc += func() int32 {
  7349  			if int32(_enc) == int32(1) {
  7350  				return int32(1)
  7351  			}
  7352  			return int32(2)
  7353  		}()
  7354  	}
  7355  	if _nByte > _iLimit {
  7356  		return int32(18)
  7357  	}
  7358  	if _sqlite3VdbeMemClearAndResize(tls, _pMem, func() int32 {
  7359  		if _8_nAlloc > int32(32) {
  7360  			return _8_nAlloc
  7361  		}
  7362  		return int32(32)
  7363  	}()) != 0 {
  7364  		return _sqlite3NomemError(tls, int32(70613))
  7365  	}
  7366  	crt.Xmemcpy(tls, unsafe.Pointer(_pMem.Xz), unsafe.Pointer(_z), uint64(_8_nAlloc))
  7367  	goto _31
  7368  _21:
  7369  	if *(*uintptr)(unsafe.Pointer(&struct {
  7370  		f func(*crt.TLS, unsafe.Pointer)
  7371  	}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
  7372  		f func(*crt.TLS, unsafe.Pointer)
  7373  	}{func() func(*crt.TLS, unsafe.Pointer) {
  7374  		v := _sqlite3MallocSize
  7375  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  7376  	}()})) {
  7377  		_sqlite3VdbeMemRelease(tls, _pMem)
  7378  		_pMem.XzMalloc = store1(&_pMem.Xz, _z)
  7379  		_pMem.XszMalloc = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.XzMalloc))
  7380  		goto _31
  7381  	}
  7382  	_sqlite3VdbeMemRelease(tls, _pMem)
  7383  	_pMem.Xz = _z
  7384  	_pMem.XxDel = _xDel
  7385  	{
  7386  		p := &_flags
  7387  		*p = uint16(int32(*p) | func() int32 {
  7388  			if _xDel == nil {
  7389  				return int32(2048)
  7390  			}
  7391  			return int32(1024)
  7392  		}())
  7393  	}
  7394  _31:
  7395  	_pMem.Xn = _nByte
  7396  	_pMem.Xflags = _flags
  7397  	_pMem.Xenc = uint8(func() int32 {
  7398  		if int32(_enc) == int32(0) {
  7399  			return int32(1)
  7400  		}
  7401  		return int32(_enc)
  7402  	}())
  7403  	if (int32(_pMem.Xenc) != int32(1)) && _sqlite3VdbeMemHandleBom(tls, _pMem) != 0 {
  7404  		return _sqlite3NomemError(tls, int32(70633))
  7405  	}
  7406  	if _nByte > _iLimit {
  7407  		return int32(18)
  7408  	}
  7409  	return int32(0)
  7410  }
  7411  
  7412  var _sqlite3VdbeMemSetStrØ00__func__Ø000 [21]int8
  7413  
  7414  func init() {
  7415  	crt.Xstrncpy(nil, &_sqlite3VdbeMemSetStrØ00__func__Ø000[0], str(6666), 21)
  7416  }
  7417  
  7418  // C comment
  7419  //  /*
  7420  //  ** This routine checks for a byte-order mark at the beginning of the
  7421  //  ** UTF-16 string stored in *pMem. If one is present, it is removed and
  7422  //  ** the encoding of the Mem adjusted. This routine does not do any
  7423  //  ** byte-swapping, it just sets Mem.enc appropriately.
  7424  //  **
  7425  //  ** The allocation (static, dynamic etc.) and encoding of the Mem may be
  7426  //  ** changed by this function.
  7427  //  */
  7428  func _sqlite3VdbeMemHandleBom(tls *crt.TLS, _pMem *XMem) (r0 int32) {
  7429  	var _rc int32
  7430  	var _bom, _1_b1, _1_b2 uint8
  7431  	_rc = int32(0)
  7432  	_bom = uint8(0)
  7433  	func() {
  7434  		if _pMem.Xn < int32(0) {
  7435  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27472), unsafe.Pointer(&_sqlite3VdbeMemHandleBomØ00__func__Ø000), unsafe.Pointer(str(5902)))
  7436  			crt.X__builtin_abort(tls)
  7437  		}
  7438  	}()
  7439  	if _pMem.Xn <= int32(1) {
  7440  		goto _2
  7441  	}
  7442  	_1_b1 = *(*uint8)(unsafe.Pointer(_pMem.Xz))
  7443  	_1_b2 = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.Xz)) + uintptr(int32(1))))
  7444  	if (int32(_1_b1) == int32(254)) && (int32(_1_b2) == int32(255)) {
  7445  		_bom = uint8(3)
  7446  	}
  7447  	if (int32(_1_b1) == int32(255)) && (int32(_1_b2) == int32(254)) {
  7448  		_bom = uint8(2)
  7449  	}
  7450  _2:
  7451  	if _bom == 0 {
  7452  		goto _7
  7453  	}
  7454  	_rc = _sqlite3VdbeMemMakeWriteable(tls, _pMem)
  7455  	if _rc == int32(0) {
  7456  		_pMem.Xn -= int32(2)
  7457  		crt.Xmemmove(tls, unsafe.Pointer(_pMem.Xz), unsafe.Pointer(elem1(_pMem.Xz, uintptr(2))), uint64(_pMem.Xn))
  7458  		*elem1(_pMem.Xz, uintptr(_pMem.Xn)) = 0
  7459  		*elem1(_pMem.Xz, uintptr(_pMem.Xn+int32(1))) = 0
  7460  		{
  7461  			p := &_pMem.Xflags
  7462  			*p = uint16(int32(*p) | int32(512))
  7463  		}
  7464  		_pMem.Xenc = _bom
  7465  	}
  7466  _7:
  7467  	return _rc
  7468  }
  7469  
  7470  var _sqlite3VdbeMemHandleBomØ00__func__Ø000 [24]int8
  7471  
  7472  func init() {
  7473  	crt.Xstrncpy(nil, &_sqlite3VdbeMemHandleBomØ00__func__Ø000[0], str(6687), 24)
  7474  }
  7475  
  7476  // C comment
  7477  //  /* Force an SQLITE_TOOBIG error. */
  7478  func Xsqlite3_result_error_toobig(tls *crt.TLS, _pCtx *Xsqlite3_context) {
  7479  	func() {
  7480  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
  7481  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76567), unsafe.Pointer(&_sqlite3_result_error_toobigØ00__func__Ø000), unsafe.Pointer(str(6567)))
  7482  			crt.X__builtin_abort(tls)
  7483  		}
  7484  	}()
  7485  	_pCtx.XisError = int32(18)
  7486  	_pCtx.XfErrorOrAux = uint8(1)
  7487  	_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.XpOut), str(6711), int32(-1), uint8(1), nil)
  7488  }
  7489  
  7490  var _sqlite3_result_error_toobigØ00__func__Ø000 [28]int8
  7491  
  7492  func init() {
  7493  	crt.Xstrncpy(nil, &_sqlite3_result_error_toobigØ00__func__Ø000[0], str(6734), 28)
  7494  }
  7495  
  7496  // C comment
  7497  //  /* This function is used by SQL generated to implement the
  7498  //  ** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER
  7499  //  ** statement. The second is a table name. The table name in the CREATE
  7500  //  ** TRIGGER statement is replaced with the third argument and the result
  7501  //  ** returned. This is analagous to renameTableFunc() above, except for CREATE
  7502  //  ** TRIGGER, not CREATE INDEX and CREATE TABLE.
  7503  //  */
  7504  func _renameTriggerFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
  7505  	var _token, _dist, _len int32
  7506  	var _zRet *int8
  7507  	var _zSql, _zTableName, _zCsr *uint8
  7508  	var _tname XToken
  7509  	var _db *Xsqlite3
  7510  	_zSql = Xsqlite3_value_text(tls, *elem19(_argv, 0))
  7511  	_zTableName = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
  7512  	_dist = int32(3)
  7513  	_zCsr = _zSql
  7514  	_len = int32(0)
  7515  	_db = Xsqlite3_context_db_handle(tls, _context)
  7516  
  7517  	if _zSql == nil {
  7518  		goto _0
  7519  	}
  7520  _1:
  7521  	if (*_zCsr) == 0 {
  7522  		return
  7523  	}
  7524  	_tname.Xz = (*int8)(unsafe.Pointer(_zCsr))
  7525  	_tname.Xn = uint32(_len)
  7526  _3:
  7527  	*(*uintptr)(unsafe.Pointer(&_zCsr)) += uintptr(_len)
  7528  	_len = _sqlite3GetToken(tls, _zCsr, &_token)
  7529  	if _token == int32(163) {
  7530  		goto _3
  7531  	}
  7532  	func() {
  7533  		if _len <= int32(0) {
  7534  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96310), unsafe.Pointer(&_renameTriggerFuncØ00__func__Ø000), unsafe.Pointer(str(4136)))
  7535  			crt.X__builtin_abort(tls)
  7536  		}
  7537  	}()
  7538  	_dist += 1
  7539  	if (_token == int32(122)) || (_token == int32(107)) {
  7540  		_dist = int32(0)
  7541  	}
  7542  	if (_dist != int32(2)) || (((_token != int32(137)) && (_token != int32(45))) && (_token != int32(5))) {
  7543  		goto _1
  7544  	}
  7545  	_zRet = _sqlite3MPrintf(tls, _db, str(4142), int32(int64(uintptr(unsafe.Pointer(_tname.Xz))-uintptr(unsafe.Pointer(_zSql)))), unsafe.Pointer(_zSql), unsafe.Pointer(_zTableName), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_tname.Xz))+uintptr(_tname.Xn)))))
  7546  	Xsqlite3_result_text(tls, _context, _zRet, int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  7547  		v := _sqlite3MallocSize
  7548  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  7549  	}())
  7550  _0:
  7551  }
  7552  
  7553  var _renameTriggerFuncØ00__func__Ø000 [18]int8
  7554  
  7555  func init() {
  7556  	crt.Xstrncpy(nil, &_renameTriggerFuncØ00__func__Ø000[0], str(6762), 18)
  7557  }
  7558  
  7559  func _renameParentFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
  7560  	var _n, _token int32
  7561  	var _zOutput, _zResult, _2_zParent, _4_zOut *int8
  7562  	var _zInput, _zOld, _zNew, _z *uint8
  7563  	var _db *Xsqlite3
  7564  	_db = Xsqlite3_context_db_handle(tls, _context)
  7565  	_zOutput = nil
  7566  	_zInput = Xsqlite3_value_text(tls, *elem19(_argv, 0))
  7567  	_zOld = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
  7568  	_zNew = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(2)))
  7569  
  7570  	if (_zInput == nil) || (_zOld == nil) {
  7571  		return
  7572  	}
  7573  	_z = _zInput
  7574  _2:
  7575  	if (*_z) == 0 {
  7576  		goto _5
  7577  	}
  7578  	_n = _sqlite3GetToken(tls, _z, &_token)
  7579  	if _token != int32(105) {
  7580  		goto _6
  7581  	}
  7582  _7:
  7583  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_n)
  7584  	_n = _sqlite3GetToken(tls, _z, &_token)
  7585  	if _token == int32(163) {
  7586  		goto _7
  7587  	}
  7588  	if _token == int32(164) {
  7589  		goto _5
  7590  	}
  7591  	_2_zParent = _sqlite3DbStrNDup(tls, _db, (*int8)(unsafe.Pointer(_z)), uint64(_n))
  7592  	if _2_zParent == nil {
  7593  		goto _5
  7594  	}
  7595  	_sqlite3Dequote(tls, _2_zParent)
  7596  	if int32(0) == _sqlite3StrICmp(tls, (*int8)(unsafe.Pointer(_zOld)), _2_zParent) {
  7597  		_4_zOut = _sqlite3MPrintf(tls, _db, str(6780), unsafe.Pointer(func() *int8 {
  7598  			if _zOutput != nil {
  7599  				return _zOutput
  7600  			}
  7601  			return str(284)
  7602  		}()), int32(int64(uintptr(unsafe.Pointer(_z))-uintptr(unsafe.Pointer(_zInput)))), unsafe.Pointer(_zInput), unsafe.Pointer(_zNew))
  7603  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zOutput))
  7604  		_zOutput = _4_zOut
  7605  		_zInput = elem15(_z, uintptr(_n))
  7606  	}
  7607  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_2_zParent))
  7608  _6:
  7609  	_z = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + uintptr(_n)))
  7610  	goto _2
  7611  _5:
  7612  	Xsqlite3_result_text(tls, func() *Xsqlite3_context {
  7613  		_zResult = _sqlite3MPrintf(tls, _db, str(6791), unsafe.Pointer(func() *int8 {
  7614  			if _zOutput != nil {
  7615  				return _zOutput
  7616  			}
  7617  			return str(284)
  7618  		}()), unsafe.Pointer(_zInput))
  7619  		return _context
  7620  	}(), _zResult, int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  7621  		v := _sqlite3MallocSize
  7622  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  7623  	}())
  7624  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zOutput))
  7625  }
  7626  
  7627  func _sqlite3DbStrNDup(tls *crt.TLS, _db *Xsqlite3, _z *int8, _n uint64) (r0 *int8) {
  7628  	var _zNew *int8
  7629  	func() {
  7630  		if _db == nil {
  7631  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24971), unsafe.Pointer(&_sqlite3DbStrNDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
  7632  			crt.X__builtin_abort(tls)
  7633  		}
  7634  	}()
  7635  	if _z == nil {
  7636  		return nil
  7637  	}
  7638  	func() {
  7639  		if (_n & uint64(2147483647)) != _n {
  7640  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24975), unsafe.Pointer(&_sqlite3DbStrNDupØ00__func__Ø000), unsafe.Pointer(str(6796)))
  7641  			crt.X__builtin_abort(tls)
  7642  		}
  7643  	}()
  7644  	_zNew = (*int8)(_sqlite3DbMallocRawNN(tls, _db, _n+uint64(1)))
  7645  	if _zNew != nil {
  7646  		crt.Xmemcpy(tls, unsafe.Pointer(_zNew), unsafe.Pointer(_z), _n)
  7647  		*elem1(_zNew, uintptr(_n)) = 0
  7648  	}
  7649  	return _zNew
  7650  }
  7651  
  7652  var _sqlite3DbStrNDupØ00__func__Ø000 [17]int8
  7653  
  7654  func init() {
  7655  	crt.Xstrncpy(nil, &_sqlite3DbStrNDupØ00__func__Ø000[0], str(6814), 17)
  7656  }
  7657  
  7658  // C comment
  7659  //  /*
  7660  //  ** Convert an SQL-style quoted string into a normal string by removing
  7661  //  ** the quote characters.  The conversion is done in-place.  If the
  7662  //  ** input does not begin with a quote character, then this routine
  7663  //  ** is a no-op.
  7664  //  **
  7665  //  ** The input string must be zero-terminated.  A new zero-terminator
  7666  //  ** is added to the dequoted string.
  7667  //  **
  7668  //  ** The return value is -1 if no dequoting occurs or the length of the
  7669  //  ** dequoted string, exclusive of the zero terminator, if dequoting does
  7670  //  ** occur.
  7671  //  **
  7672  //  ** 2002-Feb-14: This routine is extended to remove MS-Access style
  7673  //  ** brackets from around identifiers.  For example:  "[a-b-c]" becomes
  7674  //  ** "a-b-c".
  7675  //  */
  7676  func _sqlite3Dequote(tls *crt.TLS, _z *int8) {
  7677  	var _i, _j int32
  7678  	var _quote int8
  7679  	if _z == nil {
  7680  		return
  7681  	}
  7682  	_quote = *elem1(_z, 0)
  7683  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(_quote)))) & int32(128)) == 0 {
  7684  		return
  7685  	}
  7686  	if int32(_quote) == int32(91) {
  7687  		_quote = int8(93)
  7688  	}
  7689  	*func() *int32 { _i = int32(1); return &_j }() = int32(0)
  7690  _3:
  7691  	func() {
  7692  		if (*elem1(_z, uintptr(_i))) == 0 {
  7693  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27909), unsafe.Pointer(&_sqlite3DequoteØ00__func__Ø000), unsafe.Pointer(str(6831)))
  7694  			crt.X__builtin_abort(tls)
  7695  		}
  7696  	}()
  7697  	if int32(*elem1(_z, uintptr(_i))) != int32(_quote) {
  7698  		goto _8
  7699  	}
  7700  	if int32(*elem1(_z, uintptr(_i+int32(1)))) == int32(_quote) {
  7701  		*elem1(_z, uintptr(postInc2(&_j, 1))) = _quote
  7702  		_i += 1
  7703  		goto _10
  7704  	}
  7705  	goto _5
  7706  _10:
  7707  	goto _11
  7708  _8:
  7709  	*elem1(_z, uintptr(postInc2(&_j, 1))) = *elem1(_z, uintptr(_i))
  7710  _11:
  7711  	_i += 1
  7712  	goto _3
  7713  _5:
  7714  	*elem1(_z, uintptr(_j)) = 0
  7715  }
  7716  
  7717  var _sqlite3DequoteØ00__func__Ø000 [15]int8
  7718  
  7719  func init() {
  7720  	crt.Xstrncpy(nil, &_sqlite3DequoteØ00__func__Ø000[0], str(6836), 15)
  7721  }
  7722  
  7723  // C comment
  7724  //  /*
  7725  //  ** This function registered all of the above C functions as SQL
  7726  //  ** functions.  This should be the only routine in this file with
  7727  //  ** external linkage.
  7728  //  */
  7729  func _sqlite3RegisterDateTimeFunctions(tls *crt.TLS) {
  7730  	_sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3RegisterDateTimeFunctionsØ00aDateTimeFuncsØ001)), int32(8))
  7731  }
  7732  
  7733  var _sqlite3RegisterDateTimeFunctionsØ00aDateTimeFuncsØ001 [8]XFuncDef
  7734  
  7735  func init() {
  7736  	_sqlite3RegisterDateTimeFunctionsØ00aDateTimeFuncsØ001 = [8]XFuncDef{XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7737  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7738  	}{_juliandayFunc})), XzName: str(6851)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7739  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7740  	}{_dateFunc})), XzName: str(6861)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7741  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7742  	}{_timeFunc})), XzName: str(6866)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7743  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7744  	}{_datetimeFunc})), XzName: str(6871)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7745  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7746  	}{_strftimeFunc})), XzName: str(6880)}, XFuncDef{XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7747  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7748  	}{_ctimeFunc})), XzName: str(6889)}, XFuncDef{XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7749  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7750  	}{_ctimestampFunc})), XzName: str(6902)}, XFuncDef{XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7751  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7752  	}{_cdateFunc})), XzName: str(6920)}}
  7753  }
  7754  
  7755  // C comment
  7756  //  /*
  7757  //  **    julianday( TIMESTRING, MOD, MOD, ...)
  7758  //  **
  7759  //  ** Return the julian day number of the date specified in the arguments
  7760  //  */
  7761  func _juliandayFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  7762  	var _x XDateTime
  7763  	if _isDate(tls, _context, _argc, _argv, &_x) == int32(0) {
  7764  		_computeJD(tls, &_x)
  7765  		Xsqlite3_result_double(tls, _context, float64(_x.XiJD)/(8.64e+07))
  7766  	}
  7767  }
  7768  
  7769  // C comment
  7770  //  /*
  7771  //  ** Process time function arguments.  argv[0] is a date-time stamp.
  7772  //  ** argv[1] and following are modifiers.  Parse them all and write
  7773  //  ** the resulting time into the DateTime structure p.  Return 0
  7774  //  ** on success and 1 if there are any errors.
  7775  //  **
  7776  //  ** If there are zero parameters (if even argv[0] is undefined)
  7777  //  ** then assume a default value of "now" for argv[0].
  7778  //  */
  7779  func _isDate(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem, _p *XDateTime) (r0 int32) {
  7780  	var _i, _n, _eType int32
  7781  	var _z *uint8
  7782  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(48))
  7783  	if _argc == int32(0) {
  7784  		return _setDateTimeToCurrent(tls, _context, _p)
  7785  	}
  7786  	if (store2(&_eType, Xsqlite3_value_type(tls, *elem19(_argv, 0))) == int32(2)) || (_eType == int32(1)) {
  7787  		_setRawDateNumber(tls, _p, Xsqlite3_value_double(tls, *elem19(_argv, 0)))
  7788  		goto _3
  7789  	}
  7790  	_z = Xsqlite3_value_text(tls, *elem19(_argv, 0))
  7791  	if (_z == nil) || _parseDateOrTime(tls, _context, (*int8)(unsafe.Pointer(_z)), _p) != 0 {
  7792  		return int32(1)
  7793  	}
  7794  _3:
  7795  	_i = int32(1)
  7796  _6:
  7797  	if _i >= _argc {
  7798  		goto _9
  7799  	}
  7800  	_z = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(_i)))
  7801  	_n = Xsqlite3_value_bytes(tls, *elem19(_argv, uintptr(_i)))
  7802  	if (_z == nil) || _parseModifier(tls, _context, (*int8)(unsafe.Pointer(_z)), _n, _p) != 0 {
  7803  		return int32(1)
  7804  	}
  7805  	_i += 1
  7806  	goto _6
  7807  _9:
  7808  	_computeJD(tls, _p)
  7809  	if (_p.XisError != 0) || (_validJulianDay(tls, _p.XiJD) == 0) {
  7810  		return int32(1)
  7811  	}
  7812  	return int32(0)
  7813  }
  7814  
  7815  // C comment
  7816  //  /*
  7817  //  ** Set the time to the current time reported by the VFS.
  7818  //  **
  7819  //  ** Return the number of errors.
  7820  //  */
  7821  func _setDateTimeToCurrent(tls *crt.TLS, _context *Xsqlite3_context, _p *XDateTime) (r0 int32) {
  7822  	_p.XiJD = _sqlite3StmtCurrentTime(tls, _context)
  7823  	if _p.XiJD > (0) {
  7824  		_p.XvalidJD = int8(1)
  7825  		return int32(0)
  7826  	}
  7827  	return int32(1)
  7828  }
  7829  
  7830  // C comment
  7831  //  /*
  7832  //  ** Return the current time for a statement.  If the current time
  7833  //  ** is requested more than once within the same run of a single prepared
  7834  //  ** statement, the exact same time is returned for each invocation regardless
  7835  //  ** of the amount of time that elapses between invocations.  In other words,
  7836  //  ** the time returned is always the time of the first call.
  7837  //  */
  7838  func _sqlite3StmtCurrentTime(tls *crt.TLS, _p *Xsqlite3_context) (r0 int64) {
  7839  	var _rc int32
  7840  	var _piTime *int64
  7841  	_piTime = &((*TVdbe)(_p.XpVdbe).XiCurrentTime)
  7842  	func() {
  7843  		if (*TVdbe)(_p.XpVdbe) == nil {
  7844  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76829), unsafe.Pointer(&_sqlite3StmtCurrentTimeØ00__func__Ø000), unsafe.Pointer(str(6933)))
  7845  			crt.X__builtin_abort(tls)
  7846  		}
  7847  	}()
  7848  	if (*_piTime) != (0) {
  7849  		goto _2
  7850  	}
  7851  	_rc = _sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)((*Xsqlite3)((*XMem)(_p.XpOut).Xdb).XpVfs), _piTime)
  7852  	if _rc != 0 {
  7853  		*_piTime = 0
  7854  	}
  7855  _2:
  7856  	return *_piTime
  7857  }
  7858  
  7859  var _sqlite3StmtCurrentTimeØ00__func__Ø000 [23]int8
  7860  
  7861  func init() {
  7862  	crt.Xstrncpy(nil, &_sqlite3StmtCurrentTimeØ00__func__Ø000[0], str(6945), 23)
  7863  }
  7864  
  7865  func _sqlite3OsCurrentTimeInt64(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pTimeOut *int64) (r0 int32) {
  7866  	var _rc int32
  7867  	var _2_r float64
  7868  	if (_pVfs.XiVersion >= int32(2)) && (_pVfs.XxCurrentTimeInt64 != nil) {
  7869  		_rc = func() func(*crt.TLS, *Xsqlite3_vfs, *int64) int32 {
  7870  			v := _pVfs.XxCurrentTimeInt64
  7871  			return *(*func(*crt.TLS, *Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&v))
  7872  		}()(tls, _pVfs, _pTimeOut)
  7873  		goto _2
  7874  	}
  7875  	_rc = func() func(*crt.TLS, *Xsqlite3_vfs, *float64) int32 {
  7876  		v := _pVfs.XxCurrentTime
  7877  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *float64) int32)(unsafe.Pointer(&v))
  7878  	}()(tls, _pVfs, &_2_r)
  7879  	*_pTimeOut = int64(_2_r * (8.64e+07))
  7880  _2:
  7881  	return _rc
  7882  }
  7883  
  7884  // C comment
  7885  //  /* SQLITE_OMIT_UTF16 */
  7886  //  /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
  7887  //  ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
  7888  //  ** point number string BLOB NULL
  7889  //  */
  7890  func Xsqlite3_value_type(tls *crt.TLS, _pVal *XMem) (r0 int32) {
  7891  	return int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3_value_typeØ00aTypeØ001)), uintptr(int32(_pVal.Xflags)&int32(31))))
  7892  }
  7893  
  7894  var _sqlite3_value_typeØ00aTypeØ001 [32]uint8
  7895  
  7896  func init() {
  7897  	_sqlite3_value_typeØ00aTypeØ001 = [32]uint8{4, 5, 3, 5, 1, 5, 1, 5, 2, 5, 2, 5, 1, 5, 1, 5, 4, 5, 3, 5, 1, 5, 1, 5, 2, 5, 2, 5, 1, 5, 1, 5}
  7898  }
  7899  
  7900  // C comment
  7901  //  /*
  7902  //  ** Input "r" is a numeric quantity which might be a julian day number,
  7903  //  ** or the number of seconds since 1970.  If the value if r is within
  7904  //  ** range of a julian day number, install it as such and set validJD.
  7905  //  ** If the value is a valid unix timestamp, put it in p->s and set p->rawS.
  7906  //  */
  7907  func _setRawDateNumber(tls *crt.TLS, _p *XDateTime, _r float64) {
  7908  	_p.Xs = _r
  7909  	_p.XrawS = int8(1)
  7910  	if (_r >= float64(0)) && (_r < (5.3734845e+06)) {
  7911  		_p.XiJD = int64((_r * (8.64e+07)) + (0.5))
  7912  		_p.XvalidJD = int8(1)
  7913  	}
  7914  }
  7915  
  7916  func Xsqlite3_value_double(tls *crt.TLS, _pVal *XMem) (r0 float64) {
  7917  	return _sqlite3VdbeRealValue(tls, _pVal)
  7918  }
  7919  
  7920  func _sqlite3VdbeRealValue(tls *crt.TLS, _pMem *XMem) (r0 float64) {
  7921  	func() {
  7922  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  7923  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70197), unsafe.Pointer(&_sqlite3VdbeRealValueØ00__func__Ø000), unsafe.Pointer(str(4568)))
  7924  			crt.X__builtin_abort(tls)
  7925  		}
  7926  	}()
  7927  	func() {
  7928  		if (int64(uintptr(unsafe.Pointer(_pMem))) & int64(7)) != (0) {
  7929  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70198), unsafe.Pointer(&_sqlite3VdbeRealValueØ00__func__Ø000), unsafe.Pointer(str(6222)))
  7930  			crt.X__builtin_abort(tls)
  7931  		}
  7932  	}()
  7933  	if (int32(_pMem.Xflags) & int32(8)) != 0 {
  7934  		return *(*float64)(unsafe.Pointer(&_pMem.Xu))
  7935  	}
  7936  	if (int32(_pMem.Xflags) & int32(4)) != 0 {
  7937  		return float64(*(*int64)(unsafe.Pointer(&_pMem.Xu)))
  7938  	}
  7939  	if (int32(_pMem.Xflags) & int32(18)) != 0 {
  7940  		return _memRealValue(tls, _pMem)
  7941  	}
  7942  	return float64(0)
  7943  }
  7944  
  7945  var _sqlite3VdbeRealValueØ00__func__Ø000 [21]int8
  7946  
  7947  func init() {
  7948  	crt.Xstrncpy(nil, &_sqlite3VdbeRealValueØ00__func__Ø000[0], str(6968), 21)
  7949  }
  7950  
  7951  // C comment
  7952  //  /*
  7953  //  ** Return the best representation of pMem that we can get into a
  7954  //  ** double.  If pMem is already a double or an integer, return its
  7955  //  ** value.  If it is a string or blob, try to convert it to a double.
  7956  //  ** If it is a NULL, return 0.0.
  7957  //  */
  7958  func _memRealValue(tls *crt.TLS, _pMem *XMem) (r0 float64) {
  7959  	var _val float64
  7960  	_val = 0
  7961  	_sqlite3AtoF(tls, _pMem.Xz, &_val, _pMem.Xn, _pMem.Xenc)
  7962  	return _val
  7963  }
  7964  
  7965  // C comment
  7966  //  /*
  7967  //  ** The string z[] is an text representation of a real number.
  7968  //  ** Convert this string to a double and write it into *pResult.
  7969  //  **
  7970  //  ** The string z[] is length bytes in length (bytes, not characters) and
  7971  //  ** uses the encoding enc.  The string is not necessarily zero-terminated.
  7972  //  **
  7973  //  ** Return TRUE if the result is a valid real number (or integer) and FALSE
  7974  //  ** if the string is empty or contains extraneous text.  Valid numbers
  7975  //  ** are in one of these formats:
  7976  //  **
  7977  //  **    [+-]digits[E[+-]digits]
  7978  //  **    [+-]digits.[digits][E[+-]digits]
  7979  //  **    [+-].digits[E[+-]digits]
  7980  //  **
  7981  //  ** Leading and trailing whitespace is ignored for the purpose of determining
  7982  //  ** validity.
  7983  //  **
  7984  //  ** If some prefix of the input string is a valid number, this routine
  7985  //  ** returns FALSE but it still converts the prefix and writes the result
  7986  //  ** into *pResult.
  7987  //  */
  7988  func _sqlite3AtoF(tls *crt.TLS, _z *int8, _pResult *float64, _length int32, _enc uint8) (r0 int32) {
  7989  	var _incr, _sign, _d, _esign, _e, _eValid, _nDigits, _nonNum, _2_i int32
  7990  	var _s int64
  7991  	var _zEnd *int8
  7992  	var _result, _22_scale float64
  7993  	_zEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + uintptr(_length)))
  7994  	_sign = int32(1)
  7995  	_s = int64(0)
  7996  	_d = int32(0)
  7997  	_esign = int32(1)
  7998  	_e = int32(0)
  7999  	_eValid = int32(1)
  8000  	_nDigits = int32(0)
  8001  	_nonNum = int32(0)
  8002  	func() {
  8003  		if int32(_enc) != int32(1) && int32(_enc) != int32(2) && int32(_enc) != int32(3) {
  8004  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28016), unsafe.Pointer(&_sqlite3AtoFØ00__func__Ø000), unsafe.Pointer(str(6989)))
  8005  			crt.X__builtin_abort(tls)
  8006  		}
  8007  	}()
  8008  	*_pResult = float64(0)
  8009  	if int32(_enc) == int32(1) {
  8010  		_incr = int32(1)
  8011  		goto _5
  8012  	}
  8013  	_incr = int32(2)
  8014  
  8015  	_2_i = int32(3) - int32(_enc)
  8016  _6:
  8017  	if _2_i >= _length || int32(*elem1(_z, uintptr(_2_i))) != int32(0) {
  8018  		goto _10
  8019  	}
  8020  	_2_i += int32(2)
  8021  	goto _6
  8022  _10:
  8023  	_nonNum = bool2int(_2_i < _length)
  8024  	_zEnd = elem1(_z, uintptr(_2_i^int32(1)))
  8025  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(int32(_enc) & int32(1))
  8026  _5:
  8027  	if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(1)) != 0 {
  8028  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8029  		goto _5
  8030  	}
  8031  	if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) {
  8032  		return int32(0)
  8033  	}
  8034  	if int32(*_z) == int32(45) {
  8035  		_sign = int32(-1)
  8036  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8037  		goto _17
  8038  	}
  8039  	if int32(*_z) == int32(43) {
  8040  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8041  	}
  8042  _17:
  8043  	if ((crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(4)) != 0) && (_s < int64(922337203685477579)) {
  8044  		_s = (_s * int64(10)) + int64(int32(*_z)-int32(48))
  8045  		*func() *int32 { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr); return &_nDigits }() += 1
  8046  		goto _17
  8047  	}
  8048  _19:
  8049  	if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(4)) != 0 {
  8050  		*func() *int32 {
  8051  			*func() *int32 { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr); return &_nDigits }() += 1
  8052  			return &_d
  8053  		}() += 1
  8054  		goto _19
  8055  	}
  8056  	if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) {
  8057  		goto _do_atof_calc
  8058  	}
  8059  	if int32(*_z) != int32(46) {
  8060  		goto _26
  8061  	}
  8062  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8063  _27:
  8064  	if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(4)) == 0 {
  8065  		goto _28
  8066  	}
  8067  	if _s < int64(922337203685477579) {
  8068  		_s = (_s * int64(10)) + int64(int32(*_z)-int32(48))
  8069  		_d -= 1
  8070  	}
  8071  	*func() *int32 { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr); return &_nDigits }() += 1
  8072  	goto _27
  8073  _28:
  8074  _26:
  8075  	if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) {
  8076  		goto _do_atof_calc
  8077  	}
  8078  	if int32(*_z) != int32(101) && int32(*_z) != int32(69) {
  8079  		goto _33
  8080  	}
  8081  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8082  	_eValid = int32(0)
  8083  	if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) {
  8084  		goto _do_atof_calc
  8085  	}
  8086  	if int32(*_z) == int32(45) {
  8087  		_esign = int32(-1)
  8088  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8089  		goto _37
  8090  	}
  8091  	if int32(*_z) == int32(43) {
  8092  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8093  	}
  8094  _37:
  8095  	if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(4)) != 0 {
  8096  		_e = func() int32 {
  8097  			if _e < int32(10000) {
  8098  				return ((_e * int32(10)) + (int32(*_z) - int32(48)))
  8099  			}
  8100  			return int32(10000)
  8101  		}()
  8102  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8103  		_eValid = int32(1)
  8104  		goto _37
  8105  	}
  8106  _33:
  8107  	if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(1)) != 0 {
  8108  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8109  		goto _33
  8110  	}
  8111  _do_atof_calc:
  8112  	_e = (_e * _esign) + _d
  8113  	if _e < int32(0) {
  8114  		_esign = int32(-1)
  8115  		_e *= int32(-1)
  8116  		goto _47
  8117  	}
  8118  	_esign = int32(1)
  8119  _47:
  8120  	if _s == (0) {
  8121  		_result = func() float64 {
  8122  			if _sign < int32(0) {
  8123  				return (-0)
  8124  			}
  8125  			return float64(0)
  8126  		}()
  8127  		goto _51
  8128  	}
  8129  _52:
  8130  	if _e <= int32(0) {
  8131  		goto _53
  8132  	}
  8133  	if _esign <= int32(0) {
  8134  		goto _54
  8135  	}
  8136  	if _s >= int64(922337203685477580) {
  8137  		goto _53
  8138  	}
  8139  	_s *= int64(10)
  8140  	goto _56
  8141  _54:
  8142  	if (_s % int64(10)) != (0) {
  8143  		goto _53
  8144  	}
  8145  	_s /= int64(10)
  8146  _56:
  8147  	_e -= 1
  8148  	goto _52
  8149  _53:
  8150  	_s = func() int64 {
  8151  		if _sign < int32(0) {
  8152  			return (-_s)
  8153  		}
  8154  		return _s
  8155  	}()
  8156  	if _e == int32(0) {
  8157  		_result = float64(_s)
  8158  		goto _61
  8159  	}
  8160  	_22_scale = 1
  8161  	if _e <= int32(307) {
  8162  		goto _62
  8163  	}
  8164  	if _e >= int32(342) {
  8165  		goto _63
  8166  	}
  8167  _64:
  8168  	if (_e % int32(308)) != 0 {
  8169  		_22_scale *= float64(10)
  8170  		_e -= int32(1)
  8171  		goto _64
  8172  	}
  8173  	if _esign < int32(0) {
  8174  		_result = float64(_s) / _22_scale
  8175  		_result /= float64(1e+308)
  8176  		goto _67
  8177  	}
  8178  	_result = float64(_s) * _22_scale
  8179  	_result *= float64(1e+308)
  8180  _67:
  8181  	goto _68
  8182  _63:
  8183  	func() {
  8184  		if _e < int32(342) {
  8185  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28146), unsafe.Pointer(&_sqlite3AtoFØ00__func__Ø000), unsafe.Pointer(str(7052)))
  8186  			crt.X__builtin_abort(tls)
  8187  		}
  8188  	}()
  8189  	if _esign < int32(0) {
  8190  		_result = float64(0) * float64(_s)
  8191  		goto _72
  8192  	}
  8193  	_result = inf * float64(_s)
  8194  _72:
  8195  _68:
  8196  	goto _73
  8197  _62:
  8198  _74:
  8199  	if (_e % int32(22)) != 0 {
  8200  		_22_scale *= float64(10)
  8201  		_e -= int32(1)
  8202  		goto _74
  8203  	}
  8204  _75:
  8205  	if _e > int32(0) {
  8206  		_22_scale *= float64(1e+22)
  8207  		_e -= int32(22)
  8208  		goto _75
  8209  	}
  8210  	if _esign < int32(0) {
  8211  		_result = float64(_s) / _22_scale
  8212  		goto _79
  8213  	}
  8214  	_result = float64(_s) * _22_scale
  8215  _79:
  8216  _73:
  8217  _61:
  8218  _51:
  8219  	*_pResult = _result
  8220  	return bool2int((((_z == _zEnd) && (_nDigits > int32(0))) && _eValid != 0) && (_nonNum == int32(0)))
  8221  }
  8222  
  8223  var _sqlite3AtoFØ00__func__Ø000 [12]int8
  8224  
  8225  func init() {
  8226  	crt.Xstrncpy(nil, &_sqlite3AtoFØ00__func__Ø000[0], str(7059), 12)
  8227  }
  8228  
  8229  // C comment
  8230  //  /*
  8231  //  ** Attempt to parse the given string into a julian day number.  Return
  8232  //  ** the number of errors.
  8233  //  **
  8234  //  ** The following are acceptable forms for the input string:
  8235  //  **
  8236  //  **      YYYY-MM-DD HH:MM:SS.FFF  +/-HH:MM
  8237  //  **      DDDD.DD
  8238  //  **      now
  8239  //  **
  8240  //  ** In the first form, the +/-HH:MM is always optional.  The fractional
  8241  //  ** seconds extension (the ".FFF") is optional.  The seconds portion
  8242  //  ** (":SS.FFF") is option.  The year and date can be omitted as long
  8243  //  ** as there is a time string.  The time string can be omitted as long
  8244  //  ** as there is a year and date.
  8245  //  */
  8246  func _parseDateOrTime(tls *crt.TLS, _context *Xsqlite3_context, _zDate *int8, _p *XDateTime) (r0 int32) {
  8247  	var _r float64
  8248  	if _parseYyyyMmDd(tls, _zDate, _p) == int32(0) {
  8249  		return int32(0)
  8250  	}
  8251  	if _parseHhMmSs(tls, _zDate, _p) == int32(0) {
  8252  		return int32(0)
  8253  	}
  8254  	if _sqlite3StrICmp(tls, _zDate, str(7071)) == int32(0) {
  8255  		return _setDateTimeToCurrent(tls, _context, _p)
  8256  	}
  8257  	if _sqlite3AtoF(tls, _zDate, &_r, _sqlite3Strlen30(tls, _zDate), uint8(1)) != 0 {
  8258  		_setRawDateNumber(tls, _p, _r)
  8259  		return int32(0)
  8260  	}
  8261  	return int32(1)
  8262  }
  8263  
  8264  // C comment
  8265  //  /*
  8266  //  ** Parse dates of the form
  8267  //  **
  8268  //  **     YYYY-MM-DD HH:MM:SS.FFF
  8269  //  **     YYYY-MM-DD HH:MM:SS
  8270  //  **     YYYY-MM-DD HH:MM
  8271  //  **     YYYY-MM-DD
  8272  //  **
  8273  //  ** Write the result into the DateTime structure and return 0
  8274  //  ** on success and 1 if the input string is not a well-formed
  8275  //  ** date.
  8276  //  */
  8277  func _parseYyyyMmDd(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) {
  8278  	var _Y, _M, _D, _neg int32
  8279  	if int32(*elem1(_zDate, 0)) == int32(45) {
  8280  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8281  		_neg = int32(1)
  8282  		goto _1
  8283  	}
  8284  	_neg = int32(0)
  8285  _1:
  8286  	if _getDigits(tls, _zDate, str(7075), unsafe.Pointer(&_Y), unsafe.Pointer(&_M), unsafe.Pointer(&_D)) != int32(3) {
  8287  		return int32(1)
  8288  	}
  8289  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(int32(10))
  8290  _3:
  8291  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zDate))))&int32(1)) != 0 || (int32(84) == int32(*(*uint8)(unsafe.Pointer(_zDate)))) {
  8292  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8293  		goto _3
  8294  	}
  8295  	if _parseHhMmSs(tls, _zDate, _p) == int32(0) {
  8296  		goto _9
  8297  	}
  8298  	if int32(*_zDate) == int32(0) {
  8299  		_p.XvalidHMS = 0
  8300  		goto _9
  8301  	}
  8302  	return int32(1)
  8303  
  8304  _9:
  8305  	_p.XvalidJD = 0
  8306  	_p.XvalidYMD = int8(1)
  8307  	_p.XY = func() int32 {
  8308  		if _neg != 0 {
  8309  			return (-_Y)
  8310  		}
  8311  		return _Y
  8312  	}()
  8313  	_p.XM = _M
  8314  	_p.XD = _D
  8315  	if _p.XvalidTZ != 0 {
  8316  		_computeJD(tls, _p)
  8317  	}
  8318  	return int32(0)
  8319  }
  8320  
  8321  // C comment
  8322  //  /*
  8323  //  ** Convert zDate into one or more integers according to the conversion
  8324  //  ** specifier zFormat.
  8325  //  **
  8326  //  ** zFormat[] contains 4 characters for each integer converted, except for
  8327  //  ** the last integer which is specified by three characters.  The meaning
  8328  //  ** of a four-character format specifiers ABCD is:
  8329  //  **
  8330  //  **    A:   number of digits to convert.  Always "2" or "4".
  8331  //  **    B:   minimum value.  Always "0" or "1".
  8332  //  **    C:   maximum value, decoded as:
  8333  //  **           a:  12
  8334  //  **           b:  14
  8335  //  **           c:  24
  8336  //  **           d:  31
  8337  //  **           e:  59
  8338  //  **           f:  9999
  8339  //  **    D:   the separator character, or \000 to indicate this is the
  8340  //  **         last number to convert.
  8341  //  **
  8342  //  ** Example:  To translate an ISO-8601 date YYYY-MM-DD, the format would
  8343  //  ** be "40f-21a-20c".  The "40f-" indicates the 4-digit year followed by "-".
  8344  //  ** The "21a-" indicates the 2-digit month followed by "-".  The "20c" indicates
  8345  //  ** the 2-digit day which is the last integer in the set.
  8346  //  **
  8347  //  ** The function returns the number of successful conversions.
  8348  //  */
  8349  func _getDigits(tls *crt.TLS, _zDate *int8, _zFormat *int8, args ...interface{}) (r0 int32) {
  8350  	var _cnt, _1_val int32
  8351  	var _nextC, _1_N, _1_min int8
  8352  	var _1_max uint16
  8353  	var _ap []interface{}
  8354  	_cnt = int32(0)
  8355  	_ap = args
  8356  _0:
  8357  	_1_N = int8(int32(*elem1(_zFormat, 0)) - int32(48))
  8358  	_1_min = int8(int32(*elem1(_zFormat, uintptr(1))) - int32(48))
  8359  	_1_val = int32(0)
  8360  	func() {
  8361  		if int32(*elem1(_zFormat, uintptr(2))) < int32(97) || int32(*elem1(_zFormat, uintptr(2))) > int32(102) {
  8362  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18950), unsafe.Pointer(&_getDigitsØ00__func__Ø000), unsafe.Pointer(str(7087)))
  8363  			crt.X__builtin_abort(tls)
  8364  		}
  8365  	}()
  8366  	_1_max = *elem20((*uint16)(unsafe.Pointer(&_getDigitsØ00aMxØ001)), uintptr(int32(*elem1(_zFormat, uintptr(2)))-int32(97)))
  8367  	_nextC = *elem1(_zFormat, uintptr(3))
  8368  	_1_val = int32(0)
  8369  _4:
  8370  	if postInc5(&_1_N, -1) == 0 {
  8371  		goto _5
  8372  	}
  8373  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zDate)))) & int32(4)) == 0 {
  8374  		goto _end_getDigits
  8375  	}
  8376  	_1_val = ((_1_val * int32(10)) + int32(*_zDate)) - int32(48)
  8377  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8378  	goto _4
  8379  _5:
  8380  	if ((_1_val < int32(_1_min)) || (_1_val > int32(_1_max))) || ((int32(_nextC) != int32(0)) && (int32(_nextC) != int32(*_zDate))) {
  8381  		goto _end_getDigits
  8382  	}
  8383  	*(*int32)(crt.VAPointer(&_ap)) = _1_val
  8384  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8385  	_cnt += 1
  8386  	*(*uintptr)(unsafe.Pointer(&_zFormat)) += uintptr(int32(4))
  8387  	if _nextC != 0 {
  8388  		goto _0
  8389  	}
  8390  _end_getDigits:
  8391  	_ap = nil
  8392  	return _cnt
  8393  
  8394  	_ = _1_N
  8395  	panic(0)
  8396  }
  8397  
  8398  var _getDigitsØ00__func__Ø000 [10]int8
  8399  
  8400  func init() {
  8401  	crt.Xstrncpy(nil, &_getDigitsØ00__func__Ø000[0], str(7122), 10)
  8402  }
  8403  
  8404  var _getDigitsØ00aMxØ001 [6]uint16
  8405  
  8406  func init() {
  8407  	_getDigitsØ00aMxØ001 = [6]uint16{uint16(12), uint16(14), uint16(24), uint16(31), uint16(59), uint16(9999)}
  8408  }
  8409  
  8410  // C comment
  8411  //  /*
  8412  //  ** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
  8413  //  ** The HH, MM, and SS must each be exactly 2 digits.  The
  8414  //  ** fractional seconds FFFF can be one or more digits.
  8415  //  **
  8416  //  ** Return 1 if there is a parsing error and 0 on success.
  8417  //  */
  8418  func _parseHhMmSs(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) {
  8419  	var _h, _m, _s int32
  8420  	var _ms, _4_rScale float64
  8421  	_ms = 0
  8422  	if _getDigits(tls, _zDate, str(7132), unsafe.Pointer(&_h), unsafe.Pointer(&_m)) != int32(2) {
  8423  		return int32(1)
  8424  	}
  8425  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(int32(5))
  8426  	if int32(*_zDate) != int32(58) {
  8427  		goto _1
  8428  	}
  8429  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8430  	if _getDigits(tls, _zDate, str(7140), unsafe.Pointer(&_s)) != int32(1) {
  8431  		return int32(1)
  8432  	}
  8433  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(int32(2))
  8434  	if int32(*_zDate) != int32(46) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zDate, uintptr(1))))))&int32(4)) == 0 {
  8435  		goto _4
  8436  	}
  8437  	_4_rScale = 1
  8438  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8439  _5:
  8440  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zDate)))) & int32(4)) != 0 {
  8441  		_ms = ((_ms * float64(10)) + float64(*_zDate)) - (48)
  8442  		_4_rScale *= float64(10)
  8443  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8444  		goto _5
  8445  	}
  8446  	_ms /= _4_rScale
  8447  _4:
  8448  	goto _7
  8449  _1:
  8450  	_s = int32(0)
  8451  _7:
  8452  	_p.XvalidJD = 0
  8453  	_p.XrawS = 0
  8454  	_p.XvalidHMS = int8(1)
  8455  	_p.Xh = _h
  8456  	_p.Xm = _m
  8457  	_p.Xs = float64(_s) + _ms
  8458  	if _parseTimezone(tls, _zDate, _p) != 0 {
  8459  		return int32(1)
  8460  	}
  8461  	_p.XvalidTZ = int8(func() int32 {
  8462  		if _p.Xtz != int32(0) {
  8463  			return int32(1)
  8464  		}
  8465  		return int32(0)
  8466  	}())
  8467  	return int32(0)
  8468  }
  8469  
  8470  // C comment
  8471  //  /*
  8472  //  ** Parse a timezone extension on the end of a date-time.
  8473  //  ** The extension is of the form:
  8474  //  **
  8475  //  **        (+/-)HH:MM
  8476  //  **
  8477  //  ** Or the "zulu" notation:
  8478  //  **
  8479  //  **        Z
  8480  //  **
  8481  //  ** If the parse is successful, write the number of minutes
  8482  //  ** of change in p->tz and return 0.  If a parser error occurs,
  8483  //  ** return non-zero.
  8484  //  **
  8485  //  ** A missing specifier is not considered an error.
  8486  //  */
  8487  func _parseTimezone(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) {
  8488  	var _sgn, _nHr, _nMn, _c int32
  8489  	_sgn = int32(0)
  8490  _0:
  8491  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zDate)))) & int32(1)) != 0 {
  8492  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8493  		goto _0
  8494  	}
  8495  	_p.Xtz = int32(0)
  8496  	_c = int32(*_zDate)
  8497  	if _c == int32(45) {
  8498  		_sgn = int32(-1)
  8499  		goto _5
  8500  	}
  8501  	if _c == int32(43) {
  8502  		_sgn = int32(1)
  8503  		goto _5
  8504  	}
  8505  	if (_c == int32(90)) || (_c == int32(122)) {
  8506  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8507  		goto _zulu_time
  8508  	}
  8509  	return bool2int(_c != int32(0))
  8510  
  8511  _5:
  8512  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8513  	if _getDigits(tls, _zDate, str(7144), unsafe.Pointer(&_nHr), unsafe.Pointer(&_nMn)) != int32(2) {
  8514  		return int32(1)
  8515  	}
  8516  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(int32(5))
  8517  	_p.Xtz = _sgn * (_nMn + (_nHr * int32(60)))
  8518  _zulu_time:
  8519  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zDate)))) & int32(1)) != 0 {
  8520  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8521  		goto _zulu_time
  8522  	}
  8523  	_p.XtzSet = int8(1)
  8524  	return bool2int(int32(*_zDate) != int32(0))
  8525  }
  8526  
  8527  // C comment
  8528  //  /*
  8529  //  ** Convert from YYYY-MM-DD HH:MM:SS to julian day.  We always assume
  8530  //  ** that the YYYY-MM-DD is according to the Gregorian calendar.
  8531  //  **
  8532  //  ** Reference:  Meeus page 61
  8533  //  */
  8534  func _computeJD(tls *crt.TLS, _p *XDateTime) {
  8535  	var _Y, _M, _D, _A, _B, _X1, _X2 int32
  8536  	if _p.XvalidJD != 0 {
  8537  		return
  8538  	}
  8539  	if _p.XvalidYMD != 0 {
  8540  		_Y = _p.XY
  8541  		_M = _p.XM
  8542  		_D = _p.XD
  8543  		goto _2
  8544  	}
  8545  	_Y = int32(2000)
  8546  	_M = int32(1)
  8547  	_D = int32(1)
  8548  _2:
  8549  	if ((_Y < int32(-4713)) || (_Y > int32(9999))) || (_p.XrawS != 0) {
  8550  		_datetimeError(tls, _p)
  8551  		return
  8552  	}
  8553  	if _M <= int32(2) {
  8554  		_Y -= 1
  8555  		_M += int32(12)
  8556  	}
  8557  	_A = _Y / int32(100)
  8558  	_B = (int32(2) - _A) + (_A / int32(4))
  8559  	_X1 = (int32(36525) * (_Y + int32(4716))) / int32(100)
  8560  	_X2 = (int32(306001) * (_M + int32(1))) / int32(10000)
  8561  	_p.XiJD = int64((float64(((_X1+_X2)+_D)+_B) - (1524.5)) * (8.64e+07))
  8562  	_p.XvalidJD = int8(1)
  8563  	if _p.XvalidHMS == 0 {
  8564  		goto _7
  8565  	}
  8566  	_p.XiJD += int64((_p.Xh*int32(3600000))+(_p.Xm*int32(60000))) + int64(_p.Xs*(1000))
  8567  	if _p.XvalidTZ != 0 {
  8568  		_p.XiJD -= int64(_p.Xtz * int32(60000))
  8569  		_p.XvalidYMD = 0
  8570  		_p.XvalidHMS = 0
  8571  		_p.XvalidTZ = 0
  8572  	}
  8573  _7:
  8574  }
  8575  
  8576  // C comment
  8577  //  /*
  8578  //  ** Put the DateTime object into its error state.
  8579  //  */
  8580  func _datetimeError(tls *crt.TLS, _p *XDateTime) {
  8581  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(48))
  8582  	_p.XisError = int8(1)
  8583  }
  8584  
  8585  func Xsqlite3_value_bytes(tls *crt.TLS, _pVal *XMem) (r0 int32) {
  8586  	return _sqlite3ValueBytes(tls, _pVal, uint8(1))
  8587  }
  8588  
  8589  func _sqlite3ValueBytes(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 int32) {
  8590  	var _p *XMem
  8591  	_p = _pVal
  8592  	func() {
  8593  		if (int32(_p.Xflags)&int32(1)) != int32(0) && (int32(_p.Xflags)&int32(18)) != int32(0) {
  8594  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71404), unsafe.Pointer(&_sqlite3ValueBytesØ00__func__Ø000), unsafe.Pointer(str(7152)))
  8595  			crt.X__builtin_abort(tls)
  8596  		}
  8597  	}()
  8598  	if ((int32(_p.Xflags) & int32(2)) != int32(0)) && (int32(_pVal.Xenc) == int32(_enc)) {
  8599  		return _p.Xn
  8600  	}
  8601  	if (int32(_p.Xflags) & int32(16)) == int32(0) {
  8602  		goto _5
  8603  	}
  8604  	if (int32(_p.Xflags) & int32(16384)) != 0 {
  8605  		return _p.Xn + (*(*int32)(unsafe.Pointer(&_p.Xu)))
  8606  	}
  8607  	return _p.Xn
  8608  
  8609  _5:
  8610  	if (int32(_p.Xflags) & int32(1)) != 0 {
  8611  		return int32(0)
  8612  	}
  8613  	return _valueBytes(tls, _pVal, _enc)
  8614  }
  8615  
  8616  var _sqlite3ValueBytesØ00__func__Ø000 [18]int8
  8617  
  8618  func init() {
  8619  	crt.Xstrncpy(nil, &_sqlite3ValueBytesØ00__func__Ø000[0], str(7215), 18)
  8620  }
  8621  
  8622  // C comment
  8623  //  /*
  8624  //  ** The sqlite3ValueBytes() routine returns the number of bytes in the
  8625  //  ** sqlite3_value object assuming that it uses the encoding "enc".
  8626  //  ** The valueBytes() routine is a helper function.
  8627  //  */
  8628  func _valueBytes(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 int32) {
  8629  	return func() int32 {
  8630  		if _valueToText(tls, _pVal, _enc) != nil {
  8631  			return _pVal.Xn
  8632  		}
  8633  		return int32(0)
  8634  	}()
  8635  }
  8636  
  8637  // C comment
  8638  //  /*
  8639  //  ** Process a modifier to a date-time stamp.  The modifiers are
  8640  //  ** as follows:
  8641  //  **
  8642  //  **     NNN days
  8643  //  **     NNN hours
  8644  //  **     NNN minutes
  8645  //  **     NNN.NNNN seconds
  8646  //  **     NNN months
  8647  //  **     NNN years
  8648  //  **     start of month
  8649  //  **     start of year
  8650  //  **     start of week
  8651  //  **     start of day
  8652  //  **     weekday N
  8653  //  **     unixepoch
  8654  //  **     localtime
  8655  //  **     utc
  8656  //  **
  8657  //  ** Return 0 on success and 1 if there is any kind of error. If the error
  8658  //  ** is in a system call (i.e. localtime()), then an error message is written
  8659  //  ** to context pCtx. If the error is an unrecognized modifier, no error is
  8660  //  ** written to pCtx.
  8661  //  */
  8662  func _parseModifier(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _p *XDateTime) (r0 int32) {
  8663  	var _rc, _17_i, _24_x, _25_y int32
  8664  	var _8_c1, _12_Z, _20_day int64
  8665  	var _20_z2 *int8
  8666  	var _r, _17_rRounder float64
  8667  	var _20_tx XDateTime
  8668  	_rc = int32(1)
  8669  	switch int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_z, 0))))) {
  8670  	case int32(43):
  8671  		goto _5
  8672  	case int32(45):
  8673  		goto _5
  8674  	case int32(48):
  8675  		goto _5
  8676  	case int32(49):
  8677  		goto _5
  8678  	case int32(50):
  8679  		goto _5
  8680  	case int32(51):
  8681  		goto _5
  8682  	case int32(52):
  8683  		goto _5
  8684  	case int32(53):
  8685  		goto _5
  8686  	case int32(54):
  8687  		goto _5
  8688  	case int32(55):
  8689  		goto _5
  8690  	case int32(56):
  8691  		goto _5
  8692  	case int32(57):
  8693  		goto _5
  8694  	case int32(108):
  8695  		goto _1
  8696  	case int32(115):
  8697  		goto _4
  8698  	case int32(117):
  8699  		goto _2
  8700  	case int32(119):
  8701  		goto _3
  8702  	default:
  8703  		goto _17
  8704  	}
  8705  
  8706  _1:
  8707  	if Xsqlite3_stricmp(tls, _z, str(7233)) == int32(0) {
  8708  		_computeJD(tls, _p)
  8709  		_p.XiJD += _localtimeOffset(tls, _p, _pCtx, &_rc)
  8710  		_clearYMD_HMS_TZ(tls, _p)
  8711  	}
  8712  	goto _19
  8713  _2:
  8714  	if Xsqlite3_stricmp(tls, _z, str(7243)) != int32(0) || _p.XrawS == 0 {
  8715  		goto _21
  8716  	}
  8717  	_r = (_p.Xs * float64(1000)) + (2.1086676e+14)
  8718  	if (_r >= float64(0)) && (_r < (4.642690608e+14)) {
  8719  		_clearYMD_HMS_TZ(tls, _p)
  8720  		_p.XiJD = int64(_r)
  8721  		_p.XvalidJD = int8(1)
  8722  		_p.XrawS = 0
  8723  		_rc = int32(0)
  8724  	}
  8725  	goto _25
  8726  _21:
  8727  	if Xsqlite3_stricmp(tls, _z, str(7253)) != int32(0) {
  8728  		goto _25
  8729  	}
  8730  	if int32(_p.XtzSet) != int32(0) {
  8731  		goto _26
  8732  	}
  8733  	_computeJD(tls, _p)
  8734  	_8_c1 = _localtimeOffset(tls, _p, _pCtx, &_rc)
  8735  	if _rc == int32(0) {
  8736  		_p.XiJD -= _8_c1
  8737  		_clearYMD_HMS_TZ(tls, _p)
  8738  		_p.XiJD += _8_c1 - _localtimeOffset(tls, _p, _pCtx, &_rc)
  8739  	}
  8740  	_p.XtzSet = int8(1)
  8741  	goto _28
  8742  _26:
  8743  	_rc = int32(0)
  8744  _28:
  8745  _25:
  8746  	goto _19
  8747  _3:
  8748  	if Xsqlite3_strnicmp(tls, _z, str(7257), int32(8)) != int32(0) || _sqlite3AtoF(tls, elem1(_z, uintptr(8)), &_r, _sqlite3Strlen30(tls, elem1(_z, uintptr(8))), uint8(1)) == 0 || float64(store2(&_n, int32(_r))) != _r || _n < int32(0) || _r >= (7) {
  8749  		goto _33
  8750  	}
  8751  	_computeYMD_HMS(tls, _p)
  8752  	_p.XvalidTZ = 0
  8753  	_p.XvalidJD = 0
  8754  	_computeJD(tls, _p)
  8755  	_12_Z = ((_p.XiJD + int64(129600000)) / int64(86400000)) % int64(7)
  8756  	if _12_Z > int64(_n) {
  8757  		_12_Z -= int64(7)
  8758  	}
  8759  	_p.XiJD += (int64(_n) - _12_Z) * int64(86400000)
  8760  	_clearYMD_HMS_TZ(tls, _p)
  8761  	_rc = int32(0)
  8762  _33:
  8763  	goto _19
  8764  _4:
  8765  	if Xsqlite3_strnicmp(tls, _z, str(7266), int32(9)) != int32(0) {
  8766  		goto _19
  8767  	}
  8768  	if ((_p.XvalidJD == 0) && (_p.XvalidYMD == 0)) && (_p.XvalidHMS == 0) {
  8769  		goto _19
  8770  	}
  8771  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(int32(9))
  8772  	_computeYMD(tls, _p)
  8773  	_p.XvalidHMS = int8(1)
  8774  	_p.Xh = store2(&_p.Xm, int32(0))
  8775  	_p.Xs = float64(0)
  8776  	_p.XrawS = 0
  8777  	_p.XvalidTZ = 0
  8778  	_p.XvalidJD = 0
  8779  	if Xsqlite3_stricmp(tls, _z, str(7276)) == int32(0) {
  8780  		_p.XD = int32(1)
  8781  		_rc = int32(0)
  8782  		goto _43
  8783  	}
  8784  	if Xsqlite3_stricmp(tls, _z, str(7282)) == int32(0) {
  8785  		_p.XM = int32(1)
  8786  		_p.XD = int32(1)
  8787  		_rc = int32(0)
  8788  		goto _43
  8789  	}
  8790  	if Xsqlite3_stricmp(tls, _z, str(7287)) == int32(0) {
  8791  		_rc = int32(0)
  8792  	}
  8793  _43:
  8794  	goto _19
  8795  _5:
  8796  	_n = int32(1)
  8797  _44:
  8798  	if (*elem1(_z, uintptr(_n))) == 0 || int32(*elem1(_z, uintptr(_n))) == int32(58) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_z, uintptr(_n))))))&int32(1)) != 0 {
  8799  		goto _49
  8800  	}
  8801  	_n += 1
  8802  	goto _44
  8803  _49:
  8804  	if _sqlite3AtoF(tls, _z, &_r, _n, uint8(1)) == 0 {
  8805  		_rc = int32(1)
  8806  		goto _19
  8807  	}
  8808  	if int32(*elem1(_z, uintptr(_n))) != int32(58) {
  8809  		goto _51
  8810  	}
  8811  	_20_z2 = _z
  8812  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_20_z2)))) & int32(4)) == 0 {
  8813  		*(*uintptr)(unsafe.Pointer(&_20_z2)) += uintptr(1)
  8814  	}
  8815  	crt.Xmemset(tls, unsafe.Pointer(&_20_tx), int32(0), uint64(48))
  8816  	if _parseHhMmSs(tls, _20_z2, &_20_tx) != 0 {
  8817  		goto _19
  8818  	}
  8819  	_computeJD(tls, &_20_tx)
  8820  	_20_tx.XiJD -= int64(43200000)
  8821  	_20_day = _20_tx.XiJD / int64(86400000)
  8822  	_20_tx.XiJD -= _20_day * int64(86400000)
  8823  	if int32(*elem1(_z, 0)) == int32(45) {
  8824  		_20_tx.XiJD = -_20_tx.XiJD
  8825  	}
  8826  	_computeJD(tls, _p)
  8827  	_clearYMD_HMS_TZ(tls, _p)
  8828  	_p.XiJD += _20_tx.XiJD
  8829  	_rc = int32(0)
  8830  	goto _19
  8831  _51:
  8832  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_n)
  8833  _55:
  8834  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z)))) & int32(1)) != 0 {
  8835  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
  8836  		goto _55
  8837  	}
  8838  	_n = _sqlite3Strlen30(tls, _z)
  8839  	if (_n > int32(10)) || (_n < int32(3)) {
  8840  		goto _19
  8841  	}
  8842  	if int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_z, uintptr(_n-int32(1))))))) == int32(115) {
  8843  		_n -= 1
  8844  	}
  8845  	_computeJD(tls, _p)
  8846  	_rc = int32(1)
  8847  	_17_rRounder = func() float64 {
  8848  		if _r < (0) {
  8849  			return (-0.5)
  8850  		}
  8851  		return (0.5)
  8852  	}()
  8853  	_17_i = int32(0)
  8854  _62:
  8855  	if _17_i >= int32(6) {
  8856  		goto _65
  8857  	}
  8858  	if int32(elem21((*t22)(unsafe.Pointer(&_aXformType)), uintptr(_17_i)).XnName) != _n || Xsqlite3_strnicmp(tls, elem21((*t22)(unsafe.Pointer(&_aXformType)), uintptr(_17_i)).XzName, _z, _n) != int32(0) || _r <= (-(elem21((*t22)(unsafe.Pointer(&_aXformType)), uintptr(_17_i)).XrLimit)) || _r >= (elem21((*t22)(unsafe.Pointer(&_aXformType)), uintptr(_17_i)).XrLimit) {
  8859  		goto _69
  8860  	}
  8861  	switch int32(elem21((*t22)(unsafe.Pointer(&_aXformType)), uintptr(_17_i)).XeType) {
  8862  	case int32(1):
  8863  		goto _71
  8864  	case int32(2):
  8865  		goto _72
  8866  	default:
  8867  		goto _73
  8868  	}
  8869  
  8870  _71:
  8871  	_computeYMD_HMS(tls, _p)
  8872  	_p.XM += int32(_r)
  8873  	_24_x = func() int32 {
  8874  		if _p.XM > int32(0) {
  8875  			return ((_p.XM - int32(1)) / int32(12))
  8876  		}
  8877  		return ((_p.XM - int32(12)) / int32(12))
  8878  	}()
  8879  	_p.XY += _24_x
  8880  	_p.XM -= _24_x * int32(12)
  8881  	_p.XvalidJD = 0
  8882  	_r -= float64(int32(_r))
  8883  	goto _73
  8884  _72:
  8885  	_25_y = int32(_r)
  8886  	_computeYMD_HMS(tls, _p)
  8887  	_p.XY += _25_y
  8888  	_p.XvalidJD = 0
  8889  	_r -= float64(int32(_r))
  8890  	goto _73
  8891  _73:
  8892  	_computeJD(tls, _p)
  8893  	_p.XiJD += int64((_r * (elem21((*t22)(unsafe.Pointer(&_aXformType)), uintptr(_17_i)).XrXform)) + _17_rRounder)
  8894  	_rc = int32(0)
  8895  	goto _65
  8896  _69:
  8897  	_17_i += 1
  8898  	goto _62
  8899  _65:
  8900  	_clearYMD_HMS_TZ(tls, _p)
  8901  	goto _19
  8902  _17:
  8903  	goto _19
  8904  _19:
  8905  	return _rc
  8906  }
  8907  
  8908  // C comment
  8909  //  /*
  8910  //  ** Some systems have stricmp().  Others have strcasecmp().  Because
  8911  //  ** there is no consistency, we will define our own.
  8912  //  **
  8913  //  ** IMPLEMENTATION-OF: R-30243-02494 The sqlite3_stricmp() and
  8914  //  ** sqlite3_strnicmp() APIs allow applications and extensions to compare
  8915  //  ** the contents of two buffers containing UTF-8 strings in a
  8916  //  ** case-independent fashion, using the same definition of "case
  8917  //  ** independence" that SQLite uses internally when comparing identifiers.
  8918  //  */
  8919  func Xsqlite3_stricmp(tls *crt.TLS, _zLeft *int8, _zRight *int8) (r0 int32) {
  8920  	if _zLeft == nil {
  8921  		return func() int32 {
  8922  			if _zRight != nil {
  8923  				return int32(-1)
  8924  			}
  8925  			return int32(0)
  8926  		}()
  8927  	}
  8928  	if _zRight == nil {
  8929  		return int32(1)
  8930  	}
  8931  	return _sqlite3StrICmp(tls, _zLeft, _zRight)
  8932  }
  8933  
  8934  // C comment
  8935  //  /*
  8936  //  ** Compute the difference (in milliseconds) between localtime and UTC
  8937  //  ** (a.k.a. GMT) for the time value p where p is in UTC. If no error occurs,
  8938  //  ** return this value and set *pRc to SQLITE_OK.
  8939  //  **
  8940  //  ** Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value
  8941  //  ** is undefined in this case.
  8942  //  */
  8943  func _localtimeOffset(tls *crt.TLS, _p *XDateTime, _pCtx *Xsqlite3_context, _pRc *int32) (r0 int64) {
  8944  	var _2_s int32
  8945  	var _t int64
  8946  	var _sLocal crt.Xtm
  8947  	var _x, _y XDateTime
  8948  	crt.Xmemset(tls, unsafe.Pointer(&_sLocal), int32(0), uint64(56))
  8949  	_x = *_p
  8950  	_computeYMD_HMS(tls, &_x)
  8951  	if (_x.XY < int32(1971)) || (_x.XY >= int32(2038)) {
  8952  		_x.XY = int32(2000)
  8953  		_x.XM = int32(1)
  8954  		_x.XD = int32(1)
  8955  		_x.Xh = int32(0)
  8956  		_x.Xm = int32(0)
  8957  		_x.Xs = float64(0)
  8958  		goto _2
  8959  	}
  8960  	_2_s = int32(_x.Xs + (0.5))
  8961  	_x.Xs = float64(_2_s)
  8962  _2:
  8963  	_x.Xtz = int32(0)
  8964  	_x.XvalidJD = 0
  8965  	_computeJD(tls, &_x)
  8966  	_t = (_x.XiJD / int64(1000)) - int64(210866760000)
  8967  	if _osLocaltime(tls, &_t, &_sLocal) != 0 {
  8968  		Xsqlite3_result_error(tls, _pCtx, str(7291), int32(-1))
  8969  		*_pRc = int32(1)
  8970  		return 0
  8971  	}
  8972  	_y.XY = _sLocal.Xtm_year + int32(1900)
  8973  	_y.XM = _sLocal.Xtm_mon + int32(1)
  8974  	_y.XD = _sLocal.Xtm_mday
  8975  	_y.Xh = _sLocal.Xtm_hour
  8976  	_y.Xm = _sLocal.Xtm_min
  8977  	_y.Xs = float64(_sLocal.Xtm_sec)
  8978  	_y.XvalidYMD = int8(1)
  8979  	_y.XvalidHMS = int8(1)
  8980  	_y.XvalidJD = 0
  8981  	_y.XrawS = 0
  8982  	_y.XvalidTZ = 0
  8983  	_y.XisError = 0
  8984  	_computeJD(tls, &_y)
  8985  	*_pRc = int32(0)
  8986  	return _y.XiJD - _x.XiJD
  8987  }
  8988  
  8989  // C comment
  8990  //  /*
  8991  //  ** Compute both YMD and HMS
  8992  //  */
  8993  func _computeYMD_HMS(tls *crt.TLS, _p *XDateTime) {
  8994  	_computeYMD(tls, _p)
  8995  	_computeHMS(tls, _p)
  8996  }
  8997  
  8998  // C comment
  8999  //  /*
  9000  //  ** Compute the Year, Month, and Day from the julian day number.
  9001  //  */
  9002  func _computeYMD(tls *crt.TLS, _p *XDateTime) {
  9003  	var _Z, _A, _B, _C, _D, _E, _X1 int32
  9004  	if _p.XvalidYMD != 0 {
  9005  		return
  9006  	}
  9007  	if _p.XvalidJD == 0 {
  9008  		_p.XY = int32(2000)
  9009  		_p.XM = int32(1)
  9010  		_p.XD = int32(1)
  9011  		goto _4
  9012  	}
  9013  	if _validJulianDay(tls, _p.XiJD) == 0 {
  9014  		_datetimeError(tls, _p)
  9015  		return
  9016  	}
  9017  	_Z = int32((_p.XiJD + int64(43200000)) / int64(86400000))
  9018  	_A = int32((float64(_Z) - (1.86721625e+06)) / (36524.25))
  9019  	_A = ((_Z + int32(1)) + _A) - (_A / int32(4))
  9020  	_B = _A + int32(1524)
  9021  	_C = int32((float64(_B) - (122.1)) / (365.25))
  9022  	_D = (int32(36525) * (_C & int32(32767))) / int32(100)
  9023  	_E = int32(float64(_B-_D) / (30.6001))
  9024  	_X1 = int32((30.6001) * float64(_E))
  9025  	_p.XD = (_B - _D) - _X1
  9026  	_p.XM = func() int32 {
  9027  		if _E < int32(14) {
  9028  			return (_E - int32(1))
  9029  		}
  9030  		return (_E - int32(13))
  9031  	}()
  9032  	_p.XY = func() int32 {
  9033  		if _p.XM > int32(2) {
  9034  			return (_C - int32(4716))
  9035  		}
  9036  		return (_C - int32(4715))
  9037  	}()
  9038  _4:
  9039  	_p.XvalidYMD = int8(1)
  9040  }
  9041  
  9042  // C comment
  9043  //  /*
  9044  //  ** Return TRUE if the given julian day number is within range.
  9045  //  **
  9046  //  ** The input is the JulianDay times 86400000.
  9047  //  */
  9048  func _validJulianDay(tls *crt.TLS, _iJD int64) (r0 int32) {
  9049  	return bool2int((_iJD >= (0)) && (_iJD <= int64(464269060799999)))
  9050  }
  9051  
  9052  // C comment
  9053  //  /*
  9054  //  ** Compute the Hour, Minute, and Seconds from the julian day number.
  9055  //  */
  9056  func _computeHMS(tls *crt.TLS, _p *XDateTime) {
  9057  	var _s int32
  9058  	if _p.XvalidHMS != 0 {
  9059  		return
  9060  	}
  9061  	_computeJD(tls, _p)
  9062  	_s = int32((_p.XiJD + int64(43200000)) % int64(86400000))
  9063  	_p.Xs = float64(_s) / float64(1000)
  9064  	_s = int32(_p.Xs)
  9065  	_p.Xs -= float64(_s)
  9066  	_p.Xh = _s / int32(3600)
  9067  	_s -= _p.Xh * int32(3600)
  9068  	_p.Xm = _s / int32(60)
  9069  	_p.Xs += float64(_s - (_p.Xm * int32(60)))
  9070  	_p.XrawS = 0
  9071  	_p.XvalidHMS = int8(1)
  9072  }
  9073  
  9074  // C comment
  9075  //  /*
  9076  //  ** The following routine implements the rough equivalent of localtime_r()
  9077  //  ** using whatever operating-system specific localtime facility that
  9078  //  ** is available.  This routine returns 0 on success and
  9079  //  ** non-zero on any kind of error.
  9080  //  **
  9081  //  ** If the sqlite3GlobalConfig.bLocaltimeFault variable is true then this
  9082  //  ** routine will always fail.
  9083  //  **
  9084  //  ** EVIDENCE-OF: R-62172-00036 In this implementation, the standard C
  9085  //  ** library function localtime_r() is used to assist in the calculation of
  9086  //  ** local time.
  9087  //  */
  9088  func _osLocaltime(tls *crt.TLS, _t *int64, _pTm *crt.Xtm) (r0 int32) {
  9089  	var _rc int32
  9090  	var _mutex *Xsqlite3_mutex
  9091  	var _pX *crt.Xtm
  9092  	_mutex = _sqlite3MutexAlloc(tls, int32(2))
  9093  	Xsqlite3_mutex_enter(tls, _mutex)
  9094  	_pX = crt.Xlocaltime(tls, _t)
  9095  	if _sqlite3Config.XbLocaltimeFault != 0 {
  9096  		_pX = nil
  9097  	}
  9098  	if _pX != nil {
  9099  		*_pTm = *_pX
  9100  	}
  9101  	Xsqlite3_mutex_leave(tls, _mutex)
  9102  	_rc = bool2int(_pX == nil)
  9103  	return _rc
  9104  }
  9105  
  9106  func Xsqlite3_result_error(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32) {
  9107  	func() {
  9108  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
  9109  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76451), unsafe.Pointer(&_sqlite3_result_errorØ00__func__Ø000), unsafe.Pointer(str(6567)))
  9110  			crt.X__builtin_abort(tls)
  9111  		}
  9112  	}()
  9113  	_pCtx.XisError = int32(1)
  9114  	_pCtx.XfErrorOrAux = uint8(1)
  9115  	_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.XpOut), _z, _n, uint8(1), func() func(*crt.TLS, unsafe.Pointer) {
  9116  		v := uint64(18446744073709551615)
  9117  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  9118  	}())
  9119  }
  9120  
  9121  var _sqlite3_result_errorØ00__func__Ø000 [21]int8
  9122  
  9123  func init() {
  9124  	crt.Xstrncpy(nil, &_sqlite3_result_errorØ00__func__Ø000[0], str(7314), 21)
  9125  }
  9126  
  9127  // C comment
  9128  //  /*
  9129  //  ** Clear the YMD and HMS and the TZ
  9130  //  */
  9131  func _clearYMD_HMS_TZ(tls *crt.TLS, _p *XDateTime) {
  9132  	_p.XvalidYMD = 0
  9133  	_p.XvalidHMS = 0
  9134  	_p.XvalidTZ = 0
  9135  }
  9136  
  9137  func Xsqlite3_strnicmp(tls *crt.TLS, _zLeft *int8, _zRight *int8, _N int32) (r0 int32) {
  9138  	var _a, _b *uint8
  9139  	if _zLeft == nil {
  9140  		return func() int32 {
  9141  			if _zRight != nil {
  9142  				return int32(-1)
  9143  			}
  9144  			return int32(0)
  9145  		}()
  9146  	}
  9147  	if _zRight == nil {
  9148  		return int32(1)
  9149  	}
  9150  	_a = (*uint8)(unsafe.Pointer(_zLeft))
  9151  	_b = (*uint8)(unsafe.Pointer(_zRight))
  9152  _5:
  9153  	if ((postInc2(&_N, -1) > int32(0)) && (int32(*_a) != int32(0))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_a))) == int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_b)))) {
  9154  		*(*uintptr)(unsafe.Pointer(&_a)) += uintptr(1)
  9155  		*(*uintptr)(unsafe.Pointer(&_b)) += uintptr(1)
  9156  		goto _5
  9157  	}
  9158  	return func() int32 {
  9159  		if _N < int32(0) {
  9160  			return int32(0)
  9161  		}
  9162  		return (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_a))) - int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_b))))
  9163  	}()
  9164  }
  9165  
  9166  // C comment
  9167  //  /*
  9168  //  ** The following table defines various date transformations of the form
  9169  //  **
  9170  //  **            'NNN days'
  9171  //  **
  9172  //  ** Where NNN is an arbitrary floating-point number and "days" can be one
  9173  //  ** of several units of time.
  9174  //  */
  9175  var _aXformType [6]t22
  9176  
  9177  func init() {
  9178  	_aXformType = [6]t22{t22{XnName: uint8(6), XzName: str(7335), XrLimit: 4.642690608e+11, XrXform: 1000}, t22{XnName: uint8(6), XzName: str(7342), XrLimit: 7.73781768e+09, XrXform: 60000}, t22{XnName: uint8(4), XzName: str(7349), XrLimit: 1.28963628e+08, XrXform: 3.6e+06}, t22{XnName: uint8(3), XzName: str(7287), XrLimit: 5.373485e+06, XrXform: 8.64e+07}, t22{XeType: uint8(1), XnName: uint8(5), XzName: str(7276), XrLimit: 176546, XrXform: 2.592e+09}, t22{XeType: uint8(2), XnName: uint8(4), XzName: str(7282), XrLimit: 14713, XrXform: 3.1536e+10}}
  9179  }
  9180  
  9181  func Xsqlite3_result_double(tls *crt.TLS, _pCtx *Xsqlite3_context, _rVal float64) {
  9182  	func() {
  9183  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
  9184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76447), unsafe.Pointer(&_sqlite3_result_doubleØ00__func__Ø000), unsafe.Pointer(str(6567)))
  9185  			crt.X__builtin_abort(tls)
  9186  		}
  9187  	}()
  9188  	_sqlite3VdbeMemSetDouble(tls, (*XMem)(_pCtx.XpOut), _rVal)
  9189  }
  9190  
  9191  var _sqlite3_result_doubleØ00__func__Ø000 [22]int8
  9192  
  9193  func init() {
  9194  	crt.Xstrncpy(nil, &_sqlite3_result_doubleØ00__func__Ø000[0], str(7354), 22)
  9195  }
  9196  
  9197  // C comment
  9198  //  /*
  9199  //  ** Delete any previous value and set the value stored in *pMem to val,
  9200  //  ** manifest type REAL.
  9201  //  */
  9202  func _sqlite3VdbeMemSetDouble(tls *crt.TLS, _pMem *XMem, _val float64) {
  9203  	_sqlite3VdbeMemSetNull(tls, _pMem)
  9204  	if _sqlite3IsNaN(tls, _val) == 0 {
  9205  		*(*float64)(unsafe.Pointer(&_pMem.Xu)) = _val
  9206  		_pMem.Xflags = uint16(8)
  9207  	}
  9208  }
  9209  
  9210  // C comment
  9211  //  /*
  9212  //  ** Return true if the floating point value is Not a Number (NaN).
  9213  //  **
  9214  //  ** Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN.
  9215  //  ** Otherwise, we have our own implementation that works on most systems.
  9216  //  */
  9217  func _sqlite3IsNaN(tls *crt.TLS, _x float64) (r0 int32) {
  9218  	var _rc int32
  9219  	var _y, _z float64
  9220  	_y = _x
  9221  	_z = _y
  9222  	_rc = bool2int(_y != _z)
  9223  	return _rc
  9224  }
  9225  
  9226  // C comment
  9227  //  /*
  9228  //  **    date( TIMESTRING, MOD, MOD, ...)
  9229  //  **
  9230  //  ** Return YYYY-MM-DD
  9231  //  */
  9232  func _dateFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  9233  	var _x XDateTime
  9234  	var _1_zBuf [100]int8
  9235  	if _isDate(tls, _context, _argc, _argv, &_x) == int32(0) {
  9236  		_computeYMD(tls, &_x)
  9237  		Xsqlite3_snprintf(tls, int32(100), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7376), _x.XY, _x.XM, _x.XD)
  9238  		Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  9239  			v := uint64(18446744073709551615)
  9240  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  9241  		}())
  9242  	}
  9243  	_ = _1_zBuf
  9244  }
  9245  
  9246  // C comment
  9247  //  /*
  9248  //  **    time( TIMESTRING, MOD, MOD, ...)
  9249  //  **
  9250  //  ** Return HH:MM:SS
  9251  //  */
  9252  func _timeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  9253  	var _x XDateTime
  9254  	var _1_zBuf [100]int8
  9255  	if _isDate(tls, _context, _argc, _argv, &_x) == int32(0) {
  9256  		_computeHMS(tls, &_x)
  9257  		Xsqlite3_snprintf(tls, int32(100), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7391), _x.Xh, _x.Xm, int32(_x.Xs))
  9258  		Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  9259  			v := uint64(18446744073709551615)
  9260  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  9261  		}())
  9262  	}
  9263  	_ = _1_zBuf
  9264  }
  9265  
  9266  // C comment
  9267  //  /*
  9268  //  **    datetime( TIMESTRING, MOD, MOD, ...)
  9269  //  **
  9270  //  ** Return YYYY-MM-DD HH:MM:SS
  9271  //  */
  9272  func _datetimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  9273  	var _x XDateTime
  9274  	var _1_zBuf [100]int8
  9275  	if _isDate(tls, _context, _argc, _argv, &_x) == int32(0) {
  9276  		_computeYMD_HMS(tls, &_x)
  9277  		Xsqlite3_snprintf(tls, int32(100), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7406), _x.XY, _x.XM, _x.XD, _x.Xh, _x.Xm, int32(_x.Xs))
  9278  		Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  9279  			v := uint64(18446744073709551615)
  9280  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  9281  		}())
  9282  	}
  9283  	_ = _1_zBuf
  9284  }
  9285  
  9286  // C comment
  9287  //  /*
  9288  //  **    strftime( FORMAT, TIMESTRING, MOD, MOD, ...)
  9289  //  **
  9290  //  ** Return a string described by FORMAT.  Conversions as follows:
  9291  //  **
  9292  //  **   %d  day of month
  9293  //  **   %f  ** fractional seconds  SS.SSS
  9294  //  **   %H  hour 00-24
  9295  //  **   %j  day of year 000-366
  9296  //  **   %J  ** julian day number
  9297  //  **   %m  month 01-12
  9298  //  **   %M  minute 00-59
  9299  //  **   %s  seconds since 1970-01-01
  9300  //  **   %S  seconds 00-59
  9301  //  **   %w  day of week 0-6  sunday==0
  9302  //  **   %W  week of year 00-53
  9303  //  **   %Y  year 0000-9999
  9304  //  **   %%  %
  9305  //  */
  9306  func _strftimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  9307  	var _13_nDay, _14_wd int32
  9308  	var _n, _i, _j uint64
  9309  	var _z, _zFmt *int8
  9310  	var _12_s float64
  9311  	var _db *Xsqlite3
  9312  	var _x, _13_y XDateTime
  9313  	var _zBuf [100]int8
  9314  	if _argc == int32(0) {
  9315  		return
  9316  	}
  9317  	_zFmt = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
  9318  	if (_zFmt == nil) || _isDate(tls, _context, _argc-int32(1), (**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(int32(1))*uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(8))))))))))), &_x) != 0 {
  9319  		return
  9320  	}
  9321  	_db = Xsqlite3_context_db_handle(tls, _context)
  9322  	*func() *uint64 { _i = 0; return &_n }() = uint64(1)
  9323  _3:
  9324  	if (*elem1(_zFmt, uintptr(_i))) == 0 {
  9325  		goto _6
  9326  	}
  9327  	if int32(*elem1(_zFmt, uintptr(_i))) != int32(37) {
  9328  		goto _7
  9329  	}
  9330  	switch int32(*elem1(_zFmt, uintptr(_i+uint64(1)))) {
  9331  	case int32(37):
  9332  		goto _15
  9333  	case int32(72):
  9334  		goto _9
  9335  	case int32(74):
  9336  		goto _20
  9337  	case int32(77):
  9338  		goto _9
  9339  	case int32(83):
  9340  		goto _9
  9341  	case int32(87):
  9342  		goto _9
  9343  	case int32(89):
  9344  		goto _19
  9345  	case int32(100):
  9346  		goto _9
  9347  	case int32(102):
  9348  		goto _17
  9349  	case int32(106):
  9350  		goto _18
  9351  	case int32(109):
  9352  		goto _9
  9353  	case int32(115):
  9354  		goto _20
  9355  	case int32(119):
  9356  		goto _15
  9357  	default:
  9358  		goto _22
  9359  	}
  9360  
  9361  _9:
  9362  	_n += 1
  9363  _15:
  9364  	goto _23
  9365  _17:
  9366  	_n += uint64(8)
  9367  	goto _23
  9368  _18:
  9369  	_n += uint64(3)
  9370  	goto _23
  9371  _19:
  9372  	_n += uint64(8)
  9373  	goto _23
  9374  _20:
  9375  	_n += uint64(50)
  9376  	goto _23
  9377  _22:
  9378  	return
  9379  _23:
  9380  	_i += 1
  9381  _7:
  9382  	*func() *uint64 { _i += 1; return &_n }() += 1
  9383  	goto _3
  9384  _6:
  9385  	if _n < uint64(100) {
  9386  		_z = (*int8)(unsafe.Pointer(&_zBuf))
  9387  		goto _27
  9388  	}
  9389  	if _n > uint64(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
  9390  		Xsqlite3_result_error_toobig(tls, _context)
  9391  		return
  9392  	}
  9393  	_z = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(int32(_n))))
  9394  	if _z == nil {
  9395  		Xsqlite3_result_error_nomem(tls, _context)
  9396  		return
  9397  	}
  9398  _27:
  9399  	_computeJD(tls, &_x)
  9400  	_computeYMD_HMS(tls, &_x)
  9401  	_i = store23(&_j, 0)
  9402  _29:
  9403  	if (*elem1(_zFmt, uintptr(_i))) == 0 {
  9404  		goto _32
  9405  	}
  9406  	if int32(*elem1(_zFmt, uintptr(_i))) != int32(37) {
  9407  		*elem1(_z, uintptr(postInc23(&_j, uint64(1)))) = *elem1(_zFmt, uintptr(_i))
  9408  		goto _34
  9409  	}
  9410  	_i += 1
  9411  	switch int32(*elem1(_zFmt, uintptr(_i))) {
  9412  	case int32(72):
  9413  		goto _38
  9414  	case int32(74):
  9415  		goto _41
  9416  	case int32(77):
  9417  		goto _43
  9418  	case int32(83):
  9419  		goto _45
  9420  	case int32(87):
  9421  		goto _39
  9422  	case int32(89):
  9423  		goto _47
  9424  	case int32(100):
  9425  		goto _36
  9426  	case int32(102):
  9427  		goto _37
  9428  	case int32(106):
  9429  		goto _39
  9430  	case int32(109):
  9431  		goto _42
  9432  	case int32(115):
  9433  		goto _44
  9434  	case int32(119):
  9435  		goto _46
  9436  	default:
  9437  		goto _48
  9438  	}
  9439  
  9440  _36:
  9441  	Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), _x.XD)
  9442  	_j += uint64(2)
  9443  	goto _49
  9444  _37:
  9445  	_12_s = _x.Xs
  9446  	if _12_s > (59.999) {
  9447  		_12_s = 59.999
  9448  	}
  9449  	Xsqlite3_snprintf(tls, int32(7), elem1(_z, uintptr(_j)), str(7441), _12_s)
  9450  	_j += uint64(_sqlite3Strlen30(tls, elem1(_z, uintptr(_j))))
  9451  	goto _49
  9452  _38:
  9453  	Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), _x.Xh)
  9454  	_j += uint64(2)
  9455  	goto _49
  9456  _39:
  9457  	_13_y = _x
  9458  	_13_y.XvalidJD = 0
  9459  	_13_y.XM = int32(1)
  9460  	_13_y.XD = int32(1)
  9461  	_computeJD(tls, &_13_y)
  9462  	_13_nDay = int32(((_x.XiJD - _13_y.XiJD) + int64(43200000)) / int64(86400000))
  9463  	if int32(*elem1(_zFmt, uintptr(_i))) == int32(87) {
  9464  		_14_wd = int32(((_x.XiJD + int64(43200000)) / int64(86400000)) % int64(7))
  9465  		Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), ((_13_nDay+int32(7))-_14_wd)/int32(7))
  9466  		_j += uint64(2)
  9467  		goto _52
  9468  	}
  9469  	Xsqlite3_snprintf(tls, int32(4), elem1(_z, uintptr(_j)), str(7448), _13_nDay+int32(1))
  9470  	_j += uint64(3)
  9471  _52:
  9472  	goto _49
  9473  _41:
  9474  	Xsqlite3_snprintf(tls, int32(20), elem1(_z, uintptr(_j)), str(7453), float64(_x.XiJD)/(8.64e+07))
  9475  	_j += uint64(_sqlite3Strlen30(tls, elem1(_z, uintptr(_j))))
  9476  	goto _49
  9477  _42:
  9478  	Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), _x.XM)
  9479  	_j += uint64(2)
  9480  	goto _49
  9481  _43:
  9482  	Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), _x.Xm)
  9483  	_j += uint64(2)
  9484  	goto _49
  9485  _44:
  9486  	Xsqlite3_snprintf(tls, int32(30), elem1(_z, uintptr(_j)), str(6249), (_x.XiJD/int64(1000))-int64(210866760000))
  9487  	_j += uint64(_sqlite3Strlen30(tls, elem1(_z, uintptr(_j))))
  9488  	goto _49
  9489  _45:
  9490  	Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), int32(_x.Xs))
  9491  	_j += uint64(2)
  9492  	goto _49
  9493  _46:
  9494  	*elem1(_z, uintptr(postInc23(&_j, uint64(1)))) = int8(int32(int8(((_x.XiJD+int64(129600000))/int64(86400000))%int64(7))) + int32(48))
  9495  	goto _49
  9496  _47:
  9497  	Xsqlite3_snprintf(tls, int32(5), elem1(_z, uintptr(_j)), str(7459), _x.XY)
  9498  	_j += uint64(_sqlite3Strlen30(tls, elem1(_z, uintptr(_j))))
  9499  	goto _49
  9500  _48:
  9501  	*elem1(_z, uintptr(postInc23(&_j, uint64(1)))) = int8(37)
  9502  	goto _49
  9503  _49:
  9504  _34:
  9505  	_i += 1
  9506  	goto _29
  9507  _32:
  9508  	*elem1(_z, uintptr(_j)) = 0
  9509  	Xsqlite3_result_text(tls, _context, _z, int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  9510  		if _z == (*int8)(unsafe.Pointer(&_zBuf)) {
  9511  			return func() func(*crt.TLS, unsafe.Pointer) {
  9512  				v := uint64(18446744073709551615)
  9513  				return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  9514  			}()
  9515  		}
  9516  		return func() func(*crt.TLS, unsafe.Pointer) {
  9517  			v := _sqlite3MallocSize
  9518  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  9519  		}()
  9520  	}())
  9521  	_ = _zBuf
  9522  }
  9523  
  9524  // C comment
  9525  //  /* An SQLITE_NOMEM error. */
  9526  func Xsqlite3_result_error_nomem(tls *crt.TLS, _pCtx *Xsqlite3_context) {
  9527  	func() {
  9528  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
  9529  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76576), unsafe.Pointer(&_sqlite3_result_error_nomemØ00__func__Ø000), unsafe.Pointer(str(6567)))
  9530  			crt.X__builtin_abort(tls)
  9531  		}
  9532  	}()
  9533  	_sqlite3VdbeMemSetNull(tls, (*XMem)(_pCtx.XpOut))
  9534  	_pCtx.XisError = _sqlite3NomemError(tls, int32(76578))
  9535  	_pCtx.XfErrorOrAux = uint8(1)
  9536  	_sqlite3OomFault(tls, (*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb))
  9537  }
  9538  
  9539  var _sqlite3_result_error_nomemØ00__func__Ø000 [27]int8
  9540  
  9541  func init() {
  9542  	crt.Xstrncpy(nil, &_sqlite3_result_error_nomemØ00__func__Ø000[0], str(7464), 27)
  9543  }
  9544  
  9545  // C comment
  9546  //  /*
  9547  //  ** current_time()
  9548  //  **
  9549  //  ** This function returns the same value as time('now').
  9550  //  */
  9551  func _ctimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
  9552  	_ = _NotUsed2
  9553  
  9554  	_timeFunc(tls, _context, int32(0), nil)
  9555  }
  9556  
  9557  // C comment
  9558  //  /*
  9559  //  ** current_timestamp()
  9560  //  **
  9561  //  ** This function returns the same value as datetime('now').
  9562  //  */
  9563  func _ctimestampFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
  9564  	_ = _NotUsed2
  9565  
  9566  	_datetimeFunc(tls, _context, int32(0), nil)
  9567  }
  9568  
  9569  // C comment
  9570  //  /*
  9571  //  ** current_date()
  9572  //  **
  9573  //  ** This function returns the same value as date('now').
  9574  //  */
  9575  func _cdateFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
  9576  	_ = _NotUsed2
  9577  
  9578  	_dateFunc(tls, _context, int32(0), nil)
  9579  }
  9580  
  9581  var _sqlite3RegisterBuiltinFunctionsØ00aBuiltinFuncØ001 [60]XFuncDef
  9582  
  9583  func init() {
  9584  	_sqlite3RegisterBuiltinFunctionsØ00aBuiltinFuncØ001 = [60]XFuncDef{XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9585  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9586  	}{_loadExt})), XzName: str(7491)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9587  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9588  	}{_loadExt})), XzName: str(7491)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9589  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9590  	}{_compileoptionusedFunc})), XzName: str(7506)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9591  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9592  	}{_compileoptiongetFunc})), XzName: str(7532)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(3073), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9593  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9594  	}{_versionFunc})), XzName: str(7557)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(3073), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9595  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9596  	}{_versionFunc})), XzName: str(7566)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(3073), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9597  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9598  	}{_versionFunc})), XzName: str(7577)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(18433), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9599  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9600  	}{_versionFunc})), XzName: str(7584)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XpUserData: crt.U2P(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9601  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9602  	}{_trimFunc})), XzName: str(7593)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XpUserData: crt.U2P(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9603  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9604  	}{_trimFunc})), XzName: str(7593)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XpUserData: crt.U2P(2), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9605  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9606  	}{_trimFunc})), XzName: str(7599)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XpUserData: crt.U2P(2), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9607  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9608  	}{_trimFunc})), XzName: str(7599)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XpUserData: crt.U2P(3), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9609  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9610  	}{_trimFunc})), XzName: str(7605)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XpUserData: crt.U2P(3), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9611  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9612  	}{_trimFunc})), XzName: str(7605)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(2081), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9613  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9614  	}{_minmaxFunc})), XzName: str(7610)}, XFuncDef{XfuncFlags: uint16(2081), XzName: str(7610)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(4129), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9615  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9616  	}{_minmaxStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9617  		f func(*crt.TLS, *Xsqlite3_context)
  9618  	}{_minMaxFinalize})), XzName: str(7610)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(2081), XpUserData: crt.U2P(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9619  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9620  	}{_minmaxFunc})), XzName: str(7614)}, XFuncDef{XfuncFlags: uint16(2081), XpUserData: crt.U2P(1), XzName: str(7614)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(4129), XpUserData: crt.U2P(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9621  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9622  	}{_minmaxStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9623  		f func(*crt.TLS, *Xsqlite3_context)
  9624  	}{_minMaxFinalize})), XzName: str(7614)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2177), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9625  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9626  	}{_typeofFunc})), XzName: str(7618)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2113), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9627  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9628  	}{_lengthFunc})), XzName: str(7625)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9629  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9630  	}{_instrFunc})), XzName: str(7632)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9631  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9632  	}{_printfFunc})), XzName: str(7638)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9633  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9634  	}{_unicodeFunc})), XzName: str(7645)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9635  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9636  	}{_charFunc})), XzName: str(7653)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9637  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9638  	}{_absFunc})), XzName: str(7658)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9639  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9640  	}{_roundFunc})), XzName: str(7662)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9641  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9642  	}{_roundFunc})), XzName: str(7662)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9643  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9644  	}{_upperFunc})), XzName: str(7668)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9645  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9646  	}{_lowerFunc})), XzName: str(7674)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9647  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9648  	}{_hexFunc})), XzName: str(7680)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2561), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9649  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9650  	}{_versionFunc})), XzName: str(7684)}, XFuncDef{XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9651  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9652  	}{_randomFunc})), XzName: str(7691)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9653  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9654  	}{_randomBlob})), XzName: str(7698)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2081), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9655  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9656  	}{_nullifFunc})), XzName: str(7709)}, XFuncDef{XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9657  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9658  	}{_versionFunc})), XzName: str(7716)}, XFuncDef{XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9659  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9660  	}{_sourceidFunc})), XzName: str(7731)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9661  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9662  	}{_errlogFunc})), XzName: str(7748)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9663  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9664  	}{_quoteFunc})), XzName: str(7759)}, XFuncDef{XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9665  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9666  	}{_last_insert_rowid})), XzName: str(7765)}, XFuncDef{XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9667  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9668  	}{_changes})), XzName: str(7783)}, XFuncDef{XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9669  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9670  	}{_total_changes})), XzName: str(7791)}, XFuncDef{XnArg: int8(3), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9671  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9672  	}{_replaceFunc})), XzName: str(7805)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9673  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9674  	}{_zeroblobFunc})), XzName: str(7813)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9675  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9676  	}{_substrFunc})), XzName: str(7822)}, XFuncDef{XnArg: int8(3), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9677  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9678  	}{_substrFunc})), XzName: str(7822)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9679  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9680  	}{_sumStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9681  		f func(*crt.TLS, *Xsqlite3_context)
  9682  	}{_sumFinalize})), XzName: str(7829)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9683  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9684  	}{_sumStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9685  		f func(*crt.TLS, *Xsqlite3_context)
  9686  	}{_totalFinalize})), XzName: str(7833)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9687  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9688  	}{_sumStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9689  		f func(*crt.TLS, *Xsqlite3_context)
  9690  	}{_avgFinalize})), XzName: str(7839)}, XFuncDef{XfuncFlags: uint16(257), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9691  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9692  	}{_countStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9693  		f func(*crt.TLS, *Xsqlite3_context)
  9694  	}{_countFinalize})), XzName: str(7843)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9695  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9696  	}{_countStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9697  		f func(*crt.TLS, *Xsqlite3_context)
  9698  	}{_countFinalize})), XzName: str(7843)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9699  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9700  	}{_groupConcatStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9701  		f func(*crt.TLS, *Xsqlite3_context)
  9702  	}{_groupConcatFinalize})), XzName: str(7849)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9703  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9704  	}{_groupConcatStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9705  		f func(*crt.TLS, *Xsqlite3_context)
  9706  	}{_groupConcatFinalize})), XzName: str(7849)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2061), XpUserData: unsafe.Pointer(&_globInfo), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9707  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9708  	}{_likeFunc})), XzName: str(7862)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2053), XpUserData: unsafe.Pointer(&_likeInfoNorm), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9709  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9710  	}{_likeFunc})), XzName: str(7867)}, XFuncDef{XnArg: int8(3), XfuncFlags: uint16(2053), XpUserData: unsafe.Pointer(&_likeInfoNorm), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9711  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9712  	}{_likeFunc})), XzName: str(7867)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XzName: str(7872)}, XFuncDef{XfuncFlags: uint16(2049), XzName: str(7872)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(2561), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9713  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9714  	}{_versionFunc})), XzName: str(7872)}}
  9715  }
  9716  
  9717  // C comment
  9718  //  /*
  9719  //  ** A function that loads a shared-library extension then returns NULL.
  9720  //  */
  9721  func _loadExt(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  9722  	var _zFile, _zProc, _zErrMsg *int8
  9723  	var _db *Xsqlite3
  9724  	_zFile = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
  9725  	_db = Xsqlite3_context_db_handle(tls, _context)
  9726  	_zErrMsg = nil
  9727  	if (_db.Xflags & int32(8388608)) == int32(0) {
  9728  		Xsqlite3_result_error(tls, _context, str(7881), int32(-1))
  9729  		return
  9730  	}
  9731  	if _argc == int32(2) {
  9732  		_zProc = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))))
  9733  		goto _2
  9734  	}
  9735  	_zProc = nil
  9736  _2:
  9737  	if (_zFile != nil) && Xsqlite3_load_extension(tls, _db, _zFile, _zProc, &_zErrMsg) != 0 {
  9738  		Xsqlite3_result_error(tls, _context, _zErrMsg, int32(-1))
  9739  		Xsqlite3_free(tls, unsafe.Pointer(_zErrMsg))
  9740  	}
  9741  }
  9742  
  9743  // C comment
  9744  //  /*
  9745  //  ** CAPI3REF: Load An Extension
  9746  //  ** METHOD: sqlite3
  9747  //  **
  9748  //  ** ^This interface loads an SQLite extension library from the named file.
  9749  //  **
  9750  //  ** ^The sqlite3_load_extension() interface attempts to load an
  9751  //  ** [SQLite extension] library contained in the file zFile.  If
  9752  //  ** the file cannot be loaded directly, attempts are made to load
  9753  //  ** with various operating-system specific extensions added.
  9754  //  ** So for example, if "samplelib" cannot be loaded, then names like
  9755  //  ** "samplelib.so" or "samplelib.dylib" or "samplelib.dll" might
  9756  //  ** be tried also.
  9757  //  **
  9758  //  ** ^The entry point is zProc.
  9759  //  ** ^(zProc may be 0, in which case SQLite will try to come up with an
  9760  //  ** entry point name on its own.  It first tries "sqlite3_extension_init".
  9761  //  ** If that does not work, it constructs a name "sqlite3_X_init" where the
  9762  //  ** X is consists of the lower-case equivalent of all ASCII alphabetic
  9763  //  ** characters in the filename from the last "/" to the first following
  9764  //  ** "." and omitting any initial "lib".)^
  9765  //  ** ^The sqlite3_load_extension() interface returns
  9766  //  ** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.
  9767  //  ** ^If an error occurs and pzErrMsg is not 0, then the
  9768  //  ** [sqlite3_load_extension()] interface shall attempt to
  9769  //  ** fill *pzErrMsg with error message text stored in memory
  9770  //  ** obtained from [sqlite3_malloc()]. The calling function
  9771  //  ** should free this memory by calling [sqlite3_free()].
  9772  //  **
  9773  //  ** ^Extension loading must be enabled using
  9774  //  ** [sqlite3_enable_load_extension()] or
  9775  //  ** [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],1,NULL)
  9776  //  ** prior to calling this API,
  9777  //  ** otherwise an error will be returned.
  9778  //  **
  9779  //  ** <b>Security warning:</b> It is recommended that the
  9780  //  ** [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this
  9781  //  ** interface.  The use of the [sqlite3_enable_load_extension()] interface
  9782  //  ** should be avoided.  This will keep the SQL function [load_extension()]
  9783  //  ** disabled and prevent SQL injections from giving attackers
  9784  //  ** access to extension loading capabilities.
  9785  //  **
  9786  //  ** See also the [load_extension() SQL function].
  9787  //  */
  9788  func Xsqlite3_load_extension(tls *crt.TLS, _db *Xsqlite3, _zFile *int8, _zProc *int8, _pzErrMsg **int8) (r0 int32) {
  9789  	var _rc int32
  9790  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
  9791  	_rc = _sqlite3LoadExtension(tls, _db, _zFile, _zProc, _pzErrMsg)
  9792  	_rc = _sqlite3ApiExit(tls, _db, _rc)
  9793  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
  9794  	return _rc
  9795  }
  9796  
  9797  // C comment
  9798  //  /*
  9799  //  ** Attempt to load an SQLite extension library contained in the file
  9800  //  ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
  9801  //  ** default entry point name (sqlite3_extension_init) is used.  Use
  9802  //  ** of the default name is recommended.
  9803  //  **
  9804  //  ** Return SQLITE_OK on success and SQLITE_ERROR if something goes wrong.
  9805  //  **
  9806  //  ** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
  9807  //  ** error message text.  The calling function should free this memory
  9808  //  ** by calling sqlite3DbFree(db, ).
  9809  //  */
  9810  func _sqlite3LoadExtension(tls *crt.TLS, _db *Xsqlite3, _zFile *int8, _zProc *int8, _pzErrMsg **int8) (r0 int32) {
  9811  	var _ii, _rc, _7_iFile, _7_iEntry, _7_c, _7_ncFile int32
  9812  	var _nMsg uint64
  9813  	var _zErrmsg, _zEntry, _zAltEntry, _3_zAltFile *int8
  9814  	var _handle unsafe.Pointer
  9815  	var _aHandle *unsafe.Pointer
  9816  	var _pVfs *Xsqlite3_vfs
  9817  	var _xInit func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32
  9818  	_pVfs = (*Xsqlite3_vfs)(_db.XpVfs)
  9819  	_zErrmsg = nil
  9820  	_zAltEntry = nil
  9821  	_nMsg = uint64(int32(300) + _sqlite3Strlen30(tls, _zFile))
  9822  	if _pzErrMsg != nil {
  9823  		*_pzErrMsg = nil
  9824  	}
  9825  	if (_db.Xflags & int32(4194304)) != int32(0) {
  9826  		goto _1
  9827  	}
  9828  	if _pzErrMsg != nil {
  9829  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(7881))
  9830  	}
  9831  	return int32(1)
  9832  
  9833  _1:
  9834  	_zEntry = func() *int8 {
  9835  		if _zProc != nil {
  9836  			return _zProc
  9837  		}
  9838  		return str(7896)
  9839  	}()
  9840  	_handle = _sqlite3OsDlOpen(tls, _pVfs, _zFile)
  9841  	_ii = int32(0)
  9842  _5:
  9843  	if _ii >= int32(1) || _handle != nil {
  9844  		goto _9
  9845  	}
  9846  	_3_zAltFile = Xsqlite3_mprintf(tls, str(7919), unsafe.Pointer(_zFile), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_sqlite3LoadExtensionØ00azEndingsØ001)), uintptr(_ii))))
  9847  	if _3_zAltFile == nil {
  9848  		return _sqlite3NomemError(tls, int32(112306))
  9849  	}
  9850  	_handle = _sqlite3OsDlOpen(tls, _pVfs, _3_zAltFile)
  9851  	Xsqlite3_free(tls, unsafe.Pointer(_3_zAltFile))
  9852  	_ii += 1
  9853  	goto _5
  9854  _9:
  9855  	if _handle != nil {
  9856  		goto _11
  9857  	}
  9858  	if _pzErrMsg == nil {
  9859  		goto _12
  9860  	}
  9861  	*_pzErrMsg = store1(&_zErrmsg, (*int8)(Xsqlite3_malloc64(tls, _nMsg)))
  9862  	if _zErrmsg != nil {
  9863  		Xsqlite3_snprintf(tls, int32(_nMsg), _zErrmsg, str(7925), unsafe.Pointer(_zFile))
  9864  		_sqlite3OsDlError(tls, _pVfs, int32(_nMsg-uint64(1)), _zErrmsg)
  9865  	}
  9866  _12:
  9867  	return int32(1)
  9868  
  9869  _11:
  9870  	_xInit = func() func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 {
  9871  		v := _sqlite3OsDlSym(tls, _pVfs, _handle, _zEntry)
  9872  		return *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&v))
  9873  	}()
  9874  	if _xInit != nil || _zProc != nil {
  9875  		goto _15
  9876  	}
  9877  	_7_ncFile = _sqlite3Strlen30(tls, _zFile)
  9878  	_zAltEntry = (*int8)(Xsqlite3_malloc64(tls, uint64(_7_ncFile+int32(30))))
  9879  	if _zAltEntry == nil {
  9880  		_sqlite3OsDlClose(tls, _pVfs, _handle)
  9881  		return _sqlite3NomemError(tls, int32(112341))
  9882  	}
  9883  	crt.Xmemcpy(tls, unsafe.Pointer(_zAltEntry), unsafe.Pointer(str(7960)), uint64(8))
  9884  	_7_iFile = _7_ncFile - int32(1)
  9885  _17:
  9886  	if _7_iFile < int32(0) || int32(*elem1(_zFile, uintptr(_7_iFile))) == int32(47) {
  9887  		goto _21
  9888  	}
  9889  	_7_iFile -= 1
  9890  	goto _17
  9891  _21:
  9892  	_7_iFile += 1
  9893  	if Xsqlite3_strnicmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile))+uintptr(_7_iFile))), str(7969), int32(3)) == int32(0) {
  9894  		_7_iFile += int32(3)
  9895  	}
  9896  	_7_iEntry = int32(8)
  9897  _23:
  9898  	if store2(&_7_c, int32(*elem1(_zFile, uintptr(_7_iFile)))) == int32(0) || _7_c == int32(46) {
  9899  		goto _27
  9900  	}
  9901  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(_7_c)))) & int32(2)) != 0 {
  9902  		*elem1(_zAltEntry, uintptr(postInc2(&_7_iEntry, 1))) = int8(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint32(_7_c))))
  9903  	}
  9904  	_7_iFile += 1
  9905  	goto _23
  9906  _27:
  9907  	crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAltEntry))+uintptr(_7_iEntry)))), unsafe.Pointer(str(7973)), uint64(6))
  9908  	_zEntry = _zAltEntry
  9909  	_xInit = func() func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 {
  9910  		v := _sqlite3OsDlSym(tls, _pVfs, _handle, _zEntry)
  9911  		return *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&v))
  9912  	}()
  9913  _15:
  9914  	if _xInit != nil {
  9915  		goto _29
  9916  	}
  9917  	if _pzErrMsg == nil {
  9918  		goto _30
  9919  	}
  9920  	_nMsg += uint64(_sqlite3Strlen30(tls, _zEntry))
  9921  	*_pzErrMsg = store1(&_zErrmsg, (*int8)(Xsqlite3_malloc64(tls, _nMsg)))
  9922  	if _zErrmsg != nil {
  9923  		Xsqlite3_snprintf(tls, int32(_nMsg), _zErrmsg, str(7979), unsafe.Pointer(_zEntry), unsafe.Pointer(_zFile))
  9924  		_sqlite3OsDlError(tls, _pVfs, int32(_nMsg-uint64(1)), _zErrmsg)
  9925  	}
  9926  _30:
  9927  	_sqlite3OsDlClose(tls, _pVfs, _handle)
  9928  	Xsqlite3_free(tls, unsafe.Pointer(_zAltEntry))
  9929  	return int32(1)
  9930  
  9931  _29:
  9932  	Xsqlite3_free(tls, unsafe.Pointer(_zAltEntry))
  9933  	_rc = _xInit(tls, _db, &_zErrmsg, &_sqlite3Apis)
  9934  	if _rc == 0 {
  9935  		goto _32
  9936  	}
  9937  	if _rc == int32(256) {
  9938  		return int32(0)
  9939  	}
  9940  	if _pzErrMsg != nil {
  9941  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(8022), unsafe.Pointer(_zErrmsg))
  9942  	}
  9943  	Xsqlite3_free(tls, unsafe.Pointer(_zErrmsg))
  9944  	_sqlite3OsDlClose(tls, _pVfs, _handle)
  9945  	return int32(1)
  9946  
  9947  _32:
  9948  	_aHandle = (*unsafe.Pointer)(_sqlite3DbMallocZero(tls, _db, uint64(8)*uint64(_db.XnExtension+int32(1))))
  9949  	if _aHandle == nil {
  9950  		return _sqlite3NomemError(tls, int32(112385))
  9951  	}
  9952  	if _db.XnExtension > int32(0) {
  9953  		crt.Xmemcpy(tls, unsafe.Pointer(_aHandle), unsafe.Pointer(_db.XaExtension), uint64(8)*uint64(_db.XnExtension))
  9954  	}
  9955  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_db.XaExtension))
  9956  	_db.XaExtension = _aHandle
  9957  	*elem24(_db.XaExtension, uintptr(postInc2(&_db.XnExtension, 1))) = _handle
  9958  	return int32(0)
  9959  }
  9960  
  9961  // C comment
  9962  //  /*
  9963  //  ** Print into memory obtained from sqlite3_malloc()().  Omit the internal
  9964  //  ** %-conversion extensions.
  9965  //  */
  9966  func Xsqlite3_mprintf(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 *int8) {
  9967  	var _z *int8
  9968  	var _ap []interface{}
  9969  	if Xsqlite3_initialize(tls) != 0 {
  9970  		return nil
  9971  	}
  9972  	_ap = args
  9973  	_z = Xsqlite3_vmprintf(tls, _zFormat, _ap)
  9974  	_ap = nil
  9975  	return _z
  9976  }
  9977  
  9978  // C comment
  9979  //  /*
  9980  //  ** Print into memory obtained from sqlite3_malloc().  Omit the internal
  9981  //  ** %-conversion extensions.
  9982  //  */
  9983  func Xsqlite3_vmprintf(tls *crt.TLS, _zFormat *int8, _ap []interface{}) (r0 *int8) {
  9984  	var _z *int8
  9985  	var _acc XStrAccum
  9986  	var _zBase [70]int8
  9987  	if _zFormat == nil {
  9988  		_sqlite3MisuseError(tls, int32(26040))
  9989  		return nil
  9990  	}
  9991  	if Xsqlite3_initialize(tls) != 0 {
  9992  		return nil
  9993  	}
  9994  	_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBase)), int32(70), int32(1000000000))
  9995  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
  9996  	_z = _sqlite3StrAccumFinish(tls, &_acc)
  9997  	return _z
  9998  
  9999  	_ = _zBase
 10000  	panic(0)
 10001  }
 10002  
 10003  func _sqlite3OsDlOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8) (r0 unsafe.Pointer) {
 10004  	return func() func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer {
 10005  		v := _pVfs.XxDlOpen
 10006  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer)(unsafe.Pointer(&v))
 10007  	}()(tls, _pVfs, _zPath)
 10008  }
 10009  
 10010  var _sqlite3LoadExtensionØ00azEndingsØ001 [1]*int8
 10011  
 10012  func init() {
 10013  	_sqlite3LoadExtensionØ00azEndingsØ001 = [1]*int8{str(8054)}
 10014  }
 10015  
 10016  func Xsqlite3_malloc64(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) {
 10017  	if Xsqlite3_initialize(tls) != 0 {
 10018  		return nil
 10019  	}
 10020  	return _sqlite3Malloc(tls, _n)
 10021  }
 10022  
 10023  func _sqlite3OsDlError(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nByte int32, _zBufOut *int8) {
 10024  	func() func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) {
 10025  		v := _pVfs.XxDlError
 10026  		return *(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8))(unsafe.Pointer(&v))
 10027  	}()(tls, _pVfs, _nByte, _zBufOut)
 10028  }
 10029  
 10030  func _sqlite3OsDlSym(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pHdle unsafe.Pointer, _zSym *int8) (r0 func(*crt.TLS)) {
 10031  	return func() func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS) {
 10032  		v := _pVfs.XxDlSym
 10033  		return *(*func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&v))
 10034  	}()(tls, _pVfs, _pHdle, _zSym)
 10035  }
 10036  
 10037  func _sqlite3OsDlClose(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pHandle unsafe.Pointer) {
 10038  	func() func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer) {
 10039  		v := _pVfs.XxDlClose
 10040  		return *(*func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer))(unsafe.Pointer(&v))
 10041  	}()(tls, _pVfs, _pHandle)
 10042  }
 10043  
 10044  // C comment
 10045  //  /*
 10046  //  ** The following structure contains pointers to all SQLite API routines.
 10047  //  ** A pointer to this structure is passed into extensions when they are
 10048  //  ** loaded so that the extension can make calls back into the SQLite
 10049  //  ** library.
 10050  //  **
 10051  //  ** When adding new APIs, add them to the bottom of this structure
 10052  //  ** in order to preserve backwards compatibility.
 10053  //  **
 10054  //  ** Extensions that use newer APIs should first call the
 10055  //  ** sqlite3_libversion_number() to make sure that the API they
 10056  //  ** intend to use is supported by the library.  Extensions should
 10057  //  ** also check to make sure that the pointer to the function is
 10058  //  ** not NULL before calling it.
 10059  //  */
 10060  var _sqlite3Apis Xsqlite3_api_routines
 10061  
 10062  func init() {
 10063  	_sqlite3Apis = Xsqlite3_api_routines{Xaggregate_context: *(*func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
 10064  		f func(*crt.TLS, *Xsqlite3_context, int32) unsafe.Pointer
 10065  	}{Xsqlite3_aggregate_context})), Xaggregate_count: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10066  		f func(*crt.TLS, *Xsqlite3_context) int32
 10067  	}{Xsqlite3_aggregate_count})), Xbind_blob: Xsqlite3_bind_blob, Xbind_double: Xsqlite3_bind_double, Xbind_int: Xsqlite3_bind_int, Xbind_int64: Xsqlite3_bind_int64, Xbind_null: Xsqlite3_bind_null, Xbind_parameter_count: Xsqlite3_bind_parameter_count, Xbind_parameter_index: Xsqlite3_bind_parameter_index, Xbind_parameter_name: Xsqlite3_bind_parameter_name, Xbind_text: Xsqlite3_bind_text, Xbind_text16: Xsqlite3_bind_text16, Xbind_value: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10068  		f func(*crt.TLS, unsafe.Pointer, int32, *XMem) int32
 10069  	}{Xsqlite3_bind_value})), Xbusy_handler: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32) int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10070  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, int32) int32, unsafe.Pointer) int32
 10071  	}{Xsqlite3_busy_handler})), Xbusy_timeout: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 10072  		f func(*crt.TLS, *Xsqlite3, int32) int32
 10073  	}{Xsqlite3_busy_timeout})), Xchanges: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10074  		f func(*crt.TLS, *Xsqlite3) int32
 10075  	}{Xsqlite3_changes})), Xclose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10076  		f func(*crt.TLS, *Xsqlite3) int32
 10077  	}{Xsqlite3_close})), Xcollation_needed: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)) int32)(unsafe.Pointer(&struct {
 10078  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8)) int32
 10079  	}{Xsqlite3_collation_needed})), Xcollation_needed16: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
 10080  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer)) int32
 10081  	}{Xsqlite3_collation_needed16})), Xcolumn_blob: Xsqlite3_column_blob, Xcolumn_bytes: Xsqlite3_column_bytes, Xcolumn_bytes16: Xsqlite3_column_bytes16, Xcolumn_count: Xsqlite3_column_count, Xcolumn_decltype: Xsqlite3_column_decltype, Xcolumn_decltype16: Xsqlite3_column_decltype16, Xcolumn_double: Xsqlite3_column_double, Xcolumn_int: Xsqlite3_column_int, Xcolumn_int64: Xsqlite3_column_int64, Xcolumn_name: Xsqlite3_column_name, Xcolumn_name16: Xsqlite3_column_name16, Xcolumn_text: Xsqlite3_column_text, Xcolumn_text16: Xsqlite3_column_text16, Xcolumn_type: Xsqlite3_column_type, Xcolumn_value: *(*func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
 10082  		f func(*crt.TLS, unsafe.Pointer, int32) *XMem
 10083  	}{Xsqlite3_column_value})), Xcommit_hook: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10084  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer) unsafe.Pointer
 10085  	}{Xsqlite3_commit_hook})), Xcomplete: Xsqlite3_complete, Xcomplete16: Xsqlite3_complete16, Xcreate_collation: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32)(unsafe.Pointer(&struct {
 10086  		f func(*crt.TLS, *Xsqlite3, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
 10087  	}{Xsqlite3_create_collation})), Xcreate_collation16: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32)(unsafe.Pointer(&struct {
 10088  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
 10089  	}{Xsqlite3_create_collation16})), Xcreate_function: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
 10090  		f func(*crt.TLS, *Xsqlite3, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context)) int32
 10091  	}{Xsqlite3_create_function})), Xcreate_function16: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
 10092  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, int32, unsafe.Pointer, func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context)) int32
 10093  	}{Xsqlite3_create_function16})), Xcreate_module: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10094  		f func(*crt.TLS, *Xsqlite3, *int8, *Xsqlite3_module, unsafe.Pointer) int32
 10095  	}{Xsqlite3_create_module})), Xdata_count: Xsqlite3_data_count, Xdb_handle: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10096  		f func(*crt.TLS, unsafe.Pointer) *Xsqlite3
 10097  	}{Xsqlite3_db_handle})), Xdeclare_vtab: *(*func(*crt.TLS, unsafe.Pointer, *int8) int32)(unsafe.Pointer(&struct {
 10098  		f func(*crt.TLS, *Xsqlite3, *int8) int32
 10099  	}{Xsqlite3_declare_vtab})), Xenable_shared_cache: Xsqlite3_enable_shared_cache, Xerrcode: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10100  		f func(*crt.TLS, *Xsqlite3) int32
 10101  	}{Xsqlite3_errcode})), Xerrmsg: *(*func(*crt.TLS, unsafe.Pointer) *int8)(unsafe.Pointer(&struct {
 10102  		f func(*crt.TLS, *Xsqlite3) *int8
 10103  	}{Xsqlite3_errmsg})), Xerrmsg16: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10104  		f func(*crt.TLS, *Xsqlite3) unsafe.Pointer
 10105  	}{Xsqlite3_errmsg16})), Xexec: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
 10106  		f func(*crt.TLS, *Xsqlite3, *int8, func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, unsafe.Pointer, **int8) int32
 10107  	}{Xsqlite3_exec})), Xexpired: Xsqlite3_expired, Xfinalize: Xsqlite3_finalize, Xfree: Xsqlite3_free, Xfree_table: Xsqlite3_free_table, Xget_autocommit: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10108  		f func(*crt.TLS, *Xsqlite3) int32
 10109  	}{Xsqlite3_get_autocommit})), Xget_auxdata: *(*func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
 10110  		f func(*crt.TLS, *Xsqlite3_context, int32) unsafe.Pointer
 10111  	}{Xsqlite3_get_auxdata})), Xget_table: *(*func(*crt.TLS, unsafe.Pointer, *int8, ***int8, *int32, *int32, **int8) int32)(unsafe.Pointer(&struct {
 10112  		f func(*crt.TLS, *Xsqlite3, *int8, ***int8, *int32, *int32, **int8) int32
 10113  	}{Xsqlite3_get_table})), Xinterruptx: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f func(*crt.TLS, *Xsqlite3) }{Xsqlite3_interrupt})), Xlast_insert_rowid: *(*func(*crt.TLS, unsafe.Pointer) int64)(unsafe.Pointer(&struct {
 10114  		f func(*crt.TLS, *Xsqlite3) int64
 10115  	}{Xsqlite3_last_insert_rowid})), Xlibversion: Xsqlite3_libversion, Xlibversion_number: Xsqlite3_libversion_number, Xmalloc: Xsqlite3_malloc, Xmprintf: Xsqlite3_mprintf, Xopen64: *(*func(*crt.TLS, *int8, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10116  		f func(*crt.TLS, *int8, **Xsqlite3) int32
 10117  	}{Xsqlite3_open})), Xopen16: *(*func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10118  		f func(*crt.TLS, unsafe.Pointer, **Xsqlite3) int32
 10119  	}{Xsqlite3_open16})), Xprepare: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
 10120  		f func(*crt.TLS, *Xsqlite3, *int8, int32, *unsafe.Pointer, **int8) int32
 10121  	}{Xsqlite3_prepare})), Xprepare16: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10122  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
 10123  	}{Xsqlite3_prepare16})), Xprofile: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8, uint64), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10124  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, *int8, uint64), unsafe.Pointer) unsafe.Pointer
 10125  	}{Xsqlite3_profile})), Xprogress_handler: *(*func(*crt.TLS, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer))(unsafe.Pointer(&struct {
 10126  		f func(*crt.TLS, *Xsqlite3, int32, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer)
 10127  	}{Xsqlite3_progress_handler})), Xrealloc: Xsqlite3_realloc, Xreset: Xsqlite3_reset, Xresult_blob: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10128  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
 10129  	}{Xsqlite3_result_blob})), Xresult_double: *(*func(*crt.TLS, unsafe.Pointer, float64))(unsafe.Pointer(&struct {
 10130  		f func(*crt.TLS, *Xsqlite3_context, float64)
 10131  	}{Xsqlite3_result_double})), Xresult_error: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32))(unsafe.Pointer(&struct {
 10132  		f func(*crt.TLS, *Xsqlite3_context, *int8, int32)
 10133  	}{Xsqlite3_result_error})), Xresult_error16: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
 10134  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32)
 10135  	}{Xsqlite3_result_error16})), Xresult_int: *(*func(*crt.TLS, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
 10136  		f func(*crt.TLS, *Xsqlite3_context, int32)
 10137  	}{Xsqlite3_result_int})), Xresult_int64: *(*func(*crt.TLS, unsafe.Pointer, int64))(unsafe.Pointer(&struct {
 10138  		f func(*crt.TLS, *Xsqlite3_context, int64)
 10139  	}{Xsqlite3_result_int64})), Xresult_null: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10140  		f func(*crt.TLS, *Xsqlite3_context)
 10141  	}{Xsqlite3_result_null})), Xresult_text: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10142  		f func(*crt.TLS, *Xsqlite3_context, *int8, int32, func(*crt.TLS, unsafe.Pointer))
 10143  	}{Xsqlite3_result_text})), Xresult_text16: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10144  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
 10145  	}{Xsqlite3_result_text16})), Xresult_text16be: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10146  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
 10147  	}{Xsqlite3_result_text16be})), Xresult_text16le: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10148  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
 10149  	}{Xsqlite3_result_text16le})), Xresult_value: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
 10150  		f func(*crt.TLS, *Xsqlite3_context, *XMem)
 10151  	}{Xsqlite3_result_value})), Xrollback_hook: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10152  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer), unsafe.Pointer) unsafe.Pointer
 10153  	}{Xsqlite3_rollback_hook})), Xset_authorizer: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10154  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, unsafe.Pointer) int32
 10155  	}{Xsqlite3_set_authorizer})), Xset_auxdata: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10156  		f func(*crt.TLS, *Xsqlite3_context, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer))
 10157  	}{Xsqlite3_set_auxdata})), Xsnprintf: Xsqlite3_snprintf, Xstep: Xsqlite3_step, Xtable_column_metadata: *(*func(*crt.TLS, unsafe.Pointer, *int8, *int8, *int8, **int8, **int8, *int32, *int32, *int32) int32)(unsafe.Pointer(&struct {
 10158  		f func(*crt.TLS, *Xsqlite3, *int8, *int8, *int8, **int8, **int8, *int32, *int32, *int32) int32
 10159  	}{Xsqlite3_table_column_metadata})), Xthread_cleanup: Xsqlite3_thread_cleanup, Xtotal_changes: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10160  		f func(*crt.TLS, *Xsqlite3) int32
 10161  	}{Xsqlite3_total_changes})), Xtrace: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10162  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, *int8), unsafe.Pointer) unsafe.Pointer
 10163  	}{Xsqlite3_trace})), Xtransfer_bindings: Xsqlite3_transfer_bindings, Xupdate_hook: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10164  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), unsafe.Pointer) unsafe.Pointer
 10165  	}{Xsqlite3_update_hook})), Xuser_data: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10166  		f func(*crt.TLS, *Xsqlite3_context) unsafe.Pointer
 10167  	}{Xsqlite3_user_data})), Xvalue_blob: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10168  		f func(*crt.TLS, *XMem) unsafe.Pointer
 10169  	}{Xsqlite3_value_blob})), Xvalue_bytes: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int32 }{Xsqlite3_value_bytes})), Xvalue_bytes16: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int32 }{Xsqlite3_value_bytes16})), Xvalue_double: *(*func(*crt.TLS, unsafe.Pointer) float64)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) float64 }{Xsqlite3_value_double})), Xvalue_int: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int32 }{Xsqlite3_value_int})), Xvalue_int64: *(*func(*crt.TLS, unsafe.Pointer) int64)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int64 }{Xsqlite3_value_int64})), Xvalue_numeric_type: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int32 }{Xsqlite3_value_numeric_type})), Xvalue_text: *(*func(*crt.TLS, unsafe.Pointer) *uint8)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) *uint8 }{Xsqlite3_value_text})), Xvalue_text16: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10170  		f func(*crt.TLS, *XMem) unsafe.Pointer
 10171  	}{Xsqlite3_value_text16})), Xvalue_text16be: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10172  		f func(*crt.TLS, *XMem) unsafe.Pointer
 10173  	}{Xsqlite3_value_text16be})), Xvalue_text16le: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10174  		f func(*crt.TLS, *XMem) unsafe.Pointer
 10175  	}{Xsqlite3_value_text16le})), Xvalue_type: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int32 }{Xsqlite3_value_type})), Xvmprintf: *(*func(*crt.TLS, *int8, unsafe.Pointer) *int8)(unsafe.Pointer(&struct {
 10176  		f func(*crt.TLS, *int8, []interface{}) *int8
 10177  	}{Xsqlite3_vmprintf})), Xoverload_function: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
 10178  		f func(*crt.TLS, *Xsqlite3, *int8, int32) int32
 10179  	}{Xsqlite3_overload_function})), Xprepare_v2: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
 10180  		f func(*crt.TLS, *Xsqlite3, *int8, int32, *unsafe.Pointer, **int8) int32
 10181  	}{Xsqlite3_prepare_v2})), Xprepare16_v2: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10182  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
 10183  	}{Xsqlite3_prepare16_v2})), Xclear_bindings: Xsqlite3_clear_bindings, Xcreate_module_v2: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
 10184  		f func(*crt.TLS, *Xsqlite3, *int8, *Xsqlite3_module, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)) int32
 10185  	}{Xsqlite3_create_module_v2})), Xbind_zeroblob: Xsqlite3_bind_zeroblob, Xblob_bytes: Xsqlite3_blob_bytes, Xblob_close: Xsqlite3_blob_close, Xblob_open: *(*func(*crt.TLS, unsafe.Pointer, *int8, *int8, *int8, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10186  		f func(*crt.TLS, *Xsqlite3, *int8, *int8, *int8, int64, int32, *unsafe.Pointer) int32
 10187  	}{Xsqlite3_blob_open})), Xblob_read: Xsqlite3_blob_read, Xblob_write: Xsqlite3_blob_write, Xcreate_collation_v2: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, func(*crt.TLS, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
 10188  		f func(*crt.TLS, *Xsqlite3, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, func(*crt.TLS, unsafe.Pointer)) int32
 10189  	}{Xsqlite3_create_collation_v2})), Xfile_control: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10190  		f func(*crt.TLS, *Xsqlite3, *int8, int32, unsafe.Pointer) int32
 10191  	}{Xsqlite3_file_control})), Xmemory_highwater: Xsqlite3_memory_highwater, Xmemory_used: Xsqlite3_memory_used, Xmutex_alloc: *(*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
 10192  		f func(*crt.TLS, int32) *Xsqlite3_mutex
 10193  	}{Xsqlite3_mutex_alloc})), Xmutex_enter: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10194  		f func(*crt.TLS, *Xsqlite3_mutex)
 10195  	}{Xsqlite3_mutex_enter})), Xmutex_free: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10196  		f func(*crt.TLS, *Xsqlite3_mutex)
 10197  	}{Xsqlite3_mutex_free})), Xmutex_leave: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10198  		f func(*crt.TLS, *Xsqlite3_mutex)
 10199  	}{Xsqlite3_mutex_leave})), Xmutex_try: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10200  		f func(*crt.TLS, *Xsqlite3_mutex) int32
 10201  	}{Xsqlite3_mutex_try})), Xopen_v2: *(*func(*crt.TLS, *int8, *unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
 10202  		f func(*crt.TLS, *int8, **Xsqlite3, int32, *int8) int32
 10203  	}{Xsqlite3_open_v2})), Xrelease_memory: Xsqlite3_release_memory, Xresult_error_nomem: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10204  		f func(*crt.TLS, *Xsqlite3_context)
 10205  	}{Xsqlite3_result_error_nomem})), Xresult_error_toobig: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10206  		f func(*crt.TLS, *Xsqlite3_context)
 10207  	}{Xsqlite3_result_error_toobig})), Xsleep: Xsqlite3_sleep, Xsoft_heap_limit: Xsqlite3_soft_heap_limit, Xvfs_find: *(*func(*crt.TLS, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
 10208  		f func(*crt.TLS, *int8) *Xsqlite3_vfs
 10209  	}{Xsqlite3_vfs_find})), Xvfs_register: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 10210  		f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
 10211  	}{Xsqlite3_vfs_register})), Xvfs_unregister: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10212  		f func(*crt.TLS, *Xsqlite3_vfs) int32
 10213  	}{Xsqlite3_vfs_unregister})), Xxthreadsafe: Xsqlite3_threadsafe, Xresult_zeroblob: *(*func(*crt.TLS, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
 10214  		f func(*crt.TLS, *Xsqlite3_context, int32)
 10215  	}{Xsqlite3_result_zeroblob})), Xresult_error_code: *(*func(*crt.TLS, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
 10216  		f func(*crt.TLS, *Xsqlite3_context, int32)
 10217  	}{Xsqlite3_result_error_code})), Xtest_control: Xsqlite3_test_control, Xrandomness: Xsqlite3_randomness, Xcontext_db_handle: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10218  		f func(*crt.TLS, *Xsqlite3_context) *Xsqlite3
 10219  	}{Xsqlite3_context_db_handle})), Xextended_result_codes: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 10220  		f func(*crt.TLS, *Xsqlite3, int32) int32
 10221  	}{Xsqlite3_extended_result_codes})), Xlimit: *(*func(*crt.TLS, unsafe.Pointer, int32, int32) int32)(unsafe.Pointer(&struct {
 10222  		f func(*crt.TLS, *Xsqlite3, int32, int32) int32
 10223  	}{Xsqlite3_limit})), Xnext_stmt: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10224  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer) unsafe.Pointer
 10225  	}{Xsqlite3_next_stmt})), Xsql: Xsqlite3_sql, Xstatus: Xsqlite3_status, Xbackup_finish: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10226  		f func(*crt.TLS, *Xsqlite3_backup) int32
 10227  	}{Xsqlite3_backup_finish})), Xbackup_init: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
 10228  		f func(*crt.TLS, *Xsqlite3, *int8, *Xsqlite3, *int8) *Xsqlite3_backup
 10229  	}{Xsqlite3_backup_init})), Xbackup_pagecount: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10230  		f func(*crt.TLS, *Xsqlite3_backup) int32
 10231  	}{Xsqlite3_backup_pagecount})), Xbackup_remaining: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10232  		f func(*crt.TLS, *Xsqlite3_backup) int32
 10233  	}{Xsqlite3_backup_remaining})), Xbackup_step: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 10234  		f func(*crt.TLS, *Xsqlite3_backup, int32) int32
 10235  	}{Xsqlite3_backup_step})), Xcompileoption_get: Xsqlite3_compileoption_get, Xcompileoption_used: Xsqlite3_compileoption_used, Xcreate_function_v2: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
 10236  		f func(*crt.TLS, *Xsqlite3, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context), func(*crt.TLS, unsafe.Pointer)) int32
 10237  	}{Xsqlite3_create_function_v2})), Xdb_config: *(*func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32)(unsafe.Pointer(&struct {
 10238  		f func(*crt.TLS, *Xsqlite3, int32, ...interface{}) int32
 10239  	}{Xsqlite3_db_config})), Xdb_mutex: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10240  		f func(*crt.TLS, *Xsqlite3) *Xsqlite3_mutex
 10241  	}{Xsqlite3_db_mutex})), Xdb_status: *(*func(*crt.TLS, unsafe.Pointer, int32, *int32, *int32, int32) int32)(unsafe.Pointer(&struct {
 10242  		f func(*crt.TLS, *Xsqlite3, int32, *int32, *int32, int32) int32
 10243  	}{Xsqlite3_db_status})), Xextended_errcode: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10244  		f func(*crt.TLS, *Xsqlite3) int32
 10245  	}{Xsqlite3_extended_errcode})), Xlog: Xsqlite3_log, Xsoft_heap_limit64: Xsqlite3_soft_heap_limit64, Xsourceid: Xsqlite3_sourceid, Xstmt_status: Xsqlite3_stmt_status, Xstrnicmp: Xsqlite3_strnicmp, Xwal_autocheckpoint: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 10246  		f func(*crt.TLS, *Xsqlite3, int32) int32
 10247  	}{Xsqlite3_wal_autocheckpoint})), Xwal_checkpoint: *(*func(*crt.TLS, unsafe.Pointer, *int8) int32)(unsafe.Pointer(&struct {
 10248  		f func(*crt.TLS, *Xsqlite3, *int8) int32
 10249  	}{Xsqlite3_wal_checkpoint})), Xwal_hook: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10250  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32, unsafe.Pointer) unsafe.Pointer
 10251  	}{Xsqlite3_wal_hook})), Xblob_reopen: Xsqlite3_blob_reopen, Xvtab_config: *(*func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32)(unsafe.Pointer(&struct {
 10252  		f func(*crt.TLS, *Xsqlite3, int32, ...interface{}) int32
 10253  	}{Xsqlite3_vtab_config})), Xvtab_on_conflict: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10254  		f func(*crt.TLS, *Xsqlite3) int32
 10255  	}{Xsqlite3_vtab_on_conflict})), Xclose_v2: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10256  		f func(*crt.TLS, *Xsqlite3) int32
 10257  	}{Xsqlite3_close_v2})), Xdb_filename: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
 10258  		f func(*crt.TLS, *Xsqlite3, *int8) *int8
 10259  	}{Xsqlite3_db_filename})), Xdb_readonly: *(*func(*crt.TLS, unsafe.Pointer, *int8) int32)(unsafe.Pointer(&struct {
 10260  		f func(*crt.TLS, *Xsqlite3, *int8) int32
 10261  	}{Xsqlite3_db_readonly})), Xdb_release_memory: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10262  		f func(*crt.TLS, *Xsqlite3) int32
 10263  	}{Xsqlite3_db_release_memory})), Xerrstr: Xsqlite3_errstr, Xstmt_busy: Xsqlite3_stmt_busy, Xstmt_readonly: Xsqlite3_stmt_readonly, Xstricmp: Xsqlite3_stricmp, Xuri_boolean: Xsqlite3_uri_boolean, Xuri_int64: Xsqlite3_uri_int64, Xuri_parameter: Xsqlite3_uri_parameter, Xvsnprintf: *(*func(*crt.TLS, int32, *int8, *int8, unsafe.Pointer) *int8)(unsafe.Pointer(&struct {
 10264  		f func(*crt.TLS, int32, *int8, *int8, []interface{}) *int8
 10265  	}{Xsqlite3_vsnprintf})), Xwal_checkpoint_v2: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32, *int32) int32)(unsafe.Pointer(&struct {
 10266  		f func(*crt.TLS, *Xsqlite3, *int8, int32, *int32, *int32) int32
 10267  	}{Xsqlite3_wal_checkpoint_v2})), Xauto_extension: Xsqlite3_auto_extension, Xbind_blob64: Xsqlite3_bind_blob64, Xbind_text64: Xsqlite3_bind_text64, Xcancel_auto_extension: Xsqlite3_cancel_auto_extension, Xload_extension: *(*func(*crt.TLS, unsafe.Pointer, *int8, *int8, **int8) int32)(unsafe.Pointer(&struct {
 10268  		f func(*crt.TLS, *Xsqlite3, *int8, *int8, **int8) int32
 10269  	}{Xsqlite3_load_extension})), Xmalloc64: Xsqlite3_malloc64, Xmsize: Xsqlite3_msize, Xrealloc64: Xsqlite3_realloc64, Xreset_auto_extension: Xsqlite3_reset_auto_extension, Xresult_blob64: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10270  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer))
 10271  	}{Xsqlite3_result_blob64})), Xresult_text64: *(*func(*crt.TLS, unsafe.Pointer, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8))(unsafe.Pointer(&struct {
 10272  		f func(*crt.TLS, *Xsqlite3_context, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8)
 10273  	}{Xsqlite3_result_text64})), Xstrglob: Xsqlite3_strglob, Xvalue_dup: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) *XMem }{Xsqlite3_value_dup})), Xvalue_free: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) }{Xsqlite3_value_free})), Xresult_zeroblob64: *(*func(*crt.TLS, unsafe.Pointer, uint64) int32)(unsafe.Pointer(&struct {
 10274  		f func(*crt.TLS, *Xsqlite3_context, uint64) int32
 10275  	}{Xsqlite3_result_zeroblob64})), Xbind_zeroblob64: Xsqlite3_bind_zeroblob64, Xvalue_subtype: *(*func(*crt.TLS, unsafe.Pointer) uint32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) uint32 }{Xsqlite3_value_subtype})), Xresult_subtype: *(*func(*crt.TLS, unsafe.Pointer, uint32))(unsafe.Pointer(&struct {
 10276  		f func(*crt.TLS, *Xsqlite3_context, uint32)
 10277  	}{Xsqlite3_result_subtype})), Xstatus64: Xsqlite3_status64, Xstrlike: Xsqlite3_strlike, Xdb_cacheflush: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10278  		f func(*crt.TLS, *Xsqlite3) int32
 10279  	}{Xsqlite3_db_cacheflush})), Xsystem_errno: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10280  		f func(*crt.TLS, *Xsqlite3) int32
 10281  	}{Xsqlite3_system_errno})), Xtrace_v2: *(*func(*crt.TLS, unsafe.Pointer, uint32, func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10282  		f func(*crt.TLS, *Xsqlite3, uint32, func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, unsafe.Pointer) int32
 10283  	}{Xsqlite3_trace_v2})), Xexpanded_sql: Xsqlite3_expanded_sql, Xset_last_insert_rowid: *(*func(*crt.TLS, unsafe.Pointer, int64))(unsafe.Pointer(&struct {
 10284  		f func(*crt.TLS, *Xsqlite3, int64)
 10285  	}{Xsqlite3_set_last_insert_rowid}))}
 10286  }
 10287  
 10288  // C comment
 10289  //  /*
 10290  //  ** Allocate or return the aggregate context for a user function.  A new
 10291  //  ** context is allocated on the first call.  Subsequent calls return the
 10292  //  ** same context that was returned on prior calls.
 10293  //  */
 10294  func Xsqlite3_aggregate_context(tls *crt.TLS, _p *Xsqlite3_context, _nByte int32) (r0 unsafe.Pointer) {
 10295  	func() {
 10296  		if _p == nil || _p.XpFunc == nil || ((*XFuncDef)(_p.XpFunc).XxFinalize) == nil {
 10297  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76890), unsafe.Pointer(&_sqlite3_aggregate_contextØ00__func__Ø000), unsafe.Pointer(str(8057)))
 10298  			crt.X__builtin_abort(tls)
 10299  		}
 10300  	}()
 10301  	func() {
 10302  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_p.XpOut).Xdb).Xmutex)) == 0 {
 10303  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76891), unsafe.Pointer(&_sqlite3_aggregate_contextØ00__func__Ø000), unsafe.Pointer(str(8094)))
 10304  			crt.X__builtin_abort(tls)
 10305  		}
 10306  	}()
 10307  	if (int32((*XMem)(_p.XpMem).Xflags) & int32(8192)) == int32(0) {
 10308  		return _createAggContext(tls, _p, _nByte)
 10309  	}
 10310  	return unsafe.Pointer((*XMem)(_p.XpMem).Xz)
 10311  }
 10312  
 10313  var _sqlite3_aggregate_contextØ00__func__Ø000 [26]int8
 10314  
 10315  func init() {
 10316  	crt.Xstrncpy(nil, &_sqlite3_aggregate_contextØ00__func__Ø000[0], str(8133), 26)
 10317  }
 10318  
 10319  // C comment
 10320  //  /*
 10321  //  ** Create a new aggregate context for p and return a pointer to
 10322  //  ** its pMem->z element.
 10323  //  */
 10324  func _createAggContext(tls *crt.TLS, _p *Xsqlite3_context, _nByte int32) (r0 unsafe.Pointer) {
 10325  	var _pMem *XMem
 10326  	_pMem = (*XMem)(_p.XpMem)
 10327  	func() {
 10328  		if (int32(_pMem.Xflags) & int32(8192)) != int32(0) {
 10329  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76869), unsafe.Pointer(&_createAggContextØ00__func__Ø000), unsafe.Pointer(str(8159)))
 10330  			crt.X__builtin_abort(tls)
 10331  		}
 10332  	}()
 10333  	if _nByte <= int32(0) {
 10334  		_sqlite3VdbeMemSetNull(tls, _pMem)
 10335  		_pMem.Xz = nil
 10336  		goto _3
 10337  	}
 10338  	_sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte)
 10339  	_pMem.Xflags = uint16(8192)
 10340  	*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMem.Xu)))) = (*XFuncDef)(_p.XpFunc)
 10341  	if _pMem.Xz != nil {
 10342  		crt.Xmemset(tls, unsafe.Pointer(_pMem.Xz), int32(0), uint64(_nByte))
 10343  	}
 10344  _3:
 10345  	return unsafe.Pointer(_pMem.Xz)
 10346  }
 10347  
 10348  var _createAggContextØ00__func__Ø000 [17]int8
 10349  
 10350  func init() {
 10351  	crt.Xstrncpy(nil, &_createAggContextØ00__func__Ø000[0], str(8186), 17)
 10352  }
 10353  
 10354  // C comment
 10355  //  /*
 10356  //  ** Return the number of times the Step function of an aggregate has been
 10357  //  ** called.
 10358  //  **
 10359  //  ** This function is deprecated.  Do not use it for new code.  It is
 10360  //  ** provide only to avoid breaking legacy code.  New aggregate function
 10361  //  ** implementations should keep their own counts within their aggregate
 10362  //  ** context.
 10363  //  */
 10364  func Xsqlite3_aggregate_count(tls *crt.TLS, _p *Xsqlite3_context) (r0 int32) {
 10365  	func() {
 10366  		if _p == nil || _p.XpMem == nil || _p.XpFunc == nil || ((*XFuncDef)(_p.XpFunc).XxFinalize) == nil {
 10367  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76995), unsafe.Pointer(&_sqlite3_aggregate_countØ00__func__Ø000), unsafe.Pointer(str(8203)))
 10368  			crt.X__builtin_abort(tls)
 10369  		}
 10370  	}()
 10371  	return (*XMem)(_p.XpMem).Xn
 10372  }
 10373  
 10374  var _sqlite3_aggregate_countØ00__func__Ø000 [24]int8
 10375  
 10376  func init() {
 10377  	crt.Xstrncpy(nil, &_sqlite3_aggregate_countØ00__func__Ø000[0], str(8251), 24)
 10378  }
 10379  
 10380  // C comment
 10381  //  /*
 10382  //  ** Bind a blob value to an SQL statement variable.
 10383  //  */
 10384  func Xsqlite3_bind_blob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 10385  	if _nData < int32(0) {
 10386  		return _sqlite3MisuseError(tls, int32(77424))
 10387  	}
 10388  	return _bindText(tls, _pStmt, _i, _zData, _nData, _xDel, 0)
 10389  }
 10390  
 10391  // C comment
 10392  //  /*
 10393  //  ** Bind a text or BLOB value.
 10394  //  */
 10395  func _bindText(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer), _encoding uint8) (r0 int32) {
 10396  	var _rc int32
 10397  	var _p *TVdbe
 10398  	var _pVar *XMem
 10399  	_p = (*TVdbe)(_pStmt)
 10400  	_rc = _vdbeUnbind(tls, _p, _i)
 10401  	if _rc != int32(0) {
 10402  		goto _0
 10403  	}
 10404  	if _zData == nil {
 10405  		goto _1
 10406  	}
 10407  	_pVar = elem25((*XMem)(_p.XaVar), uintptr(_i-int32(1)))
 10408  	_rc = _sqlite3VdbeMemSetStr(tls, _pVar, (*int8)(_zData), _nData, _encoding, _xDel)
 10409  	if (_rc == int32(0)) && (int32(_encoding) != int32(0)) {
 10410  		_rc = _sqlite3VdbeChangeEncoding(tls, _pVar, int32((*Xsqlite3)(_p.Xdb).Xenc))
 10411  	}
 10412  	_sqlite3Error(tls, (*Xsqlite3)(_p.Xdb), _rc)
 10413  	_rc = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.Xdb), _rc)
 10414  _1:
 10415  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10416  	goto _6
 10417  _0:
 10418  	if (_xDel != nil) && (*(*uintptr)(unsafe.Pointer(&struct {
 10419  		f func(*crt.TLS, unsafe.Pointer)
 10420  	}{_xDel})) != *(*uintptr)(unsafe.Pointer(&struct {
 10421  		f func(*crt.TLS, unsafe.Pointer)
 10422  	}{func() func(*crt.TLS, unsafe.Pointer) {
 10423  		v := uint64(18446744073709551615)
 10424  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 10425  	}()}))) {
 10426  		_xDel(tls, _zData)
 10427  	}
 10428  _6:
 10429  	return _rc
 10430  }
 10431  
 10432  // C comment
 10433  //  /******************************* sqlite3_bind_  ***************************
 10434  //  **
 10435  //  ** Routines used to attach values to wildcards in a compiled SQL statement.
 10436  //  */
 10437  //  /*
 10438  //  ** Unbind the value bound to variable i in virtual machine p. This is the
 10439  //  ** the same as binding a NULL value to the column. If the "i" parameter is
 10440  //  ** out of range, then SQLITE_RANGE is returned. Othewise SQLITE_OK.
 10441  //  **
 10442  //  ** A successful evaluation of this routine acquires the mutex on p.
 10443  //  ** the mutex is released if any kind of error occurs.
 10444  //  **
 10445  //  ** The error code stored in database p->db is overwritten with the return
 10446  //  ** value in any case.
 10447  //  */
 10448  func _vdbeUnbind(tls *crt.TLS, _p *TVdbe, _i int32) (r0 int32) {
 10449  	var _pVar *XMem
 10450  	if _vdbeSafetyNotNull(tls, _p) != 0 {
 10451  		return _sqlite3MisuseError(tls, int32(77342))
 10452  	}
 10453  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10454  	if (_p.Xmagic != uint32(770837923)) || (_p.Xpc >= int32(0)) {
 10455  		_sqlite3Error(tls, (*Xsqlite3)(_p.Xdb), int32(21))
 10456  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10457  		Xsqlite3_log(tls, int32(21), str(8275), unsafe.Pointer(_p.XzSql))
 10458  		return _sqlite3MisuseError(tls, int32(77350))
 10459  	}
 10460  	if (_i < int32(1)) || (_i > int32(_p.XnVar)) {
 10461  		_sqlite3Error(tls, (*Xsqlite3)(_p.Xdb), int32(25))
 10462  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10463  		return int32(25)
 10464  	}
 10465  	_i -= 1
 10466  	_pVar = elem25((*XMem)(_p.XaVar), uintptr(_i))
 10467  	_sqlite3VdbeMemRelease(tls, _pVar)
 10468  	_pVar.Xflags = uint16(1)
 10469  	_sqlite3Error(tls, (*Xsqlite3)(_p.Xdb), int32(0))
 10470  	func() {
 10471  		if ((uint32(_p.Xexpired>>9)<<31)>>31) == 0 && _p.Xexpmask != (0) {
 10472  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77372), unsafe.Pointer(&_vdbeUnbindØ00__func__Ø000), unsafe.Pointer(str(8315)))
 10473  			crt.X__builtin_abort(tls)
 10474  		}
 10475  	}()
 10476  	if (_p.Xexpmask != (0)) && ((_p.Xexpmask & func() uint32 {
 10477  		if _i >= int32(31) {
 10478  			return uint32(2147483648)
 10479  		}
 10480  		return (uint32(1) << uint(_i))
 10481  	}()) != (0)) {
 10482  		storebits26(&_p.Xexpired, int16(1), 1, 0)
 10483  	}
 10484  	return int32(0)
 10485  }
 10486  
 10487  func _vdbeSafetyNotNull(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 10488  	if _p == nil {
 10489  		Xsqlite3_log(tls, int32(21), str(8347))
 10490  		return int32(1)
 10491  	}
 10492  	return _vdbeSafety(tls, _p)
 10493  }
 10494  
 10495  // C comment
 10496  //  /*
 10497  //  ** Check on a Vdbe to make sure it has not been finalized.  Log
 10498  //  ** an error and return true if it has been finalized (or is otherwise
 10499  //  ** invalid).  Return false if it is ok.
 10500  //  */
 10501  func _vdbeSafety(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 10502  	if (*Xsqlite3)(_p.Xdb) == nil {
 10503  		Xsqlite3_log(tls, int32(21), str(8387))
 10504  		return int32(1)
 10505  	}
 10506  	return int32(0)
 10507  }
 10508  
 10509  // C comment
 10510  //  /*
 10511  //  ** Set the current error code to err_code and clear any prior error message.
 10512  //  ** Also set iSysErrno (by calling sqlite3System) if the err_code indicates
 10513  //  ** that would be appropriate.
 10514  //  */
 10515  func _sqlite3Error(tls *crt.TLS, _db *Xsqlite3, _err_code int32) {
 10516  	func() {
 10517  		if _db == nil {
 10518  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27796), unsafe.Pointer(&_sqlite3ErrorØ00__func__Ø000), unsafe.Pointer(str(1219)))
 10519  			crt.X__builtin_abort(tls)
 10520  		}
 10521  	}()
 10522  	_db.XerrCode = _err_code
 10523  	if _err_code != 0 || (_db.XpErr != nil) {
 10524  		_sqlite3ErrorFinish(tls, _db, _err_code)
 10525  	}
 10526  }
 10527  
 10528  var _sqlite3ErrorØ00__func__Ø000 [13]int8
 10529  
 10530  func init() {
 10531  	crt.Xstrncpy(nil, &_sqlite3ErrorØ00__func__Ø000[0], str(8432), 13)
 10532  }
 10533  
 10534  // C comment
 10535  //  /*
 10536  //  ** Helper function for sqlite3Error() - called rarely.  Broken out into
 10537  //  ** a separate routine to avoid unnecessary register saves on entry to
 10538  //  ** sqlite3Error().
 10539  //  */
 10540  func _sqlite3ErrorFinish(tls *crt.TLS, _db *Xsqlite3, _err_code int32) {
 10541  	if _db.XpErr != nil {
 10542  		_sqlite3ValueSetNull(tls, (*XMem)(_db.XpErr))
 10543  	}
 10544  	_sqlite3SystemError(tls, _db, _err_code)
 10545  }
 10546  
 10547  func _sqlite3ValueSetNull(tls *crt.TLS, _p *XMem) {
 10548  	_sqlite3VdbeMemSetNull(tls, _p)
 10549  }
 10550  
 10551  // C comment
 10552  //  /*
 10553  //  ** Load the sqlite3.iSysErrno field if that is an appropriate thing
 10554  //  ** to do based on the SQLite error code in rc.
 10555  //  */
 10556  func _sqlite3SystemError(tls *crt.TLS, _db *Xsqlite3, _rc int32) {
 10557  	if _rc == int32(3082) {
 10558  		return
 10559  	}
 10560  	_rc &= int32(255)
 10561  	if (_rc == int32(14)) || (_rc == int32(10)) {
 10562  		_db.XiSysErrno = _sqlite3OsGetLastError(tls, (*Xsqlite3_vfs)(_db.XpVfs))
 10563  	}
 10564  }
 10565  
 10566  func _sqlite3OsGetLastError(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) {
 10567  	return func() int32 {
 10568  		if _pVfs.XxGetLastError != nil {
 10569  			return func() func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32 {
 10570  				v := _pVfs.XxGetLastError
 10571  				return *(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&v))
 10572  			}()(tls, _pVfs, int32(0), nil)
 10573  		}
 10574  		return int32(0)
 10575  	}()
 10576  }
 10577  
 10578  var _vdbeUnbindØ00__func__Ø000 [11]int8
 10579  
 10580  func init() {
 10581  	crt.Xstrncpy(nil, &_vdbeUnbindØ00__func__Ø000[0], str(8445), 11)
 10582  }
 10583  
 10584  // C comment
 10585  //  /*
 10586  //  ** This function must be called before exiting any API function (i.e.
 10587  //  ** returning control to the user) that has called sqlite3_malloc or
 10588  //  ** sqlite3_realloc.
 10589  //  **
 10590  //  ** The returned value is normally a copy of the second argument to this
 10591  //  ** function. However, if a malloc() failure has occurred since the previous
 10592  //  ** invocation SQLITE_NOMEM is returned instead.
 10593  //  **
 10594  //  ** If an OOM as occurred, then the connection error-code (the value
 10595  //  ** returned by sqlite3_errcode()) is set to SQLITE_NOMEM.
 10596  //  */
 10597  func _sqlite3ApiExit(tls *crt.TLS, _db *Xsqlite3, _rc int32) (r0 int32) {
 10598  	func() {
 10599  		if _db == nil {
 10600  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25050), unsafe.Pointer(&_sqlite3ApiExitØ00__func__Ø000), unsafe.Pointer(str(1219)))
 10601  			crt.X__builtin_abort(tls)
 10602  		}
 10603  	}()
 10604  	func() {
 10605  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 10606  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25051), unsafe.Pointer(&_sqlite3ApiExitØ00__func__Ø000), unsafe.Pointer(str(881)))
 10607  			crt.X__builtin_abort(tls)
 10608  		}
 10609  	}()
 10610  	if (_db.XmallocFailed != 0) || (_rc == int32(3082)) {
 10611  		return _apiOomError(tls, _db)
 10612  	}
 10613  	return _rc & _db.XerrMask
 10614  }
 10615  
 10616  var _sqlite3ApiExitØ00__func__Ø000 [15]int8
 10617  
 10618  func init() {
 10619  	crt.Xstrncpy(nil, &_sqlite3ApiExitØ00__func__Ø000[0], str(8456), 15)
 10620  }
 10621  
 10622  // C comment
 10623  //  /*
 10624  //  ** Take actions at the end of an API call to indicate an OOM error
 10625  //  */
 10626  func _apiOomError(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 10627  	_sqlite3OomClear(tls, _db)
 10628  	_sqlite3Error(tls, _db, int32(7))
 10629  	return _sqlite3NomemError(tls, int32(25030))
 10630  }
 10631  
 10632  // C comment
 10633  //  /*
 10634  //  ** This routine reactivates the memory allocator and clears the
 10635  //  ** db->mallocFailed flag as necessary.
 10636  //  **
 10637  //  ** The memory allocator is not restarted if there are running
 10638  //  ** VDBEs.
 10639  //  */
 10640  func _sqlite3OomClear(tls *crt.TLS, _db *Xsqlite3) {
 10641  	if (_db.XmallocFailed != 0) && (_db.XnVdbeExec == int32(0)) {
 10642  		_db.XmallocFailed = 0
 10643  		*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(0)
 10644  		func() {
 10645  			if (_db.Xlookaside.XbDisable) <= (0) {
 10646  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25019), unsafe.Pointer(&_sqlite3OomClearØ00__func__Ø000), unsafe.Pointer(str(8471)))
 10647  				crt.X__builtin_abort(tls)
 10648  			}
 10649  		}()
 10650  		_db.Xlookaside.XbDisable -= 1
 10651  	}
 10652  }
 10653  
 10654  var _sqlite3OomClearØ00__func__Ø000 [16]int8
 10655  
 10656  func init() {
 10657  	crt.Xstrncpy(nil, &_sqlite3OomClearØ00__func__Ø000[0], str(8496), 16)
 10658  }
 10659  
 10660  func Xsqlite3_bind_double(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _rValue float64) (r0 int32) {
 10661  	var _rc int32
 10662  	var _p *TVdbe
 10663  	_p = (*TVdbe)(_pStmt)
 10664  	_rc = _vdbeUnbind(tls, _p, _i)
 10665  	if _rc == int32(0) {
 10666  		_sqlite3VdbeMemSetDouble(tls, elem25((*XMem)(_p.XaVar), uintptr(_i-int32(1))), _rValue)
 10667  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10668  	}
 10669  	return _rc
 10670  }
 10671  
 10672  func Xsqlite3_bind_int(tls *crt.TLS, _p unsafe.Pointer, _i int32, _iValue int32) (r0 int32) {
 10673  	return Xsqlite3_bind_int64(tls, _p, _i, int64(_iValue))
 10674  }
 10675  
 10676  func Xsqlite3_bind_int64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _iValue int64) (r0 int32) {
 10677  	var _rc int32
 10678  	var _p *TVdbe
 10679  	_p = (*TVdbe)(_pStmt)
 10680  	_rc = _vdbeUnbind(tls, _p, _i)
 10681  	if _rc == int32(0) {
 10682  		_sqlite3VdbeMemSetInt64(tls, elem25((*XMem)(_p.XaVar), uintptr(_i-int32(1))), _iValue)
 10683  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10684  	}
 10685  	return _rc
 10686  }
 10687  
 10688  // C comment
 10689  //  /*
 10690  //  ** Delete any previous value and set the value stored in *pMem to val,
 10691  //  ** manifest type INTEGER.
 10692  //  */
 10693  func _sqlite3VdbeMemSetInt64(tls *crt.TLS, _pMem *XMem, _val int64) {
 10694  	if (int32(_pMem.Xflags) & int32(9312)) != int32(0) {
 10695  		_vdbeReleaseAndSetInt64(tls, _pMem, _val)
 10696  		goto _1
 10697  	}
 10698  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = _val
 10699  	_pMem.Xflags = uint16(4)
 10700  _1:
 10701  }
 10702  
 10703  // C comment
 10704  //  /*
 10705  //  ** The pMem is known to contain content that needs to be destroyed prior
 10706  //  ** to a value change.  So invoke the destructor, then set the value to
 10707  //  ** a 64-bit integer.
 10708  //  */
 10709  func _vdbeReleaseAndSetInt64(tls *crt.TLS, _pMem *XMem, _val int64) {
 10710  	_sqlite3VdbeMemSetNull(tls, _pMem)
 10711  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = _val
 10712  	_pMem.Xflags = uint16(4)
 10713  }
 10714  
 10715  func Xsqlite3_bind_null(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
 10716  	var _rc int32
 10717  	var _p *TVdbe
 10718  	_p = (*TVdbe)(_pStmt)
 10719  	_rc = _vdbeUnbind(tls, _p, _i)
 10720  	if _rc == int32(0) {
 10721  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10722  	}
 10723  	return _rc
 10724  }
 10725  
 10726  // C comment
 10727  //  /*
 10728  //  ** Return the number of wildcards that can be potentially bound to.
 10729  //  ** This routine is added to support DBD::SQLite.
 10730  //  */
 10731  func Xsqlite3_bind_parameter_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 10732  	var _p *TVdbe
 10733  	_p = (*TVdbe)(_pStmt)
 10734  	return func() int32 {
 10735  		if _p != nil {
 10736  			return int32(_p.XnVar)
 10737  		}
 10738  		return int32(0)
 10739  	}()
 10740  }
 10741  
 10742  // C comment
 10743  //  /*
 10744  //  ** CAPI3REF: Index Of A Parameter With A Given Name
 10745  //  ** METHOD: sqlite3_stmt
 10746  //  **
 10747  //  ** ^Return the index of an SQL parameter given its name.  ^The
 10748  //  ** index value returned is suitable for use as the second
 10749  //  ** parameter to [sqlite3_bind_blob|sqlite3_bind()].  ^A zero
 10750  //  ** is returned if no matching parameter is found.  ^The parameter
 10751  //  ** name must be given in UTF-8 even if the original statement
 10752  //  ** was prepared from UTF-16 text using [sqlite3_prepare16_v2()].
 10753  //  **
 10754  //  ** See also: [sqlite3_bind_blob|sqlite3_bind()],
 10755  //  ** [sqlite3_bind_parameter_count()], and
 10756  //  ** [sqlite3_bind_parameter_name()].
 10757  //  */
 10758  func Xsqlite3_bind_parameter_index(tls *crt.TLS, _pStmt unsafe.Pointer, _zName *int8) (r0 int32) {
 10759  	return _sqlite3VdbeParameterIndex(tls, (*TVdbe)(_pStmt), _zName, _sqlite3Strlen30(tls, _zName))
 10760  }
 10761  
 10762  // C comment
 10763  //  /*
 10764  //  ** Given a wildcard parameter name, return the index of the variable
 10765  //  ** with that name.  If there is no variable with the given name,
 10766  //  ** return 0.
 10767  //  */
 10768  func _sqlite3VdbeParameterIndex(tls *crt.TLS, _p *TVdbe, _zName *int8, _nName int32) (r0 int32) {
 10769  	if (_p == nil) || (_zName == nil) {
 10770  		return int32(0)
 10771  	}
 10772  	return _sqlite3VListNameToNum(tls, _p.XpVList, _zName, _nName)
 10773  }
 10774  
 10775  // C comment
 10776  //  /*
 10777  //  ** Return the number of the variable named zName, if it is in VList.
 10778  //  ** or return 0 if there is no such variable.
 10779  //  */
 10780  func _sqlite3VListNameToNum(tls *crt.TLS, _pIn *int32, _zName *int8, _nName int32) (r0 int32) {
 10781  	var _i, _mx int32
 10782  	var _1_z *int8
 10783  	if _pIn == nil {
 10784  		return int32(0)
 10785  	}
 10786  	_mx = *elem8(_pIn, uintptr(1))
 10787  	_i = int32(2)
 10788  _1:
 10789  	_1_z = (*int8)(unsafe.Pointer(elem8(_pIn, uintptr(_i+int32(2)))))
 10790  	if (crt.Xstrncmp(tls, _1_z, _zName, uint64(_nName)) == int32(0)) && (int32(*elem1(_1_z, uintptr(_nName))) == int32(0)) {
 10791  		return *elem8(_pIn, uintptr(_i))
 10792  	}
 10793  	_i += *elem8(_pIn, uintptr(_i+int32(1)))
 10794  	if _i < _mx {
 10795  		goto _1
 10796  	}
 10797  	return int32(0)
 10798  }
 10799  
 10800  // C comment
 10801  //  /*
 10802  //  ** Return the name of a wildcard parameter.  Return NULL if the index
 10803  //  ** is out of range or if the wildcard is unnamed.
 10804  //  **
 10805  //  ** The result is always UTF-8.
 10806  //  */
 10807  func Xsqlite3_bind_parameter_name(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *int8) {
 10808  	var _p *TVdbe
 10809  	_p = (*TVdbe)(_pStmt)
 10810  	if _p == nil {
 10811  		return nil
 10812  	}
 10813  	return _sqlite3VListNumToName(tls, _p.XpVList, _i)
 10814  }
 10815  
 10816  // C comment
 10817  //  /*
 10818  //  ** Return a pointer to the name of a variable in the given VList that
 10819  //  ** has the value iVal.  Or return a NULL if there is no such variable in
 10820  //  ** the list
 10821  //  */
 10822  func _sqlite3VListNumToName(tls *crt.TLS, _pIn *int32, _iVal int32) (r0 *int8) {
 10823  	var _i, _mx int32
 10824  	if _pIn == nil {
 10825  		return nil
 10826  	}
 10827  	_mx = *elem8(_pIn, uintptr(1))
 10828  	_i = int32(2)
 10829  _1:
 10830  	if (*elem8(_pIn, uintptr(_i))) == _iVal {
 10831  		return (*int8)(unsafe.Pointer(elem8(_pIn, uintptr(_i+int32(2)))))
 10832  	}
 10833  	_i += *elem8(_pIn, uintptr(_i+int32(1)))
 10834  	if _i < _mx {
 10835  		goto _1
 10836  	}
 10837  	return nil
 10838  }
 10839  
 10840  func Xsqlite3_bind_text(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData *int8, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 10841  	return _bindText(tls, _pStmt, _i, unsafe.Pointer(_zData), _nData, _xDel, uint8(1))
 10842  }
 10843  
 10844  func Xsqlite3_bind_text16(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 10845  	return _bindText(tls, _pStmt, _i, _zData, _nData, _xDel, uint8(2))
 10846  }
 10847  
 10848  // C comment
 10849  //  /* SQLITE_OMIT_UTF16 */
 10850  func Xsqlite3_bind_value(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _pValue *XMem) (r0 int32) {
 10851  	var _rc int32
 10852  	switch Xsqlite3_value_type(tls, _pValue) {
 10853  	case int32(1):
 10854  		goto _1
 10855  	case int32(2):
 10856  		goto _2
 10857  	case int32(3):
 10858  		goto _4
 10859  	case int32(4):
 10860  		goto _3
 10861  	default:
 10862  		goto _5
 10863  	}
 10864  
 10865  _1:
 10866  	_rc = Xsqlite3_bind_int64(tls, _pStmt, _i, *(*int64)(unsafe.Pointer(&_pValue.Xu)))
 10867  	goto _6
 10868  _2:
 10869  	_rc = Xsqlite3_bind_double(tls, _pStmt, _i, *(*float64)(unsafe.Pointer(&_pValue.Xu)))
 10870  	goto _6
 10871  _3:
 10872  	if (int32(_pValue.Xflags) & int32(16384)) != 0 {
 10873  		_rc = Xsqlite3_bind_zeroblob(tls, _pStmt, _i, *(*int32)(unsafe.Pointer(&_pValue.Xu)))
 10874  		goto _8
 10875  	}
 10876  	_rc = Xsqlite3_bind_blob(tls, _pStmt, _i, unsafe.Pointer(_pValue.Xz), _pValue.Xn, func() func(*crt.TLS, unsafe.Pointer) {
 10877  		v := uint64(18446744073709551615)
 10878  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 10879  	}())
 10880  _8:
 10881  	goto _6
 10882  _4:
 10883  	_rc = _bindText(tls, _pStmt, _i, unsafe.Pointer(_pValue.Xz), _pValue.Xn, func() func(*crt.TLS, unsafe.Pointer) {
 10884  		v := uint64(18446744073709551615)
 10885  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 10886  	}(), _pValue.Xenc)
 10887  	goto _6
 10888  _5:
 10889  	_rc = Xsqlite3_bind_null(tls, _pStmt, _i)
 10890  	goto _6
 10891  _6:
 10892  	return _rc
 10893  }
 10894  
 10895  func Xsqlite3_bind_zeroblob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _n int32) (r0 int32) {
 10896  	var _rc int32
 10897  	var _p *TVdbe
 10898  	_p = (*TVdbe)(_pStmt)
 10899  	_rc = _vdbeUnbind(tls, _p, _i)
 10900  	if _rc == int32(0) {
 10901  		_sqlite3VdbeMemSetZeroBlob(tls, elem25((*XMem)(_p.XaVar), uintptr(_i-int32(1))), _n)
 10902  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10903  	}
 10904  	return _rc
 10905  }
 10906  
 10907  // C comment
 10908  //  /*
 10909  //  ** Delete any previous value and set the value to be a BLOB of length
 10910  //  ** n containing all zeros.
 10911  //  */
 10912  func _sqlite3VdbeMemSetZeroBlob(tls *crt.TLS, _pMem *XMem, _n int32) {
 10913  	_sqlite3VdbeMemRelease(tls, _pMem)
 10914  	_pMem.Xflags = uint16(16400)
 10915  	_pMem.Xn = int32(0)
 10916  	if _n < int32(0) {
 10917  		_n = int32(0)
 10918  	}
 10919  	*(*int32)(unsafe.Pointer(&_pMem.Xu)) = _n
 10920  	_pMem.Xenc = uint8(1)
 10921  	_pMem.Xz = nil
 10922  }
 10923  
 10924  // C comment
 10925  //  /*
 10926  //  ** This routine sets the busy callback for an Sqlite database to the
 10927  //  ** given callback function with the given argument.
 10928  //  */
 10929  func Xsqlite3_busy_handler(tls *crt.TLS, _db *Xsqlite3, _xBusy func(*crt.TLS, unsafe.Pointer, int32) int32, _pArg unsafe.Pointer) (r0 int32) {
 10930  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 10931  		return _sqlite3MisuseError(tls, int32(141988))
 10932  	}
 10933  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 10934  	_db.XbusyHandler.XxFunc = _xBusy
 10935  	_db.XbusyHandler.XpArg = _pArg
 10936  	_db.XbusyHandler.XnBusy = int32(0)
 10937  	_db.XbusyTimeout = int32(0)
 10938  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 10939  	return int32(0)
 10940  }
 10941  
 10942  // C comment
 10943  //  /*
 10944  //  ** Check to make sure we have a valid db pointer.  This test is not
 10945  //  ** foolproof but it does provide some measure of protection against
 10946  //  ** misuse of the interface such as passing in db pointers that are
 10947  //  ** NULL or which have been previously closed.  If this routine returns
 10948  //  ** 1 it means that the db pointer is valid and 0 if it should not be
 10949  //  ** dereferenced for any reason.  The calling function should invoke
 10950  //  ** SQLITE_MISUSE immediately.
 10951  //  **
 10952  //  ** sqlite3SafetyCheckOk() requires that the db pointer be valid for
 10953  //  ** use.  sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to
 10954  //  ** open properly and is not fit for general use but which can be
 10955  //  ** used as an argument to sqlite3_errmsg() or sqlite3_close().
 10956  //  */
 10957  func _sqlite3SafetyCheckOk(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 10958  	var _magic uint32
 10959  	if _db == nil {
 10960  		_logBadConnection(tls, str(285))
 10961  		return int32(0)
 10962  	}
 10963  	_magic = _db.Xmagic
 10964  	if _magic == uint32(2687084183) {
 10965  		goto _1
 10966  	}
 10967  	if _sqlite3SafetyCheckSickOrOk(tls, _db) != 0 {
 10968  		_logBadConnection(tls, str(8512))
 10969  	}
 10970  	return int32(0)
 10971  
 10972  _1:
 10973  	return int32(1)
 10974  }
 10975  
 10976  // C comment
 10977  //  /*
 10978  //  ** Log an error that is an API call on a connection pointer that should
 10979  //  ** not have been used.  The "type" of connection pointer is given as the
 10980  //  ** argument.  The zType is a word like "NULL" or "closed" or "invalid".
 10981  //  */
 10982  func _logBadConnection(tls *crt.TLS, _zType *int8) {
 10983  	Xsqlite3_log(tls, int32(21), str(8521), unsafe.Pointer(_zType))
 10984  }
 10985  
 10986  func _sqlite3SafetyCheckSickOrOk(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 10987  	var _magic uint32
 10988  	_magic = _db.Xmagic
 10989  	if ((_magic != uint32(1266094736)) && (_magic != uint32(2687084183))) && (_magic != uint32(4030429446)) {
 10990  		_logBadConnection(tls, str(8566))
 10991  		return int32(0)
 10992  	}
 10993  	return int32(1)
 10994  }
 10995  
 10996  // C comment
 10997  //  /*
 10998  //  ** This routine installs a default busy handler that waits for the
 10999  //  ** specified number of milliseconds before returning 0.
 11000  //  */
 11001  func Xsqlite3_busy_timeout(tls *crt.TLS, _db *Xsqlite3, _ms int32) (r0 int32) {
 11002  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 11003  		return _sqlite3MisuseError(tls, int32(142038))
 11004  	}
 11005  	if _ms > int32(0) {
 11006  		Xsqlite3_busy_handler(tls, _db, _sqliteDefaultBusyCallback, unsafe.Pointer(_db))
 11007  		_db.XbusyTimeout = _ms
 11008  		goto _2
 11009  	}
 11010  	Xsqlite3_busy_handler(tls, _db, nil, nil)
 11011  _2:
 11012  	return int32(0)
 11013  }
 11014  
 11015  // C comment
 11016  //  /*
 11017  //  ** This routine implements a busy callback that sleeps and tries
 11018  //  ** again until a timeout value is reached.  The timeout value is
 11019  //  ** an integer number of milliseconds passed in as the first
 11020  //  ** argument.
 11021  //  */
 11022  func _sqliteDefaultBusyCallback(tls *crt.TLS, _ptr unsafe.Pointer, _count int32) (r0 int32) {
 11023  	var _timeout, _delay, _prior int32
 11024  	var _db *Xsqlite3
 11025  	_db = (*Xsqlite3)(_ptr)
 11026  	_timeout = _db.XbusyTimeout
 11027  	func() {
 11028  		if _count < int32(0) {
 11029  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141934), unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00__func__Ø000), unsafe.Pointer(str(8574)))
 11030  			crt.X__builtin_abort(tls)
 11031  		}
 11032  	}()
 11033  	if _count < int32(12) {
 11034  		_delay = int32(*elem15((*uint8)(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00delaysØ001)), uintptr(_count)))
 11035  		_prior = int32(*elem15((*uint8)(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00totalsØ002)), uintptr(_count)))
 11036  		goto _3
 11037  	}
 11038  	_delay = int32(*elem15((*uint8)(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00delaysØ001)), uintptr(11)))
 11039  	_prior = int32(*elem15((*uint8)(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00totalsØ002)), uintptr(11))) + (_delay * (_count - int32(11)))
 11040  _3:
 11041  	if (_prior + _delay) <= _timeout {
 11042  		goto _4
 11043  	}
 11044  	_delay = _timeout - _prior
 11045  	if _delay <= int32(0) {
 11046  		return int32(0)
 11047  	}
 11048  _4:
 11049  	_sqlite3OsSleep(tls, (*Xsqlite3_vfs)(_db.XpVfs), _delay*int32(1000))
 11050  	return int32(1)
 11051  }
 11052  
 11053  var _sqliteDefaultBusyCallbackØ00__func__Ø000 [26]int8
 11054  
 11055  func init() {
 11056  	crt.Xstrncpy(nil, &_sqliteDefaultBusyCallbackØ00__func__Ø000[0], str(8583), 26)
 11057  }
 11058  
 11059  var _sqliteDefaultBusyCallbackØ00delaysØ001 [12]uint8
 11060  
 11061  func init() {
 11062  	_sqliteDefaultBusyCallbackØ00delaysØ001 = [12]uint8{1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100}
 11063  }
 11064  
 11065  var _sqliteDefaultBusyCallbackØ00totalsØ002 [12]uint8
 11066  
 11067  func init() {
 11068  	_sqliteDefaultBusyCallbackØ00totalsØ002 = [12]uint8{0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228}
 11069  }
 11070  
 11071  func _sqlite3OsSleep(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nMicro int32) (r0 int32) {
 11072  	return func() func(*crt.TLS, *Xsqlite3_vfs, int32) int32 {
 11073  		v := _pVfs.XxSleep
 11074  		return *(*func(*crt.TLS, *Xsqlite3_vfs, int32) int32)(unsafe.Pointer(&v))
 11075  	}()(tls, _pVfs, _nMicro)
 11076  }
 11077  
 11078  // C comment
 11079  //  /*
 11080  //  ** Return the number of changes in the most recent call to sqlite3_exec().
 11081  //  */
 11082  func Xsqlite3_changes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 11083  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 11084  		_sqlite3MisuseError(tls, int32(141413))
 11085  		return int32(0)
 11086  	}
 11087  	return _db.XnChange
 11088  }
 11089  
 11090  // C comment
 11091  //  /*
 11092  //  ** Two variations on the public interface for closing a database
 11093  //  ** connection. The sqlite3_close() version returns SQLITE_BUSY and
 11094  //  ** leaves the connection option if there are unfinalized prepared
 11095  //  ** statements or unfinished sqlite3_backups.  The sqlite3_close_v2()
 11096  //  ** version forces the connection to become a zombie if there are
 11097  //  ** unclosed resources, and arranges for deallocation when the last
 11098  //  ** prepare statement or sqlite3_backup closes.
 11099  //  */
 11100  func Xsqlite3_close(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 11101  	return _sqlite3Close(tls, _db, int32(0))
 11102  }
 11103  
 11104  // C comment
 11105  //  /*
 11106  //  ** Close an existing SQLite database
 11107  //  */
 11108  func _sqlite3Close(tls *crt.TLS, _db *Xsqlite3, _forceZombie int32) (r0 int32) {
 11109  	if _db == nil {
 11110  		return int32(0)
 11111  	}
 11112  	if _sqlite3SafetyCheckSickOrOk(tls, _db) == 0 {
 11113  		return _sqlite3MisuseError(tls, int32(141522))
 11114  	}
 11115  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 11116  	if (int32(_db.XmTrace) & int32(8)) != 0 {
 11117  		_db.XxTrace(tls, uint32(8), _db.XpTraceArg, unsafe.Pointer(_db), nil)
 11118  	}
 11119  	_disconnectAllVtab(tls, _db)
 11120  	_sqlite3VtabRollback(tls, _db)
 11121  	if (_forceZombie == 0) && _connectionIsBusy(tls, _db) != 0 {
 11122  		_sqlite3ErrorWithMsg(tls, _db, int32(5), str(8609))
 11123  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 11124  		return int32(5)
 11125  	}
 11126  	_db.Xmagic = uint32(1691352191)
 11127  	_sqlite3LeaveMutexAndCloseZombie(tls, _db)
 11128  	return int32(0)
 11129  }
 11130  
 11131  // C comment
 11132  //  /*
 11133  //  ** Disconnect all sqlite3_vtab objects that belong to database connection
 11134  //  ** db. This is called when db is being closed.
 11135  //  */
 11136  func _disconnectAllVtab(tls *crt.TLS, _db *Xsqlite3) {
 11137  	var _i int32
 11138  	var _1_pSchema *XSchema
 11139  	var _p *XHashElem
 11140  	var _3_pTab *XTable
 11141  	var _4_pMod *XModule
 11142  	_sqlite3BtreeEnterAll(tls, _db)
 11143  	_i = int32(0)
 11144  _0:
 11145  	if _i >= _db.XnDb {
 11146  		goto _3
 11147  	}
 11148  	_1_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpSchema)
 11149  	if (elem27((*XDb)(_db.XaDb), uintptr(_i)).XpSchema) == nil {
 11150  		goto _4
 11151  	}
 11152  	_p = (*XHashElem)(_1_pSchema.XtblHash.Xfirst)
 11153  _5:
 11154  	if _p == nil {
 11155  		goto _8
 11156  	}
 11157  	_3_pTab = (*XTable)(_p.Xdata)
 11158  	if _3_pTab.XnModuleArg != 0 {
 11159  		_sqlite3VtabDisconnect(tls, _db, _3_pTab)
 11160  	}
 11161  	_p = (*XHashElem)(_p.Xnext)
 11162  	goto _5
 11163  _8:
 11164  _4:
 11165  	_i += 1
 11166  	goto _0
 11167  _3:
 11168  	_p = (*XHashElem)(_db.XaModule.Xfirst)
 11169  _10:
 11170  	if _p == nil {
 11171  		goto _13
 11172  	}
 11173  	_4_pMod = (*XModule)(_p.Xdata)
 11174  	if _4_pMod.XpEpoTab != nil {
 11175  		_sqlite3VtabDisconnect(tls, _db, (*XTable)(_4_pMod.XpEpoTab))
 11176  	}
 11177  	_p = (*XHashElem)(_p.Xnext)
 11178  	goto _10
 11179  _13:
 11180  	_sqlite3VtabUnlockList(tls, _db)
 11181  	_sqlite3BtreeLeaveAll(tls, _db)
 11182  }
 11183  
 11184  func _sqlite3BtreeEnterAll(tls *crt.TLS, _db *Xsqlite3) {
 11185  	if int32(_db.XskipBtreeMutex) == int32(0) {
 11186  		_btreeEnterAll(tls, _db)
 11187  	}
 11188  }
 11189  
 11190  // C comment
 11191  //  /*
 11192  //  ** Enter the mutex on every Btree associated with a database
 11193  //  ** connection.  This is needed (for example) prior to parsing
 11194  //  ** a statement since we will be comparing table and column names
 11195  //  ** against all schemas and we do not want those schemas being
 11196  //  ** reset out from under us.
 11197  //  **
 11198  //  ** There is a corresponding leave-all procedures.
 11199  //  **
 11200  //  ** Enter the mutexes in accending order by BtShared pointer address
 11201  //  ** to avoid the possibility of deadlock when two threads with
 11202  //  ** two or more btrees in common both try to lock all their btrees
 11203  //  ** at the same instant.
 11204  //  */
 11205  func _btreeEnterAll(tls *crt.TLS, _db *Xsqlite3) {
 11206  	var _i, _skipOk int32
 11207  	var _p *XBtree
 11208  	_skipOk = int32(1)
 11209  	func() {
 11210  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11211  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58913), unsafe.Pointer(&_btreeEnterAllØ00__func__Ø000), unsafe.Pointer(str(881)))
 11212  			crt.X__builtin_abort(tls)
 11213  		}
 11214  	}()
 11215  	_i = int32(0)
 11216  _2:
 11217  	if _i >= _db.XnDb {
 11218  		goto _5
 11219  	}
 11220  	_p = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 11221  	if (_p != nil) && (_p.Xsharable != 0) {
 11222  		_sqlite3BtreeEnter(tls, _p)
 11223  		_skipOk = int32(0)
 11224  	}
 11225  	_i += 1
 11226  	goto _2
 11227  _5:
 11228  	_db.XskipBtreeMutex = uint8(_skipOk)
 11229  }
 11230  
 11231  var _btreeEnterAllØ00__func__Ø000 [14]int8
 11232  
 11233  func init() {
 11234  	crt.Xstrncpy(nil, &_btreeEnterAllØ00__func__Ø000[0], str(8677), 14)
 11235  }
 11236  
 11237  // C comment
 11238  //  /*
 11239  //  ** Enter a mutex on the given BTree object.
 11240  //  **
 11241  //  ** If the object is not sharable, then no mutex is ever required
 11242  //  ** and this routine is a no-op.  The underlying mutex is non-recursive.
 11243  //  ** But we keep a reference count in Btree.wantToLock so the behavior
 11244  //  ** of this interface is recursive.
 11245  //  **
 11246  //  ** To avoid deadlocks, multiple Btrees are locked in the same order
 11247  //  ** by all database connections.  The p->pNext is a list of other
 11248  //  ** Btrees belonging to the same database connection as the p Btree
 11249  //  ** which need to be locked after p.  If we cannot get a lock on
 11250  //  ** p, then first unlock all of the others on p->pNext, then wait
 11251  //  ** for the lock to become available on p, then relock all of the
 11252  //  ** subsequent Btrees that desire a lock.
 11253  //  */
 11254  func _sqlite3BtreeEnter(tls *crt.TLS, _p *XBtree) {
 11255  	func() {
 11256  		if (*XBtree)(_p.XpNext) != nil && crt.P2U((*XBtree)(_p.XpNext).XpBt) <= crt.P2U(_p.XpBt) {
 11257  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58799), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8691)))
 11258  			crt.X__builtin_abort(tls)
 11259  		}
 11260  	}()
 11261  	func() {
 11262  		if (*XBtree)(_p.XpPrev) != nil && crt.P2U((*XBtree)(_p.XpPrev).XpBt) >= crt.P2U(_p.XpBt) {
 11263  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58800), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8727)))
 11264  			crt.X__builtin_abort(tls)
 11265  		}
 11266  	}()
 11267  	func() {
 11268  		if (*XBtree)(_p.XpNext) != nil && (*Xsqlite3)((*XBtree)(_p.XpNext).Xdb) != (*Xsqlite3)(_p.Xdb) {
 11269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58801), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8763)))
 11270  			crt.X__builtin_abort(tls)
 11271  		}
 11272  	}()
 11273  	func() {
 11274  		if (*XBtree)(_p.XpPrev) != nil && (*Xsqlite3)((*XBtree)(_p.XpPrev).Xdb) != (*Xsqlite3)(_p.Xdb) {
 11275  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58802), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8798)))
 11276  			crt.X__builtin_abort(tls)
 11277  		}
 11278  	}()
 11279  	func() {
 11280  		if _p.Xsharable == 0 && ((*XBtree)(_p.XpNext) != nil || (*XBtree)(_p.XpPrev) != nil) {
 11281  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58803), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8833)))
 11282  			crt.X__builtin_abort(tls)
 11283  		}
 11284  	}()
 11285  	func() {
 11286  		if _p.Xlocked != 0 && _p.XwantToLock <= int32(0) {
 11287  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58806), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8877)))
 11288  			crt.X__builtin_abort(tls)
 11289  		}
 11290  	}()
 11291  	func() {
 11292  		if _p.Xsharable == 0 && _p.XwantToLock != int32(0) {
 11293  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58807), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8907)))
 11294  			crt.X__builtin_abort(tls)
 11295  		}
 11296  	}()
 11297  	func() {
 11298  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 11299  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58810), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8939)))
 11300  			crt.X__builtin_abort(tls)
 11301  		}
 11302  	}()
 11303  	func() {
 11304  		if (int32(_p.Xlocked) != int32(0) || _p.Xsharable == 0) && (*Xsqlite3)((*XBtShared)(_p.XpBt).Xdb) != (*Xsqlite3)(_p.Xdb) {
 11305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58814), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8972)))
 11306  			crt.X__builtin_abort(tls)
 11307  		}
 11308  	}()
 11309  	if _p.Xsharable == 0 {
 11310  		return
 11311  	}
 11312  	_p.XwantToLock += 1
 11313  	if _p.Xlocked != 0 {
 11314  		return
 11315  	}
 11316  	_btreeLockCarefully(tls, _p)
 11317  }
 11318  
 11319  var _sqlite3BtreeEnterØ00__func__Ø000 [18]int8
 11320  
 11321  func init() {
 11322  	crt.Xstrncpy(nil, &_sqlite3BtreeEnterØ00__func__Ø000[0], str(9023), 18)
 11323  }
 11324  
 11325  // C comment
 11326  //  /* This is a helper function for sqlite3BtreeLock(). By moving
 11327  //  ** complex, but seldom used logic, out of sqlite3BtreeLock() and
 11328  //  ** into this routine, we avoid unnecessary stack pointer changes
 11329  //  ** and thus help the sqlite3BtreeLock() routine to run much faster
 11330  //  ** in the common case.
 11331  //  */
 11332  func _btreeLockCarefully(tls *crt.TLS, _p *XBtree) {
 11333  	var _pLater *XBtree
 11334  	if Xsqlite3_mutex_try(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex)) == int32(0) {
 11335  		*(**Xsqlite3)(unsafe.Pointer(&((*XBtShared)(_p.XpBt).Xdb))) = (*Xsqlite3)(_p.Xdb)
 11336  		_p.Xlocked = uint8(1)
 11337  		return
 11338  	}
 11339  	_pLater = (*XBtree)(_p.XpNext)
 11340  _1:
 11341  	if _pLater == nil {
 11342  		goto _4
 11343  	}
 11344  	func() {
 11345  		if _pLater.Xsharable == 0 {
 11346  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58847), unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000), unsafe.Pointer(str(9041)))
 11347  			crt.X__builtin_abort(tls)
 11348  		}
 11349  	}()
 11350  	func() {
 11351  		if (*XBtree)(_pLater.XpNext) != nil && crt.P2U((*XBtree)(_pLater.XpNext).XpBt) <= crt.P2U(_pLater.XpBt) {
 11352  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58848), unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000), unsafe.Pointer(str(9058)))
 11353  			crt.X__builtin_abort(tls)
 11354  		}
 11355  	}()
 11356  	func() {
 11357  		if _pLater.Xlocked != 0 && _pLater.XwantToLock <= int32(0) {
 11358  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58849), unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000), unsafe.Pointer(str(9109)))
 11359  			crt.X__builtin_abort(tls)
 11360  		}
 11361  	}()
 11362  	if _pLater.Xlocked != 0 {
 11363  		_unlockBtreeMutex(tls, _pLater)
 11364  	}
 11365  	_pLater = (*XBtree)(_pLater.XpNext)
 11366  	goto _1
 11367  _4:
 11368  	_lockBtreeMutex(tls, _p)
 11369  	_pLater = (*XBtree)(_p.XpNext)
 11370  _14:
 11371  	if _pLater == nil {
 11372  		goto _17
 11373  	}
 11374  	if _pLater.XwantToLock != 0 {
 11375  		_lockBtreeMutex(tls, _pLater)
 11376  	}
 11377  	_pLater = (*XBtree)(_pLater.XpNext)
 11378  	goto _14
 11379  _17:
 11380  }
 11381  
 11382  // C comment
 11383  //  /*
 11384  //  ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
 11385  //  ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
 11386  //  */
 11387  func Xsqlite3_mutex_try(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
 11388  	var _rc int32
 11389  	_rc = int32(0)
 11390  	if _p != nil {
 11391  		func() {
 11392  			if (_sqlite3Config.Xmutex.XxMutexTry) == nil {
 11393  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22877), unsafe.Pointer(&_sqlite3_mutex_tryØ00__func__Ø000), unsafe.Pointer(str(9149)))
 11394  				crt.X__builtin_abort(tls)
 11395  			}
 11396  		}()
 11397  		return func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
 11398  			v := _sqlite3Config.Xmutex.XxMutexTry
 11399  			return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
 11400  		}()(tls, _p)
 11401  	}
 11402  	return _rc
 11403  }
 11404  
 11405  var _sqlite3_mutex_tryØ00__func__Ø000 [18]int8
 11406  
 11407  func init() {
 11408  	crt.Xstrncpy(nil, &_sqlite3_mutex_tryØ00__func__Ø000[0], str(9185), 18)
 11409  }
 11410  
 11411  var _btreeLockCarefullyØ00__func__Ø000 [19]int8
 11412  
 11413  func init() {
 11414  	crt.Xstrncpy(nil, &_btreeLockCarefullyØ00__func__Ø000[0], str(9203), 19)
 11415  }
 11416  
 11417  // C comment
 11418  //  /*
 11419  //  ** Release the BtShared mutex associated with B-Tree handle p and
 11420  //  ** clear the p->locked boolean.
 11421  //  */
 11422  func _unlockBtreeMutex(tls *crt.TLS, _p *XBtree) {
 11423  	var _pBt *XBtShared
 11424  	_pBt = (*XBtShared)(_p.XpBt)
 11425  	func() {
 11426  		if int32(_p.Xlocked) != int32(1) {
 11427  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58766), unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(9222)))
 11428  			crt.X__builtin_abort(tls)
 11429  		}
 11430  	}()
 11431  	func() {
 11432  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 11433  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58767), unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(9235)))
 11434  			crt.X__builtin_abort(tls)
 11435  		}
 11436  	}()
 11437  	func() {
 11438  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 11439  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58768), unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(8939)))
 11440  			crt.X__builtin_abort(tls)
 11441  		}
 11442  	}()
 11443  	func() {
 11444  		if (*Xsqlite3)(_p.Xdb) != (*Xsqlite3)(_pBt.Xdb) {
 11445  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58769), unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(9266)))
 11446  			crt.X__builtin_abort(tls)
 11447  		}
 11448  	}()
 11449  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pBt.Xmutex))
 11450  	_p.Xlocked = 0
 11451  }
 11452  
 11453  var _unlockBtreeMutexØ00__func__Ø000 [17]int8
 11454  
 11455  func init() {
 11456  	crt.Xstrncpy(nil, &_unlockBtreeMutexØ00__func__Ø000[0], str(9281), 17)
 11457  }
 11458  
 11459  // C comment
 11460  //  /*
 11461  //  ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
 11462  //  ** set BtShared.db to the database handle associated with p and the
 11463  //  ** p->locked boolean to true.
 11464  //  */
 11465  func _lockBtreeMutex(tls *crt.TLS, _p *XBtree) {
 11466  	func() {
 11467  		if int32(_p.Xlocked) != int32(0) {
 11468  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58751), unsafe.Pointer(&_lockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(9298)))
 11469  			crt.X__builtin_abort(tls)
 11470  		}
 11471  	}()
 11472  	func() {
 11473  		if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex)) == 0 {
 11474  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58752), unsafe.Pointer(&_lockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(9311)))
 11475  			crt.X__builtin_abort(tls)
 11476  		}
 11477  	}()
 11478  	func() {
 11479  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 11480  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58753), unsafe.Pointer(&_lockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(8939)))
 11481  			crt.X__builtin_abort(tls)
 11482  		}
 11483  	}()
 11484  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex))
 11485  	*(**Xsqlite3)(unsafe.Pointer(&((*XBtShared)(_p.XpBt).Xdb))) = (*Xsqlite3)(_p.Xdb)
 11486  	_p.Xlocked = uint8(1)
 11487  }
 11488  
 11489  var _lockBtreeMutexØ00__func__Ø000 [15]int8
 11490  
 11491  func init() {
 11492  	crt.Xstrncpy(nil, &_lockBtreeMutexØ00__func__Ø000[0], str(9348), 15)
 11493  }
 11494  
 11495  // C comment
 11496  //  /*
 11497  //  ** Table *p is a virtual table. This function removes the VTable object
 11498  //  ** for table *p associated with database connection db from the linked
 11499  //  ** list in p->pVTab. It also decrements the VTable ref count. This is
 11500  //  ** used when closing database connection db to free all of its VTable
 11501  //  ** objects without disturbing the rest of the Schema object (which may
 11502  //  ** be being used by other shared-cache connections).
 11503  //  */
 11504  func _sqlite3VtabDisconnect(tls *crt.TLS, _db *Xsqlite3, _p *XTable) {
 11505  	var _2_pVTab *XVTable
 11506  	var _ppVTab **XVTable
 11507  	func() {
 11508  		if _p.XnModuleArg == 0 {
 11509  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125207), unsafe.Pointer(&_sqlite3VtabDisconnectØ00__func__Ø000), unsafe.Pointer(str(9363)))
 11510  			crt.X__builtin_abort(tls)
 11511  		}
 11512  	}()
 11513  	func() {
 11514  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
 11515  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125208), unsafe.Pointer(&_sqlite3VtabDisconnectØ00__func__Ø000), unsafe.Pointer(str(9376)))
 11516  			crt.X__builtin_abort(tls)
 11517  		}
 11518  	}()
 11519  	func() {
 11520  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11521  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125209), unsafe.Pointer(&_sqlite3VtabDisconnectØ00__func__Ø000), unsafe.Pointer(str(881)))
 11522  			crt.X__builtin_abort(tls)
 11523  		}
 11524  	}()
 11525  	_ppVTab = (**XVTable)(unsafe.Pointer(&_p.XpVTable))
 11526  _6:
 11527  	if (*_ppVTab) == nil {
 11528  		goto _9
 11529  	}
 11530  	if (*Xsqlite3)((*_ppVTab).Xdb) == _db {
 11531  		_2_pVTab = *_ppVTab
 11532  		*_ppVTab = (*XVTable)(_2_pVTab.XpNext)
 11533  		_sqlite3VtabUnlock(tls, _2_pVTab)
 11534  		goto _9
 11535  	}
 11536  	_ppVTab = (**XVTable)(unsafe.Pointer(&((*_ppVTab).XpNext)))
 11537  	goto _6
 11538  _9:
 11539  }
 11540  
 11541  var _sqlite3VtabDisconnectØ00__func__Ø000 [22]int8
 11542  
 11543  func init() {
 11544  	crt.Xstrncpy(nil, &_sqlite3VtabDisconnectØ00__func__Ø000[0], str(9408), 22)
 11545  }
 11546  
 11547  // C comment
 11548  //  /*
 11549  //  ** Return true if the current thread holds the database connection
 11550  //  ** mutex and all required BtShared mutexes.
 11551  //  **
 11552  //  ** This routine is used inside assert() statements only.
 11553  //  */
 11554  func _sqlite3BtreeHoldsAllMutexes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 11555  	var _i int32
 11556  	var _2_p *XBtree
 11557  	if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11558  		return int32(0)
 11559  	}
 11560  	_i = int32(0)
 11561  _1:
 11562  	if _i >= _db.XnDb {
 11563  		goto _4
 11564  	}
 11565  	_2_p = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 11566  	if ((_2_p != nil) && (_2_p.Xsharable != 0)) && ((_2_p.XwantToLock == int32(0)) || (Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_2_p.XpBt).Xmutex)) == 0)) {
 11567  		return int32(0)
 11568  	}
 11569  	_i += 1
 11570  	goto _1
 11571  _4:
 11572  	return int32(1)
 11573  }
 11574  
 11575  // C comment
 11576  //  /*
 11577  //  ** Decrement the ref-count on a virtual table object. When the ref-count
 11578  //  ** reaches zero, call the xDisconnect() method to delete the object.
 11579  //  */
 11580  func _sqlite3VtabUnlock(tls *crt.TLS, _pVTab *XVTable) {
 11581  	var _db *Xsqlite3
 11582  	var _1_p *Xsqlite3_vtab
 11583  	_db = (*Xsqlite3)(_pVTab.Xdb)
 11584  	func() {
 11585  		if _db == nil {
 11586  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125143), unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000), unsafe.Pointer(str(9430)))
 11587  			crt.X__builtin_abort(tls)
 11588  		}
 11589  	}()
 11590  	func() {
 11591  		if _pVTab.XnRef <= int32(0) {
 11592  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125144), unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000), unsafe.Pointer(str(9433)))
 11593  			crt.X__builtin_abort(tls)
 11594  		}
 11595  	}()
 11596  	func() {
 11597  		if _db.Xmagic != uint32(2687084183) && _db.Xmagic != uint32(1691352191) {
 11598  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125145), unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000), unsafe.Pointer(str(9447)))
 11599  			crt.X__builtin_abort(tls)
 11600  		}
 11601  	}()
 11602  	_pVTab.XnRef -= 1
 11603  	if _pVTab.XnRef != int32(0) {
 11604  		goto _7
 11605  	}
 11606  	_1_p = (*Xsqlite3_vtab)(_pVTab.XpVtab)
 11607  	if _1_p != nil {
 11608  		func() func(*crt.TLS, *Xsqlite3_vtab) int32 {
 11609  			v := (*Xsqlite3_module)(_1_p.XpModule).XxDisconnect
 11610  			return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v))
 11611  		}()(tls, _1_p)
 11612  	}
 11613  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pVTab))
 11614  _7:
 11615  }
 11616  
 11617  var _sqlite3VtabUnlockØ00__func__Ø000 [18]int8
 11618  
 11619  func init() {
 11620  	crt.Xstrncpy(nil, &_sqlite3VtabUnlockØ00__func__Ø000[0], str(9510), 18)
 11621  }
 11622  
 11623  // C comment
 11624  //  /*
 11625  //  ** Disconnect all the virtual table objects in the sqlite3.pDisconnect list.
 11626  //  **
 11627  //  ** This function may only be called when the mutexes associated with all
 11628  //  ** shared b-tree databases opened using connection db are held by the
 11629  //  ** caller. This is done to protect the sqlite3.pDisconnect list. The
 11630  //  ** sqlite3.pDisconnect list is accessed only as follows:
 11631  //  **
 11632  //  **   1) By this function. In this case, all BtShared mutexes and the mutex
 11633  //  **      associated with the database handle itself must be held.
 11634  //  **
 11635  //  **   2) By function vtabDisconnectAll(), when it adds a VTable entry to
 11636  //  **      the sqlite3.pDisconnect list. In this case either the BtShared mutex
 11637  //  **      associated with the database the virtual table is stored in is held
 11638  //  **      or, if the virtual table is stored in a non-sharable database, then
 11639  //  **      the database handle mutex is held.
 11640  //  **
 11641  //  ** As a result, a sqlite3.pDisconnect cannot be accessed simultaneously
 11642  //  ** by multiple threads. It is thread-safe.
 11643  //  */
 11644  func _sqlite3VtabUnlockList(tls *crt.TLS, _db *Xsqlite3) {
 11645  	var _p, _2_pNext *XVTable
 11646  	_p = (*XVTable)(_db.XpDisconnect)
 11647  	*(**XVTable)(unsafe.Pointer(&_db.XpDisconnect)) = nil
 11648  	func() {
 11649  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
 11650  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125246), unsafe.Pointer(&_sqlite3VtabUnlockListØ00__func__Ø000), unsafe.Pointer(str(9376)))
 11651  			crt.X__builtin_abort(tls)
 11652  		}
 11653  	}()
 11654  	func() {
 11655  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11656  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125247), unsafe.Pointer(&_sqlite3VtabUnlockListØ00__func__Ø000), unsafe.Pointer(str(881)))
 11657  			crt.X__builtin_abort(tls)
 11658  		}
 11659  	}()
 11660  	if _p == nil {
 11661  		goto _4
 11662  	}
 11663  	_sqlite3ExpirePreparedStatements(tls, _db)
 11664  _5:
 11665  	_2_pNext = (*XVTable)(_p.XpNext)
 11666  	_sqlite3VtabUnlock(tls, _p)
 11667  	_p = _2_pNext
 11668  	if _p != nil {
 11669  		goto _5
 11670  	}
 11671  _4:
 11672  }
 11673  
 11674  var _sqlite3VtabUnlockListØ00__func__Ø000 [22]int8
 11675  
 11676  func init() {
 11677  	crt.Xstrncpy(nil, &_sqlite3VtabUnlockListØ00__func__Ø000[0], str(9528), 22)
 11678  }
 11679  
 11680  // C comment
 11681  //  /*
 11682  //  ** Mark every prepared statement associated with a database connection
 11683  //  ** as expired.
 11684  //  **
 11685  //  ** An expired statement means that recompilation of the statement is
 11686  //  ** recommend.  Statements expire when things happen that make their
 11687  //  ** programs obsolete.  Removing user-defined functions or collating
 11688  //  ** sequences, or changing an authorization function are the types of
 11689  //  ** things that make prepared statements obsolete.
 11690  //  */
 11691  func _sqlite3ExpirePreparedStatements(tls *crt.TLS, _db *Xsqlite3) {
 11692  	var _p *TVdbe
 11693  	_p = (*TVdbe)(_db.XpVdbe)
 11694  _0:
 11695  	if _p == nil {
 11696  		goto _3
 11697  	}
 11698  	storebits26(&_p.Xexpired, int16(1), 1, 0)
 11699  	_p = (*TVdbe)(_p.XpNext)
 11700  	goto _0
 11701  _3:
 11702  }
 11703  
 11704  func _sqlite3BtreeLeaveAll(tls *crt.TLS, _db *Xsqlite3) {
 11705  	if int32(_db.XskipBtreeMutex) == int32(0) {
 11706  		_btreeLeaveAll(tls, _db)
 11707  	}
 11708  }
 11709  
 11710  func _btreeLeaveAll(tls *crt.TLS, _db *Xsqlite3) {
 11711  	var _i int32
 11712  	var _p *XBtree
 11713  	func() {
 11714  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11715  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58929), unsafe.Pointer(&_btreeLeaveAllØ00__func__Ø000), unsafe.Pointer(str(881)))
 11716  			crt.X__builtin_abort(tls)
 11717  		}
 11718  	}()
 11719  	_i = int32(0)
 11720  _2:
 11721  	if _i >= _db.XnDb {
 11722  		goto _5
 11723  	}
 11724  	_p = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 11725  	if _p != nil {
 11726  		_sqlite3BtreeLeave(tls, _p)
 11727  	}
 11728  	_i += 1
 11729  	goto _2
 11730  _5:
 11731  }
 11732  
 11733  var _btreeLeaveAllØ00__func__Ø000 [14]int8
 11734  
 11735  func init() {
 11736  	crt.Xstrncpy(nil, &_btreeLeaveAllØ00__func__Ø000[0], str(9550), 14)
 11737  }
 11738  
 11739  // C comment
 11740  //  /*
 11741  //  ** Exit the recursive mutex on a Btree.
 11742  //  */
 11743  func _sqlite3BtreeLeave(tls *crt.TLS, _p *XBtree) {
 11744  	func() {
 11745  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 11746  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58867), unsafe.Pointer(&_sqlite3BtreeLeaveØ00__func__Ø000), unsafe.Pointer(str(8939)))
 11747  			crt.X__builtin_abort(tls)
 11748  		}
 11749  	}()
 11750  	if _p.Xsharable == 0 {
 11751  		goto _2
 11752  	}
 11753  	func() {
 11754  		if _p.XwantToLock <= int32(0) {
 11755  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58869), unsafe.Pointer(&_sqlite3BtreeLeaveØ00__func__Ø000), unsafe.Pointer(str(9564)))
 11756  			crt.X__builtin_abort(tls)
 11757  		}
 11758  	}()
 11759  	_p.XwantToLock -= 1
 11760  	if _p.XwantToLock == int32(0) {
 11761  		_unlockBtreeMutex(tls, _p)
 11762  	}
 11763  _2:
 11764  }
 11765  
 11766  var _sqlite3BtreeLeaveØ00__func__Ø000 [18]int8
 11767  
 11768  func init() {
 11769  	crt.Xstrncpy(nil, &_sqlite3BtreeLeaveØ00__func__Ø000[0], str(9580), 18)
 11770  }
 11771  
 11772  // C comment
 11773  //  /*
 11774  //  ** Invoke the xRollback method of all virtual tables in the
 11775  //  ** sqlite3.aVTrans array. Then clear the array itself.
 11776  //  */
 11777  func _sqlite3VtabRollback(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 11778  	_callFinaliser(tls, _db, int32(136))
 11779  	return int32(0)
 11780  }
 11781  
 11782  // C comment
 11783  //  /*
 11784  //  ** This function invokes either the xRollback or xCommit method
 11785  //  ** of each of the virtual tables in the sqlite3.aVTrans array. The method
 11786  //  ** called is identified by the second argument, "offset", which is
 11787  //  ** the offset of the method to call in the sqlite3_module structure.
 11788  //  **
 11789  //  ** The array is cleared after invoking the callbacks.
 11790  //  */
 11791  func _callFinaliser(tls *crt.TLS, _db *Xsqlite3, _offset int32) {
 11792  	var _i int32
 11793  	var _2_pVTab *XVTable
 11794  	var _2_p *Xsqlite3_vtab
 11795  	var _1_aVTrans **XVTable
 11796  	var _3_x func(*crt.TLS, *Xsqlite3_vtab) int32
 11797  	if _db.XaVTrans == nil {
 11798  		goto _0
 11799  	}
 11800  	_1_aVTrans = (**XVTable)(unsafe.Pointer(_db.XaVTrans))
 11801  	*(***XVTable)(unsafe.Pointer(&_db.XaVTrans)) = nil
 11802  	_i = int32(0)
 11803  _1:
 11804  	if _i >= _db.XnVTrans {
 11805  		goto _4
 11806  	}
 11807  	_2_pVTab = *elem28(_1_aVTrans, uintptr(_i))
 11808  	_2_p = (*Xsqlite3_vtab)(_2_pVTab.XpVtab)
 11809  	if _2_p == nil {
 11810  		goto _5
 11811  	}
 11812  	_3_x = *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_2_p.XpModule) + uintptr(_offset)))))
 11813  	if _3_x != nil {
 11814  		_3_x(tls, _2_p)
 11815  	}
 11816  _5:
 11817  	_2_pVTab.XiSavepoint = int32(0)
 11818  	_sqlite3VtabUnlock(tls, _2_pVTab)
 11819  	_i += 1
 11820  	goto _1
 11821  _4:
 11822  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_aVTrans))
 11823  	_db.XnVTrans = int32(0)
 11824  _0:
 11825  }
 11826  
 11827  // C comment
 11828  //  /*
 11829  //  ** Return TRUE if database connection db has unfinalized prepared
 11830  //  ** statements or unfinished sqlite3_backup objects.
 11831  //  */
 11832  func _connectionIsBusy(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 11833  	var _j int32
 11834  	var _1_pBt *XBtree
 11835  	func() {
 11836  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11837  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141503), unsafe.Pointer(&_connectionIsBusyØ00__func__Ø000), unsafe.Pointer(str(881)))
 11838  			crt.X__builtin_abort(tls)
 11839  		}
 11840  	}()
 11841  	if _db.XpVdbe != nil {
 11842  		return int32(1)
 11843  	}
 11844  	_j = int32(0)
 11845  _3:
 11846  	if _j >= _db.XnDb {
 11847  		goto _6
 11848  	}
 11849  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_j)).XpBt)
 11850  	if (_1_pBt != nil) && _sqlite3BtreeIsInBackup(tls, _1_pBt) != 0 {
 11851  		return int32(1)
 11852  	}
 11853  	_j += 1
 11854  	goto _3
 11855  _6:
 11856  	return int32(0)
 11857  }
 11858  
 11859  var _connectionIsBusyØ00__func__Ø000 [17]int8
 11860  
 11861  func init() {
 11862  	crt.Xstrncpy(nil, &_connectionIsBusyØ00__func__Ø000[0], str(9598), 17)
 11863  }
 11864  
 11865  func _sqlite3BtreeIsInBackup(tls *crt.TLS, _p *XBtree) (r0 int32) {
 11866  	func() {
 11867  		if _p == nil {
 11868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68680), unsafe.Pointer(&_sqlite3BtreeIsInBackupØ00__func__Ø000), unsafe.Pointer(str(9615)))
 11869  			crt.X__builtin_abort(tls)
 11870  		}
 11871  	}()
 11872  	func() {
 11873  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 11874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68681), unsafe.Pointer(&_sqlite3BtreeIsInBackupØ00__func__Ø000), unsafe.Pointer(str(8939)))
 11875  			crt.X__builtin_abort(tls)
 11876  		}
 11877  	}()
 11878  	return bool2int(_p.XnBackup != int32(0))
 11879  }
 11880  
 11881  var _sqlite3BtreeIsInBackupØ00__func__Ø000 [23]int8
 11882  
 11883  func init() {
 11884  	crt.Xstrncpy(nil, &_sqlite3BtreeIsInBackupØ00__func__Ø000[0], str(9617), 23)
 11885  }
 11886  
 11887  // C comment
 11888  //  /*
 11889  //  ** Set the most recent error code and error string for the sqlite
 11890  //  ** handle "db". The error code is set to "err_code".
 11891  //  **
 11892  //  ** If it is not NULL, string zFormat specifies the format of the
 11893  //  ** error string in the style of the printf functions: The following
 11894  //  ** format characters are allowed:
 11895  //  **
 11896  //  **      %s      Insert a string
 11897  //  **      %z      A string that should be freed after use
 11898  //  **      %d      Insert an integer
 11899  //  **      %T      Insert a token
 11900  //  **      %S      Insert the first element of a SrcList
 11901  //  **
 11902  //  ** zFormat and any string tokens that follow it are assumed to be
 11903  //  ** encoded in UTF-8.
 11904  //  **
 11905  //  ** To clear the most recent error for sqlite handle "db", sqlite3Error
 11906  //  ** should be called with err_code set to SQLITE_OK and zFormat set
 11907  //  ** to NULL.
 11908  //  */
 11909  func _sqlite3ErrorWithMsg(tls *crt.TLS, _db *Xsqlite3, _err_code int32, _zFormat *int8, args ...interface{}) {
 11910  	var _2_z *int8
 11911  	var _2_ap []interface{}
 11912  	func() {
 11913  		if _db == nil {
 11914  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27835), unsafe.Pointer(&_sqlite3ErrorWithMsgØ00__func__Ø000), unsafe.Pointer(str(1219)))
 11915  			crt.X__builtin_abort(tls)
 11916  		}
 11917  	}()
 11918  	_db.XerrCode = _err_code
 11919  	_sqlite3SystemError(tls, _db, _err_code)
 11920  	if _zFormat == nil {
 11921  		_sqlite3Error(tls, _db, _err_code)
 11922  		goto _5
 11923  	}
 11924  	if (_db.XpErr != nil) || (store25((**XMem)(unsafe.Pointer(&_db.XpErr)), _sqlite3ValueNew(tls, _db)) != nil) {
 11925  		_2_ap = args
 11926  		_2_z = _sqlite3VMPrintf(tls, _db, _zFormat, _2_ap)
 11927  		_2_ap = nil
 11928  		_sqlite3ValueSetStr(tls, (*XMem)(_db.XpErr), int32(-1), unsafe.Pointer(_2_z), uint8(1), func() func(*crt.TLS, unsafe.Pointer) {
 11929  			v := _sqlite3MallocSize
 11930  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 11931  		}())
 11932  	}
 11933  _5:
 11934  }
 11935  
 11936  var _sqlite3ErrorWithMsgØ00__func__Ø000 [20]int8
 11937  
 11938  func init() {
 11939  	crt.Xstrncpy(nil, &_sqlite3ErrorWithMsgØ00__func__Ø000[0], str(9640), 20)
 11940  }
 11941  
 11942  // C comment
 11943  //  /*
 11944  //  ** Create a new sqlite3_value object.
 11945  //  */
 11946  func _sqlite3ValueNew(tls *crt.TLS, _db *Xsqlite3) (r0 *XMem) {
 11947  	var _p *XMem
 11948  	_p = (*XMem)(_sqlite3DbMallocZero(tls, _db, uint64(72)))
 11949  	if _p != nil {
 11950  		_p.Xflags = uint16(1)
 11951  		*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 11952  	}
 11953  	return _p
 11954  }
 11955  
 11956  // C comment
 11957  //  /*
 11958  //  ** Allocate and zero memory.  If the allocation fails, make
 11959  //  ** the mallocFailed flag in the connection pointer.
 11960  //  */
 11961  func _sqlite3DbMallocZero(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
 11962  	var _p unsafe.Pointer
 11963  	_p = _sqlite3DbMallocRaw(tls, _db, _n)
 11964  	if _p != nil {
 11965  		crt.Xmemset(tls, _p, int32(0), _n)
 11966  	}
 11967  	return _p
 11968  }
 11969  
 11970  // C comment
 11971  //  /*
 11972  //  ** Change the string value of an sqlite3_value object
 11973  //  */
 11974  func _sqlite3ValueSetStr(tls *crt.TLS, _v *XMem, _n int32, _z unsafe.Pointer, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) {
 11975  	if _v != nil {
 11976  		_sqlite3VdbeMemSetStr(tls, _v, (*int8)(_z), _n, _enc, _xDel)
 11977  	}
 11978  }
 11979  
 11980  // C comment
 11981  //  /*
 11982  //  ** Close the mutex on database connection db.
 11983  //  **
 11984  //  ** Furthermore, if database connection db is a zombie (meaning that there
 11985  //  ** has been a prior call to sqlite3_close(db) or sqlite3_close_v2(db)) and
 11986  //  ** every sqlite3_stmt has now been finalized and every sqlite3_backup has
 11987  //  ** finished, then free all resources.
 11988  //  */
 11989  func _sqlite3LeaveMutexAndCloseZombie(tls *crt.TLS, _db *Xsqlite3) {
 11990  	var _j int32
 11991  	var _2_pDb *XDb
 11992  	var _i *XHashElem
 11993  	var _6_pNext, _6_p *XFuncDef
 11994  	var _8_pColl *XCollSeq
 11995  	var _11_pMod *XModule
 11996  	if (_db.Xmagic != uint32(1691352191)) || _connectionIsBusy(tls, _db) != 0 {
 11997  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 11998  		return
 11999  	}
 12000  	_sqlite3RollbackAll(tls, _db, int32(0))
 12001  	_sqlite3CloseSavepoints(tls, _db)
 12002  	_j = int32(0)
 12003  _2:
 12004  	if _j >= _db.XnDb {
 12005  		goto _5
 12006  	}
 12007  	_2_pDb = elem27((*XDb)(_db.XaDb), uintptr(_j))
 12008  	if _2_pDb.XpBt == nil {
 12009  		goto _6
 12010  	}
 12011  	_sqlite3BtreeClose(tls, (*XBtree)(_2_pDb.XpBt))
 12012  	*(**XBtree)(unsafe.Pointer(&_2_pDb.XpBt)) = nil
 12013  	if _j != int32(1) {
 12014  		*(**XSchema)(unsafe.Pointer(&_2_pDb.XpSchema)) = nil
 12015  	}
 12016  _6:
 12017  	_j += 1
 12018  	goto _2
 12019  _5:
 12020  	if (elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema) != nil {
 12021  		_sqlite3SchemaClear(tls, elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema)
 12022  	}
 12023  	_sqlite3VtabUnlockList(tls, _db)
 12024  	_sqlite3CollapseDatabaseArray(tls, _db)
 12025  	func() {
 12026  		if _db.XnDb > int32(2) {
 12027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141633), unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000), unsafe.Pointer(str(9660)))
 12028  			crt.X__builtin_abort(tls)
 12029  		}
 12030  	}()
 12031  	func() {
 12032  		if (*XDb)(_db.XaDb) != (*XDb)(unsafe.Pointer(&_db.XaDbStatic)) {
 12033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141634), unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000), unsafe.Pointer(str(9671)))
 12034  			crt.X__builtin_abort(tls)
 12035  		}
 12036  	}()
 12037  	_i = (*XHashElem)(_db.XaFunc.Xfirst)
 12038  _13:
 12039  	if _i == nil {
 12040  		goto _16
 12041  	}
 12042  	_6_p = (*XFuncDef)(_i.Xdata)
 12043  _17:
 12044  	_functionDestroy(tls, _db, _6_p)
 12045  	_6_pNext = (*XFuncDef)(_6_p.XpNext)
 12046  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_6_p))
 12047  	_6_p = _6_pNext
 12048  	if _6_p != nil {
 12049  		goto _17
 12050  	}
 12051  	_i = (*XHashElem)(_i.Xnext)
 12052  	goto _13
 12053  _16:
 12054  	_sqlite3HashClear(tls, &_db.XaFunc)
 12055  	_i = (*XHashElem)(_db.XaCollSeq.Xfirst)
 12056  _18:
 12057  	if _i == nil {
 12058  		goto _21
 12059  	}
 12060  	_8_pColl = (*XCollSeq)(_i.Xdata)
 12061  	_j = int32(0)
 12062  _22:
 12063  	if _j >= int32(3) {
 12064  		goto _25
 12065  	}
 12066  	if (elem29(_8_pColl, uintptr(_j)).XxDel) != nil {
 12067  		(elem29(_8_pColl, uintptr(_j)).XxDel)(tls, elem29(_8_pColl, uintptr(_j)).XpUser)
 12068  	}
 12069  	_j += 1
 12070  	goto _22
 12071  _25:
 12072  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_8_pColl))
 12073  	_i = (*XHashElem)(_i.Xnext)
 12074  	goto _18
 12075  _21:
 12076  	_sqlite3HashClear(tls, &_db.XaCollSeq)
 12077  	_i = (*XHashElem)(_db.XaModule.Xfirst)
 12078  _27:
 12079  	if _i == nil {
 12080  		goto _30
 12081  	}
 12082  	_11_pMod = (*XModule)(_i.Xdata)
 12083  	if _11_pMod.XxDestroy != nil {
 12084  		_11_pMod.XxDestroy(tls, _11_pMod.XpAux)
 12085  	}
 12086  	_sqlite3VtabEponymousTableClear(tls, _db, _11_pMod)
 12087  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_11_pMod))
 12088  	_i = (*XHashElem)(_i.Xnext)
 12089  	goto _27
 12090  _30:
 12091  	_sqlite3HashClear(tls, &_db.XaModule)
 12092  	_sqlite3Error(tls, _db, int32(0))
 12093  	_sqlite3ValueFree(tls, (*XMem)(_db.XpErr))
 12094  	_sqlite3CloseExtensions(tls, _db)
 12095  	_db.Xmagic = uint32(3040180528)
 12096  	_sqlite3DbFree(tls, _db, elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema)
 12097  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 12098  	_db.Xmagic = uint32(2671521075)
 12099  	Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 12100  	func() {
 12101  		if (_db.Xlookaside.XnOut) != int32(0) {
 12102  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141695), unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000), unsafe.Pointer(str(9694)))
 12103  			crt.X__builtin_abort(tls)
 12104  		}
 12105  	}()
 12106  	if (_db.Xlookaside.XbMalloced) != 0 {
 12107  		Xsqlite3_free(tls, _db.Xlookaside.XpStart)
 12108  	}
 12109  	Xsqlite3_free(tls, unsafe.Pointer(_db))
 12110  }
 12111  
 12112  // C comment
 12113  //  /*
 12114  //  ** Rollback all database files.  If tripCode is not SQLITE_OK, then
 12115  //  ** any write cursors are invalidated ("tripped" - as in "tripping a circuit
 12116  //  ** breaker") and made to return tripCode if there are any further
 12117  //  ** attempts to use that cursor.  Read cursors remain open and valid
 12118  //  ** but are "saved" in case the table pages are moved around.
 12119  //  */
 12120  func _sqlite3RollbackAll(tls *crt.TLS, _db *Xsqlite3, _tripCode int32) {
 12121  	var _i, _inTrans, _schemaChange int32
 12122  	var _1_p *XBtree
 12123  	_inTrans = int32(0)
 12124  	func() {
 12125  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 12126  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141713), unsafe.Pointer(&_sqlite3RollbackAllØ00__func__Ø000), unsafe.Pointer(str(881)))
 12127  			crt.X__builtin_abort(tls)
 12128  		}
 12129  	}()
 12130  	_sqlite3BeginBenignMalloc(tls)
 12131  	_sqlite3BtreeEnterAll(tls, _db)
 12132  	_schemaChange = bool2int(((_db.Xflags & int32(2)) != int32(0)) && (int32(_db.Xinit.Xbusy) == int32(0)))
 12133  	_i = int32(0)
 12134  _3:
 12135  	if _i >= _db.XnDb {
 12136  		goto _6
 12137  	}
 12138  	_1_p = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 12139  	if _1_p == nil {
 12140  		goto _7
 12141  	}
 12142  	if _sqlite3BtreeIsInTrans(tls, _1_p) != 0 {
 12143  		_inTrans = int32(1)
 12144  	}
 12145  	_sqlite3BtreeRollback(tls, _1_p, _tripCode, bool2int(_schemaChange == 0))
 12146  _7:
 12147  	_i += 1
 12148  	goto _3
 12149  _6:
 12150  	_sqlite3VtabRollback(tls, _db)
 12151  	_sqlite3EndBenignMalloc(tls)
 12152  	if ((_db.Xflags & int32(2)) != int32(0)) && (int32(_db.Xinit.Xbusy) == int32(0)) {
 12153  		_sqlite3ExpirePreparedStatements(tls, _db)
 12154  		_sqlite3ResetAllSchemasOfConnection(tls, _db)
 12155  	}
 12156  	_sqlite3BtreeLeaveAll(tls, _db)
 12157  	_db.XnDeferredCons = 0
 12158  	_db.XnDeferredImmCons = 0
 12159  	_db.Xflags &= int32(-33554433)
 12160  	if (_db.XxRollbackCallback != nil) && (_inTrans != 0 || (_db.XautoCommit == 0)) {
 12161  		_db.XxRollbackCallback(tls, _db.XpRollbackArg)
 12162  	}
 12163  }
 12164  
 12165  var _sqlite3RollbackAllØ00__func__Ø000 [19]int8
 12166  
 12167  func init() {
 12168  	crt.Xstrncpy(nil, &_sqlite3RollbackAllØ00__func__Ø000[0], str(9716), 19)
 12169  }
 12170  
 12171  // C comment
 12172  //  /*
 12173  //  ** Return non-zero if a transaction is active.
 12174  //  */
 12175  func _sqlite3BtreeIsInTrans(tls *crt.TLS, _p *XBtree) (r0 int32) {
 12176  	func() {
 12177  		if _p != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 12178  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68641), unsafe.Pointer(&_sqlite3BtreeIsInTransØ00__func__Ø000), unsafe.Pointer(str(9735)))
 12179  			crt.X__builtin_abort(tls)
 12180  		}
 12181  	}()
 12182  	return bool2int((_p != nil) && (int32(_p.XinTrans) == int32(2)))
 12183  }
 12184  
 12185  var _sqlite3BtreeIsInTransØ00__func__Ø000 [22]int8
 12186  
 12187  func init() {
 12188  	crt.Xstrncpy(nil, &_sqlite3BtreeIsInTransØ00__func__Ø000[0], str(9776), 22)
 12189  }
 12190  
 12191  // C comment
 12192  //  /*
 12193  //  ** Rollback the transaction in progress.
 12194  //  **
 12195  //  ** If tripCode is not SQLITE_OK then cursors will be invalidated (tripped).
 12196  //  ** Only write cursors are tripped if writeOnly is true but all cursors are
 12197  //  ** tripped if writeOnly is false.  Any attempt to use
 12198  //  ** a tripped cursor will result in an error.
 12199  //  **
 12200  //  ** This will release the write lock on the database file.  If there
 12201  //  ** are no active cursors, it also releases the read lock.
 12202  //  */
 12203  func _sqlite3BtreeRollback(tls *crt.TLS, _p *XBtree, _tripCode int32, _writeOnly int32) (r0 int32) {
 12204  	var _rc, _3_rc2, _4_rc2, _6_nPage int32
 12205  	var _pBt *XBtShared
 12206  	var _pPage1 *XMemPage
 12207  	_pBt = (*XBtShared)(_p.XpBt)
 12208  	func() {
 12209  		if _writeOnly != int32(1) && _writeOnly != int32(0) {
 12210  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63037), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(9798)))
 12211  			crt.X__builtin_abort(tls)
 12212  		}
 12213  	}()
 12214  	func() {
 12215  		if _tripCode != int32(516) && _tripCode != int32(0) {
 12216  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63038), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(9827)))
 12217  			crt.X__builtin_abort(tls)
 12218  		}
 12219  	}()
 12220  	_sqlite3BtreeEnter(tls, _p)
 12221  	if _tripCode != int32(0) {
 12222  		goto _6
 12223  	}
 12224  	_rc = store2(&_tripCode, _saveAllCursors(tls, _pBt, 0, nil))
 12225  	if _rc != 0 {
 12226  		_writeOnly = int32(0)
 12227  	}
 12228  	goto _8
 12229  _6:
 12230  	_rc = int32(0)
 12231  _8:
 12232  	if _tripCode == 0 {
 12233  		goto _9
 12234  	}
 12235  	_3_rc2 = _sqlite3BtreeTripAllCursors(tls, _p, _tripCode, _writeOnly)
 12236  	func() {
 12237  		if _rc != int32(0) && (_writeOnly != int32(0) || _3_rc2 != int32(0)) {
 12238  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63048), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(9882)))
 12239  			crt.X__builtin_abort(tls)
 12240  		}
 12241  	}()
 12242  	if _3_rc2 != int32(0) {
 12243  		_rc = _3_rc2
 12244  	}
 12245  _9:
 12246  	func() {
 12247  		if int32((*XBtShared)(_p.XpBt).XinTransaction) == int32(0) && ((*XBtShared)(_p.XpBt).XnTransaction) != int32(0) {
 12248  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63051), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(9932)))
 12249  			crt.X__builtin_abort(tls)
 12250  		}
 12251  	}()
 12252  	func() {
 12253  		if int32((*XBtShared)(_p.XpBt).XinTransaction) < int32(_p.XinTrans) {
 12254  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63051), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(9993)))
 12255  			crt.X__builtin_abort(tls)
 12256  		}
 12257  	}()
 12258  	if int32(_p.XinTrans) != int32(2) {
 12259  		goto _20
 12260  	}
 12261  	func() {
 12262  		if int32(2) != int32(_pBt.XinTransaction) {
 12263  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63056), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(10027)))
 12264  			crt.X__builtin_abort(tls)
 12265  		}
 12266  	}()
 12267  	_4_rc2 = _sqlite3PagerRollback(tls, (*XPager)(_pBt.XpPager))
 12268  	if _4_rc2 != int32(0) {
 12269  		_rc = _4_rc2
 12270  	}
 12271  	if _btreeGetPage(tls, _pBt, uint32(1), &_pPage1, int32(0)) != int32(0) {
 12272  		goto _24
 12273  	}
 12274  	_6_nPage = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(int32(28))+uintptr(unsafe.Pointer(_pPage1.XaData))))))
 12275  	if _6_nPage == int32(0) {
 12276  		_sqlite3PagerPagecount(tls, (*XPager)(_pBt.XpPager), &_6_nPage)
 12277  	}
 12278  	_pBt.XnPage = uint32(_6_nPage)
 12279  	_releasePage(tls, _pPage1)
 12280  _24:
 12281  	func() {
 12282  		if _countValidCursors(tls, _pBt, int32(1)) != int32(0) {
 12283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63073), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(10059)))
 12284  			crt.X__builtin_abort(tls)
 12285  		}
 12286  	}()
 12287  	_pBt.XinTransaction = uint8(1)
 12288  	_btreeClearHasContent(tls, _pBt)
 12289  _20:
 12290  	_btreeEndTransaction(tls, _p)
 12291  	_sqlite3BtreeLeave(tls, _p)
 12292  	return _rc
 12293  }
 12294  
 12295  var _sqlite3BtreeRollbackØ00__func__Ø000 [21]int8
 12296  
 12297  func init() {
 12298  	crt.Xstrncpy(nil, &_sqlite3BtreeRollbackØ00__func__Ø000[0], str(10088), 21)
 12299  }
 12300  
 12301  // C comment
 12302  //  /*
 12303  //  ** Save the positions of all cursors (except pExcept) that are open on
 12304  //  ** the table with root-page iRoot.  "Saving the cursor position" means that
 12305  //  ** the location in the btree is remembered in such a way that it can be
 12306  //  ** moved back to the same spot after the btree has been modified.  This
 12307  //  ** routine is called just before cursor pExcept is used to modify the
 12308  //  ** table, for example in BtreeDelete() or BtreeInsert().
 12309  //  **
 12310  //  ** If there are two or more cursors on the same btree, then all such
 12311  //  ** cursors should have their BTCF_Multiple flag set.  The btreeCursor()
 12312  //  ** routine enforces that rule.  This routine only needs to be called in
 12313  //  ** the uncommon case when pExpect has the BTCF_Multiple flag set.
 12314  //  **
 12315  //  ** If pExpect!=NULL and if no other cursors are found on the same root-page,
 12316  //  ** then the BTCF_Multiple flag on pExpect is cleared, to avoid another
 12317  //  ** pointless call to this routine.
 12318  //  **
 12319  //  ** Implementation note:  This routine merely checks to see if any cursors
 12320  //  ** need to be saved.  It calls out to saveCursorsOnList() in the (unusual)
 12321  //  ** event that cursors are in need to being saved.
 12322  //  */
 12323  func _saveAllCursors(tls *crt.TLS, _pBt *XBtShared, _iRoot uint32, _pExcept *XBtCursor) (r0 int32) {
 12324  	var _p *XBtCursor
 12325  	func() {
 12326  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 12327  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59740), unsafe.Pointer(&_saveAllCursorsØ00__func__Ø000), unsafe.Pointer(str(9235)))
 12328  			crt.X__builtin_abort(tls)
 12329  		}
 12330  	}()
 12331  	func() {
 12332  		if _pExcept != nil && (*XBtShared)(_pExcept.XpBt) != _pBt {
 12333  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59741), unsafe.Pointer(&_saveAllCursorsØ00__func__Ø000), unsafe.Pointer(str(10109)))
 12334  			crt.X__builtin_abort(tls)
 12335  		}
 12336  	}()
 12337  	_p = (*XBtCursor)(_pBt.XpCursor)
 12338  _5:
 12339  	if _p == nil {
 12340  		goto _8
 12341  	}
 12342  	if (_p != _pExcept) && (((0) == _iRoot) || (_p.XpgnoRoot == _iRoot)) {
 12343  		goto _8
 12344  	}
 12345  	_p = (*XBtCursor)(_p.XpNext)
 12346  	goto _5
 12347  _8:
 12348  	if _p != nil {
 12349  		return _saveCursorsOnList(tls, _p, _iRoot, _pExcept)
 12350  	}
 12351  	if _pExcept != nil {
 12352  		{
 12353  			p := &_pExcept.XcurFlags
 12354  			*p = uint8(int32(*p) & int32(-33))
 12355  		}
 12356  	}
 12357  	return int32(0)
 12358  }
 12359  
 12360  var _saveAllCursorsØ00__func__Ø000 [15]int8
 12361  
 12362  func init() {
 12363  	crt.Xstrncpy(nil, &_saveAllCursorsØ00__func__Ø000[0], str(10141), 15)
 12364  }
 12365  
 12366  // C comment
 12367  //  /* This helper routine to saveAllCursors does the actual work of saving
 12368  //  ** the cursors if and when a cursor is found that actually requires saving.
 12369  //  ** The common case is that no cursors need to be saved, so this routine is
 12370  //  ** broken out from its caller to avoid unnecessary stack pointer movement.
 12371  //  */
 12372  func _saveCursorsOnList(tls *crt.TLS, _p *XBtCursor, _iRoot uint32, _pExcept *XBtCursor) (r0 int32) {
 12373  	var _3_rc int32
 12374  _0:
 12375  	if _p == _pExcept || (0) != _iRoot && _p.XpgnoRoot != _iRoot {
 12376  		goto _3
 12377  	}
 12378  	if int32(_p.XeState) != int32(1) && int32(_p.XeState) != int32(2) {
 12379  		goto _5
 12380  	}
 12381  	_3_rc = _saveCursorPosition(tls, _p)
 12382  	if int32(0) != _3_rc {
 12383  		return _3_rc
 12384  	}
 12385  	goto _7
 12386  _5:
 12387  	_btreeReleaseAllCursorPages(tls, _p)
 12388  _7:
 12389  _3:
 12390  	_p = (*XBtCursor)(_p.XpNext)
 12391  	if _p != nil {
 12392  		goto _0
 12393  	}
 12394  	return int32(0)
 12395  }
 12396  
 12397  // C comment
 12398  //  /*
 12399  //  ** Save the current cursor position in the variables BtCursor.nKey
 12400  //  ** and BtCursor.pKey. The cursor's state is set to CURSOR_REQUIRESEEK.
 12401  //  **
 12402  //  ** The caller must ensure that the cursor is valid (has eState==CURSOR_VALID)
 12403  //  ** prior to calling this routine.
 12404  //  */
 12405  func _saveCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 12406  	var _rc int32
 12407  	func() {
 12408  		if int32(1) != int32(_pCur.XeState) && int32(2) != int32(_pCur.XeState) {
 12409  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59694), unsafe.Pointer(&_saveCursorPositionØ00__func__Ø000), unsafe.Pointer(str(10156)))
 12410  			crt.X__builtin_abort(tls)
 12411  		}
 12412  	}()
 12413  	func() {
 12414  		if nil != _pCur.XpKey {
 12415  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59695), unsafe.Pointer(&_saveCursorPositionØ00__func__Ø000), unsafe.Pointer(str(10216)))
 12416  			crt.X__builtin_abort(tls)
 12417  		}
 12418  	}()
 12419  	func() {
 12420  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12421  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59696), unsafe.Pointer(&_saveCursorPositionØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12422  			crt.X__builtin_abort(tls)
 12423  		}
 12424  	}()
 12425  	if int32(_pCur.XeState) == int32(2) {
 12426  		_pCur.XeState = uint8(1)
 12427  		goto _8
 12428  	}
 12429  	_pCur.XskipNext = int32(0)
 12430  _8:
 12431  	_rc = _saveCursorKey(tls, _pCur)
 12432  	if _rc == int32(0) {
 12433  		_btreeReleaseAllCursorPages(tls, _pCur)
 12434  		_pCur.XeState = uint8(3)
 12435  	}
 12436  	{
 12437  		p := &_pCur.XcurFlags
 12438  		*p = uint8(int32(*p) & int32(-15))
 12439  	}
 12440  	return _rc
 12441  }
 12442  
 12443  var _saveCursorPositionØ00__func__Ø000 [19]int8
 12444  
 12445  func init() {
 12446  	crt.Xstrncpy(nil, &_saveCursorPositionØ00__func__Ø000[0], str(10253), 19)
 12447  }
 12448  
 12449  func _cursorHoldsMutex(tls *crt.TLS, _p *XBtCursor) (r0 int32) {
 12450  	return Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex))
 12451  }
 12452  
 12453  // C comment
 12454  //  /*
 12455  //  ** The cursor passed as the only argument must point to a valid entry
 12456  //  ** when this function is called (i.e. have eState==CURSOR_VALID). This
 12457  //  ** function saves the current cursor key in variables pCur->nKey and
 12458  //  ** pCur->pKey. SQLITE_OK is returned if successful or an SQLite error
 12459  //  ** code otherwise.
 12460  //  **
 12461  //  ** If the cursor is open on an intkey table, then the integer key
 12462  //  ** (the rowid) is stored in pCur->nKey and pCur->pKey is left set to
 12463  //  ** NULL. If the cursor is open on a non-intkey table, then pCur->pKey is
 12464  //  ** set to point to a malloced buffer pCur->nKey bytes in size containing
 12465  //  ** the key.
 12466  //  */
 12467  func _saveCursorKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 12468  	var _rc int32
 12469  	var _2_pKey unsafe.Pointer
 12470  	_rc = int32(0)
 12471  	func() {
 12472  		if int32(1) != int32(_pCur.XeState) {
 12473  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59657), unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000), unsafe.Pointer(str(10272)))
 12474  			crt.X__builtin_abort(tls)
 12475  		}
 12476  	}()
 12477  	func() {
 12478  		if nil != _pCur.XpKey {
 12479  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59658), unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000), unsafe.Pointer(str(10216)))
 12480  			crt.X__builtin_abort(tls)
 12481  		}
 12482  	}()
 12483  	func() {
 12484  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12485  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59659), unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12486  			crt.X__builtin_abort(tls)
 12487  		}
 12488  	}()
 12489  	if _pCur.XcurIntKey != 0 {
 12490  		_pCur.XnKey = _sqlite3BtreeIntegerKey(tls, _pCur)
 12491  		goto _7
 12492  	}
 12493  	_pCur.XnKey = int64(_sqlite3BtreePayloadSize(tls, _pCur))
 12494  	_2_pKey = _sqlite3Malloc(tls, uint64(_pCur.XnKey))
 12495  	if _2_pKey == nil {
 12496  		goto _8
 12497  	}
 12498  	_rc = _sqlite3BtreePayload(tls, _pCur, 0, uint32(int32(_pCur.XnKey)), _2_pKey)
 12499  	if _rc == int32(0) {
 12500  		_pCur.XpKey = _2_pKey
 12501  		goto _10
 12502  	}
 12503  	Xsqlite3_free(tls, _2_pKey)
 12504  _10:
 12505  	goto _11
 12506  _8:
 12507  	_rc = _sqlite3NomemError(tls, int32(59677))
 12508  _11:
 12509  _7:
 12510  	func() {
 12511  		if _pCur.XcurIntKey != 0 && _pCur.XpKey != nil {
 12512  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59680), unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000), unsafe.Pointer(str(10299)))
 12513  			crt.X__builtin_abort(tls)
 12514  		}
 12515  	}()
 12516  	return _rc
 12517  }
 12518  
 12519  var _saveCursorKeyØ00__func__Ø000 [14]int8
 12520  
 12521  func init() {
 12522  	crt.Xstrncpy(nil, &_saveCursorKeyØ00__func__Ø000[0], str(10331), 14)
 12523  }
 12524  
 12525  // C comment
 12526  //  /*
 12527  //  ** Return the value of the integer key or "rowid" for a table btree.
 12528  //  ** This routine is only valid for a cursor that is pointing into a
 12529  //  ** ordinary table btree.  If the cursor points to an index btree or
 12530  //  ** is invalid, the result of this routine is undefined.
 12531  //  */
 12532  func _sqlite3BtreeIntegerKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int64) {
 12533  	func() {
 12534  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12535  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63392), unsafe.Pointer(&_sqlite3BtreeIntegerKeyØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12536  			crt.X__builtin_abort(tls)
 12537  		}
 12538  	}()
 12539  	func() {
 12540  		if int32(_pCur.XeState) != int32(1) {
 12541  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63393), unsafe.Pointer(&_sqlite3BtreeIntegerKeyØ00__func__Ø000), unsafe.Pointer(str(10345)))
 12542  			crt.X__builtin_abort(tls)
 12543  		}
 12544  	}()
 12545  	func() {
 12546  		if _pCur.XcurIntKey == 0 {
 12547  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63394), unsafe.Pointer(&_sqlite3BtreeIntegerKeyØ00__func__Ø000), unsafe.Pointer(str(10372)))
 12548  			crt.X__builtin_abort(tls)
 12549  		}
 12550  	}()
 12551  	_getCellInfo(tls, _pCur)
 12552  	return _pCur.Xinfo.XnKey
 12553  }
 12554  
 12555  var _sqlite3BtreeIntegerKeyØ00__func__Ø000 [23]int8
 12556  
 12557  func init() {
 12558  	crt.Xstrncpy(nil, &_sqlite3BtreeIntegerKeyØ00__func__Ø000[0], str(10388), 23)
 12559  }
 12560  
 12561  func _getCellInfo(tls *crt.TLS, _pCur *XBtCursor) {
 12562  	var _1_iPage int32
 12563  	if int32(_pCur.Xinfo.XnSize) == int32(0) {
 12564  		_1_iPage = int32(_pCur.XiPage)
 12565  		{
 12566  			p := &_pCur.XcurFlags
 12567  			*p = uint8(int32(*p) | int32(2))
 12568  		}
 12569  		_btreeParseCell(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_1_iPage)), int32(_pCur.Xix), &_pCur.Xinfo)
 12570  		goto _1
 12571  	}
 12572  	_assertCellInfo(tls, _pCur)
 12573  _1:
 12574  }
 12575  
 12576  func _btreeParseCell(tls *crt.TLS, _pPage *XMemPage, _iCell int32, _pInfo *XCellInfo) {
 12577  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 12578  		v := _pPage.XxParseCell
 12579  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 12580  	}()(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData))+uintptr(int32(_pPage.XmaskPage)&((int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_iCell)), 0))<<8)|int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_iCell)), uintptr(1))))))), _pInfo)
 12581  }
 12582  
 12583  func _assertCellInfo(tls *crt.TLS, _pCur *XBtCursor) {
 12584  	var _iPage int32
 12585  	var _info XCellInfo
 12586  	_iPage = int32(_pCur.XiPage)
 12587  	crt.Xmemset(tls, unsafe.Pointer(&_info), int32(0), uint64(24))
 12588  	_btreeParseCell(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_iPage)), int32(_pCur.Xix), &_info)
 12589  	func() {
 12590  		if _sqlite3Config.XneverCorrupt != int32(0) && crt.Xmemcmp(tls, unsafe.Pointer(&_info), unsafe.Pointer(&_pCur.Xinfo), uint64(24)) != int32(0) {
 12591  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63355), unsafe.Pointer(&_assertCellInfoØ00__func__Ø000), unsafe.Pointer(str(10411)))
 12592  			crt.X__builtin_abort(tls)
 12593  		}
 12594  	}()
 12595  }
 12596  
 12597  var _assertCellInfoØ00__func__Ø000 [15]int8
 12598  
 12599  func init() {
 12600  	crt.Xstrncpy(nil, &_assertCellInfoØ00__func__Ø000[0], str(10469), 15)
 12601  }
 12602  
 12603  // C comment
 12604  //  /*
 12605  //  ** Return the number of bytes of payload for the entry that pCur is
 12606  //  ** currently pointing to.  For table btrees, this will be the amount
 12607  //  ** of data.  For index btrees, this will be the size of the key.
 12608  //  **
 12609  //  ** The caller must guarantee that the cursor is pointing to a non-NULL
 12610  //  ** valid entry.  In other words, the calling procedure must guarantee
 12611  //  ** that the cursor has Cursor.eState==CURSOR_VALID.
 12612  //  */
 12613  func _sqlite3BtreePayloadSize(tls *crt.TLS, _pCur *XBtCursor) (r0 uint32) {
 12614  	func() {
 12615  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12616  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63409), unsafe.Pointer(&_sqlite3BtreePayloadSizeØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12617  			crt.X__builtin_abort(tls)
 12618  		}
 12619  	}()
 12620  	func() {
 12621  		if int32(_pCur.XeState) != int32(1) {
 12622  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63410), unsafe.Pointer(&_sqlite3BtreePayloadSizeØ00__func__Ø000), unsafe.Pointer(str(10345)))
 12623  			crt.X__builtin_abort(tls)
 12624  		}
 12625  	}()
 12626  	_getCellInfo(tls, _pCur)
 12627  	return _pCur.Xinfo.XnPayload
 12628  }
 12629  
 12630  var _sqlite3BtreePayloadSizeØ00__func__Ø000 [24]int8
 12631  
 12632  func init() {
 12633  	crt.Xstrncpy(nil, &_sqlite3BtreePayloadSizeØ00__func__Ø000[0], str(10484), 24)
 12634  }
 12635  
 12636  // C comment
 12637  //  /*
 12638  //  ** Read part of the payload for the row at which that cursor pCur is currently
 12639  //  ** pointing.  "amt" bytes will be transferred into pBuf[].  The transfer
 12640  //  ** begins at "offset".
 12641  //  **
 12642  //  ** pCur can be pointing to either a table or an index b-tree.
 12643  //  ** If pointing to a table btree, then the content section is read.  If
 12644  //  ** pCur is pointing to an index b-tree then the key section is read.
 12645  //  **
 12646  //  ** For sqlite3BtreePayload(), the caller must ensure that pCur is pointing
 12647  //  ** to a valid row in the table.  For sqlite3BtreePayloadChecked(), the
 12648  //  ** cursor might be invalid or might need to be restored before being read.
 12649  //  **
 12650  //  ** Return SQLITE_OK on success or an error code if anything goes
 12651  //  ** wrong.  An error is returned if "offset+amt" is larger than
 12652  //  ** the available payload.
 12653  //  */
 12654  func _sqlite3BtreePayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf unsafe.Pointer) (r0 int32) {
 12655  	func() {
 12656  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12657  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63755), unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12658  			crt.X__builtin_abort(tls)
 12659  		}
 12660  	}()
 12661  	func() {
 12662  		if int32(_pCur.XeState) != int32(1) {
 12663  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63756), unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000), unsafe.Pointer(str(10345)))
 12664  			crt.X__builtin_abort(tls)
 12665  		}
 12666  	}()
 12667  	func() {
 12668  		if int32(_pCur.XiPage) < int32(0) || (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) == nil {
 12669  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63757), unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000), unsafe.Pointer(str(10508)))
 12670  			crt.X__builtin_abort(tls)
 12671  		}
 12672  	}()
 12673  	func() {
 12674  		if int32(_pCur.Xix) >= int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) {
 12675  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63758), unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000), unsafe.Pointer(str(10552)))
 12676  			crt.X__builtin_abort(tls)
 12677  		}
 12678  	}()
 12679  	return _accessPayload(tls, _pCur, _offset, _amt, (*uint8)(_pBuf), int32(0))
 12680  }
 12681  
 12682  var _sqlite3BtreePayloadØ00__func__Ø000 [20]int8
 12683  
 12684  func init() {
 12685  	crt.Xstrncpy(nil, &_sqlite3BtreePayloadØ00__func__Ø000[0], str(10594), 20)
 12686  }
 12687  
 12688  // C comment
 12689  //  /*
 12690  //  ** This function is used to read or overwrite payload information
 12691  //  ** for the entry that the pCur cursor is pointing to. The eOp
 12692  //  ** argument is interpreted as follows:
 12693  //  **
 12694  //  **   0: The operation is a read. Populate the overflow cache.
 12695  //  **   1: The operation is a write. Populate the overflow cache.
 12696  //  **
 12697  //  ** A total of "amt" bytes are read or written beginning at "offset".
 12698  //  ** Data is read to or from the buffer pBuf.
 12699  //  **
 12700  //  ** The content being read or written might appear on the main page
 12701  //  ** or be scattered out on multiple overflow pages.
 12702  //  **
 12703  //  ** If the current cursor entry uses one or more overflow pages
 12704  //  ** this function may allocate space for and lazily populate
 12705  //  ** the overflow page-list cache array (BtCursor.aOverflow).
 12706  //  ** Subsequent calls use this cache to make seeking to the supplied offset
 12707  //  ** more efficient.
 12708  //  **
 12709  //  ** Once an overflow page-list cache has been allocated, it must be
 12710  //  ** invalidated if some other cursor writes to the same table, or if
 12711  //  ** the cursor is moved to a different row. Additionally, in auto-vacuum
 12712  //  ** mode, the following events may invalidate an overflow page-list cache.
 12713  //  **
 12714  //  **   * An incremental vacuum,
 12715  //  **   * A commit in auto_vacuum="full" mode,
 12716  //  **   * Creating a table (may require moving an overflow page).
 12717  //  */
 12718  func _accessPayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf *uint8, _eOp int32) (r0 int32) {
 12719  	var _rc, _iIdx, _2_a, _6_nOvfl, _16_a int32
 12720  	var _5_ovflSize, _5_nextPage uint32
 12721  	var _aPayload *uint8
 12722  	var _7_aNew *uint32
 12723  	var _18_pDbPage *XPgHdr
 12724  	var _pBt *XBtShared
 12725  	var _pPage *XMemPage
 12726  	_rc = int32(0)
 12727  	_iIdx = int32(0)
 12728  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 12729  	_pBt = (*XBtShared)(_pCur.XpBt)
 12730  	func() {
 12731  		if _pPage == nil {
 12732  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63568), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10614)))
 12733  			crt.X__builtin_abort(tls)
 12734  		}
 12735  	}()
 12736  	func() {
 12737  		if _eOp != int32(0) && _eOp != int32(1) {
 12738  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63569), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10620)))
 12739  			crt.X__builtin_abort(tls)
 12740  		}
 12741  	}()
 12742  	func() {
 12743  		if int32(_pCur.XeState) != int32(1) {
 12744  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63570), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10345)))
 12745  			crt.X__builtin_abort(tls)
 12746  		}
 12747  	}()
 12748  	func() {
 12749  		if int32(_pCur.Xix) >= int32(_pPage.XnCell) {
 12750  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63571), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10637)))
 12751  			crt.X__builtin_abort(tls)
 12752  		}
 12753  	}()
 12754  	func() {
 12755  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12756  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63572), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12757  			crt.X__builtin_abort(tls)
 12758  		}
 12759  	}()
 12760  	_getCellInfo(tls, _pCur)
 12761  	_aPayload = _pCur.Xinfo.XpPayload
 12762  	func() {
 12763  		if (_offset + _amt) > (_pCur.Xinfo.XnPayload) {
 12764  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63576), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10659)))
 12765  			crt.X__builtin_abort(tls)
 12766  		}
 12767  	}()
 12768  	func() {
 12769  		if crt.P2U(unsafe.Pointer(_aPayload)) <= crt.P2U(unsafe.Pointer(_pPage.XaData)) {
 12770  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63578), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10693)))
 12771  			crt.X__builtin_abort(tls)
 12772  		}
 12773  	}()
 12774  	if uint64(int64(uintptr(unsafe.Pointer(_aPayload))-uintptr(unsafe.Pointer(_pPage.XaData)))) > uint64(_pBt.XusableSize-uint32(_pCur.Xinfo.XnLocal)) {
 12775  		return _sqlite3CorruptError(tls, int32(63585))
 12776  	}
 12777  	if _offset >= uint32(_pCur.Xinfo.XnLocal) {
 12778  		goto _16
 12779  	}
 12780  	_2_a = int32(_amt)
 12781  	if (uint32(_2_a) + _offset) > uint32(_pCur.Xinfo.XnLocal) {
 12782  		_2_a = int32(uint32(_pCur.Xinfo.XnLocal) - _offset)
 12783  	}
 12784  	_rc = _copyPayload(tls, unsafe.Pointer(elem15(_aPayload, uintptr(_offset))), unsafe.Pointer(_pBuf), _2_a, _eOp, (*XPgHdr)(_pPage.XpDbPage))
 12785  	_offset = 0
 12786  	*(*uintptr)(unsafe.Pointer(&_pBuf)) += uintptr(_2_a)
 12787  	_amt -= uint32(_2_a)
 12788  	goto _18
 12789  _16:
 12790  	_offset -= uint32(_pCur.Xinfo.XnLocal)
 12791  _18:
 12792  	if _rc != int32(0) || _amt <= (0) {
 12793  		goto _20
 12794  	}
 12795  	_5_ovflSize = _pBt.XusableSize - uint32(4)
 12796  	_5_nextPage = _sqlite3Get4byte(tls, elem15(_aPayload, uintptr(_pCur.Xinfo.XnLocal)))
 12797  	if (int32(_pCur.XcurFlags) & int32(4)) != int32(0) {
 12798  		goto _21
 12799  	}
 12800  	_6_nOvfl = int32(((((_pCur.Xinfo.XnPayload) - uint32(_pCur.Xinfo.XnLocal)) + _5_ovflSize) - uint32(1)) / _5_ovflSize)
 12801  	if _6_nOvfl <= _pCur.XnOvflAlloc {
 12802  		goto _22
 12803  	}
 12804  	_7_aNew = (*uint32)(_sqlite3Realloc(tls, unsafe.Pointer(_pCur.XaOverflow), uint64(_6_nOvfl*int32(2))*uint64(4)))
 12805  	if _7_aNew == nil {
 12806  		return _sqlite3NomemError(tls, int32(63623))
 12807  	}
 12808  	_pCur.XnOvflAlloc = _6_nOvfl * int32(2)
 12809  	_pCur.XaOverflow = _7_aNew
 12810  _22:
 12811  	crt.Xmemset(tls, unsafe.Pointer(_pCur.XaOverflow), int32(0), uint64(_6_nOvfl)*uint64(4))
 12812  	{
 12813  		p := &_pCur.XcurFlags
 12814  		*p = uint8(int32(*p) | int32(4))
 12815  	}
 12816  	goto _25
 12817  _21:
 12818  	if (*elem31(_pCur.XaOverflow, uintptr(_offset/_5_ovflSize))) != 0 {
 12819  		_iIdx = int32(_offset / _5_ovflSize)
 12820  		_5_nextPage = *elem31(_pCur.XaOverflow, uintptr(_iIdx))
 12821  		_offset = _offset % _5_ovflSize
 12822  	}
 12823  _25:
 12824  	func() {
 12825  		if _rc != int32(0) || _amt <= (0) {
 12826  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63643), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10717)))
 12827  			crt.X__builtin_abort(tls)
 12828  		}
 12829  	}()
 12830  _30:
 12831  	if _5_nextPage == 0 {
 12832  		goto _31
 12833  	}
 12834  	func() {
 12835  		if (*elem31(_pCur.XaOverflow, uintptr(_iIdx))) != (0) && (*elem31(_pCur.XaOverflow, uintptr(_iIdx))) != _5_nextPage && _sqlite3Config.XneverCorrupt != int32(0) {
 12836  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63646), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10740)))
 12837  			crt.X__builtin_abort(tls)
 12838  		}
 12839  	}()
 12840  	*elem31(_pCur.XaOverflow, uintptr(_iIdx)) = _5_nextPage
 12841  	if _offset < _5_ovflSize {
 12842  		goto _36
 12843  	}
 12844  	func() {
 12845  		if (int32(_pCur.XcurFlags) & int32(4)) == 0 {
 12846  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63658), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10814)))
 12847  			crt.X__builtin_abort(tls)
 12848  		}
 12849  	}()
 12850  	func() {
 12851  		if (*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb) != (*Xsqlite3)(_pBt.Xdb) {
 12852  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63659), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10846)))
 12853  			crt.X__builtin_abort(tls)
 12854  		}
 12855  	}()
 12856  	if (*elem31(_pCur.XaOverflow, uintptr(_iIdx+int32(1)))) != 0 {
 12857  		_5_nextPage = *elem31(_pCur.XaOverflow, uintptr(_iIdx+int32(1)))
 12858  		goto _42
 12859  	}
 12860  	_rc = _getOverflowPage(tls, _pBt, _5_nextPage, nil, &_5_nextPage)
 12861  _42:
 12862  	_offset -= _5_ovflSize
 12863  	goto _43
 12864  _36:
 12865  	_16_a = int32(_amt)
 12866  	if (uint32(_16_a) + _offset) > _5_ovflSize {
 12867  		_16_a = int32(_5_ovflSize - _offset)
 12868  	}
 12869  	_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.XpPager), _5_nextPage, &_18_pDbPage, func() int32 {
 12870  		if _eOp == int32(0) {
 12871  			return int32(2)
 12872  		}
 12873  		return int32(0)
 12874  	}())
 12875  	if _rc == int32(0) {
 12876  		_aPayload = (*uint8)(_sqlite3PagerGetData(tls, _18_pDbPage))
 12877  		_5_nextPage = _sqlite3Get4byte(tls, _aPayload)
 12878  		_rc = _copyPayload(tls, unsafe.Pointer(elem15(_aPayload, uintptr(_offset+uint32(4)))), unsafe.Pointer(_pBuf), _16_a, _eOp, _18_pDbPage)
 12879  		_sqlite3PagerUnref(tls, _18_pDbPage)
 12880  		_offset = 0
 12881  	}
 12882  	_amt -= uint32(_16_a)
 12883  	if _amt == (0) {
 12884  		return _rc
 12885  	}
 12886  	*(*uintptr)(unsafe.Pointer(&_pBuf)) += uintptr(_16_a)
 12887  _43:
 12888  	if _rc != 0 {
 12889  		goto _31
 12890  	}
 12891  	_iIdx += 1
 12892  	goto _30
 12893  _31:
 12894  _20:
 12895  	if (_rc == int32(0)) && (_amt > (0)) {
 12896  		return _sqlite3CorruptError(tls, int32(63732))
 12897  	}
 12898  	return _rc
 12899  }
 12900  
 12901  var _accessPayloadØ00__func__Ø000 [14]int8
 12902  
 12903  func init() {
 12904  	crt.Xstrncpy(nil, &_accessPayloadØ00__func__Ø000[0], str(10872), 14)
 12905  }
 12906  
 12907  // C comment
 12908  //  /*
 12909  //  ** The SQLITE_*_BKPT macros are substitutes for the error codes with
 12910  //  ** the same name but without the _BKPT suffix.  These macros invoke
 12911  //  ** routines that report the line-number on which the error originated
 12912  //  ** using sqlite3_log().  The routines also provide a convenient place
 12913  //  ** to set a debugger breakpoint.
 12914  //  */
 12915  func _sqlite3CorruptError(tls *crt.TLS, _lineno int32) (r0 int32) {
 12916  	return _reportError(tls, int32(11), _lineno, str(10886))
 12917  }
 12918  
 12919  // C comment
 12920  //  /*
 12921  //  ** Copy data from a buffer to a page, or from a page to a buffer.
 12922  //  **
 12923  //  ** pPayload is a pointer to data stored on database page pDbPage.
 12924  //  ** If argument eOp is false, then nByte bytes of data are copied
 12925  //  ** from pPayload to the buffer pointed at by pBuf. If eOp is true,
 12926  //  ** then sqlite3PagerWrite() is called on pDbPage and nByte bytes
 12927  //  ** of data are copied from the buffer pBuf to pPayload.
 12928  //  **
 12929  //  ** SQLITE_OK is returned on success, otherwise an error code.
 12930  //  */
 12931  func _copyPayload(tls *crt.TLS, _pPayload unsafe.Pointer, _pBuf unsafe.Pointer, _nByte int32, _eOp int32, _pDbPage *XPgHdr) (r0 int32) {
 12932  	var _1_rc int32
 12933  	if _eOp == 0 {
 12934  		goto _0
 12935  	}
 12936  	_1_rc = _sqlite3PagerWrite(tls, _pDbPage)
 12937  	if _1_rc != int32(0) {
 12938  		return _1_rc
 12939  	}
 12940  	crt.Xmemcpy(tls, _pPayload, _pBuf, uint64(_nByte))
 12941  	goto _2
 12942  _0:
 12943  	crt.Xmemcpy(tls, _pBuf, _pPayload, uint64(_nByte))
 12944  _2:
 12945  	return int32(0)
 12946  }
 12947  
 12948  // C comment
 12949  //  /*
 12950  //  ** Mark a data page as writeable. This routine must be called before
 12951  //  ** making changes to a page. The caller must check the return value
 12952  //  ** of this function and be careful not to change any page data unless
 12953  //  ** this routine returns SQLITE_OK.
 12954  //  **
 12955  //  ** The difference between this function and pager_write() is that this
 12956  //  ** function also deals with the special case where 2 or more pages
 12957  //  ** fit on a single disk sector. In this case all co-resident pages
 12958  //  ** must have been written to the journal file before returning.
 12959  //  **
 12960  //  ** If an error occurs, SQLITE_NOMEM or an IO error code is returned
 12961  //  ** as appropriate. Otherwise, SQLITE_OK.
 12962  //  */
 12963  func _sqlite3PagerWrite(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 12964  	var _pPager *XPager
 12965  	_pPager = (*XPager)(_pPg.XpPager)
 12966  	func() {
 12967  		if (int32(_pPg.Xflags) & int32(32)) != int32(0) {
 12968  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52989), unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000), unsafe.Pointer(str(10906)))
 12969  			crt.X__builtin_abort(tls)
 12970  		}
 12971  	}()
 12972  	func() {
 12973  		if int32(_pPager.XeState) < int32(2) {
 12974  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52990), unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000), unsafe.Pointer(str(10935)))
 12975  			crt.X__builtin_abort(tls)
 12976  		}
 12977  	}()
 12978  	func() {
 12979  		if _assert_pager_state(tls, _pPager) == 0 {
 12980  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52991), unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000), unsafe.Pointer(str(10971)))
 12981  			crt.X__builtin_abort(tls)
 12982  		}
 12983  	}()
 12984  	if (int32(_pPg.Xflags)&int32(4)) == int32(0) || _pPager.XdbSize < _pPg.Xpgno {
 12985  		goto _7
 12986  	}
 12987  	if _pPager.XnSavepoint != 0 {
 12988  		return _subjournalPageIfRequired(tls, _pPg)
 12989  	}
 12990  	return int32(0)
 12991  
 12992  _7:
 12993  	if _pPager.XerrCode != 0 {
 12994  		return _pPager.XerrCode
 12995  	}
 12996  	if _pPager.XsectorSize > uint32(_pPager.XpageSize) {
 12997  		func() {
 12998  			if int32(_pPager.XtempFile) != int32(0) {
 12999  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52998), unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000), unsafe.Pointer(str(10998)))
 13000  				crt.X__builtin_abort(tls)
 13001  			}
 13002  		}()
 13003  		return _pagerWriteLargeSector(tls, _pPg)
 13004  	}
 13005  	return _pager_write(tls, _pPg)
 13006  }
 13007  
 13008  var _sqlite3PagerWriteØ00__func__Ø000 [18]int8
 13009  
 13010  func init() {
 13011  	crt.Xstrncpy(nil, &_sqlite3PagerWriteØ00__func__Ø000[0], str(11018), 18)
 13012  }
 13013  
 13014  // C comment
 13015  //  /*
 13016  //  ** Usage:
 13017  //  **
 13018  //  **   assert( assert_pager_state(pPager) );
 13019  //  **
 13020  //  ** This function runs many asserts to try to find inconsistencies in
 13021  //  ** the internal state of the Pager object.
 13022  //  */
 13023  func _assert_pager_state(tls *crt.TLS, _p *XPager) (r0 int32) {
 13024  	var _pPager *XPager
 13025  	_pPager = _p
 13026  	func() {
 13027  		if int32(_p.XeState) != int32(0) && int32(_p.XeState) != int32(1) && int32(_p.XeState) != int32(2) && int32(_p.XeState) != int32(3) && int32(_p.XeState) != int32(4) && int32(_p.XeState) != int32(5) && int32(_p.XeState) != int32(6) {
 13028  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47769), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11036)))
 13029  			crt.X__builtin_abort(tls)
 13030  		}
 13031  	}()
 13032  	func() {
 13033  		if int32(_p.XtempFile) != int32(0) && int32(_p.XeLock) != int32(4) {
 13034  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47782), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11250)))
 13035  			crt.X__builtin_abort(tls)
 13036  		}
 13037  	}()
 13038  	func() {
 13039  		if int32(_p.XtempFile) != int32(0) && _pPager.XchangeCountDone == 0 {
 13040  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47783), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11293)))
 13041  			crt.X__builtin_abort(tls)
 13042  		}
 13043  	}()
 13044  	func() {
 13045  		if int32(_p.XjournalMode) != int32(2) && _p.XuseJournal == 0 {
 13046  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47788), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11335)))
 13047  			crt.X__builtin_abort(tls)
 13048  		}
 13049  	}()
 13050  	func() {
 13051  		if int32(_p.XjournalMode) == int32(2) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.Xjfd).XpMethods) != nil {
 13052  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47789), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11390)))
 13053  			crt.X__builtin_abort(tls)
 13054  		}
 13055  	}()
 13056  	if _pPager.XmemDb != 0 {
 13057  		func() {
 13058  			if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.Xfd).XpMethods) != nil {
 13059  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47800), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11447)))
 13060  				crt.X__builtin_abort(tls)
 13061  			}
 13062  		}()
 13063  		func() {
 13064  			if _p.XnoSync == 0 {
 13065  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47801), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11462)))
 13066  				crt.X__builtin_abort(tls)
 13067  			}
 13068  		}()
 13069  		func() {
 13070  			if int32(_p.XjournalMode) != int32(2) && int32(_p.XjournalMode) != int32(4) {
 13071  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47802), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11472)))
 13072  				crt.X__builtin_abort(tls)
 13073  			}
 13074  		}()
 13075  		func() {
 13076  			if int32(_p.XeState) == int32(6) || int32(_p.XeState) == int32(0) {
 13077  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47805), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11554)))
 13078  				crt.X__builtin_abort(tls)
 13079  			}
 13080  		}()
 13081  		func() {
 13082  			if bool2int((*XWal)(_p.XpWal) != nil) != int32(0) {
 13083  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47806), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11602)))
 13084  				crt.X__builtin_abort(tls)
 13085  			}
 13086  		}()
 13087  	}
 13088  	func() {
 13089  		if int32(_pPager.XchangeCountDone) != int32(0) && int32(_pPager.XeLock) < int32(2) {
 13090  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47812), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11620)))
 13091  			crt.X__builtin_abort(tls)
 13092  		}
 13093  	}()
 13094  	func() {
 13095  		if int32(_p.XeLock) == int32(3) {
 13096  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47813), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11679)))
 13097  			crt.X__builtin_abort(tls)
 13098  		}
 13099  	}()
 13100  	switch int32(_p.XeState) {
 13101  	case int32(0):
 13102  		goto _39
 13103  	case int32(1):
 13104  		goto _40
 13105  	case int32(2):
 13106  		goto _41
 13107  	case int32(3):
 13108  		goto _42
 13109  	case int32(4):
 13110  		goto _43
 13111  	case int32(5):
 13112  		goto _44
 13113  	case int32(6):
 13114  		goto _45
 13115  	default:
 13116  		goto _46
 13117  	}
 13118  
 13119  _39:
 13120  	func() {
 13121  		if _pPager.XmemDb != 0 {
 13122  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47817), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11702)))
 13123  			crt.X__builtin_abort(tls)
 13124  		}
 13125  	}()
 13126  	func() {
 13127  		if _pPager.XerrCode != int32(0) {
 13128  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47818), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11709)))
 13129  			crt.X__builtin_abort(tls)
 13130  		}
 13131  	}()
 13132  	func() {
 13133  		if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache)) != int32(0) && _pPager.XtempFile == 0 {
 13134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47819), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11736)))
 13135  			crt.X__builtin_abort(tls)
 13136  		}
 13137  	}()
 13138  	goto _46
 13139  _40:
 13140  	func() {
 13141  		if _pPager.XerrCode != int32(0) {
 13142  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47823), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11709)))
 13143  			crt.X__builtin_abort(tls)
 13144  		}
 13145  	}()
 13146  	func() {
 13147  		if int32(_p.XeLock) == int32(5) {
 13148  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47824), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11798)))
 13149  			crt.X__builtin_abort(tls)
 13150  		}
 13151  	}()
 13152  	func() {
 13153  		if int32(_p.XeLock) < int32(1) {
 13154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47825), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11821)))
 13155  			crt.X__builtin_abort(tls)
 13156  		}
 13157  	}()
 13158  	goto _46
 13159  _41:
 13160  	func() {
 13161  		if int32(_p.XeLock) == int32(5) {
 13162  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47829), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11798)))
 13163  			crt.X__builtin_abort(tls)
 13164  		}
 13165  	}()
 13166  	func() {
 13167  		if _pPager.XerrCode != int32(0) {
 13168  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47830), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11709)))
 13169  			crt.X__builtin_abort(tls)
 13170  		}
 13171  	}()
 13172  	if (*XWal)(_pPager.XpWal) == nil {
 13173  		func() {
 13174  			if int32(_p.XeLock) < int32(2) {
 13175  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47832), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11843)))
 13176  				crt.X__builtin_abort(tls)
 13177  			}
 13178  		}()
 13179  	}
 13180  	func() {
 13181  		if _pPager.XdbSize != _pPager.XdbOrigSize {
 13182  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47834), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11867)))
 13183  			crt.X__builtin_abort(tls)
 13184  		}
 13185  	}()
 13186  	func() {
 13187  		if _pPager.XdbOrigSize != _pPager.XdbFileSize {
 13188  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47835), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11902)))
 13189  			crt.X__builtin_abort(tls)
 13190  		}
 13191  	}()
 13192  	func() {
 13193  		if _pPager.XdbOrigSize != _pPager.XdbHintSize {
 13194  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47836), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11941)))
 13195  			crt.X__builtin_abort(tls)
 13196  		}
 13197  	}()
 13198  	func() {
 13199  		if int32(_pPager.XsetMaster) != int32(0) {
 13200  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47837), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11980)))
 13201  			crt.X__builtin_abort(tls)
 13202  		}
 13203  	}()
 13204  	goto _46
 13205  _42:
 13206  	func() {
 13207  		if int32(_p.XeLock) == int32(5) {
 13208  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47841), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11798)))
 13209  			crt.X__builtin_abort(tls)
 13210  		}
 13211  	}()
 13212  	func() {
 13213  		if _pPager.XerrCode != int32(0) {
 13214  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47842), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11709)))
 13215  			crt.X__builtin_abort(tls)
 13216  		}
 13217  	}()
 13218  	if (*XWal)(_pPager.XpWal) == nil {
 13219  		func() {
 13220  			if int32(_p.XeLock) < int32(2) {
 13221  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47849), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11843)))
 13222  				crt.X__builtin_abort(tls)
 13223  			}
 13224  		}()
 13225  		func() {
 13226  			if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.Xjfd).XpMethods) == nil && int32(_p.XjournalMode) != int32(2) && int32(_p.XjournalMode) != int32(5) {
 13227  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47850), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12001)))
 13228  				crt.X__builtin_abort(tls)
 13229  			}
 13230  		}()
 13231  	}
 13232  	func() {
 13233  		if _pPager.XdbOrigSize != _pPager.XdbFileSize {
 13234  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47855), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11902)))
 13235  			crt.X__builtin_abort(tls)
 13236  		}
 13237  	}()
 13238  	func() {
 13239  		if _pPager.XdbOrigSize != _pPager.XdbHintSize {
 13240  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47856), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11941)))
 13241  			crt.X__builtin_abort(tls)
 13242  		}
 13243  	}()
 13244  	goto _46
 13245  _43:
 13246  	func() {
 13247  		if int32(_p.XeLock) != int32(4) {
 13248  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47860), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12098)))
 13249  			crt.X__builtin_abort(tls)
 13250  		}
 13251  	}()
 13252  	func() {
 13253  		if _pPager.XerrCode != int32(0) {
 13254  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47861), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11709)))
 13255  			crt.X__builtin_abort(tls)
 13256  		}
 13257  	}()
 13258  	func() {
 13259  		if (*XWal)(_pPager.XpWal) != nil {
 13260  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47862), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12123)))
 13261  			crt.X__builtin_abort(tls)
 13262  		}
 13263  	}()
 13264  	func() {
 13265  		if int32(_p.XeLock) < int32(4) {
 13266  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47863), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12144)))
 13267  			crt.X__builtin_abort(tls)
 13268  		}
 13269  	}()
 13270  	func() {
 13271  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.Xjfd).XpMethods) == nil && int32(_p.XjournalMode) != int32(2) && int32(_p.XjournalMode) != int32(5) {
 13272  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47864), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12001)))
 13273  			crt.X__builtin_abort(tls)
 13274  		}
 13275  	}()
 13276  	func() {
 13277  		if _pPager.XdbOrigSize > _pPager.XdbHintSize {
 13278  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47868), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12169)))
 13279  			crt.X__builtin_abort(tls)
 13280  		}
 13281  	}()
 13282  	goto _46
 13283  _44:
 13284  	func() {
 13285  		if int32(_p.XeLock) != int32(4) {
 13286  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47872), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12098)))
 13287  			crt.X__builtin_abort(tls)
 13288  		}
 13289  	}()
 13290  	func() {
 13291  		if _pPager.XerrCode != int32(0) {
 13292  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47873), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(11709)))
 13293  			crt.X__builtin_abort(tls)
 13294  		}
 13295  	}()
 13296  	func() {
 13297  		if (*XWal)(_pPager.XpWal) != nil {
 13298  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47874), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12123)))
 13299  			crt.X__builtin_abort(tls)
 13300  		}
 13301  	}()
 13302  	func() {
 13303  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.Xjfd).XpMethods) == nil && int32(_p.XjournalMode) != int32(2) && int32(_p.XjournalMode) != int32(5) {
 13304  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47875), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12001)))
 13305  			crt.X__builtin_abort(tls)
 13306  		}
 13307  	}()
 13308  	goto _46
 13309  _45:
 13310  	func() {
 13311  		if _pPager.XerrCode == int32(0) {
 13312  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47886), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12208)))
 13313  			crt.X__builtin_abort(tls)
 13314  		}
 13315  	}()
 13316  	func() {
 13317  		if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache)) <= int32(0) && _pPager.XtempFile == 0 {
 13318  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(47887), unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000), unsafe.Pointer(str(12235)))
 13319  			crt.X__builtin_abort(tls)
 13320  		}
 13321  	}()
 13322  	goto _46
 13323  _46:
 13324  	return int32(1)
 13325  }
 13326  
 13327  var _assert_pager_stateØ00__func__Ø000 [19]int8
 13328  
 13329  func init() {
 13330  	crt.Xstrncpy(nil, &_assert_pager_stateØ00__func__Ø000[0], str(12296), 19)
 13331  }
 13332  
 13333  // C comment
 13334  //  /*
 13335  //  ** Return the total number of references to all pages held by the cache.
 13336  //  **
 13337  //  ** This is not the total number of pages referenced, but the sum of the
 13338  //  ** reference count for all pages.
 13339  //  */
 13340  func _sqlite3PcacheRefCount(tls *crt.TLS, _pCache *XPCache) (r0 int32) {
 13341  	return _pCache.XnRefSum
 13342  }
 13343  
 13344  func _subjournalPageIfRequired(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 13345  	if _subjRequiresPage(tls, _pPg) != 0 {
 13346  		return _subjournalPage(tls, _pPg)
 13347  	}
 13348  	return int32(0)
 13349  }
 13350  
 13351  // C comment
 13352  //  /*
 13353  //  ** Return true if it is necessary to write page *pPg into the sub-journal.
 13354  //  ** A page needs to be written into the sub-journal if there exists one
 13355  //  ** or more open savepoints for which:
 13356  //  **
 13357  //  **   * The page-number is less than or equal to PagerSavepoint.nOrig, and
 13358  //  **   * The bit corresponding to the page-number is not set in
 13359  //  **     PagerSavepoint.pInSavepoint.
 13360  //  */
 13361  func _subjRequiresPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 13362  	var _i int32
 13363  	var _pgno uint32
 13364  	var _pPager *XPager
 13365  	var _p *XPagerSavepoint
 13366  	_pPager = (*XPager)(_pPg.XpPager)
 13367  	_pgno = _pPg.Xpgno
 13368  	_i = int32(0)
 13369  _0:
 13370  	if _i >= _pPager.XnSavepoint {
 13371  		goto _3
 13372  	}
 13373  	_p = elem32((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_i))
 13374  	if (_p.XnOrig >= _pgno) && (int32(0) == _sqlite3BitvecTestNotNull(tls, (*XBitvec)(_p.XpInSavepoint), _pgno)) {
 13375  		return int32(1)
 13376  	}
 13377  	_i += 1
 13378  	goto _0
 13379  _3:
 13380  	return int32(0)
 13381  }
 13382  
 13383  // C comment
 13384  //  /*
 13385  //  ** Check to see if the i-th bit is set.  Return true or false.
 13386  //  ** If p is NULL (if the bitmap has not been created) or if
 13387  //  ** i is out of range, then return false.
 13388  //  */
 13389  func _sqlite3BitvecTestNotNull(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) {
 13390  	var _1_bin, _4_h uint32
 13391  	func() {
 13392  		if _p == nil {
 13393  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(43840), unsafe.Pointer(&_sqlite3BitvecTestNotNullØ00__func__Ø000), unsafe.Pointer(str(807)))
 13394  			crt.X__builtin_abort(tls)
 13395  		}
 13396  	}()
 13397  	_i -= 1
 13398  	if _i >= _p.XiSize {
 13399  		return int32(0)
 13400  	}
 13401  _2:
 13402  	if _p.XiDivisor == 0 {
 13403  		goto _4
 13404  	}
 13405  	_1_bin = _i / _p.XiDivisor
 13406  	_i = _i % _p.XiDivisor
 13407  	_p = *elem33((**XBitvec)(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin))
 13408  	if _p == nil {
 13409  		return int32(0)
 13410  	}
 13411  	goto _2
 13412  _4:
 13413  	if uint64(_p.XiSize) <= uint64(3968) {
 13414  		return bool2int((int32(*elem15((*uint8)(unsafe.Pointer((*[496]uint8)(unsafe.Pointer(&_p.Xu)))), uintptr(_i/uint32(8)))) & (int32(1) << uint(int32(_i&uint32(7))))) != int32(0))
 13415  	}
 13416  	_4_h = uint32(uint64(postInc34(&_i, uint32(1))*uint32(1)) % uint64(124))
 13417  _8:
 13418  	if (*elem31((*uint32)(unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_4_h))) == 0 {
 13419  		goto _9
 13420  	}
 13421  	if (*elem31((*uint32)(unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_4_h))) == _i {
 13422  		return int32(1)
 13423  	}
 13424  	_4_h = uint32(uint64(_4_h+uint32(1)) % uint64(124))
 13425  	goto _8
 13426  _9:
 13427  	return int32(0)
 13428  }
 13429  
 13430  var _sqlite3BitvecTestNotNullØ00__func__Ø000 [25]int8
 13431  
 13432  func init() {
 13433  	crt.Xstrncpy(nil, &_sqlite3BitvecTestNotNullØ00__func__Ø000[0], str(12315), 25)
 13434  }
 13435  
 13436  // C comment
 13437  //  /*
 13438  //  ** Append a record of the current state of page pPg to the sub-journal.
 13439  //  **
 13440  //  ** If successful, set the bit corresponding to pPg->pgno in the bitvecs
 13441  //  ** for all open savepoints before returning.
 13442  //  **
 13443  //  ** This function returns SQLITE_OK if everything is successful, an IO
 13444  //  ** error code if the attempt to write to the sub-journal fails, or
 13445  //  ** SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint
 13446  //  ** bitvec.
 13447  //  */
 13448  func _subjournalPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 13449  	var _rc int32
 13450  	var _2_offset int64
 13451  	var _2_pData2 *int8
 13452  	var _2_pData unsafe.Pointer
 13453  	var _pPager *XPager
 13454  	_rc = int32(0)
 13455  	_pPager = (*XPager)(_pPg.XpPager)
 13456  	if int32(_pPager.XjournalMode) == int32(2) {
 13457  		goto _0
 13458  	}
 13459  	func() {
 13460  		if _pPager.XuseJournal == 0 {
 13461  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51384), unsafe.Pointer(&_subjournalPageØ00__func__Ø000), unsafe.Pointer(str(12340)))
 13462  			crt.X__builtin_abort(tls)
 13463  		}
 13464  	}()
 13465  	func() {
 13466  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil && (*XWal)(_pPager.XpWal) == nil {
 13467  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51385), unsafe.Pointer(&_subjournalPageØ00__func__Ø000), unsafe.Pointer(str(12359)))
 13468  			crt.X__builtin_abort(tls)
 13469  		}
 13470  	}()
 13471  	func() {
 13472  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xsjfd).XpMethods) == nil && _pPager.XnSubRec != (0) {
 13473  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51386), unsafe.Pointer(&_subjournalPageØ00__func__Ø000), unsafe.Pointer(str(12402)))
 13474  			crt.X__builtin_abort(tls)
 13475  		}
 13476  	}()
 13477  	func() {
 13478  		if (*XWal)(_pPager.XpWal) == nil && _pageInJournal(tls, _pPager, _pPg) == 0 && _pPg.Xpgno <= _pPager.XdbOrigSize {
 13479  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51387), unsafe.Pointer(&_subjournalPageØ00__func__Ø000), unsafe.Pointer(str(12445)))
 13480  			crt.X__builtin_abort(tls)
 13481  		}
 13482  	}()
 13483  	_rc = _openSubJournal(tls, _pPager)
 13484  	if _rc != int32(0) {
 13485  		goto _13
 13486  	}
 13487  	_2_pData = _pPg.XpData
 13488  	_2_offset = int64(_pPager.XnSubRec) * int64(int32(4)+_pPager.XpageSize)
 13489  	_2_pData2 = (*int8)(_2_pData)
 13490  	_rc = _write32bits(tls, (*Xsqlite3_file)(_pPager.Xsjfd), _2_offset, _pPg.Xpgno)
 13491  	if _rc == int32(0) {
 13492  		_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xsjfd), unsafe.Pointer(_2_pData2), _pPager.XpageSize, _2_offset+int64(4))
 13493  	}
 13494  _13:
 13495  _0:
 13496  	if _rc == int32(0) {
 13497  		_pPager.XnSubRec += 1
 13498  		func() {
 13499  			if _pPager.XnSavepoint <= int32(0) {
 13500  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51415), unsafe.Pointer(&_subjournalPageØ00__func__Ø000), unsafe.Pointer(str(12527)))
 13501  				crt.X__builtin_abort(tls)
 13502  			}
 13503  		}()
 13504  		_rc = _addToSavepointBitvecs(tls, _pPager, _pPg.Xpgno)
 13505  	}
 13506  	return _rc
 13507  }
 13508  
 13509  var _subjournalPageØ00__func__Ø000 [15]int8
 13510  
 13511  func init() {
 13512  	crt.Xstrncpy(nil, &_subjournalPageØ00__func__Ø000[0], str(12548), 15)
 13513  }
 13514  
 13515  // C comment
 13516  //  /*
 13517  //  ** Return true if the page is already in the journal file.
 13518  //  */
 13519  func _pageInJournal(tls *crt.TLS, _pPager *XPager, _pPg *XPgHdr) (r0 int32) {
 13520  	return _sqlite3BitvecTest(tls, (*XBitvec)(_pPager.XpInJournal), _pPg.Xpgno)
 13521  }
 13522  
 13523  func _sqlite3BitvecTest(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) {
 13524  	return bool2int((_p != nil) && _sqlite3BitvecTestNotNull(tls, _p, _i) != 0)
 13525  }
 13526  
 13527  // C comment
 13528  //  /*
 13529  //  ** Ensure that the sub-journal file is open. If it is already open, this
 13530  //  ** function is a no-op.
 13531  //  **
 13532  //  ** SQLITE_OK is returned if everything goes according to plan. An
 13533  //  ** SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen()
 13534  //  ** fails.
 13535  //  */
 13536  func _openSubJournal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 13537  	var _rc, _1_flags, _1_nStmtSpill int32
 13538  	_rc = int32(0)
 13539  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xsjfd).XpMethods) != nil {
 13540  		goto _0
 13541  	}
 13542  	_1_flags = int32(8222)
 13543  	_1_nStmtSpill = _sqlite3Config.XnStmtSpill
 13544  	if (int32(_pPager.XjournalMode) == int32(4)) || (_pPager.XsubjInMemory != 0) {
 13545  		_1_nStmtSpill = int32(-1)
 13546  	}
 13547  	_rc = _sqlite3JournalOpen(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), nil, (*Xsqlite3_file)(_pPager.Xsjfd), _1_flags, _1_nStmtSpill)
 13548  _0:
 13549  	return _rc
 13550  }
 13551  
 13552  // C comment
 13553  //  /*
 13554  //  ** Open a journal file.
 13555  //  **
 13556  //  ** The behaviour of the journal file depends on the value of parameter
 13557  //  ** nSpill. If nSpill is 0, then the journal file is always create and
 13558  //  ** accessed using the underlying VFS. If nSpill is less than zero, then
 13559  //  ** all content is always stored in main-memory. Finally, if nSpill is a
 13560  //  ** positive value, then the journal file is initially created in-memory
 13561  //  ** but may be flushed to disk later on. In this case the journal file is
 13562  //  ** flushed to disk either when it grows larger than nSpill bytes in size,
 13563  //  ** or when sqlite3JournalCreate() is called.
 13564  //  */
 13565  func _sqlite3JournalOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zName *int8, _pJfd *Xsqlite3_file, _flags int32, _nSpill int32) (r0 int32) {
 13566  	var _p *XMemJournal
 13567  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13568  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(88))
 13569  	if _nSpill == int32(0) {
 13570  		return _sqlite3OsOpen(tls, _pVfs, _zName, _pJfd, _flags, nil)
 13571  	}
 13572  	if _nSpill > int32(0) {
 13573  		_p.XnChunkSize = _nSpill
 13574  		goto _2
 13575  	}
 13576  	_p.XnChunkSize = int32(1016)
 13577  	func() {
 13578  		if uint64(1024) != (uint64(16) + uint64(_p.XnChunkSize-int32(8))) {
 13579  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89134), unsafe.Pointer(&_sqlite3JournalOpenØ00__func__Ø000), unsafe.Pointer(str(12563)))
 13580  			crt.X__builtin_abort(tls)
 13581  		}
 13582  	}()
 13583  _2:
 13584  	*(**Xsqlite3_io_methods)(unsafe.Pointer(&_p.XpMethod)) = &_MemJournalMethods
 13585  	_p.XnSpill = _nSpill
 13586  	_p.Xflags = _flags
 13587  	_p.XzJournal = _zName
 13588  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_p.XpVfs)) = _pVfs
 13589  	return int32(0)
 13590  }
 13591  
 13592  // C comment
 13593  //  /*
 13594  //  ** The next group of routines are convenience wrappers around the
 13595  //  ** VFS methods.
 13596  //  */
 13597  func _sqlite3OsOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _pFile *Xsqlite3_file, _flags int32, _pFlagsOut *int32) (r0 int32) {
 13598  	var _rc int32
 13599  	_rc = func() func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32 {
 13600  		v := _pVfs.XxOpen
 13601  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32)(unsafe.Pointer(&v))
 13602  	}()(tls, _pVfs, _zPath, _pFile, _flags&int32(556927), _pFlagsOut)
 13603  	func() {
 13604  		if _rc != int32(0) && (*Xsqlite3_io_methods)(_pFile.XpMethods) != nil {
 13605  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20292), unsafe.Pointer(&_sqlite3OsOpenØ00__func__Ø000), unsafe.Pointer(str(12623)))
 13606  			crt.X__builtin_abort(tls)
 13607  		}
 13608  	}()
 13609  	return _rc
 13610  }
 13611  
 13612  var _sqlite3OsOpenØ00__func__Ø000 [14]int8
 13613  
 13614  func init() {
 13615  	crt.Xstrncpy(nil, &_sqlite3OsOpenØ00__func__Ø000[0], str(12659), 14)
 13616  }
 13617  
 13618  var _sqlite3JournalOpenØ00__func__Ø000 [19]int8
 13619  
 13620  func init() {
 13621  	crt.Xstrncpy(nil, &_sqlite3JournalOpenØ00__func__Ø000[0], str(12673), 19)
 13622  }
 13623  
 13624  // C comment
 13625  //  /*
 13626  //  ** Table of methods for MemJournal sqlite3_file object.
 13627  //  */
 13628  var _MemJournalMethods Xsqlite3_io_methods
 13629  
 13630  func init() {
 13631  	_MemJournalMethods = Xsqlite3_io_methods{XiVersion: int32(1), XxClose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 13632  		f func(*crt.TLS, *Xsqlite3_file) int32
 13633  	}{_memjrnlClose})), XxRead: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
 13634  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
 13635  	}{_memjrnlRead})), XxWrite: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
 13636  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
 13637  	}{_memjrnlWrite})), XxTruncate: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
 13638  		f func(*crt.TLS, *Xsqlite3_file, int64) int32
 13639  	}{_memjrnlTruncate})), XxSync: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 13640  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
 13641  	}{_memjrnlSync})), XxFileSize: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
 13642  		f func(*crt.TLS, *Xsqlite3_file, *int64) int32
 13643  	}{_memjrnlFileSize}))}
 13644  }
 13645  
 13646  // C comment
 13647  //  /*
 13648  //  ** Close the file.
 13649  //  */
 13650  func _memjrnlClose(tls *crt.TLS, _pJfd *Xsqlite3_file) (r0 int32) {
 13651  	var _p *XMemJournal
 13652  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13653  	_memjrnlFreeChunks(tls, _p)
 13654  	return int32(0)
 13655  }
 13656  
 13657  // C comment
 13658  //  /*
 13659  //  ** Free the list of FileChunk structures headed at MemJournal.pFirst.
 13660  //  */
 13661  func _memjrnlFreeChunks(tls *crt.TLS, _p *XMemJournal) {
 13662  	var _pIter, _pNext *XFileChunk
 13663  	_pIter = (*XFileChunk)(_p.XpFirst)
 13664  _0:
 13665  	if _pIter == nil {
 13666  		goto _3
 13667  	}
 13668  	_pNext = (*XFileChunk)(_pIter.XpNext)
 13669  	Xsqlite3_free(tls, unsafe.Pointer(_pIter))
 13670  	_pIter = _pNext
 13671  	goto _0
 13672  _3:
 13673  	*(**XFileChunk)(unsafe.Pointer(&_p.XpFirst)) = nil
 13674  }
 13675  
 13676  // C comment
 13677  //  /*
 13678  //  ** Read data from the in-memory journal file.  This is the implementation
 13679  //  ** of the sqlite3_vfs.xRead method.
 13680  //  */
 13681  func _memjrnlRead(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iAmt int32, _iOfst int64) (r0 int32) {
 13682  	var _nRead, _iChunkOffset, _4_iSpace, _4_nCopy int32
 13683  	var _1_iOff int64
 13684  	var _zOut *uint8
 13685  	var _p *XMemJournal
 13686  	var _pChunk *XFileChunk
 13687  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13688  	_zOut = (*uint8)(_zBuf)
 13689  	_nRead = _iAmt
 13690  	func() {
 13691  		if (int64(_iAmt) + _iOfst) > (_p.Xendpoint.XiOffset) {
 13692  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88870), unsafe.Pointer(&_memjrnlReadØ00__func__Ø000), unsafe.Pointer(str(12692)))
 13693  			crt.X__builtin_abort(tls)
 13694  		}
 13695  	}()
 13696  	func() {
 13697  		if (_p.Xreadpoint.XiOffset) != (0) && (*XFileChunk)(_p.Xreadpoint.XpChunk) == nil {
 13698  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88871), unsafe.Pointer(&_memjrnlReadØ00__func__Ø000), unsafe.Pointer(str(12726)))
 13699  			crt.X__builtin_abort(tls)
 13700  		}
 13701  	}()
 13702  	if (_p.Xreadpoint.XiOffset) == _iOfst && _iOfst != (0) {
 13703  		goto _6
 13704  	}
 13705  	_1_iOff = int64(0)
 13706  	_pChunk = (*XFileChunk)(_p.XpFirst)
 13707  _7:
 13708  	if func() int32 {
 13709  		if _pChunk != nil {
 13710  			return int32(1)
 13711  		}
 13712  		return func() int32 {
 13713  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88875), unsafe.Pointer(&_memjrnlReadØ00__func__Ø000), unsafe.Pointer(str(4809)))
 13714  			crt.X__builtin_abort(tls)
 13715  			return int32(0)
 13716  		}()
 13717  	}() == 0 || (_1_iOff+int64(_p.XnChunkSize)) > _iOfst {
 13718  		goto _13
 13719  	}
 13720  	_1_iOff += int64(_p.XnChunkSize)
 13721  	_pChunk = (*XFileChunk)(_pChunk.XpNext)
 13722  	goto _7
 13723  _13:
 13724  	goto _14
 13725  _6:
 13726  	_pChunk = (*XFileChunk)(_p.Xreadpoint.XpChunk)
 13727  	func() {
 13728  		if _pChunk == nil {
 13729  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88882), unsafe.Pointer(&_memjrnlReadØ00__func__Ø000), unsafe.Pointer(str(12776)))
 13730  			crt.X__builtin_abort(tls)
 13731  		}
 13732  	}()
 13733  _14:
 13734  	_iChunkOffset = int32(_iOfst % int64(_p.XnChunkSize))
 13735  _17:
 13736  	_4_iSpace = _p.XnChunkSize - _iChunkOffset
 13737  	_4_nCopy = func() int32 {
 13738  		if _nRead < (_p.XnChunkSize - _iChunkOffset) {
 13739  			return _nRead
 13740  		}
 13741  		return (_p.XnChunkSize - _iChunkOffset)
 13742  	}()
 13743  	crt.Xmemcpy(tls, unsafe.Pointer(_zOut), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pChunk.XzChunk))+uintptr(_iChunkOffset)))), uint64(_4_nCopy))
 13744  	*(*uintptr)(unsafe.Pointer(&_zOut)) += uintptr(_4_nCopy)
 13745  	_nRead -= _4_iSpace
 13746  	_iChunkOffset = int32(0)
 13747  	if ((_nRead >= int32(0)) && (store35(&_pChunk, (*XFileChunk)(_pChunk.XpNext)) != nil)) && (_nRead > int32(0)) {
 13748  		goto _17
 13749  	}
 13750  	_p.Xreadpoint.XiOffset = func() int64 {
 13751  		if _pChunk != nil {
 13752  			return (_iOfst + int64(_iAmt))
 13753  		}
 13754  		return (0)
 13755  	}()
 13756  	*(**XFileChunk)(unsafe.Pointer(&(_p.Xreadpoint.XpChunk))) = _pChunk
 13757  	return int32(0)
 13758  }
 13759  
 13760  var _memjrnlReadØ00__func__Ø000 [12]int8
 13761  
 13762  func init() {
 13763  	crt.Xstrncpy(nil, &_memjrnlReadØ00__func__Ø000[0], str(12786), 12)
 13764  }
 13765  
 13766  // C comment
 13767  //  /*
 13768  //  ** Write data to the file.
 13769  //  */
 13770  func _memjrnlWrite(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iAmt int32, _iOfst int64) (r0 int32) {
 13771  	var _nWrite, _1_rc, _5_iChunkOffset, _5_iSpace int32
 13772  	var _zWrite *uint8
 13773  	var _p *XMemJournal
 13774  	var _5_pChunk, _6_pNew *XFileChunk
 13775  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13776  	_nWrite = _iAmt
 13777  	_zWrite = (*uint8)(_zBuf)
 13778  	if _p.XnSpill <= int32(0) || (int64(_iAmt)+_iOfst) <= int64(_p.XnSpill) {
 13779  		goto _1
 13780  	}
 13781  	_1_rc = _memjrnlCreateFile(tls, _p)
 13782  	if _1_rc == int32(0) {
 13783  		_1_rc = _sqlite3OsWrite(tls, _pJfd, _zBuf, _iAmt, _iOfst)
 13784  	}
 13785  	return _1_rc
 13786  
 13787  _1:
 13788  	func() {
 13789  		if _iOfst != (_p.Xendpoint.XiOffset) && _iOfst != (0) {
 13790  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88982), unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000), unsafe.Pointer(str(12798)))
 13791  			crt.X__builtin_abort(tls)
 13792  		}
 13793  	}()
 13794  	func() {
 13795  		if _iOfst <= (0) && (*XFileChunk)(_p.XpFirst) != nil {
 13796  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88989), unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000), unsafe.Pointer(str(12837)))
 13797  			crt.X__builtin_abort(tls)
 13798  		}
 13799  	}()
 13800  _10:
 13801  	if _nWrite <= int32(0) {
 13802  		goto _11
 13803  	}
 13804  	_5_pChunk = (*XFileChunk)(_p.Xendpoint.XpChunk)
 13805  	_5_iChunkOffset = int32((_p.Xendpoint.XiOffset) % int64(_p.XnChunkSize))
 13806  	_5_iSpace = func() int32 {
 13807  		if _nWrite < (_p.XnChunkSize - _5_iChunkOffset) {
 13808  			return _nWrite
 13809  		}
 13810  		return (_p.XnChunkSize - _5_iChunkOffset)
 13811  	}()
 13812  	if _5_iChunkOffset != int32(0) {
 13813  		goto _14
 13814  	}
 13815  	_6_pNew = (*XFileChunk)(Xsqlite3_malloc(tls, int32(uint64(16)+uint64(_p.XnChunkSize-int32(8)))))
 13816  	if _6_pNew == nil {
 13817  		return _sqlite3IoerrnomemError(tls, int32(89001))
 13818  	}
 13819  	*(**XFileChunk)(unsafe.Pointer(&_6_pNew.XpNext)) = nil
 13820  	if _5_pChunk != nil {
 13821  		func() {
 13822  			if _p.XpFirst == nil {
 13823  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89005), unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000), unsafe.Pointer(str(12861)))
 13824  				crt.X__builtin_abort(tls)
 13825  			}
 13826  		}()
 13827  		*(**XFileChunk)(unsafe.Pointer(&_5_pChunk.XpNext)) = _6_pNew
 13828  		goto _19
 13829  	}
 13830  	func() {
 13831  		if _p.XpFirst != nil {
 13832  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89008), unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000), unsafe.Pointer(str(12871)))
 13833  			crt.X__builtin_abort(tls)
 13834  		}
 13835  	}()
 13836  	*(**XFileChunk)(unsafe.Pointer(&_p.XpFirst)) = _6_pNew
 13837  _19:
 13838  	*(**XFileChunk)(unsafe.Pointer(&(_p.Xendpoint.XpChunk))) = _6_pNew
 13839  _14:
 13840  	crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&((*XFileChunk)(_p.Xendpoint.XpChunk).XzChunk)))+uintptr(_5_iChunkOffset)))), unsafe.Pointer(_zWrite), uint64(_5_iSpace))
 13841  	*(*uintptr)(unsafe.Pointer(&_zWrite)) += uintptr(_5_iSpace)
 13842  	_nWrite -= _5_iSpace
 13843  	_p.Xendpoint.XiOffset += int64(_5_iSpace)
 13844  	goto _10
 13845  _11:
 13846  	_p.XnSize = int32(int64(_iAmt) + _iOfst)
 13847  	return int32(0)
 13848  }
 13849  
 13850  // C comment
 13851  //  /*
 13852  //  ** Flush the contents of memory to a real file on disk.
 13853  //  */
 13854  func _memjrnlCreateFile(tls *crt.TLS, _p *XMemJournal) (r0 int32) {
 13855  	var _rc, _1_nChunk int32
 13856  	var _1_iOff int64
 13857  	var _pReal *Xsqlite3_file
 13858  	var _copy XMemJournal
 13859  	var _1_pIter *XFileChunk
 13860  	_pReal = (*Xsqlite3_file)(unsafe.Pointer(_p))
 13861  	_copy = *_p
 13862  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(88))
 13863  	_rc = _sqlite3OsOpen(tls, (*Xsqlite3_vfs)(_copy.XpVfs), _copy.XzJournal, _pReal, _copy.Xflags, nil)
 13864  	if _rc != int32(0) {
 13865  		goto _0
 13866  	}
 13867  	_1_nChunk = _copy.XnChunkSize
 13868  	_1_iOff = int64(0)
 13869  	_1_pIter = (*XFileChunk)(_copy.XpFirst)
 13870  _1:
 13871  	if _1_pIter == nil {
 13872  		goto _4
 13873  	}
 13874  	if (_1_iOff + int64(_1_nChunk)) > (_copy.Xendpoint.XiOffset) {
 13875  		_1_nChunk = int32((_copy.Xendpoint.XiOffset) - _1_iOff)
 13876  	}
 13877  	_rc = _sqlite3OsWrite(tls, _pReal, unsafe.Pointer(&_1_pIter.XzChunk), _1_nChunk, _1_iOff)
 13878  	if _rc != 0 {
 13879  		goto _4
 13880  	}
 13881  	_1_iOff += int64(_1_nChunk)
 13882  	_1_pIter = (*XFileChunk)(_1_pIter.XpNext)
 13883  	goto _1
 13884  _4:
 13885  	if _rc == int32(0) {
 13886  		_memjrnlFreeChunks(tls, &_copy)
 13887  	}
 13888  _0:
 13889  	if _rc != int32(0) {
 13890  		_sqlite3OsClose(tls, _pReal)
 13891  		*_p = _copy
 13892  	}
 13893  	return _rc
 13894  }
 13895  
 13896  func _sqlite3OsWrite(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
 13897  	return func() func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32 {
 13898  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxWrite
 13899  		return *(*func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&v))
 13900  	}()(tls, _id, _pBuf, _amt, _offset)
 13901  }
 13902  
 13903  // C comment
 13904  //  /*
 13905  //  ** The following routines are convenience wrappers around methods
 13906  //  ** of the sqlite3_file object.  This is mostly just syntactic sugar. All
 13907  //  ** of this would be completely automatic if SQLite were coded using
 13908  //  ** C++ instead of plain old C.
 13909  //  */
 13910  func _sqlite3OsClose(tls *crt.TLS, _pId *Xsqlite3_file) {
 13911  	if _pId.XpMethods != nil {
 13912  		func() func(*crt.TLS, *Xsqlite3_file) int32 {
 13913  			v := (*Xsqlite3_io_methods)(_pId.XpMethods).XxClose
 13914  			return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v))
 13915  		}()(tls, _pId)
 13916  		*(**Xsqlite3_io_methods)(unsafe.Pointer(&_pId.XpMethods)) = nil
 13917  	}
 13918  }
 13919  
 13920  var _memjrnlWriteØ00__func__Ø000 [13]int8
 13921  
 13922  func init() {
 13923  	crt.Xstrncpy(nil, &_memjrnlWriteØ00__func__Ø000[0], str(12882), 13)
 13924  }
 13925  
 13926  // C comment
 13927  //  /*
 13928  //  ** This version of the memory allocation is for use by the application.
 13929  //  ** First make sure the memory subsystem is initialized, then do the
 13930  //  ** allocation.
 13931  //  */
 13932  func Xsqlite3_malloc(tls *crt.TLS, _n int32) (r0 unsafe.Pointer) {
 13933  	if Xsqlite3_initialize(tls) != 0 {
 13934  		return nil
 13935  	}
 13936  	return func() unsafe.Pointer {
 13937  		if _n <= int32(0) {
 13938  			return nil
 13939  		}
 13940  		return _sqlite3Malloc(tls, uint64(_n))
 13941  	}()
 13942  }
 13943  
 13944  func _sqlite3IoerrnomemError(tls *crt.TLS, _lineno int32) (r0 int32) {
 13945  	return _reportError(tls, int32(3082), _lineno, str(12895))
 13946  }
 13947  
 13948  // C comment
 13949  //  /*
 13950  //  ** Truncate the file.
 13951  //  **
 13952  //  ** If the journal file is already on disk, truncate it there. Or, if it
 13953  //  ** is still in main memory but is being truncated to zero bytes in size,
 13954  //  ** ignore
 13955  //  */
 13956  func _memjrnlTruncate(tls *crt.TLS, _pJfd *Xsqlite3_file, _size int64) (r0 int32) {
 13957  	var _p *XMemJournal
 13958  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13959  	if func() int32 {
 13960  		if _size == (0) {
 13961  			return int32(1)
 13962  		}
 13963  		return func() int32 {
 13964  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89035), unsafe.Pointer(&_memjrnlTruncateØ00__func__Ø000), unsafe.Pointer(str(4809)))
 13965  			crt.X__builtin_abort(tls)
 13966  			return int32(0)
 13967  		}()
 13968  	}() != 0 {
 13969  		_memjrnlFreeChunks(tls, _p)
 13970  		_p.XnSize = int32(0)
 13971  		*(**XFileChunk)(unsafe.Pointer(&(_p.Xendpoint.XpChunk))) = nil
 13972  		_p.Xendpoint.XiOffset = 0
 13973  		*(**XFileChunk)(unsafe.Pointer(&(_p.Xreadpoint.XpChunk))) = nil
 13974  		_p.Xreadpoint.XiOffset = 0
 13975  	}
 13976  	return int32(0)
 13977  }
 13978  
 13979  var _memjrnlTruncateØ00__func__Ø000 [16]int8
 13980  
 13981  func init() {
 13982  	crt.Xstrncpy(nil, &_memjrnlTruncateØ00__func__Ø000[0], str(12909), 16)
 13983  }
 13984  
 13985  // C comment
 13986  //  /*
 13987  //  ** Sync the file.
 13988  //  **
 13989  //  ** If the real file has been created, call its xSync method. Otherwise,
 13990  //  ** syncing an in-memory journal is a no-op.
 13991  //  */
 13992  func _memjrnlSync(tls *crt.TLS, _pJfd *Xsqlite3_file, _flags int32) (r0 int32) {
 13993  	_ = _flags
 13994  	return int32(0)
 13995  }
 13996  
 13997  // C comment
 13998  //  /*
 13999  //  ** Query the size of the file in bytes.
 14000  //  */
 14001  func _memjrnlFileSize(tls *crt.TLS, _pJfd *Xsqlite3_file, _pSize *int64) (r0 int32) {
 14002  	var _p *XMemJournal
 14003  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 14004  	*_pSize = _p.Xendpoint.XiOffset
 14005  	return int32(0)
 14006  }
 14007  
 14008  // C comment
 14009  //  /*
 14010  //  ** Write a 32-bit integer into the given file descriptor.  Return SQLITE_OK
 14011  //  ** on success or an error code is something goes wrong.
 14012  //  */
 14013  func _write32bits(tls *crt.TLS, _fd *Xsqlite3_file, _offset int64, _val uint32) (r0 int32) {
 14014  	var _ac [4]int8
 14015  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(&_ac)))), _val)
 14016  	return _sqlite3OsWrite(tls, _fd, unsafe.Pointer(&_ac), int32(4), _offset)
 14017  
 14018  	_ = _ac
 14019  	panic(0)
 14020  }
 14021  
 14022  func _sqlite3Put4byte(tls *crt.TLS, _p *uint8, _v uint32) {
 14023  	*elem15(_p, 0) = uint8(_v >> 24)
 14024  	*elem15(_p, uintptr(1)) = uint8(_v >> 16)
 14025  	*elem15(_p, uintptr(2)) = uint8(_v >> 8)
 14026  	*elem15(_p, uintptr(3)) = uint8(_v)
 14027  }
 14028  
 14029  // C comment
 14030  //  /*
 14031  //  ** Set the bit number pgno in the PagerSavepoint.pInSavepoint
 14032  //  ** bitvecs of all open savepoints. Return SQLITE_OK if successful
 14033  //  ** or SQLITE_NOMEM if a malloc failure occurs.
 14034  //  */
 14035  func _addToSavepointBitvecs(tls *crt.TLS, _pPager *XPager, _pgno uint32) (r0 int32) {
 14036  	var _ii, _rc int32
 14037  	var _1_p *XPagerSavepoint
 14038  	_rc = int32(0)
 14039  	_ii = int32(0)
 14040  _0:
 14041  	if _ii >= _pPager.XnSavepoint {
 14042  		goto _3
 14043  	}
 14044  	_1_p = elem32((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_ii))
 14045  	if _pgno <= _1_p.XnOrig {
 14046  		_rc |= _sqlite3BitvecSet(tls, (*XBitvec)(_1_p.XpInSavepoint), _pgno)
 14047  		func() {
 14048  			if _rc != int32(0) && _rc != int32(7) {
 14049  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48693), unsafe.Pointer(&_addToSavepointBitvecsØ00__func__Ø000), unsafe.Pointer(str(5706)))
 14050  				crt.X__builtin_abort(tls)
 14051  			}
 14052  		}()
 14053  	}
 14054  	_ii += 1
 14055  	goto _0
 14056  _3:
 14057  	return _rc
 14058  }
 14059  
 14060  // C comment
 14061  //  /*
 14062  //  ** Set the i-th bit.  Return 0 on success and an error code if
 14063  //  ** anything goes wrong.
 14064  //  **
 14065  //  ** This routine might cause sub-bitmaps to be allocated.  Failing
 14066  //  ** to get the memory needed to hold the sub-bitmap is the only
 14067  //  ** that can go wrong with an insert, assuming p and i are valid.
 14068  //  **
 14069  //  ** The calling function must ensure that p is a valid Bitvec object
 14070  //  ** and that the value for "i" is within range of the Bitvec object.
 14071  //  ** Otherwise the behavior is undefined.
 14072  //  */
 14073  func _sqlite3BitvecSet(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) {
 14074  	var _8_rc int32
 14075  	var _h, _1_bin, _8_j uint32
 14076  	var _8_aiValues *uint32
 14077  	if _p == nil {
 14078  		return int32(0)
 14079  	}
 14080  	func() {
 14081  		if _i <= (0) {
 14082  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(43881), unsafe.Pointer(&_sqlite3BitvecSetØ00__func__Ø000), unsafe.Pointer(str(12925)))
 14083  			crt.X__builtin_abort(tls)
 14084  		}
 14085  	}()
 14086  	func() {
 14087  		if _i > _p.XiSize {
 14088  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(43882), unsafe.Pointer(&_sqlite3BitvecSetØ00__func__Ø000), unsafe.Pointer(str(12929)))
 14089  			crt.X__builtin_abort(tls)
 14090  		}
 14091  	}()
 14092  	_i -= 1
 14093  _5:
 14094  	if uint64(_p.XiSize) <= uint64(3968) || _p.XiDivisor == 0 {
 14095  		goto _6
 14096  	}
 14097  	_1_bin = _i / _p.XiDivisor
 14098  	_i = _i % _p.XiDivisor
 14099  	if (*elem33((**XBitvec)(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin))) != nil {
 14100  		goto _8
 14101  	}
 14102  	*elem33((**XBitvec)(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin)) = _sqlite3BitvecCreate(tls, _p.XiDivisor)
 14103  	if (*elem33((**XBitvec)(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin))) == nil {
 14104  		return _sqlite3NomemError(tls, int32(43889))
 14105  	}
 14106  _8:
 14107  	_p = *elem33((**XBitvec)(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin))
 14108  	goto _5
 14109  _6:
 14110  	if uint64(_p.XiSize) <= uint64(3968) {
 14111  		{
 14112  			p := elem15((*uint8)(unsafe.Pointer((*[496]uint8)(unsafe.Pointer(&_p.Xu)))), uintptr(_i/uint32(8)))
 14113  			*p = uint8(int32(*p) | (int32(1) << uint(int32(_i&uint32(7)))))
 14114  		}
 14115  		return int32(0)
 14116  	}
 14117  	_h = uint32(uint64(postInc34(&_i, uint32(1))*uint32(1)) % uint64(124))
 14118  	if (*elem31((*uint32)(unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_h))) != 0 {
 14119  		goto _11
 14120  	}
 14121  	if uint64(_p.XnSet) < uint64(123) {
 14122  		goto _bitvec_set_end
 14123  	}
 14124  	goto _bitvec_set_rehash
 14125  _11:
 14126  	if (*elem31((*uint32)(unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_h))) == _i {
 14127  		return int32(0)
 14128  	}
 14129  	_h += 1
 14130  	if uint64(_h) >= uint64(124) {
 14131  		_h = 0
 14132  	}
 14133  	if (*elem31((*uint32)(unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_h))) != 0 {
 14134  		goto _11
 14135  	}
 14136  _bitvec_set_rehash:
 14137  	if uint64(_p.XnSet) < uint64(62) {
 14138  		goto _bitvec_set_end
 14139  	}
 14140  	_8_aiValues = (*uint32)(_sqlite3DbMallocRaw(tls, nil, uint64(496)))
 14141  	if _8_aiValues == nil {
 14142  		return _sqlite3NomemError(tls, int32(43924))
 14143  	}
 14144  	crt.Xmemcpy(tls, unsafe.Pointer(_8_aiValues), unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu))), uint64(496))
 14145  	crt.Xmemset(tls, unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer(&_p.Xu))), int32(0), uint64(496))
 14146  	_p.XiDivisor = uint32(((uint64(_p.XiSize) + uint64(62)) - uint64(1)) / uint64(62))
 14147  	_8_rc = _sqlite3BitvecSet(tls, _p, _i)
 14148  	_8_j = 0
 14149  _20:
 14150  	if uint64(_8_j) >= uint64(124) {
 14151  		goto _23
 14152  	}
 14153  	if (*elem31(_8_aiValues, uintptr(_8_j))) != 0 {
 14154  		_8_rc |= _sqlite3BitvecSet(tls, _p, *elem31(_8_aiValues, uintptr(_8_j)))
 14155  	}
 14156  	_8_j += 1
 14157  	goto _20
 14158  _23:
 14159  	_sqlite3DbFree(tls, nil, unsafe.Pointer(_8_aiValues))
 14160  	return _8_rc
 14161  
 14162  _bitvec_set_end:
 14163  	_p.XnSet += 1
 14164  	*elem31((*uint32)(unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_h)) = _i
 14165  	return int32(0)
 14166  }
 14167  
 14168  var _sqlite3BitvecSetØ00__func__Ø000 [17]int8
 14169  
 14170  func init() {
 14171  	crt.Xstrncpy(nil, &_sqlite3BitvecSetØ00__func__Ø000[0], str(12941), 17)
 14172  }
 14173  
 14174  // C comment
 14175  //  /*
 14176  //  ** Create a new bitmap object able to handle bits between 0 and iSize,
 14177  //  ** inclusive.  Return a pointer to the new object.  Return NULL if
 14178  //  ** malloc fails.
 14179  //  */
 14180  func _sqlite3BitvecCreate(tls *crt.TLS, _iSize uint32) (r0 *XBitvec) {
 14181  	var _p *XBitvec
 14182  
 14183  	_p = (*XBitvec)(_sqlite3MallocZero(tls, uint64(512)))
 14184  	if _p != nil {
 14185  		_p.XiSize = _iSize
 14186  	}
 14187  	return _p
 14188  }
 14189  
 14190  var _addToSavepointBitvecsØ00__func__Ø000 [22]int8
 14191  
 14192  func init() {
 14193  	crt.Xstrncpy(nil, &_addToSavepointBitvecsØ00__func__Ø000[0], str(12958), 22)
 14194  }
 14195  
 14196  // C comment
 14197  //  /*
 14198  //  ** This is a variant of sqlite3PagerWrite() that runs when the sector size
 14199  //  ** is larger than the page size.  SQLite makes the (reasonable) assumption that
 14200  //  ** all bytes of a sector are written together by hardware.  Hence, all bytes of
 14201  //  ** a sector need to be journalled in case of a power loss in the middle of
 14202  //  ** a write.
 14203  //  **
 14204  //  ** Usually, the sector size is less than or equal to the page size, in which
 14205  //  ** case pages can be individually written.  This routine only runs in the
 14206  //  ** exceptional case where the page size is smaller than the sector size.
 14207  //  */
 14208  func _pagerWriteLargeSector(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 14209  	var _rc, _nPage, _ii, _needSync int32
 14210  	var _nPageCount, _pg1, _nPagePerSector, _4_pg uint32
 14211  	var _pPager *XPager
 14212  	var _4_pPage, _12_pPage *XPgHdr
 14213  	_rc = int32(0)
 14214  	_nPage = int32(0)
 14215  	_needSync = int32(0)
 14216  	_pPager = (*XPager)(_pPg.XpPager)
 14217  	_nPagePerSector = _pPager.XsectorSize / uint32(_pPager.XpageSize)
 14218  	func() {
 14219  		if _pPager.XmemDb != 0 {
 14220  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52907), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(11702)))
 14221  			crt.X__builtin_abort(tls)
 14222  		}
 14223  	}()
 14224  	func() {
 14225  		if (int32(_pPager.XdoNotSpill) & int32(4)) != int32(0) {
 14226  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52908), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(12980)))
 14227  			crt.X__builtin_abort(tls)
 14228  		}
 14229  	}()
 14230  	{
 14231  		p := &_pPager.XdoNotSpill
 14232  		*p = uint8(int32(*p) | int32(4))
 14233  	}
 14234  	_pg1 = ((_pPg.Xpgno - uint32(1)) & (^(_nPagePerSector - uint32(1)))) + uint32(1)
 14235  	_nPageCount = _pPager.XdbSize
 14236  	if _pPg.Xpgno > _nPageCount {
 14237  		_nPage = int32((_pPg.Xpgno - _pg1) + uint32(1))
 14238  		goto _7
 14239  	}
 14240  	if ((_pg1 + _nPagePerSector) - uint32(1)) > _nPageCount {
 14241  		_nPage = int32((_nPageCount + uint32(1)) - _pg1)
 14242  		goto _7
 14243  	}
 14244  	_nPage = int32(_nPagePerSector)
 14245  _7:
 14246  	func() {
 14247  		if _nPage <= int32(0) {
 14248  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52925), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(13023)))
 14249  			crt.X__builtin_abort(tls)
 14250  		}
 14251  	}()
 14252  	func() {
 14253  		if _pg1 > _pPg.Xpgno {
 14254  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52926), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(13031)))
 14255  			crt.X__builtin_abort(tls)
 14256  		}
 14257  	}()
 14258  	func() {
 14259  		if (_pg1 + uint32(_nPage)) <= _pPg.Xpgno {
 14260  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52927), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(13046)))
 14261  			crt.X__builtin_abort(tls)
 14262  		}
 14263  	}()
 14264  	_ii = int32(0)
 14265  _14:
 14266  	if _ii >= _nPage || _rc != int32(0) {
 14267  		goto _18
 14268  	}
 14269  	_4_pg = _pg1 + uint32(_ii)
 14270  	if _4_pg != _pPg.Xpgno && _sqlite3BitvecTest(tls, (*XBitvec)(_pPager.XpInJournal), _4_pg) != 0 {
 14271  		goto _20
 14272  	}
 14273  	if _4_pg == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1)) {
 14274  		goto _21
 14275  	}
 14276  	_rc = _sqlite3PagerGet(tls, _pPager, _4_pg, &_4_pPage, int32(0))
 14277  	if _rc != int32(0) {
 14278  		goto _22
 14279  	}
 14280  	_rc = _pager_write(tls, _4_pPage)
 14281  	if (int32(_4_pPage.Xflags) & int32(8)) != 0 {
 14282  		_needSync = int32(1)
 14283  	}
 14284  	_sqlite3PagerUnrefNotNull(tls, _4_pPage)
 14285  _22:
 14286  _21:
 14287  	goto _25
 14288  _20:
 14289  	if store36(&_4_pPage, _sqlite3PagerLookup(tls, _pPager, _4_pg)) == nil {
 14290  		goto _25
 14291  	}
 14292  	if (int32(_4_pPage.Xflags) & int32(8)) != 0 {
 14293  		_needSync = int32(1)
 14294  	}
 14295  	_sqlite3PagerUnrefNotNull(tls, _4_pPage)
 14296  _25:
 14297  	_ii += 1
 14298  	goto _14
 14299  _18:
 14300  	if _rc != int32(0) || _needSync == 0 {
 14301  		goto _28
 14302  	}
 14303  	func() {
 14304  		if _pPager.XmemDb != 0 {
 14305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52958), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(11702)))
 14306  			crt.X__builtin_abort(tls)
 14307  		}
 14308  	}()
 14309  	_ii = int32(0)
 14310  _31:
 14311  	if _ii >= _nPage {
 14312  		goto _34
 14313  	}
 14314  	_12_pPage = _sqlite3PagerLookup(tls, _pPager, _pg1+uint32(_ii))
 14315  	if _12_pPage != nil {
 14316  		{
 14317  			p := &_12_pPage.Xflags
 14318  			*p = uint16(int32(*p) | int32(8))
 14319  		}
 14320  		_sqlite3PagerUnrefNotNull(tls, _12_pPage)
 14321  	}
 14322  	_ii += 1
 14323  	goto _31
 14324  _34:
 14325  _28:
 14326  	func() {
 14327  		if (int32(_pPager.XdoNotSpill) & int32(4)) == int32(0) {
 14328  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52968), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(13068)))
 14329  			crt.X__builtin_abort(tls)
 14330  		}
 14331  	}()
 14332  	{
 14333  		p := &_pPager.XdoNotSpill
 14334  		*p = uint8(int32(*p) & int32(-5))
 14335  	}
 14336  	return _rc
 14337  }
 14338  
 14339  var _pagerWriteLargeSectorØ00__func__Ø000 [22]int8
 14340  
 14341  func init() {
 14342  	crt.Xstrncpy(nil, &_pagerWriteLargeSectorØ00__func__Ø000[0], str(13111), 22)
 14343  }
 14344  
 14345  var _sqlite3PendingByte int32
 14346  
 14347  func init() {
 14348  	_sqlite3PendingByte = int32(1073741824)
 14349  }
 14350  
 14351  // C comment
 14352  //  /* Dispatch all page fetch requests to the appropriate getter method.
 14353  //  */
 14354  func _sqlite3PagerGet(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
 14355  	return func() func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32 {
 14356  		v := _pPager.XxGet
 14357  		return *(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&v))
 14358  	}()(tls, _pPager, _pgno, _ppPage, _flags)
 14359  }
 14360  
 14361  // C comment
 14362  //  /*
 14363  //  ** Mark a single data page as writeable. The page is written into the
 14364  //  ** main journal or sub-journal as required. If the page is written into
 14365  //  ** one of the journals, the corresponding bit is set in the
 14366  //  ** Pager.pInJournal bitvec and the PagerSavepoint.pInSavepoint bitvecs
 14367  //  ** of any open savepoints as appropriate.
 14368  //  */
 14369  func _pager_write(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 14370  	var _rc int32
 14371  	var _pPager *XPager
 14372  	_pPager = (*XPager)(_pPg.XpPager)
 14373  	_rc = int32(0)
 14374  	func() {
 14375  		if int32(_pPager.XeState) != int32(2) && int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) {
 14376  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52809), unsafe.Pointer(&_pager_writeØ00__func__Ø000), unsafe.Pointer(str(13133)))
 14377  			crt.X__builtin_abort(tls)
 14378  		}
 14379  	}()
 14380  	func() {
 14381  		if _assert_pager_state(tls, _pPager) == 0 {
 14382  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52813), unsafe.Pointer(&_pager_writeØ00__func__Ø000), unsafe.Pointer(str(10971)))
 14383  			crt.X__builtin_abort(tls)
 14384  		}
 14385  	}()
 14386  	func() {
 14387  		if _pPager.XerrCode != int32(0) {
 14388  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52814), unsafe.Pointer(&_pager_writeØ00__func__Ø000), unsafe.Pointer(str(13248)))
 14389  			crt.X__builtin_abort(tls)
 14390  		}
 14391  	}()
 14392  	func() {
 14393  		if int32(_pPager.XreadOnly) != int32(0) {
 14394  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52815), unsafe.Pointer(&_pager_writeØ00__func__Ø000), unsafe.Pointer(str(13267)))
 14395  			crt.X__builtin_abort(tls)
 14396  		}
 14397  	}()
 14398  	if int32(_pPager.XeState) != int32(2) {
 14399  		goto _10
 14400  	}
 14401  	_rc = _pager_open_journal(tls, _pPager)
 14402  	if _rc != int32(0) {
 14403  		return _rc
 14404  	}
 14405  _10:
 14406  	func() {
 14407  		if int32(_pPager.XeState) < int32(3) {
 14408  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52831), unsafe.Pointer(&_pager_writeØ00__func__Ø000), unsafe.Pointer(str(13287)))
 14409  			crt.X__builtin_abort(tls)
 14410  		}
 14411  	}()
 14412  	func() {
 14413  		if _assert_pager_state(tls, _pPager) == 0 {
 14414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52832), unsafe.Pointer(&_pager_writeØ00__func__Ø000), unsafe.Pointer(str(10971)))
 14415  			crt.X__builtin_abort(tls)
 14416  		}
 14417  	}()
 14418  	_sqlite3PcacheMakeDirty(tls, _pPg)
 14419  	func() {
 14420  		if ((*XBitvec)(_pPager.XpInJournal) != nil) != ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil) {
 14421  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52841), unsafe.Pointer(&_pager_writeØ00__func__Ø000), unsafe.Pointer(str(13325)))
 14422  			crt.X__builtin_abort(tls)
 14423  		}
 14424  	}()
 14425  	if (*XBitvec)(_pPager.XpInJournal) == nil || _sqlite3BitvecTestNotNull(tls, (*XBitvec)(_pPager.XpInJournal), _pPg.Xpgno) != int32(0) {
 14426  		goto _19
 14427  	}
 14428  	func() {
 14429  		if bool2int((*XWal)(_pPager.XpWal) != nil) != int32(0) {
 14430  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52845), unsafe.Pointer(&_pager_writeØ00__func__Ø000), unsafe.Pointer(str(13372)))
 14431  			crt.X__builtin_abort(tls)
 14432  		}
 14433  	}()
 14434  	if _pPg.Xpgno > _pPager.XdbOrigSize {
 14435  		goto _22
 14436  	}
 14437  	_rc = _pagerAddPageToRollbackJournal(tls, _pPg)
 14438  	if _rc != int32(0) {
 14439  		return _rc
 14440  	}
 14441  	goto _24
 14442  _22:
 14443  	if int32(_pPager.XeState) != int32(4) {
 14444  		{
 14445  			p := &_pPg.Xflags
 14446  			*p = uint16(int32(*p) | int32(8))
 14447  		}
 14448  	}
 14449  _24:
 14450  _19:
 14451  	{
 14452  		p := &_pPg.Xflags
 14453  		*p = uint16(int32(*p) | int32(4))
 14454  	}
 14455  	if _pPager.XnSavepoint > int32(0) {
 14456  		_rc = _subjournalPageIfRequired(tls, _pPg)
 14457  	}
 14458  	if _pPager.XdbSize < _pPg.Xpgno {
 14459  		_pPager.XdbSize = _pPg.Xpgno
 14460  	}
 14461  	return _rc
 14462  }
 14463  
 14464  var _pager_writeØ00__func__Ø000 [12]int8
 14465  
 14466  func init() {
 14467  	crt.Xstrncpy(nil, &_pager_writeØ00__func__Ø000[0], str(13395), 12)
 14468  }
 14469  
 14470  // C comment
 14471  //  /*
 14472  //  ** This function is called at the start of every write transaction.
 14473  //  ** There must already be a RESERVED or EXCLUSIVE lock on the database
 14474  //  ** file when this routine is called.
 14475  //  **
 14476  //  ** Open the journal file for pager pPager and write a journal header
 14477  //  ** to the start of it. If there are active savepoints, open the sub-journal
 14478  //  ** as well. This function is only used when the journal file is being
 14479  //  ** opened to write a rollback log for a transaction. It is not used
 14480  //  ** when opening a hot journal file to roll it back.
 14481  //  **
 14482  //  ** If the journal file is already open (as it may be in exclusive mode),
 14483  //  ** then this function just writes a journal header to the start of the
 14484  //  ** already open file.
 14485  //  **
 14486  //  ** Whether or not the journal file is opened by this function, the
 14487  //  ** Pager.pInJournal bitvec structure is allocated.
 14488  //  **
 14489  //  ** Return SQLITE_OK if everything is successful. Otherwise, return
 14490  //  ** SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or
 14491  //  ** an IO error code if opening or writing the journal file fails.
 14492  //  */
 14493  func _pager_open_journal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 14494  	var _rc, _5_flags, _5_nSpill int32
 14495  	var _pVfs *Xsqlite3_vfs
 14496  	_rc = int32(0)
 14497  	_pVfs = (*Xsqlite3_vfs)(_pPager.XpVfs)
 14498  	func() {
 14499  		if int32(_pPager.XeState) != int32(2) {
 14500  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52590), unsafe.Pointer(&_pager_open_journalØ00__func__Ø000), unsafe.Pointer(str(13407)))
 14501  			crt.X__builtin_abort(tls)
 14502  		}
 14503  	}()
 14504  	func() {
 14505  		if _assert_pager_state(tls, _pPager) == 0 {
 14506  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52591), unsafe.Pointer(&_pager_open_journalØ00__func__Ø000), unsafe.Pointer(str(10971)))
 14507  			crt.X__builtin_abort(tls)
 14508  		}
 14509  	}()
 14510  	func() {
 14511  		if (*XBitvec)(_pPager.XpInJournal) != nil {
 14512  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52592), unsafe.Pointer(&_pager_open_journalØ00__func__Ø000), unsafe.Pointer(str(13443)))
 14513  			crt.X__builtin_abort(tls)
 14514  		}
 14515  	}()
 14516  	if func() int32 {
 14517  		if _pPager.XerrCode != 0 {
 14518  			return func() int32 {
 14519  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52597), unsafe.Pointer(&_pager_open_journalØ00__func__Ø000), unsafe.Pointer(str(4809)))
 14520  				crt.X__builtin_abort(tls)
 14521  				return int32(1)
 14522  			}()
 14523  		}
 14524  		return int32(0)
 14525  	}() != 0 {
 14526  		return _pPager.XerrCode
 14527  	}
 14528  	if (*XWal)(_pPager.XpWal) != nil || int32(_pPager.XjournalMode) == int32(2) {
 14529  		goto _10
 14530  	}
 14531  	*(**XBitvec)(unsafe.Pointer(&_pPager.XpInJournal)) = _sqlite3BitvecCreate(tls, _pPager.XdbSize)
 14532  	if (*XBitvec)(_pPager.XpInJournal) == nil {
 14533  		return _sqlite3NomemError(tls, int32(52602))
 14534  	}
 14535  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil {
 14536  		goto _12
 14537  	}
 14538  	if int32(_pPager.XjournalMode) == int32(4) {
 14539  		_sqlite3MemJournalOpen(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 14540  		goto _14
 14541  	}
 14542  	_5_flags = int32(6)
 14543  	if _pPager.XtempFile != 0 {
 14544  		_5_flags |= int32(4104)
 14545  		_5_nSpill = _sqlite3Config.XnStmtSpill
 14546  		goto _16
 14547  	}
 14548  	_5_flags |= int32(2048)
 14549  	_5_nSpill = int32(0)
 14550  _16:
 14551  	_rc = _databaseIsUnmoved(tls, _pPager)
 14552  	if _rc == int32(0) {
 14553  		_rc = _sqlite3JournalOpen(tls, _pVfs, _pPager.XzJournal, (*Xsqlite3_file)(_pPager.Xjfd), _5_flags, _5_nSpill)
 14554  	}
 14555  _14:
 14556  	func() {
 14557  		if _rc == int32(0) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 14558  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52630), unsafe.Pointer(&_pager_open_journalØ00__func__Ø000), unsafe.Pointer(str(13465)))
 14559  			crt.X__builtin_abort(tls)
 14560  		}
 14561  	}()
 14562  _12:
 14563  	if _rc == int32(0) {
 14564  		_pPager.XnRec = int32(0)
 14565  		_pPager.XjournalOff = 0
 14566  		_pPager.XsetMaster = 0
 14567  		_pPager.XjournalHdr = 0
 14568  		_rc = _writeJournalHdr(tls, _pPager)
 14569  	}
 14570  _10:
 14571  	if _rc != int32(0) {
 14572  		_sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.XpInJournal))
 14573  		*(**XBitvec)(unsafe.Pointer(&_pPager.XpInJournal)) = nil
 14574  		goto _23
 14575  	}
 14576  	func() {
 14577  		if int32(_pPager.XeState) != int32(2) {
 14578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52651), unsafe.Pointer(&_pager_open_journalØ00__func__Ø000), unsafe.Pointer(str(13407)))
 14579  			crt.X__builtin_abort(tls)
 14580  		}
 14581  	}()
 14582  	_pPager.XeState = uint8(3)
 14583  _23:
 14584  	return _rc
 14585  }
 14586  
 14587  var _pager_open_journalØ00__func__Ø000 [19]int8
 14588  
 14589  func init() {
 14590  	crt.Xstrncpy(nil, &_pager_open_journalØ00__func__Ø000[0], str(13502), 19)
 14591  }
 14592  
 14593  // C comment
 14594  //  /*
 14595  //  ** Open an in-memory journal file.
 14596  //  */
 14597  func _sqlite3MemJournalOpen(tls *crt.TLS, _pJfd *Xsqlite3_file) {
 14598  	_sqlite3JournalOpen(tls, nil, nil, _pJfd, int32(0), int32(-1))
 14599  }
 14600  
 14601  // C comment
 14602  //  /* Verify that the database file has not be deleted or renamed out from
 14603  //  ** under the pager.  Return SQLITE_OK if the database is still were it ought
 14604  //  ** to be on disk.  Return non-zero (SQLITE_READONLY_DBMOVED or some other error
 14605  //  ** code from sqlite3OsAccess()) if the database has gone missing.
 14606  //  */
 14607  func _databaseIsUnmoved(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 14608  	var _bHasMoved, _rc int32
 14609  	_bHasMoved = int32(0)
 14610  	if _pPager.XtempFile != 0 {
 14611  		return int32(0)
 14612  	}
 14613  	if _pPager.XdbSize == (0) {
 14614  		return int32(0)
 14615  	}
 14616  	func() {
 14617  		if _pPager.XzFilename == nil || (*elem1(_pPager.XzFilename, 0)) == 0 {
 14618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51865), unsafe.Pointer(&_databaseIsUnmovedØ00__func__Ø000), unsafe.Pointer(str(13521)))
 14619  			crt.X__builtin_abort(tls)
 14620  		}
 14621  	}()
 14622  	_rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(20), unsafe.Pointer(&_bHasMoved))
 14623  	if _rc == int32(12) {
 14624  		_rc = int32(0)
 14625  		goto _8
 14626  	}
 14627  	if (_rc == int32(0)) && _bHasMoved != 0 {
 14628  		_rc = int32(1032)
 14629  	}
 14630  _8:
 14631  	return _rc
 14632  }
 14633  
 14634  var _databaseIsUnmovedØ00__func__Ø000 [18]int8
 14635  
 14636  func init() {
 14637  	crt.Xstrncpy(nil, &_databaseIsUnmovedØ00__func__Ø000[0], str(13563), 18)
 14638  }
 14639  
 14640  // C comment
 14641  //  /*
 14642  //  ** Use sqlite3OsFileControl() when we are doing something that might fail
 14643  //  ** and we need to know about the failures.  Use sqlite3OsFileControlHint()
 14644  //  ** when simply tossing information over the wall to the VFS and we do not
 14645  //  ** really care if the VFS receives and understands the information since it
 14646  //  ** is only a hint and can be safely ignored.  The sqlite3OsFileControlHint()
 14647  //  ** routine has no return value since the return value would be meaningless.
 14648  //  */
 14649  func _sqlite3OsFileControl(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) (r0 int32) {
 14650  	return func() func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32 {
 14651  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxFileControl
 14652  		return *(*func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&v))
 14653  	}()(tls, _id, _op, _pArg)
 14654  }
 14655  
 14656  // C comment
 14657  //  /*
 14658  //  ** The journal file must be open when this routine is called. A journal
 14659  //  ** header (JOURNAL_HDR_SZ bytes) is written into the journal file at the
 14660  //  ** current location.
 14661  //  **
 14662  //  ** The format for the journal header is as follows:
 14663  //  ** - 8 bytes: Magic identifying journal format.
 14664  //  ** - 4 bytes: Number of records in journal, or -1 no-sync mode is on.
 14665  //  ** - 4 bytes: Random number used for page hash.
 14666  //  ** - 4 bytes: Initial database page count.
 14667  //  ** - 4 bytes: Sector size used by the process that wrote this journal.
 14668  //  ** - 4 bytes: Database page size.
 14669  //  **
 14670  //  ** Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space.
 14671  //  */
 14672  func _writeJournalHdr(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 14673  	var _rc, _ii int32
 14674  	var _nHeader, _nWrite uint32
 14675  	var _zHeader *int8
 14676  	_rc = int32(0)
 14677  	_zHeader = _pPager.XpTmpSpace
 14678  	_nHeader = uint32(_pPager.XpageSize)
 14679  	func() {
 14680  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 14681  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48342), unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000), unsafe.Pointer(str(13581)))
 14682  			crt.X__builtin_abort(tls)
 14683  		}
 14684  	}()
 14685  	if _nHeader > _pPager.XsectorSize {
 14686  		_nHeader = _pPager.XsectorSize
 14687  	}
 14688  	_ii = int32(0)
 14689  _3:
 14690  	if _ii >= _pPager.XnSavepoint {
 14691  		goto _6
 14692  	}
 14693  	if (elem32((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_ii)).XiHdrOffset) == (0) {
 14694  		elem32((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_ii)).XiHdrOffset = _pPager.XjournalOff
 14695  	}
 14696  	_ii += 1
 14697  	goto _3
 14698  _6:
 14699  	_pPager.XjournalHdr = store37(&_pPager.XjournalOff, _journalHdrOffset(tls, _pPager))
 14700  	func() {
 14701  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _pPager.XnoSync == 0 {
 14702  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48380), unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000), unsafe.Pointer(str(13601)))
 14703  			crt.X__builtin_abort(tls)
 14704  		}
 14705  	}()
 14706  	if ((_pPager.XnoSync != 0) || (int32(_pPager.XjournalMode) == int32(4))) || (_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xfd))&int32(512)) != 0 {
 14707  		crt.Xmemcpy(tls, unsafe.Pointer(_zHeader), unsafe.Pointer(&_aJournalMagic), uint64(8))
 14708  		_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem1(_zHeader, uintptr(8)))), uint32(4294967295))
 14709  		goto _14
 14710  	}
 14711  	crt.Xmemset(tls, unsafe.Pointer(_zHeader), int32(0), uint64(12))
 14712  _14:
 14713  	Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_pPager.XcksumInit))
 14714  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem1(_zHeader, uintptr(12)))), _pPager.XcksumInit)
 14715  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem1(_zHeader, uintptr(16)))), _pPager.XdbOrigSize)
 14716  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem1(_zHeader, uintptr(20)))), _pPager.XsectorSize)
 14717  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem1(_zHeader, uintptr(24)))), uint32(_pPager.XpageSize))
 14718  	crt.Xmemset(tls, unsafe.Pointer(elem1(_zHeader, uintptr(28))), int32(0), uint64(_nHeader)-uint64(28))
 14719  	_nWrite = 0
 14720  _15:
 14721  	if _rc != int32(0) || _nWrite >= _pPager.XsectorSize {
 14722  		goto _19
 14723  	}
 14724  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(_zHeader), int32(_nHeader), _pPager.XjournalOff)
 14725  	func() {
 14726  		if _pPager.XjournalHdr > _pPager.XjournalOff {
 14727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48429), unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000), unsafe.Pointer(str(13638)))
 14728  			crt.X__builtin_abort(tls)
 14729  		}
 14730  	}()
 14731  	_pPager.XjournalOff += int64(_nHeader)
 14732  	_nWrite += _nHeader
 14733  	goto _15
 14734  _19:
 14735  	return _rc
 14736  }
 14737  
 14738  var _writeJournalHdrØ00__func__Ø000 [16]int8
 14739  
 14740  func init() {
 14741  	crt.Xstrncpy(nil, &_writeJournalHdrØ00__func__Ø000[0], str(13679), 16)
 14742  }
 14743  
 14744  // C comment
 14745  //  /*
 14746  //  ** Return the offset of the sector boundary at or immediately
 14747  //  ** following the value in pPager->journalOff, assuming a sector
 14748  //  ** size of pPager->sectorSize bytes.
 14749  //  **
 14750  //  ** i.e for a sector size of 512:
 14751  //  **
 14752  //  **   Pager.journalOff          Return value
 14753  //  **   ---------------------------------------
 14754  //  **   0                         0
 14755  //  **   512                       512
 14756  //  **   100                       512
 14757  //  **   2000                      2048
 14758  //  **
 14759  //  */
 14760  func _journalHdrOffset(tls *crt.TLS, _pPager *XPager) (r0 int64) {
 14761  	var _offset, _c int64
 14762  	_offset = int64(0)
 14763  	_c = _pPager.XjournalOff
 14764  	if _c != 0 {
 14765  		_offset = (((_c - int64(1)) / int64(_pPager.XsectorSize)) + int64(1)) * int64(_pPager.XsectorSize)
 14766  	}
 14767  	func() {
 14768  		if (_offset % int64(_pPager.XsectorSize)) != (0) {
 14769  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48258), unsafe.Pointer(&_journalHdrOffsetØ00__func__Ø000), unsafe.Pointer(str(13695)))
 14770  			crt.X__builtin_abort(tls)
 14771  		}
 14772  	}()
 14773  	func() {
 14774  		if _offset < _c {
 14775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48259), unsafe.Pointer(&_journalHdrOffsetØ00__func__Ø000), unsafe.Pointer(str(13728)))
 14776  			crt.X__builtin_abort(tls)
 14777  		}
 14778  	}()
 14779  	func() {
 14780  		if (_offset - _c) >= int64(_pPager.XsectorSize) {
 14781  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48260), unsafe.Pointer(&_journalHdrOffsetØ00__func__Ø000), unsafe.Pointer(str(13738)))
 14782  			crt.X__builtin_abort(tls)
 14783  		}
 14784  	}()
 14785  	return _offset
 14786  }
 14787  
 14788  var _journalHdrOffsetØ00__func__Ø000 [17]int8
 14789  
 14790  func init() {
 14791  	crt.Xstrncpy(nil, &_journalHdrOffsetØ00__func__Ø000[0], str(13772), 17)
 14792  }
 14793  
 14794  func _sqlite3OsDeviceCharacteristics(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
 14795  	return func() func(*crt.TLS, *Xsqlite3_file) int32 {
 14796  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxDeviceCharacteristics
 14797  		return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v))
 14798  	}()(tls, _id)
 14799  }
 14800  
 14801  // C comment
 14802  //  /*
 14803  //  ** Journal files begin with the following magic string.  The data
 14804  //  ** was obtained from /dev/random.  It is used only as a sanity check.
 14805  //  **
 14806  //  ** Since version 2.8.0, the journal format contains additional sanity
 14807  //  ** checking information.  If the power fails while the journal is being
 14808  //  ** written, semi-random garbage data might appear in the journal
 14809  //  ** file after power is restored.  If an attempt is then made
 14810  //  ** to roll the journal back, the database could be corrupted.  The additional
 14811  //  ** sanity checking data is an attempt to discover the garbage in the
 14812  //  ** journal and ignore it.
 14813  //  **
 14814  //  ** The sanity checking information for the new journal format consists
 14815  //  ** of a 32-bit checksum on each page of data.  The checksum covers both
 14816  //  ** the page number and the pPager->pageSize bytes of data for the page.
 14817  //  ** This cksum is initialized to a 32-bit random value that appears in the
 14818  //  ** journal file right after the header.  The random initializer is important,
 14819  //  ** because garbage data that appears at the end of a journal is likely
 14820  //  ** data that was once in other files that have now been deleted.  If the
 14821  //  ** garbage data came from an obsolete journal file, the checksums might
 14822  //  ** be correct.  But by initializing the checksum to random value which
 14823  //  ** is different for every journal, we minimize that risk.
 14824  //  */
 14825  var _aJournalMagic [8]uint8
 14826  
 14827  func init() {
 14828  	_aJournalMagic = [8]uint8{217, 213, 5, 249, 32, 161, 99, 215}
 14829  }
 14830  
 14831  // C comment
 14832  //  /*
 14833  //  ** Return N random bytes.
 14834  //  */
 14835  func Xsqlite3_randomness(tls *crt.TLS, _N int32, _pBuf unsafe.Pointer) {
 14836  	var _2_i int32
 14837  	var _t uint8
 14838  	var _zBuf *uint8
 14839  	var _mutex *Xsqlite3_mutex
 14840  	var _2_k [256]int8
 14841  	_zBuf = (*uint8)(_pBuf)
 14842  	if Xsqlite3_initialize(tls) != 0 {
 14843  		return
 14844  	}
 14845  	_mutex = _sqlite3MutexAlloc(tls, int32(5))
 14846  	Xsqlite3_mutex_enter(tls, _mutex)
 14847  	if (_N <= int32(0)) || (_pBuf == nil) {
 14848  		_sqlite3Prng.XisInit = 0
 14849  		Xsqlite3_mutex_leave(tls, _mutex)
 14850  		return
 14851  	}
 14852  	if _sqlite3Prng.XisInit != 0 {
 14853  		goto _3
 14854  	}
 14855  	_sqlite3Prng.Xj = 0
 14856  	_sqlite3Prng.Xi = 0
 14857  	_sqlite3OsRandomness(tls, Xsqlite3_vfs_find(tls, nil), int32(256), (*int8)(unsafe.Pointer(&_2_k)))
 14858  	_2_i = int32(0)
 14859  _4:
 14860  	if _2_i >= int32(256) {
 14861  		goto _7
 14862  	}
 14863  	*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_2_i)) = uint8(_2_i)
 14864  	_2_i += 1
 14865  	goto _4
 14866  _7:
 14867  	_2_i = int32(0)
 14868  _8:
 14869  	if _2_i >= int32(256) {
 14870  		goto _11
 14871  	}
 14872  	{
 14873  		p := &_sqlite3Prng.Xj
 14874  		*p = uint8(int32(*p) + (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_2_i))) + int32(*elem1((*int8)(unsafe.Pointer(&_2_k)), uintptr(_2_i)))))
 14875  	}
 14876  	_t = *elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xj))
 14877  	*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xj)) = *elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_2_i))
 14878  	*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_2_i)) = _t
 14879  	_2_i += 1
 14880  	goto _8
 14881  _11:
 14882  	_sqlite3Prng.XisInit = uint8(1)
 14883  _3:
 14884  	func() {
 14885  		if _N <= int32(0) {
 14886  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26805), unsafe.Pointer(&_sqlite3_randomnessØ00__func__Ø000), unsafe.Pointer(str(13789)))
 14887  			crt.X__builtin_abort(tls)
 14888  		}
 14889  	}()
 14890  _14:
 14891  	_sqlite3Prng.Xi += 1
 14892  	_t = *elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xi))
 14893  	{
 14894  		p := &_sqlite3Prng.Xj
 14895  		*p = uint8(int32(*p) + int32(_t))
 14896  	}
 14897  	*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xi)) = *elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xj))
 14898  	*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xj)) = _t
 14899  	{
 14900  		p := &_t
 14901  		*p = uint8(int32(*p) + int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xi))))
 14902  	}
 14903  	*postInc15(&_zBuf, 1) = *elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_t))
 14904  	if preInc2(&_N, -1) != 0 {
 14905  		goto _14
 14906  	}
 14907  	Xsqlite3_mutex_leave(tls, _mutex)
 14908  	_ = _zBuf
 14909  	_ = _2_k
 14910  }
 14911  
 14912  // C comment
 14913  //  /* All threads share a single random number generator.
 14914  //  ** This structure is the current state of the generator.
 14915  //  */
 14916  var _sqlite3Prng Tsqlite3PrngType
 14917  
 14918  // C comment
 14919  //  /* SQLITE_OMIT_LOAD_EXTENSION */
 14920  func _sqlite3OsRandomness(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nByte int32, _zBufOut *int8) (r0 int32) {
 14921  	return func() func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32 {
 14922  		v := _pVfs.XxRandomness
 14923  		return *(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&v))
 14924  	}()(tls, _pVfs, _nByte, _zBufOut)
 14925  }
 14926  
 14927  // C comment
 14928  //  /*
 14929  //  ** Locate a VFS by name.  If no name is given, simply return the
 14930  //  ** first VFS on the list.
 14931  //  */
 14932  func Xsqlite3_vfs_find(tls *crt.TLS, _zVfs *int8) (r0 *Xsqlite3_vfs) {
 14933  	var _rc int32
 14934  	var _mutex *Xsqlite3_mutex
 14935  	var _pVfs *Xsqlite3_vfs
 14936  	_pVfs = nil
 14937  	_rc = Xsqlite3_initialize(tls)
 14938  	if _rc != 0 {
 14939  		return nil
 14940  	}
 14941  	_mutex = _sqlite3MutexAlloc(tls, int32(2))
 14942  	Xsqlite3_mutex_enter(tls, _mutex)
 14943  	_pVfs = _vfsList
 14944  _1:
 14945  	if _pVfs == nil {
 14946  		goto _4
 14947  	}
 14948  	if _zVfs == nil {
 14949  		goto _4
 14950  	}
 14951  	if crt.Xstrcmp(tls, _zVfs, _pVfs.XzName) == int32(0) {
 14952  		goto _4
 14953  	}
 14954  	_pVfs = (*Xsqlite3_vfs)(_pVfs.XpNext)
 14955  	goto _1
 14956  _4:
 14957  	Xsqlite3_mutex_leave(tls, _mutex)
 14958  	return _pVfs
 14959  }
 14960  
 14961  // C comment
 14962  //  /*
 14963  //  ** The list of all registered VFS implementations.
 14964  //  */
 14965  var _vfsList *Xsqlite3_vfs
 14966  
 14967  var _sqlite3_randomnessØ00__func__Ø000 [19]int8
 14968  
 14969  func init() {
 14970  	crt.Xstrncpy(nil, &_sqlite3_randomnessØ00__func__Ø000[0], str(13793), 19)
 14971  }
 14972  
 14973  // C comment
 14974  //  /*
 14975  //  ** Destroy a bitmap object.  Reclaim all memory used.
 14976  //  */
 14977  func _sqlite3BitvecDestroy(tls *crt.TLS, _p *XBitvec) {
 14978  	var _1_i uint32
 14979  	if _p == nil {
 14980  		return
 14981  	}
 14982  	if _p.XiDivisor == 0 {
 14983  		goto _1
 14984  	}
 14985  	_1_i = 0
 14986  _2:
 14987  	if uint64(_1_i) >= uint64(62) {
 14988  		goto _5
 14989  	}
 14990  	_sqlite3BitvecDestroy(tls, *elem33((**XBitvec)(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_i)))
 14991  	_1_i += 1
 14992  	goto _2
 14993  _5:
 14994  _1:
 14995  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 14996  }
 14997  
 14998  // C comment
 14999  //  /*
 15000  //  ** Make sure the page is marked as dirty. If it isn't dirty already,
 15001  //  ** make it so.
 15002  //  */
 15003  func _sqlite3PcacheMakeDirty(tls *crt.TLS, _p *XPgHdr) {
 15004  	func() {
 15005  		if int32(_p.XnRef) <= int32(0) {
 15006  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44679), unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000), unsafe.Pointer(str(13812)))
 15007  			crt.X__builtin_abort(tls)
 15008  		}
 15009  	}()
 15010  	func() {
 15011  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 15012  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44680), unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000), unsafe.Pointer(str(13822)))
 15013  			crt.X__builtin_abort(tls)
 15014  		}
 15015  	}()
 15016  	if (int32(_p.Xflags) & int32(17)) == 0 {
 15017  		goto _4
 15018  	}
 15019  	{
 15020  		p := &_p.Xflags
 15021  		*p = uint16(int32(*p) & int32(-17))
 15022  	}
 15023  	if (int32(_p.Xflags) & int32(1)) != 0 {
 15024  		{
 15025  			p := &_p.Xflags
 15026  			*p = uint16(int32(*p) ^ int32(3))
 15027  		}
 15028  		func() {
 15029  			if (int32(_p.Xflags) & int32(3)) != int32(2) {
 15030  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44686), unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000), unsafe.Pointer(str(13849)))
 15031  				crt.X__builtin_abort(tls)
 15032  			}
 15033  		}()
 15034  		_pcacheManageDirtyList(tls, _p, uint8(2))
 15035  	}
 15036  	func() {
 15037  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 15038  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44689), unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000), unsafe.Pointer(str(13822)))
 15039  			crt.X__builtin_abort(tls)
 15040  		}
 15041  	}()
 15042  _4:
 15043  }
 15044  
 15045  var _sqlite3PcacheMakeDirtyØ00__func__Ø000 [23]int8
 15046  
 15047  func init() {
 15048  	crt.Xstrncpy(nil, &_sqlite3PcacheMakeDirtyØ00__func__Ø000[0], str(13901), 23)
 15049  }
 15050  
 15051  // C comment
 15052  //  /* Check invariants on a PgHdr object */
 15053  func _sqlite3PcachePageSanity(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 15054  	var _pCache *XPCache
 15055  	func() {
 15056  		if _pPg == nil {
 15057  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44233), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(13924)))
 15058  			crt.X__builtin_abort(tls)
 15059  		}
 15060  	}()
 15061  	func() {
 15062  		if _pPg.Xpgno <= (0) && (*XPager)(_pPg.XpPager) != nil {
 15063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44234), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(13931)))
 15064  			crt.X__builtin_abort(tls)
 15065  		}
 15066  	}()
 15067  	_pCache = (*XPCache)(_pPg.XpCache)
 15068  	func() {
 15069  		if _pCache == nil {
 15070  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44236), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(13961)))
 15071  			crt.X__builtin_abort(tls)
 15072  		}
 15073  	}()
 15074  	if (int32(_pPg.Xflags) & int32(1)) != 0 {
 15075  		func() {
 15076  			if (int32(_pPg.Xflags) & int32(2)) != int32(0) {
 15077  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44238), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(13971)))
 15078  				crt.X__builtin_abort(tls)
 15079  			}
 15080  		}()
 15081  		func() {
 15082  			if (*XPgHdr)(_pCache.XpDirty) == _pPg {
 15083  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44239), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(14001)))
 15084  				crt.X__builtin_abort(tls)
 15085  			}
 15086  		}()
 15087  		func() {
 15088  			if (*XPgHdr)(_pCache.XpDirtyTail) == _pPg {
 15089  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44240), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(14021)))
 15090  				crt.X__builtin_abort(tls)
 15091  			}
 15092  		}()
 15093  	}
 15094  	if (int32(_pPg.Xflags) & int32(4)) != 0 {
 15095  		func() {
 15096  			if (int32(_pPg.Xflags) & int32(2)) == 0 {
 15097  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44244), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(14045)))
 15098  				crt.X__builtin_abort(tls)
 15099  			}
 15100  		}()
 15101  	}
 15102  	return int32(1)
 15103  }
 15104  
 15105  var _sqlite3PcachePageSanityØ00__func__Ø000 [24]int8
 15106  
 15107  func init() {
 15108  	crt.Xstrncpy(nil, &_sqlite3PcachePageSanityØ00__func__Ø000[0], str(14070), 24)
 15109  }
 15110  
 15111  // C comment
 15112  //  /*
 15113  //  ** Manage pPage's participation on the dirty list.  Bits of the addRemove
 15114  //  ** argument determines what operation to do.  The 0x01 bit means first
 15115  //  ** remove pPage from the dirty list.  The 0x02 means add pPage back to
 15116  //  ** the dirty list.  Doing both moves pPage to the front of the dirty list.
 15117  //  */
 15118  func _pcacheManageDirtyList(tls *crt.TLS, _pPage *XPgHdr, _addRemove uint8) {
 15119  	var _p *XPCache
 15120  	_p = (*XPCache)(_pPage.XpCache)
 15121  	if (int32(_addRemove) & int32(1)) == 0 {
 15122  		goto _0
 15123  	}
 15124  	func() {
 15125  		if _pPage.XpDirtyNext == nil && _pPage != (*XPgHdr)(_p.XpDirtyTail) {
 15126  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44288), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14094)))
 15127  			crt.X__builtin_abort(tls)
 15128  		}
 15129  	}()
 15130  	func() {
 15131  		if _pPage.XpDirtyPrev == nil && _pPage != (*XPgHdr)(_p.XpDirty) {
 15132  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44289), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14136)))
 15133  			crt.X__builtin_abort(tls)
 15134  		}
 15135  	}()
 15136  	if (*XPgHdr)(_p.XpSynced) == _pPage {
 15137  		*(**XPgHdr)(unsafe.Pointer(&_p.XpSynced)) = (*XPgHdr)(_pPage.XpDirtyPrev)
 15138  	}
 15139  	if _pPage.XpDirtyNext != nil {
 15140  		*(**XPgHdr)(unsafe.Pointer(&((*XPgHdr)(_pPage.XpDirtyNext).XpDirtyPrev))) = (*XPgHdr)(_pPage.XpDirtyPrev)
 15141  		goto _9
 15142  	}
 15143  	func() {
 15144  		if _pPage != (*XPgHdr)(_p.XpDirtyTail) {
 15145  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44299), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14174)))
 15146  			crt.X__builtin_abort(tls)
 15147  		}
 15148  	}()
 15149  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirtyTail)) = (*XPgHdr)(_pPage.XpDirtyPrev)
 15150  _9:
 15151  	if _pPage.XpDirtyPrev != nil {
 15152  		*(**XPgHdr)(unsafe.Pointer(&((*XPgHdr)(_pPage.XpDirtyPrev).XpDirtyNext))) = (*XPgHdr)(_pPage.XpDirtyNext)
 15153  		goto _13
 15154  	}
 15155  	func() {
 15156  		if _pPage != (*XPgHdr)(_p.XpDirty) {
 15157  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44309), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14195)))
 15158  			crt.X__builtin_abort(tls)
 15159  		}
 15160  	}()
 15161  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirty)) = (*XPgHdr)(_pPage.XpDirtyNext)
 15162  	func() {
 15163  		if _p.XbPurgeable == 0 && int32(_p.XeCreate) != int32(2) {
 15164  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44311), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14212)))
 15165  			crt.X__builtin_abort(tls)
 15166  		}
 15167  	}()
 15168  	if (*XPgHdr)(_p.XpDirty) == nil {
 15169  		func() {
 15170  			if int32(_p.XbPurgeable) != int32(0) && int32(_p.XeCreate) != int32(1) {
 15171  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44313), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14243)))
 15172  				crt.X__builtin_abort(tls)
 15173  			}
 15174  		}()
 15175  		_p.XeCreate = uint8(2)
 15176  	}
 15177  _13:
 15178  	*(**XPgHdr)(unsafe.Pointer(&_pPage.XpDirtyNext)) = nil
 15179  	*(**XPgHdr)(unsafe.Pointer(&_pPage.XpDirtyPrev)) = nil
 15180  _0:
 15181  	if (int32(_addRemove) & int32(2)) == 0 {
 15182  		goto _23
 15183  	}
 15184  	func() {
 15185  		if (*XPgHdr)(_pPage.XpDirtyNext) != nil || (*XPgHdr)(_pPage.XpDirtyPrev) != nil || (*XPgHdr)(_p.XpDirty) == _pPage {
 15186  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44321), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14277)))
 15187  			crt.X__builtin_abort(tls)
 15188  		}
 15189  	}()
 15190  	*(**XPgHdr)(unsafe.Pointer(&_pPage.XpDirtyNext)) = (*XPgHdr)(_p.XpDirty)
 15191  	if _pPage.XpDirtyNext != nil {
 15192  		func() {
 15193  			if (*XPgHdr)((*XPgHdr)(_pPage.XpDirtyNext).XpDirtyPrev) != nil {
 15194  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44325), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14342)))
 15195  				crt.X__builtin_abort(tls)
 15196  			}
 15197  		}()
 15198  		*(**XPgHdr)(unsafe.Pointer(&((*XPgHdr)(_pPage.XpDirtyNext).XpDirtyPrev))) = _pPage
 15199  		goto _31
 15200  	}
 15201  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirtyTail)) = _pPage
 15202  	if _p.XbPurgeable != 0 {
 15203  		func() {
 15204  			if int32(_p.XeCreate) != int32(2) {
 15205  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44330), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14375)))
 15206  				crt.X__builtin_abort(tls)
 15207  			}
 15208  		}()
 15209  		_p.XeCreate = uint8(1)
 15210  	}
 15211  _31:
 15212  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirty)) = _pPage
 15213  	if (_p.XpSynced == nil) && (int32(0) == (int32(_pPage.Xflags) & int32(8))) {
 15214  		*(**XPgHdr)(unsafe.Pointer(&_p.XpSynced)) = _pPage
 15215  	}
 15216  _23:
 15217  }
 15218  
 15219  var _pcacheManageDirtyListØ00__func__Ø000 [22]int8
 15220  
 15221  func init() {
 15222  	crt.Xstrncpy(nil, &_pcacheManageDirtyListØ00__func__Ø000[0], str(14389), 22)
 15223  }
 15224  
 15225  // C comment
 15226  //  /*
 15227  //  ** Write page pPg onto the end of the rollback journal.
 15228  //  */
 15229  func _pagerAddPageToRollbackJournal(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 15230  	var _rc int32
 15231  	var _iOff int64
 15232  	var _cksum uint32
 15233  	var _pData2 *int8
 15234  	var _pPager *XPager
 15235  	_pPager = (*XPager)(_pPg.XpPager)
 15236  	_iOff = _pPager.XjournalOff
 15237  	func() {
 15238  		if _pPg.Xpgno == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1)) {
 15239  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52754), unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000), unsafe.Pointer(str(14411)))
 15240  			crt.X__builtin_abort(tls)
 15241  		}
 15242  	}()
 15243  	func() {
 15244  		if _pPager.XjournalHdr > _pPager.XjournalOff {
 15245  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52756), unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000), unsafe.Pointer(str(14444)))
 15246  			crt.X__builtin_abort(tls)
 15247  		}
 15248  	}()
 15249  	_pData2 = (*int8)(_pPg.XpData)
 15250  	_cksum = _pager_cksum(tls, _pPager, (*uint8)(unsafe.Pointer(_pData2)))
 15251  	{
 15252  		p := &_pPg.Xflags
 15253  		*p = uint16(int32(*p) | int32(8))
 15254  	}
 15255  	_rc = _write32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), _iOff, _pPg.Xpgno)
 15256  	if _rc != int32(0) {
 15257  		return _rc
 15258  	}
 15259  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(_pData2), _pPager.XpageSize, _iOff+int64(4))
 15260  	if _rc != int32(0) {
 15261  		return _rc
 15262  	}
 15263  	_rc = _write32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), (_iOff+int64(_pPager.XpageSize))+int64(4), _cksum)
 15264  	if _rc != int32(0) {
 15265  		return _rc
 15266  	}
 15267  	_pPager.XjournalOff += int64(int32(8) + _pPager.XpageSize)
 15268  	_pPager.XnRec += 1
 15269  	func() {
 15270  		if (*XBitvec)(_pPager.XpInJournal) == nil {
 15271  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52785), unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000), unsafe.Pointer(str(14483)))
 15272  			crt.X__builtin_abort(tls)
 15273  		}
 15274  	}()
 15275  	_rc = _sqlite3BitvecSet(tls, (*XBitvec)(_pPager.XpInJournal), _pPg.Xpgno)
 15276  	func() {
 15277  		if _rc != int32(0) && _rc != int32(7) {
 15278  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52788), unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000), unsafe.Pointer(str(5706)))
 15279  			crt.X__builtin_abort(tls)
 15280  		}
 15281  	}()
 15282  	_rc |= _addToSavepointBitvecs(tls, _pPager, _pPg.Xpgno)
 15283  	func() {
 15284  		if _rc != int32(0) && _rc != int32(7) {
 15285  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52790), unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000), unsafe.Pointer(str(5706)))
 15286  			crt.X__builtin_abort(tls)
 15287  		}
 15288  	}()
 15289  	return _rc
 15290  }
 15291  
 15292  var _pagerAddPageToRollbackJournalØ00__func__Ø000 [30]int8
 15293  
 15294  func init() {
 15295  	crt.Xstrncpy(nil, &_pagerAddPageToRollbackJournalØ00__func__Ø000[0], str(14505), 30)
 15296  }
 15297  
 15298  // C comment
 15299  //  /*
 15300  //  ** Parameter aData must point to a buffer of pPager->pageSize bytes
 15301  //  ** of data. Compute and return a checksum based ont the contents of the
 15302  //  ** page of data and the current value of pPager->cksumInit.
 15303  //  **
 15304  //  ** This is not a real checksum. It is really just the sum of the
 15305  //  ** random initial value (pPager->cksumInit) and every 200th byte
 15306  //  ** of the page data, starting with byte offset (pPager->pageSize%200).
 15307  //  ** Each byte is interpreted as an 8-bit unsigned integer.
 15308  //  **
 15309  //  ** Changing the formula used to compute this checksum results in an
 15310  //  ** incompatible journal file format.
 15311  //  **
 15312  //  ** If journal corruption occurs due to a power failure, the most likely
 15313  //  ** scenario is that one end or the other of the record will be changed.
 15314  //  ** It is much less likely that the two ends of the journal record will be
 15315  //  ** correct and the middle be corrupt.  Thus, this "checksum" scheme,
 15316  //  ** though fast and simple, catches the mostly likely kind of corruption.
 15317  //  */
 15318  func _pager_cksum(tls *crt.TLS, _pPager *XPager, _aData *uint8) (r0 uint32) {
 15319  	var _i int32
 15320  	var _cksum uint32
 15321  	_cksum = _pPager.XcksumInit
 15322  	_i = _pPager.XpageSize - int32(200)
 15323  _0:
 15324  	if _i > int32(0) {
 15325  		_cksum += uint32(*elem15(_aData, uintptr(_i)))
 15326  		_i -= int32(200)
 15327  		goto _0
 15328  	}
 15329  	return _cksum
 15330  }
 15331  
 15332  // C comment
 15333  //  /*
 15334  //  ** Release a page reference.
 15335  //  **
 15336  //  ** If the number of references to the page drop to zero, then the
 15337  //  ** page is added to the LRU list.  When all references to all pages
 15338  //  ** are released, a rollback occurs and the lock on the database is
 15339  //  ** removed.
 15340  //  */
 15341  func _sqlite3PagerUnrefNotNull(tls *crt.TLS, _pPg *XPgHdr) {
 15342  	var _pPager *XPager
 15343  	func() {
 15344  		if _pPg == nil {
 15345  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52551), unsafe.Pointer(&_sqlite3PagerUnrefNotNullØ00__func__Ø000), unsafe.Pointer(str(13924)))
 15346  			crt.X__builtin_abort(tls)
 15347  		}
 15348  	}()
 15349  	_pPager = (*XPager)(_pPg.XpPager)
 15350  	if (int32(_pPg.Xflags) & int32(32)) != 0 {
 15351  		_pagerReleaseMapPage(tls, _pPg)
 15352  		goto _3
 15353  	}
 15354  	_sqlite3PcacheRelease(tls, _pPg)
 15355  _3:
 15356  	_pagerUnlockIfUnused(tls, _pPager)
 15357  }
 15358  
 15359  var _sqlite3PagerUnrefNotNullØ00__func__Ø000 [25]int8
 15360  
 15361  func init() {
 15362  	crt.Xstrncpy(nil, &_sqlite3PagerUnrefNotNullØ00__func__Ø000[0], str(14535), 25)
 15363  }
 15364  
 15365  // C comment
 15366  //  /*
 15367  //  ** Release a reference to page pPg. pPg must have been returned by an
 15368  //  ** earlier call to pagerAcquireMapPage().
 15369  //  */
 15370  func _pagerReleaseMapPage(tls *crt.TLS, _pPg *XPgHdr) {
 15371  	var _pPager *XPager
 15372  	_pPager = (*XPager)(_pPg.XpPager)
 15373  	_pPager.XnMmapOut -= 1
 15374  	*(**XPgHdr)(unsafe.Pointer(&_pPg.XpDirty)) = (*XPgHdr)(_pPager.XpMmapFreelist)
 15375  	*(**XPgHdr)(unsafe.Pointer(&_pPager.XpMmapFreelist)) = _pPg
 15376  	func() {
 15377  		if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods).XiVersion) < int32(3) {
 15378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50978), unsafe.Pointer(&_pagerReleaseMapPageØ00__func__Ø000), unsafe.Pointer(str(14560)))
 15379  			crt.X__builtin_abort(tls)
 15380  		}
 15381  	}()
 15382  	_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), int64(_pPg.Xpgno-uint32(1))*int64(_pPager.XpageSize), _pPg.XpData)
 15383  }
 15384  
 15385  var _pagerReleaseMapPageØ00__func__Ø000 [20]int8
 15386  
 15387  func init() {
 15388  	crt.Xstrncpy(nil, &_pagerReleaseMapPageØ00__func__Ø000[0], str(14594), 20)
 15389  }
 15390  
 15391  func _sqlite3OsUnfetch(tls *crt.TLS, _id *Xsqlite3_file, _iOff int64, _p unsafe.Pointer) (r0 int32) {
 15392  	return func() func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32 {
 15393  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxUnfetch
 15394  		return *(*func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32)(unsafe.Pointer(&v))
 15395  	}()(tls, _id, _iOff, _p)
 15396  }
 15397  
 15398  // C comment
 15399  //  /*
 15400  //  ** Decrement the reference count on a page. If the page is clean and the
 15401  //  ** reference count drops to 0, then it is made eligible for recycling.
 15402  //  */
 15403  func _sqlite3PcacheRelease(tls *crt.TLS, _p *XPgHdr) {
 15404  	func() {
 15405  		if int32(_p.XnRef) <= int32(0) {
 15406  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44634), unsafe.Pointer(&_sqlite3PcacheReleaseØ00__func__Ø000), unsafe.Pointer(str(13812)))
 15407  			crt.X__builtin_abort(tls)
 15408  		}
 15409  	}()
 15410  	(*XPCache)(_p.XpCache).XnRefSum -= 1
 15411  	if int32(preInc26(&_p.XnRef, -1)) != int32(0) {
 15412  		goto _2
 15413  	}
 15414  	if (int32(_p.Xflags) & int32(1)) != 0 {
 15415  		_pcacheUnpin(tls, _p)
 15416  		goto _5
 15417  	}
 15418  	if (*XPgHdr)(_p.XpDirtyPrev) != nil {
 15419  		_pcacheManageDirtyList(tls, _p, uint8(3))
 15420  	}
 15421  _5:
 15422  _2:
 15423  }
 15424  
 15425  var _sqlite3PcacheReleaseØ00__func__Ø000 [21]int8
 15426  
 15427  func init() {
 15428  	crt.Xstrncpy(nil, &_sqlite3PcacheReleaseØ00__func__Ø000[0], str(14614), 21)
 15429  }
 15430  
 15431  // C comment
 15432  //  /*
 15433  //  ** Wrapper around the pluggable caches xUnpin method. If the cache is
 15434  //  ** being used for an in-memory database, this function is a no-op.
 15435  //  */
 15436  func _pcacheUnpin(tls *crt.TLS, _p *XPgHdr) {
 15437  	if ((*XPCache)(_p.XpCache).XbPurgeable) != 0 {
 15438  		func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32) {
 15439  			v := _sqlite3Config.Xpcache2.XxUnpin
 15440  			return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32))(unsafe.Pointer(&v))
 15441  		}()(tls, (*XPCache)(_p.XpCache).XpCache, (*Xsqlite3_pcache_page)(_p.XpPage), int32(0))
 15442  	}
 15443  }
 15444  
 15445  func _pagerUnlockIfUnused(tls *crt.TLS, _pPager *XPager) {
 15446  	if (_pPager.XnMmapOut == int32(0)) && (_sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache)) == int32(0)) {
 15447  		_pagerUnlockAndRollback(tls, _pPager)
 15448  	}
 15449  }
 15450  
 15451  // C comment
 15452  //  /*
 15453  //  ** Execute a rollback if a transaction is active and unlock the
 15454  //  ** database file.
 15455  //  **
 15456  //  ** If the pager has already entered the ERROR state, do not attempt
 15457  //  ** the rollback at this time. Instead, pager_unlock() is called. The
 15458  //  ** call to pager_unlock() will discard all in-memory pages, unlock
 15459  //  ** the database file and move the pager back to OPEN state. If this
 15460  //  ** means that there is a hot-journal left in the file-system, the next
 15461  //  ** connection to obtain a shared lock on the pager (which may be this one)
 15462  //  ** will roll it back.
 15463  //  **
 15464  //  ** If the pager has not already entered the ERROR state, but an IO or
 15465  //  ** malloc error occurs during a rollback, then this will itself cause
 15466  //  ** the pager to enter the ERROR state. Which will be cleared by the
 15467  //  ** call to pager_unlock(), as described above.
 15468  //  */
 15469  func _pagerUnlockAndRollback(tls *crt.TLS, _pPager *XPager) {
 15470  	if int32(_pPager.XeState) == int32(6) || int32(_pPager.XeState) == int32(0) {
 15471  		goto _1
 15472  	}
 15473  	func() {
 15474  		if _assert_pager_state(tls, _pPager) == 0 {
 15475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49056), unsafe.Pointer(&_pagerUnlockAndRollbackØ00__func__Ø000), unsafe.Pointer(str(10971)))
 15476  			crt.X__builtin_abort(tls)
 15477  		}
 15478  	}()
 15479  	if int32(_pPager.XeState) >= int32(2) {
 15480  		_sqlite3BeginBenignMalloc(tls)
 15481  		_sqlite3PagerRollback(tls, _pPager)
 15482  		_sqlite3EndBenignMalloc(tls)
 15483  		goto _6
 15484  	}
 15485  	if _pPager.XexclusiveMode == 0 {
 15486  		func() {
 15487  			if int32(_pPager.XeState) != int32(1) {
 15488  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49062), unsafe.Pointer(&_pagerUnlockAndRollbackØ00__func__Ø000), unsafe.Pointer(str(14635)))
 15489  				crt.X__builtin_abort(tls)
 15490  			}
 15491  		}()
 15492  		_pager_end_transaction(tls, _pPager, int32(0), int32(0))
 15493  	}
 15494  _6:
 15495  _1:
 15496  	_pager_unlock(tls, _pPager)
 15497  }
 15498  
 15499  var _pagerUnlockAndRollbackØ00__func__Ø000 [23]int8
 15500  
 15501  func init() {
 15502  	crt.Xstrncpy(nil, &_pagerUnlockAndRollbackØ00__func__Ø000[0], str(14664), 23)
 15503  }
 15504  
 15505  // C comment
 15506  //  /*
 15507  //  ** If a write transaction is open, then all changes made within the
 15508  //  ** transaction are reverted and the current write-transaction is closed.
 15509  //  ** The pager falls back to PAGER_READER state if successful, or PAGER_ERROR
 15510  //  ** state if an error occurs.
 15511  //  **
 15512  //  ** If the pager is already in PAGER_ERROR state when this function is called,
 15513  //  ** it returns Pager.errCode immediately. No work is performed in this case.
 15514  //  **
 15515  //  ** Otherwise, in rollback mode, this function performs two functions:
 15516  //  **
 15517  //  **   1) It rolls back the journal file, restoring all database file and
 15518  //  **      in-memory cache pages to the state they were in when the transaction
 15519  //  **      was opened, and
 15520  //  **
 15521  //  **   2) It finalizes the journal file, so that it is not used for hot
 15522  //  **      rollback at any point in the future.
 15523  //  **
 15524  //  ** Finalization of the journal file (task 2) is only performed if the
 15525  //  ** rollback is successful.
 15526  //  **
 15527  //  ** In WAL mode, all cache-entries containing data modified within the
 15528  //  ** current transaction are either expelled from the cache or reverted to
 15529  //  ** their pre-transaction state by re-reading data from the database or
 15530  //  ** WAL files. The WAL transaction is then closed.
 15531  //  */
 15532  func _sqlite3PagerRollback(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 15533  	var _rc, _1_rc2, _2_eState int32
 15534  	_rc = int32(0)
 15535  	func() {
 15536  		if _assert_pager_state(tls, _pPager) == 0 {
 15537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53472), unsafe.Pointer(&_sqlite3PagerRollbackØ00__func__Ø000), unsafe.Pointer(str(10971)))
 15538  			crt.X__builtin_abort(tls)
 15539  		}
 15540  	}()
 15541  	if int32(_pPager.XeState) == int32(6) {
 15542  		return _pPager.XerrCode
 15543  	}
 15544  	if int32(_pPager.XeState) <= int32(1) {
 15545  		return int32(0)
 15546  	}
 15547  	if (*XWal)(_pPager.XpWal) == nil {
 15548  		goto _4
 15549  	}
 15550  	_rc = _sqlite3PagerSavepoint(tls, _pPager, int32(2), int32(-1))
 15551  	_1_rc2 = _pager_end_transaction(tls, _pPager, int32(_pPager.XsetMaster), int32(0))
 15552  	if _rc == int32(0) {
 15553  		_rc = _1_rc2
 15554  	}
 15555  	goto _11
 15556  _4:
 15557  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil && int32(_pPager.XeState) != int32(2) {
 15558  		goto _8
 15559  	}
 15560  	_2_eState = int32(_pPager.XeState)
 15561  	_rc = _pager_end_transaction(tls, _pPager, int32(0), int32(0))
 15562  	if (_pPager.XmemDb == 0) && (_2_eState > int32(2)) {
 15563  		_pPager.XerrCode = int32(4)
 15564  		_pPager.XeState = uint8(6)
 15565  		_setGetterMethod(tls, _pPager)
 15566  		return _rc
 15567  	}
 15568  	goto _11
 15569  _8:
 15570  	_rc = _pager_playback(tls, _pPager, int32(0))
 15571  _11:
 15572  	func() {
 15573  		if int32(_pPager.XeState) != int32(1) && _rc == int32(0) {
 15574  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53498), unsafe.Pointer(&_sqlite3PagerRollbackØ00__func__Ø000), unsafe.Pointer(str(14687)))
 15575  			crt.X__builtin_abort(tls)
 15576  		}
 15577  	}()
 15578  	func() {
 15579  		if _rc != int32(0) && _rc != int32(13) && _rc != int32(11) && _rc != int32(7) && (_rc&int32(255)) != int32(10) && _rc != int32(14) {
 15580  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53499), unsafe.Pointer(&_sqlite3PagerRollbackØ00__func__Ø000), unsafe.Pointer(str(14733)))
 15581  			crt.X__builtin_abort(tls)
 15582  		}
 15583  	}()
 15584  	return _pager_error(tls, _pPager, _rc)
 15585  }
 15586  
 15587  var _sqlite3PagerRollbackØ00__func__Ø000 [21]int8
 15588  
 15589  func init() {
 15590  	crt.Xstrncpy(nil, &_sqlite3PagerRollbackØ00__func__Ø000[0], str(14858), 21)
 15591  }
 15592  
 15593  func _sqlite3PagerSavepoint(tls *crt.TLS, _pPager *XPager, _op int32, _iSavepoint int32) (r0 int32) {
 15594  	var _rc, _1_ii, _1_nNew int32
 15595  	var _6_pSavepoint *XPagerSavepoint
 15596  	_rc = _pPager.XerrCode
 15597  	func() {
 15598  		if _op != int32(1) && _op != int32(2) {
 15599  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53702), unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000), unsafe.Pointer(str(14879)))
 15600  			crt.X__builtin_abort(tls)
 15601  		}
 15602  	}()
 15603  	func() {
 15604  		if _iSavepoint < int32(0) && _op != int32(2) {
 15605  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53703), unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000), unsafe.Pointer(str(14927)))
 15606  			crt.X__builtin_abort(tls)
 15607  		}
 15608  	}()
 15609  	if _rc != int32(0) || _iSavepoint >= _pPager.XnSavepoint {
 15610  		goto _7
 15611  	}
 15612  	_1_nNew = _iSavepoint + func() int32 {
 15613  		if _op == int32(1) {
 15614  			return int32(0)
 15615  		}
 15616  		return int32(1)
 15617  	}()
 15618  	_1_ii = _1_nNew
 15619  _10:
 15620  	if _1_ii >= _pPager.XnSavepoint {
 15621  		goto _13
 15622  	}
 15623  	_sqlite3BitvecDestroy(tls, (*XBitvec)(elem32((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_1_ii)).XpInSavepoint))
 15624  	_1_ii += 1
 15625  	goto _10
 15626  _13:
 15627  	_pPager.XnSavepoint = _1_nNew
 15628  	if _op != int32(1) {
 15629  		goto _14
 15630  	}
 15631  	if _1_nNew != int32(0) || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xsjfd).XpMethods) == nil {
 15632  		goto _16
 15633  	}
 15634  	if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.Xsjfd)) != 0 {
 15635  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xsjfd), 0)
 15636  		func() {
 15637  			if _rc != int32(0) {
 15638  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53726), unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000), unsafe.Pointer(str(14967)))
 15639  				crt.X__builtin_abort(tls)
 15640  			}
 15641  		}()
 15642  	}
 15643  	_pPager.XnSubRec = 0
 15644  _16:
 15645  	goto _22
 15646  _14:
 15647  	if ((*XWal)(_pPager.XpWal) != nil) || ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil) {
 15648  		_6_pSavepoint = func() *XPagerSavepoint {
 15649  			if _1_nNew == int32(0) {
 15650  				return nil
 15651  			}
 15652  			return elem32((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_1_nNew-int32(1)))
 15653  		}()
 15654  		_rc = _pagerPlaybackSavepoint(tls, _pPager, _6_pSavepoint)
 15655  		func() {
 15656  			if _rc == int32(101) {
 15657  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53739), unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000), unsafe.Pointer(str(14981)))
 15658  				crt.X__builtin_abort(tls)
 15659  			}
 15660  		}()
 15661  	}
 15662  _22:
 15663  _7:
 15664  	return _rc
 15665  }
 15666  
 15667  var _sqlite3PagerSavepointØ00__func__Ø000 [22]int8
 15668  
 15669  func init() {
 15670  	crt.Xstrncpy(nil, &_sqlite3PagerSavepointØ00__func__Ø000[0], str(14997), 22)
 15671  }
 15672  
 15673  // C comment
 15674  //  /*
 15675  //  ** The file-handle passed as the only argument is open on a journal file.
 15676  //  ** Return true if this "journal file" is currently stored in heap memory,
 15677  //  ** or false otherwise.
 15678  //  */
 15679  func _sqlite3JournalIsInMemory(tls *crt.TLS, _p *Xsqlite3_file) (r0 int32) {
 15680  	return bool2int((*Xsqlite3_io_methods)(_p.XpMethods) == &_MemJournalMethods)
 15681  }
 15682  
 15683  func _sqlite3OsTruncate(tls *crt.TLS, _id *Xsqlite3_file, _size int64) (r0 int32) {
 15684  	return func() func(*crt.TLS, *Xsqlite3_file, int64) int32 {
 15685  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxTruncate
 15686  		return *(*func(*crt.TLS, *Xsqlite3_file, int64) int32)(unsafe.Pointer(&v))
 15687  	}()(tls, _id, _size)
 15688  }
 15689  
 15690  // C comment
 15691  //  /*
 15692  //  ** Playback savepoint pSavepoint. Or, if pSavepoint==NULL, then playback
 15693  //  ** the entire master journal file. The case pSavepoint==NULL occurs when
 15694  //  ** a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction
 15695  //  ** savepoint.
 15696  //  **
 15697  //  ** When pSavepoint is not NULL (meaning a non-transaction savepoint is
 15698  //  ** being rolled back), then the rollback consists of up to three stages,
 15699  //  ** performed in the order specified:
 15700  //  **
 15701  //  **   * Pages are played back from the main journal starting at byte
 15702  //  **     offset PagerSavepoint.iOffset and continuing to
 15703  //  **     PagerSavepoint.iHdrOffset, or to the end of the main journal
 15704  //  **     file if PagerSavepoint.iHdrOffset is zero.
 15705  //  **
 15706  //  **   * If PagerSavepoint.iHdrOffset is not zero, then pages are played
 15707  //  **     back starting from the journal header immediately following
 15708  //  **     PagerSavepoint.iHdrOffset to the end of the main journal file.
 15709  //  **
 15710  //  **   * Pages are then played back from the sub-journal file, starting
 15711  //  **     with the PagerSavepoint.iSubRec and continuing to the end of
 15712  //  **     the journal file.
 15713  //  **
 15714  //  ** Throughout the rollback process, each time a page is rolled back, the
 15715  //  ** corresponding bit is set in a bitvec structure (variable pDone in the
 15716  //  ** implementation below). This is used to ensure that a page is only
 15717  //  ** rolled back the first time it is encountered in either journal.
 15718  //  **
 15719  //  ** If pSavepoint is NULL, then pages are only played back from the main
 15720  //  ** journal file. There is no need for a bitvec in this case.
 15721  //  **
 15722  //  ** In either case, before playback commences the Pager.dbSize variable
 15723  //  ** is reset to the value that it held at the start of the savepoint
 15724  //  ** (or transaction). No page with a page-number greater than this value
 15725  //  ** is played back. If one is encountered it is simply skipped.
 15726  //  */
 15727  func _pagerPlaybackSavepoint(tls *crt.TLS, _pPager *XPager, _pSavepoint *XPagerSavepoint) (r0 int32) {
 15728  	var _rc int32
 15729  	var _szJ, _iHdrOff, _10_offset int64
 15730  	var _7_ii, _7_nJRec, _7_dummy, _10_ii uint32
 15731  	var _pDone *XBitvec
 15732  	_rc = int32(0)
 15733  	_pDone = nil
 15734  	func() {
 15735  		if int32(_pPager.XeState) == int32(6) {
 15736  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50292), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(15019)))
 15737  			crt.X__builtin_abort(tls)
 15738  		}
 15739  	}()
 15740  	func() {
 15741  		if int32(_pPager.XeState) < int32(2) {
 15742  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50293), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(10935)))
 15743  			crt.X__builtin_abort(tls)
 15744  		}
 15745  	}()
 15746  	if _pSavepoint == nil {
 15747  		goto _4
 15748  	}
 15749  	_pDone = _sqlite3BitvecCreate(tls, _pSavepoint.XnOrig)
 15750  	if _pDone == nil {
 15751  		return _sqlite3NomemError(tls, int32(50299))
 15752  	}
 15753  _4:
 15754  	_pPager.XdbSize = func() uint32 {
 15755  		if _pSavepoint != nil {
 15756  			return _pSavepoint.XnOrig
 15757  		}
 15758  		return _pPager.XdbOrigSize
 15759  	}()
 15760  	_pPager.XchangeCountDone = _pPager.XtempFile
 15761  	if (_pSavepoint == nil) && ((*XWal)(_pPager.XpWal) != nil) {
 15762  		return _pagerRollbackWal(tls, _pPager)
 15763  	}
 15764  	_szJ = _pPager.XjournalOff
 15765  	func() {
 15766  		if bool2int((*XWal)(_pPager.XpWal) != nil) != int32(0) && _szJ != (0) {
 15767  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50319), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(15047)))
 15768  			crt.X__builtin_abort(tls)
 15769  		}
 15770  	}()
 15771  	if _pSavepoint == nil || (*XWal)(_pPager.XpWal) != nil {
 15772  		goto _14
 15773  	}
 15774  	_iHdrOff = func() int64 {
 15775  		if _pSavepoint.XiHdrOffset != 0 {
 15776  			return _pSavepoint.XiHdrOffset
 15777  		}
 15778  		return _szJ
 15779  	}()
 15780  	_pPager.XjournalOff = _pSavepoint.XiOffset
 15781  _17:
 15782  	if (_rc == int32(0)) && (_pPager.XjournalOff < _iHdrOff) {
 15783  		_rc = _pager_playback_one_page(tls, _pPager, &_pPager.XjournalOff, _pDone, int32(1), int32(1))
 15784  		goto _17
 15785  	}
 15786  	func() {
 15787  		if _rc == int32(101) {
 15788  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50334), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(14981)))
 15789  			crt.X__builtin_abort(tls)
 15790  		}
 15791  	}()
 15792  	goto _22
 15793  _14:
 15794  	_pPager.XjournalOff = 0
 15795  _22:
 15796  	if _rc != int32(0) || _pPager.XjournalOff >= _szJ {
 15797  		goto _24
 15798  	}
 15799  	_7_nJRec = 0
 15800  	_rc = _readJournalHdr(tls, _pPager, int32(0), _szJ, &_7_nJRec, &_7_dummy)
 15801  	func() {
 15802  		if _rc == int32(101) {
 15803  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50349), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(14981)))
 15804  			crt.X__builtin_abort(tls)
 15805  		}
 15806  	}()
 15807  	if (_7_nJRec == (0)) && ((_pPager.XjournalHdr + int64(_pPager.XsectorSize)) == _pPager.XjournalOff) {
 15808  		_7_nJRec = uint32((_szJ - _pPager.XjournalOff) / int64(_pPager.XpageSize+int32(8)))
 15809  	}
 15810  	_7_ii = 0
 15811  _30:
 15812  	if _rc != int32(0) || _7_ii >= _7_nJRec || _pPager.XjournalOff >= _szJ {
 15813  		goto _35
 15814  	}
 15815  	_rc = _pager_playback_one_page(tls, _pPager, &_pPager.XjournalOff, _pDone, int32(1), int32(1))
 15816  	_7_ii += 1
 15817  	goto _30
 15818  _35:
 15819  	func() {
 15820  		if _rc == int32(101) {
 15821  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50364), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(14981)))
 15822  			crt.X__builtin_abort(tls)
 15823  		}
 15824  	}()
 15825  	goto _22
 15826  _24:
 15827  	func() {
 15828  		if _rc == int32(0) && _pPager.XjournalOff < _szJ {
 15829  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50366), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(15080)))
 15830  			crt.X__builtin_abort(tls)
 15831  		}
 15832  	}()
 15833  	if _pSavepoint == nil {
 15834  		goto _41
 15835  	}
 15836  	_10_offset = int64(_pSavepoint.XiSubRec) * int64(int32(4)+_pPager.XpageSize)
 15837  	if (*XWal)(_pPager.XpWal) != nil {
 15838  		_rc = _sqlite3WalSavepointUndo(tls, (*XWal)(_pPager.XpWal), (*uint32)(unsafe.Pointer(&_pSavepoint.XaWalData)))
 15839  	}
 15840  	_10_ii = _pSavepoint.XiSubRec
 15841  _43:
 15842  	if _rc != int32(0) || _10_ii >= _pPager.XnSubRec {
 15843  		goto _47
 15844  	}
 15845  	func() {
 15846  		if _10_offset != (int64(_10_ii) * int64(int32(4)+_pPager.XpageSize)) {
 15847  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50380), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(15121)))
 15848  			crt.X__builtin_abort(tls)
 15849  		}
 15850  	}()
 15851  	_rc = _pager_playback_one_page(tls, _pPager, &_10_offset, _pDone, int32(0), int32(1))
 15852  	_10_ii += 1
 15853  	goto _43
 15854  _47:
 15855  	func() {
 15856  		if _rc == int32(101) {
 15857  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50383), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(14981)))
 15858  			crt.X__builtin_abort(tls)
 15859  		}
 15860  	}()
 15861  _41:
 15862  	_sqlite3BitvecDestroy(tls, _pDone)
 15863  	if _rc == int32(0) {
 15864  		_pPager.XjournalOff = _szJ
 15865  	}
 15866  	return _rc
 15867  }
 15868  
 15869  var _pagerPlaybackSavepointØ00__func__Ø000 [23]int8
 15870  
 15871  func init() {
 15872  	crt.Xstrncpy(nil, &_pagerPlaybackSavepointØ00__func__Ø000[0], str(15158), 23)
 15873  }
 15874  
 15875  // C comment
 15876  //  /*
 15877  //  ** This function is called to rollback a transaction on a WAL database.
 15878  //  */
 15879  func _pagerRollbackWal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 15880  	var _rc int32
 15881  	var _pList, _1_pNext *XPgHdr
 15882  	_pPager.XdbSize = _pPager.XdbOrigSize
 15883  	_rc = _sqlite3WalUndo(tls, (*XWal)(_pPager.XpWal), _pagerUndoCallback, unsafe.Pointer(_pPager))
 15884  	_pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.XpPCache))
 15885  _0:
 15886  	if (_pList != nil) && (_rc == int32(0)) {
 15887  		_1_pNext = (*XPgHdr)(_pList.XpDirty)
 15888  		_rc = _pagerUndoCallback(tls, unsafe.Pointer(_pPager), _pList.Xpgno)
 15889  		_pList = _1_pNext
 15890  		goto _0
 15891  	}
 15892  	return _rc
 15893  }
 15894  
 15895  // C comment
 15896  //  /*
 15897  //  ** If any data has been written (but not committed) to the log file, this
 15898  //  ** function moves the write-pointer back to the start of the transaction.
 15899  //  **
 15900  //  ** Additionally, the callback function is invoked for each frame written
 15901  //  ** to the WAL since the start of the transaction. If the callback returns
 15902  //  ** other than SQLITE_OK, it is not invoked again and the error code is
 15903  //  ** returned to the caller.
 15904  //  **
 15905  //  ** Otherwise, if the callback function does not return an error, this
 15906  //  ** function returns SQLITE_OK.
 15907  //  */
 15908  func _sqlite3WalUndo(tls *crt.TLS, _pWal *XWal, _xUndo func(*crt.TLS, unsafe.Pointer, uint32) int32, _pUndoCtx unsafe.Pointer) (r0 int32) {
 15909  	var _rc int32
 15910  	var _1_iMax, _1_iFrame uint32
 15911  	_rc = int32(0)
 15912  	if func() int32 {
 15913  		if _pWal.XwriteLock != 0 {
 15914  			return int32(1)
 15915  		}
 15916  		return func() int32 {
 15917  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57261), unsafe.Pointer(&_sqlite3WalUndoØ00__func__Ø000), unsafe.Pointer(str(4809)))
 15918  			crt.X__builtin_abort(tls)
 15919  			return int32(0)
 15920  		}()
 15921  	}() == 0 {
 15922  		goto _2
 15923  	}
 15924  	_1_iMax = _pWal.Xhdr.XmxFrame
 15925  	crt.Xmemcpy(tls, unsafe.Pointer(&_pWal.Xhdr), unsafe.Pointer(_walIndexHdr(tls, _pWal)), uint64(48))
 15926  	_1_iFrame = (_pWal.Xhdr.XmxFrame) + uint32(1)
 15927  _3:
 15928  	if func() int32 {
 15929  		if _rc == int32(0) {
 15930  			return int32(1)
 15931  		}
 15932  		return func() int32 {
 15933  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57271), unsafe.Pointer(&_sqlite3WalUndoØ00__func__Ø000), unsafe.Pointer(str(4809)))
 15934  			crt.X__builtin_abort(tls)
 15935  			return int32(0)
 15936  		}()
 15937  	}() == 0 || _1_iFrame > _1_iMax {
 15938  		goto _9
 15939  	}
 15940  	func() {
 15941  		if _walFramePgno(tls, _pWal, _1_iFrame) == uint32(1) {
 15942  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57285), unsafe.Pointer(&_sqlite3WalUndoØ00__func__Ø000), unsafe.Pointer(str(15181)))
 15943  			crt.X__builtin_abort(tls)
 15944  		}
 15945  	}()
 15946  	_rc = _xUndo(tls, _pUndoCtx, _walFramePgno(tls, _pWal, _1_iFrame))
 15947  	_1_iFrame += 1
 15948  	goto _3
 15949  _9:
 15950  	if _1_iMax != (_pWal.Xhdr.XmxFrame) {
 15951  		_walCleanupHash(tls, _pWal)
 15952  	}
 15953  _2:
 15954  	return _rc
 15955  }
 15956  
 15957  var _sqlite3WalUndoØ00__func__Ø000 [15]int8
 15958  
 15959  func init() {
 15960  	crt.Xstrncpy(nil, &_sqlite3WalUndoØ00__func__Ø000[0], str(15211), 15)
 15961  }
 15962  
 15963  // C comment
 15964  //  /*
 15965  //  ** Return a pointer to the WalIndexHdr structure in the wal-index.
 15966  //  */
 15967  func _walIndexHdr(tls *crt.TLS, _pWal *XWal) (r0 *XWalIndexHdr) {
 15968  	func() {
 15969  		if _pWal.XnWiData <= int32(0) || (*elem38(_pWal.XapWiData, 0)) == nil {
 15970  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55066), unsafe.Pointer(&_walIndexHdrØ00__func__Ø000), unsafe.Pointer(str(15226)))
 15971  			crt.X__builtin_abort(tls)
 15972  		}
 15973  	}()
 15974  	return (*XWalIndexHdr)(unsafe.Pointer(*elem38(_pWal.XapWiData, 0)))
 15975  }
 15976  
 15977  var _walIndexHdrØ00__func__Ø000 [12]int8
 15978  
 15979  func init() {
 15980  	crt.Xstrncpy(nil, &_walIndexHdrØ00__func__Ø000[0], str(15263), 12)
 15981  }
 15982  
 15983  // C comment
 15984  //  /*
 15985  //  ** Return the page number associated with frame iFrame in this WAL.
 15986  //  */
 15987  func _walFramePgno(tls *crt.TLS, _pWal *XWal, _iFrame uint32) (r0 uint32) {
 15988  	var _iHash int32
 15989  	_iHash = _walFramePage(tls, _iFrame)
 15990  	if _iHash == int32(0) {
 15991  		return *elem31(*elem38(_pWal.XapWiData, 0), uintptr((uint64(34)+uint64(_iFrame))-uint64(1)))
 15992  	}
 15993  	return *elem31(*elem38(_pWal.XapWiData, uintptr(_iHash)), uintptr((uint64(_iFrame-uint32(1))-uint64(4062))%uint64(4096)))
 15994  }
 15995  
 15996  // C comment
 15997  //  /*
 15998  //  ** Return the number of the wal-index page that contains the hash-table
 15999  //  ** and page-number array that contain entries corresponding to WAL frame
 16000  //  ** iFrame. The wal-index is broken up into 32KB pages. Wal-index pages
 16001  //  ** are numbered starting from 0.
 16002  //  */
 16003  func _walFramePage(tls *crt.TLS, _iFrame uint32) (r0 int32) {
 16004  	var _iHash int32
 16005  	_iHash = int32(((uint64(_iFrame+uint32(4096)) - uint64(4062)) - uint64(1)) / uint64(4096))
 16006  	func() {
 16007  		if _iHash != int32(0) && uint64(_iFrame) <= uint64(4062) || _iHash < int32(1) && uint64(_iFrame) > uint64(4062) || _iHash > int32(1) && uint64(_iFrame) <= uint64(8158) || _iHash < int32(2) && uint64(_iFrame) > uint64(8158) || _iHash > int32(2) && uint64(_iFrame) <= uint64(12254) {
 16008  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55378), unsafe.Pointer(&_walFramePageØ00__func__Ø000), unsafe.Pointer(str(15275)))
 16009  			crt.X__builtin_abort(tls)
 16010  		}
 16011  	}()
 16012  	return _iHash
 16013  }
 16014  
 16015  var _walFramePageØ00__func__Ø000 [13]int8
 16016  
 16017  func init() {
 16018  	crt.Xstrncpy(nil, &_walFramePageØ00__func__Ø000[0], str(15548), 13)
 16019  }
 16020  
 16021  // C comment
 16022  //  /*
 16023  //  ** Remove entries from the hash table that point to WAL slots greater
 16024  //  ** than pWal->hdr.mxFrame.
 16025  //  **
 16026  //  ** This function is called whenever pWal->hdr.mxFrame is decreased due
 16027  //  ** to a rollback or savepoint.
 16028  //  **
 16029  //  ** At most only the hash table containing pWal->hdr.mxFrame needs to be
 16030  //  ** updated.  Any later hash tables will be automatically cleared when
 16031  //  ** pWal->hdr.mxFrame advances to the point where those hash tables are
 16032  //  ** actually needed.
 16033  //  */
 16034  func _walCleanupHash(tls *crt.TLS, _pWal *XWal) {
 16035  	var _iLimit, _nByte, _i int32
 16036  	var _iZero uint32
 16037  	var _aHash *uint16
 16038  	var _aPgno *uint32
 16039  	_aHash = nil
 16040  	_aPgno = nil
 16041  	_iZero = uint32(0)
 16042  	_iLimit = int32(0)
 16043  	func() {
 16044  		if _pWal.XwriteLock == 0 {
 16045  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55418), unsafe.Pointer(&_walCleanupHashØ00__func__Ø000), unsafe.Pointer(str(15561)))
 16046  			crt.X__builtin_abort(tls)
 16047  		}
 16048  	}()
 16049  	if (_pWal.Xhdr.XmxFrame) == (0) {
 16050  		return
 16051  	}
 16052  	func() {
 16053  		if _pWal.XnWiData <= _walFramePage(tls, _pWal.Xhdr.XmxFrame) {
 16054  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55429), unsafe.Pointer(&_walCleanupHashØ00__func__Ø000), unsafe.Pointer(str(15577)))
 16055  			crt.X__builtin_abort(tls)
 16056  		}
 16057  	}()
 16058  	func() {
 16059  		if (*elem38(_pWal.XapWiData, uintptr(_walFramePage(tls, _pWal.Xhdr.XmxFrame)))) == nil {
 16060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55430), unsafe.Pointer(&_walCleanupHashØ00__func__Ø000), unsafe.Pointer(str(15623)))
 16061  			crt.X__builtin_abort(tls)
 16062  		}
 16063  	}()
 16064  	_walHashGet(tls, _pWal, _walFramePage(tls, _pWal.Xhdr.XmxFrame), &_aHash, &_aPgno, &_iZero)
 16065  	_iLimit = int32((_pWal.Xhdr.XmxFrame) - _iZero)
 16066  	func() {
 16067  		if _iLimit <= int32(0) {
 16068  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55437), unsafe.Pointer(&_walCleanupHashØ00__func__Ø000), unsafe.Pointer(str(15671)))
 16069  			crt.X__builtin_abort(tls)
 16070  		}
 16071  	}()
 16072  	_i = int32(0)
 16073  _9:
 16074  	if _i >= int32(8192) {
 16075  		goto _12
 16076  	}
 16077  	if int32(*elem20(_aHash, uintptr(_i))) > _iLimit {
 16078  		*elem20(_aHash, uintptr(_i)) = 0
 16079  	}
 16080  	_i += 1
 16081  	goto _9
 16082  _12:
 16083  	_nByte = int32(int64(uintptr(unsafe.Pointer(_aHash)) - uintptr(unsafe.Pointer(elem31(_aPgno, uintptr(_iLimit+int32(1)))))))
 16084  	crt.Xmemset(tls, unsafe.Pointer(elem31(_aPgno, uintptr(_iLimit+int32(1)))), int32(0), uint64(_nByte))
 16085  }
 16086  
 16087  var _walCleanupHashØ00__func__Ø000 [15]int8
 16088  
 16089  func init() {
 16090  	crt.Xstrncpy(nil, &_walCleanupHashØ00__func__Ø000[0], str(15680), 15)
 16091  }
 16092  
 16093  // C comment
 16094  //  /*
 16095  //  ** Return pointers to the hash table and page number array stored on
 16096  //  ** page iHash of the wal-index. The wal-index is broken into 32KB pages
 16097  //  ** numbered starting from 0.
 16098  //  **
 16099  //  ** Set output variable *paHash to point to the start of the hash table
 16100  //  ** in the wal-index file. Set *piZero to one less than the frame
 16101  //  ** number of the first frame indexed by this hash table. If a
 16102  //  ** slot in the hash table is set to N, it refers to frame number
 16103  //  ** (*piZero+N) in the log.
 16104  //  **
 16105  //  ** Finally, set *paPgno so that *paPgno[1] is the page number of the
 16106  //  ** first frame indexed by the hash table, frame (*piZero+1).
 16107  //  */
 16108  func _walHashGet(tls *crt.TLS, _pWal *XWal, _iHash int32, _paHash **uint16, _paPgno **uint32, _piZero *uint32) (r0 int32) {
 16109  	var _rc int32
 16110  	var _1_iZero uint32
 16111  	var _1_aHash *uint16
 16112  	var _aPgno *uint32
 16113  	_rc = _walIndexPage(tls, _pWal, _iHash, &_aPgno)
 16114  	func() {
 16115  		if _rc != int32(0) && _iHash <= int32(0) {
 16116  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55349), unsafe.Pointer(&_walHashGetØ00__func__Ø000), unsafe.Pointer(str(15695)))
 16117  			crt.X__builtin_abort(tls)
 16118  		}
 16119  	}()
 16120  	if _rc != int32(0) {
 16121  		goto _3
 16122  	}
 16123  	_1_aHash = (*uint16)(unsafe.Pointer(elem31(_aPgno, uintptr(4096))))
 16124  	if _iHash == int32(0) {
 16125  		_aPgno = elem31(_aPgno, uintptr(34))
 16126  		_1_iZero = 0
 16127  		goto _5
 16128  	}
 16129  	_1_iZero = uint32(uint64(4062) + uint64((_iHash-int32(1))*int32(4096)))
 16130  _5:
 16131  	*_paPgno = elem31(_aPgno, uintptr(18446744073709551615))
 16132  	*_paHash = _1_aHash
 16133  	*_piZero = _1_iZero
 16134  _3:
 16135  	return _rc
 16136  }
 16137  
 16138  // C comment
 16139  //  /*
 16140  //  ** Obtain a pointer to the iPage'th page of the wal-index. The wal-index
 16141  //  ** is broken into pages of WALINDEX_PGSZ bytes. Wal-index pages are
 16142  //  ** numbered from zero.
 16143  //  **
 16144  //  ** If this call is successful, *ppPage is set to point to the wal-index
 16145  //  ** page and SQLITE_OK is returned. If an error (an OOM or VFS error) occurs,
 16146  //  ** then an SQLite error code is returned and *ppPage is set to 0.
 16147  //  */
 16148  func _walIndexPage(tls *crt.TLS, _pWal *XWal, _iPage int32, _ppPage **uint32) (r0 int32) {
 16149  	var _rc, _1_nByte int32
 16150  	var _1_apNew **uint32
 16151  	_rc = int32(0)
 16152  	if _pWal.XnWiData > _iPage {
 16153  		goto _0
 16154  	}
 16155  	_1_nByte = int32(uint64(8) * uint64(_iPage+int32(1)))
 16156  	_1_apNew = (**uint32)(Xsqlite3_realloc64(tls, unsafe.Pointer(_pWal.XapWiData), uint64(_1_nByte)))
 16157  	if _1_apNew == nil {
 16158  		*_ppPage = nil
 16159  		return _sqlite3NomemError(tls, int32(55025))
 16160  	}
 16161  	crt.Xmemset(tls, unsafe.Pointer(elem38(_1_apNew, uintptr(_pWal.XnWiData))), int32(0), uint64(8)*uint64((_iPage+int32(1))-_pWal.XnWiData))
 16162  	_pWal.XapWiData = _1_apNew
 16163  	_pWal.XnWiData = _iPage + int32(1)
 16164  _0:
 16165  	if (*elem38(_pWal.XapWiData, uintptr(_iPage))) != nil {
 16166  		goto _2
 16167  	}
 16168  	if int32(_pWal.XexclusiveMode) != int32(2) {
 16169  		goto _3
 16170  	}
 16171  	*elem38(_pWal.XapWiData, uintptr(_iPage)) = (*uint32)(_sqlite3MallocZero(tls, uint64(32768)))
 16172  	if (*elem38(_pWal.XapWiData, uintptr(_iPage))) == nil {
 16173  		_rc = _sqlite3NomemError(tls, int32(55037))
 16174  	}
 16175  	goto _5
 16176  _3:
 16177  	_rc = _sqlite3OsShmMap(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _iPage, int32(32768), int32(_pWal.XwriteLock), (*unsafe.Pointer)(unsafe.Pointer(elem38(_pWal.XapWiData, uintptr(_iPage)))))
 16178  	if _rc == int32(8) {
 16179  		{
 16180  			p := &_pWal.XreadOnly
 16181  			*p = uint8(int32(*p) | int32(2))
 16182  		}
 16183  		_rc = int32(0)
 16184  	}
 16185  _5:
 16186  _2:
 16187  	*_ppPage = *elem38(_pWal.XapWiData, uintptr(_iPage))
 16188  	func() {
 16189  		if _iPage != int32(0) && (*_ppPage) == nil && _rc == int32(0) {
 16190  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55050), unsafe.Pointer(&_walIndexPageØ00__func__Ø000), unsafe.Pointer(str(15720)))
 16191  			crt.X__builtin_abort(tls)
 16192  		}
 16193  	}()
 16194  	return _rc
 16195  }
 16196  
 16197  func _sqlite3OsShmMap(tls *crt.TLS, _id *Xsqlite3_file, _iPage int32, _pgsz int32, _bExtend int32, _pp *unsafe.Pointer) (r0 int32) {
 16198  	return func() func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32 {
 16199  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxShmMap
 16200  		return *(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&v))
 16201  	}()(tls, _id, _iPage, _pgsz, _bExtend, _pp)
 16202  }
 16203  
 16204  var _walIndexPageØ00__func__Ø000 [13]int8
 16205  
 16206  func init() {
 16207  	crt.Xstrncpy(nil, &_walIndexPageØ00__func__Ø000[0], str(15757), 13)
 16208  }
 16209  
 16210  var _walHashGetØ00__func__Ø000 [11]int8
 16211  
 16212  func init() {
 16213  	crt.Xstrncpy(nil, &_walHashGetØ00__func__Ø000[0], str(15770), 11)
 16214  }
 16215  
 16216  // C comment
 16217  //  /*
 16218  //  ** This function is invoked once for each page that has already been
 16219  //  ** written into the log file when a WAL transaction is rolled back.
 16220  //  ** Parameter iPg is the page number of said page. The pCtx argument
 16221  //  ** is actually a pointer to the Pager structure.
 16222  //  **
 16223  //  ** If page iPg is present in the cache, and has no outstanding references,
 16224  //  ** it is discarded. Otherwise, if there are one or more outstanding
 16225  //  ** references, the page content is reloaded from the database. If the
 16226  //  ** attempt to reload content from the database is required and fails,
 16227  //  ** return an SQLite error code. Otherwise, SQLITE_OK.
 16228  //  */
 16229  func _pagerUndoCallback(tls *crt.TLS, _pCtx unsafe.Pointer, _iPg uint32) (r0 int32) {
 16230  	var _rc int32
 16231  	var _3_iFrame uint32
 16232  	var _pPager *XPager
 16233  	var _pPg *XPgHdr
 16234  	_rc = int32(0)
 16235  	_pPager = (*XPager)(_pCtx)
 16236  	func() {
 16237  		if (*XWal)(_pPager.XpWal) == nil {
 16238  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49991), unsafe.Pointer(&_pagerUndoCallbackØ00__func__Ø000), unsafe.Pointer(str(15781)))
 16239  			crt.X__builtin_abort(tls)
 16240  		}
 16241  	}()
 16242  	_pPg = _sqlite3PagerLookup(tls, _pPager, _iPg)
 16243  	if _pPg == nil {
 16244  		goto _2
 16245  	}
 16246  	if _sqlite3PcachePageRefcount(tls, _pPg) == int32(1) {
 16247  		_sqlite3PcacheDrop(tls, _pPg)
 16248  		goto _4
 16249  	}
 16250  	_3_iFrame = uint32(0)
 16251  	_rc = _sqlite3WalFindFrame(tls, (*XWal)(_pPager.XpWal), _pPg.Xpgno, &_3_iFrame)
 16252  	if _rc == int32(0) {
 16253  		_rc = _readDbPage(tls, _pPg, _3_iFrame)
 16254  	}
 16255  	if _rc == int32(0) {
 16256  		func() func(*crt.TLS, *XPgHdr) {
 16257  			v := _pPager.XxReiniter
 16258  			return *(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&v))
 16259  		}()(tls, _pPg)
 16260  	}
 16261  	_sqlite3PagerUnrefNotNull(tls, _pPg)
 16262  _4:
 16263  _2:
 16264  	_sqlite3BackupRestart(tls, (*Xsqlite3_backup)(_pPager.XpBackup))
 16265  	return _rc
 16266  }
 16267  
 16268  var _pagerUndoCallbackØ00__func__Ø000 [18]int8
 16269  
 16270  func init() {
 16271  	crt.Xstrncpy(nil, &_pagerUndoCallbackØ00__func__Ø000[0], str(15801), 18)
 16272  }
 16273  
 16274  // C comment
 16275  //  /*
 16276  //  ** Acquire a page if it is already in the in-memory cache.  Do
 16277  //  ** not read the page from disk.  Return a pointer to the page,
 16278  //  ** or 0 if the page is not in cache.
 16279  //  **
 16280  //  ** See also sqlite3PagerGet().  The difference between this routine
 16281  //  ** and sqlite3PagerGet() is that _get() will go to the disk and read
 16282  //  ** in the page if the page is not already in cache.  This routine
 16283  //  ** returns NULL if the page is not in cache or if a disk I/O error
 16284  //  ** has ever happened.
 16285  //  */
 16286  func _sqlite3PagerLookup(tls *crt.TLS, _pPager *XPager, _pgno uint32) (r0 *XPgHdr) {
 16287  	var _pPage *Xsqlite3_pcache_page
 16288  	func() {
 16289  		if _pPager == nil {
 16290  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52532), unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000), unsafe.Pointer(str(15819)))
 16291  			crt.X__builtin_abort(tls)
 16292  		}
 16293  	}()
 16294  	func() {
 16295  		if _pgno == (0) {
 16296  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52533), unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000), unsafe.Pointer(str(15829)))
 16297  			crt.X__builtin_abort(tls)
 16298  		}
 16299  	}()
 16300  	func() {
 16301  		if (*XPCache)(_pPager.XpPCache) == nil {
 16302  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52534), unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000), unsafe.Pointer(str(15837)))
 16303  			crt.X__builtin_abort(tls)
 16304  		}
 16305  	}()
 16306  	_pPage = _sqlite3PcacheFetch(tls, (*XPCache)(_pPager.XpPCache), _pgno, int32(0))
 16307  	func() {
 16308  		if _pPage != nil && _pPager.XhasHeldSharedLock == 0 {
 16309  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52536), unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000), unsafe.Pointer(str(15856)))
 16310  			crt.X__builtin_abort(tls)
 16311  		}
 16312  	}()
 16313  	if _pPage == nil {
 16314  		return nil
 16315  	}
 16316  	return _sqlite3PcacheFetchFinish(tls, (*XPCache)(_pPager.XpPCache), _pgno, _pPage)
 16317  }
 16318  
 16319  var _sqlite3PagerLookupØ00__func__Ø000 [19]int8
 16320  
 16321  func init() {
 16322  	crt.Xstrncpy(nil, &_sqlite3PagerLookupØ00__func__Ø000[0], str(15894), 19)
 16323  }
 16324  
 16325  // C comment
 16326  //  /*
 16327  //  ** Try to obtain a page from the cache.
 16328  //  **
 16329  //  ** This routine returns a pointer to an sqlite3_pcache_page object if
 16330  //  ** such an object is already in cache, or if a new one is created.
 16331  //  ** This routine returns a NULL pointer if the object was not in cache
 16332  //  ** and could not be created.
 16333  //  **
 16334  //  ** The createFlags should be 0 to check for existing pages and should
 16335  //  ** be 3 (not 1, but 3) to try to create a new page.
 16336  //  **
 16337  //  ** If the createFlag is 0, then NULL is always returned if the page
 16338  //  ** is not already in the cache.  If createFlag is 1, then a new page
 16339  //  ** is created only if that can be done without spilling dirty pages
 16340  //  ** and without exceeding the cache size limit.
 16341  //  **
 16342  //  ** The caller needs to invoke sqlite3PcacheFetchFinish() to properly
 16343  //  ** initialize the sqlite3_pcache_page object and convert it into a
 16344  //  ** PgHdr object.  The sqlite3PcacheFetch() and sqlite3PcacheFetchFinish()
 16345  //  ** routines are split this way for performance reasons. When separated
 16346  //  ** they can both (usually) operate without having to push values to
 16347  //  ** the stack on entry and pop them back off on exit, which saves a
 16348  //  ** lot of pushing and popping.
 16349  //  */
 16350  func _sqlite3PcacheFetch(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _createFlag int32) (r0 *Xsqlite3_pcache_page) {
 16351  	var _eCreate int32
 16352  	var _pRes *Xsqlite3_pcache_page
 16353  	func() {
 16354  		if _pCache == nil {
 16355  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44495), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(13961)))
 16356  			crt.X__builtin_abort(tls)
 16357  		}
 16358  	}()
 16359  	func() {
 16360  		if _pCache.XpCache == nil {
 16361  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44496), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(15913)))
 16362  			crt.X__builtin_abort(tls)
 16363  		}
 16364  	}()
 16365  	func() {
 16366  		if _createFlag != int32(3) && _createFlag != int32(0) {
 16367  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44497), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(15931)))
 16368  			crt.X__builtin_abort(tls)
 16369  		}
 16370  	}()
 16371  	func() {
 16372  		if int32(_pCache.XeCreate) != func() int32 {
 16373  			if (_pCache.XbPurgeable != 0) && (_pCache.XpDirty != nil) {
 16374  				return int32(1)
 16375  			}
 16376  			return int32(2)
 16377  		}() {
 16378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44498), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(15962)))
 16379  			crt.X__builtin_abort(tls)
 16380  		}
 16381  	}()
 16382  	_eCreate = _createFlag & int32(_pCache.XeCreate)
 16383  	func() {
 16384  		if _eCreate != int32(0) && _eCreate != int32(1) && _eCreate != int32(2) {
 16385  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44508), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(16028)))
 16386  			crt.X__builtin_abort(tls)
 16387  		}
 16388  	}()
 16389  	func() {
 16390  		if _createFlag != int32(0) && int32(_pCache.XeCreate) != _eCreate {
 16391  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44509), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(16067)))
 16392  			crt.X__builtin_abort(tls)
 16393  		}
 16394  	}()
 16395  	func() {
 16396  		if _createFlag != int32(0) && _eCreate != (int32(1)+bool2int((_pCache.XbPurgeable == 0) || (_pCache.XpDirty == nil))) {
 16397  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44510), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(16109)))
 16398  			crt.X__builtin_abort(tls)
 16399  		}
 16400  	}()
 16401  	_pRes = func() func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page {
 16402  		v := _sqlite3Config.Xpcache2.XxFetch
 16403  		return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&v))
 16404  	}()(tls, _pCache.XpCache, _pgno, _eCreate)
 16405  	return _pRes
 16406  }
 16407  
 16408  var _sqlite3PcacheFetchØ00__func__Ø000 [19]int8
 16409  
 16410  func init() {
 16411  	crt.Xstrncpy(nil, &_sqlite3PcacheFetchØ00__func__Ø000[0], str(16176), 19)
 16412  }
 16413  
 16414  // C comment
 16415  //  /*
 16416  //  ** This routine converts the sqlite3_pcache_page object returned by
 16417  //  ** sqlite3PcacheFetch() into an initialized PgHdr object.  This routine
 16418  //  ** must be called after sqlite3PcacheFetch() in order to get a usable
 16419  //  ** result.
 16420  //  */
 16421  func _sqlite3PcacheFetchFinish(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _pPage *Xsqlite3_pcache_page) (r0 *XPgHdr) {
 16422  	var _pPgHdr *XPgHdr
 16423  	func() {
 16424  		if _pPage == nil {
 16425  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44617), unsafe.Pointer(&_sqlite3PcacheFetchFinishØ00__func__Ø000), unsafe.Pointer(str(2800)))
 16426  			crt.X__builtin_abort(tls)
 16427  		}
 16428  	}()
 16429  	_pPgHdr = (*XPgHdr)(_pPage.XpExtra)
 16430  	if _pPgHdr.XpPage == nil {
 16431  		return _pcacheFetchFinishWithInit(tls, _pCache, _pgno, _pPage)
 16432  	}
 16433  	_pCache.XnRefSum += 1
 16434  	_pPgHdr.XnRef += 1
 16435  	func() {
 16436  		if _sqlite3PcachePageSanity(tls, _pPgHdr) == 0 {
 16437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44625), unsafe.Pointer(&_sqlite3PcacheFetchFinishØ00__func__Ø000), unsafe.Pointer(str(16195)))
 16438  			crt.X__builtin_abort(tls)
 16439  		}
 16440  	}()
 16441  	return _pPgHdr
 16442  }
 16443  
 16444  var _sqlite3PcacheFetchFinishØ00__func__Ø000 [25]int8
 16445  
 16446  func init() {
 16447  	crt.Xstrncpy(nil, &_sqlite3PcacheFetchFinishØ00__func__Ø000[0], str(16227), 25)
 16448  }
 16449  
 16450  // C comment
 16451  //  /*
 16452  //  ** This is a helper routine for sqlite3PcacheFetchFinish()
 16453  //  **
 16454  //  ** In the uncommon case where the page being fetched has not been
 16455  //  ** initialized, this routine is invoked to do the initialization.
 16456  //  ** This routine is broken out into a separate function since it
 16457  //  ** requires extra stack manipulation that can be avoided in the common
 16458  //  ** case.
 16459  //  */
 16460  func _pcacheFetchFinishWithInit(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _pPage *Xsqlite3_pcache_page) (r0 *XPgHdr) {
 16461  	var _pPgHdr *XPgHdr
 16462  	func() {
 16463  		if _pPage == nil {
 16464  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44590), unsafe.Pointer(&_pcacheFetchFinishWithInitØ00__func__Ø000), unsafe.Pointer(str(2800)))
 16465  			crt.X__builtin_abort(tls)
 16466  		}
 16467  	}()
 16468  	_pPgHdr = (*XPgHdr)(_pPage.XpExtra)
 16469  	func() {
 16470  		if (*Xsqlite3_pcache_page)(_pPgHdr.XpPage) != nil {
 16471  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44592), unsafe.Pointer(&_pcacheFetchFinishWithInitØ00__func__Ø000), unsafe.Pointer(str(16252)))
 16472  			crt.X__builtin_abort(tls)
 16473  		}
 16474  	}()
 16475  	crt.Xmemset(tls, unsafe.Pointer(&_pPgHdr.XpDirty), int32(0), uint64(48))
 16476  	*(**Xsqlite3_pcache_page)(unsafe.Pointer(&_pPgHdr.XpPage)) = _pPage
 16477  	_pPgHdr.XpData = _pPage.XpBuf
 16478  	_pPgHdr.XpExtra = unsafe.Pointer(elem36(_pPgHdr, uintptr(1)))
 16479  	crt.Xmemset(tls, _pPgHdr.XpExtra, int32(0), uint64(8))
 16480  	*(**XPCache)(unsafe.Pointer(&_pPgHdr.XpCache)) = _pCache
 16481  	_pPgHdr.Xpgno = _pgno
 16482  	_pPgHdr.Xflags = uint16(1)
 16483  	return _sqlite3PcacheFetchFinish(tls, _pCache, _pgno, _pPage)
 16484  }
 16485  
 16486  var _pcacheFetchFinishWithInitØ00__func__Ø000 [26]int8
 16487  
 16488  func init() {
 16489  	crt.Xstrncpy(nil, &_pcacheFetchFinishWithInitØ00__func__Ø000[0], str(16269), 26)
 16490  }
 16491  
 16492  // C comment
 16493  //  /*
 16494  //  ** Return the number of references to the page supplied as an argument.
 16495  //  */
 16496  func _sqlite3PcachePageRefcount(tls *crt.TLS, _p *XPgHdr) (r0 int32) {
 16497  	return int32(_p.XnRef)
 16498  }
 16499  
 16500  // C comment
 16501  //  /*
 16502  //  ** Drop a page from the cache. There must be exactly one reference to the
 16503  //  ** page. This function deletes that reference, so after it returns the
 16504  //  ** page pointed to by p is invalid.
 16505  //  */
 16506  func _sqlite3PcacheDrop(tls *crt.TLS, _p *XPgHdr) {
 16507  	func() {
 16508  		if int32(_p.XnRef) != int32(1) {
 16509  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44665), unsafe.Pointer(&_sqlite3PcacheDropØ00__func__Ø000), unsafe.Pointer(str(16295)))
 16510  			crt.X__builtin_abort(tls)
 16511  		}
 16512  	}()
 16513  	func() {
 16514  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 16515  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44666), unsafe.Pointer(&_sqlite3PcacheDropØ00__func__Ø000), unsafe.Pointer(str(13822)))
 16516  			crt.X__builtin_abort(tls)
 16517  		}
 16518  	}()
 16519  	if (int32(_p.Xflags) & int32(2)) != 0 {
 16520  		_pcacheManageDirtyList(tls, _p, uint8(1))
 16521  	}
 16522  	(*XPCache)(_p.XpCache).XnRefSum -= 1
 16523  	func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32) {
 16524  		v := _sqlite3Config.Xpcache2.XxUnpin
 16525  		return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32))(unsafe.Pointer(&v))
 16526  	}()(tls, (*XPCache)(_p.XpCache).XpCache, (*Xsqlite3_pcache_page)(_p.XpPage), int32(1))
 16527  }
 16528  
 16529  var _sqlite3PcacheDropØ00__func__Ø000 [18]int8
 16530  
 16531  func init() {
 16532  	crt.Xstrncpy(nil, &_sqlite3PcacheDropØ00__func__Ø000[0], str(16306), 18)
 16533  }
 16534  
 16535  // C comment
 16536  //  /*
 16537  //  ** Search the wal file for page pgno. If found, set *piRead to the frame that
 16538  //  ** contains the page. Otherwise, if pgno is not in the wal file, set *piRead
 16539  //  ** to zero.
 16540  //  **
 16541  //  ** Return SQLITE_OK if successful, or an error code if an error occurs. If an
 16542  //  ** error does occur, the final value of *piRead is undefined.
 16543  //  */
 16544  func _sqlite3WalFindFrame(tls *crt.TLS, _pWal *XWal, _pgno uint32, _piRead *uint32) (r0 int32) {
 16545  	var _iHash, _iMinHash, _2_iKey, _2_nCollide, _2_rc int32
 16546  	var _iRead, _iLast, _2_iZero, _4_iFrame uint32
 16547  	var _2_aHash *uint16
 16548  	var _2_aPgno *uint32
 16549  	_iRead = uint32(0)
 16550  	_iLast = _pWal.Xhdr.XmxFrame
 16551  	func() {
 16552  		if int32(_pWal.XreadLock) < int32(0) && _pWal.XlockError == 0 {
 16553  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57067), unsafe.Pointer(&_sqlite3WalFindFrameØ00__func__Ø000), unsafe.Pointer(str(16324)))
 16554  			crt.X__builtin_abort(tls)
 16555  		}
 16556  	}()
 16557  	if (_iLast == (0)) || (int32(_pWal.XreadLock) == int32(0)) {
 16558  		*_piRead = 0
 16559  		return int32(0)
 16560  	}
 16561  	_iMinHash = _walFramePage(tls, _pWal.XminFrame)
 16562  	_iHash = _walFramePage(tls, _iLast)
 16563  _5:
 16564  	if _iHash < _iMinHash || _iRead != (0) {
 16565  		goto _9
 16566  	}
 16567  	_2_rc = _walHashGet(tls, _pWal, _iHash, &_2_aHash, &_2_aPgno, &_2_iZero)
 16568  	if _2_rc != int32(0) {
 16569  		return _2_rc
 16570  	}
 16571  	_2_nCollide = int32(8192)
 16572  	_2_iKey = _walHash(tls, _pgno)
 16573  _11:
 16574  	if (*elem20(_2_aHash, uintptr(_2_iKey))) == 0 {
 16575  		goto _14
 16576  	}
 16577  	_4_iFrame = uint32(*elem20(_2_aHash, uintptr(_2_iKey))) + _2_iZero
 16578  	if ((_4_iFrame <= _iLast) && (_4_iFrame >= _pWal.XminFrame)) && ((*elem31(_2_aPgno, uintptr(*elem20(_2_aHash, uintptr(_2_iKey))))) == _pgno) {
 16579  		func() {
 16580  			if _4_iFrame <= _iRead && _sqlite3Config.XneverCorrupt != int32(0) {
 16581  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57122), unsafe.Pointer(&_sqlite3WalFindFrameØ00__func__Ø000), unsafe.Pointer(str(16361)))
 16582  				crt.X__builtin_abort(tls)
 16583  			}
 16584  		}()
 16585  		_iRead = _4_iFrame
 16586  	}
 16587  	if postInc2(&_2_nCollide, -1) == int32(0) {
 16588  		return _sqlite3CorruptError(tls, int32(57126))
 16589  	}
 16590  	_2_iKey = _walNextHash(tls, _2_iKey)
 16591  	goto _11
 16592  _14:
 16593  	_iHash -= 1
 16594  	goto _5
 16595  _9:
 16596  	*_piRead = _iRead
 16597  	return int32(0)
 16598  
 16599  	_ = _2_nCollide
 16600  	panic(0)
 16601  }
 16602  
 16603  var _sqlite3WalFindFrameØ00__func__Ø000 [20]int8
 16604  
 16605  func init() {
 16606  	crt.Xstrncpy(nil, &_sqlite3WalFindFrameØ00__func__Ø000[0], str(16388), 20)
 16607  }
 16608  
 16609  // C comment
 16610  //  /*
 16611  //  ** Compute a hash on a page number.  The resulting hash value must land
 16612  //  ** between 0 and (HASHTABLE_NSLOT-1).  The walHashNext() function advances
 16613  //  ** the hash to the next value in the event of a collision.
 16614  //  */
 16615  func _walHash(tls *crt.TLS, _iPage uint32) (r0 int32) {
 16616  	func() {
 16617  		if _iPage <= (0) {
 16618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55316), unsafe.Pointer(&_walHashØ00__func__Ø000), unsafe.Pointer(str(16408)))
 16619  			crt.X__builtin_abort(tls)
 16620  		}
 16621  	}()
 16622  	return int32((_iPage * uint32(383)) & uint32(8191))
 16623  }
 16624  
 16625  var _walHashØ00__func__Ø000 [8]int8
 16626  
 16627  func init() {
 16628  	crt.Xstrncpy(nil, &_walHashØ00__func__Ø000[0], str(16416), 8)
 16629  }
 16630  
 16631  func _walNextHash(tls *crt.TLS, _iPriorHash int32) (r0 int32) {
 16632  	return (_iPriorHash + int32(1)) & int32(8191)
 16633  }
 16634  
 16635  // C comment
 16636  //  /*
 16637  //  ** Read the content for page pPg out of the database file and into
 16638  //  ** pPg->pData. A shared lock or greater must be held on the database
 16639  //  ** file before this function is called.
 16640  //  **
 16641  //  ** If page 1 is read, then the value of Pager.dbFileVers[] is set to
 16642  //  ** the value read from the database file.
 16643  //  **
 16644  //  ** If an IO error occurs, then the IO error is returned to the caller.
 16645  //  ** Otherwise, SQLITE_OK is returned.
 16646  //  */
 16647  func _readDbPage(tls *crt.TLS, _pPg *XPgHdr, _iFrame uint32) (r0 int32) {
 16648  	var _rc, _pgsz int32
 16649  	var _2_iOffset int64
 16650  	var _pgno uint32
 16651  	var _6_dbFileVers *uint8
 16652  	var _pPager *XPager
 16653  	_pPager = (*XPager)(_pPg.XpPager)
 16654  	_pgno = _pPg.Xpgno
 16655  	_rc = int32(0)
 16656  	_pgsz = _pPager.XpageSize
 16657  	func() {
 16658  		if int32(_pPager.XeState) < int32(1) || _pPager.XmemDb != 0 {
 16659  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49903), unsafe.Pointer(&_readDbPageØ00__func__Ø000), unsafe.Pointer(str(16424)))
 16660  			crt.X__builtin_abort(tls)
 16661  		}
 16662  	}()
 16663  	func() {
 16664  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 16665  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49904), unsafe.Pointer(&_readDbPageØ00__func__Ø000), unsafe.Pointer(str(16463)))
 16666  			crt.X__builtin_abort(tls)
 16667  		}
 16668  	}()
 16669  	if _iFrame != 0 {
 16670  		_rc = _sqlite3WalReadFrame(tls, (*XWal)(_pPager.XpWal), _iFrame, _pgsz, (*uint8)(_pPg.XpData))
 16671  		goto _6
 16672  	}
 16673  	_2_iOffset = int64(_pgno-uint32(1)) * int64(_pPager.XpageSize)
 16674  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xfd), _pPg.XpData, _pgsz, _2_iOffset)
 16675  	if _rc == int32(522) {
 16676  		_rc = int32(0)
 16677  	}
 16678  _6:
 16679  	if _pgno != uint32(1) {
 16680  		goto _8
 16681  	}
 16682  	if _rc != 0 {
 16683  		crt.Xmemset(tls, unsafe.Pointer(&_pPager.XdbFileVers), int32(255), uint64(16))
 16684  		goto _10
 16685  	}
 16686  	_6_dbFileVers = elem15((*uint8)(_pPg.XpData), uintptr(24))
 16687  	crt.Xmemcpy(tls, unsafe.Pointer(&_pPager.XdbFileVers), unsafe.Pointer(_6_dbFileVers), uint64(16))
 16688  _10:
 16689  _8:
 16690  	return _rc
 16691  }
 16692  
 16693  var _readDbPageØ00__func__Ø000 [11]int8
 16694  
 16695  func init() {
 16696  	crt.Xstrncpy(nil, &_readDbPageØ00__func__Ø000[0], str(16482), 11)
 16697  }
 16698  
 16699  // C comment
 16700  //  /*
 16701  //  ** Read the contents of frame iRead from the wal file into buffer pOut
 16702  //  ** (which is nOut bytes in size). Return SQLITE_OK if successful, or an
 16703  //  ** error code otherwise.
 16704  //  */
 16705  func _sqlite3WalReadFrame(tls *crt.TLS, _pWal *XWal, _iRead uint32, _nOut int32, _pOut *uint8) (r0 int32) {
 16706  	var _sz int32
 16707  	var _iOffset int64
 16708  	_sz = int32(_pWal.Xhdr.XszPage)
 16709  	_sz = (_sz & int32(65024)) + ((_sz & int32(1)) << 16)
 16710  	_iOffset = (int64(32) + (int64(_iRead-uint32(1)) * int64(_sz+int32(24)))) + int64(24)
 16711  	return _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(_pOut), func() int32 {
 16712  		if _nOut > _sz {
 16713  			return _sz
 16714  		}
 16715  		return _nOut
 16716  	}(), _iOffset)
 16717  }
 16718  
 16719  func _sqlite3OsRead(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
 16720  	return func() func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32 {
 16721  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxRead
 16722  		return *(*func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&v))
 16723  	}()(tls, _id, _pBuf, _amt, _offset)
 16724  }
 16725  
 16726  // C comment
 16727  //  /*
 16728  //  ** Restart the backup process. This is called when the pager layer
 16729  //  ** detects that the database has been modified by an external database
 16730  //  ** connection. In this case there is no way of knowing which of the
 16731  //  ** pages that have been copied into the destination database are still
 16732  //  ** valid and which are not, so the entire process needs to be restarted.
 16733  //  **
 16734  //  ** It is assumed that the mutex associated with the BtShared object
 16735  //  ** corresponding to the source database is held when this function is
 16736  //  ** called.
 16737  //  */
 16738  func _sqlite3BackupRestart(tls *crt.TLS, _pBackup *Xsqlite3_backup) {
 16739  	var _p *Xsqlite3_backup
 16740  	_p = _pBackup
 16741  _0:
 16742  	if _p == nil {
 16743  		goto _3
 16744  	}
 16745  	func() {
 16746  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)((*XBtree)(_p.XpSrc).XpBt).Xmutex)) == 0 {
 16747  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69631), unsafe.Pointer(&_sqlite3BackupRestartØ00__func__Ø000), unsafe.Pointer(str(16493)))
 16748  			crt.X__builtin_abort(tls)
 16749  		}
 16750  	}()
 16751  	_p.XiNext = uint32(1)
 16752  	_p = (*Xsqlite3_backup)(_p.XpNext)
 16753  	goto _0
 16754  _3:
 16755  }
 16756  
 16757  var _sqlite3BackupRestartØ00__func__Ø000 [21]int8
 16758  
 16759  func init() {
 16760  	crt.Xstrncpy(nil, &_sqlite3BackupRestartØ00__func__Ø000[0], str(16533), 21)
 16761  }
 16762  
 16763  // C comment
 16764  //  /*
 16765  //  ** Return a list of all dirty pages in the cache, sorted by page number.
 16766  //  */
 16767  func _sqlite3PcacheDirtyList(tls *crt.TLS, _pCache *XPCache) (r0 *XPgHdr) {
 16768  	var _p *XPgHdr
 16769  	_p = (*XPgHdr)(_pCache.XpDirty)
 16770  _0:
 16771  	if _p == nil {
 16772  		goto _3
 16773  	}
 16774  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirty)) = (*XPgHdr)(_p.XpDirtyNext)
 16775  	_p = (*XPgHdr)(_p.XpDirtyNext)
 16776  	goto _0
 16777  _3:
 16778  	return _pcacheSortDirtyList(tls, (*XPgHdr)(_pCache.XpDirty))
 16779  }
 16780  
 16781  func _pcacheSortDirtyList(tls *crt.TLS, _pIn *XPgHdr) (r0 *XPgHdr) {
 16782  	var _i int32
 16783  	var _p *XPgHdr
 16784  	var _a [32]*XPgHdr
 16785  	crt.Xmemset(tls, unsafe.Pointer(&_a), int32(0), uint64(256))
 16786  _0:
 16787  	if _pIn == nil {
 16788  		goto _1
 16789  	}
 16790  	_p = _pIn
 16791  	_pIn = (*XPgHdr)(_p.XpDirty)
 16792  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirty)) = nil
 16793  	_i = int32(0)
 16794  _2:
 16795  	if func() int32 {
 16796  		if _i < int32(31) {
 16797  			return int32(1)
 16798  		}
 16799  		return func() int32 {
 16800  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44866), unsafe.Pointer(&_pcacheSortDirtyListØ00__func__Ø000), unsafe.Pointer(str(4809)))
 16801  			crt.X__builtin_abort(tls)
 16802  			return int32(0)
 16803  		}()
 16804  	}() == 0 {
 16805  		goto _7
 16806  	}
 16807  	if (*elem39((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i))) == nil {
 16808  		*elem39((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)) = _p
 16809  		goto _7
 16810  	}
 16811  	_p = _pcacheMergeDirtyList(tls, *elem39((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)), _p)
 16812  	*elem39((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)) = nil
 16813  	_i += 1
 16814  	goto _2
 16815  _7:
 16816  	if func() int32 {
 16817  		if _i == int32(31) {
 16818  			return func() int32 {
 16819  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44875), unsafe.Pointer(&_pcacheSortDirtyListØ00__func__Ø000), unsafe.Pointer(str(4809)))
 16820  				crt.X__builtin_abort(tls)
 16821  				return int32(1)
 16822  			}()
 16823  		}
 16824  		return int32(0)
 16825  	}() != 0 {
 16826  		*elem39((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)) = _pcacheMergeDirtyList(tls, *elem39((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)), _p)
 16827  	}
 16828  	goto _0
 16829  _1:
 16830  	_p = *elem39((**XPgHdr)(unsafe.Pointer(&_a)), 0)
 16831  	_i = int32(1)
 16832  _13:
 16833  	if _i >= int32(32) {
 16834  		goto _16
 16835  	}
 16836  	if (*elem39((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i))) == nil {
 16837  		goto _14
 16838  	}
 16839  	_p = func() *XPgHdr {
 16840  		if _p != nil {
 16841  			return _pcacheMergeDirtyList(tls, _p, *elem39((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)))
 16842  		}
 16843  		return (*elem39((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)))
 16844  	}()
 16845  _14:
 16846  	_i += 1
 16847  	goto _13
 16848  _16:
 16849  	return _p
 16850  
 16851  	_ = _a
 16852  	panic(0)
 16853  }
 16854  
 16855  var _pcacheSortDirtyListØ00__func__Ø000 [20]int8
 16856  
 16857  func init() {
 16858  	crt.Xstrncpy(nil, &_pcacheSortDirtyListØ00__func__Ø000[0], str(16554), 20)
 16859  }
 16860  
 16861  // C comment
 16862  //  /*
 16863  //  ** Merge two lists of pages connected by pDirty and in pgno order.
 16864  //  ** Do not bother fixing the pDirtyPrev pointers.
 16865  //  */
 16866  func _pcacheMergeDirtyList(tls *crt.TLS, _pA *XPgHdr, _pB *XPgHdr) (r0 *XPgHdr) {
 16867  	var _result XPgHdr
 16868  	var _pTail *XPgHdr
 16869  	_pTail = &_result
 16870  	func() {
 16871  		if _pA == nil || _pB == nil {
 16872  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44824), unsafe.Pointer(&_pcacheMergeDirtyListØ00__func__Ø000), unsafe.Pointer(str(16574)))
 16873  			crt.X__builtin_abort(tls)
 16874  		}
 16875  	}()
 16876  _3:
 16877  	if _pA.Xpgno >= _pB.Xpgno {
 16878  		goto _6
 16879  	}
 16880  	*(**XPgHdr)(unsafe.Pointer(&_pTail.XpDirty)) = _pA
 16881  	_pTail = _pA
 16882  	_pA = (*XPgHdr)(_pA.XpDirty)
 16883  	if _pA == nil {
 16884  		*(**XPgHdr)(unsafe.Pointer(&_pTail.XpDirty)) = _pB
 16885  		goto _5
 16886  	}
 16887  	goto _8
 16888  _6:
 16889  	*(**XPgHdr)(unsafe.Pointer(&_pTail.XpDirty)) = _pB
 16890  	_pTail = _pB
 16891  	_pB = (*XPgHdr)(_pB.XpDirty)
 16892  	if _pB == nil {
 16893  		*(**XPgHdr)(unsafe.Pointer(&_pTail.XpDirty)) = _pA
 16894  		goto _5
 16895  	}
 16896  _8:
 16897  	goto _3
 16898  _5:
 16899  	return (*XPgHdr)(_result.XpDirty)
 16900  }
 16901  
 16902  var _pcacheMergeDirtyListØ00__func__Ø000 [21]int8
 16903  
 16904  func init() {
 16905  	crt.Xstrncpy(nil, &_pcacheMergeDirtyListØ00__func__Ø000[0], str(16589), 21)
 16906  }
 16907  
 16908  // C comment
 16909  //  /*
 16910  //  ** Read a single page from either the journal file (if isMainJrnl==1) or
 16911  //  ** from the sub-journal (if isMainJrnl==0) and playback that page.
 16912  //  ** The page begins at offset *pOffset into the file. The *pOffset
 16913  //  ** value is increased to the start of the next page in the journal.
 16914  //  **
 16915  //  ** The main rollback journal uses checksums - the statement journal does
 16916  //  ** not.
 16917  //  **
 16918  //  ** If the page number of the page record read from the (sub-)journal file
 16919  //  ** is greater than the current value of Pager.dbSize, then playback is
 16920  //  ** skipped and SQLITE_OK is returned.
 16921  //  **
 16922  //  ** If pDone is not NULL, then it is a record of pages that have already
 16923  //  ** been played back.  If the page at *pOffset has already been played back
 16924  //  ** (if the corresponding pDone bit is set) then skip the playback.
 16925  //  ** Make sure the pDone bit corresponding to the *pOffset page is set
 16926  //  ** prior to returning.
 16927  //  **
 16928  //  ** If the page record is successfully read from the (sub-)journal file
 16929  //  ** and played back, then SQLITE_OK is returned. If an IO error occurs
 16930  //  ** while reading the record from the (sub-)journal file or while writing
 16931  //  ** to the database file, then the IO error code is returned. If data
 16932  //  ** is successfully read from the (sub-)journal file but appears to be
 16933  //  ** corrupted, SQLITE_DONE is returned. Data is considered corrupted in
 16934  //  ** two circumstances:
 16935  //  **
 16936  //  **   * If the record page-number is illegal (0 or PAGER_MJ_PGNO), or
 16937  //  **   * If the record is being rolled back from the main journal file
 16938  //  **     and the checksum field does not match the record content.
 16939  //  **
 16940  //  ** Neither of these two scenarios are possible during a savepoint rollback.
 16941  //  **
 16942  //  ** If this is a savepoint rollback, then memory may have to be dynamically
 16943  //  ** allocated by this function. If this is the case and an allocation fails,
 16944  //  ** SQLITE_NOMEM is returned.
 16945  //  */
 16946  func _pager_playback_one_page(tls *crt.TLS, _pPager *XPager, _pOffset *int64, _pDone *XBitvec, _isMainJrnl int32, _isSavepnt int32) (r0 int32) {
 16947  	var _rc, _isSynced int32
 16948  	var _11_ofst int64
 16949  	var _pgno, _cksum uint32
 16950  	var _aData *int8
 16951  	var _15_pData unsafe.Pointer
 16952  	var _jfd *Xsqlite3_file
 16953  	var _pPg *XPgHdr
 16954  	func() {
 16955  		if (_isMainJrnl & int32(-2)) != int32(0) {
 16956  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49184), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16610)))
 16957  			crt.X__builtin_abort(tls)
 16958  		}
 16959  	}()
 16960  	func() {
 16961  		if (_isSavepnt & int32(-2)) != int32(0) {
 16962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49185), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16629)))
 16963  			crt.X__builtin_abort(tls)
 16964  		}
 16965  	}()
 16966  	func() {
 16967  		if _isMainJrnl == 0 && _pDone == nil {
 16968  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49186), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16647)))
 16969  			crt.X__builtin_abort(tls)
 16970  		}
 16971  	}()
 16972  	func() {
 16973  		if _isSavepnt == 0 && _pDone != nil {
 16974  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49187), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16667)))
 16975  			crt.X__builtin_abort(tls)
 16976  		}
 16977  	}()
 16978  	_aData = _pPager.XpTmpSpace
 16979  	func() {
 16980  		if _aData == nil {
 16981  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49190), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16689)))
 16982  			crt.X__builtin_abort(tls)
 16983  		}
 16984  	}()
 16985  	func() {
 16986  		if bool2int((*XWal)(_pPager.XpWal) != nil) != int32(0) && (_isMainJrnl != 0 || _isSavepnt == 0) {
 16987  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49191), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16695)))
 16988  			crt.X__builtin_abort(tls)
 16989  		}
 16990  	}()
 16991  	func() {
 16992  		if int32(_pPager.XeState) < int32(3) && (int32(_pPager.XeState) != int32(0) || int32(_pPager.XeLock) != int32(4)) {
 16993  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49199), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16748)))
 16994  			crt.X__builtin_abort(tls)
 16995  		}
 16996  	}()
 16997  	func() {
 16998  		if int32(_pPager.XeState) < int32(3) && _isMainJrnl == 0 {
 16999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49202), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16851)))
 17000  			crt.X__builtin_abort(tls)
 17001  		}
 17002  	}()
 17003  	_jfd = func() *Xsqlite3_file {
 17004  		if _isMainJrnl != 0 {
 17005  			return (*Xsqlite3_file)(_pPager.Xjfd)
 17006  		}
 17007  		return (*Xsqlite3_file)(_pPager.Xsjfd)
 17008  	}()
 17009  	_rc = _read32bits(tls, _jfd, *_pOffset, &_pgno)
 17010  	if _rc != int32(0) {
 17011  		return _rc
 17012  	}
 17013  	_rc = _sqlite3OsRead(tls, _jfd, unsafe.Pointer(_aData), _pPager.XpageSize, (*_pOffset)+int64(4))
 17014  	if _rc != int32(0) {
 17015  		return _rc
 17016  	}
 17017  	*_pOffset += int64((_pPager.XpageSize + int32(4)) + (_isMainJrnl * int32(4)))
 17018  	if (_pgno == (0)) || (_pgno == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1))) {
 17019  		func() {
 17020  			if _isSavepnt != 0 {
 17021  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49220), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16903)))
 17022  				crt.X__builtin_abort(tls)
 17023  			}
 17024  		}()
 17025  		return int32(101)
 17026  	}
 17027  	if (_pgno > _pPager.XdbSize) || _sqlite3BitvecTest(tls, _pDone, _pgno) != 0 {
 17028  		return int32(0)
 17029  	}
 17030  	if _isMainJrnl == 0 {
 17031  		goto _33
 17032  	}
 17033  	_rc = _read32bits(tls, _jfd, (*_pOffset)-int64(4), &_cksum)
 17034  	if _rc != 0 {
 17035  		return _rc
 17036  	}
 17037  	if (_isSavepnt == 0) && (_pager_cksum(tls, _pPager, (*uint8)(unsafe.Pointer(_aData))) != _cksum) {
 17038  		return int32(101)
 17039  	}
 17040  _33:
 17041  	if (_pDone != nil) && (store2(&_rc, _sqlite3BitvecSet(tls, _pDone, _pgno)) != int32(0)) {
 17042  		return _rc
 17043  	}
 17044  	if (_pgno == uint32(1)) && (int32(_pPager.XnReserve) != int32(*elem15((*uint8)(unsafe.Pointer(_aData)), uintptr(20)))) {
 17045  		_pPager.XnReserve = int16(*elem15((*uint8)(unsafe.Pointer(_aData)), uintptr(20)))
 17046  	}
 17047  	if (*XWal)(_pPager.XpWal) != nil {
 17048  		_pPg = nil
 17049  		goto _42
 17050  	}
 17051  	_pPg = _sqlite3PagerLookup(tls, _pPager, _pgno)
 17052  _42:
 17053  	func() {
 17054  		if _pPg == nil && _pPager.XmemDb != 0 {
 17055  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49288), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16914)))
 17056  			crt.X__builtin_abort(tls)
 17057  		}
 17058  	}()
 17059  	func() {
 17060  		if int32(_pPager.XeState) == int32(0) && _pPg != nil && _pPager.XtempFile == 0 {
 17061  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49289), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16928)))
 17062  			crt.X__builtin_abort(tls)
 17063  		}
 17064  	}()
 17065  	if _isMainJrnl != 0 {
 17066  		_isSynced = bool2int((_pPager.XnoSync != 0) || ((*_pOffset) <= _pPager.XjournalHdr))
 17067  		goto _52
 17068  	}
 17069  	_isSynced = bool2int((_pPg == nil) || (int32(0) == (int32(_pPg.Xflags) & int32(8))))
 17070  _52:
 17071  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil || int32(_pPager.XeState) < int32(4) && int32(_pPager.XeState) != int32(0) || _isSynced == 0 {
 17072  		goto _57
 17073  	}
 17074  	_11_ofst = int64(_pgno-uint32(1)) * int64(_pPager.XpageSize)
 17075  	func() {
 17076  		if (*XWal)(_pPager.XpWal) != nil {
 17077  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49305), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(12123)))
 17078  			crt.X__builtin_abort(tls)
 17079  		}
 17080  	}()
 17081  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xfd), unsafe.Pointer(_aData), _pPager.XpageSize, _11_ofst)
 17082  	if _pgno > _pPager.XdbFileSize {
 17083  		_pPager.XdbFileSize = _pgno
 17084  	}
 17085  	if _pPager.XpBackup != nil {
 17086  		_sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.XpBackup), _pgno, (*uint8)(unsafe.Pointer(_aData)))
 17087  	}
 17088  	goto _64
 17089  _57:
 17090  	if _isMainJrnl != 0 || _pPg != nil {
 17091  		goto _64
 17092  	}
 17093  	func() {
 17094  		if _isSavepnt == 0 {
 17095  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49352), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16985)))
 17096  			crt.X__builtin_abort(tls)
 17097  		}
 17098  	}()
 17099  	func() {
 17100  		if (int32(_pPager.XdoNotSpill) & int32(2)) != int32(0) {
 17101  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49353), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(16995)))
 17102  			crt.X__builtin_abort(tls)
 17103  		}
 17104  	}()
 17105  	{
 17106  		p := &_pPager.XdoNotSpill
 17107  		*p = uint8(int32(*p) | int32(2))
 17108  	}
 17109  	_rc = _sqlite3PagerGet(tls, _pPager, _pgno, &_pPg, int32(1))
 17110  	func() {
 17111  		if (int32(_pPager.XdoNotSpill) & int32(2)) == int32(0) {
 17112  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49356), unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000), unsafe.Pointer(str(17040)))
 17113  			crt.X__builtin_abort(tls)
 17114  		}
 17115  	}()
 17116  	{
 17117  		p := &_pPager.XdoNotSpill
 17118  		*p = uint8(int32(*p) & int32(-3))
 17119  	}
 17120  	if _rc != int32(0) {
 17121  		return _rc
 17122  	}
 17123  	_sqlite3PcacheMakeDirty(tls, _pPg)
 17124  _64:
 17125  	if _pPg == nil {
 17126  		goto _72
 17127  	}
 17128  	_15_pData = _pPg.XpData
 17129  	crt.Xmemcpy(tls, _15_pData, unsafe.Pointer(_aData), uint64(_pPager.XpageSize))
 17130  	func() func(*crt.TLS, *XPgHdr) {
 17131  		v := _pPager.XxReiniter
 17132  		return *(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&v))
 17133  	}()(tls, _pPg)
 17134  	if _pgno == uint32(1) {
 17135  		crt.Xmemcpy(tls, unsafe.Pointer(&_pPager.XdbFileVers), unsafe.Pointer(elem15((*uint8)(_15_pData), uintptr(24))), uint64(16))
 17136  	}
 17137  	_sqlite3PcacheRelease(tls, _pPg)
 17138  _72:
 17139  	return _rc
 17140  }
 17141  
 17142  var _pager_playback_one_pageØ00__func__Ø000 [24]int8
 17143  
 17144  func init() {
 17145  	crt.Xstrncpy(nil, &_pager_playback_one_pageØ00__func__Ø000[0], str(17085), 24)
 17146  }
 17147  
 17148  // C comment
 17149  //  /*
 17150  //  ** Read a 32-bit integer from the given file descriptor.  Store the integer
 17151  //  ** that is read in *pRes.  Return SQLITE_OK if everything worked, or an
 17152  //  ** error code is something goes wrong.
 17153  //  **
 17154  //  ** All values are stored on disk as big-endian.
 17155  //  */
 17156  func _read32bits(tls *crt.TLS, _fd *Xsqlite3_file, _offset int64, _pRes *uint32) (r0 int32) {
 17157  	var _rc int32
 17158  	var _ac [4]uint8
 17159  	_rc = _sqlite3OsRead(tls, _fd, unsafe.Pointer(&_ac), int32(4), _offset)
 17160  	if _rc == int32(0) {
 17161  		*_pRes = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(&_ac)))
 17162  	}
 17163  	return _rc
 17164  
 17165  	_ = _ac
 17166  	panic(0)
 17167  }
 17168  
 17169  // C comment
 17170  //  /*
 17171  //  ** Read or write a four-byte big-endian integer value.
 17172  //  */
 17173  func _sqlite3Get4byte(tls *crt.TLS, _p *uint8) (r0 uint32) {
 17174  	return (((uint32(*elem15(_p, 0)) << 24) | uint32(int32(*elem15(_p, uintptr(1)))<<16)) | uint32(int32(*elem15(_p, uintptr(2)))<<8)) | uint32(*elem15(_p, uintptr(3)))
 17175  }
 17176  
 17177  func _sqlite3BackupUpdate(tls *crt.TLS, _pBackup *Xsqlite3_backup, _iPage uint32, _aData *uint8) {
 17178  	if _pBackup != nil {
 17179  		_backupUpdate(tls, _pBackup, _iPage, _aData)
 17180  	}
 17181  }
 17182  
 17183  // C comment
 17184  //  /*
 17185  //  ** This function is called after the contents of page iPage of the
 17186  //  ** source database have been modified. If page iPage has already been
 17187  //  ** copied into the destination database, then the data written to the
 17188  //  ** destination is now invalidated. The destination copy of iPage needs
 17189  //  ** to be updated with the new data before the backup operation is
 17190  //  ** complete.
 17191  //  **
 17192  //  ** It is assumed that the mutex associated with the BtShared object
 17193  //  ** corresponding to the source database is held when this function is
 17194  //  ** called.
 17195  //  */
 17196  func _backupUpdate(tls *crt.TLS, _p *Xsqlite3_backup, _iPage uint32, _aData *uint8) {
 17197  	var _2_rc int32
 17198  	func() {
 17199  		if _p == nil {
 17200  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69593), unsafe.Pointer(&_backupUpdateØ00__func__Ø000), unsafe.Pointer(str(807)))
 17201  			crt.X__builtin_abort(tls)
 17202  		}
 17203  	}()
 17204  _2:
 17205  	func() {
 17206  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)((*XBtree)(_p.XpSrc).XpBt).Xmutex)) == 0 {
 17207  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69595), unsafe.Pointer(&_backupUpdateØ00__func__Ø000), unsafe.Pointer(str(16493)))
 17208  			crt.X__builtin_abort(tls)
 17209  		}
 17210  	}()
 17211  	if _isFatalError(tls, _p.Xrc) != 0 || _iPage >= _p.XiNext {
 17212  		goto _6
 17213  	}
 17214  	func() {
 17215  		if _p.XpDestDb == nil {
 17216  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69602), unsafe.Pointer(&_backupUpdateØ00__func__Ø000), unsafe.Pointer(str(17109)))
 17217  			crt.X__builtin_abort(tls)
 17218  		}
 17219  	}()
 17220  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpDestDb).Xmutex))
 17221  	_2_rc = _backupOnePage(tls, _p, _iPage, _aData, int32(1))
 17222  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpDestDb).Xmutex))
 17223  	func() {
 17224  		if _2_rc == int32(5) || _2_rc == int32(6) {
 17225  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69606), unsafe.Pointer(&_backupUpdateØ00__func__Ø000), unsafe.Pointer(str(17120)))
 17226  			crt.X__builtin_abort(tls)
 17227  		}
 17228  	}()
 17229  	if _2_rc != int32(0) {
 17230  		_p.Xrc = _2_rc
 17231  	}
 17232  _6:
 17233  	if store40(&_p, (*Xsqlite3_backup)(_p.XpNext)) != nil {
 17234  		goto _2
 17235  	}
 17236  }
 17237  
 17238  var _backupUpdateØ00__func__Ø000 [13]int8
 17239  
 17240  func init() {
 17241  	crt.Xstrncpy(nil, &_backupUpdateØ00__func__Ø000[0], str(17157), 13)
 17242  }
 17243  
 17244  // C comment
 17245  //  /*
 17246  //  ** Argument rc is an SQLite error code. Return true if this error is
 17247  //  ** considered fatal if encountered during a backup operation. All errors
 17248  //  ** are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED.
 17249  //  */
 17250  func _isFatalError(tls *crt.TLS, _rc int32) (r0 int32) {
 17251  	return bool2int(((_rc != int32(0)) && (_rc != int32(5))) && func() int32 {
 17252  		if _rc != int32(6) {
 17253  			return int32(1)
 17254  		}
 17255  		return func() int32 {
 17256  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69117), unsafe.Pointer(&_isFatalErrorØ00__func__Ø000), unsafe.Pointer(str(4809)))
 17257  			crt.X__builtin_abort(tls)
 17258  			return int32(0)
 17259  		}()
 17260  	}() != 0)
 17261  }
 17262  
 17263  var _isFatalErrorØ00__func__Ø000 [13]int8
 17264  
 17265  func init() {
 17266  	crt.Xstrncpy(nil, &_isFatalErrorØ00__func__Ø000[0], str(17170), 13)
 17267  }
 17268  
 17269  // C comment
 17270  //  /*
 17271  //  ** Parameter zSrcData points to a buffer containing the data for
 17272  //  ** page iSrcPg from the source database. Copy this data into the
 17273  //  ** destination database.
 17274  //  */
 17275  func _backupOnePage(tls *crt.TLS, _p *Xsqlite3_backup, _iSrcPg uint32, _zSrcData *uint8, _bUpdate int32) (r0 int32) {
 17276  	var _nSrcPgsz, _nDestPgsz, _nCopy, _rc int32
 17277  	var _iEnd, _iOff int64
 17278  	var _2_iDest uint32
 17279  	var _3_zIn, _3_zDestData, _3_zOut *uint8
 17280  	var _pDestPager *XPager
 17281  	var _2_pDestPg *XPgHdr
 17282  	_pDestPager = _sqlite3BtreePager(tls, (*XBtree)(_p.XpDest))
 17283  	_nSrcPgsz = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpSrc))
 17284  	_nDestPgsz = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpDest))
 17285  	_nCopy = func() int32 {
 17286  		if _nSrcPgsz < _nDestPgsz {
 17287  			return _nSrcPgsz
 17288  		}
 17289  		return _nDestPgsz
 17290  	}()
 17291  	_iEnd = int64(_iSrcPg) * int64(_nSrcPgsz)
 17292  	_rc = int32(0)
 17293  	func() {
 17294  		if _sqlite3BtreeGetReserveNoMutex(tls, (*XBtree)(_p.XpSrc)) < int32(0) {
 17295  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69146), unsafe.Pointer(&_backupOnePageØ00__func__Ø000), unsafe.Pointer(str(17183)))
 17296  			crt.X__builtin_abort(tls)
 17297  		}
 17298  	}()
 17299  	func() {
 17300  		if _p.XbDestLocked == 0 {
 17301  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69147), unsafe.Pointer(&_backupOnePageØ00__func__Ø000), unsafe.Pointer(str(17225)))
 17302  			crt.X__builtin_abort(tls)
 17303  		}
 17304  	}()
 17305  	func() {
 17306  		if _isFatalError(tls, _p.Xrc) != 0 {
 17307  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69148), unsafe.Pointer(&_backupOnePageØ00__func__Ø000), unsafe.Pointer(str(17240)))
 17308  			crt.X__builtin_abort(tls)
 17309  		}
 17310  	}()
 17311  	func() {
 17312  		if _iSrcPg == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.XpSrc).XpBt).XpageSize)) + uint32(1)) {
 17313  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69149), unsafe.Pointer(&_backupOnePageØ00__func__Ø000), unsafe.Pointer(str(17261)))
 17314  			crt.X__builtin_abort(tls)
 17315  		}
 17316  	}()
 17317  	func() {
 17318  		if _zSrcData == nil {
 17319  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69150), unsafe.Pointer(&_backupOnePageØ00__func__Ø000), unsafe.Pointer(str(17301)))
 17320  			crt.X__builtin_abort(tls)
 17321  		}
 17322  	}()
 17323  	if (_nSrcPgsz != _nDestPgsz) && _sqlite3PagerIsMemdb(tls, _pDestPager) != 0 {
 17324  		_rc = int32(8)
 17325  	}
 17326  	_iOff = _iEnd - int64(_nSrcPgsz)
 17327  _14:
 17328  	if _rc != int32(0) || _iOff >= _iEnd {
 17329  		goto _18
 17330  	}
 17331  	_2_pDestPg = nil
 17332  	_2_iDest = uint32(_iOff/int64(_nDestPgsz)) + uint32(1)
 17333  	if _2_iDest == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.XpDest).XpBt).XpageSize)) + uint32(1)) {
 17334  		goto _15
 17335  	}
 17336  	if int32(0) != store2(&_rc, _sqlite3PagerGet(tls, _pDestPager, _2_iDest, &_2_pDestPg, int32(0))) || int32(0) != store2(&_rc, _sqlite3PagerWrite(tls, _2_pDestPg)) {
 17337  		goto _21
 17338  	}
 17339  	_3_zIn = elem15(_zSrcData, uintptr(_iOff%int64(_nSrcPgsz)))
 17340  	_3_zDestData = (*uint8)(_sqlite3PagerGetData(tls, _2_pDestPg))
 17341  	_3_zOut = elem15(_3_zDestData, uintptr(_iOff%int64(_nDestPgsz)))
 17342  	crt.Xmemcpy(tls, unsafe.Pointer(_3_zOut), unsafe.Pointer(_3_zIn), uint64(_nCopy))
 17343  	*elem15((*uint8)(_sqlite3PagerGetExtra(tls, _2_pDestPg)), 0) = 0
 17344  	if (_iOff == (0)) && (_bUpdate == int32(0)) {
 17345  		_sqlite3Put4byte(tls, elem15(_3_zOut, uintptr(28)), _sqlite3BtreeLastPage(tls, (*XBtree)(_p.XpSrc)))
 17346  	}
 17347  _21:
 17348  	_sqlite3PagerUnref(tls, _2_pDestPg)
 17349  _15:
 17350  	_iOff += int64(_nDestPgsz)
 17351  	goto _14
 17352  _18:
 17353  	return _rc
 17354  }
 17355  
 17356  // C comment
 17357  //  /*
 17358  //  ** Return the pager associated with a BTree.  This routine is used for
 17359  //  ** testing and debugging only.
 17360  //  */
 17361  func _sqlite3BtreePager(tls *crt.TLS, _p *XBtree) (r0 *XPager) {
 17362  	return (*XPager)((*XBtShared)(_p.XpBt).XpPager)
 17363  }
 17364  
 17365  // C comment
 17366  //  /*
 17367  //  ** Return the currently defined page size
 17368  //  */
 17369  func _sqlite3BtreeGetPageSize(tls *crt.TLS, _p *XBtree) (r0 int32) {
 17370  	return int32((*XBtShared)(_p.XpBt).XpageSize)
 17371  }
 17372  
 17373  // C comment
 17374  //  /*
 17375  //  ** This function is similar to sqlite3BtreeGetReserve(), except that it
 17376  //  ** may only be called if it is guaranteed that the b-tree mutex is already
 17377  //  ** held.
 17378  //  **
 17379  //  ** This is useful in one special case in the backup API code where it is
 17380  //  ** known that the shared b-tree mutex is held, but the mutex on the
 17381  //  ** database handle that owns *p is not. In this case if sqlite3BtreeEnter()
 17382  //  ** were to be called, it might collide with some other operation on the
 17383  //  ** database handle that owns *p, causing undefined behavior.
 17384  //  */
 17385  func _sqlite3BtreeGetReserveNoMutex(tls *crt.TLS, _p *XBtree) (r0 int32) {
 17386  	var _n int32
 17387  	func() {
 17388  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex)) == 0 {
 17389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61796), unsafe.Pointer(&_sqlite3BtreeGetReserveNoMutexØ00__func__Ø000), unsafe.Pointer(str(17310)))
 17390  			crt.X__builtin_abort(tls)
 17391  		}
 17392  	}()
 17393  	_n = int32(((*XBtShared)(_p.XpBt).XpageSize) - ((*XBtShared)(_p.XpBt).XusableSize))
 17394  	return _n
 17395  }
 17396  
 17397  var _sqlite3BtreeGetReserveNoMutexØ00__func__Ø000 [30]int8
 17398  
 17399  func init() {
 17400  	crt.Xstrncpy(nil, &_sqlite3BtreeGetReserveNoMutexØ00__func__Ø000[0], str(17344), 30)
 17401  }
 17402  
 17403  var _backupOnePageØ00__func__Ø000 [14]int8
 17404  
 17405  func init() {
 17406  	crt.Xstrncpy(nil, &_backupOnePageØ00__func__Ø000[0], str(17374), 14)
 17407  }
 17408  
 17409  // C comment
 17410  //  /*
 17411  //  ** Return true if this is an in-memory or temp-file backed pager.
 17412  //  */
 17413  func _sqlite3PagerIsMemdb(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 17414  	return int32(_pPager.XtempFile)
 17415  }
 17416  
 17417  // C comment
 17418  //  /*
 17419  //  ** Return a pointer to the data for the specified page.
 17420  //  */
 17421  func _sqlite3PagerGetData(tls *crt.TLS, _pPg *XPgHdr) (r0 unsafe.Pointer) {
 17422  	func() {
 17423  		if int32(_pPg.XnRef) <= int32(0) && ((*XPager)(_pPg.XpPager).XmemDb) == 0 {
 17424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54024), unsafe.Pointer(&_sqlite3PagerGetDataØ00__func__Ø000), unsafe.Pointer(str(17388)))
 17425  			crt.X__builtin_abort(tls)
 17426  		}
 17427  	}()
 17428  	return _pPg.XpData
 17429  }
 17430  
 17431  var _sqlite3PagerGetDataØ00__func__Ø000 [20]int8
 17432  
 17433  func init() {
 17434  	crt.Xstrncpy(nil, &_sqlite3PagerGetDataØ00__func__Ø000[0], str(17422), 20)
 17435  }
 17436  
 17437  // C comment
 17438  //  /*
 17439  //  ** Return a pointer to the Pager.nExtra bytes of "extra" space
 17440  //  ** allocated along with the specified page.
 17441  //  */
 17442  func _sqlite3PagerGetExtra(tls *crt.TLS, _pPg *XPgHdr) (r0 unsafe.Pointer) {
 17443  	return _pPg.XpExtra
 17444  }
 17445  
 17446  func _sqlite3BtreeLastPage(tls *crt.TLS, _p *XBtree) (r0 uint32) {
 17447  	func() {
 17448  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 17449  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61054), unsafe.Pointer(&_sqlite3BtreeLastPageØ00__func__Ø000), unsafe.Pointer(str(17442)))
 17450  			crt.X__builtin_abort(tls)
 17451  		}
 17452  	}()
 17453  	func() {
 17454  		if (((*XBtShared)(_p.XpBt).XnPage) & uint32(134217728)) != (0) {
 17455  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61055), unsafe.Pointer(&_sqlite3BtreeLastPageØ00__func__Ø000), unsafe.Pointer(str(17468)))
 17456  			crt.X__builtin_abort(tls)
 17457  		}
 17458  	}()
 17459  	return _btreePagecount(tls, (*XBtShared)(_p.XpBt))
 17460  }
 17461  
 17462  // C comment
 17463  //  /*
 17464  //  ** Return true if the BtShared mutex is held on the btree, or if the
 17465  //  ** B-Tree is not marked as sharable.
 17466  //  **
 17467  //  ** This routine is used only from within assert() statements.
 17468  //  */
 17469  func _sqlite3BtreeHoldsMutex(tls *crt.TLS, _p *XBtree) (r0 int32) {
 17470  	func() {
 17471  		if int32(_p.Xsharable) != int32(0) && int32(_p.Xlocked) != int32(0) && _p.XwantToLock <= int32(0) {
 17472  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58885), unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000), unsafe.Pointer(str(17499)))
 17473  			crt.X__builtin_abort(tls)
 17474  		}
 17475  	}()
 17476  	func() {
 17477  		if int32(_p.Xsharable) != int32(0) && int32(_p.Xlocked) != int32(0) && (*Xsqlite3)(_p.Xdb) != (*Xsqlite3)((*XBtShared)(_p.XpBt).Xdb) {
 17478  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58886), unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000), unsafe.Pointer(str(17549)))
 17479  			crt.X__builtin_abort(tls)
 17480  		}
 17481  	}()
 17482  	func() {
 17483  		if int32(_p.Xsharable) != int32(0) && int32(_p.Xlocked) != int32(0) && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex)) == 0 {
 17484  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58887), unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000), unsafe.Pointer(str(17601)))
 17485  			crt.X__builtin_abort(tls)
 17486  		}
 17487  	}()
 17488  	func() {
 17489  		if int32(_p.Xsharable) != int32(0) && int32(_p.Xlocked) != int32(0) && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 17490  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58888), unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000), unsafe.Pointer(str(17669)))
 17491  			crt.X__builtin_abort(tls)
 17492  		}
 17493  	}()
 17494  	return bool2int((int32(_p.Xsharable) == int32(0)) || (_p.Xlocked != 0))
 17495  }
 17496  
 17497  var _sqlite3BtreeHoldsMutexØ00__func__Ø000 [23]int8
 17498  
 17499  func init() {
 17500  	crt.Xstrncpy(nil, &_sqlite3BtreeHoldsMutexØ00__func__Ø000[0], str(17736), 23)
 17501  }
 17502  
 17503  var _sqlite3BtreeLastPageØ00__func__Ø000 [21]int8
 17504  
 17505  func init() {
 17506  	crt.Xstrncpy(nil, &_sqlite3BtreeLastPageØ00__func__Ø000[0], str(17759), 21)
 17507  }
 17508  
 17509  // C comment
 17510  //  /*
 17511  //  ** Return the size of the database file in pages. If there is any kind of
 17512  //  ** error, return ((unsigned int)-1).
 17513  //  */
 17514  func _btreePagecount(tls *crt.TLS, _pBt *XBtShared) (r0 uint32) {
 17515  	return _pBt.XnPage
 17516  }
 17517  
 17518  func _sqlite3PagerUnref(tls *crt.TLS, _pPg *XPgHdr) {
 17519  	if _pPg != nil {
 17520  		_sqlite3PagerUnrefNotNull(tls, _pPg)
 17521  	}
 17522  }
 17523  
 17524  // C comment
 17525  //  /*
 17526  //  ** The journal file must be open when this is called. A journal header file
 17527  //  ** (JOURNAL_HDR_SZ bytes) is read from the current location in the journal
 17528  //  ** file. The current location in the journal file is given by
 17529  //  ** pPager->journalOff. See comments above function writeJournalHdr() for
 17530  //  ** a description of the journal header format.
 17531  //  **
 17532  //  ** If the header is read successfully, *pNRec is set to the number of
 17533  //  ** page records following this header and *pDbSize is set to the size of the
 17534  //  ** database before the transaction began, in pages. Also, pPager->cksumInit
 17535  //  ** is set to the value read from the journal header. SQLITE_OK is returned
 17536  //  ** in this case.
 17537  //  **
 17538  //  ** If the journal header file appears to be corrupted, SQLITE_DONE is
 17539  //  ** returned and *pNRec and *PDbSize are undefined.  If JOURNAL_HDR_SZ bytes
 17540  //  ** cannot be read from the journal file an error code is returned.
 17541  //  */
 17542  func _readJournalHdr(tls *crt.TLS, _pPager *XPager, _isHot int32, _journalSize int64, _pNRec *uint32, _pDbSize *uint32) (r0 int32) {
 17543  	var _rc int32
 17544  	var _iHdrOff int64
 17545  	var _6_iPageSize, _6_iSectorSize uint32
 17546  	var _aMagic [8]uint8
 17547  	func() {
 17548  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 17549  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48464), unsafe.Pointer(&_readJournalHdrØ00__func__Ø000), unsafe.Pointer(str(13581)))
 17550  			crt.X__builtin_abort(tls)
 17551  		}
 17552  	}()
 17553  	_pPager.XjournalOff = _journalHdrOffset(tls, _pPager)
 17554  	if (_pPager.XjournalOff + int64(_pPager.XsectorSize)) > _journalSize {
 17555  		return int32(101)
 17556  	}
 17557  	_iHdrOff = _pPager.XjournalOff
 17558  	if _isHot == 0 && _iHdrOff == _pPager.XjournalHdr {
 17559  		goto _4
 17560  	}
 17561  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_aMagic), int32(8), _iHdrOff)
 17562  	if _rc != 0 {
 17563  		return _rc
 17564  	}
 17565  	if crt.Xmemcmp(tls, unsafe.Pointer(&_aMagic), unsafe.Pointer(&_aJournalMagic), uint64(8)) != int32(0) {
 17566  		return int32(101)
 17567  	}
 17568  _4:
 17569  	if ((int32(0) != store2(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), _iHdrOff+int64(8), _pNRec))) || (int32(0) != store2(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), _iHdrOff+int64(12), &_pPager.XcksumInit)))) || (int32(0) != store2(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), _iHdrOff+int64(16), _pDbSize))) {
 17570  		return _rc
 17571  	}
 17572  	if _pPager.XjournalOff != (0) {
 17573  		goto _10
 17574  	}
 17575  	if (int32(0) != store2(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), _iHdrOff+int64(20), &_6_iSectorSize))) || (int32(0) != store2(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), _iHdrOff+int64(24), &_6_iPageSize))) {
 17576  		return _rc
 17577  	}
 17578  	if _6_iPageSize == (0) {
 17579  		_6_iPageSize = uint32(_pPager.XpageSize)
 17580  	}
 17581  	if (((((_6_iPageSize < uint32(512)) || (_6_iSectorSize < uint32(32))) || (_6_iPageSize > uint32(65536))) || (_6_iSectorSize > uint32(65536))) || (((_6_iPageSize - uint32(1)) & _6_iPageSize) != (0))) || (((_6_iSectorSize - uint32(1)) & _6_iSectorSize) != (0)) {
 17582  		return int32(101)
 17583  	}
 17584  	_rc = _sqlite3PagerSetPagesize(tls, _pPager, &_6_iPageSize, int32(-1))
 17585  	_pPager.XsectorSize = _6_iSectorSize
 17586  _10:
 17587  	_pPager.XjournalOff += int64(_pPager.XsectorSize)
 17588  	return _rc
 17589  
 17590  	_ = _aMagic
 17591  	panic(0)
 17592  }
 17593  
 17594  var _readJournalHdrØ00__func__Ø000 [15]int8
 17595  
 17596  func init() {
 17597  	crt.Xstrncpy(nil, &_readJournalHdrØ00__func__Ø000[0], str(17780), 15)
 17598  }
 17599  
 17600  // C comment
 17601  //  /*
 17602  //  ** Change the page size used by the Pager object. The new page size
 17603  //  ** is passed in *pPageSize.
 17604  //  **
 17605  //  ** If the pager is in the error state when this function is called, it
 17606  //  ** is a no-op. The value returned is the error state error code (i.e.
 17607  //  ** one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL).
 17608  //  **
 17609  //  ** Otherwise, if all of the following are true:
 17610  //  **
 17611  //  **   * the new page size (value of *pPageSize) is valid (a power
 17612  //  **     of two between 512 and SQLITE_MAX_PAGE_SIZE, inclusive), and
 17613  //  **
 17614  //  **   * there are no outstanding page references, and
 17615  //  **
 17616  //  **   * the database is either not an in-memory database or it is
 17617  //  **     an in-memory database that currently consists of zero pages.
 17618  //  **
 17619  //  ** then the pager object page size is set to *pPageSize.
 17620  //  **
 17621  //  ** If the page size is changed, then this function uses sqlite3PagerMalloc()
 17622  //  ** to obtain a new Pager.pTmpSpace buffer. If this allocation attempt
 17623  //  ** fails, SQLITE_NOMEM is returned and the page size remains unchanged.
 17624  //  ** In all other cases, SQLITE_OK is returned.
 17625  //  **
 17626  //  ** If the page size is not changed, either because one of the enumerated
 17627  //  ** conditions above is not true, the pager was in error state when this
 17628  //  ** function was called, or because the memory allocation attempt failed,
 17629  //  ** then *pPageSize is set to the old, retained page size before returning.
 17630  //  */
 17631  func _sqlite3PagerSetPagesize(tls *crt.TLS, _pPager *XPager, _pPageSize *uint32, _nReserve int32) (r0 int32) {
 17632  	var _rc int32
 17633  	var _1_nByte int64
 17634  	var _pageSize uint32
 17635  	var _1_pNew *int8
 17636  	_rc = int32(0)
 17637  	_pageSize = *_pPageSize
 17638  	func() {
 17639  		if _pageSize != (0) && (_pageSize < uint32(512) || _pageSize > uint32(65536)) {
 17640  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50655), unsafe.Pointer(&_sqlite3PagerSetPagesizeØ00__func__Ø000), unsafe.Pointer(str(17795)))
 17641  			crt.X__builtin_abort(tls)
 17642  		}
 17643  	}()
 17644  	if int32(_pPager.XmemDb) != int32(0) && _pPager.XdbSize != (0) || _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache)) != int32(0) || _pageSize == 0 || _pageSize == uint32(_pPager.XpageSize) {
 17645  		goto _8
 17646  	}
 17647  	_1_pNew = nil
 17648  	_1_nByte = int64(0)
 17649  	if (int32(_pPager.XeState) > int32(0)) && ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil) {
 17650  		_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xfd), &_1_nByte)
 17651  	}
 17652  	if _rc != int32(0) {
 17653  		goto _11
 17654  	}
 17655  	_1_pNew = (*int8)(_sqlite3PageMalloc(tls, int32(_pageSize)))
 17656  	if _1_pNew == nil {
 17657  		_rc = _sqlite3NomemError(tls, int32(50668))
 17658  	}
 17659  _11:
 17660  	if _rc == int32(0) {
 17661  		_pager_reset(tls, _pPager)
 17662  		_rc = _sqlite3PcacheSetPageSize(tls, (*XPCache)(_pPager.XpPCache), int32(_pageSize))
 17663  	}
 17664  	if _rc == int32(0) {
 17665  		_sqlite3PageFree(tls, unsafe.Pointer(_pPager.XpTmpSpace))
 17666  		_pPager.XpTmpSpace = _1_pNew
 17667  		_pPager.XdbSize = uint32(((_1_nByte + int64(_pageSize)) - int64(1)) / int64(_pageSize))
 17668  		_pPager.XpageSize = int32(_pageSize)
 17669  		goto _15
 17670  	}
 17671  	_sqlite3PageFree(tls, unsafe.Pointer(_1_pNew))
 17672  _15:
 17673  _8:
 17674  	*_pPageSize = uint32(_pPager.XpageSize)
 17675  	if _rc != int32(0) {
 17676  		goto _16
 17677  	}
 17678  	if _nReserve < int32(0) {
 17679  		_nReserve = int32(_pPager.XnReserve)
 17680  	}
 17681  	func() {
 17682  		if _nReserve < int32(0) || _nReserve >= int32(1000) {
 17683  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50688), unsafe.Pointer(&_sqlite3PagerSetPagesizeØ00__func__Ø000), unsafe.Pointer(str(17860)))
 17684  			crt.X__builtin_abort(tls)
 17685  		}
 17686  	}()
 17687  	_pPager.XnReserve = int16(_nReserve)
 17688  	_pagerFixMaplimit(tls, _pPager)
 17689  _16:
 17690  	return _rc
 17691  }
 17692  
 17693  var _sqlite3PagerSetPagesizeØ00__func__Ø000 [24]int8
 17694  
 17695  func init() {
 17696  	crt.Xstrncpy(nil, &_sqlite3PagerSetPagesizeØ00__func__Ø000[0], str(17889), 24)
 17697  }
 17698  
 17699  func _sqlite3OsFileSize(tls *crt.TLS, _id *Xsqlite3_file, _pSize *int64) (r0 int32) {
 17700  	return func() func(*crt.TLS, *Xsqlite3_file, *int64) int32 {
 17701  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxFileSize
 17702  		return *(*func(*crt.TLS, *Xsqlite3_file, *int64) int32)(unsafe.Pointer(&v))
 17703  	}()(tls, _id, _pSize)
 17704  }
 17705  
 17706  // C comment
 17707  //  /*
 17708  //  ** Malloc function used by SQLite to obtain space from the buffer configured
 17709  //  ** using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no such buffer
 17710  //  ** exists, this function falls back to sqlite3Malloc().
 17711  //  */
 17712  func _sqlite3PageMalloc(tls *crt.TLS, _sz int32) (r0 unsafe.Pointer) {
 17713  	return _pcache1Alloc(tls, _sz)
 17714  }
 17715  
 17716  // C comment
 17717  //  /*
 17718  //  ** Discard the entire contents of the in-memory page-cache.
 17719  //  */
 17720  func _pager_reset(tls *crt.TLS, _pPager *XPager) {
 17721  	_pPager.XiDataVersion += 1
 17722  	_sqlite3BackupRestart(tls, (*Xsqlite3_backup)(_pPager.XpBackup))
 17723  	_sqlite3PcacheClear(tls, (*XPCache)(_pPager.XpPCache))
 17724  }
 17725  
 17726  // C comment
 17727  //  /*
 17728  //  ** Discard the contents of the cache.
 17729  //  */
 17730  func _sqlite3PcacheClear(tls *crt.TLS, _pCache *XPCache) {
 17731  	_sqlite3PcacheTruncate(tls, _pCache, 0)
 17732  }
 17733  
 17734  // C comment
 17735  //  /*
 17736  //  ** Drop every cache entry whose page number is greater than "pgno". The
 17737  //  ** caller must ensure that there are no outstanding references to any pages
 17738  //  ** other than page 1 with a page number greater than pgno.
 17739  //  **
 17740  //  ** If there is a reference to page 1 and the pgno parameter passed to this
 17741  //  ** function is 0, then the data area associated with page 1 is zeroed, but
 17742  //  ** the page object is not dropped.
 17743  //  */
 17744  func _sqlite3PcacheTruncate(tls *crt.TLS, _pCache *XPCache, _pgno uint32) {
 17745  	var _1_p, _1_pNext *XPgHdr
 17746  	var _4_pPage1 *Xsqlite3_pcache_page
 17747  	if _pCache.XpCache == nil {
 17748  		goto _0
 17749  	}
 17750  	_1_p = (*XPgHdr)(_pCache.XpDirty)
 17751  _1:
 17752  	if _1_p == nil {
 17753  		goto _4
 17754  	}
 17755  	_1_pNext = (*XPgHdr)(_1_p.XpDirtyNext)
 17756  	func() {
 17757  		if _1_p.Xpgno <= (0) {
 17758  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44782), unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000), unsafe.Pointer(str(17913)))
 17759  			crt.X__builtin_abort(tls)
 17760  		}
 17761  	}()
 17762  	if _1_p.Xpgno > _pgno {
 17763  		func() {
 17764  			if (int32(_1_p.Xflags) & int32(2)) == 0 {
 17765  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44784), unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000), unsafe.Pointer(str(17923)))
 17766  				crt.X__builtin_abort(tls)
 17767  			}
 17768  		}()
 17769  		_sqlite3PcacheMakeClean(tls, _1_p)
 17770  	}
 17771  	_1_p = _1_pNext
 17772  	goto _1
 17773  _4:
 17774  	if _pgno != (0) || _pCache.XnRefSum == 0 {
 17775  		goto _11
 17776  	}
 17777  	_4_pPage1 = func() func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page {
 17778  		v := _sqlite3Config.Xpcache2.XxFetch
 17779  		return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&v))
 17780  	}()(tls, _pCache.XpCache, uint32(1), int32(0))
 17781  	if func() int32 {
 17782  		if _4_pPage1 != nil {
 17783  			return int32(1)
 17784  		}
 17785  		return func() int32 {
 17786  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44791), unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000), unsafe.Pointer(str(4809)))
 17787  			crt.X__builtin_abort(tls)
 17788  			return int32(0)
 17789  		}()
 17790  	}() != 0 {
 17791  		crt.Xmemset(tls, _4_pPage1.XpBuf, int32(0), uint64(_pCache.XszPage))
 17792  		_pgno = uint32(1)
 17793  	}
 17794  _11:
 17795  	(_sqlite3Config.Xpcache2.XxTruncate)(tls, _pCache.XpCache, _pgno+uint32(1))
 17796  _0:
 17797  }
 17798  
 17799  var _sqlite3PcacheTruncateØ00__func__Ø000 [22]int8
 17800  
 17801  func init() {
 17802  	crt.Xstrncpy(nil, &_sqlite3PcacheTruncateØ00__func__Ø000[0], str(17944), 22)
 17803  }
 17804  
 17805  // C comment
 17806  //  /*
 17807  //  ** Make sure the page is marked as clean. If it isn't clean already,
 17808  //  ** make it so.
 17809  //  */
 17810  func _sqlite3PcacheMakeClean(tls *crt.TLS, _p *XPgHdr) {
 17811  	func() {
 17812  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 17813  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44698), unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000), unsafe.Pointer(str(13822)))
 17814  			crt.X__builtin_abort(tls)
 17815  		}
 17816  	}()
 17817  	if func() int32 {
 17818  		if (int32(_p.Xflags) & int32(2)) != int32(0) {
 17819  			return int32(1)
 17820  		}
 17821  		return func() int32 {
 17822  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44699), unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000), unsafe.Pointer(str(4809)))
 17823  			crt.X__builtin_abort(tls)
 17824  			return int32(0)
 17825  		}()
 17826  	}() == 0 {
 17827  		goto _4
 17828  	}
 17829  	func() {
 17830  		if (int32(_p.Xflags) & int32(1)) != int32(0) {
 17831  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44700), unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000), unsafe.Pointer(str(17966)))
 17832  			crt.X__builtin_abort(tls)
 17833  		}
 17834  	}()
 17835  	_pcacheManageDirtyList(tls, _p, uint8(1))
 17836  	{
 17837  		p := &_p.Xflags
 17838  		*p = uint16(int32(*p) & int32(-15))
 17839  	}
 17840  	{
 17841  		p := &_p.Xflags
 17842  		*p = uint16(int32(*p) | int32(1))
 17843  	}
 17844  	func() {
 17845  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 17846  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44705), unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000), unsafe.Pointer(str(13822)))
 17847  			crt.X__builtin_abort(tls)
 17848  		}
 17849  	}()
 17850  	if int32(_p.XnRef) == int32(0) {
 17851  		_pcacheUnpin(tls, _p)
 17852  	}
 17853  _4:
 17854  }
 17855  
 17856  var _sqlite3PcacheMakeCleanØ00__func__Ø000 [23]int8
 17857  
 17858  func init() {
 17859  	crt.Xstrncpy(nil, &_sqlite3PcacheMakeCleanØ00__func__Ø000[0], str(17994), 23)
 17860  }
 17861  
 17862  // C comment
 17863  //  /*
 17864  //  ** Change the page size for PCache object. The caller must ensure that there
 17865  //  ** are no outstanding page references when this function is called.
 17866  //  */
 17867  func _sqlite3PcacheSetPageSize(tls *crt.TLS, _pCache *XPCache, _szPage int32) (r0 int32) {
 17868  	var _1_pNew unsafe.Pointer
 17869  	func() {
 17870  		if _pCache.XnRefSum != int32(0) || (*XPgHdr)(_pCache.XpDirty) != nil {
 17871  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44444), unsafe.Pointer(&_sqlite3PcacheSetPageSizeØ00__func__Ø000), unsafe.Pointer(str(18017)))
 17872  			crt.X__builtin_abort(tls)
 17873  		}
 17874  	}()
 17875  	if _pCache.XszPage == 0 {
 17876  		goto _3
 17877  	}
 17878  	_1_pNew = (_sqlite3Config.Xpcache2.XxCreate)(tls, _szPage, int32(uint64(_pCache.XszExtra)+uint64(72)), int32(_pCache.XbPurgeable))
 17879  	if _1_pNew == nil {
 17880  		return _sqlite3NomemError(tls, int32(44451))
 17881  	}
 17882  	(_sqlite3Config.Xpcache2.XxCachesize)(tls, _1_pNew, _numberOfCachePages(tls, _pCache))
 17883  	if _pCache.XpCache != nil {
 17884  		(_sqlite3Config.Xpcache2.XxDestroy)(tls, _pCache.XpCache)
 17885  	}
 17886  	_pCache.XpCache = _1_pNew
 17887  	_pCache.XszPage = _szPage
 17888  _3:
 17889  	return int32(0)
 17890  }
 17891  
 17892  var _sqlite3PcacheSetPageSizeØ00__func__Ø000 [25]int8
 17893  
 17894  func init() {
 17895  	crt.Xstrncpy(nil, &_sqlite3PcacheSetPageSizeØ00__func__Ø000[0], str(18057), 25)
 17896  }
 17897  
 17898  // C comment
 17899  //  /*
 17900  //  ** Compute the number of pages of cache requested.   p->szCache is the
 17901  //  ** cache size requested by the "PRAGMA cache_size" statement.
 17902  //  */
 17903  func _numberOfCachePages(tls *crt.TLS, _p *XPCache) (r0 int32) {
 17904  	if _p.XszCache >= int32(0) {
 17905  		return _p.XszCache
 17906  	}
 17907  	return int32((int64(-1024) * int64(_p.XszCache)) / int64(_p.XszPage+_p.XszExtra))
 17908  }
 17909  
 17910  // C comment
 17911  //  /*
 17912  //  ** Free an allocated buffer obtained from sqlite3PageMalloc().
 17913  //  */
 17914  func _sqlite3PageFree(tls *crt.TLS, _p unsafe.Pointer) {
 17915  	_pcache1Free(tls, _p)
 17916  }
 17917  
 17918  // C comment
 17919  //  /*
 17920  //  ** Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap.
 17921  //  */
 17922  func _pagerFixMaplimit(tls *crt.TLS, _pPager *XPager) {
 17923  	var _1_sz int64
 17924  	var _fd *Xsqlite3_file
 17925  	_fd = (*Xsqlite3_file)(_pPager.Xfd)
 17926  	if ((*Xsqlite3_io_methods)(_fd.XpMethods) != nil) && (((*Xsqlite3_io_methods)(_fd.XpMethods).XiVersion) >= int32(3)) {
 17927  		_1_sz = _pPager.XszMmap
 17928  		_pPager.XbUseFetch = uint8(bool2int(_1_sz > (0)))
 17929  		_setGetterMethod(tls, _pPager)
 17930  		_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(18), unsafe.Pointer(&_1_sz))
 17931  	}
 17932  }
 17933  
 17934  // C comment
 17935  //  /*
 17936  //  ** Set the Pager.xGet method for the appropriate routine used to fetch
 17937  //  ** content from the pager.
 17938  //  */
 17939  func _setGetterMethod(tls *crt.TLS, _pPager *XPager) {
 17940  	if _pPager.XerrCode != 0 {
 17941  		*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&_pPager.XxGet)) = _getPageError
 17942  		goto _3
 17943  	}
 17944  	if _pPager.XbUseFetch != 0 {
 17945  		*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&_pPager.XxGet)) = _getPageMMap
 17946  		goto _3
 17947  	}
 17948  	*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&_pPager.XxGet)) = _getPageNormal
 17949  _3:
 17950  }
 17951  
 17952  // C comment
 17953  //  /* The page getter method for when the pager is an error state */
 17954  func _getPageError(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
 17955  	func() {
 17956  		if _pPager.XerrCode == int32(0) {
 17957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52502), unsafe.Pointer(&_getPageErrorØ00__func__Ø000), unsafe.Pointer(str(12208)))
 17958  			crt.X__builtin_abort(tls)
 17959  		}
 17960  	}()
 17961  	*_ppPage = nil
 17962  	return _pPager.XerrCode
 17963  }
 17964  
 17965  var _getPageErrorØ00__func__Ø000 [13]int8
 17966  
 17967  func init() {
 17968  	crt.Xstrncpy(nil, &_getPageErrorØ00__func__Ø000[0], str(18082), 13)
 17969  }
 17970  
 17971  // C comment
 17972  //  /* The page getter for when memory-mapped I/O is enabled */
 17973  func _getPageMMap(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
 17974  	var _rc, _bMmapOk int32
 17975  	var _iFrame uint32
 17976  	var _4_pData unsafe.Pointer
 17977  	var _pPg *XPgHdr
 17978  	_rc = int32(0)
 17979  	_pPg = nil
 17980  	_iFrame = uint32(0)
 17981  	_bMmapOk = bool2int((_pgno > uint32(1)) && ((int32(_pPager.XeState) == int32(1)) || (_flags&int32(2)) != 0))
 17982  	func() {
 17983  		if _pPager.XbUseFetch == 0 {
 17984  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52440), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(18095)))
 17985  			crt.X__builtin_abort(tls)
 17986  		}
 17987  	}()
 17988  	if (_pgno <= uint32(1)) && (_pgno == (0)) {
 17989  		return _sqlite3CorruptError(tls, int32(52450))
 17990  	}
 17991  	func() {
 17992  		if int32(_pPager.XeState) < int32(1) {
 17993  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52452), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(18112)))
 17994  			crt.X__builtin_abort(tls)
 17995  		}
 17996  	}()
 17997  	func() {
 17998  		if _assert_pager_state(tls, _pPager) == 0 {
 17999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52453), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(10971)))
 18000  			crt.X__builtin_abort(tls)
 18001  		}
 18002  	}()
 18003  	func() {
 18004  		if int32(_pPager.XhasHeldSharedLock) != int32(1) {
 18005  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52454), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(18141)))
 18006  			crt.X__builtin_abort(tls)
 18007  		}
 18008  	}()
 18009  	func() {
 18010  		if _pPager.XerrCode != int32(0) {
 18011  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52455), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(11709)))
 18012  			crt.X__builtin_abort(tls)
 18013  		}
 18014  	}()
 18015  	if _bMmapOk == 0 || (*XWal)(_pPager.XpWal) == nil {
 18016  		goto _15
 18017  	}
 18018  	_rc = _sqlite3WalFindFrame(tls, (*XWal)(_pPager.XpWal), _pgno, &_iFrame)
 18019  	if _rc != int32(0) {
 18020  		*_ppPage = nil
 18021  		return _rc
 18022  	}
 18023  _15:
 18024  	if _bMmapOk == 0 || _iFrame != (0) {
 18025  		goto _18
 18026  	}
 18027  	_4_pData = nil
 18028  	_rc = _sqlite3OsFetch(tls, (*Xsqlite3_file)(_pPager.Xfd), int64(_pgno-uint32(1))*int64(_pPager.XpageSize), _pPager.XpageSize, &_4_pData)
 18029  	if _rc != int32(0) || _4_pData == nil {
 18030  		goto _20
 18031  	}
 18032  	if (int32(_pPager.XeState) > int32(1)) || (_pPager.XtempFile != 0) {
 18033  		_pPg = _sqlite3PagerLookup(tls, _pPager, _pgno)
 18034  	}
 18035  	if _pPg == nil {
 18036  		_rc = _pagerAcquireMapPage(tls, _pPager, _pgno, _4_pData, &_pPg)
 18037  		goto _24
 18038  	}
 18039  	_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), int64(_pgno-uint32(1))*int64(_pPager.XpageSize), _4_pData)
 18040  _24:
 18041  	if _pPg != nil {
 18042  		func() {
 18043  			if _rc != int32(0) {
 18044  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52479), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(14967)))
 18045  				crt.X__builtin_abort(tls)
 18046  			}
 18047  		}()
 18048  		*_ppPage = _pPg
 18049  		return int32(0)
 18050  	}
 18051  _20:
 18052  	if _rc != int32(0) {
 18053  		*_ppPage = nil
 18054  		return _rc
 18055  	}
 18056  _18:
 18057  	return _getPageNormal(tls, _pPager, _pgno, _ppPage, _flags)
 18058  }
 18059  
 18060  var _getPageMMapØ00__func__Ø000 [12]int8
 18061  
 18062  func init() {
 18063  	crt.Xstrncpy(nil, &_getPageMMapØ00__func__Ø000[0], str(18170), 12)
 18064  }
 18065  
 18066  // C comment
 18067  //  /* The real implementation of xFetch and xUnfetch */
 18068  func _sqlite3OsFetch(tls *crt.TLS, _id *Xsqlite3_file, _iOff int64, _iAmt int32, _pp *unsafe.Pointer) (r0 int32) {
 18069  	return func() func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32 {
 18070  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxFetch
 18071  		return *(*func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&v))
 18072  	}()(tls, _id, _iOff, _iAmt, _pp)
 18073  }
 18074  
 18075  // C comment
 18076  //  /*
 18077  //  ** Obtain a reference to a memory mapped page object for page number pgno.
 18078  //  ** The new object will use the pointer pData, obtained from xFetch().
 18079  //  ** If successful, set *ppPage to point to the new page reference
 18080  //  ** and return SQLITE_OK. Otherwise, return an SQLite error code and set
 18081  //  ** *ppPage to zero.
 18082  //  **
 18083  //  ** Page references obtained by calling this function should be released
 18084  //  ** by calling pagerReleaseMapPage().
 18085  //  */
 18086  func _pagerAcquireMapPage(tls *crt.TLS, _pPager *XPager, _pgno uint32, _pData unsafe.Pointer, _ppPage **XPgHdr) (r0 int32) {
 18087  	var _p *XPgHdr
 18088  	if _pPager.XpMmapFreelist != nil {
 18089  		*_ppPage = store36(&_p, (*XPgHdr)(_pPager.XpMmapFreelist))
 18090  		*(**XPgHdr)(unsafe.Pointer(&_pPager.XpMmapFreelist)) = (*XPgHdr)(_p.XpDirty)
 18091  		*(**XPgHdr)(unsafe.Pointer(&_p.XpDirty)) = nil
 18092  		func() {
 18093  			if int32(_pPager.XnExtra) < int32(8) {
 18094  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50940), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(18182)))
 18095  				crt.X__builtin_abort(tls)
 18096  			}
 18097  		}()
 18098  		crt.Xmemset(tls, _p.XpExtra, int32(0), uint64(8))
 18099  		goto _3
 18100  	}
 18101  	*_ppPage = store36(&_p, (*XPgHdr)(_sqlite3MallocZero(tls, uint64(72)+uint64(_pPager.XnExtra))))
 18102  	if _p == nil {
 18103  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), int64(_pgno-uint32(1))*int64(_pPager.XpageSize), _pData)
 18104  		return _sqlite3NomemError(tls, int32(50946))
 18105  	}
 18106  	_p.XpExtra = unsafe.Pointer(elem36(_p, uintptr(1)))
 18107  	_p.Xflags = uint16(32)
 18108  	_p.XnRef = int16(1)
 18109  	*(**XPager)(unsafe.Pointer(&_p.XpPager)) = _pPager
 18110  _3:
 18111  	func() {
 18112  		if _p.XpExtra != unsafe.Pointer(elem36(_p, uintptr(1))) {
 18113  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50954), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(18200)))
 18114  			crt.X__builtin_abort(tls)
 18115  		}
 18116  	}()
 18117  	func() {
 18118  		if (*Xsqlite3_pcache_page)(_p.XpPage) != nil {
 18119  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50955), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(18225)))
 18120  			crt.X__builtin_abort(tls)
 18121  		}
 18122  	}()
 18123  	func() {
 18124  		if int32(_p.Xflags) != int32(32) {
 18125  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50956), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(18237)))
 18126  			crt.X__builtin_abort(tls)
 18127  		}
 18128  	}()
 18129  	func() {
 18130  		if (*XPager)(_p.XpPager) != _pPager {
 18131  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50957), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(18258)))
 18132  			crt.X__builtin_abort(tls)
 18133  		}
 18134  	}()
 18135  	func() {
 18136  		if int32(_p.XnRef) != int32(1) {
 18137  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50958), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(16295)))
 18138  			crt.X__builtin_abort(tls)
 18139  		}
 18140  	}()
 18141  	_p.Xpgno = _pgno
 18142  	_p.XpData = _pData
 18143  	_pPager.XnMmapOut += 1
 18144  	return int32(0)
 18145  }
 18146  
 18147  var _pagerAcquireMapPageØ00__func__Ø000 [20]int8
 18148  
 18149  func init() {
 18150  	crt.Xstrncpy(nil, &_pagerAcquireMapPageØ00__func__Ø000[0], str(18276), 20)
 18151  }
 18152  
 18153  // C comment
 18154  //  /*
 18155  //  ** The page getter methods each try to acquire a reference to a
 18156  //  ** page with page number pgno. If the requested reference is
 18157  //  ** successfully obtained, it is copied to *ppPage and SQLITE_OK returned.
 18158  //  **
 18159  //  ** There are different implementations of the getter method depending
 18160  //  ** on the current state of the pager.
 18161  //  **
 18162  //  **     getPageNormal()         --  The normal getter
 18163  //  **     getPageError()          --  Used if the pager is in an error state
 18164  //  **     getPageMmap()           --  Used if memory-mapped I/O is enabled
 18165  //  **
 18166  //  ** If the requested page is already in the cache, it is returned.
 18167  //  ** Otherwise, a new page object is allocated and populated with data
 18168  //  ** read from the database file. In some cases, the pcache module may
 18169  //  ** choose not to allocate a new page object and may reuse an existing
 18170  //  ** object with no outstanding references.
 18171  //  **
 18172  //  ** The extra data appended to a page is always initialized to zeros the
 18173  //  ** first time a page is loaded into memory. If the page requested is
 18174  //  ** already in the cache when this function is called, then the extra
 18175  //  ** data is left as it was when the page object was last used.
 18176  //  **
 18177  //  ** If the database image is smaller than the requested page or if
 18178  //  ** the flags parameter contains the PAGER_GET_NOCONTENT bit and the
 18179  //  ** requested page is not already stored in the cache, then no
 18180  //  ** actual disk read occurs. In this case the memory image of the
 18181  //  ** page is initialized to all zeros.
 18182  //  **
 18183  //  ** If PAGER_GET_NOCONTENT is true, it means that we do not care about
 18184  //  ** the contents of the page. This occurs in two scenarios:
 18185  //  **
 18186  //  **   a) When reading a free-list leaf page from the database, and
 18187  //  **
 18188  //  **   b) When a savepoint is being rolled back and we need to load
 18189  //  **      a new page into the cache to be filled with the data read
 18190  //  **      from the savepoint journal.
 18191  //  **
 18192  //  ** If PAGER_GET_NOCONTENT is true, then the data returned is zeroed instead
 18193  //  ** of being read from the database. Additionally, the bits corresponding
 18194  //  ** to pgno in Pager.pInJournal (bitvec of pages already written to the
 18195  //  ** journal file) and the PagerSavepoint.pInSavepoint bitvecs of any open
 18196  //  ** savepoints are set. This means if the page is made writable at any
 18197  //  ** point in the future, using a call to sqlite3PagerWrite(), its contents
 18198  //  ** will not be journaled. This saves IO.
 18199  //  **
 18200  //  ** The acquisition might fail for several reasons.  In all cases,
 18201  //  ** an appropriate error code is returned and *ppPage is set to NULL.
 18202  //  **
 18203  //  ** See also sqlite3PagerLookup().  Both this routine and Lookup() attempt
 18204  //  ** to find a page in the in-memory cache first.  If the page is not already
 18205  //  ** in memory, this routine goes to disk to read it in whereas Lookup()
 18206  //  ** just returns 0.  This routine acquires a read-lock the first time it
 18207  //  ** has to go to disk, and could also playback an old journal if necessary.
 18208  //  ** Since Lookup() never goes to disk, it never has to deal with locks
 18209  //  ** or journal files.
 18210  //  */
 18211  func _getPageNormal(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
 18212  	var _rc int32
 18213  	var _10_iFrame uint32
 18214  	var _noContent uint8
 18215  	var _pPg *XPgHdr
 18216  	var _pBase *Xsqlite3_pcache_page
 18217  	_rc = int32(0)
 18218  	func() {
 18219  		if _pPager.XerrCode != int32(0) {
 18220  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52326), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(11709)))
 18221  			crt.X__builtin_abort(tls)
 18222  		}
 18223  	}()
 18224  	func() {
 18225  		if int32(_pPager.XeState) < int32(1) {
 18226  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52327), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18112)))
 18227  			crt.X__builtin_abort(tls)
 18228  		}
 18229  	}()
 18230  	func() {
 18231  		if _assert_pager_state(tls, _pPager) == 0 {
 18232  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52328), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(10971)))
 18233  			crt.X__builtin_abort(tls)
 18234  		}
 18235  	}()
 18236  	func() {
 18237  		if int32(_pPager.XhasHeldSharedLock) != int32(1) {
 18238  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52329), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18141)))
 18239  			crt.X__builtin_abort(tls)
 18240  		}
 18241  	}()
 18242  	if _pgno == (0) {
 18243  		return _sqlite3CorruptError(tls, int32(52331))
 18244  	}
 18245  	_pBase = _sqlite3PcacheFetch(tls, (*XPCache)(_pPager.XpPCache), _pgno, int32(3))
 18246  	if _pBase != nil {
 18247  		goto _9
 18248  	}
 18249  	_pPg = nil
 18250  	_rc = _sqlite3PcacheFetchStress(tls, (*XPCache)(_pPager.XpPCache), _pgno, &_pBase)
 18251  	if _rc != int32(0) {
 18252  		goto _pager_acquire_err
 18253  	}
 18254  	if _pBase == nil {
 18255  		_rc = _sqlite3NomemError(tls, int32(52338))
 18256  		goto _pager_acquire_err
 18257  	}
 18258  _9:
 18259  	_pPg = store36(_ppPage, _sqlite3PcacheFetchFinish(tls, (*XPCache)(_pPager.XpPCache), _pgno, _pBase))
 18260  	func() {
 18261  		if _pPg != (*_ppPage) {
 18262  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52343), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18296)))
 18263  			crt.X__builtin_abort(tls)
 18264  		}
 18265  	}()
 18266  	func() {
 18267  		if _pPg.Xpgno != _pgno {
 18268  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52344), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18311)))
 18269  			crt.X__builtin_abort(tls)
 18270  		}
 18271  	}()
 18272  	func() {
 18273  		if (*XPager)(_pPg.XpPager) != _pPager && (*XPager)(_pPg.XpPager) != nil {
 18274  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52345), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18327)))
 18275  			crt.X__builtin_abort(tls)
 18276  		}
 18277  	}()
 18278  	_noContent = uint8(bool2int((_flags & int32(1)) != int32(0)))
 18279  	if (_pPg.XpPager != nil) && (_noContent == 0) {
 18280  		func() {
 18281  			if _pgno > uint32(2147483647) || _pgno == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1)) {
 18282  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52351), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18365)))
 18283  				crt.X__builtin_abort(tls)
 18284  			}
 18285  		}()
 18286  		*elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), 0) += 1
 18287  		return int32(0)
 18288  	}
 18289  	if (_pgno > uint32(2147483647)) || (_pgno == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1))) {
 18290  		_rc = _sqlite3CorruptError(tls, int32(52363))
 18291  		goto _pager_acquire_err
 18292  	}
 18293  	*(**XPager)(unsafe.Pointer(&_pPg.XpPager)) = _pPager
 18294  	func() {
 18295  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil && _pPager.XmemDb != 0 {
 18296  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52369), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18417)))
 18297  			crt.X__builtin_abort(tls)
 18298  		}
 18299  	}()
 18300  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil && _pPager.XdbSize >= _pgno && _noContent == 0 {
 18301  		goto _32
 18302  	}
 18303  	if _pgno > _pPager.XmxPgno {
 18304  		_rc = int32(13)
 18305  		goto _pager_acquire_err
 18306  	}
 18307  	if _noContent == 0 {
 18308  		goto _34
 18309  	}
 18310  	_sqlite3BeginBenignMalloc(tls)
 18311  	if _pgno <= _pPager.XdbOrigSize {
 18312  		_rc = _sqlite3BitvecSet(tls, (*XBitvec)(_pPager.XpInJournal), _pgno)
 18313  	}
 18314  	_rc = _addToSavepointBitvecs(tls, _pPager, _pgno)
 18315  	_sqlite3EndBenignMalloc(tls)
 18316  _34:
 18317  	crt.Xmemset(tls, _pPg.XpData, int32(0), uint64(_pPager.XpageSize))
 18318  	goto _36
 18319  _32:
 18320  	_10_iFrame = uint32(0)
 18321  	if (*XWal)(_pPager.XpWal) == nil {
 18322  		goto _37
 18323  	}
 18324  	_rc = _sqlite3WalFindFrame(tls, (*XWal)(_pPager.XpWal), _pgno, &_10_iFrame)
 18325  	if _rc != int32(0) {
 18326  		goto _pager_acquire_err
 18327  	}
 18328  _37:
 18329  	func() {
 18330  		if (*XPager)(_pPg.XpPager) != _pPager {
 18331  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52399), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18447)))
 18332  			crt.X__builtin_abort(tls)
 18333  		}
 18334  	}()
 18335  	*elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), uintptr(1)) += 1
 18336  	_rc = _readDbPage(tls, _pPg, _10_iFrame)
 18337  	if _rc != int32(0) {
 18338  		goto _pager_acquire_err
 18339  	}
 18340  _36:
 18341  	return int32(0)
 18342  
 18343  _pager_acquire_err:
 18344  	func() {
 18345  		if _rc == int32(0) {
 18346  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52411), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18467)))
 18347  			crt.X__builtin_abort(tls)
 18348  		}
 18349  	}()
 18350  	if _pPg != nil {
 18351  		_sqlite3PcacheDrop(tls, _pPg)
 18352  	}
 18353  	_pagerUnlockIfUnused(tls, _pPager)
 18354  	*_ppPage = nil
 18355  	return _rc
 18356  }
 18357  
 18358  var _getPageNormalØ00__func__Ø000 [14]int8
 18359  
 18360  func init() {
 18361  	crt.Xstrncpy(nil, &_getPageNormalØ00__func__Ø000[0], str(18481), 14)
 18362  }
 18363  
 18364  // C comment
 18365  //  /*
 18366  //  ** If the sqlite3PcacheFetch() routine is unable to allocate a new
 18367  //  ** page because no clean pages are available for reuse and the cache
 18368  //  ** size limit has been reached, then this routine can be invoked to
 18369  //  ** try harder to allocate a page.  This routine might invoke the stress
 18370  //  ** callback to spill dirty pages to the journal.  It will then try to
 18371  //  ** allocate the new page and will only fail to allocate a new page on
 18372  //  ** an OOM error.
 18373  //  **
 18374  //  ** This routine should be invoked only after sqlite3PcacheFetch() fails.
 18375  //  */
 18376  func _sqlite3PcacheFetchStress(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _ppPage **Xsqlite3_pcache_page) (r0 int32) {
 18377  	var _3_rc int32
 18378  	var _pPg *XPgHdr
 18379  	if int32(_pCache.XeCreate) == int32(2) {
 18380  		return int32(0)
 18381  	}
 18382  	if _sqlite3PcachePagecount(tls, _pCache) <= _pCache.XszSpill {
 18383  		goto _1
 18384  	}
 18385  	_pPg = (*XPgHdr)(_pCache.XpSynced)
 18386  _2:
 18387  	if _pPg == nil || _pPg.XnRef == 0 && (int32(_pPg.Xflags)&int32(8)) == 0 {
 18388  		goto _7
 18389  	}
 18390  	_pPg = (*XPgHdr)(_pPg.XpDirtyPrev)
 18391  	goto _2
 18392  _7:
 18393  	*(**XPgHdr)(unsafe.Pointer(&_pCache.XpSynced)) = _pPg
 18394  	if _pPg != nil {
 18395  		goto _8
 18396  	}
 18397  	_pPg = (*XPgHdr)(_pCache.XpDirtyTail)
 18398  _9:
 18399  	if _pPg == nil || _pPg.XnRef == 0 {
 18400  		goto _13
 18401  	}
 18402  	_pPg = (*XPgHdr)(_pPg.XpDirtyPrev)
 18403  	goto _9
 18404  _13:
 18405  _8:
 18406  	if _pPg == nil {
 18407  		goto _14
 18408  	}
 18409  	_3_rc = func() func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32 {
 18410  		v := _pCache.XxStress
 18411  		return *(*func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32)(unsafe.Pointer(&v))
 18412  	}()(tls, _pCache.XpStress, _pPg)
 18413  	if (_3_rc != int32(0)) && (_3_rc != int32(5)) {
 18414  		return _3_rc
 18415  	}
 18416  _14:
 18417  _1:
 18418  	*_ppPage = func() func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page {
 18419  		v := _sqlite3Config.Xpcache2.XxFetch
 18420  		return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&v))
 18421  	}()(tls, _pCache.XpCache, _pgno, int32(2))
 18422  	return func() int32 {
 18423  		if (*_ppPage) == nil {
 18424  			return _sqlite3NomemError(tls, int32(44572))
 18425  		}
 18426  		return int32(0)
 18427  	}()
 18428  }
 18429  
 18430  // C comment
 18431  //  /*
 18432  //  ** Return the total number of pages in the cache.
 18433  //  */
 18434  func _sqlite3PcachePagecount(tls *crt.TLS, _pCache *XPCache) (r0 int32) {
 18435  	func() {
 18436  		if _pCache.XpCache == nil {
 18437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44922), unsafe.Pointer(&_sqlite3PcachePagecountØ00__func__Ø000), unsafe.Pointer(str(15913)))
 18438  			crt.X__builtin_abort(tls)
 18439  		}
 18440  	}()
 18441  	return (_sqlite3Config.Xpcache2.XxPagecount)(tls, _pCache.XpCache)
 18442  }
 18443  
 18444  var _sqlite3PcachePagecountØ00__func__Ø000 [23]int8
 18445  
 18446  func init() {
 18447  	crt.Xstrncpy(nil, &_sqlite3PcachePagecountØ00__func__Ø000[0], str(18495), 23)
 18448  }
 18449  
 18450  func _sqlite3OsFileControlHint(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) {
 18451  	func() func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32 {
 18452  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxFileControl
 18453  		return *(*func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&v))
 18454  	}()(tls, _id, _op, _pArg)
 18455  }
 18456  
 18457  // C comment
 18458  //  /*
 18459  //  ** Move the write position of the WAL back to the point identified by
 18460  //  ** the values in the aWalData[] array. aWalData must point to an array
 18461  //  ** of WAL_SAVEPOINT_NDATA u32 values that has been previously populated
 18462  //  ** by a call to WalSavepoint().
 18463  //  */
 18464  func _sqlite3WalSavepointUndo(tls *crt.TLS, _pWal *XWal, _aWalData *uint32) (r0 int32) {
 18465  	var _rc int32
 18466  	_rc = int32(0)
 18467  	func() {
 18468  		if _pWal.XwriteLock == 0 {
 18469  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57316), unsafe.Pointer(&_sqlite3WalSavepointUndoØ00__func__Ø000), unsafe.Pointer(str(15561)))
 18470  			crt.X__builtin_abort(tls)
 18471  		}
 18472  	}()
 18473  	func() {
 18474  		if (*elem31(_aWalData, uintptr(3))) == _pWal.XnCkpt && (*elem31(_aWalData, 0)) > (_pWal.Xhdr.XmxFrame) {
 18475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57317), unsafe.Pointer(&_sqlite3WalSavepointUndoØ00__func__Ø000), unsafe.Pointer(str(18518)))
 18476  			crt.X__builtin_abort(tls)
 18477  		}
 18478  	}()
 18479  	if (*elem31(_aWalData, uintptr(3))) != _pWal.XnCkpt {
 18480  		*elem31(_aWalData, 0) = 0
 18481  		*elem31(_aWalData, uintptr(3)) = _pWal.XnCkpt
 18482  	}
 18483  	if (*elem31(_aWalData, 0)) < (_pWal.Xhdr.XmxFrame) {
 18484  		_pWal.Xhdr.XmxFrame = *elem31(_aWalData, 0)
 18485  		*elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0) = *elem31(_aWalData, uintptr(1))
 18486  		*elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1)) = *elem31(_aWalData, uintptr(2))
 18487  		_walCleanupHash(tls, _pWal)
 18488  	}
 18489  	return _rc
 18490  }
 18491  
 18492  var _sqlite3WalSavepointUndoØ00__func__Ø000 [24]int8
 18493  
 18494  func init() {
 18495  	crt.Xstrncpy(nil, &_sqlite3WalSavepointUndoØ00__func__Ø000[0], str(18577), 24)
 18496  }
 18497  
 18498  // C comment
 18499  //  /*
 18500  //  ** This routine ends a transaction. A transaction is usually ended by
 18501  //  ** either a COMMIT or a ROLLBACK operation. This routine may be called
 18502  //  ** after rollback of a hot-journal, or if an error occurs while opening
 18503  //  ** the journal file or writing the very first journal-header of a
 18504  //  ** database transaction.
 18505  //  **
 18506  //  ** This routine is never called in PAGER_ERROR state. If it is called
 18507  //  ** in PAGER_NONE or PAGER_SHARED state and the lock held is less
 18508  //  ** exclusive than a RESERVED lock, it is a no-op.
 18509  //  **
 18510  //  ** Otherwise, any active savepoints are released.
 18511  //  **
 18512  //  ** If the journal file is open, then it is "finalized". Once a journal
 18513  //  ** file has been finalized it is not possible to use it to roll back a
 18514  //  ** transaction. Nor will it be considered to be a hot-journal by this
 18515  //  ** or any other database connection. Exactly how a journal is finalized
 18516  //  ** depends on whether or not the pager is running in exclusive mode and
 18517  //  ** the current journal-mode (Pager.journalMode value), as follows:
 18518  //  **
 18519  //  **   journalMode==MEMORY
 18520  //  **     Journal file descriptor is simply closed. This destroys an
 18521  //  **     in-memory journal.
 18522  //  **
 18523  //  **   journalMode==TRUNCATE
 18524  //  **     Journal file is truncated to zero bytes in size.
 18525  //  **
 18526  //  **   journalMode==PERSIST
 18527  //  **     The first 28 bytes of the journal file are zeroed. This invalidates
 18528  //  **     the first journal header in the file, and hence the entire journal
 18529  //  **     file. An invalid journal file cannot be rolled back.
 18530  //  **
 18531  //  **   journalMode==DELETE
 18532  //  **     The journal file is closed and deleted using sqlite3OsDelete().
 18533  //  **
 18534  //  **     If the pager is running in exclusive mode, this method of finalizing
 18535  //  **     the journal file is never used. Instead, if the journalMode is
 18536  //  **     DELETE and the pager is in exclusive mode, the method described under
 18537  //  **     journalMode==PERSIST is used instead.
 18538  //  **
 18539  //  ** After the journal is finalized, the pager moves to PAGER_READER state.
 18540  //  ** If running in non-exclusive rollback mode, the lock on the file is
 18541  //  ** downgraded to a SHARED_LOCK.
 18542  //  **
 18543  //  ** SQLITE_OK is returned if no error occurs. If an error occurs during
 18544  //  ** any of the IO operations to finalize the journal file or unlock the
 18545  //  ** database then the IO error code is returned to the user. If the
 18546  //  ** operation to finalize the journal file fails, then the code still
 18547  //  ** tries to unlock the database file if not in exclusive mode. If the
 18548  //  ** unlock operation fails as well, then the first error code related
 18549  //  ** to the first error encountered (the journal finalization one) is
 18550  //  ** returned.
 18551  //  */
 18552  func _pager_end_transaction(tls *crt.TLS, _pPager *XPager, _hasMaster int32, _bCommit int32) (r0 int32) {
 18553  	var _rc, _rc2, _9_bDelete int32
 18554  	_rc = int32(0)
 18555  	_rc2 = int32(0)
 18556  	func() {
 18557  		if _assert_pager_state(tls, _pPager) == 0 {
 18558  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48925), unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000), unsafe.Pointer(str(10971)))
 18559  			crt.X__builtin_abort(tls)
 18560  		}
 18561  	}()
 18562  	func() {
 18563  		if int32(_pPager.XeState) == int32(6) {
 18564  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48926), unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000), unsafe.Pointer(str(15019)))
 18565  			crt.X__builtin_abort(tls)
 18566  		}
 18567  	}()
 18568  	if (int32(_pPager.XeState) < int32(2)) && (int32(_pPager.XeLock) < int32(2)) {
 18569  		return int32(0)
 18570  	}
 18571  	_releaseAllSavepoints(tls, _pPager)
 18572  	func() {
 18573  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil && (*XBitvec)(_pPager.XpInJournal) != nil {
 18574  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48932), unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000), unsafe.Pointer(str(18601)))
 18575  			crt.X__builtin_abort(tls)
 18576  		}
 18577  	}()
 18578  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 18579  		goto _9
 18580  	}
 18581  	func() {
 18582  		if (*XWal)(_pPager.XpWal) != nil {
 18583  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48934), unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000), unsafe.Pointer(str(12123)))
 18584  			crt.X__builtin_abort(tls)
 18585  		}
 18586  	}()
 18587  	if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.Xjfd)) != 0 {
 18588  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 18589  		goto _24
 18590  	}
 18591  	if int32(_pPager.XjournalMode) != int32(3) {
 18592  		goto _14
 18593  	}
 18594  	if _pPager.XjournalOff == (0) {
 18595  		_rc = int32(0)
 18596  		goto _16
 18597  	}
 18598  	_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xjfd), 0)
 18599  	if (_rc == int32(0)) && (_pPager.XfullSync != 0) {
 18600  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xjfd), int32(_pPager.XsyncFlags))
 18601  	}
 18602  _16:
 18603  	_pPager.XjournalOff = 0
 18604  	goto _24
 18605  _14:
 18606  	if (int32(_pPager.XjournalMode) == int32(1)) || ((_pPager.XexclusiveMode != 0) && (int32(_pPager.XjournalMode) != int32(5))) {
 18607  		_rc = _zeroJournalHdr(tls, _pPager, bool2int(_hasMaster != 0 || (_pPager.XtempFile != 0)))
 18608  		_pPager.XjournalOff = 0
 18609  		goto _24
 18610  	}
 18611  	_9_bDelete = bool2int(_pPager.XtempFile == 0)
 18612  	func() {
 18613  		if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.Xjfd)) != int32(0) {
 18614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48967), unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000), unsafe.Pointer(str(18646)))
 18615  			crt.X__builtin_abort(tls)
 18616  		}
 18617  	}()
 18618  	func() {
 18619  		if int32(_pPager.XjournalMode) != int32(0) && int32(_pPager.XjournalMode) != int32(4) && int32(_pPager.XjournalMode) != int32(5) {
 18620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48968), unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000), unsafe.Pointer(str(18687)))
 18621  			crt.X__builtin_abort(tls)
 18622  		}
 18623  	}()
 18624  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 18625  	if _9_bDelete != 0 {
 18626  		_rc = _sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzJournal, int32(_pPager.XextraSync))
 18627  	}
 18628  _24:
 18629  _9:
 18630  	_sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.XpInJournal))
 18631  	*(**XBitvec)(unsafe.Pointer(&_pPager.XpInJournal)) = nil
 18632  	_pPager.XnRec = int32(0)
 18633  	if _rc != int32(0) {
 18634  		goto _32
 18635  	}
 18636  	if (_pPager.XmemDb != 0) || _pagerFlushOnCommit(tls, _pPager, _bCommit) != 0 {
 18637  		_sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.XpPCache))
 18638  		goto _35
 18639  	}
 18640  	_sqlite3PcacheClearWritable(tls, (*XPCache)(_pPager.XpPCache))
 18641  _35:
 18642  	_sqlite3PcacheTruncate(tls, (*XPCache)(_pPager.XpPCache), _pPager.XdbSize)
 18643  _32:
 18644  	if (*XWal)(_pPager.XpWal) != nil {
 18645  		_rc2 = _sqlite3WalEndWriteTransaction(tls, (*XWal)(_pPager.XpWal))
 18646  		func() {
 18647  			if _rc2 != int32(0) {
 18648  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49008), unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000), unsafe.Pointer(str(18828)))
 18649  				crt.X__builtin_abort(tls)
 18650  			}
 18651  		}()
 18652  		goto _42
 18653  	}
 18654  	if ((_rc == int32(0)) && _bCommit != 0) && (_pPager.XdbFileSize > _pPager.XdbSize) {
 18655  		func() {
 18656  			if int32(_pPager.XeLock) != int32(4) {
 18657  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49016), unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000), unsafe.Pointer(str(18843)))
 18658  				crt.X__builtin_abort(tls)
 18659  			}
 18660  		}()
 18661  		_rc = _pager_truncate(tls, _pPager, _pPager.XdbSize)
 18662  	}
 18663  _42:
 18664  	if _rc != int32(0) || _bCommit == 0 || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 18665  		goto _47
 18666  	}
 18667  	_rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(22), nil)
 18668  	if _rc == int32(12) {
 18669  		_rc = int32(0)
 18670  	}
 18671  _47:
 18672  	if (_pPager.XexclusiveMode == 0) && (((*XWal)(_pPager.XpWal) == nil) || _sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.XpWal), int32(0)) != 0) {
 18673  		_rc2 = _pagerUnlockDb(tls, _pPager, int32(1))
 18674  		_pPager.XchangeCountDone = 0
 18675  	}
 18676  	_pPager.XeState = uint8(1)
 18677  	_pPager.XsetMaster = 0
 18678  	return func() int32 {
 18679  		if _rc == int32(0) {
 18680  			return _rc2
 18681  		}
 18682  		return _rc
 18683  	}()
 18684  }
 18685  
 18686  var _pager_end_transactionØ00__func__Ø000 [22]int8
 18687  
 18688  func init() {
 18689  	crt.Xstrncpy(nil, &_pager_end_transactionØ00__func__Ø000[0], str(18873), 22)
 18690  }
 18691  
 18692  // C comment
 18693  //  /*
 18694  //  ** Free all structures in the Pager.aSavepoint[] array and set both
 18695  //  ** Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal
 18696  //  ** if it is open and the pager is not in exclusive mode.
 18697  //  */
 18698  func _releaseAllSavepoints(tls *crt.TLS, _pPager *XPager) {
 18699  	var _ii int32
 18700  	_ii = int32(0)
 18701  _0:
 18702  	if _ii >= _pPager.XnSavepoint {
 18703  		goto _3
 18704  	}
 18705  	_sqlite3BitvecDestroy(tls, (*XBitvec)(elem32((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_ii)).XpInSavepoint))
 18706  	_ii += 1
 18707  	goto _0
 18708  _3:
 18709  	if (_pPager.XexclusiveMode == 0) || _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.Xsjfd)) != 0 {
 18710  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xsjfd))
 18711  	}
 18712  	Xsqlite3_free(tls, _pPager.XaSavepoint)
 18713  	*(**XPagerSavepoint)(unsafe.Pointer(&_pPager.XaSavepoint)) = nil
 18714  	_pPager.XnSavepoint = int32(0)
 18715  	_pPager.XnSubRec = 0
 18716  }
 18717  
 18718  func _sqlite3OsSync(tls *crt.TLS, _id *Xsqlite3_file, _flags int32) (r0 int32) {
 18719  	return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 {
 18720  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxSync
 18721  		return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v))
 18722  	}()(tls, _id, _flags)
 18723  }
 18724  
 18725  // C comment
 18726  //  /*
 18727  //  ** The journal file must be open when this function is called.
 18728  //  **
 18729  //  ** This function is a no-op if the journal file has not been written to
 18730  //  ** within the current transaction (i.e. if Pager.journalOff==0).
 18731  //  **
 18732  //  ** If doTruncate is non-zero or the Pager.journalSizeLimit variable is
 18733  //  ** set to 0, then truncate the journal file to zero bytes in size. Otherwise,
 18734  //  ** zero the 28-byte header at the start of the journal file. In either case,
 18735  //  ** if the pager is not in no-sync mode, sync the journal file immediately
 18736  //  ** after writing or truncating it.
 18737  //  **
 18738  //  ** If Pager.journalSizeLimit is set to a positive, non-zero value, and
 18739  //  ** following the truncation or zeroing described above the size of the
 18740  //  ** journal file in bytes is larger than this value, then truncate the
 18741  //  ** journal file to Pager.journalSizeLimit bytes. The journal file does
 18742  //  ** not need to be synced following this operation.
 18743  //  **
 18744  //  ** If an IO error occurs, abandon processing and return the IO error code.
 18745  //  ** Otherwise, return SQLITE_OK.
 18746  //  */
 18747  func _zeroJournalHdr(tls *crt.TLS, _pPager *XPager, _doTruncate int32) (r0 int32) {
 18748  	var _rc int32
 18749  	var _1_iLimit, _5_sz int64
 18750  	_rc = int32(0)
 18751  	func() {
 18752  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 18753  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48287), unsafe.Pointer(&_zeroJournalHdrØ00__func__Ø000), unsafe.Pointer(str(13581)))
 18754  			crt.X__builtin_abort(tls)
 18755  		}
 18756  	}()
 18757  	func() {
 18758  		if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.Xjfd)) != 0 {
 18759  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48288), unsafe.Pointer(&_zeroJournalHdrØ00__func__Ø000), unsafe.Pointer(str(18895)))
 18760  			crt.X__builtin_abort(tls)
 18761  		}
 18762  	}()
 18763  	if _pPager.XjournalOff == 0 {
 18764  		goto _4
 18765  	}
 18766  	_1_iLimit = _pPager.XjournalSizeLimit
 18767  	if _doTruncate != 0 || (_1_iLimit == (0)) {
 18768  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xjfd), 0)
 18769  		goto _7
 18770  	}
 18771  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_zeroJournalHdrØ00zeroHdrØ001), int32(28), 0)
 18772  _7:
 18773  	if (_rc == int32(0)) && (_pPager.XnoSync == 0) {
 18774  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xjfd), int32(16)|int32(_pPager.XsyncFlags))
 18775  	}
 18776  	if _rc != int32(0) || _1_iLimit <= (0) {
 18777  		goto _11
 18778  	}
 18779  	_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xjfd), &_5_sz)
 18780  	if (_rc == int32(0)) && (_5_sz > _1_iLimit) {
 18781  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xjfd), _1_iLimit)
 18782  	}
 18783  _11:
 18784  _4:
 18785  	return _rc
 18786  }
 18787  
 18788  var _zeroJournalHdrØ00__func__Ø000 [15]int8
 18789  
 18790  func init() {
 18791  	crt.Xstrncpy(nil, &_zeroJournalHdrØ00__func__Ø000[0], str(18934), 15)
 18792  }
 18793  
 18794  var _zeroJournalHdrØ00zeroHdrØ001 [28]int8
 18795  
 18796  func _sqlite3OsDelete(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _dirSync int32) (r0 int32) {
 18797  	func() {
 18798  		if _dirSync != int32(0) && _dirSync != int32(1) {
 18799  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20297), unsafe.Pointer(&_sqlite3OsDeleteØ00__func__Ø000), unsafe.Pointer(str(18949)))
 18800  			crt.X__builtin_abort(tls)
 18801  		}
 18802  	}()
 18803  	return func() func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32 {
 18804  		v := _pVfs.XxDelete
 18805  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&v))
 18806  	}()(tls, _pVfs, _zPath, _dirSync)
 18807  }
 18808  
 18809  var _sqlite3OsDeleteØ00__func__Ø000 [16]int8
 18810  
 18811  func init() {
 18812  	crt.Xstrncpy(nil, &_sqlite3OsDeleteØ00__func__Ø000[0], str(18974), 16)
 18813  }
 18814  
 18815  // C comment
 18816  //  /*
 18817  //  ** The write transaction open on pPager is being committed (bCommit==1)
 18818  //  ** or rolled back (bCommit==0).
 18819  //  **
 18820  //  ** Return TRUE if and only if all dirty pages should be flushed to disk.
 18821  //  **
 18822  //  ** Rules:
 18823  //  **
 18824  //  **   *  For non-TEMP databases, always sync to disk.  This is necessary
 18825  //  **      for transactions to be durable.
 18826  //  **
 18827  //  **   *  Sync TEMP database only on a COMMIT (not a ROLLBACK) when the backing
 18828  //  **      file has been created already (via a spill on pagerStress()) and
 18829  //  **      when the number of dirty pages in memory exceeds 25% of the total
 18830  //  **      cache size.
 18831  //  */
 18832  func _pagerFlushOnCommit(tls *crt.TLS, _pPager *XPager, _bCommit int32) (r0 int32) {
 18833  	if int32(_pPager.XtempFile) == int32(0) {
 18834  		return int32(1)
 18835  	}
 18836  	if _bCommit == 0 {
 18837  		return int32(0)
 18838  	}
 18839  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 18840  		return int32(0)
 18841  	}
 18842  	return bool2int(_sqlite3PCachePercentDirty(tls, (*XPCache)(_pPager.XpPCache)) >= int32(25))
 18843  }
 18844  
 18845  // C comment
 18846  //  /*
 18847  //  ** Return the number of dirty pages currently in the cache, as a percentage
 18848  //  ** of the configured cache size.
 18849  //  */
 18850  func _sqlite3PCachePercentDirty(tls *crt.TLS, _pCache *XPCache) (r0 int32) {
 18851  	var _nDirty, _nCache int32
 18852  	var _pDirty *XPgHdr
 18853  	_nDirty = int32(0)
 18854  	_nCache = _numberOfCachePages(tls, _pCache)
 18855  	_pDirty = (*XPgHdr)(_pCache.XpDirty)
 18856  _0:
 18857  	if _pDirty == nil {
 18858  		goto _3
 18859  	}
 18860  	_nDirty += 1
 18861  	_pDirty = (*XPgHdr)(_pDirty.XpDirtyNext)
 18862  	goto _0
 18863  _3:
 18864  	return func() int32 {
 18865  		if _nCache != 0 {
 18866  			return int32((int64(_nDirty) * int64(100)) / int64(_nCache))
 18867  		}
 18868  		return int32(0)
 18869  	}()
 18870  }
 18871  
 18872  // C comment
 18873  //  /*
 18874  //  ** Make every page in the cache clean.
 18875  //  */
 18876  func _sqlite3PcacheCleanAll(tls *crt.TLS, _pCache *XPCache) {
 18877  	var _p *XPgHdr
 18878  _0:
 18879  	if store36(&_p, (*XPgHdr)(_pCache.XpDirty)) != nil {
 18880  		_sqlite3PcacheMakeClean(tls, _p)
 18881  		goto _0
 18882  	}
 18883  }
 18884  
 18885  // C comment
 18886  //  /*
 18887  //  ** Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages.
 18888  //  */
 18889  func _sqlite3PcacheClearWritable(tls *crt.TLS, _pCache *XPCache) {
 18890  	var _p *XPgHdr
 18891  	_p = (*XPgHdr)(_pCache.XpDirty)
 18892  _0:
 18893  	if _p == nil {
 18894  		goto _3
 18895  	}
 18896  	{
 18897  		p := &_p.Xflags
 18898  		*p = uint16(int32(*p) & int32(-13))
 18899  	}
 18900  	_p = (*XPgHdr)(_p.XpDirtyNext)
 18901  	goto _0
 18902  _3:
 18903  	*(**XPgHdr)(unsafe.Pointer(&_pCache.XpSynced)) = (*XPgHdr)(_pCache.XpDirtyTail)
 18904  }
 18905  
 18906  // C comment
 18907  //  /*
 18908  //  ** End a write transaction.  The commit has already been done.  This
 18909  //  ** routine merely releases the lock.
 18910  //  */
 18911  func _sqlite3WalEndWriteTransaction(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 18912  	if _pWal.XwriteLock != 0 {
 18913  		_walUnlockExclusive(tls, _pWal, int32(0), int32(1))
 18914  		_pWal.XwriteLock = 0
 18915  		_pWal.XiReCksum = 0
 18916  		_pWal.XtruncateOnCommit = 0
 18917  	}
 18918  	return int32(0)
 18919  }
 18920  
 18921  func _walUnlockExclusive(tls *crt.TLS, _pWal *XWal, _lockIdx int32, _n int32) {
 18922  	if _pWal.XexclusiveMode != 0 {
 18923  		return
 18924  	}
 18925  	_sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _lockIdx, _n, int32(9))
 18926  }
 18927  
 18928  func _sqlite3OsShmLock(tls *crt.TLS, _id *Xsqlite3_file, _offset int32, _n int32, _flags int32) (r0 int32) {
 18929  	return func() func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32 {
 18930  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxShmLock
 18931  		return *(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32)(unsafe.Pointer(&v))
 18932  	}()(tls, _id, _offset, _n, _flags)
 18933  }
 18934  
 18935  // C comment
 18936  //  /*
 18937  //  ** This function is used to change the actual size of the database
 18938  //  ** file in the file-system. This only happens when committing a transaction,
 18939  //  ** or rolling back a transaction (including rolling back a hot-journal).
 18940  //  **
 18941  //  ** If the main database file is not open, or the pager is not in either
 18942  //  ** DBMOD or OPEN state, this function is a no-op. Otherwise, the size
 18943  //  ** of the file is changed to nPage pages (nPage*pPager->pageSize bytes).
 18944  //  ** If the file on disk is currently larger than nPage pages, then use the VFS
 18945  //  ** xTruncate() method to truncate it.
 18946  //  **
 18947  //  ** Or, it might be the case that the file on disk is smaller than
 18948  //  ** nPage pages. Some operating system implementations can get confused if
 18949  //  ** you try to truncate a file to some size that is larger than it
 18950  //  ** currently is, so detect this case and write a single zero byte to
 18951  //  ** the end of the new file instead.
 18952  //  **
 18953  //  ** If successful, return SQLITE_OK. If an IO error occurs while modifying
 18954  //  ** the database file, return the error code to the caller.
 18955  //  */
 18956  func _pager_truncate(tls *crt.TLS, _pPager *XPager, _nPage uint32) (r0 int32) {
 18957  	var _rc, _1_szPage int32
 18958  	var _1_currentSize, _1_newSize int64
 18959  	var _4_pTmp *int8
 18960  	_rc = int32(0)
 18961  	func() {
 18962  		if int32(_pPager.XeState) == int32(6) {
 18963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49548), unsafe.Pointer(&_pager_truncateØ00__func__Ø000), unsafe.Pointer(str(15019)))
 18964  			crt.X__builtin_abort(tls)
 18965  		}
 18966  	}()
 18967  	func() {
 18968  		if int32(_pPager.XeState) == int32(1) {
 18969  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49549), unsafe.Pointer(&_pager_truncateØ00__func__Ø000), unsafe.Pointer(str(18990)))
 18970  			crt.X__builtin_abort(tls)
 18971  		}
 18972  	}()
 18973  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil || int32(_pPager.XeState) < int32(4) && int32(_pPager.XeState) != int32(0) {
 18974  		goto _6
 18975  	}
 18976  	_1_szPage = _pPager.XpageSize
 18977  	func() {
 18978  		if int32(_pPager.XeLock) != int32(4) {
 18979  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49556), unsafe.Pointer(&_pager_truncateØ00__func__Ø000), unsafe.Pointer(str(18843)))
 18980  			crt.X__builtin_abort(tls)
 18981  		}
 18982  	}()
 18983  	_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xfd), &_1_currentSize)
 18984  	_1_newSize = int64(_1_szPage) * int64(_nPage)
 18985  	if _rc != int32(0) || _1_currentSize == _1_newSize {
 18986  		goto _10
 18987  	}
 18988  	if _1_currentSize > _1_newSize {
 18989  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xfd), _1_newSize)
 18990  		goto _13
 18991  	}
 18992  	if (_1_currentSize + int64(_1_szPage)) <= _1_newSize {
 18993  		_4_pTmp = _pPager.XpTmpSpace
 18994  		crt.Xmemset(tls, unsafe.Pointer(_4_pTmp), int32(0), uint64(_1_szPage))
 18995  		_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xfd), unsafe.Pointer(_4_pTmp), _1_szPage, _1_newSize-int64(_1_szPage))
 18996  	}
 18997  _13:
 18998  	if _rc == int32(0) {
 18999  		_pPager.XdbFileSize = _nPage
 19000  	}
 19001  _10:
 19002  _6:
 19003  	return _rc
 19004  }
 19005  
 19006  var _pager_truncateØ00__func__Ø000 [15]int8
 19007  
 19008  func init() {
 19009  	crt.Xstrncpy(nil, &_pager_truncateØ00__func__Ø000[0], str(19019), 15)
 19010  }
 19011  
 19012  // C comment
 19013  //  /*
 19014  //  ** This function is called to change the WAL subsystem into or out
 19015  //  ** of locking_mode=EXCLUSIVE.
 19016  //  **
 19017  //  ** If op is zero, then attempt to change from locking_mode=EXCLUSIVE
 19018  //  ** into locking_mode=NORMAL.  This means that we must acquire a lock
 19019  //  ** on the pWal->readLock byte.  If the WAL is already in locking_mode=NORMAL
 19020  //  ** or if the acquisition of the lock fails, then return 0.  If the
 19021  //  ** transition out of exclusive-mode is successful, return 1.  This
 19022  //  ** operation must occur while the pager is still holding the exclusive
 19023  //  ** lock on the main database file.
 19024  //  **
 19025  //  ** If op is one, then change from locking_mode=NORMAL into
 19026  //  ** locking_mode=EXCLUSIVE.  This means that the pWal->readLock must
 19027  //  ** be released.  Return 1 if the transition is made and 0 if the
 19028  //  ** WAL is already in exclusive-locking mode - meaning that this
 19029  //  ** routine is a no-op.  The pager must already hold the exclusive lock
 19030  //  ** on the main database file before invoking this operation.
 19031  //  **
 19032  //  ** If op is negative, then do a dry-run of the op==1 case but do
 19033  //  ** not actually change anything. The pager uses this to see if it
 19034  //  ** should acquire the database exclusive lock prior to invoking
 19035  //  ** the op==1 case.
 19036  //  */
 19037  func _sqlite3WalExclusiveMode(tls *crt.TLS, _pWal *XWal, _op int32) (r0 int32) {
 19038  	var _rc int32
 19039  	func() {
 19040  		if int32(_pWal.XwriteLock) != int32(0) {
 19041  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57902), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(19034)))
 19042  			crt.X__builtin_abort(tls)
 19043  		}
 19044  	}()
 19045  	func() {
 19046  		if int32(_pWal.XexclusiveMode) == int32(2) && _op != int32(-1) {
 19047  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57903), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(19053)))
 19048  			crt.X__builtin_abort(tls)
 19049  		}
 19050  	}()
 19051  	func() {
 19052  		if int32(_pWal.XreadLock) < int32(0) && _pWal.XlockError == 0 {
 19053  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57911), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(16324)))
 19054  			crt.X__builtin_abort(tls)
 19055  		}
 19056  	}()
 19057  	func() {
 19058  		if int32(_pWal.XreadLock) < int32(0) && (_op > int32(0) || int32(_pWal.XexclusiveMode) != int32(0)) {
 19059  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57912), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(19104)))
 19060  			crt.X__builtin_abort(tls)
 19061  		}
 19062  	}()
 19063  	if _op != int32(0) {
 19064  		goto _12
 19065  	}
 19066  	if _pWal.XexclusiveMode == 0 {
 19067  		goto _13
 19068  	}
 19069  	_pWal.XexclusiveMode = 0
 19070  	if _walLockShared(tls, _pWal, int32(3)+int32(_pWal.XreadLock)) != int32(0) {
 19071  		_pWal.XexclusiveMode = uint8(1)
 19072  	}
 19073  	_rc = bool2int(int32(_pWal.XexclusiveMode) == int32(0))
 19074  	goto _15
 19075  _13:
 19076  	_rc = int32(0)
 19077  _15:
 19078  	goto _22
 19079  _12:
 19080  	if _op > int32(0) {
 19081  		func() {
 19082  			if int32(_pWal.XexclusiveMode) != int32(0) {
 19083  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57926), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(19159)))
 19084  				crt.X__builtin_abort(tls)
 19085  			}
 19086  		}()
 19087  		func() {
 19088  			if int32(_pWal.XreadLock) < int32(0) {
 19089  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57927), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(19182)))
 19090  				crt.X__builtin_abort(tls)
 19091  			}
 19092  		}()
 19093  		_walUnlockShared(tls, _pWal, int32(3)+int32(_pWal.XreadLock))
 19094  		_pWal.XexclusiveMode = uint8(1)
 19095  		_rc = int32(1)
 19096  		goto _22
 19097  	}
 19098  	_rc = bool2int(int32(_pWal.XexclusiveMode) == int32(0))
 19099  _22:
 19100  	return _rc
 19101  }
 19102  
 19103  var _sqlite3WalExclusiveModeØ00__func__Ø000 [24]int8
 19104  
 19105  func init() {
 19106  	crt.Xstrncpy(nil, &_sqlite3WalExclusiveModeØ00__func__Ø000[0], str(19200), 24)
 19107  }
 19108  
 19109  // C comment
 19110  //  /*
 19111  //  ** Set or release locks on the WAL.  Locks are either shared or exclusive.
 19112  //  ** A lock cannot be moved directly between shared and exclusive - it must go
 19113  //  ** through the unlocked state first.
 19114  //  **
 19115  //  ** In locking_mode=EXCLUSIVE, all of these routines become no-ops.
 19116  //  */
 19117  func _walLockShared(tls *crt.TLS, _pWal *XWal, _lockIdx int32) (r0 int32) {
 19118  	var _rc int32
 19119  	if _pWal.XexclusiveMode != 0 {
 19120  		return int32(0)
 19121  	}
 19122  	_rc = _sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _lockIdx, int32(1), int32(6))
 19123  	_pWal.XlockError = uint8(bool2int((_rc != int32(0)) && (_rc != int32(5))))
 19124  	return _rc
 19125  }
 19126  
 19127  func _walUnlockShared(tls *crt.TLS, _pWal *XWal, _lockIdx int32) {
 19128  	if _pWal.XexclusiveMode != 0 {
 19129  		return
 19130  	}
 19131  	_sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _lockIdx, int32(1), int32(5))
 19132  }
 19133  
 19134  // C comment
 19135  //  /*
 19136  //  ** Unlock the database file to level eLock, which must be either NO_LOCK
 19137  //  ** or SHARED_LOCK. Regardless of whether or not the call to xUnlock()
 19138  //  ** succeeds, set the Pager.eLock variable to match the (attempted) new lock.
 19139  //  **
 19140  //  ** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is
 19141  //  ** called, do not modify it. See the comment above the #define of
 19142  //  ** UNKNOWN_LOCK for an explanation of this.
 19143  //  */
 19144  func _pagerUnlockDb(tls *crt.TLS, _pPager *XPager, _eLock int32) (r0 int32) {
 19145  	var _rc int32
 19146  	_rc = int32(0)
 19147  	func() {
 19148  		if _pPager.XexclusiveMode != 0 && int32(_pPager.XeLock) != _eLock {
 19149  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48049), unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000), unsafe.Pointer(str(19224)))
 19150  			crt.X__builtin_abort(tls)
 19151  		}
 19152  	}()
 19153  	func() {
 19154  		if _eLock != int32(0) && _eLock != int32(1) {
 19155  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48050), unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000), unsafe.Pointer(str(19271)))
 19156  			crt.X__builtin_abort(tls)
 19157  		}
 19158  	}()
 19159  	func() {
 19160  		if _eLock == int32(0) && bool2int((*XWal)(_pPager.XpWal) != nil) != int32(0) {
 19161  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48051), unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000), unsafe.Pointer(str(19308)))
 19162  			crt.X__builtin_abort(tls)
 19163  		}
 19164  	}()
 19165  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 19166  		goto _9
 19167  	}
 19168  	func() {
 19169  		if int32(_pPager.XeLock) < _eLock {
 19170  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48053), unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000), unsafe.Pointer(str(19349)))
 19171  			crt.X__builtin_abort(tls)
 19172  		}
 19173  	}()
 19174  	_rc = func() int32 {
 19175  		if _pPager.XnoLock != 0 {
 19176  			return int32(0)
 19177  		}
 19178  		return _sqlite3OsUnlock(tls, (*Xsqlite3_file)(_pPager.Xfd), _eLock)
 19179  	}()
 19180  	if int32(_pPager.XeLock) != int32(5) {
 19181  		_pPager.XeLock = uint8(_eLock)
 19182  	}
 19183  _9:
 19184  	return _rc
 19185  }
 19186  
 19187  var _pagerUnlockDbØ00__func__Ø000 [14]int8
 19188  
 19189  func init() {
 19190  	crt.Xstrncpy(nil, &_pagerUnlockDbØ00__func__Ø000[0], str(19370), 14)
 19191  }
 19192  
 19193  func _sqlite3OsUnlock(tls *crt.TLS, _id *Xsqlite3_file, _lockType int32) (r0 int32) {
 19194  	return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 {
 19195  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxUnlock
 19196  		return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v))
 19197  	}()(tls, _id, _lockType)
 19198  }
 19199  
 19200  // C comment
 19201  //  /*
 19202  //  ** Playback the journal and thus restore the database file to
 19203  //  ** the state it was in before we started making changes.
 19204  //  **
 19205  //  ** The journal file format is as follows:
 19206  //  **
 19207  //  **  (1)  8 byte prefix.  A copy of aJournalMagic[].
 19208  //  **  (2)  4 byte big-endian integer which is the number of valid page records
 19209  //  **       in the journal.  If this value is 0xffffffff, then compute the
 19210  //  **       number of page records from the journal size.
 19211  //  **  (3)  4 byte big-endian integer which is the initial value for the
 19212  //  **       sanity checksum.
 19213  //  **  (4)  4 byte integer which is the number of pages to truncate the
 19214  //  **       database to during a rollback.
 19215  //  **  (5)  4 byte big-endian integer which is the sector size.  The header
 19216  //  **       is this many bytes in size.
 19217  //  **  (6)  4 byte big-endian integer which is the page size.
 19218  //  **  (7)  zero padding out to the next sector size.
 19219  //  **  (8)  Zero or more pages instances, each as follows:
 19220  //  **        +  4 byte page number.
 19221  //  **        +  pPager->pageSize bytes of data.
 19222  //  **        +  4 byte checksum
 19223  //  **
 19224  //  ** When we speak of the journal header, we mean the first 7 items above.
 19225  //  ** Each entry in the journal is an instance of the 8th item.
 19226  //  **
 19227  //  ** Call the value from the second bullet "nRec".  nRec is the number of
 19228  //  ** valid page entries in the journal.  In most cases, you can compute the
 19229  //  ** value of nRec from the size of the journal file.  But if a power
 19230  //  ** failure occurred while the journal was being written, it could be the
 19231  //  ** case that the size of the journal file had already been increased but
 19232  //  ** the extra entries had not yet made it safely to disk.  In such a case,
 19233  //  ** the value of nRec computed from the file size would be too large.  For
 19234  //  ** that reason, we always use the nRec value in the header.
 19235  //  **
 19236  //  ** If the nRec value is 0xffffffff it means that nRec should be computed
 19237  //  ** from the file size.  This value is used when the user selects the
 19238  //  ** no-sync option for the journal.  A power failure could lead to corruption
 19239  //  ** in this case.  But for things like temporary table (which will be
 19240  //  ** deleted when the power is restored) we don't care.
 19241  //  **
 19242  //  ** If the file opened as the journal file is not a well-formed
 19243  //  ** journal file then all pages up to the first corrupted page are rolled
 19244  //  ** back (or no pages if the journal header is corrupted). The journal file
 19245  //  ** is then deleted and SQLITE_OK returned, just as if no corruption had
 19246  //  ** been encountered.
 19247  //  **
 19248  //  ** If an I/O or malloc() error occurs, the journal-file is not deleted
 19249  //  ** and an error code is returned.
 19250  //  **
 19251  //  ** The isHot parameter indicates that we are trying to rollback a journal
 19252  //  ** that might be a hot journal.  Or, it could be that the journal is
 19253  //  ** preserved because of JOURNALMODE_PERSIST or JOURNALMODE_TRUNCATE.
 19254  //  ** If the journal really is hot, reset the pager cache prior rolling
 19255  //  ** back any content.  If the journal is merely persistent, no reset is
 19256  //  ** needed.
 19257  //  */
 19258  func _pager_playback(tls *crt.TLS, _pPager *XPager, _isHot int32) (r0 int32) {
 19259  	var _rc, _res, _needPagerReset, _nPlayback int32
 19260  	var _szJ int64
 19261  	var _nRec, _u, _mxPg uint32
 19262  	var _zMaster *int8
 19263  	var _pVfs *Xsqlite3_vfs
 19264  	_pVfs = (*Xsqlite3_vfs)(_pPager.XpVfs)
 19265  	_mxPg = uint32(0)
 19266  	_res = int32(1)
 19267  	_zMaster = nil
 19268  	_nPlayback = int32(0)
 19269  	func() {
 19270  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 19271  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49704), unsafe.Pointer(&_pager_playbackØ00__func__Ø000), unsafe.Pointer(str(13581)))
 19272  			crt.X__builtin_abort(tls)
 19273  		}
 19274  	}()
 19275  	_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xjfd), &_szJ)
 19276  	if _rc != int32(0) {
 19277  		goto _end_playback
 19278  	}
 19279  	_zMaster = _pPager.XpTmpSpace
 19280  	_rc = _readMasterJournal(tls, (*Xsqlite3_file)(_pPager.Xjfd), _zMaster, uint32(((*Xsqlite3_vfs)(_pPager.XpVfs).XmxPathname)+int32(1)))
 19281  	if (_rc == int32(0)) && ((*elem1(_zMaster, 0)) != 0) {
 19282  		_rc = _sqlite3OsAccess(tls, _pVfs, _zMaster, int32(0), &_res)
 19283  	}
 19284  	_zMaster = nil
 19285  	if (_rc != int32(0)) || (_res == 0) {
 19286  		goto _end_playback
 19287  	}
 19288  	_pPager.XjournalOff = 0
 19289  	_needPagerReset = _isHot
 19290  _7:
 19291  	_rc = _readJournalHdr(tls, _pPager, _isHot, _szJ, &_nRec, &_mxPg)
 19292  	if _rc == int32(0) {
 19293  		goto _9
 19294  	}
 19295  	if _rc == int32(101) {
 19296  		_rc = int32(0)
 19297  	}
 19298  	goto _end_playback
 19299  _9:
 19300  	if _nRec == uint32(4294967295) {
 19301  		func() {
 19302  			if _pPager.XjournalOff != int64(_pPager.XsectorSize) {
 19303  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49757), unsafe.Pointer(&_pager_playbackØ00__func__Ø000), unsafe.Pointer(str(19384)))
 19304  				crt.X__builtin_abort(tls)
 19305  			}
 19306  		}()
 19307  		_nRec = uint32(int32((_szJ - int64(_pPager.XsectorSize)) / int64(_pPager.XpageSize+int32(8))))
 19308  	}
 19309  	if ((_nRec == (0)) && (_isHot == 0)) && ((_pPager.XjournalHdr + int64(_pPager.XsectorSize)) == _pPager.XjournalOff) {
 19310  		_nRec = uint32(int32((_szJ - _pPager.XjournalOff) / int64(_pPager.XpageSize+int32(8))))
 19311  	}
 19312  	if _pPager.XjournalOff != int64(_pPager.XsectorSize) {
 19313  		goto _17
 19314  	}
 19315  	_rc = _pager_truncate(tls, _pPager, _mxPg)
 19316  	if _rc != int32(0) {
 19317  		goto _end_playback
 19318  	}
 19319  	_pPager.XdbSize = _mxPg
 19320  _17:
 19321  	_u = 0
 19322  _19:
 19323  	if _u >= _nRec {
 19324  		goto _22
 19325  	}
 19326  	if _needPagerReset != 0 {
 19327  		_pager_reset(tls, _pPager)
 19328  		_needPagerReset = int32(0)
 19329  	}
 19330  	_rc = _pager_playback_one_page(tls, _pPager, &_pPager.XjournalOff, nil, int32(1), int32(0))
 19331  	if _rc == int32(0) {
 19332  		_nPlayback += 1
 19333  		goto _25
 19334  	}
 19335  	if _rc == int32(101) {
 19336  		_pPager.XjournalOff = _szJ
 19337  		goto _22
 19338  	}
 19339  	if _rc == int32(522) {
 19340  		_rc = int32(0)
 19341  		goto _end_playback
 19342  	}
 19343  	goto _end_playback
 19344  _25:
 19345  	_u += 1
 19346  	goto _19
 19347  _22:
 19348  	goto _7
 19349  _end_playback:
 19350  	if ((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil {
 19351  		_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(-905363552), nil)
 19352  	}
 19353  	_pPager.XchangeCountDone = _pPager.XtempFile
 19354  	if _rc == int32(0) {
 19355  		_zMaster = _pPager.XpTmpSpace
 19356  		_rc = _readMasterJournal(tls, (*Xsqlite3_file)(_pPager.Xjfd), _zMaster, uint32(((*Xsqlite3_vfs)(_pPager.XpVfs).XmxPathname)+int32(1)))
 19357  	}
 19358  	if (_rc == int32(0)) && ((int32(_pPager.XeState) >= int32(4)) || (int32(_pPager.XeState) == int32(0))) {
 19359  		_rc = _sqlite3PagerSync(tls, _pPager, nil)
 19360  	}
 19361  	if _rc == int32(0) {
 19362  		_rc = _pager_end_transaction(tls, _pPager, bool2int(int32(*elem1(_zMaster, 0)) != int32(0)), int32(0))
 19363  	}
 19364  	if ((_rc == int32(0)) && ((*elem1(_zMaster, 0)) != 0)) && _res != 0 {
 19365  		_rc = _pager_delmaster(tls, _pPager, _zMaster)
 19366  	}
 19367  	if _isHot != 0 && _nPlayback != 0 {
 19368  		Xsqlite3_log(tls, int32(539), str(19427), _nPlayback, unsafe.Pointer(_pPager.XzJournal))
 19369  	}
 19370  	_setSectorSize(tls, _pPager)
 19371  	return _rc
 19372  }
 19373  
 19374  var _pager_playbackØ00__func__Ø000 [15]int8
 19375  
 19376  func init() {
 19377  	crt.Xstrncpy(nil, &_pager_playbackØ00__func__Ø000[0], str(19454), 15)
 19378  }
 19379  
 19380  // C comment
 19381  //  /*
 19382  //  ** When this is called the journal file for pager pPager must be open.
 19383  //  ** This function attempts to read a master journal file name from the
 19384  //  ** end of the file and, if successful, copies it into memory supplied
 19385  //  ** by the caller. See comments above writeMasterJournal() for the format
 19386  //  ** used to store a master journal file name at the end of a journal file.
 19387  //  **
 19388  //  ** zMaster must point to a buffer of at least nMaster bytes allocated by
 19389  //  ** the caller. This should be sqlite3_vfs.mxPathname+1 (to ensure there is
 19390  //  ** enough space to write the master journal name). If the master journal
 19391  //  ** name in the journal is longer than nMaster bytes (including a
 19392  //  ** nul-terminator), then this is handled as if no master journal name
 19393  //  ** were present in the journal.
 19394  //  **
 19395  //  ** If a master journal file name is present at the end of the journal
 19396  //  ** file, then it is copied into the buffer pointed to by zMaster. A
 19397  //  ** nul-terminator byte is appended to the buffer following the master
 19398  //  ** journal file name.
 19399  //  **
 19400  //  ** If it is determined that no master journal file name is present
 19401  //  ** zMaster[0] is set to 0 and SQLITE_OK returned.
 19402  //  **
 19403  //  ** If an error occurs while reading from the journal file, an SQLite
 19404  //  ** error code is returned.
 19405  //  */
 19406  func _readMasterJournal(tls *crt.TLS, _pJrnl *Xsqlite3_file, _zMaster *int8, _nMaster uint32) (r0 int32) {
 19407  	var _rc int32
 19408  	var _szJ int64
 19409  	var _len, _cksum, _u uint32
 19410  	var _aMagic [8]uint8
 19411  	*elem1(_zMaster, 0) = 0
 19412  	if ((((((((int32(0) != store2(&_rc, _sqlite3OsFileSize(tls, _pJrnl, &_szJ))) || (_szJ < int64(16))) || (int32(0) != store2(&_rc, _read32bits(tls, _pJrnl, _szJ-int64(16), &_len)))) || (_len >= _nMaster)) || (_len == (0))) || (int32(0) != store2(&_rc, _read32bits(tls, _pJrnl, _szJ-int64(12), &_cksum)))) || (int32(0) != store2(&_rc, _sqlite3OsRead(tls, _pJrnl, unsafe.Pointer(&_aMagic), int32(8), _szJ-int64(8))))) || crt.Xmemcmp(tls, unsafe.Pointer(&_aMagic), unsafe.Pointer(&_aJournalMagic), uint64(8)) != 0) || (int32(0) != store2(&_rc, _sqlite3OsRead(tls, _pJrnl, unsafe.Pointer(_zMaster), int32(_len), (_szJ-int64(16))-int64(_len)))) {
 19413  		return _rc
 19414  	}
 19415  	_u = 0
 19416  _9:
 19417  	if _u >= _len {
 19418  		goto _12
 19419  	}
 19420  	_cksum -= uint32(*elem1(_zMaster, uintptr(_u)))
 19421  	_u += 1
 19422  	goto _9
 19423  _12:
 19424  	if _cksum != 0 {
 19425  		_len = 0
 19426  	}
 19427  	*elem1(_zMaster, uintptr(_len)) = 0
 19428  	return int32(0)
 19429  
 19430  	_ = _aMagic
 19431  	panic(0)
 19432  }
 19433  
 19434  func _sqlite3OsAccess(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _flags int32, _pResOut *int32) (r0 int32) {
 19435  	return func() func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32 {
 19436  		v := _pVfs.XxAccess
 19437  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&v))
 19438  	}()(tls, _pVfs, _zPath, _flags, _pResOut)
 19439  }
 19440  
 19441  // C comment
 19442  //  /*
 19443  //  ** Sync the database file to disk. This is a no-op for in-memory databases
 19444  //  ** or pages with the Pager.noSync flag set.
 19445  //  **
 19446  //  ** If successful, or if called on a pager for which it is a no-op, this
 19447  //  ** function returns SQLITE_OK. Otherwise, an IO error code is returned.
 19448  //  */
 19449  func _sqlite3PagerSync(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) {
 19450  	var _rc int32
 19451  	var _1_pArg unsafe.Pointer
 19452  	_rc = int32(0)
 19453  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 19454  		goto _0
 19455  	}
 19456  	_1_pArg = unsafe.Pointer(_zMaster)
 19457  	_rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(21), _1_pArg)
 19458  	if _rc == int32(12) {
 19459  		_rc = int32(0)
 19460  	}
 19461  _0:
 19462  	if (_rc == int32(0)) && (_pPager.XnoSync == 0) {
 19463  		func() {
 19464  			if _pPager.XmemDb != 0 {
 19465  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53162), unsafe.Pointer(&_sqlite3PagerSyncØ00__func__Ø000), unsafe.Pointer(str(11702)))
 19466  				crt.X__builtin_abort(tls)
 19467  			}
 19468  		}()
 19469  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(_pPager.XsyncFlags))
 19470  	}
 19471  	return _rc
 19472  }
 19473  
 19474  var _sqlite3PagerSyncØ00__func__Ø000 [17]int8
 19475  
 19476  func init() {
 19477  	crt.Xstrncpy(nil, &_sqlite3PagerSyncØ00__func__Ø000[0], str(19469), 17)
 19478  }
 19479  
 19480  // C comment
 19481  //  /*
 19482  //  ** Parameter zMaster is the name of a master journal file. A single journal
 19483  //  ** file that referred to the master journal file has just been rolled back.
 19484  //  ** This routine checks if it is possible to delete the master journal file,
 19485  //  ** and does so if it is.
 19486  //  **
 19487  //  ** Argument zMaster may point to Pager.pTmpSpace. So that buffer is not
 19488  //  ** available for use within this function.
 19489  //  **
 19490  //  ** When a master journal file is created, it is populated with the names
 19491  //  ** of all of its child journals, one after another, formatted as utf-8
 19492  //  ** encoded text. The end of each child journal file is marked with a
 19493  //  ** nul-terminator byte (0x00). i.e. the entire contents of a master journal
 19494  //  ** file for a transaction involving two databases might be:
 19495  //  **
 19496  //  **   "/home/bill/a.db-journal\x00/home/bill/b.db-journal\x00"
 19497  //  **
 19498  //  ** A master journal file may only be deleted once all of its child
 19499  //  ** journals have been rolled back.
 19500  //  **
 19501  //  ** This function reads the contents of the master-journal file into
 19502  //  ** memory and loops through each of the child journal names. For
 19503  //  ** each child journal, it checks if:
 19504  //  **
 19505  //  **   * if the child journal exists, and if so
 19506  //  **   * if the child journal contains a reference to master journal
 19507  //  **     file zMaster
 19508  //  **
 19509  //  ** If a child journal can be found that matches both of the criteria
 19510  //  ** above, this function returns without doing anything. Otherwise, if
 19511  //  ** no such child journal can be found, file zMaster is deleted from
 19512  //  ** the file-system using sqlite3OsDelete().
 19513  //  **
 19514  //  ** If an IO error within this function, an error code is returned. This
 19515  //  ** function allocates memory by calling sqlite3Malloc(). If an allocation
 19516  //  ** fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors
 19517  //  ** occur, SQLITE_OK is returned.
 19518  //  **
 19519  //  ** TODO: This function allocates a single block of memory to load
 19520  //  ** the entire contents of the master journal file. This could be
 19521  //  ** a couple of kilobytes or so - potentially larger than the page
 19522  //  ** size.
 19523  //  */
 19524  func _pager_delmaster(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) {
 19525  	var _rc, _nMasterPtr, _2_flags, _4_exists, _6_c, _6_flags int32
 19526  	var _nMasterJournal int64
 19527  	var _zMasterJournal, _zJournal, _zMasterPtr *int8
 19528  	var _pMaster, _pJournal *Xsqlite3_file
 19529  	var _pVfs *Xsqlite3_vfs
 19530  	_pVfs = (*Xsqlite3_vfs)(_pPager.XpVfs)
 19531  	_zMasterJournal = nil
 19532  	_pMaster = (*Xsqlite3_file)(_sqlite3MallocZero(tls, uint64(_pVfs.XszOsFile*int32(2))))
 19533  	_pJournal = (*Xsqlite3_file)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMaster)) + uintptr(_pVfs.XszOsFile)))))
 19534  	if _pMaster == nil {
 19535  		_rc = _sqlite3NomemError(tls, int32(49453))
 19536  		goto _1
 19537  	}
 19538  	_2_flags = int32(16385)
 19539  	_rc = _sqlite3OsOpen(tls, _pVfs, _zMaster, _pMaster, _2_flags, nil)
 19540  _1:
 19541  	if _rc != int32(0) {
 19542  		goto _delmaster_out
 19543  	}
 19544  	_rc = _sqlite3OsFileSize(tls, _pMaster, &_nMasterJournal)
 19545  	if _rc != int32(0) {
 19546  		goto _delmaster_out
 19547  	}
 19548  	_nMasterPtr = _pVfs.XmxPathname + int32(1)
 19549  	_zMasterJournal = (*int8)(_sqlite3Malloc(tls, uint64((_nMasterJournal+int64(_nMasterPtr))+int64(1))))
 19550  	if _zMasterJournal == nil {
 19551  		_rc = _sqlite3NomemError(tls, int32(49470))
 19552  		goto _delmaster_out
 19553  	}
 19554  	_zMasterPtr = elem1(_zMasterJournal, uintptr(_nMasterJournal+int64(1)))
 19555  	_rc = _sqlite3OsRead(tls, _pMaster, unsafe.Pointer(_zMasterJournal), int32(_nMasterJournal), 0)
 19556  	if _rc != int32(0) {
 19557  		goto _delmaster_out
 19558  	}
 19559  	*elem1(_zMasterJournal, uintptr(_nMasterJournal)) = 0
 19560  	_zJournal = _zMasterJournal
 19561  _6:
 19562  	if int64(uintptr(unsafe.Pointer(_zJournal))-uintptr(unsafe.Pointer(_zMasterJournal))) >= _nMasterJournal {
 19563  		goto _7
 19564  	}
 19565  	_rc = _sqlite3OsAccess(tls, _pVfs, _zJournal, int32(0), &_4_exists)
 19566  	if _rc != int32(0) {
 19567  		goto _delmaster_out
 19568  	}
 19569  	if _4_exists == 0 {
 19570  		goto _9
 19571  	}
 19572  	_6_flags = int32(2049)
 19573  	_rc = _sqlite3OsOpen(tls, _pVfs, _zJournal, _pJournal, _6_flags, nil)
 19574  	if _rc != int32(0) {
 19575  		goto _delmaster_out
 19576  	}
 19577  	_rc = _readMasterJournal(tls, _pJournal, _zMasterPtr, uint32(_nMasterPtr))
 19578  	_sqlite3OsClose(tls, _pJournal)
 19579  	if _rc != int32(0) {
 19580  		goto _delmaster_out
 19581  	}
 19582  	_6_c = bool2int((int32(*elem1(_zMasterPtr, 0)) != int32(0)) && (crt.Xstrcmp(tls, _zMasterPtr, _zMaster) == int32(0)))
 19583  	if _6_c != 0 {
 19584  		goto _delmaster_out
 19585  	}
 19586  _9:
 19587  	*(*uintptr)(unsafe.Pointer(&_zJournal)) += uintptr(_sqlite3Strlen30(tls, _zJournal) + int32(1))
 19588  	goto _6
 19589  _7:
 19590  	_sqlite3OsClose(tls, _pMaster)
 19591  	_rc = _sqlite3OsDelete(tls, _pVfs, _zMaster, int32(0))
 19592  _delmaster_out:
 19593  	Xsqlite3_free(tls, unsafe.Pointer(_zMasterJournal))
 19594  	if _pMaster != nil {
 19595  		_sqlite3OsClose(tls, _pMaster)
 19596  		func() {
 19597  			if (*Xsqlite3_io_methods)(_pJournal.XpMethods) != nil {
 19598  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49519), unsafe.Pointer(&_pager_delmasterØ00__func__Ø000), unsafe.Pointer(str(19486)))
 19599  				crt.X__builtin_abort(tls)
 19600  			}
 19601  		}()
 19602  		Xsqlite3_free(tls, unsafe.Pointer(_pMaster))
 19603  	}
 19604  	return _rc
 19605  }
 19606  
 19607  var _pager_delmasterØ00__func__Ø000 [16]int8
 19608  
 19609  func init() {
 19610  	crt.Xstrncpy(nil, &_pager_delmasterØ00__func__Ø000[0], str(19504), 16)
 19611  }
 19612  
 19613  // C comment
 19614  //  /*
 19615  //  ** Set the value of the Pager.sectorSize variable for the given
 19616  //  ** pager based on the value returned by the xSectorSize method
 19617  //  ** of the open database file. The sector size will be used
 19618  //  ** to determine the size and alignment of journal header and
 19619  //  ** master journal pointers within created journal files.
 19620  //  **
 19621  //  ** For temporary files the effective sector size is always 512 bytes.
 19622  //  **
 19623  //  ** Otherwise, for non-temporary files, the effective sector size is
 19624  //  ** the value returned by the xSectorSize() method rounded up to 32 if
 19625  //  ** it is less than 32, or rounded down to MAX_SECTOR_SIZE if it
 19626  //  ** is greater than MAX_SECTOR_SIZE.
 19627  //  **
 19628  //  ** If the file has the SQLITE_IOCAP_POWERSAFE_OVERWRITE property, then set
 19629  //  ** the effective sector size to its minimum value (512).  The purpose of
 19630  //  ** pPager->sectorSize is to define the "blast radius" of bytes that
 19631  //  ** might change if a crash occurs while writing to a single byte in
 19632  //  ** that range.  But with POWERSAFE_OVERWRITE, the blast radius is zero
 19633  //  ** (that is what POWERSAFE_OVERWRITE means), so we minimize the sector
 19634  //  ** size.  For backwards compatibility of the rollback journal file format,
 19635  //  ** we cannot reduce the effective sector size below 512.
 19636  //  */
 19637  func _setSectorSize(tls *crt.TLS, _pPager *XPager) {
 19638  	func() {
 19639  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _pPager.XtempFile == 0 {
 19640  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49617), unsafe.Pointer(&_setSectorSizeØ00__func__Ø000), unsafe.Pointer(str(19520)))
 19641  			crt.X__builtin_abort(tls)
 19642  		}
 19643  	}()
 19644  	if (_pPager.XtempFile != 0) || ((_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xfd)) & int32(4096)) != int32(0)) {
 19645  		_pPager.XsectorSize = uint32(512)
 19646  		goto _5
 19647  	}
 19648  	_pPager.XsectorSize = uint32(_sqlite3SectorSize(tls, (*Xsqlite3_file)(_pPager.Xfd)))
 19649  _5:
 19650  }
 19651  
 19652  var _setSectorSizeØ00__func__Ø000 [14]int8
 19653  
 19654  func init() {
 19655  	crt.Xstrncpy(nil, &_setSectorSizeØ00__func__Ø000[0], str(19559), 14)
 19656  }
 19657  
 19658  // C comment
 19659  //  /*
 19660  //  ** Return a sanitized version of the sector-size of OS file pFile. The
 19661  //  ** return value is guaranteed to lie between 32 and MAX_SECTOR_SIZE.
 19662  //  */
 19663  func _sqlite3SectorSize(tls *crt.TLS, _pFile *Xsqlite3_file) (r0 int32) {
 19664  	var _iRet int32
 19665  	_iRet = _sqlite3OsSectorSize(tls, _pFile)
 19666  	if _iRet < int32(32) {
 19667  		_iRet = int32(512)
 19668  		goto _2
 19669  	}
 19670  	if _iRet > int32(65536) {
 19671  		_iRet = int32(65536)
 19672  	}
 19673  _2:
 19674  	return _iRet
 19675  }
 19676  
 19677  func _sqlite3OsSectorSize(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
 19678  	var _xSectorSize func(*crt.TLS, *Xsqlite3_file) int32
 19679  	_xSectorSize = func() func(*crt.TLS, *Xsqlite3_file) int32 {
 19680  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxSectorSize
 19681  		return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v))
 19682  	}()
 19683  	return func() int32 {
 19684  		if _xSectorSize != nil {
 19685  			return _xSectorSize(tls, _id)
 19686  		}
 19687  		return int32(4096)
 19688  	}()
 19689  }
 19690  
 19691  // C comment
 19692  //  /*
 19693  //  ** This function is called whenever an IOERR or FULL error that requires
 19694  //  ** the pager to transition into the ERROR state may ahve occurred.
 19695  //  ** The first argument is a pointer to the pager structure, the second
 19696  //  ** the error-code about to be returned by a pager API function. The
 19697  //  ** value returned is a copy of the second argument to this function.
 19698  //  **
 19699  //  ** If the second argument is SQLITE_FULL, SQLITE_IOERR or one of the
 19700  //  ** IOERR sub-codes, the pager enters the ERROR state and the error code
 19701  //  ** is stored in Pager.errCode. While the pager remains in the ERROR state,
 19702  //  ** all major API calls on the Pager will immediately return Pager.errCode.
 19703  //  **
 19704  //  ** The ERROR state indicates that the contents of the pager-cache
 19705  //  ** cannot be trusted. This state can be cleared by completely discarding
 19706  //  ** the contents of the pager-cache. If a transaction was active when
 19707  //  ** the persistent error occurred, then the rollback journal may need
 19708  //  ** to be replayed to restore the contents of the database file (as if
 19709  //  ** it were a hot-journal).
 19710  //  */
 19711  func _pager_error(tls *crt.TLS, _pPager *XPager, _rc int32) (r0 int32) {
 19712  	var _rc2 int32
 19713  	_rc2 = _rc & int32(255)
 19714  	func() {
 19715  		if _rc != int32(0) && _pPager.XmemDb != 0 {
 19716  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48816), unsafe.Pointer(&_pager_errorØ00__func__Ø000), unsafe.Pointer(str(19573)))
 19717  			crt.X__builtin_abort(tls)
 19718  		}
 19719  	}()
 19720  	func() {
 19721  		if _pPager.XerrCode != int32(13) && _pPager.XerrCode != int32(0) && (_pPager.XerrCode&int32(255)) != int32(10) {
 19722  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48817), unsafe.Pointer(&_pager_errorØ00__func__Ø000), unsafe.Pointer(str(19597)))
 19723  			crt.X__builtin_abort(tls)
 19724  		}
 19725  	}()
 19726  	if (_rc2 == int32(13)) || (_rc2 == int32(10)) {
 19727  		_pPager.XerrCode = _rc
 19728  		_pPager.XeState = uint8(6)
 19729  		_setGetterMethod(tls, _pPager)
 19730  	}
 19731  	return _rc
 19732  }
 19733  
 19734  var _pager_errorØ00__func__Ø000 [12]int8
 19735  
 19736  func init() {
 19737  	crt.Xstrncpy(nil, &_pager_errorØ00__func__Ø000[0], str(19698), 12)
 19738  }
 19739  
 19740  // C comment
 19741  //  /*
 19742  //  ** This function is a no-op if the pager is in exclusive mode and not
 19743  //  ** in the ERROR state. Otherwise, it switches the pager to PAGER_OPEN
 19744  //  ** state.
 19745  //  **
 19746  //  ** If the pager is not in exclusive-access mode, the database file is
 19747  //  ** completely unlocked. If the file is unlocked and the file-system does
 19748  //  ** not exhibit the UNDELETABLE_WHEN_OPEN property, the journal file is
 19749  //  ** closed (if it is open).
 19750  //  **
 19751  //  ** If the pager is in ERROR state when this function is called, the
 19752  //  ** contents of the pager cache are discarded before switching back to
 19753  //  ** the OPEN state. Regardless of whether the pager is in exclusive-mode
 19754  //  ** or not, any journal file left in the file-system will be treated
 19755  //  ** as a hot-journal and rolled back the next time a read-transaction
 19756  //  ** is opened (by this or by any other connection).
 19757  //  */
 19758  func _pager_unlock(tls *crt.TLS, _pPager *XPager) {
 19759  	var _2_rc, _2_iDc int32
 19760  	func() {
 19761  		if int32(_pPager.XeState) != int32(1) && int32(_pPager.XeState) != int32(0) && int32(_pPager.XeState) != int32(6) {
 19762  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48718), unsafe.Pointer(&_pager_unlockØ00__func__Ø000), unsafe.Pointer(str(19710)))
 19763  			crt.X__builtin_abort(tls)
 19764  		}
 19765  	}()
 19766  	_sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.XpInJournal))
 19767  	*(**XBitvec)(unsafe.Pointer(&_pPager.XpInJournal)) = nil
 19768  	_releaseAllSavepoints(tls, _pPager)
 19769  	if (*XWal)(_pPager.XpWal) != nil {
 19770  		func() {
 19771  			if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil {
 19772  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48728), unsafe.Pointer(&_pager_unlockØ00__func__Ø000), unsafe.Pointer(str(19800)))
 19773  				crt.X__builtin_abort(tls)
 19774  			}
 19775  		}()
 19776  		_sqlite3WalEndReadTransaction(tls, (*XWal)(_pPager.XpWal))
 19777  		_pPager.XeState = 0
 19778  		goto _8
 19779  	}
 19780  	if _pPager.XexclusiveMode != 0 {
 19781  		goto _8
 19782  	}
 19783  	_2_iDc = func() int32 {
 19784  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil {
 19785  			return _sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xfd))
 19786  		}
 19787  		return int32(0)
 19788  	}()
 19789  
 19790  	if (int32(0) == (_2_iDc & int32(2048))) || (int32(1) != (int32(_pPager.XjournalMode) & int32(5))) {
 19791  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 19792  	}
 19793  	_2_rc = _pagerUnlockDb(tls, _pPager, int32(0))
 19794  	if (_2_rc != int32(0)) && (int32(_pPager.XeState) == int32(6)) {
 19795  		_pPager.XeLock = uint8(5)
 19796  	}
 19797  	func() {
 19798  		if _pPager.XerrCode == 0 && int32(_pPager.XeState) == int32(6) {
 19799  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48766), unsafe.Pointer(&_pager_unlockØ00__func__Ø000), unsafe.Pointer(str(19821)))
 19800  			crt.X__builtin_abort(tls)
 19801  		}
 19802  	}()
 19803  	_pPager.XchangeCountDone = 0
 19804  	_pPager.XeState = 0
 19805  _8:
 19806  	func() {
 19807  		if _pPager.XerrCode != int32(0) && _pPager.XmemDb != 0 {
 19808  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48776), unsafe.Pointer(&_pager_unlockØ00__func__Ø000), unsafe.Pointer(str(19868)))
 19809  			crt.X__builtin_abort(tls)
 19810  		}
 19811  	}()
 19812  	if _pPager.XerrCode == 0 {
 19813  		goto _21
 19814  	}
 19815  	if int32(_pPager.XtempFile) == int32(0) {
 19816  		_pager_reset(tls, _pPager)
 19817  		_pPager.XchangeCountDone = 0
 19818  		_pPager.XeState = 0
 19819  		goto _23
 19820  	}
 19821  	_pPager.XeState = uint8(func() int32 {
 19822  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil {
 19823  			return int32(0)
 19824  		}
 19825  		return int32(1)
 19826  	}())
 19827  _23:
 19828  	if _pPager.XbUseFetch != 0 {
 19829  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), 0, nil)
 19830  	}
 19831  	_pPager.XerrCode = int32(0)
 19832  	_setGetterMethod(tls, _pPager)
 19833  _21:
 19834  	_pPager.XjournalOff = 0
 19835  	_pPager.XjournalHdr = 0
 19836  	_pPager.XsetMaster = 0
 19837  }
 19838  
 19839  var _pager_unlockØ00__func__Ø000 [13]int8
 19840  
 19841  func init() {
 19842  	crt.Xstrncpy(nil, &_pager_unlockØ00__func__Ø000[0], str(19905), 13)
 19843  }
 19844  
 19845  // C comment
 19846  //  /*
 19847  //  ** Finish with a read transaction.  All this does is release the
 19848  //  ** read-lock.
 19849  //  */
 19850  func _sqlite3WalEndReadTransaction(tls *crt.TLS, _pWal *XWal) {
 19851  	_sqlite3WalEndWriteTransaction(tls, _pWal)
 19852  	if int32(_pWal.XreadLock) >= int32(0) {
 19853  		_walUnlockShared(tls, _pWal, int32(3)+int32(_pWal.XreadLock))
 19854  		_pWal.XreadLock = int16(-1)
 19855  	}
 19856  }
 19857  
 19858  // C comment
 19859  //  /*
 19860  //  ** Change the size of an existing memory allocation
 19861  //  */
 19862  func _sqlite3Realloc(tls *crt.TLS, _pOld unsafe.Pointer, _nBytes uint64) (r0 unsafe.Pointer) {
 19863  	var _nOld, _nNew, _nDiff int32
 19864  	var _pNew unsafe.Pointer
 19865  
 19866  	if _pOld == nil {
 19867  		return _sqlite3Malloc(tls, _nBytes)
 19868  	}
 19869  	if _nBytes == (0) {
 19870  		Xsqlite3_free(tls, _pOld)
 19871  		return nil
 19872  	}
 19873  	if _nBytes >= uint64(2147483392) {
 19874  		return nil
 19875  	}
 19876  	_nOld = _sqlite3MallocSize(tls, _pOld)
 19877  	_nNew = (_sqlite3Config.Xm.XxRoundup)(tls, int32(_nBytes))
 19878  	if _nOld == _nNew {
 19879  		_pNew = _pOld
 19880  		goto _11
 19881  	}
 19882  	if _sqlite3Config.XbMemstat == 0 {
 19883  		goto _5
 19884  	}
 19885  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 19886  	_sqlite3StatusHighwater(tls, int32(5), int32(_nBytes))
 19887  	_nDiff = _nNew - _nOld
 19888  	if (_nDiff > int32(0)) && (_sqlite3StatusValue(tls, int32(0)) >= (_mem0.XalarmThreshold - int64(_nDiff))) {
 19889  		_sqlite3MallocAlarm(tls, _nDiff)
 19890  	}
 19891  	_pNew = (_sqlite3Config.Xm.XxRealloc)(tls, _pOld, _nNew)
 19892  	if (_pNew == nil) && (_mem0.XalarmThreshold > (0)) {
 19893  		_sqlite3MallocAlarm(tls, int32(_nBytes))
 19894  		_pNew = (_sqlite3Config.Xm.XxRealloc)(tls, _pOld, _nNew)
 19895  	}
 19896  	if _pNew != nil {
 19897  		_nNew = _sqlite3MallocSize(tls, _pNew)
 19898  		_sqlite3StatusUp(tls, int32(0), _nNew-_nOld)
 19899  	}
 19900  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 19901  	goto _11
 19902  _5:
 19903  	_pNew = (_sqlite3Config.Xm.XxRealloc)(tls, _pOld, _nNew)
 19904  _11:
 19905  	func() {
 19906  		if (int64(uintptr(_pNew)) & int64(7)) != (0) {
 19907  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24772), unsafe.Pointer(&_sqlite3ReallocØ00__func__Ø000), unsafe.Pointer(str(19918)))
 19908  			crt.X__builtin_abort(tls)
 19909  		}
 19910  	}()
 19911  	return _pNew
 19912  }
 19913  
 19914  var _sqlite3ReallocØ00__func__Ø000 [15]int8
 19915  
 19916  func init() {
 19917  	crt.Xstrncpy(nil, &_sqlite3ReallocØ00__func__Ø000[0], str(19945), 15)
 19918  }
 19919  
 19920  // C comment
 19921  //  /*
 19922  //  ** Given the page number of an overflow page in the database (parameter
 19923  //  ** ovfl), this function finds the page number of the next page in the
 19924  //  ** linked list of overflow pages. If possible, it uses the auto-vacuum
 19925  //  ** pointer-map data instead of reading the content of page ovfl to do so.
 19926  //  **
 19927  //  ** If an error occurs an SQLite error code is returned. Otherwise:
 19928  //  **
 19929  //  ** The page number of the next overflow page in the linked list is
 19930  //  ** written to *pPgnoNext. If page ovfl is the last page in its linked
 19931  //  ** list, *pPgnoNext is set to zero.
 19932  //  **
 19933  //  ** If ppPage is not NULL, and a reference to the MemPage object corresponding
 19934  //  ** to page number pOvfl was obtained, then *ppPage is set to point to that
 19935  //  ** reference. It is the responsibility of the caller to call releasePage()
 19936  //  ** on *ppPage to free the reference. In no reference was obtained (because
 19937  //  ** the pointer-map was used to obtain the value for *pPgnoNext), then
 19938  //  ** *ppPage is set to zero.
 19939  //  */
 19940  func _getOverflowPage(tls *crt.TLS, _pBt *XBtShared, _ovfl uint32, _ppPage **XMemPage, _pPgnoNext *uint32) (r0 int32) {
 19941  	var _rc int32
 19942  	var _next, _1_pgno, _1_iGuess uint32
 19943  	var _1_eType uint8
 19944  	var _pPage *XMemPage
 19945  	_next = uint32(0)
 19946  	_pPage = nil
 19947  	_rc = int32(0)
 19948  	func() {
 19949  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 19950  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63444), unsafe.Pointer(&_getOverflowPageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 19951  			crt.X__builtin_abort(tls)
 19952  		}
 19953  	}()
 19954  	func() {
 19955  		if _pPgnoNext == nil {
 19956  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63445), unsafe.Pointer(&_getOverflowPageØ00__func__Ø000), unsafe.Pointer(str(19960)))
 19957  			crt.X__builtin_abort(tls)
 19958  		}
 19959  	}()
 19960  	if _pBt.XautoVacuum == 0 {
 19961  		goto _4
 19962  	}
 19963  	_1_iGuess = _ovfl + uint32(1)
 19964  _5:
 19965  	if (_ptrmapPageno(tls, _pBt, _1_iGuess) == _1_iGuess) || (_1_iGuess == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 19966  		_1_iGuess += 1
 19967  		goto _5
 19968  	}
 19969  	if _1_iGuess > _btreePagecount(tls, _pBt) {
 19970  		goto _8
 19971  	}
 19972  	_rc = _ptrmapGet(tls, _pBt, _1_iGuess, &_1_eType, &_1_pgno)
 19973  	if ((_rc == int32(0)) && (int32(_1_eType) == int32(4))) && (_1_pgno == _ovfl) {
 19974  		_next = _1_iGuess
 19975  		_rc = int32(101)
 19976  	}
 19977  _8:
 19978  _4:
 19979  	func() {
 19980  		if _next != (0) && _rc != int32(101) {
 19981  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63473), unsafe.Pointer(&_getOverflowPageØ00__func__Ø000), unsafe.Pointer(str(19970)))
 19982  			crt.X__builtin_abort(tls)
 19983  		}
 19984  	}()
 19985  	if _rc != int32(0) {
 19986  		goto _15
 19987  	}
 19988  	_rc = _btreeGetPage(tls, _pBt, _ovfl, &_pPage, func() int32 {
 19989  		if _ppPage == nil {
 19990  			return int32(2)
 19991  		}
 19992  		return int32(0)
 19993  	}())
 19994  	func() {
 19995  		if _rc != int32(0) && _pPage != nil {
 19996  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63476), unsafe.Pointer(&_getOverflowPageØ00__func__Ø000), unsafe.Pointer(str(19997)))
 19997  			crt.X__builtin_abort(tls)
 19998  		}
 19999  	}()
 20000  	if _rc == int32(0) {
 20001  		_next = _sqlite3Get4byte(tls, _pPage.XaData)
 20002  	}
 20003  _15:
 20004  	*_pPgnoNext = _next
 20005  	if _ppPage != nil {
 20006  		*_ppPage = _pPage
 20007  		goto _23
 20008  	}
 20009  	_releasePage(tls, _pPage)
 20010  _23:
 20011  	return func() int32 {
 20012  		if _rc == int32(101) {
 20013  			return int32(0)
 20014  		}
 20015  		return _rc
 20016  	}()
 20017  }
 20018  
 20019  var _getOverflowPageØ00__func__Ø000 [16]int8
 20020  
 20021  func init() {
 20022  	crt.Xstrncpy(nil, &_getOverflowPageØ00__func__Ø000[0], str(20023), 16)
 20023  }
 20024  
 20025  // C comment
 20026  //  /*
 20027  //  ** Given a page number of a regular database page, return the page
 20028  //  ** number for the pointer-map page that contains the entry for the
 20029  //  ** input page number.
 20030  //  **
 20031  //  ** Return 0 (not a valid page) for pgno==1 since there is
 20032  //  ** no pointer map associated with page 1.  The integrity_check logic
 20033  //  ** requires that ptrmapPageno(*,1)!=1.
 20034  //  */
 20035  func _ptrmapPageno(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 uint32) {
 20036  	var _nPagesPerMapPage int32
 20037  	var _iPtrMap, _ret uint32
 20038  	func() {
 20039  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 20040  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59937), unsafe.Pointer(&_ptrmapPagenoØ00__func__Ø000), unsafe.Pointer(str(9235)))
 20041  			crt.X__builtin_abort(tls)
 20042  		}
 20043  	}()
 20044  	if _pgno < uint32(2) {
 20045  		return 0
 20046  	}
 20047  	_nPagesPerMapPage = int32((_pBt.XusableSize / uint32(5)) + uint32(1))
 20048  	_iPtrMap = (_pgno - uint32(2)) / uint32(_nPagesPerMapPage)
 20049  	_ret = (_iPtrMap * uint32(_nPagesPerMapPage)) + uint32(2)
 20050  	if _ret == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 20051  		_ret += 1
 20052  	}
 20053  	return _ret
 20054  }
 20055  
 20056  var _ptrmapPagenoØ00__func__Ø000 [13]int8
 20057  
 20058  func init() {
 20059  	crt.Xstrncpy(nil, &_ptrmapPagenoØ00__func__Ø000[0], str(20039), 13)
 20060  }
 20061  
 20062  // C comment
 20063  //  /*
 20064  //  ** Read an entry from the pointer map.
 20065  //  **
 20066  //  ** This routine retrieves the pointer map entry for page 'key', writing
 20067  //  ** the type and parent page number to *pEType and *pPgno respectively.
 20068  //  ** An error code is returned if something goes wrong, otherwise SQLITE_OK.
 20069  //  */
 20070  func _ptrmapGet(tls *crt.TLS, _pBt *XBtShared, _key uint32, _pEType *uint8, _pPgno *uint32) (r0 int32) {
 20071  	var _iPtrmap, _offset, _rc int32
 20072  	var _pPtrmap *uint8
 20073  	var _pDbPage *XPgHdr
 20074  	func() {
 20075  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 20076  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60017), unsafe.Pointer(&_ptrmapGetØ00__func__Ø000), unsafe.Pointer(str(9235)))
 20077  			crt.X__builtin_abort(tls)
 20078  		}
 20079  	}()
 20080  	_iPtrmap = int32(_ptrmapPageno(tls, _pBt, _key))
 20081  	_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.XpPager), uint32(_iPtrmap), &_pDbPage, int32(0))
 20082  	if _rc != int32(0) {
 20083  		return _rc
 20084  	}
 20085  	_pPtrmap = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage))
 20086  	_offset = int32(uint32(5) * ((_key - uint32(_iPtrmap)) - uint32(1)))
 20087  	if _offset < int32(0) {
 20088  		_sqlite3PagerUnref(tls, _pDbPage)
 20089  		return _sqlite3CorruptError(tls, int32(60029))
 20090  	}
 20091  	func() {
 20092  		if _offset > (int32(_pBt.XusableSize) - int32(5)) {
 20093  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60031), unsafe.Pointer(&_ptrmapGetØ00__func__Ø000), unsafe.Pointer(str(20052)))
 20094  			crt.X__builtin_abort(tls)
 20095  		}
 20096  	}()
 20097  	func() {
 20098  		if _pEType == nil {
 20099  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60032), unsafe.Pointer(&_ptrmapGetØ00__func__Ø000), unsafe.Pointer(str(20085)))
 20100  			crt.X__builtin_abort(tls)
 20101  		}
 20102  	}()
 20103  	*_pEType = *elem15(_pPtrmap, uintptr(_offset))
 20104  	if _pPgno != nil {
 20105  		*_pPgno = _sqlite3Get4byte(tls, elem15(_pPtrmap, uintptr(_offset+int32(1))))
 20106  	}
 20107  	_sqlite3PagerUnref(tls, _pDbPage)
 20108  	if (int32(*_pEType) < int32(1)) || (int32(*_pEType) > int32(5)) {
 20109  		return _sqlite3CorruptError(tls, int32(60037))
 20110  	}
 20111  	return int32(0)
 20112  }
 20113  
 20114  var _ptrmapGetØ00__func__Ø000 [10]int8
 20115  
 20116  func init() {
 20117  	crt.Xstrncpy(nil, &_ptrmapGetØ00__func__Ø000[0], str(20095), 10)
 20118  }
 20119  
 20120  // C comment
 20121  //  /*
 20122  //  ** Get a page from the pager.  Initialize the MemPage.pBt and
 20123  //  ** MemPage.aData elements if needed.  See also: btreeGetUnusedPage().
 20124  //  **
 20125  //  ** If the PAGER_GET_NOCONTENT flag is set, it means that we do not care
 20126  //  ** about the content of the page at this time.  So do not go to the disk
 20127  //  ** to fetch the content.  Just fill in the content with zeros for now.
 20128  //  ** If in the future we call sqlite3PagerWrite() on this page, that
 20129  //  ** means we have started to be concerned about content and the disk
 20130  //  ** read should occur at that point.
 20131  //  */
 20132  func _btreeGetPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _flags int32) (r0 int32) {
 20133  	var _rc int32
 20134  	var _pDbPage *XPgHdr
 20135  	func() {
 20136  		if _flags != int32(0) && _flags != int32(1) && _flags != int32(2) {
 20137  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61023), unsafe.Pointer(&_btreeGetPageØ00__func__Ø000), unsafe.Pointer(str(20105)))
 20138  			crt.X__builtin_abort(tls)
 20139  		}
 20140  	}()
 20141  	func() {
 20142  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 20143  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61024), unsafe.Pointer(&_btreeGetPageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 20144  			crt.X__builtin_abort(tls)
 20145  		}
 20146  	}()
 20147  	_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.XpPager), _pgno, &_pDbPage, _flags)
 20148  	if _rc != 0 {
 20149  		return _rc
 20150  	}
 20151  	*_ppPage = _btreePageFromDbPage(tls, _pDbPage, _pgno, _pBt)
 20152  	return int32(0)
 20153  }
 20154  
 20155  var _btreeGetPageØ00__func__Ø000 [13]int8
 20156  
 20157  func init() {
 20158  	crt.Xstrncpy(nil, &_btreeGetPageØ00__func__Ø000[0], str(20173), 13)
 20159  }
 20160  
 20161  // C comment
 20162  //  /*
 20163  //  ** Convert a DbPage obtained from the pager into a MemPage used by
 20164  //  ** the btree layer.
 20165  //  */
 20166  func _btreePageFromDbPage(tls *crt.TLS, _pDbPage *XPgHdr, _pgno uint32, _pBt *XBtShared) (r0 *XMemPage) {
 20167  	var _pPage *XMemPage
 20168  	_pPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pDbPage))
 20169  	if _pgno != _pPage.Xpgno {
 20170  		_pPage.XaData = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage))
 20171  		*(**XPgHdr)(unsafe.Pointer(&_pPage.XpDbPage)) = _pDbPage
 20172  		*(**XBtShared)(unsafe.Pointer(&_pPage.XpBt)) = _pBt
 20173  		_pPage.Xpgno = _pgno
 20174  		_pPage.XhdrOffset = uint8(func() int32 {
 20175  			if _pgno == uint32(1) {
 20176  				return int32(100)
 20177  			}
 20178  			return int32(0)
 20179  		}())
 20180  	}
 20181  	func() {
 20182  		if _pPage.XaData != (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) {
 20183  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60999), unsafe.Pointer(&_btreePageFromDbPageØ00__func__Ø000), unsafe.Pointer(str(20186)))
 20184  			crt.X__builtin_abort(tls)
 20185  		}
 20186  	}()
 20187  	return _pPage
 20188  }
 20189  
 20190  var _btreePageFromDbPageØ00__func__Ø000 [20]int8
 20191  
 20192  func init() {
 20193  	crt.Xstrncpy(nil, &_btreePageFromDbPageØ00__func__Ø000[0], str(20229), 20)
 20194  }
 20195  
 20196  func _releasePage(tls *crt.TLS, _pPage *XMemPage) {
 20197  	if _pPage != nil {
 20198  		_releasePageNotNull(tls, _pPage)
 20199  	}
 20200  }
 20201  
 20202  // C comment
 20203  //  /*
 20204  //  ** Release a MemPage.  This should be called once for each prior
 20205  //  ** call to btreeGetPage.
 20206  //  */
 20207  func _releasePageNotNull(tls *crt.TLS, _pPage *XMemPage) {
 20208  	func() {
 20209  		if _pPage.XaData == nil {
 20210  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61127), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20249)))
 20211  			crt.X__builtin_abort(tls)
 20212  		}
 20213  	}()
 20214  	func() {
 20215  		if _pPage.XpBt == nil {
 20216  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61128), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20262)))
 20217  			crt.X__builtin_abort(tls)
 20218  		}
 20219  	}()
 20220  	func() {
 20221  		if (*XPgHdr)(_pPage.XpDbPage) == nil {
 20222  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61129), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20273)))
 20223  			crt.X__builtin_abort(tls)
 20224  		}
 20225  	}()
 20226  	func() {
 20227  		if _sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.XpDbPage)) != unsafe.Pointer(_pPage) {
 20228  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61130), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20291)))
 20229  			crt.X__builtin_abort(tls)
 20230  		}
 20231  	}()
 20232  	func() {
 20233  		if _sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.XpDbPage)) != unsafe.Pointer(_pPage.XaData) {
 20234  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61131), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20344)))
 20235  			crt.X__builtin_abort(tls)
 20236  		}
 20237  	}()
 20238  	func() {
 20239  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 20240  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61132), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20394)))
 20241  			crt.X__builtin_abort(tls)
 20242  		}
 20243  	}()
 20244  	_sqlite3PagerUnrefNotNull(tls, (*XPgHdr)(_pPage.XpDbPage))
 20245  }
 20246  
 20247  var _releasePageNotNullØ00__func__Ø000 [19]int8
 20248  
 20249  func init() {
 20250  	crt.Xstrncpy(nil, &_releasePageNotNullØ00__func__Ø000[0], str(20432), 19)
 20251  }
 20252  
 20253  // C comment
 20254  //  /*
 20255  //  ** Release all of the apPage[] pages for a cursor.
 20256  //  */
 20257  func _btreeReleaseAllCursorPages(tls *crt.TLS, _pCur *XBtCursor) {
 20258  	var _i int32
 20259  	_i = int32(0)
 20260  _0:
 20261  	if _i > int32(_pCur.XiPage) {
 20262  		goto _3
 20263  	}
 20264  	_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_i)))
 20265  	*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_i)) = nil
 20266  	_i += 1
 20267  	goto _0
 20268  _3:
 20269  	_pCur.XiPage = int8(-1)
 20270  }
 20271  
 20272  // C comment
 20273  //  /*
 20274  //  ** This routine sets the state to CURSOR_FAULT and the error
 20275  //  ** code to errCode for every cursor on any BtShared that pBtree
 20276  //  ** references.  Or if the writeOnly flag is set to 1, then only
 20277  //  ** trip write cursors and leave read cursors unchanged.
 20278  //  **
 20279  //  ** Every cursor is a candidate to be tripped, including cursors
 20280  //  ** that belong to other database connections that happen to be
 20281  //  ** sharing the cache with pBtree.
 20282  //  **
 20283  //  ** This routine gets called when a rollback occurs. If the writeOnly
 20284  //  ** flag is true, then only write-cursors need be tripped - read-only
 20285  //  ** cursors save their current positions so that they may continue
 20286  //  ** following the rollback. Or, if writeOnly is false, all cursors are
 20287  //  ** tripped. In general, writeOnly is false if the transaction being
 20288  //  ** rolled back modified the database schema. In this case b-tree root
 20289  //  ** pages may be moved or deleted from the database altogether, making
 20290  //  ** it unsafe for read cursors to continue.
 20291  //  **
 20292  //  ** If the writeOnly flag is true and an error is encountered while
 20293  //  ** saving the current position of a read-only cursor, all cursors,
 20294  //  ** including all read-cursors are tripped.
 20295  //  **
 20296  //  ** SQLITE_OK is returned if successful, or if an error occurs while
 20297  //  ** saving a cursor position, an SQLite error code.
 20298  //  */
 20299  func _sqlite3BtreeTripAllCursors(tls *crt.TLS, _pBtree *XBtree, _errCode int32, _writeOnly int32) (r0 int32) {
 20300  	var _rc, _2_i int32
 20301  	var _p *XBtCursor
 20302  	_rc = int32(0)
 20303  	func() {
 20304  		if _writeOnly != int32(0) && _writeOnly != int32(1) || int32(1) == 0 {
 20305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62993), unsafe.Pointer(&_sqlite3BtreeTripAllCursorsØ00__func__Ø000), unsafe.Pointer(str(20451)))
 20306  			crt.X__builtin_abort(tls)
 20307  		}
 20308  	}()
 20309  	if _pBtree == nil {
 20310  		goto _4
 20311  	}
 20312  	_sqlite3BtreeEnter(tls, _pBtree)
 20313  	_p = (*XBtCursor)((*XBtShared)(_pBtree.XpBt).XpCursor)
 20314  _5:
 20315  	if _p == nil {
 20316  		goto _8
 20317  	}
 20318  	if _writeOnly == 0 || (int32(_p.XcurFlags)&int32(1)) != int32(0) {
 20319  		goto _10
 20320  	}
 20321  	if int32(_p.XeState) != int32(1) && int32(_p.XeState) != int32(2) {
 20322  		goto _12
 20323  	}
 20324  	_rc = _saveCursorPosition(tls, _p)
 20325  	if _rc != int32(0) {
 20326  		_sqlite3BtreeTripAllCursors(tls, _pBtree, _rc, int32(0))
 20327  		goto _8
 20328  	}
 20329  _12:
 20330  	goto _14
 20331  _10:
 20332  	_sqlite3BtreeClearCursor(tls, _p)
 20333  	_p.XeState = uint8(4)
 20334  	_p.XskipNext = _errCode
 20335  _14:
 20336  	_2_i = int32(0)
 20337  _15:
 20338  	if _2_i > int32(_p.XiPage) {
 20339  		goto _18
 20340  	}
 20341  	_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_p.XapPage)), uintptr(_2_i)))
 20342  	*elem30((**XMemPage)(unsafe.Pointer(&_p.XapPage)), uintptr(_2_i)) = nil
 20343  	_2_i += 1
 20344  	goto _15
 20345  _18:
 20346  	_p = (*XBtCursor)(_p.XpNext)
 20347  	goto _5
 20348  _8:
 20349  	_sqlite3BtreeLeave(tls, _pBtree)
 20350  _4:
 20351  	return _rc
 20352  }
 20353  
 20354  var _sqlite3BtreeTripAllCursorsØ00__func__Ø000 [27]int8
 20355  
 20356  func init() {
 20357  	crt.Xstrncpy(nil, &_sqlite3BtreeTripAllCursorsØ00__func__Ø000[0], str(20503), 27)
 20358  }
 20359  
 20360  // C comment
 20361  //  /*
 20362  //  ** Clear the current cursor position.
 20363  //  */
 20364  func _sqlite3BtreeClearCursor(tls *crt.TLS, _pCur *XBtCursor) {
 20365  	func() {
 20366  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 20367  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59781), unsafe.Pointer(&_sqlite3BtreeClearCursorØ00__func__Ø000), unsafe.Pointer(str(10230)))
 20368  			crt.X__builtin_abort(tls)
 20369  		}
 20370  	}()
 20371  	Xsqlite3_free(tls, _pCur.XpKey)
 20372  	_pCur.XpKey = nil
 20373  	_pCur.XeState = 0
 20374  }
 20375  
 20376  var _sqlite3BtreeClearCursorØ00__func__Ø000 [24]int8
 20377  
 20378  func init() {
 20379  	crt.Xstrncpy(nil, &_sqlite3BtreeClearCursorØ00__func__Ø000[0], str(20530), 24)
 20380  }
 20381  
 20382  // C comment
 20383  //  /*
 20384  //  ** This function may only be called when a read-transaction is open on
 20385  //  ** the pager. It returns the total number of pages in the database.
 20386  //  **
 20387  //  ** However, if the file is between 1 and <page-size> bytes in size, then
 20388  //  ** this is considered a 1 page file.
 20389  //  */
 20390  func _sqlite3PagerPagecount(tls *crt.TLS, _pPager *XPager, _pnPage *int32) {
 20391  	func() {
 20392  		if int32(_pPager.XeState) < int32(1) {
 20393  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50791), unsafe.Pointer(&_sqlite3PagerPagecountØ00__func__Ø000), unsafe.Pointer(str(18112)))
 20394  			crt.X__builtin_abort(tls)
 20395  		}
 20396  	}()
 20397  	func() {
 20398  		if int32(_pPager.XeState) == int32(5) {
 20399  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50792), unsafe.Pointer(&_sqlite3PagerPagecountØ00__func__Ø000), unsafe.Pointer(str(20554)))
 20400  			crt.X__builtin_abort(tls)
 20401  		}
 20402  	}()
 20403  	*_pnPage = int32(_pPager.XdbSize)
 20404  }
 20405  
 20406  var _sqlite3PagerPagecountØ00__func__Ø000 [22]int8
 20407  
 20408  func init() {
 20409  	crt.Xstrncpy(nil, &_sqlite3PagerPagecountØ00__func__Ø000[0], str(20592), 22)
 20410  }
 20411  
 20412  // C comment
 20413  //  /*
 20414  //  ** Return the number of cursors open on pBt. This is for use
 20415  //  ** in assert() expressions, so it is only compiled if NDEBUG is not
 20416  //  ** defined.
 20417  //  **
 20418  //  ** Only write cursors are counted if wrOnly is true.  If wrOnly is
 20419  //  ** false then all cursors are counted.
 20420  //  **
 20421  //  ** For the purposes of this routine, a cursor is any cursor that
 20422  //  ** is capable of reading or writing to the database.  Cursors that
 20423  //  ** have been tripped into the CURSOR_FAULT state are not counted.
 20424  //  */
 20425  func _countValidCursors(tls *crt.TLS, _pBt *XBtShared, _wrOnly int32) (r0 int32) {
 20426  	var _r int32
 20427  	var _pCur *XBtCursor
 20428  	_r = int32(0)
 20429  	_pCur = (*XBtCursor)(_pBt.XpCursor)
 20430  _0:
 20431  	if _pCur == nil {
 20432  		goto _3
 20433  	}
 20434  	if ((_wrOnly == int32(0)) || ((int32(_pCur.XcurFlags) & int32(1)) != int32(0))) && (int32(_pCur.XeState) != int32(4)) {
 20435  		_r += 1
 20436  	}
 20437  	_pCur = (*XBtCursor)(_pCur.XpNext)
 20438  	goto _0
 20439  _3:
 20440  	return _r
 20441  }
 20442  
 20443  // C comment
 20444  //  /*
 20445  //  ** Clear (destroy) the BtShared.pHasContent bitvec. This should be
 20446  //  ** invoked at the conclusion of each write-transaction.
 20447  //  */
 20448  func _btreeClearHasContent(tls *crt.TLS, _pBt *XBtShared) {
 20449  	_sqlite3BitvecDestroy(tls, (*XBitvec)(_pBt.XpHasContent))
 20450  	*(**XBitvec)(unsafe.Pointer(&_pBt.XpHasContent)) = nil
 20451  }
 20452  
 20453  // C comment
 20454  //  /*
 20455  //  ** This function is called from both BtreeCommitPhaseTwo() and BtreeRollback()
 20456  //  ** at the conclusion of a transaction.
 20457  //  */
 20458  func _btreeEndTransaction(tls *crt.TLS, _p *XBtree) {
 20459  	var _db *Xsqlite3
 20460  	var _pBt *XBtShared
 20461  	_pBt = (*XBtShared)(_p.XpBt)
 20462  	_db = (*Xsqlite3)(_p.Xdb)
 20463  	func() {
 20464  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 20465  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62861), unsafe.Pointer(&_btreeEndTransactionØ00__func__Ø000), unsafe.Pointer(str(17442)))
 20466  			crt.X__builtin_abort(tls)
 20467  		}
 20468  	}()
 20469  	_pBt.XbDoTruncate = 0
 20470  	if (int32(_p.XinTrans) > int32(0)) && (_db.XnVdbeRead > int32(1)) {
 20471  		_downgradeAllSharedCacheTableLocks(tls, _p)
 20472  		_p.XinTrans = uint8(1)
 20473  		goto _4
 20474  	}
 20475  	if int32(_p.XinTrans) == int32(0) {
 20476  		goto _5
 20477  	}
 20478  	_clearAllSharedCacheTableLocks(tls, _p)
 20479  	_pBt.XnTransaction -= 1
 20480  	if int32(0) == _pBt.XnTransaction {
 20481  		_pBt.XinTransaction = 0
 20482  	}
 20483  _5:
 20484  	_p.XinTrans = 0
 20485  	_unlockBtreeIfUnused(tls, _pBt)
 20486  _4:
 20487  	func() {
 20488  		if int32((*XBtShared)(_p.XpBt).XinTransaction) == int32(0) && ((*XBtShared)(_p.XpBt).XnTransaction) != int32(0) {
 20489  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62891), unsafe.Pointer(&_btreeEndTransactionØ00__func__Ø000), unsafe.Pointer(str(9932)))
 20490  			crt.X__builtin_abort(tls)
 20491  		}
 20492  	}()
 20493  	func() {
 20494  		if int32((*XBtShared)(_p.XpBt).XinTransaction) < int32(_p.XinTrans) {
 20495  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62891), unsafe.Pointer(&_btreeEndTransactionØ00__func__Ø000), unsafe.Pointer(str(9993)))
 20496  			crt.X__builtin_abort(tls)
 20497  		}
 20498  	}()
 20499  }
 20500  
 20501  var _btreeEndTransactionØ00__func__Ø000 [20]int8
 20502  
 20503  func init() {
 20504  	crt.Xstrncpy(nil, &_btreeEndTransactionØ00__func__Ø000[0], str(20614), 20)
 20505  }
 20506  
 20507  // C comment
 20508  //  /*
 20509  //  ** This function changes all write-locks held by Btree p into read-locks.
 20510  //  */
 20511  func _downgradeAllSharedCacheTableLocks(tls *crt.TLS, _p *XBtree) {
 20512  	var _pBt *XBtShared
 20513  	var _1_pLock *XBtLock
 20514  	_pBt = (*XBtShared)(_p.XpBt)
 20515  	if (*XBtree)(_pBt.XpWriter) != _p {
 20516  		goto _0
 20517  	}
 20518  	*(**XBtree)(unsafe.Pointer(&_pBt.XpWriter)) = nil
 20519  	{
 20520  		p := &_pBt.XbtsFlags
 20521  		*p = uint16(int32(*p) & int32(-97))
 20522  	}
 20523  	_1_pLock = (*XBtLock)(_pBt.XpLock)
 20524  _1:
 20525  	if _1_pLock == nil {
 20526  		goto _4
 20527  	}
 20528  	func() {
 20529  		if int32(_1_pLock.XeLock) != int32(1) && (*XBtree)(_1_pLock.XpBtree) != _p {
 20530  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59468), unsafe.Pointer(&_downgradeAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20634)))
 20531  			crt.X__builtin_abort(tls)
 20532  		}
 20533  	}()
 20534  	_1_pLock.XeLock = uint8(1)
 20535  	_1_pLock = (*XBtLock)(_1_pLock.XpNext)
 20536  	goto _1
 20537  _4:
 20538  _0:
 20539  }
 20540  
 20541  var _downgradeAllSharedCacheTableLocksØ00__func__Ø000 [34]int8
 20542  
 20543  func init() {
 20544  	crt.Xstrncpy(nil, &_downgradeAllSharedCacheTableLocksØ00__func__Ø000[0], str(20678), 34)
 20545  }
 20546  
 20547  // C comment
 20548  //  /*
 20549  //  ** Release all the table locks (locks obtained via calls to
 20550  //  ** the setSharedCacheTableLock() procedure) held by Btree object p.
 20551  //  **
 20552  //  ** This function assumes that Btree p has an open read or write
 20553  //  ** transaction. If it does not, then the BTS_PENDING flag
 20554  //  ** may be incorrectly cleared.
 20555  //  */
 20556  func _clearAllSharedCacheTableLocks(tls *crt.TLS, _p *XBtree) {
 20557  	var _pBt *XBtShared
 20558  	var _1_pLock *XBtLock
 20559  	var _ppIter **XBtLock
 20560  	_pBt = (*XBtShared)(_p.XpBt)
 20561  	_ppIter = (**XBtLock)(unsafe.Pointer(&_pBt.XpLock))
 20562  	func() {
 20563  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 20564  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59421), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(17442)))
 20565  			crt.X__builtin_abort(tls)
 20566  		}
 20567  	}()
 20568  	func() {
 20569  		if _p.Xsharable == 0 && nil != (*_ppIter) {
 20570  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59422), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20712)))
 20571  			crt.X__builtin_abort(tls)
 20572  		}
 20573  	}()
 20574  	func() {
 20575  		if int32(_p.XinTrans) <= int32(0) {
 20576  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59423), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20738)))
 20577  			crt.X__builtin_abort(tls)
 20578  		}
 20579  	}()
 20580  _7:
 20581  	if (*_ppIter) == nil {
 20582  		goto _8
 20583  	}
 20584  	_1_pLock = *_ppIter
 20585  	func() {
 20586  		if (int32(_pBt.XbtsFlags)&int32(32)) != int32(0) && (*XBtree)(_pBt.XpWriter) != (*XBtree)(_1_pLock.XpBtree) {
 20587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59427), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20751)))
 20588  			crt.X__builtin_abort(tls)
 20589  		}
 20590  	}()
 20591  	func() {
 20592  		if int32((*XBtree)(_1_pLock.XpBtree).XinTrans) < int32(_1_pLock.XeLock) {
 20593  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59428), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20817)))
 20594  			crt.X__builtin_abort(tls)
 20595  		}
 20596  	}()
 20597  	if (*XBtree)(_1_pLock.XpBtree) != _p {
 20598  		goto _14
 20599  	}
 20600  	*_ppIter = (*XBtLock)(_1_pLock.XpNext)
 20601  	func() {
 20602  		if _1_pLock.XiTable == uint32(1) && _1_pLock != &_p.Xlock {
 20603  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59431), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20854)))
 20604  			crt.X__builtin_abort(tls)
 20605  		}
 20606  	}()
 20607  	if _1_pLock.XiTable != uint32(1) {
 20608  		Xsqlite3_free(tls, unsafe.Pointer(_1_pLock))
 20609  	}
 20610  	goto _19
 20611  _14:
 20612  	_ppIter = (**XBtLock)(unsafe.Pointer(&_1_pLock.XpNext))
 20613  _19:
 20614  	goto _7
 20615  _8:
 20616  	func() {
 20617  		if (int32(_pBt.XbtsFlags)&int32(64)) != int32(0) && _pBt.XpWriter == nil {
 20618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59440), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20890)))
 20619  			crt.X__builtin_abort(tls)
 20620  		}
 20621  	}()
 20622  	if (*XBtree)(_pBt.XpWriter) == _p {
 20623  		*(**XBtree)(unsafe.Pointer(&_pBt.XpWriter)) = nil
 20624  		{
 20625  			p := &_pBt.XbtsFlags
 20626  			*p = uint16(int32(*p) & int32(-97))
 20627  		}
 20628  		goto _25
 20629  	}
 20630  	if _pBt.XnTransaction == int32(2) {
 20631  		{
 20632  			p := &_pBt.XbtsFlags
 20633  			*p = uint16(int32(*p) & int32(-65))
 20634  		}
 20635  	}
 20636  _25:
 20637  }
 20638  
 20639  var _clearAllSharedCacheTableLocksØ00__func__Ø000 [30]int8
 20640  
 20641  func init() {
 20642  	crt.Xstrncpy(nil, &_clearAllSharedCacheTableLocksØ00__func__Ø000[0], str(20939), 30)
 20643  }
 20644  
 20645  // C comment
 20646  //  /*
 20647  //  ** If there are no outstanding cursors and we are not in the middle
 20648  //  ** of a transaction but there is a read lock on the database, then
 20649  //  ** this routine unrefs the first page of the database file which
 20650  //  ** has the effect of releasing the read lock.
 20651  //  **
 20652  //  ** If there is a transaction in progress, this routine is a no-op.
 20653  //  */
 20654  func _unlockBtreeIfUnused(tls *crt.TLS, _pBt *XBtShared) {
 20655  	var _1_pPage1 *XMemPage
 20656  	func() {
 20657  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 20658  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62138), unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000), unsafe.Pointer(str(9235)))
 20659  			crt.X__builtin_abort(tls)
 20660  		}
 20661  	}()
 20662  	func() {
 20663  		if _countValidCursors(tls, _pBt, int32(0)) != int32(0) && int32(_pBt.XinTransaction) <= int32(0) {
 20664  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62139), unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000), unsafe.Pointer(str(20969)))
 20665  			crt.X__builtin_abort(tls)
 20666  		}
 20667  	}()
 20668  	if (int32(_pBt.XinTransaction) == int32(0)) && ((*XMemPage)(_pBt.XpPage1) != nil) {
 20669  		_1_pPage1 = (*XMemPage)(_pBt.XpPage1)
 20670  		func() {
 20671  			if _1_pPage1.XaData == nil {
 20672  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62142), unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000), unsafe.Pointer(str(21030)))
 20673  				crt.X__builtin_abort(tls)
 20674  			}
 20675  		}()
 20676  		func() {
 20677  			if _sqlite3PagerRefcount(tls, (*XPager)(_pBt.XpPager)) != int32(1) {
 20678  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62143), unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000), unsafe.Pointer(str(21044)))
 20679  				crt.X__builtin_abort(tls)
 20680  			}
 20681  		}()
 20682  		*(**XMemPage)(unsafe.Pointer(&_pBt.XpPage1)) = nil
 20683  		_releasePageNotNull(tls, _1_pPage1)
 20684  	}
 20685  }
 20686  
 20687  var _unlockBtreeIfUnusedØ00__func__Ø000 [20]int8
 20688  
 20689  func init() {
 20690  	crt.Xstrncpy(nil, &_unlockBtreeIfUnusedØ00__func__Ø000[0], str(21081), 20)
 20691  }
 20692  
 20693  // C comment
 20694  //  /*
 20695  //  ** Return the sum of the reference counts for all pages held by pPager.
 20696  //  */
 20697  func _sqlite3PagerRefcount(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 20698  	return _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache))
 20699  }
 20700  
 20701  // C comment
 20702  //  /*
 20703  //  ** Erase all schema information from all attached databases (including
 20704  //  ** "main" and "temp") for a single database connection.
 20705  //  */
 20706  func _sqlite3ResetAllSchemasOfConnection(tls *crt.TLS, _db *Xsqlite3) {
 20707  	var _i int32
 20708  	var _1_pDb *XDb
 20709  	_sqlite3BtreeEnterAll(tls, _db)
 20710  	_i = int32(0)
 20711  _0:
 20712  	if _i >= _db.XnDb {
 20713  		goto _3
 20714  	}
 20715  	_1_pDb = elem27((*XDb)(_db.XaDb), uintptr(_i))
 20716  	if _1_pDb.XpSchema != nil {
 20717  		_sqlite3SchemaClear(tls, _1_pDb.XpSchema)
 20718  	}
 20719  	_i += 1
 20720  	goto _0
 20721  _3:
 20722  	_db.Xflags &= int32(-3)
 20723  	_sqlite3VtabUnlockList(tls, _db)
 20724  	_sqlite3BtreeLeaveAll(tls, _db)
 20725  	_sqlite3CollapseDatabaseArray(tls, _db)
 20726  }
 20727  
 20728  // C comment
 20729  //  /*
 20730  //  ** Free all resources held by the schema structure. The void* argument points
 20731  //  ** at a Schema struct. This function does not call sqlite3DbFree(db, ) on the
 20732  //  ** pointer itself, it just cleans up subsidiary resources (i.e. the contents
 20733  //  ** of the schema hash tables).
 20734  //  **
 20735  //  ** The Schema.cache_size variable is not cleared.
 20736  //  */
 20737  func _sqlite3SchemaClear(tls *crt.TLS, _p unsafe.Pointer) {
 20738  	var _temp1, _temp2 XHash
 20739  	var _pSchema *XSchema
 20740  	var _pElem *XHashElem
 20741  	var _2_pTab *XTable
 20742  	_pSchema = (*XSchema)(_p)
 20743  	_temp1 = _pSchema.XtblHash
 20744  	_temp2 = _pSchema.XtrigHash
 20745  	_sqlite3HashInit(tls, &_pSchema.XtrigHash)
 20746  	_sqlite3HashClear(tls, &_pSchema.XidxHash)
 20747  	_pElem = (*XHashElem)(_temp2.Xfirst)
 20748  _0:
 20749  	if _pElem == nil {
 20750  		goto _3
 20751  	}
 20752  	_sqlite3DeleteTrigger(tls, nil, (*XTrigger)(_pElem.Xdata))
 20753  	_pElem = (*XHashElem)(_pElem.Xnext)
 20754  	goto _0
 20755  _3:
 20756  	_sqlite3HashClear(tls, &_temp2)
 20757  	_sqlite3HashInit(tls, &_pSchema.XtblHash)
 20758  	_pElem = (*XHashElem)(_temp1.Xfirst)
 20759  _4:
 20760  	if _pElem == nil {
 20761  		goto _7
 20762  	}
 20763  	_2_pTab = (*XTable)(_pElem.Xdata)
 20764  	_sqlite3DeleteTable(tls, nil, _2_pTab)
 20765  	_pElem = (*XHashElem)(_pElem.Xnext)
 20766  	goto _4
 20767  _7:
 20768  	_sqlite3HashClear(tls, &_temp1)
 20769  	_sqlite3HashClear(tls, &_pSchema.XfkeyHash)
 20770  	*(**XTable)(unsafe.Pointer(&_pSchema.XpSeqTab)) = nil
 20771  	if (int32(_pSchema.XschemaFlags) & int32(1)) != 0 {
 20772  		_pSchema.XiGeneration += 1
 20773  		{
 20774  			p := &_pSchema.XschemaFlags
 20775  			*p = uint16(int32(*p) & int32(-2))
 20776  		}
 20777  	}
 20778  }
 20779  
 20780  // C comment
 20781  //  /* Turn bulk memory into a hash table object by initializing the
 20782  //  ** fields of the Hash structure.
 20783  //  **
 20784  //  ** "pNew" is a pointer to the hash table that is to be initialized.
 20785  //  */
 20786  func _sqlite3HashInit(tls *crt.TLS, _pNew *XHash) {
 20787  	func() {
 20788  		if _pNew == nil {
 20789  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29250), unsafe.Pointer(&_sqlite3HashInitØ00__func__Ø000), unsafe.Pointer(str(21101)))
 20790  			crt.X__builtin_abort(tls)
 20791  		}
 20792  	}()
 20793  	*(**XHashElem)(unsafe.Pointer(&_pNew.Xfirst)) = nil
 20794  	_pNew.Xcount = 0
 20795  	_pNew.Xhtsize = 0
 20796  	*(**T_ht)(unsafe.Pointer(&_pNew.Xht)) = nil
 20797  }
 20798  
 20799  var _sqlite3HashInitØ00__func__Ø000 [16]int8
 20800  
 20801  func init() {
 20802  	crt.Xstrncpy(nil, &_sqlite3HashInitØ00__func__Ø000[0], str(21109), 16)
 20803  }
 20804  
 20805  // C comment
 20806  //  /* Remove all entries from a hash table.  Reclaim all memory.
 20807  //  ** Call this routine to delete a hash table or to reset a hash table
 20808  //  ** to the empty state.
 20809  //  */
 20810  func _sqlite3HashClear(tls *crt.TLS, _pH *XHash) {
 20811  	var _elem, _1_next_elem *XHashElem
 20812  	func() {
 20813  		if _pH == nil {
 20814  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29264), unsafe.Pointer(&_sqlite3HashClearØ00__func__Ø000), unsafe.Pointer(str(21125)))
 20815  			crt.X__builtin_abort(tls)
 20816  		}
 20817  	}()
 20818  	_elem = (*XHashElem)(_pH.Xfirst)
 20819  	*(**XHashElem)(unsafe.Pointer(&_pH.Xfirst)) = nil
 20820  	Xsqlite3_free(tls, _pH.Xht)
 20821  	*(**T_ht)(unsafe.Pointer(&_pH.Xht)) = nil
 20822  	_pH.Xhtsize = 0
 20823  _2:
 20824  	if _elem != nil {
 20825  		_1_next_elem = (*XHashElem)(_elem.Xnext)
 20826  		Xsqlite3_free(tls, unsafe.Pointer(_elem))
 20827  		_elem = _1_next_elem
 20828  		goto _2
 20829  	}
 20830  	_pH.Xcount = 0
 20831  }
 20832  
 20833  var _sqlite3HashClearØ00__func__Ø000 [17]int8
 20834  
 20835  func init() {
 20836  	crt.Xstrncpy(nil, &_sqlite3HashClearØ00__func__Ø000[0], str(21131), 17)
 20837  }
 20838  
 20839  // C comment
 20840  //  /*
 20841  //  ** Recursively delete a Trigger structure
 20842  //  */
 20843  func _sqlite3DeleteTrigger(tls *crt.TLS, _db *Xsqlite3, _pTrigger *XTrigger) {
 20844  	if _pTrigger == nil {
 20845  		return
 20846  	}
 20847  	_sqlite3DeleteTriggerStep(tls, _db, (*XTriggerStep)(_pTrigger.Xstep_list))
 20848  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTrigger.XzName))
 20849  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTrigger.Xtable))
 20850  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pTrigger.XpWhen))
 20851  	_sqlite3IdListDelete(tls, _db, (*XIdList)(_pTrigger.XpColumns))
 20852  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTrigger))
 20853  }
 20854  
 20855  // C comment
 20856  //  /*
 20857  //  ** Delete a linked list of TriggerStep structures.
 20858  //  */
 20859  func _sqlite3DeleteTriggerStep(tls *crt.TLS, _db *Xsqlite3, _pTriggerStep *XTriggerStep) {
 20860  	var _1_pTmp *XTriggerStep
 20861  _0:
 20862  	if _pTriggerStep != nil {
 20863  		_1_pTmp = _pTriggerStep
 20864  		_pTriggerStep = (*XTriggerStep)(_pTriggerStep.XpNext)
 20865  		_sqlite3ExprDelete(tls, _db, (*XExpr)(_1_pTmp.XpWhere))
 20866  		_sqlite3ExprListDelete(tls, _db, (*XExprList)(_1_pTmp.XpExprList))
 20867  		_sqlite3SelectDelete(tls, _db, (*XSelect)(_1_pTmp.XpSelect))
 20868  		_sqlite3IdListDelete(tls, _db, (*XIdList)(_1_pTmp.XpIdList))
 20869  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pTmp))
 20870  		goto _0
 20871  	}
 20872  }
 20873  
 20874  func _sqlite3ExprDelete(tls *crt.TLS, _db *Xsqlite3, _p *XExpr) {
 20875  	if _p != nil {
 20876  		_sqlite3ExprDeleteNN(tls, _db, _p)
 20877  	}
 20878  }
 20879  
 20880  // C comment
 20881  //  /*
 20882  //  ** Recursively delete an expression tree.
 20883  //  */
 20884  func _sqlite3ExprDeleteNN(tls *crt.TLS, _db *Xsqlite3, _p *XExpr) {
 20885  	func() {
 20886  		if _p == nil {
 20887  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91912), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(807)))
 20888  			crt.X__builtin_abort(tls)
 20889  		}
 20890  	}()
 20891  	func() {
 20892  		if (_p.Xflags&uint32(1024)) != (0) && (*(*int32)(unsafe.Pointer(&_p.Xu))) < int32(0) {
 20893  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91914), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21148)))
 20894  			crt.X__builtin_abort(tls)
 20895  		}
 20896  	}()
 20897  	if ((_p.Xflags & uint32(8388608)) != (0)) && ((_p.Xflags & uint32(16384)) == (0)) {
 20898  		func() {
 20899  			if (*XExpr)(_p.XpLeft) != nil {
 20900  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91917), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21199)))
 20901  				crt.X__builtin_abort(tls)
 20902  			}
 20903  		}()
 20904  		func() {
 20905  			if (*XExpr)(_p.XpRight) != nil {
 20906  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91918), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21211)))
 20907  				crt.X__builtin_abort(tls)
 20908  			}
 20909  		}()
 20910  		func() {
 20911  			if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil {
 20912  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91919), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21224)))
 20913  				crt.X__builtin_abort(tls)
 20914  			}
 20915  		}()
 20916  	}
 20917  	if (_p.Xflags & uint32(8404992)) != (0) {
 20918  		goto _13
 20919  	}
 20920  	func() {
 20921  		if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil && (*XExpr)(_p.XpRight) != nil {
 20922  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91924), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21240)))
 20923  			crt.X__builtin_abort(tls)
 20924  		}
 20925  	}()
 20926  	if (_p.XpLeft != nil) && (int32(_p.Xop) != int32(159)) {
 20927  		_sqlite3ExprDeleteNN(tls, _db, (*XExpr)(_p.XpLeft))
 20928  	}
 20929  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpRight))
 20930  	if (_p.Xflags & uint32(2048)) != (0) {
 20931  		_sqlite3SelectDelete(tls, _db, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))))
 20932  		goto _20
 20933  	}
 20934  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))))
 20935  _20:
 20936  _13:
 20937  	if (_p.Xflags & uint32(65536)) != (0) {
 20938  		_sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_p.Xu))))
 20939  	}
 20940  	if (_p.Xflags & uint32(32768)) == (0) {
 20941  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 20942  	}
 20943  }
 20944  
 20945  var _sqlite3ExprDeleteNNØ00__func__Ø000 [20]int8
 20946  
 20947  func init() {
 20948  	crt.Xstrncpy(nil, &_sqlite3ExprDeleteNNØ00__func__Ø000[0], str(21270), 20)
 20949  }
 20950  
 20951  // C comment
 20952  //  /*
 20953  //  ** Delete the given Select structure and all of its substructures.
 20954  //  */
 20955  func _sqlite3SelectDelete(tls *crt.TLS, _db *Xsqlite3, _p *XSelect) {
 20956  	if _p != nil {
 20957  		_clearSelect(tls, _db, _p, int32(1))
 20958  	}
 20959  }
 20960  
 20961  // C comment
 20962  //  /*
 20963  //  ** Delete all the content of a Select structure.  Deallocate the structure
 20964  //  ** itself only if bFree is true.
 20965  //  */
 20966  func _clearSelect(tls *crt.TLS, _db *Xsqlite3, _p *XSelect, _bFree int32) {
 20967  	var _1_pPrior *XSelect
 20968  _0:
 20969  	if _p == nil {
 20970  		goto _1
 20971  	}
 20972  	_1_pPrior = (*XSelect)(_p.XpPrior)
 20973  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XpEList))
 20974  	_sqlite3SrcListDelete(tls, _db, (*XSrcList)(_p.XpSrc))
 20975  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpWhere))
 20976  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XpGroupBy))
 20977  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpHaving))
 20978  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XpOrderBy))
 20979  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpLimit))
 20980  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpOffset))
 20981  	if _p.XpWith != nil {
 20982  		_sqlite3WithDelete(tls, _db, (*XWith)(_p.XpWith))
 20983  	}
 20984  	if _bFree != 0 {
 20985  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 20986  	}
 20987  	_p = _1_pPrior
 20988  	_bFree = int32(1)
 20989  	goto _0
 20990  _1:
 20991  }
 20992  
 20993  func _sqlite3ExprListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XExprList) {
 20994  	if _pList != nil {
 20995  		_exprListDeleteNN(tls, _db, _pList)
 20996  	}
 20997  }
 20998  
 20999  // C comment
 21000  //  /*
 21001  //  ** Delete an entire expression list.
 21002  //  */
 21003  func _exprListDeleteNN(tls *crt.TLS, _db *Xsqlite3, _pList *XExprList) {
 21004  	var _i int32
 21005  	var _pItem *TExprList_item
 21006  	_i = _pList.XnExpr
 21007  	_pItem = (*TExprList_item)(unsafe.Pointer(&_pList.Xa))
 21008  	func() {
 21009  		if _pList.XnExpr <= int32(0) {
 21010  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92555), unsafe.Pointer(&_exprListDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21290)))
 21011  			crt.X__builtin_abort(tls)
 21012  		}
 21013  	}()
 21014  _2:
 21015  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pItem.XpExpr))
 21016  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.XzName))
 21017  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.XzSpan))
 21018  	*(*uintptr)(unsafe.Pointer(&_pItem)) += uintptr(32)
 21019  	if preInc2(&_i, -1) > int32(0) {
 21020  		goto _2
 21021  	}
 21022  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pList))
 21023  	_ = _i
 21024  }
 21025  
 21026  var _exprListDeleteNNØ00__func__Ø000 [17]int8
 21027  
 21028  func init() {
 21029  	crt.Xstrncpy(nil, &_exprListDeleteNNØ00__func__Ø000[0], str(21305), 17)
 21030  }
 21031  
 21032  // C comment
 21033  //  /*
 21034  //  ** Delete an entire SrcList including all its substructure.
 21035  //  */
 21036  func _sqlite3SrcListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XSrcList) {
 21037  	var _i int32
 21038  	var _pItem *TSrcList_item
 21039  	if _pList == nil {
 21040  		return
 21041  	}
 21042  	*func() *int32 { _pItem = (*TSrcList_item)(unsafe.Pointer(&_pList.Xa)); return &_i }() = int32(0)
 21043  _1:
 21044  	if _i >= _pList.XnSrc {
 21045  		goto _4
 21046  	}
 21047  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.XzDatabase))
 21048  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.XzName))
 21049  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.XzAlias))
 21050  	if ((uint32((_pItem.Xfg.XnotIndexed)>>1) << 31) >> 31) != 0 {
 21051  		_sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pItem.Xu1))))
 21052  	}
 21053  	if ((uint32((_pItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0 {
 21054  		_sqlite3ExprListDelete(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pItem.Xu1))))
 21055  	}
 21056  	_sqlite3DeleteTable(tls, _db, (*XTable)(_pItem.XpTab))
 21057  	_sqlite3SelectDelete(tls, _db, (*XSelect)(_pItem.XpSelect))
 21058  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pItem.XpOn))
 21059  	_sqlite3IdListDelete(tls, _db, (*XIdList)(_pItem.XpUsing))
 21060  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(112)
 21061  	goto _1
 21062  _4:
 21063  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pList))
 21064  }
 21065  
 21066  func _sqlite3DeleteTable(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) {
 21067  	if _pTable == nil {
 21068  		return
 21069  	}
 21070  	if ((_db == nil) || (_db.XpnBytesFreed == nil)) && (preInc34(&_pTable.XnTabRef, uint32(4294967295)) > (0)) {
 21071  		return
 21072  	}
 21073  	_deleteTable(tls, _db, _pTable)
 21074  }
 21075  
 21076  // C comment
 21077  //  /*
 21078  //  ** Remove the memory data structures associated with the given
 21079  //  ** Table.  No changes are made to disk by this routine.
 21080  //  **
 21081  //  ** This routine just deletes the data structure.  It does not unlink
 21082  //  ** the table data structure from the hash table.  But it does destroy
 21083  //  ** memory structures of the indices and foreign keys associated with
 21084  //  ** the table.
 21085  //  **
 21086  //  ** The db parameter is optional.  It is needed if the Table object
 21087  //  ** contains lookaside memory.  (Table objects in the schema do not use
 21088  //  ** lookaside memory, but some ephemeral Table objects do.)  Or the
 21089  //  ** db parameter can be used with db->pnBytesFreed to measure the memory
 21090  //  ** used by the Table object.
 21091  //  */
 21092  func _deleteTable(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) {
 21093  	var _nLookaside int32
 21094  	var _2_zName *int8
 21095  	var _pIndex, _pNext, _2_pOld *XIndex
 21096  	_nLookaside = func() int32 {
 21097  		if (_db != nil) && ((_pTable.XtabFlags & uint32(2)) == (0)) {
 21098  			return (_db.Xlookaside.XnOut)
 21099  		}
 21100  		return int32(0)
 21101  	}()
 21102  	_pIndex = (*XIndex)(_pTable.XpIndex)
 21103  _3:
 21104  	if _pIndex == nil {
 21105  		goto _6
 21106  	}
 21107  	_pNext = (*XIndex)(_pIndex.XpNext)
 21108  	func() {
 21109  		if (*XSchema)(_pIndex.XpSchema) != (*XSchema)(_pTable.XpSchema) && (_pTable.XnModuleArg == 0 || int32((uint32(_pIndex.XidxType)<<30)>>30) == int32(0)) {
 21110  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100309), unsafe.Pointer(&_deleteTableØ00__func__Ø000), unsafe.Pointer(str(21322)))
 21111  			crt.X__builtin_abort(tls)
 21112  		}
 21113  	}()
 21114  	if ((_db == nil) || (_db.XpnBytesFreed == nil)) && (_pTable.XnModuleArg == 0) {
 21115  		_2_zName = _pIndex.XzName
 21116  		_2_pOld = (*XIndex)(_sqlite3HashInsert(tls, &((*XSchema)(_pIndex.XpSchema).XidxHash), _2_zName, nil))
 21117  		func() {
 21118  			if _db != nil && _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_pIndex.XpSchema)) == 0 {
 21119  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100316), unsafe.Pointer(&_deleteTableØ00__func__Ø000), unsafe.Pointer(str(21420)))
 21120  				crt.X__builtin_abort(tls)
 21121  			}
 21122  		}()
 21123  		func() {
 21124  			if _2_pOld != _pIndex && _2_pOld != nil {
 21125  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100317), unsafe.Pointer(&_deleteTableØ00__func__Ø000), unsafe.Pointer(str(21476)))
 21126  				crt.X__builtin_abort(tls)
 21127  			}
 21128  		}()
 21129  	}
 21130  	_freeIndex(tls, _db, _pIndex)
 21131  	_pIndex = _pNext
 21132  	goto _3
 21133  _6:
 21134  	_sqlite3FkDelete(tls, _db, _pTable)
 21135  	_sqlite3DeleteColumnNames(tls, _db, _pTable)
 21136  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTable.XzName))
 21137  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTable.XzColAff))
 21138  	_sqlite3SelectDelete(tls, _db, (*XSelect)(_pTable.XpSelect))
 21139  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_pTable.XpCheck))
 21140  	_sqlite3VtabClear(tls, _db, _pTable)
 21141  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTable))
 21142  	func() {
 21143  		if _nLookaside != int32(0) && _nLookaside != (_db.Xlookaside.XnOut) {
 21144  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100338), unsafe.Pointer(&_deleteTableØ00__func__Ø000), unsafe.Pointer(str(21500)))
 21145  			crt.X__builtin_abort(tls)
 21146  		}
 21147  	}()
 21148  }
 21149  
 21150  var _deleteTableØ00__func__Ø000 [12]int8
 21151  
 21152  func init() {
 21153  	crt.Xstrncpy(nil, &_deleteTableØ00__func__Ø000[0], str(21548), 12)
 21154  }
 21155  
 21156  // C comment
 21157  //  /* Insert an element into the hash table pH.  The key is pKey
 21158  //  ** and the data is "data".
 21159  //  **
 21160  //  ** If no element exists with a matching key, then a new
 21161  //  ** element is created and NULL is returned.
 21162  //  **
 21163  //  ** If another element already exists with the same key, then the
 21164  //  ** new data replaces the old data and the old data is returned.
 21165  //  ** The key is not copied in this instance.  If a malloc fails, then
 21166  //  ** the new data is returned and the hash table is unchanged.
 21167  //  **
 21168  //  ** If the "data" parameter to this function is NULL, then the
 21169  //  ** element corresponding to "key" is removed from the hash table.
 21170  //  */
 21171  func _sqlite3HashInsert(tls *crt.TLS, _pH *XHash, _pKey *int8, _data unsafe.Pointer) (r0 unsafe.Pointer) {
 21172  	var _h uint32
 21173  	var _1_old_data unsafe.Pointer
 21174  	var _elem, _new_elem *XHashElem
 21175  	func() {
 21176  		if _pH == nil {
 21177  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29470), unsafe.Pointer(&_sqlite3HashInsertØ00__func__Ø000), unsafe.Pointer(str(21125)))
 21178  			crt.X__builtin_abort(tls)
 21179  		}
 21180  	}()
 21181  	func() {
 21182  		if _pKey == nil {
 21183  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29471), unsafe.Pointer(&_sqlite3HashInsertØ00__func__Ø000), unsafe.Pointer(str(21560)))
 21184  			crt.X__builtin_abort(tls)
 21185  		}
 21186  	}()
 21187  	_elem = _findElementWithHash(tls, _pH, _pKey, &_h)
 21188  	if _elem == nil {
 21189  		goto _4
 21190  	}
 21191  	_1_old_data = _elem.Xdata
 21192  	if _data == nil {
 21193  		_removeElementGivenHash(tls, _pH, _elem, _h)
 21194  		goto _6
 21195  	}
 21196  	_elem.Xdata = _data
 21197  	_elem.XpKey = _pKey
 21198  _6:
 21199  	return _1_old_data
 21200  
 21201  _4:
 21202  	if _data == nil {
 21203  		return nil
 21204  	}
 21205  	_new_elem = (*XHashElem)(_sqlite3Malloc(tls, uint64(32)))
 21206  	if _new_elem == nil {
 21207  		return _data
 21208  	}
 21209  	_new_elem.XpKey = _pKey
 21210  	_new_elem.Xdata = _data
 21211  	_pH.Xcount += 1
 21212  	if _pH.Xcount < uint32(10) || _pH.Xcount <= (uint32(2)*_pH.Xhtsize) {
 21213  		goto _10
 21214  	}
 21215  	if _rehash(tls, _pH, _pH.Xcount*uint32(2)) != 0 {
 21216  		func() {
 21217  			if _pH.Xhtsize <= (0) {
 21218  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29491), unsafe.Pointer(&_sqlite3HashInsertØ00__func__Ø000), unsafe.Pointer(str(21568)))
 21219  				crt.X__builtin_abort(tls)
 21220  			}
 21221  		}()
 21222  		_h = _strHash(tls, _pKey) % _pH.Xhtsize
 21223  	}
 21224  _10:
 21225  	_insertElement(tls, _pH, func() *T_ht {
 21226  		if _pH.Xht != nil {
 21227  			return elem41((*T_ht)(_pH.Xht), uintptr(_h))
 21228  		}
 21229  		return nil
 21230  	}(), _new_elem)
 21231  	return nil
 21232  }
 21233  
 21234  var _sqlite3HashInsertØ00__func__Ø000 [18]int8
 21235  
 21236  func init() {
 21237  	crt.Xstrncpy(nil, &_sqlite3HashInsertØ00__func__Ø000[0], str(21581), 18)
 21238  }
 21239  
 21240  // C comment
 21241  //  /* This function (for internal use only) locates an element in an
 21242  //  ** hash table that matches the given key.  The hash for this key is
 21243  //  ** also computed and returned in the *pH parameter.
 21244  //  */
 21245  func _findElementWithHash(tls *crt.TLS, _pH *XHash, _pKey *int8, _pHash *uint32) (r0 *XHashElem) {
 21246  	var _count int32
 21247  	var _h uint32
 21248  	var _elem *XHashElem
 21249  	var _1_pEntry *T_ht
 21250  	if _pH.Xht != nil {
 21251  		_h = _strHash(tls, _pKey) % _pH.Xhtsize
 21252  		_1_pEntry = elem41((*T_ht)(_pH.Xht), uintptr(_h))
 21253  		_elem = (*XHashElem)(_1_pEntry.Xchain)
 21254  		_count = _1_pEntry.Xcount
 21255  		goto _1
 21256  	}
 21257  	_h = 0
 21258  	_elem = (*XHashElem)(_pH.Xfirst)
 21259  	_count = int32(_pH.Xcount)
 21260  _1:
 21261  	*_pHash = _h
 21262  _2:
 21263  	if postInc2(&_count, -1) == 0 {
 21264  		goto _3
 21265  	}
 21266  	func() {
 21267  		if _elem == nil {
 21268  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29394), unsafe.Pointer(&_findElementWithHashØ00__func__Ø000), unsafe.Pointer(str(21599)))
 21269  			crt.X__builtin_abort(tls)
 21270  		}
 21271  	}()
 21272  	if _sqlite3StrICmp(tls, _elem.XpKey, _pKey) == int32(0) {
 21273  		return _elem
 21274  	}
 21275  	_elem = (*XHashElem)(_elem.Xnext)
 21276  	goto _2
 21277  _3:
 21278  	return nil
 21279  
 21280  	_ = _count
 21281  	panic(0)
 21282  }
 21283  
 21284  // C comment
 21285  //  /*
 21286  //  ** The hashing function.
 21287  //  */
 21288  func _strHash(tls *crt.TLS, _z *int8) (r0 uint32) {
 21289  	var _h uint32
 21290  	var _c uint8
 21291  	_h = uint32(0)
 21292  _0:
 21293  	if int32(store3(&_c, uint8(*postInc1(&_z, 1)))) != int32(0) {
 21294  		_h += uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(_c)))
 21295  		_h *= uint32(2654435761)
 21296  		goto _0
 21297  	}
 21298  	return _h
 21299  }
 21300  
 21301  var _findElementWithHashØ00__func__Ø000 [20]int8
 21302  
 21303  func init() {
 21304  	crt.Xstrncpy(nil, &_findElementWithHashØ00__func__Ø000[0], str(21607), 20)
 21305  }
 21306  
 21307  // C comment
 21308  //  /* Remove a single entry from the hash table given a pointer to that
 21309  //  ** element and a hash on the element's key.
 21310  //  */
 21311  func _removeElementGivenHash(tls *crt.TLS, _pH *XHash, _elem *XHashElem, _h uint32) {
 21312  	var _pEntry *T_ht
 21313  	if _elem.Xprev != nil {
 21314  		*(**XHashElem)(unsafe.Pointer(&((*XHashElem)(_elem.Xprev).Xnext))) = (*XHashElem)(_elem.Xnext)
 21315  		goto _1
 21316  	}
 21317  	*(**XHashElem)(unsafe.Pointer(&_pH.Xfirst)) = (*XHashElem)(_elem.Xnext)
 21318  _1:
 21319  	if _elem.Xnext != nil {
 21320  		*(**XHashElem)(unsafe.Pointer(&((*XHashElem)(_elem.Xnext).Xprev))) = (*XHashElem)(_elem.Xprev)
 21321  	}
 21322  	if _pH.Xht == nil {
 21323  		goto _3
 21324  	}
 21325  	_pEntry = elem41((*T_ht)(_pH.Xht), uintptr(_h))
 21326  	if (*XHashElem)(_pEntry.Xchain) == _elem {
 21327  		*(**XHashElem)(unsafe.Pointer(&_pEntry.Xchain)) = (*XHashElem)(_elem.Xnext)
 21328  	}
 21329  	_pEntry.Xcount -= 1
 21330  	func() {
 21331  		if _pEntry.Xcount < int32(0) {
 21332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29426), unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000), unsafe.Pointer(str(21627)))
 21333  			crt.X__builtin_abort(tls)
 21334  		}
 21335  	}()
 21336  _3:
 21337  	Xsqlite3_free(tls, unsafe.Pointer(_elem))
 21338  	_pH.Xcount -= 1
 21339  	if _pH.Xcount == (0) {
 21340  		func() {
 21341  			if (*XHashElem)(_pH.Xfirst) != nil {
 21342  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29431), unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000), unsafe.Pointer(str(21644)))
 21343  				crt.X__builtin_abort(tls)
 21344  			}
 21345  		}()
 21346  		func() {
 21347  			if _pH.Xcount != (0) {
 21348  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29432), unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000), unsafe.Pointer(str(21657)))
 21349  				crt.X__builtin_abort(tls)
 21350  			}
 21351  		}()
 21352  		_sqlite3HashClear(tls, _pH)
 21353  	}
 21354  }
 21355  
 21356  var _removeElementGivenHashØ00__func__Ø000 [23]int8
 21357  
 21358  func init() {
 21359  	crt.Xstrncpy(nil, &_removeElementGivenHashØ00__func__Ø000[0], str(21670), 23)
 21360  }
 21361  
 21362  // C comment
 21363  //  /* Resize the hash table so that it cantains "new_size" buckets.
 21364  //  **
 21365  //  ** The hash table might fail to resize if sqlite3_malloc() fails or
 21366  //  ** if the new size is the same as the prior size.
 21367  //  ** Return TRUE if the resize occurs and false if not.
 21368  //  */
 21369  func _rehash(tls *crt.TLS, _pH *XHash, _new_size uint32) (r0 int32) {
 21370  	var _2_h uint32
 21371  	var _elem, _next_elem *XHashElem
 21372  	var _new_ht *T_ht
 21373  	if (uint64(_new_size) * uint64(16)) > uint64(1024) {
 21374  		_new_size = uint32(64)
 21375  	}
 21376  	if _new_size == _pH.Xhtsize {
 21377  		return int32(0)
 21378  	}
 21379  	_sqlite3BeginBenignMalloc(tls)
 21380  	_new_ht = (*T_ht)(_sqlite3Malloc(tls, uint64(_new_size)*uint64(16)))
 21381  	_sqlite3EndBenignMalloc(tls)
 21382  	if _new_ht == nil {
 21383  		return int32(0)
 21384  	}
 21385  	Xsqlite3_free(tls, _pH.Xht)
 21386  	*(**T_ht)(unsafe.Pointer(&_pH.Xht)) = _new_ht
 21387  	_pH.Xhtsize = store34(&_new_size, uint32(uint64(_sqlite3MallocSize(tls, unsafe.Pointer(_new_ht)))/uint64(16)))
 21388  	crt.Xmemset(tls, unsafe.Pointer(_new_ht), int32(0), uint64(_new_size)*uint64(16))
 21389  	*(**XHashElem)(unsafe.Pointer(&(func() *XHash { _elem = (*XHashElem)(_pH.Xfirst); return _pH }().Xfirst))) = nil
 21390  _3:
 21391  	if _elem == nil {
 21392  		goto _6
 21393  	}
 21394  	_2_h = _strHash(tls, _elem.XpKey) % _new_size
 21395  	_next_elem = (*XHashElem)(_elem.Xnext)
 21396  	_insertElement(tls, _pH, elem41(_new_ht, uintptr(_2_h)), _elem)
 21397  	_elem = _next_elem
 21398  	goto _3
 21399  _6:
 21400  	return int32(1)
 21401  }
 21402  
 21403  // C comment
 21404  //  /* Link pNew element into the hash table pH.  If pEntry!=0 then also
 21405  //  ** insert pNew into the pEntry hash bucket.
 21406  //  */
 21407  func _insertElement(tls *crt.TLS, _pH *XHash, _pEntry *T_ht, _pNew *XHashElem) {
 21408  	var _pHead *XHashElem
 21409  	if _pEntry != nil {
 21410  		_pHead = func() *XHashElem {
 21411  			if _pEntry.Xcount != 0 {
 21412  				return (*XHashElem)(_pEntry.Xchain)
 21413  			}
 21414  			return nil
 21415  		}()
 21416  		_pEntry.Xcount += 1
 21417  		*(**XHashElem)(unsafe.Pointer(&_pEntry.Xchain)) = _pNew
 21418  		goto _3
 21419  	}
 21420  	_pHead = nil
 21421  _3:
 21422  	if _pHead == nil {
 21423  		goto _4
 21424  	}
 21425  	*(**XHashElem)(unsafe.Pointer(&_pNew.Xnext)) = _pHead
 21426  	*(**XHashElem)(unsafe.Pointer(&_pNew.Xprev)) = (*XHashElem)(_pHead.Xprev)
 21427  	if _pHead.Xprev != nil {
 21428  		*(**XHashElem)(unsafe.Pointer(&((*XHashElem)(_pHead.Xprev).Xnext))) = _pNew
 21429  		goto _6
 21430  	}
 21431  	*(**XHashElem)(unsafe.Pointer(&_pH.Xfirst)) = _pNew
 21432  _6:
 21433  	*(**XHashElem)(unsafe.Pointer(&_pHead.Xprev)) = _pNew
 21434  	goto _7
 21435  _4:
 21436  	*(**XHashElem)(unsafe.Pointer(&_pNew.Xnext)) = (*XHashElem)(_pH.Xfirst)
 21437  	if _pH.Xfirst != nil {
 21438  		*(**XHashElem)(unsafe.Pointer(&((*XHashElem)(_pH.Xfirst).Xprev))) = _pNew
 21439  	}
 21440  	*(**XHashElem)(unsafe.Pointer(&_pNew.Xprev)) = nil
 21441  	*(**XHashElem)(unsafe.Pointer(&_pH.Xfirst)) = _pNew
 21442  _7:
 21443  }
 21444  
 21445  // C comment
 21446  //  /*
 21447  //  ** Return true if the correct mutexes are held for accessing the
 21448  //  ** db->aDb[iDb].pSchema structure.  The mutexes required for schema
 21449  //  ** access are:
 21450  //  **
 21451  //  **   (1) The mutex on db
 21452  //  **   (2) if iDb!=1, then the mutex on db->aDb[iDb].pBt.
 21453  //  **
 21454  //  ** If pSchema is not NULL, then iDb is computed from pSchema and
 21455  //  ** db using sqlite3SchemaToIndex().
 21456  //  */
 21457  func _sqlite3SchemaMutexHeld(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pSchema *XSchema) (r0 int32) {
 21458  	var _p *XBtree
 21459  	func() {
 21460  		if _db == nil {
 21461  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58977), unsafe.Pointer(&_sqlite3SchemaMutexHeldØ00__func__Ø000), unsafe.Pointer(str(1219)))
 21462  			crt.X__builtin_abort(tls)
 21463  		}
 21464  	}()
 21465  	if _pSchema != nil {
 21466  		_iDb = _sqlite3SchemaToIndex(tls, _db, _pSchema)
 21467  	}
 21468  	func() {
 21469  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 21470  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58979), unsafe.Pointer(&_sqlite3SchemaMutexHeldØ00__func__Ø000), unsafe.Pointer(str(21693)))
 21471  			crt.X__builtin_abort(tls)
 21472  		}
 21473  	}()
 21474  	if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 21475  		return int32(0)
 21476  	}
 21477  	if _iDb == int32(1) {
 21478  		return int32(1)
 21479  	}
 21480  	_p = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt)
 21481  	func() {
 21482  		if _p == nil {
 21483  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58983), unsafe.Pointer(&_sqlite3SchemaMutexHeldØ00__func__Ø000), unsafe.Pointer(str(807)))
 21484  			crt.X__builtin_abort(tls)
 21485  		}
 21486  	}()
 21487  	return bool2int((int32(_p.Xsharable) == int32(0)) || (int32(_p.Xlocked) == int32(1)))
 21488  }
 21489  
 21490  var _sqlite3SchemaMutexHeldØ00__func__Ø000 [23]int8
 21491  
 21492  func init() {
 21493  	crt.Xstrncpy(nil, &_sqlite3SchemaMutexHeldØ00__func__Ø000[0], str(21715), 23)
 21494  }
 21495  
 21496  // C comment
 21497  //  /*
 21498  //  ** Convert a schema pointer into the iDb index that indicates
 21499  //  ** which database file in db->aDb[] the schema refers to.
 21500  //  **
 21501  //  ** If the same database is attached more than once, the first
 21502  //  ** attached database is returned.
 21503  //  */
 21504  func _sqlite3SchemaToIndex(tls *crt.TLS, _db *Xsqlite3, _pSchema *XSchema) (r0 int32) {
 21505  	var _i int32
 21506  	_i = int32(-1000000)
 21507  	func() {
 21508  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 21509  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116147), unsafe.Pointer(&_sqlite3SchemaToIndexØ00__func__Ø000), unsafe.Pointer(str(881)))
 21510  			crt.X__builtin_abort(tls)
 21511  		}
 21512  	}()
 21513  	if _pSchema == nil {
 21514  		goto _2
 21515  	}
 21516  	_i = int32(0)
 21517  _3:
 21518  	if func() int32 {
 21519  		if _i < _db.XnDb {
 21520  			return int32(1)
 21521  		}
 21522  		return func() int32 {
 21523  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116149), unsafe.Pointer(&_sqlite3SchemaToIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 21524  			crt.X__builtin_abort(tls)
 21525  			return int32(0)
 21526  		}()
 21527  	}() == 0 {
 21528  		goto _8
 21529  	}
 21530  	if (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpSchema) == _pSchema {
 21531  		goto _8
 21532  	}
 21533  	_i += 1
 21534  	goto _3
 21535  _8:
 21536  	func() {
 21537  		if _i < int32(0) || _i >= _db.XnDb {
 21538  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116154), unsafe.Pointer(&_sqlite3SchemaToIndexØ00__func__Ø000), unsafe.Pointer(str(21738)))
 21539  			crt.X__builtin_abort(tls)
 21540  		}
 21541  	}()
 21542  _2:
 21543  	return _i
 21544  }
 21545  
 21546  var _sqlite3SchemaToIndexØ00__func__Ø000 [21]int8
 21547  
 21548  func init() {
 21549  	crt.Xstrncpy(nil, &_sqlite3SchemaToIndexØ00__func__Ø000[0], str(21756), 21)
 21550  }
 21551  
 21552  // C comment
 21553  //  /*
 21554  //  ** Reclaim the memory used by an index
 21555  //  */
 21556  func _freeIndex(tls *crt.TLS, _db *Xsqlite3, _p *XIndex) {
 21557  	_sqlite3DeleteIndexSamples(tls, _db, _p)
 21558  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpPartIdxWhere))
 21559  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XaColExpr))
 21560  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzColAff))
 21561  	if ((uint32(_p.XidxType>>4) << 31) >> 31) != 0 {
 21562  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XazColl))
 21563  	}
 21564  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p))
 21565  }
 21566  
 21567  // C comment
 21568  //  /*
 21569  //  ** If the Index.aSample variable is not NULL, delete the aSample[] array
 21570  //  ** and its contents.
 21571  //  */
 21572  func _sqlite3DeleteIndexSamples(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex) {
 21573  }
 21574  
 21575  // C comment
 21576  //  /*
 21577  //  ** Free all memory associated with foreign key definitions attached to
 21578  //  ** table pTab. Remove the deleted foreign keys from the Schema.fkeyHash
 21579  //  ** hash table.
 21580  //  */
 21581  func _sqlite3FkDelete(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable) {
 21582  	var _4_z *int8
 21583  	var _4_p unsafe.Pointer
 21584  	var _pFKey, _pNext *XFKey
 21585  	func() {
 21586  		if _db != nil && _pTab.XnModuleArg == 0 && _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_pTab.XpSchema)) == 0 {
 21587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108799), unsafe.Pointer(&_sqlite3FkDeleteØ00__func__Ø000), unsafe.Pointer(str(21777)))
 21588  			crt.X__builtin_abort(tls)
 21589  		}
 21590  	}()
 21591  	_pFKey = (*XFKey)(_pTab.XpFKey)
 21592  _4:
 21593  	if _pFKey == nil {
 21594  		goto _7
 21595  	}
 21596  	if _db != nil && _db.XpnBytesFreed != nil {
 21597  		goto _9
 21598  	}
 21599  	if _pFKey.XpPrevTo != nil {
 21600  		*(**XFKey)(unsafe.Pointer(&((*XFKey)(_pFKey.XpPrevTo).XpNextTo))) = (*XFKey)(_pFKey.XpNextTo)
 21601  		goto _11
 21602  	}
 21603  	_4_p = _pFKey.XpNextTo
 21604  	_4_z = func() *int8 {
 21605  		if _4_p != nil {
 21606  			return ((*XFKey)(_pFKey.XpNextTo).XzTo)
 21607  		}
 21608  		return _pFKey.XzTo
 21609  	}()
 21610  	_sqlite3HashInsert(tls, &((*XSchema)(_pTab.XpSchema).XfkeyHash), _4_z, _4_p)
 21611  _11:
 21612  	if _pFKey.XpNextTo != nil {
 21613  		*(**XFKey)(unsafe.Pointer(&((*XFKey)(_pFKey.XpNextTo).XpPrevTo))) = (*XFKey)(_pFKey.XpPrevTo)
 21614  	}
 21615  _9:
 21616  	func() {
 21617  		if int32(_pFKey.XisDeferred) != int32(0) && int32(_pFKey.XisDeferred) != int32(1) {
 21618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108820), unsafe.Pointer(&_sqlite3FkDeleteØ00__func__Ø000), unsafe.Pointer(str(21850)))
 21619  			crt.X__builtin_abort(tls)
 21620  		}
 21621  	}()
 21622  	_fkTriggerDelete(tls, _db, *elem42((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), 0))
 21623  	_fkTriggerDelete(tls, _db, *elem42((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), uintptr(1)))
 21624  	_pNext = (*XFKey)(_pFKey.XpNextFrom)
 21625  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pFKey))
 21626  	_pFKey = _pNext
 21627  	goto _4
 21628  _7:
 21629  }
 21630  
 21631  var _sqlite3FkDeleteØ00__func__Ø000 [16]int8
 21632  
 21633  func init() {
 21634  	crt.Xstrncpy(nil, &_sqlite3FkDeleteØ00__func__Ø000[0], str(21895), 16)
 21635  }
 21636  
 21637  // C comment
 21638  //  /*
 21639  //  ** The second argument is a Trigger structure allocated by the
 21640  //  ** fkActionTrigger() routine. This function deletes the Trigger structure
 21641  //  ** and all of its sub-components.
 21642  //  **
 21643  //  ** The Trigger structure or any of its sub-components may be allocated from
 21644  //  ** the lookaside buffer belonging to database handle dbMem.
 21645  //  */
 21646  func _fkTriggerDelete(tls *crt.TLS, _dbMem *Xsqlite3, _p *XTrigger) {
 21647  	var _1_pStep *XTriggerStep
 21648  	if _p != nil {
 21649  		_1_pStep = (*XTriggerStep)(_p.Xstep_list)
 21650  		_sqlite3ExprDelete(tls, _dbMem, (*XExpr)(_1_pStep.XpWhere))
 21651  		_sqlite3ExprListDelete(tls, _dbMem, (*XExprList)(_1_pStep.XpExprList))
 21652  		_sqlite3SelectDelete(tls, _dbMem, (*XSelect)(_1_pStep.XpSelect))
 21653  		_sqlite3ExprDelete(tls, _dbMem, (*XExpr)(_p.XpWhen))
 21654  		_sqlite3DbFree(tls, _dbMem, unsafe.Pointer(_p))
 21655  	}
 21656  }
 21657  
 21658  // C comment
 21659  //  /*
 21660  //  ** Delete memory allocated for the column names of a table or view (the
 21661  //  ** Table.aCol[] array).
 21662  //  */
 21663  func _sqlite3DeleteColumnNames(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) {
 21664  	var _i int32
 21665  	var _pCol *XColumn
 21666  	func() {
 21667  		if _pTable == nil {
 21668  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100270), unsafe.Pointer(&_sqlite3DeleteColumnNamesØ00__func__Ø000), unsafe.Pointer(str(21911)))
 21669  			crt.X__builtin_abort(tls)
 21670  		}
 21671  	}()
 21672  	if store43(&_pCol, (*XColumn)(_pTable.XaCol)) == nil {
 21673  		goto _2
 21674  	}
 21675  	_i = int32(0)
 21676  _3:
 21677  	if _i >= int32(_pTable.XnCol) {
 21678  		goto _6
 21679  	}
 21680  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pCol.XzName))
 21681  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pCol.XpDflt))
 21682  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pCol.XzColl))
 21683  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(32)
 21684  	goto _3
 21685  _6:
 21686  	_sqlite3DbFree(tls, _db, _pTable.XaCol)
 21687  _2:
 21688  }
 21689  
 21690  var _sqlite3DeleteColumnNamesØ00__func__Ø000 [25]int8
 21691  
 21692  func init() {
 21693  	crt.Xstrncpy(nil, &_sqlite3DeleteColumnNamesØ00__func__Ø000[0], str(21921), 25)
 21694  }
 21695  
 21696  // C comment
 21697  //  /*
 21698  //  ** Clear any and all virtual-table information from the Table record.
 21699  //  ** This routine is called, for example, just before deleting the Table
 21700  //  ** record.
 21701  //  **
 21702  //  ** Since it is a virtual-table, the Table structure contains a pointer
 21703  //  ** to the head of a linked list of VTable structures. Each VTable
 21704  //  ** structure is associated with a single sqlite3* user of the schema.
 21705  //  ** The reference count of the VTable structure associated with database
 21706  //  ** connection db is decremented immediately (which may lead to the
 21707  //  ** structure being xDisconnected and free). Any other VTable structures
 21708  //  ** in the list are moved to the sqlite3.pDisconnect list of the associated
 21709  //  ** database connection.
 21710  //  */
 21711  func _sqlite3VtabClear(tls *crt.TLS, _db *Xsqlite3, _p *XTable) {
 21712  	var _1_i int32
 21713  	if (_db == nil) || (_db.XpnBytesFreed == nil) {
 21714  		_vtabDisconnectAll(tls, nil, _p)
 21715  	}
 21716  	if _p.XazModuleArg == nil {
 21717  		goto _2
 21718  	}
 21719  	_1_i = int32(0)
 21720  _3:
 21721  	if _1_i >= _p.XnModuleArg {
 21722  		goto _6
 21723  	}
 21724  	if _1_i != int32(1) {
 21725  		_sqlite3DbFree(tls, _db, unsafe.Pointer(*elem0(_p.XazModuleArg, uintptr(_1_i))))
 21726  	}
 21727  	_1_i += 1
 21728  	goto _3
 21729  _6:
 21730  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XazModuleArg))
 21731  _2:
 21732  }
 21733  
 21734  // C comment
 21735  //  /*
 21736  //  ** Table p is a virtual table. This function moves all elements in the
 21737  //  ** p->pVTable list to the sqlite3.pDisconnect lists of their associated
 21738  //  ** database connections to be disconnected at the next opportunity.
 21739  //  ** Except, if argument db is not NULL, then the entry associated with
 21740  //  ** connection db is left in the p->pVTable list.
 21741  //  */
 21742  func _vtabDisconnectAll(tls *crt.TLS, _db *Xsqlite3, _p *XTable) (r0 *XVTable) {
 21743  	var _1_db2 *Xsqlite3
 21744  	var _pRet, _pVTable, _1_pNext *XVTable
 21745  	_pRet = nil
 21746  	_pVTable = (*XVTable)(_p.XpVTable)
 21747  	*(**XVTable)(unsafe.Pointer(&_p.XpVTable)) = nil
 21748  	func() {
 21749  		if _db != nil && _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_p.XpSchema)) == 0 {
 21750  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125175), unsafe.Pointer(&_vtabDisconnectAllØ00__func__Ø000), unsafe.Pointer(str(21946)))
 21751  			crt.X__builtin_abort(tls)
 21752  		}
 21753  	}()
 21754  _3:
 21755  	if _pVTable == nil {
 21756  		goto _4
 21757  	}
 21758  	_1_db2 = (*Xsqlite3)(_pVTable.Xdb)
 21759  	_1_pNext = (*XVTable)(_pVTable.XpNext)
 21760  	func() {
 21761  		if _1_db2 == nil {
 21762  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125180), unsafe.Pointer(&_vtabDisconnectAllØ00__func__Ø000), unsafe.Pointer(str(21997)))
 21763  			crt.X__builtin_abort(tls)
 21764  		}
 21765  	}()
 21766  	if _1_db2 == _db {
 21767  		_pRet = _pVTable
 21768  		*(**XVTable)(unsafe.Pointer(&_p.XpVTable)) = _pRet
 21769  		*(**XVTable)(unsafe.Pointer(&_pRet.XpNext)) = nil
 21770  		goto _8
 21771  	}
 21772  	*(**XVTable)(unsafe.Pointer(&_pVTable.XpNext)) = (*XVTable)(_1_db2.XpDisconnect)
 21773  	*(**XVTable)(unsafe.Pointer(&_1_db2.XpDisconnect)) = _pVTable
 21774  _8:
 21775  	_pVTable = _1_pNext
 21776  	goto _3
 21777  _4:
 21778  	func() {
 21779  		if _db != nil && _pRet == nil {
 21780  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125192), unsafe.Pointer(&_vtabDisconnectAllØ00__func__Ø000), unsafe.Pointer(str(22001)))
 21781  			crt.X__builtin_abort(tls)
 21782  		}
 21783  	}()
 21784  	return _pRet
 21785  }
 21786  
 21787  var _vtabDisconnectAllØ00__func__Ø000 [18]int8
 21788  
 21789  func init() {
 21790  	crt.Xstrncpy(nil, &_vtabDisconnectAllØ00__func__Ø000[0], str(22013), 18)
 21791  }
 21792  
 21793  // C comment
 21794  //  /*
 21795  //  ** Delete an IdList.
 21796  //  */
 21797  func _sqlite3IdListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XIdList) {
 21798  	var _i int32
 21799  	if _pList == nil {
 21800  		return
 21801  	}
 21802  	_i = int32(0)
 21803  _1:
 21804  	if _i >= _pList.XnId {
 21805  		goto _4
 21806  	}
 21807  	_sqlite3DbFree(tls, _db, unsafe.Pointer(elem44((*TIdList_item)(_pList.Xa), uintptr(_i)).XzName))
 21808  	_i += 1
 21809  	goto _1
 21810  _4:
 21811  	_sqlite3DbFree(tls, _db, _pList.Xa)
 21812  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pList))
 21813  }
 21814  
 21815  // C comment
 21816  //  /*
 21817  //  ** Free the contents of the With object passed as the second argument.
 21818  //  */
 21819  func _sqlite3WithDelete(tls *crt.TLS, _db *Xsqlite3, _pWith *XWith) {
 21820  	var _1_i int32
 21821  	var _2_pCte *TCte
 21822  	if _pWith == nil {
 21823  		goto _0
 21824  	}
 21825  	_1_i = int32(0)
 21826  _1:
 21827  	if _1_i >= _pWith.XnCte {
 21828  		goto _4
 21829  	}
 21830  	_2_pCte = elem45((*TCte)(unsafe.Pointer(&_pWith.Xa)), uintptr(_1_i))
 21831  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_2_pCte.XpCols))
 21832  	_sqlite3SelectDelete(tls, _db, (*XSelect)(_2_pCte.XpSelect))
 21833  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_2_pCte.XzName))
 21834  	_1_i += 1
 21835  	goto _1
 21836  _4:
 21837  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pWith))
 21838  _0:
 21839  }
 21840  
 21841  // C comment
 21842  //  /*
 21843  //  ** Look through the list of open database files in db->aDb[] and if
 21844  //  ** any have been closed, remove them from the list.  Reallocate the
 21845  //  ** db->aDb[] structure to a smaller size, if possible.
 21846  //  **
 21847  //  ** Entry 0 (the "main" database) and entry 1 (the "temp" database)
 21848  //  ** are never candidates for being collapsed.
 21849  //  */
 21850  func _sqlite3CollapseDatabaseArray(tls *crt.TLS, _db *Xsqlite3) {
 21851  	var _i, _j int32
 21852  	var _1_pDb *XDb
 21853  	_i = store2(&_j, int32(2))
 21854  _0:
 21855  	if _i >= _db.XnDb {
 21856  		goto _3
 21857  	}
 21858  	_1_pDb = elem27((*XDb)(_db.XaDb), uintptr(_i))
 21859  	if (*XBtree)(_1_pDb.XpBt) == nil {
 21860  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pDb.XzDbSName))
 21861  		_1_pDb.XzDbSName = nil
 21862  		goto _1
 21863  	}
 21864  	if _j < _i {
 21865  		*elem27((*XDb)(_db.XaDb), uintptr(_j)) = *elem27((*XDb)(_db.XaDb), uintptr(_i))
 21866  	}
 21867  	_j += 1
 21868  _1:
 21869  	_i += 1
 21870  	goto _0
 21871  _3:
 21872  	_db.XnDb = _j
 21873  	if (_db.XnDb <= int32(2)) && ((*XDb)(_db.XaDb) != (*XDb)(unsafe.Pointer(&_db.XaDbStatic))) {
 21874  		crt.Xmemcpy(tls, unsafe.Pointer(&_db.XaDbStatic), _db.XaDb, uint64(64))
 21875  		_sqlite3DbFree(tls, _db, _db.XaDb)
 21876  		*(**XDb)(unsafe.Pointer(&_db.XaDb)) = (*XDb)(unsafe.Pointer(&_db.XaDbStatic))
 21877  	}
 21878  }
 21879  
 21880  // C comment
 21881  //  /*
 21882  //  ** Close all open savepoints. This function only manipulates fields of the
 21883  //  ** database handle object, it does not close any savepoints that may be open
 21884  //  ** at the b-tree/pager level.
 21885  //  */
 21886  func _sqlite3CloseSavepoints(tls *crt.TLS, _db *Xsqlite3) {
 21887  	var _1_pTmp *XSavepoint
 21888  _0:
 21889  	if _db.XpSavepoint != nil {
 21890  		_1_pTmp = (*XSavepoint)(_db.XpSavepoint)
 21891  		*(**XSavepoint)(unsafe.Pointer(&_db.XpSavepoint)) = (*XSavepoint)(_1_pTmp.XpNext)
 21892  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pTmp))
 21893  		goto _0
 21894  	}
 21895  	_db.XnSavepoint = int32(0)
 21896  	_db.XnStatement = int32(0)
 21897  	_db.XisTransactionSavepoint = 0
 21898  }
 21899  
 21900  // C comment
 21901  //  /*
 21902  //  ** Close an open database and invalidate all cursors.
 21903  //  */
 21904  func _sqlite3BtreeClose(tls *crt.TLS, _p *XBtree) (r0 int32) {
 21905  	var _pBt *XBtShared
 21906  	var _pCur, _1_pTmp *XBtCursor
 21907  	_pBt = (*XBtShared)(_p.XpBt)
 21908  	func() {
 21909  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 21910  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61603), unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000), unsafe.Pointer(str(8939)))
 21911  			crt.X__builtin_abort(tls)
 21912  		}
 21913  	}()
 21914  	_sqlite3BtreeEnter(tls, _p)
 21915  	_pCur = (*XBtCursor)(_pBt.XpCursor)
 21916  _2:
 21917  	if _pCur == nil {
 21918  		goto _3
 21919  	}
 21920  	_1_pTmp = _pCur
 21921  	_pCur = (*XBtCursor)(_pCur.XpNext)
 21922  	if (*XBtree)(_1_pTmp.XpBtree) == _p {
 21923  		_sqlite3BtreeCloseCursor(tls, _1_pTmp)
 21924  	}
 21925  	goto _2
 21926  _3:
 21927  	_sqlite3BtreeRollback(tls, _p, int32(0), int32(0))
 21928  	_sqlite3BtreeLeave(tls, _p)
 21929  	func() {
 21930  		if _p.XwantToLock != int32(0) || int32(_p.Xlocked) != int32(0) {
 21931  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61625), unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000), unsafe.Pointer(str(22031)))
 21932  			crt.X__builtin_abort(tls)
 21933  		}
 21934  	}()
 21935  	if _p.Xsharable != 0 && _removeFromSharingList(tls, _pBt) == 0 {
 21936  		goto _9
 21937  	}
 21938  	func() {
 21939  		if _pBt.XpCursor != nil {
 21940  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61632), unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000), unsafe.Pointer(str(22064)))
 21941  			crt.X__builtin_abort(tls)
 21942  		}
 21943  	}()
 21944  	_sqlite3PagerClose(tls, (*XPager)(_pBt.XpPager), (*Xsqlite3)(_p.Xdb))
 21945  	if (_pBt.XxFreeSchema != nil) && (_pBt.XpSchema != nil) {
 21946  		_pBt.XxFreeSchema(tls, _pBt.XpSchema)
 21947  	}
 21948  	_sqlite3DbFree(tls, nil, _pBt.XpSchema)
 21949  	_freeTempSpace(tls, _pBt)
 21950  	Xsqlite3_free(tls, unsafe.Pointer(_pBt))
 21951  _9:
 21952  	func() {
 21953  		if _p.XwantToLock != int32(0) {
 21954  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61643), unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000), unsafe.Pointer(str(22078)))
 21955  			crt.X__builtin_abort(tls)
 21956  		}
 21957  	}()
 21958  	func() {
 21959  		if int32(_p.Xlocked) != int32(0) {
 21960  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61644), unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000), unsafe.Pointer(str(9298)))
 21961  			crt.X__builtin_abort(tls)
 21962  		}
 21963  	}()
 21964  	if _p.XpPrev != nil {
 21965  		*(**XBtree)(unsafe.Pointer(&((*XBtree)(_p.XpPrev).XpNext))) = (*XBtree)(_p.XpNext)
 21966  	}
 21967  	if _p.XpNext != nil {
 21968  		*(**XBtree)(unsafe.Pointer(&((*XBtree)(_p.XpNext).XpPrev))) = (*XBtree)(_p.XpPrev)
 21969  	}
 21970  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 21971  	return int32(0)
 21972  }
 21973  
 21974  var _sqlite3BtreeCloseØ00__func__Ø000 [18]int8
 21975  
 21976  func init() {
 21977  	crt.Xstrncpy(nil, &_sqlite3BtreeCloseØ00__func__Ø000[0], str(22095), 18)
 21978  }
 21979  
 21980  // C comment
 21981  //  /*
 21982  //  ** Close a cursor.  The read lock on the database file is released
 21983  //  ** when the last cursor is closed.
 21984  //  */
 21985  func _sqlite3BtreeCloseCursor(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 21986  	var _1_i int32
 21987  	var _pBtree *XBtree
 21988  	var _1_pBt *XBtShared
 21989  	var _3_pPrev *XBtCursor
 21990  	_pBtree = (*XBtree)(_pCur.XpBtree)
 21991  	if _pBtree == nil {
 21992  		goto _0
 21993  	}
 21994  	_1_pBt = (*XBtShared)(_pCur.XpBt)
 21995  	_sqlite3BtreeEnter(tls, _pBtree)
 21996  	_sqlite3BtreeClearCursor(tls, _pCur)
 21997  	func() {
 21998  		if (*XBtCursor)(_1_pBt.XpCursor) == nil {
 21999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63317), unsafe.Pointer(&_sqlite3BtreeCloseCursorØ00__func__Ø000), unsafe.Pointer(str(22113)))
 22000  			crt.X__builtin_abort(tls)
 22001  		}
 22002  	}()
 22003  	if (*XBtCursor)(_1_pBt.XpCursor) == _pCur {
 22004  		*(**XBtCursor)(unsafe.Pointer(&_1_pBt.XpCursor)) = (*XBtCursor)(_pCur.XpNext)
 22005  		goto _4
 22006  	}
 22007  	_3_pPrev = (*XBtCursor)(_1_pBt.XpCursor)
 22008  _5:
 22009  	if (*XBtCursor)(_3_pPrev.XpNext) == _pCur {
 22010  		*(**XBtCursor)(unsafe.Pointer(&_3_pPrev.XpNext)) = (*XBtCursor)(_pCur.XpNext)
 22011  		goto _7
 22012  	}
 22013  	_3_pPrev = (*XBtCursor)(_3_pPrev.XpNext)
 22014  	if func() int32 {
 22015  		if _3_pPrev != nil {
 22016  			return int32(1)
 22017  		}
 22018  		return func() int32 {
 22019  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63328), unsafe.Pointer(&_sqlite3BtreeCloseCursorØ00__func__Ø000), unsafe.Pointer(str(4809)))
 22020  			crt.X__builtin_abort(tls)
 22021  			return int32(0)
 22022  		}()
 22023  	}() != 0 {
 22024  		goto _5
 22025  	}
 22026  _7:
 22027  _4:
 22028  	_1_i = int32(0)
 22029  _10:
 22030  	if _1_i > int32(_pCur.XiPage) {
 22031  		goto _13
 22032  	}
 22033  	_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_1_i)))
 22034  	_1_i += 1
 22035  	goto _10
 22036  _13:
 22037  	_unlockBtreeIfUnused(tls, _1_pBt)
 22038  	Xsqlite3_free(tls, unsafe.Pointer(_pCur.XaOverflow))
 22039  	_sqlite3BtreeLeave(tls, _pBtree)
 22040  _0:
 22041  	return int32(0)
 22042  }
 22043  
 22044  var _sqlite3BtreeCloseCursorØ00__func__Ø000 [24]int8
 22045  
 22046  func init() {
 22047  	crt.Xstrncpy(nil, &_sqlite3BtreeCloseCursorØ00__func__Ø000[0], str(22129), 24)
 22048  }
 22049  
 22050  // C comment
 22051  //  /*
 22052  //  ** Decrement the BtShared.nRef counter.  When it reaches zero,
 22053  //  ** remove the BtShared structure from the sharing list.  Return
 22054  //  ** true if the BtShared.nRef counter reaches zero and return
 22055  //  ** false if it is still positive.
 22056  //  */
 22057  func _removeFromSharingList(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
 22058  	var _removed int32
 22059  	var _pMaster *Xsqlite3_mutex
 22060  	var _pList *XBtShared
 22061  	_removed = int32(0)
 22062  	func() {
 22063  		if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 22064  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61525), unsafe.Pointer(&_removeFromSharingListØ00__func__Ø000), unsafe.Pointer(str(22153)))
 22065  			crt.X__builtin_abort(tls)
 22066  		}
 22067  	}()
 22068  	_pMaster = _sqlite3MutexAlloc(tls, int32(2))
 22069  	Xsqlite3_mutex_enter(tls, _pMaster)
 22070  	_pBt.XnRef -= 1
 22071  	if _pBt.XnRef > int32(0) {
 22072  		goto _2
 22073  	}
 22074  	if _sqlite3SharedCacheList == _pBt {
 22075  		_sqlite3SharedCacheList = (*XBtShared)(_pBt.XpNext)
 22076  		bug20530(_sqlite3SharedCacheList)
 22077  		goto _4
 22078  	}
 22079  	_pList = _sqlite3SharedCacheList
 22080  _5:
 22081  	if func() int32 {
 22082  		if _pList != nil {
 22083  			return int32(1)
 22084  		}
 22085  		return func() int32 {
 22086  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61534), unsafe.Pointer(&_removeFromSharingListØ00__func__Ø000), unsafe.Pointer(str(4809)))
 22087  			crt.X__builtin_abort(tls)
 22088  			return int32(0)
 22089  		}()
 22090  	}() != 0 && ((*XBtShared)(_pList.XpNext) != _pBt) {
 22091  		_pList = (*XBtShared)(_pList.XpNext)
 22092  		goto _5
 22093  	}
 22094  	if func() int32 {
 22095  		if _pList != nil {
 22096  			return int32(1)
 22097  		}
 22098  		return func() int32 {
 22099  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61537), unsafe.Pointer(&_removeFromSharingListØ00__func__Ø000), unsafe.Pointer(str(4809)))
 22100  			crt.X__builtin_abort(tls)
 22101  			return int32(0)
 22102  		}()
 22103  	}() != 0 {
 22104  		*(**XBtShared)(unsafe.Pointer(&_pList.XpNext)) = (*XBtShared)(_pBt.XpNext)
 22105  	}
 22106  _4:
 22107  	Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_pBt.Xmutex))
 22108  	_removed = int32(1)
 22109  _2:
 22110  	Xsqlite3_mutex_leave(tls, _pMaster)
 22111  	return _removed
 22112  }
 22113  
 22114  var _removeFromSharingListØ00__func__Ø000 [22]int8
 22115  
 22116  func init() {
 22117  	crt.Xstrncpy(nil, &_removeFromSharingListØ00__func__Ø000[0], str(22187), 22)
 22118  }
 22119  
 22120  var _sqlite3SharedCacheList *XBtShared
 22121  
 22122  // C comment
 22123  //  /*
 22124  //  ** Free a dynamic mutex.
 22125  //  */
 22126  func Xsqlite3_mutex_free(tls *crt.TLS, _p *Xsqlite3_mutex) {
 22127  	if _p != nil {
 22128  		func() {
 22129  			if (_sqlite3Config.Xmutex.XxMutexFree) == nil {
 22130  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22854), unsafe.Pointer(&_sqlite3_mutex_freeØ00__func__Ø000), unsafe.Pointer(str(22209)))
 22131  				crt.X__builtin_abort(tls)
 22132  			}
 22133  		}()
 22134  		func() func(*crt.TLS, *Xsqlite3_mutex) {
 22135  			v := _sqlite3Config.Xmutex.XxMutexFree
 22136  			return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
 22137  		}()(tls, _p)
 22138  	}
 22139  }
 22140  
 22141  var _sqlite3_mutex_freeØ00__func__Ø000 [19]int8
 22142  
 22143  func init() {
 22144  	crt.Xstrncpy(nil, &_sqlite3_mutex_freeØ00__func__Ø000[0], str(22246), 19)
 22145  }
 22146  
 22147  // C comment
 22148  //  /*
 22149  //  ** Shutdown the page cache.  Free all memory and close all files.
 22150  //  **
 22151  //  ** If a transaction was in progress when this routine is called, that
 22152  //  ** transaction is rolled back.  All outstanding pages are invalidated
 22153  //  ** and their memory is freed.  Any attempt to use a page associated
 22154  //  ** with this page cache after this function returns will likely
 22155  //  ** result in a coredump.
 22156  //  **
 22157  //  ** This function always succeeds. If a transaction is active an attempt
 22158  //  ** is made to roll it back. If an error occurs during the rollback
 22159  //  ** a hot journal may be left in the filesystem but no error is returned
 22160  //  ** to the caller.
 22161  //  */
 22162  func _sqlite3PagerClose(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int32) {
 22163  	var _pTmp *uint8
 22164  	_pTmp = (*uint8)(unsafe.Pointer(_pPager.XpTmpSpace))
 22165  	func() {
 22166  		if _db == nil && bool2int((*XWal)(_pPager.XpWal) != nil) != int32(0) {
 22167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51012), unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000), unsafe.Pointer(str(22265)))
 22168  			crt.X__builtin_abort(tls)
 22169  		}
 22170  	}()
 22171  	func() {
 22172  		if _assert_pager_state(tls, _pPager) == 0 {
 22173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51013), unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000), unsafe.Pointer(str(10971)))
 22174  			crt.X__builtin_abort(tls)
 22175  		}
 22176  	}()
 22177  	_sqlite3BeginBenignMalloc(tls)
 22178  	_pagerFreeMapHdrs(tls, _pPager)
 22179  	_pPager.XexclusiveMode = 0
 22180  	func() {
 22181  		if _db == nil && (*XWal)(_pPager.XpWal) != nil {
 22182  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51020), unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000), unsafe.Pointer(str(22294)))
 22183  			crt.X__builtin_abort(tls)
 22184  		}
 22185  	}()
 22186  	_sqlite3WalClose(tls, (*XWal)(_pPager.XpWal), _db, int32(_pPager.XckptSyncFlags), _pPager.XpageSize, func() *uint8 {
 22187  		if (_db != nil) && ((uint32(_db.Xflags) & uint32(2147483648)) != 0) {
 22188  			return nil
 22189  		}
 22190  		return _pTmp
 22191  	}())
 22192  	*(**XWal)(unsafe.Pointer(&_pPager.XpWal)) = nil
 22193  	_pager_reset(tls, _pPager)
 22194  	if _pPager.XmemDb != 0 {
 22195  		_pager_unlock(tls, _pPager)
 22196  		goto _12
 22197  	}
 22198  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil {
 22199  		_pager_error(tls, _pPager, _pagerSyncHotJournal(tls, _pPager))
 22200  	}
 22201  	_pagerUnlockAndRollback(tls, _pPager)
 22202  _12:
 22203  	_sqlite3EndBenignMalloc(tls)
 22204  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 22205  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xfd))
 22206  	_sqlite3PageFree(tls, unsafe.Pointer(_pTmp))
 22207  	_sqlite3PcacheClose(tls, (*XPCache)(_pPager.XpPCache))
 22208  	func() {
 22209  		if _pPager.XaSavepoint != nil || _pPager.XpInJournal != nil {
 22210  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51059), unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000), unsafe.Pointer(str(22316)))
 22211  			crt.X__builtin_abort(tls)
 22212  		}
 22213  	}()
 22214  	func() {
 22215  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xsjfd).XpMethods) != nil {
 22216  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51060), unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000), unsafe.Pointer(str(22359)))
 22217  			crt.X__builtin_abort(tls)
 22218  		}
 22219  	}()
 22220  	Xsqlite3_free(tls, unsafe.Pointer(_pPager))
 22221  	return int32(0)
 22222  }
 22223  
 22224  var _sqlite3PagerCloseØ00__func__Ø000 [18]int8
 22225  
 22226  func init() {
 22227  	crt.Xstrncpy(nil, &_sqlite3PagerCloseØ00__func__Ø000[0], str(22405), 18)
 22228  }
 22229  
 22230  // C comment
 22231  //  /*
 22232  //  ** Free all PgHdr objects stored in the Pager.pMmapFreelist list.
 22233  //  */
 22234  func _pagerFreeMapHdrs(tls *crt.TLS, _pPager *XPager) {
 22235  	var _p, _pNext *XPgHdr
 22236  	_p = (*XPgHdr)(_pPager.XpMmapFreelist)
 22237  _0:
 22238  	if _p == nil {
 22239  		goto _3
 22240  	}
 22241  	_pNext = (*XPgHdr)(_p.XpDirty)
 22242  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 22243  	_p = _pNext
 22244  	goto _0
 22245  _3:
 22246  }
 22247  
 22248  // C comment
 22249  //  /*
 22250  //  ** Close a connection to a log file.
 22251  //  */
 22252  func _sqlite3WalClose(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _sync_flags int32, _nBuf int32, _zBuf *uint8) (r0 int32) {
 22253  	var _rc, _1_isDelete, _4_bPersist int32
 22254  	_rc = int32(0)
 22255  	if _pWal == nil {
 22256  		goto _0
 22257  	}
 22258  	_1_isDelete = int32(0)
 22259  	if _zBuf == nil || int32(0) != store2(&_rc, _sqlite3OsLock(tls, (*Xsqlite3_file)(_pWal.XpDbFd), int32(4))) {
 22260  		goto _2
 22261  	}
 22262  	if int32(_pWal.XexclusiveMode) == int32(0) {
 22263  		_pWal.XexclusiveMode = uint8(1)
 22264  	}
 22265  	_rc = _sqlite3WalCheckpoint(tls, _pWal, _db, int32(0), nil, nil, _sync_flags, _nBuf, _zBuf, nil, nil)
 22266  	if _rc != int32(0) {
 22267  		goto _4
 22268  	}
 22269  	_4_bPersist = int32(-1)
 22270  	_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pWal.XpDbFd), int32(10), unsafe.Pointer(&_4_bPersist))
 22271  	if _4_bPersist != int32(1) {
 22272  		_1_isDelete = int32(1)
 22273  		goto _7
 22274  	}
 22275  	if _pWal.XmxWalSize >= (0) {
 22276  		_walLimitSize(tls, _pWal, 0)
 22277  	}
 22278  _7:
 22279  _4:
 22280  _2:
 22281  	_walIndexClose(tls, _pWal, _1_isDelete)
 22282  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pWal.XpWalFd))
 22283  	if _1_isDelete != 0 {
 22284  		_sqlite3BeginBenignMalloc(tls)
 22285  		_sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pWal.XpVfs), _pWal.XzWalName, int32(0))
 22286  		_sqlite3EndBenignMalloc(tls)
 22287  	}
 22288  	Xsqlite3_free(tls, unsafe.Pointer(_pWal.XapWiData))
 22289  	Xsqlite3_free(tls, unsafe.Pointer(_pWal))
 22290  _0:
 22291  	return _rc
 22292  }
 22293  
 22294  func _sqlite3OsLock(tls *crt.TLS, _id *Xsqlite3_file, _lockType int32) (r0 int32) {
 22295  	return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 {
 22296  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxLock
 22297  		return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v))
 22298  	}()(tls, _id, _lockType)
 22299  }
 22300  
 22301  // C comment
 22302  //  /*
 22303  //  ** This routine is called to implement sqlite3_wal_checkpoint() and
 22304  //  ** related interfaces.
 22305  //  **
 22306  //  ** Obtain a CHECKPOINT lock and then backfill as much information as
 22307  //  ** we can from WAL into the database.
 22308  //  **
 22309  //  ** If parameter xBusy is not NULL, it is a pointer to a busy-handler
 22310  //  ** callback. In this case this function runs a blocking checkpoint.
 22311  //  */
 22312  func _sqlite3WalCheckpoint(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _eMode int32, _xBusy func(*crt.TLS, unsafe.Pointer) int32, _pBusyArg unsafe.Pointer, _sync_flags int32, _nBuf int32, _zBuf *uint8, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
 22313  	var _rc, _isChanged, _eMode2 int32
 22314  	var _xBusy2 func(*crt.TLS, unsafe.Pointer) int32
 22315  	_isChanged = int32(0)
 22316  	_eMode2 = _eMode
 22317  	_xBusy2 = _xBusy
 22318  	func() {
 22319  		if int32(_pWal.XckptLock) != int32(0) {
 22320  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57774), unsafe.Pointer(&_sqlite3WalCheckpointØ00__func__Ø000), unsafe.Pointer(str(22423)))
 22321  			crt.X__builtin_abort(tls)
 22322  		}
 22323  	}()
 22324  	func() {
 22325  		if int32(_pWal.XwriteLock) != int32(0) {
 22326  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57775), unsafe.Pointer(&_sqlite3WalCheckpointØ00__func__Ø000), unsafe.Pointer(str(19034)))
 22327  			crt.X__builtin_abort(tls)
 22328  		}
 22329  	}()
 22330  	func() {
 22331  		if _eMode == int32(0) && _xBusy != nil {
 22332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57779), unsafe.Pointer(&_sqlite3WalCheckpointØ00__func__Ø000), unsafe.Pointer(str(22441)))
 22333  			crt.X__builtin_abort(tls)
 22334  		}
 22335  	}()
 22336  	if _pWal.XreadOnly != 0 {
 22337  		return int32(8)
 22338  	}
 22339  	_rc = _walLockExclusive(tls, _pWal, int32(1), int32(1))
 22340  	if _rc != 0 {
 22341  		return _rc
 22342  	}
 22343  	_pWal.XckptLock = uint8(1)
 22344  	if _eMode == int32(0) {
 22345  		goto _9
 22346  	}
 22347  	_rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, int32(0), int32(1))
 22348  	if _rc == int32(0) {
 22349  		_pWal.XwriteLock = uint8(1)
 22350  		goto _12
 22351  	}
 22352  	if _rc == int32(5) {
 22353  		_eMode2 = int32(0)
 22354  		_xBusy2 = nil
 22355  		_rc = int32(0)
 22356  	}
 22357  _12:
 22358  _9:
 22359  	if _rc != int32(0) {
 22360  		goto _13
 22361  	}
 22362  	_rc = _walIndexReadHdr(tls, _pWal, &_isChanged)
 22363  	if _isChanged != 0 && (((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pWal.XpDbFd).XpMethods).XiVersion) >= int32(3)) {
 22364  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pWal.XpDbFd), 0, nil)
 22365  	}
 22366  _13:
 22367  	if _rc != int32(0) {
 22368  		goto _16
 22369  	}
 22370  	if ((_pWal.Xhdr.XmxFrame) != 0) && (_walPagesize(tls, _pWal) != _nBuf) {
 22371  		_rc = _sqlite3CorruptError(tls, int32(57832))
 22372  		goto _19
 22373  	}
 22374  	_rc = _walCheckpoint(tls, _pWal, _db, _eMode2, _xBusy2, _pBusyArg, _sync_flags, _zBuf)
 22375  _19:
 22376  	if _rc != int32(0) && _rc != int32(5) {
 22377  		goto _21
 22378  	}
 22379  	if _pnLog != nil {
 22380  		*_pnLog = int32(_pWal.Xhdr.XmxFrame)
 22381  	}
 22382  	if _pnCkpt != nil {
 22383  		*_pnCkpt = int32(_walCkptInfo(tls, _pWal).XnBackfill)
 22384  	}
 22385  _21:
 22386  _16:
 22387  	if _isChanged != 0 {
 22388  		crt.Xmemset(tls, unsafe.Pointer(&_pWal.Xhdr), int32(0), uint64(48))
 22389  	}
 22390  	_sqlite3WalEndWriteTransaction(tls, _pWal)
 22391  	_walUnlockExclusive(tls, _pWal, int32(1), int32(1))
 22392  	_pWal.XckptLock = 0
 22393  	return func() int32 {
 22394  		if (_rc == int32(0)) && (_eMode != _eMode2) {
 22395  			return int32(5)
 22396  		}
 22397  		return _rc
 22398  	}()
 22399  }
 22400  
 22401  var _sqlite3WalCheckpointØ00__func__Ø000 [21]int8
 22402  
 22403  func init() {
 22404  	crt.Xstrncpy(nil, &_sqlite3WalCheckpointØ00__func__Ø000[0], str(22486), 21)
 22405  }
 22406  
 22407  func _walLockExclusive(tls *crt.TLS, _pWal *XWal, _lockIdx int32, _n int32) (r0 int32) {
 22408  	var _rc int32
 22409  	if _pWal.XexclusiveMode != 0 {
 22410  		return int32(0)
 22411  	}
 22412  	_rc = _sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _lockIdx, _n, int32(10))
 22413  	_pWal.XlockError = uint8(bool2int((_rc != int32(0)) && (_rc != int32(5))))
 22414  	return _rc
 22415  }
 22416  
 22417  // C comment
 22418  //  /*
 22419  //  ** Attempt to obtain the exclusive WAL lock defined by parameters lockIdx and
 22420  //  ** n. If the attempt fails and parameter xBusy is not NULL, then it is a
 22421  //  ** busy-handler function. Invoke it and retry the lock until either the
 22422  //  ** lock is successfully obtained or the busy-handler returns 0.
 22423  //  */
 22424  func _walBusyLock(tls *crt.TLS, _pWal *XWal, _xBusy func(*crt.TLS, unsafe.Pointer) int32, _pBusyArg unsafe.Pointer, _lockIdx int32, _n int32) (r0 int32) {
 22425  	var _rc int32
 22426  _0:
 22427  	_rc = _walLockExclusive(tls, _pWal, _lockIdx, _n)
 22428  	if ((_xBusy != nil) && (_rc == int32(5))) && _xBusy(tls, _pBusyArg) != 0 {
 22429  		goto _0
 22430  	}
 22431  	return _rc
 22432  }
 22433  
 22434  // C comment
 22435  //  /*
 22436  //  ** Read the wal-index header from the wal-index and into pWal->hdr.
 22437  //  ** If the wal-header appears to be corrupt, try to reconstruct the
 22438  //  ** wal-index from the WAL before returning.
 22439  //  **
 22440  //  ** Set *pChanged to 1 if the wal-index header value in pWal->hdr is
 22441  //  ** changed by this operation.  If pWal->hdr is unchanged, set *pChanged
 22442  //  ** to 0.
 22443  //  **
 22444  //  ** If the wal-index header is successfully read, return SQLITE_OK.
 22445  //  ** Otherwise an SQLite error code.
 22446  //  */
 22447  func _walIndexReadHdr(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) {
 22448  	var _rc, _badHdr int32
 22449  	var _page0 *uint32
 22450  	func() {
 22451  		if _pChanged == nil {
 22452  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56550), unsafe.Pointer(&_walIndexReadHdrØ00__func__Ø000), unsafe.Pointer(str(22507)))
 22453  			crt.X__builtin_abort(tls)
 22454  		}
 22455  	}()
 22456  	_rc = _walIndexPage(tls, _pWal, int32(0), &_page0)
 22457  	if _rc != int32(0) {
 22458  		return _rc
 22459  	}
 22460  	func() {
 22461  		if _page0 == nil && int32(_pWal.XwriteLock) != int32(0) {
 22462  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56555), unsafe.Pointer(&_walIndexReadHdrØ00__func__Ø000), unsafe.Pointer(str(22516)))
 22463  			crt.X__builtin_abort(tls)
 22464  		}
 22465  	}()
 22466  	_badHdr = func() int32 {
 22467  		if _page0 != nil {
 22468  			return _walIndexTryHdr(tls, _pWal, _pChanged)
 22469  		}
 22470  		return int32(1)
 22471  	}()
 22472  	func() {
 22473  		if _badHdr != int32(0) && int32(_pWal.XwriteLock) != int32(0) {
 22474  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56567), unsafe.Pointer(&_walIndexReadHdrØ00__func__Ø000), unsafe.Pointer(str(22544)))
 22475  			crt.X__builtin_abort(tls)
 22476  		}
 22477  	}()
 22478  	if _badHdr == 0 {
 22479  		goto _11
 22480  	}
 22481  	if (int32(_pWal.XreadOnly) & int32(2)) == 0 {
 22482  		goto _12
 22483  	}
 22484  	if int32(0) == store2(&_rc, _walLockShared(tls, _pWal, int32(0))) {
 22485  		_walUnlockShared(tls, _pWal, int32(0))
 22486  		_rc = int32(264)
 22487  	}
 22488  	goto _15
 22489  _12:
 22490  	if int32(0) != store2(&_rc, _walLockExclusive(tls, _pWal, int32(0), int32(1))) {
 22491  		goto _15
 22492  	}
 22493  	_pWal.XwriteLock = uint8(1)
 22494  	if int32(0) != store2(&_rc, _walIndexPage(tls, _pWal, int32(0), &_page0)) {
 22495  		goto _16
 22496  	}
 22497  	_badHdr = _walIndexTryHdr(tls, _pWal, _pChanged)
 22498  	if _badHdr != 0 {
 22499  		_rc = _walIndexRecover(tls, _pWal)
 22500  		*_pChanged = int32(1)
 22501  	}
 22502  _16:
 22503  	_pWal.XwriteLock = 0
 22504  	_walUnlockExclusive(tls, _pWal, int32(0), int32(1))
 22505  _15:
 22506  _11:
 22507  	if (_badHdr == int32(0)) && ((_pWal.Xhdr.XiVersion) != uint32(3007000)) {
 22508  		_rc = _sqlite3CantopenError(tls, int32(56597))
 22509  	}
 22510  	return _rc
 22511  }
 22512  
 22513  var _walIndexReadHdrØ00__func__Ø000 [16]int8
 22514  
 22515  func init() {
 22516  	crt.Xstrncpy(nil, &_walIndexReadHdrØ00__func__Ø000[0], str(22576), 16)
 22517  }
 22518  
 22519  // C comment
 22520  //  /*
 22521  //  ** Try to read the wal-index header.  Return 0 on success and 1 if
 22522  //  ** there is a problem.
 22523  //  **
 22524  //  ** The wal-index is in shared memory.  Another thread or process might
 22525  //  ** be writing the header at the same time this procedure is trying to
 22526  //  ** read it, which might result in inconsistency.  A dirty read is detected
 22527  //  ** by verifying that both copies of the header are the same and also by
 22528  //  ** a checksum on the header.
 22529  //  **
 22530  //  ** If and only if the read is consistent and the header is different from
 22531  //  ** pWal->hdr, then pWal->hdr is updated to the content of the new header
 22532  //  ** and *pChanged is set to 1.
 22533  //  **
 22534  //  ** If the checksum cannot be verified return non-zero. If the header
 22535  //  ** is read successfully and the checksum verified, return zero.
 22536  //  */
 22537  func _walIndexTryHdr(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) {
 22538  	var _aCksum [2]uint32
 22539  	var _h1, _h2 XWalIndexHdr
 22540  	var _aHdr *XWalIndexHdr
 22541  	func() {
 22542  		if _pWal.XnWiData <= int32(0) || (*elem38(_pWal.XapWiData, 0)) == nil {
 22543  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56490), unsafe.Pointer(&_walIndexTryHdrØ00__func__Ø000), unsafe.Pointer(str(15226)))
 22544  			crt.X__builtin_abort(tls)
 22545  		}
 22546  	}()
 22547  	_aHdr = _walIndexHdr(tls, _pWal)
 22548  	crt.Xmemcpy(tls, unsafe.Pointer(&_h1), unsafe.Pointer(elem46(_aHdr, 0)), uint64(48))
 22549  	_walShmBarrier(tls, _pWal)
 22550  	crt.Xmemcpy(tls, unsafe.Pointer(&_h2), unsafe.Pointer(elem46(_aHdr, uintptr(1))), uint64(48))
 22551  	if crt.Xmemcmp(tls, unsafe.Pointer(&_h1), unsafe.Pointer(&_h2), uint64(48)) != int32(0) {
 22552  		return int32(1)
 22553  	}
 22554  	if int32(_h1.XisInit) == int32(0) {
 22555  		return int32(1)
 22556  	}
 22557  	_walChecksumBytes(tls, int32(1), (*uint8)(unsafe.Pointer(&_h1)), int32(40), nil, (*uint32)(unsafe.Pointer(&_aCksum)))
 22558  	if ((*elem31((*uint32)(unsafe.Pointer(&_aCksum)), 0)) != (*elem31((*uint32)(unsafe.Pointer(&_h1.XaCksum)), 0))) || ((*elem31((*uint32)(unsafe.Pointer(&_aCksum)), uintptr(1))) != (*elem31((*uint32)(unsafe.Pointer(&_h1.XaCksum)), uintptr(1)))) {
 22559  		return int32(1)
 22560  	}
 22561  	if crt.Xmemcmp(tls, unsafe.Pointer(&_pWal.Xhdr), unsafe.Pointer(&_h1), uint64(48)) != 0 {
 22562  		*_pChanged = int32(1)
 22563  		crt.Xmemcpy(tls, unsafe.Pointer(&_pWal.Xhdr), unsafe.Pointer(&_h1), uint64(48))
 22564  		_pWal.XszPage = uint32((int32(_pWal.Xhdr.XszPage) & int32(65024)) + ((int32(_pWal.Xhdr.XszPage) & int32(1)) << 16))
 22565  	}
 22566  	return int32(0)
 22567  
 22568  	_ = _aCksum
 22569  	_ = _h2
 22570  	panic(0)
 22571  }
 22572  
 22573  var _walIndexTryHdrØ00__func__Ø000 [15]int8
 22574  
 22575  func init() {
 22576  	crt.Xstrncpy(nil, &_walIndexTryHdrØ00__func__Ø000[0], str(22592), 15)
 22577  }
 22578  
 22579  func _walShmBarrier(tls *crt.TLS, _pWal *XWal) {
 22580  	if int32(_pWal.XexclusiveMode) != int32(2) {
 22581  		_sqlite3OsShmBarrier(tls, (*Xsqlite3_file)(_pWal.XpDbFd))
 22582  	}
 22583  }
 22584  
 22585  func _sqlite3OsShmBarrier(tls *crt.TLS, _id *Xsqlite3_file) {
 22586  	func() func(*crt.TLS, *Xsqlite3_file) {
 22587  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxShmBarrier
 22588  		return *(*func(*crt.TLS, *Xsqlite3_file))(unsafe.Pointer(&v))
 22589  	}()(tls, _id)
 22590  }
 22591  
 22592  // C comment
 22593  //  /*
 22594  //  ** Generate or extend an 8 byte checksum based on the data in
 22595  //  ** array aByte[] and the initial values of aIn[0] and aIn[1] (or
 22596  //  ** initial values of 0 and 0 if aIn==NULL).
 22597  //  **
 22598  //  ** The checksum is written back into aOut[] before returning.
 22599  //  **
 22600  //  ** nByte must be a positive multiple of 8.
 22601  //  */
 22602  func _walChecksumBytes(tls *crt.TLS, _nativeCksum int32, _a *uint8, _nByte int32, _aIn *uint32, _aOut *uint32) {
 22603  	var _s1, _s2 uint32
 22604  	var _aData, _aEnd *uint32
 22605  	_aData = (*uint32)(unsafe.Pointer(_a))
 22606  	_aEnd = (*uint32)(unsafe.Pointer(elem15(_a, uintptr(_nByte))))
 22607  	if _aIn != nil {
 22608  		_s1 = *elem31(_aIn, 0)
 22609  		_s2 = *elem31(_aIn, uintptr(1))
 22610  		goto _1
 22611  	}
 22612  	_s1 = store34(&_s2, 0)
 22613  _1:
 22614  	func() {
 22615  		if _nByte < int32(8) {
 22616  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55109), unsafe.Pointer(&_walChecksumBytesØ00__func__Ø000), unsafe.Pointer(str(22607)))
 22617  			crt.X__builtin_abort(tls)
 22618  		}
 22619  	}()
 22620  	func() {
 22621  		if (_nByte & int32(7)) != int32(0) {
 22622  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55110), unsafe.Pointer(&_walChecksumBytesØ00__func__Ø000), unsafe.Pointer(str(22616)))
 22623  			crt.X__builtin_abort(tls)
 22624  		}
 22625  	}()
 22626  	if _nativeCksum == 0 {
 22627  		goto _6
 22628  	}
 22629  _7:
 22630  	_s1 += (*postInc31(&_aData, 4)) + _s2
 22631  	_s2 += (*postInc31(&_aData, 4)) + _s1
 22632  	if crt.P2U(unsafe.Pointer(_aData)) < crt.P2U(unsafe.Pointer(_aEnd)) {
 22633  		goto _7
 22634  	}
 22635  	goto _8
 22636  _6:
 22637  _9:
 22638  	_s1 += ((((((*elem31(_aData, 0)) & uint32(255)) << 24) + (((*elem31(_aData, 0)) & uint32(65280)) << 8)) + (((*elem31(_aData, 0)) & uint32(16711680)) >> 8)) + (((*elem31(_aData, 0)) & uint32(4278190080)) >> 24)) + _s2
 22639  	_s2 += ((((((*elem31(_aData, uintptr(1))) & uint32(255)) << 24) + (((*elem31(_aData, uintptr(1))) & uint32(65280)) << 8)) + (((*elem31(_aData, uintptr(1))) & uint32(16711680)) >> 8)) + (((*elem31(_aData, uintptr(1))) & uint32(4278190080)) >> 24)) + _s1
 22640  	*(*uintptr)(unsafe.Pointer(&_aData)) += 4 * uintptr(int32(2))
 22641  	if crt.P2U(unsafe.Pointer(_aData)) < crt.P2U(unsafe.Pointer(_aEnd)) {
 22642  		goto _9
 22643  	}
 22644  _8:
 22645  	*elem31(_aOut, 0) = _s1
 22646  	*elem31(_aOut, uintptr(1)) = _s2
 22647  }
 22648  
 22649  var _walChecksumBytesØ00__func__Ø000 [17]int8
 22650  
 22651  func init() {
 22652  	crt.Xstrncpy(nil, &_walChecksumBytesØ00__func__Ø000[0], str(22638), 17)
 22653  }
 22654  
 22655  // C comment
 22656  //  /*
 22657  //  ** Recover the wal-index by reading the write-ahead log file.
 22658  //  **
 22659  //  ** This routine first tries to establish an exclusive lock on the
 22660  //  ** wal-index to prevent other threads/processes from doing anything
 22661  //  ** with the WAL or wal-index while recovery is running.  The
 22662  //  ** WAL_RECOVER_LOCK is also held so that other threads will know
 22663  //  ** that this thread is running recovery.  If unable to establish
 22664  //  ** the necessary locks, this routine returns SQLITE_BUSY.
 22665  //  */
 22666  func _walIndexRecover(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 22667  	var _rc, _iLock, _nLock, _3_szFrame, _3_iFrame, _3_szPage, _3_isValid, _11_i int32
 22668  	var _nSize, _3_iOffset int64
 22669  	var _3_magic, _3_version, _9_pgno, _9_nTruncate uint32
 22670  	var _3_aFrame, _3_aData *uint8
 22671  	var _3_aBuf [32]uint8
 22672  	var _aFrameCksum [2]uint32
 22673  	var _11_pInfo *XWalCkptInfo
 22674  	_aFrameCksum = [2]uint32{}
 22675  	func() {
 22676  		if int32(_pWal.XckptLock) != int32(1) && int32(_pWal.XckptLock) != int32(0) {
 22677  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55574), unsafe.Pointer(&_walIndexRecoverØ00__func__Ø000), unsafe.Pointer(str(22655)))
 22678  			crt.X__builtin_abort(tls)
 22679  		}
 22680  	}()
 22681  
 22682  	func() {
 22683  		if _pWal.XwriteLock == 0 {
 22684  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55577), unsafe.Pointer(&_walIndexRecoverØ00__func__Ø000), unsafe.Pointer(str(15561)))
 22685  			crt.X__builtin_abort(tls)
 22686  		}
 22687  	}()
 22688  	_iLock = int32(1) + int32(_pWal.XckptLock)
 22689  	_nLock = int32(8) - _iLock
 22690  	_rc = _walLockExclusive(tls, _pWal, _iLock, _nLock)
 22691  	if _rc != 0 {
 22692  		return _rc
 22693  	}
 22694  	crt.Xmemset(tls, unsafe.Pointer(&_pWal.Xhdr), int32(0), uint64(48))
 22695  	_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.XpWalFd), &_nSize)
 22696  	if _rc != int32(0) {
 22697  		goto _recovery_error
 22698  	}
 22699  	if _nSize <= int64(32) {
 22700  		goto _finished
 22701  	}
 22702  	_3_aFrame = nil
 22703  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(&_3_aBuf), int32(32), 0)
 22704  	if _rc != int32(0) {
 22705  		goto _recovery_error
 22706  	}
 22707  	_3_magic = _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), 0))
 22708  	_3_szPage = int32(_sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(8))))
 22709  	if ((((_3_magic & uint32(4294967294)) != uint32(931071618)) || (_3_szPage&(_3_szPage-int32(1))) != 0) || (_3_szPage > int32(65536))) || (_3_szPage < int32(512)) {
 22710  		goto _finished
 22711  	}
 22712  	_pWal.Xhdr.XbigEndCksum = uint8(_3_magic & uint32(1))
 22713  	_pWal.XszPage = uint32(_3_szPage)
 22714  	_pWal.XnCkpt = _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(12)))
 22715  	crt.Xmemcpy(tls, unsafe.Pointer(&(_pWal.Xhdr.XaSalt)), unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(16))), uint64(8))
 22716  	_walChecksumBytes(tls, bool2int(int32(_pWal.Xhdr.XbigEndCksum) == int32(0)), (*uint8)(unsafe.Pointer(&_3_aBuf)), int32(24), nil, (*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))))
 22717  	if ((*elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0)) != _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(24)))) || ((*elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1))) != _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(28)))) {
 22718  		goto _finished
 22719  	}
 22720  	_3_version = _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(4)))
 22721  	if _3_version != uint32(3007000) {
 22722  		_rc = _sqlite3CantopenError(tls, int32(55644))
 22723  		goto _finished
 22724  	}
 22725  	_3_szFrame = _3_szPage + int32(24)
 22726  	_3_aFrame = (*uint8)(Xsqlite3_malloc64(tls, uint64(_3_szFrame)))
 22727  	if _3_aFrame == nil {
 22728  		_rc = _sqlite3NomemError(tls, int32(55652))
 22729  		goto _recovery_error
 22730  	}
 22731  	_3_aData = elem15(_3_aFrame, uintptr(24))
 22732  	_3_iFrame = int32(0)
 22733  	_3_iOffset = int64(32)
 22734  _17:
 22735  	if (_3_iOffset + int64(_3_szFrame)) > _nSize {
 22736  		goto _20
 22737  	}
 22738  	_3_iFrame += 1
 22739  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(_3_aFrame), _3_szFrame, _3_iOffset)
 22740  	if _rc != int32(0) {
 22741  		goto _20
 22742  	}
 22743  	_3_isValid = _walDecodeFrame(tls, _pWal, &_9_pgno, &_9_nTruncate, _3_aData, _3_aFrame)
 22744  	if _3_isValid == 0 {
 22745  		goto _20
 22746  	}
 22747  	_rc = _walIndexAppend(tls, _pWal, uint32(_3_iFrame), _9_pgno)
 22748  	if _rc != int32(0) {
 22749  		goto _20
 22750  	}
 22751  	if _9_nTruncate != 0 {
 22752  		_pWal.Xhdr.XmxFrame = uint32(_3_iFrame)
 22753  		_pWal.Xhdr.XnPage = _9_nTruncate
 22754  		_pWal.Xhdr.XszPage = uint16((_3_szPage & int32(65280)) | (_3_szPage >> 16))
 22755  		*elem31((*uint32)(unsafe.Pointer(&_aFrameCksum)), 0) = *elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0)
 22756  		*elem31((*uint32)(unsafe.Pointer(&_aFrameCksum)), uintptr(1)) = *elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1))
 22757  	}
 22758  	_3_iOffset += int64(_3_szFrame)
 22759  	goto _17
 22760  _20:
 22761  	Xsqlite3_free(tls, unsafe.Pointer(_3_aFrame))
 22762  _finished:
 22763  	if _rc != int32(0) {
 22764  		goto _recovery_error
 22765  	}
 22766  	*elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0) = *elem31((*uint32)(unsafe.Pointer(&_aFrameCksum)), 0)
 22767  	*elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1)) = *elem31((*uint32)(unsafe.Pointer(&_aFrameCksum)), uintptr(1))
 22768  	_walIndexWriteHdr(tls, _pWal)
 22769  	_11_pInfo = _walCkptInfo(tls, _pWal)
 22770  	_11_pInfo.XnBackfill = 0
 22771  	_11_pInfo.XnBackfillAttempted = _pWal.Xhdr.XmxFrame
 22772  	*elem31((*uint32)(unsafe.Pointer(&_11_pInfo.XaReadMark)), 0) = 0
 22773  	_11_i = int32(1)
 22774  _26:
 22775  	if _11_i >= int32(5) {
 22776  		goto _29
 22777  	}
 22778  	*elem31((*uint32)(unsafe.Pointer(&_11_pInfo.XaReadMark)), uintptr(_11_i)) = uint32(4294967295)
 22779  	_11_i += 1
 22780  	goto _26
 22781  _29:
 22782  	if (_pWal.Xhdr.XmxFrame) != 0 {
 22783  		*elem31((*uint32)(unsafe.Pointer(&_11_pInfo.XaReadMark)), uintptr(1)) = _pWal.Xhdr.XmxFrame
 22784  	}
 22785  	if (_pWal.Xhdr.XnPage) != 0 {
 22786  		Xsqlite3_log(tls, int32(283), str(22694), _pWal.Xhdr.XmxFrame, unsafe.Pointer(_pWal.XzWalName))
 22787  	}
 22788  _recovery_error:
 22789  	_walUnlockExclusive(tls, _pWal, _iLock, _nLock)
 22790  	return _rc
 22791  
 22792  	_ = _aFrameCksum
 22793  	_ = _3_aBuf
 22794  	panic(0)
 22795  }
 22796  
 22797  var _walIndexRecoverØ00__func__Ø000 [16]int8
 22798  
 22799  func init() {
 22800  	crt.Xstrncpy(nil, &_walIndexRecoverØ00__func__Ø000[0], str(22731), 16)
 22801  }
 22802  
 22803  func _sqlite3CantopenError(tls *crt.TLS, _lineno int32) (r0 int32) {
 22804  	return _reportError(tls, int32(14), _lineno, str(22747))
 22805  }
 22806  
 22807  // C comment
 22808  //  /*
 22809  //  ** Check to see if the frame with header in aFrame[] and content
 22810  //  ** in aData[] is valid.  If it is a valid frame, fill *piPage and
 22811  //  ** *pnTruncate and return true.  Return if the frame is not valid.
 22812  //  */
 22813  func _walDecodeFrame(tls *crt.TLS, _pWal *XWal, _piPage *uint32, _pnTruncate *uint32, _aData *uint8, _aFrame *uint8) (r0 int32) {
 22814  	var _nativeCksum int32
 22815  	var _pgno uint32
 22816  	var _aCksum *uint32
 22817  	_aCksum = (*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum)))
 22818  
 22819  	if crt.Xmemcmp(tls, unsafe.Pointer(&(_pWal.Xhdr.XaSalt)), unsafe.Pointer(elem15(_aFrame, uintptr(8))), uint64(8)) != int32(0) {
 22820  		return int32(0)
 22821  	}
 22822  	_pgno = _sqlite3Get4byte(tls, elem15(_aFrame, 0))
 22823  	if _pgno == (0) {
 22824  		return int32(0)
 22825  	}
 22826  	_nativeCksum = bool2int(int32(_pWal.Xhdr.XbigEndCksum) == int32(0))
 22827  	_walChecksumBytes(tls, _nativeCksum, _aFrame, int32(8), _aCksum, _aCksum)
 22828  	_walChecksumBytes(tls, _nativeCksum, _aData, int32(_pWal.XszPage), _aCksum, _aCksum)
 22829  	if ((*elem31(_aCksum, 0)) != _sqlite3Get4byte(tls, elem15(_aFrame, uintptr(16)))) || ((*elem31(_aCksum, uintptr(1))) != _sqlite3Get4byte(tls, elem15(_aFrame, uintptr(20)))) {
 22830  		return int32(0)
 22831  	}
 22832  	*_piPage = _pgno
 22833  	*_pnTruncate = _sqlite3Get4byte(tls, elem15(_aFrame, uintptr(4)))
 22834  	return int32(1)
 22835  }
 22836  
 22837  // C comment
 22838  //  /*
 22839  //  ** Set an entry in the wal-index that will map database page number
 22840  //  ** pPage into WAL frame iFrame.
 22841  //  */
 22842  func _walIndexAppend(tls *crt.TLS, _pWal *XWal, _iFrame uint32, _iPage uint32) (r0 int32) {
 22843  	var _rc, _1_iKey, _1_idx, _1_nCollide, _2_nByte int32
 22844  	var _iZero uint32
 22845  	var _aHash *uint16
 22846  	var _aPgno *uint32
 22847  	_iZero = uint32(0)
 22848  	_aPgno = nil
 22849  	_aHash = nil
 22850  	_rc = _walHashGet(tls, _pWal, _walFramePage(tls, _iFrame), &_aHash, &_aPgno, &_iZero)
 22851  	if _rc != int32(0) {
 22852  		goto _0
 22853  	}
 22854  	_1_idx = int32(_iFrame - _iZero)
 22855  	func() {
 22856  		if _1_idx > int32(4097) {
 22857  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55489), unsafe.Pointer(&_walIndexAppendØ00__func__Ø000), unsafe.Pointer(str(22764)))
 22858  			crt.X__builtin_abort(tls)
 22859  		}
 22860  	}()
 22861  	if _1_idx == int32(1) {
 22862  		_2_nByte = int32(int64(uintptr(unsafe.Pointer(elem20(_aHash, uintptr(8192)))) - uintptr(unsafe.Pointer(elem31(_aPgno, uintptr(1))))))
 22863  		crt.Xmemset(tls, unsafe.Pointer(elem31(_aPgno, uintptr(1))), int32(0), uint64(_2_nByte))
 22864  	}
 22865  	if (*elem31(_aPgno, uintptr(_1_idx))) != 0 {
 22866  		_walCleanupHash(tls, _pWal)
 22867  		func() {
 22868  			if (*elem31(_aPgno, uintptr(_1_idx))) != 0 {
 22869  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55507), unsafe.Pointer(&_walIndexAppendØ00__func__Ø000), unsafe.Pointer(str(22793)))
 22870  				crt.X__builtin_abort(tls)
 22871  			}
 22872  		}()
 22873  	}
 22874  	_1_nCollide = _1_idx
 22875  	_1_iKey = _walHash(tls, _iPage)
 22876  _7:
 22877  	if (*elem20(_aHash, uintptr(_1_iKey))) == 0 {
 22878  		goto _10
 22879  	}
 22880  	if postInc2(&_1_nCollide, -1) == int32(0) {
 22881  		return _sqlite3CorruptError(tls, int32(55513))
 22882  	}
 22883  	_1_iKey = _walNextHash(tls, _1_iKey)
 22884  	goto _7
 22885  _10:
 22886  	*elem31(_aPgno, uintptr(_1_idx)) = _iPage
 22887  	*elem20(_aHash, uintptr(_1_iKey)) = uint16(_1_idx)
 22888  _0:
 22889  	return _rc
 22890  
 22891  	_ = _1_nCollide
 22892  	panic(0)
 22893  }
 22894  
 22895  var _walIndexAppendØ00__func__Ø000 [15]int8
 22896  
 22897  func init() {
 22898  	crt.Xstrncpy(nil, &_walIndexAppendØ00__func__Ø000[0], str(22805), 15)
 22899  }
 22900  
 22901  // C comment
 22902  //  /*
 22903  //  ** Write the header information in pWal->hdr into the wal-index.
 22904  //  **
 22905  //  ** The checksum on pWal->hdr is updated before it is written.
 22906  //  */
 22907  func _walIndexWriteHdr(tls *crt.TLS, _pWal *XWal) {
 22908  	var _nCksum int32
 22909  	var _aHdr *XWalIndexHdr
 22910  	_aHdr = _walIndexHdr(tls, _pWal)
 22911  	_nCksum = int32(40)
 22912  	func() {
 22913  		if _pWal.XwriteLock == 0 {
 22914  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55144), unsafe.Pointer(&_walIndexWriteHdrØ00__func__Ø000), unsafe.Pointer(str(15561)))
 22915  			crt.X__builtin_abort(tls)
 22916  		}
 22917  	}()
 22918  	_pWal.Xhdr.XisInit = uint8(1)
 22919  	_pWal.Xhdr.XiVersion = uint32(3007000)
 22920  	_walChecksumBytes(tls, int32(1), (*uint8)(unsafe.Pointer(&_pWal.Xhdr)), _nCksum, nil, (*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaCksum))))
 22921  	crt.Xmemcpy(tls, unsafe.Pointer(elem46(_aHdr, uintptr(1))), unsafe.Pointer(&_pWal.Xhdr), uint64(48))
 22922  	_walShmBarrier(tls, _pWal)
 22923  	crt.Xmemcpy(tls, unsafe.Pointer(elem46(_aHdr, 0)), unsafe.Pointer(&_pWal.Xhdr), uint64(48))
 22924  }
 22925  
 22926  var _walIndexWriteHdrØ00__func__Ø000 [17]int8
 22927  
 22928  func init() {
 22929  	crt.Xstrncpy(nil, &_walIndexWriteHdrØ00__func__Ø000[0], str(22820), 17)
 22930  }
 22931  
 22932  // C comment
 22933  //  /*
 22934  //  ** Return a pointer to the WalCkptInfo structure in the wal-index.
 22935  //  */
 22936  func _walCkptInfo(tls *crt.TLS, _pWal *XWal) (r0 *XWalCkptInfo) {
 22937  	func() {
 22938  		if _pWal.XnWiData <= int32(0) || (*elem38(_pWal.XapWiData, 0)) == nil {
 22939  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55058), unsafe.Pointer(&_walCkptInfoØ00__func__Ø000), unsafe.Pointer(str(15226)))
 22940  			crt.X__builtin_abort(tls)
 22941  		}
 22942  	}()
 22943  	return (*XWalCkptInfo)(unsafe.Pointer(elem31(*elem38(_pWal.XapWiData, 0), uintptr(24))))
 22944  }
 22945  
 22946  var _walCkptInfoØ00__func__Ø000 [12]int8
 22947  
 22948  func init() {
 22949  	crt.Xstrncpy(nil, &_walCkptInfoØ00__func__Ø000[0], str(22837), 12)
 22950  }
 22951  
 22952  // C comment
 22953  //  /*
 22954  //  ** The cache of the wal-index header must be valid to call this function.
 22955  //  ** Return the page-size in bytes used by the database.
 22956  //  */
 22957  func _walPagesize(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 22958  	return (int32(_pWal.Xhdr.XszPage) & int32(65024)) + ((int32(_pWal.Xhdr.XszPage) & int32(1)) << 16)
 22959  }
 22960  
 22961  // C comment
 22962  //  /*
 22963  //  ** Copy as much content as we can from the WAL back into the database file
 22964  //  ** in response to an sqlite3_wal_checkpoint() request or the equivalent.
 22965  //  **
 22966  //  ** The amount of information copies from WAL to database might be limited
 22967  //  ** by active readers.  This routine will never overwrite a database page
 22968  //  ** that a concurrent reader might be using.
 22969  //  **
 22970  //  ** All I/O barrier operations (a.k.a fsyncs) occur in this routine when
 22971  //  ** SQLite is in WAL-mode in synchronous=NORMAL.  That means that if
 22972  //  ** checkpoints are always run by a background thread or background
 22973  //  ** process, foreground threads will never block on a lengthy fsync call.
 22974  //  **
 22975  //  ** Fsync is called on the WAL before writing content out of the WAL and
 22976  //  ** into the database.  This ensures that if the new content is persistent
 22977  //  ** in the WAL and can be recovered following a power-loss or hard reset.
 22978  //  **
 22979  //  ** Fsync is also called on the database file if (and only if) the entire
 22980  //  ** WAL content is copied into the database file.  This second fsync makes
 22981  //  ** it safe to delete the WAL since the new content will persist in the
 22982  //  ** database file.
 22983  //  **
 22984  //  ** This routine uses and updates the nBackfill field of the wal-index header.
 22985  //  ** This is the only routine that will increase the value of nBackfill.
 22986  //  ** (A WAL reset or recovery will revert nBackfill to zero, but not increase
 22987  //  ** its value.)
 22988  //  **
 22989  //  ** The caller must be holding sufficient locks to ensure that no other
 22990  //  ** checkpoint is running (in any other thread or process) at the same
 22991  //  ** time.
 22992  //  */
 22993  func _walCheckpoint(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _eMode int32, _xBusy func(*crt.TLS, unsafe.Pointer) int32, _pBusyArg unsafe.Pointer, _sync_flags int32, _zBuf *uint8) (r0 int32) {
 22994  	var _rc, _szPage, _i int32
 22995  	var _8_nSize, _10_nReq, _12_iOffset, _16_szDb int64
 22996  	var _iDbpage, _iFrame, _mxSafeFrame, _mxPage, _3_y, _8_nBackfill, _22_salt1 uint32
 22997  	var _pInfo *XWalCkptInfo
 22998  	var _pIter *XWalIterator
 22999  	_rc = int32(0)
 23000  	_pIter = nil
 23001  	_iDbpage = uint32(0)
 23002  	_iFrame = uint32(0)
 23003  	_szPage = _walPagesize(tls, _pWal)
 23004  	_pInfo = _walCkptInfo(tls, _pWal)
 23005  	if _pInfo.XnBackfill >= (_pWal.Xhdr.XmxFrame) {
 23006  		goto _0
 23007  	}
 23008  	_rc = _walIteratorInit(tls, _pWal, &_pIter)
 23009  	if _rc != int32(0) {
 23010  		return _rc
 23011  	}
 23012  	func() {
 23013  		if _pIter == nil {
 23014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56230), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(22849)))
 23015  			crt.X__builtin_abort(tls)
 23016  		}
 23017  	}()
 23018  	func() {
 23019  		if _eMode == int32(0) && _xBusy != nil {
 23020  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56234), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(22441)))
 23021  			crt.X__builtin_abort(tls)
 23022  		}
 23023  	}()
 23024  	_mxSafeFrame = _pWal.Xhdr.XmxFrame
 23025  	_mxPage = _pWal.Xhdr.XnPage
 23026  	_i = int32(1)
 23027  _7:
 23028  	if _i >= int32(5) {
 23029  		goto _10
 23030  	}
 23031  	_3_y = *elem31((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_i))
 23032  	if _mxSafeFrame <= _3_y {
 23033  		goto _11
 23034  	}
 23035  	func() {
 23036  		if _3_y > (_pWal.Xhdr.XmxFrame) {
 23037  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56254), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(22855)))
 23038  			crt.X__builtin_abort(tls)
 23039  		}
 23040  	}()
 23041  	_rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, int32(3)+_i, int32(1))
 23042  	if _rc == int32(0) {
 23043  		*elem31((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_i)) = func() uint32 {
 23044  			if _i == int32(1) {
 23045  				return _mxSafeFrame
 23046  			}
 23047  			return uint32(4294967295)
 23048  		}()
 23049  		_walUnlockExclusive(tls, _pWal, int32(3)+_i, int32(1))
 23050  		goto _19
 23051  	}
 23052  	if _rc == int32(5) {
 23053  		_mxSafeFrame = _3_y
 23054  		_xBusy = nil
 23055  		goto _19
 23056  	}
 23057  	goto _walcheckpoint_out
 23058  _19:
 23059  _11:
 23060  	_i += 1
 23061  	goto _7
 23062  _10:
 23063  	if _pInfo.XnBackfill >= _mxSafeFrame || store2(&_rc, _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, int32(3), int32(1))) != int32(0) {
 23064  		goto _21
 23065  	}
 23066  	_8_nBackfill = _pInfo.XnBackfill
 23067  	_pInfo.XnBackfillAttempted = _mxSafeFrame
 23068  	if _sync_flags != 0 {
 23069  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.XpWalFd), _sync_flags)
 23070  	}
 23071  	if _rc != int32(0) {
 23072  		goto _23
 23073  	}
 23074  	_10_nReq = int64(_mxPage) * int64(_szPage)
 23075  	_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.XpDbFd), &_8_nSize)
 23076  	if (_rc == int32(0)) && (_8_nSize < _10_nReq) {
 23077  		_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pWal.XpDbFd), int32(5), unsafe.Pointer(&_10_nReq))
 23078  	}
 23079  _23:
 23080  	if _rc != int32(0) || int32(0) != _walIteratorNext(tls, _pIter, &_iDbpage, &_iFrame) {
 23081  		goto _27
 23082  	}
 23083  	func() {
 23084  		if _walFramePgno(tls, _pWal, _iFrame) != _iDbpage {
 23085  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56296), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(22876)))
 23086  			crt.X__builtin_abort(tls)
 23087  		}
 23088  	}()
 23089  	if (*(*int32)(unsafe.Pointer(&_db.Xu1))) != 0 {
 23090  		_rc = func() int32 {
 23091  			if _db.XmallocFailed != 0 {
 23092  				return _sqlite3NomemError(tls, int32(56298))
 23093  			}
 23094  			return int32(9)
 23095  		}()
 23096  		goto _27
 23097  	}
 23098  	if ((_iFrame <= _8_nBackfill) || (_iFrame > _mxSafeFrame)) || (_iDbpage > _mxPage) {
 23099  		goto _23
 23100  	}
 23101  	_12_iOffset = (int64(32) + (int64(_iFrame-uint32(1)) * int64(_szPage+int32(24)))) + int64(24)
 23102  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(_zBuf), _szPage, _12_iOffset)
 23103  	if _rc != int32(0) {
 23104  		goto _27
 23105  	}
 23106  	_12_iOffset = int64(_iDbpage-uint32(1)) * int64(_szPage)
 23107  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.XpDbFd), unsafe.Pointer(_zBuf), _szPage, _12_iOffset)
 23108  	if _rc != int32(0) {
 23109  		goto _27
 23110  	}
 23111  	goto _23
 23112  _27:
 23113  	if _rc != int32(0) {
 23114  		goto _39
 23115  	}
 23116  	if _mxSafeFrame != (_walIndexHdr(tls, _pWal).XmxFrame) {
 23117  		goto _40
 23118  	}
 23119  	_16_szDb = int64(_pWal.Xhdr.XnPage) * int64(_szPage)
 23120  	_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _16_szDb)
 23121  	if (_rc == int32(0)) && _sync_flags != 0 {
 23122  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _sync_flags)
 23123  	}
 23124  _40:
 23125  	if _rc == int32(0) {
 23126  		_pInfo.XnBackfill = _mxSafeFrame
 23127  	}
 23128  _39:
 23129  	_walUnlockExclusive(tls, _pWal, int32(3), int32(1))
 23130  _21:
 23131  	if _rc == int32(5) {
 23132  		_rc = int32(0)
 23133  	}
 23134  _0:
 23135  	if _rc != int32(0) || _eMode == int32(0) {
 23136  		goto _walcheckpoint_out
 23137  	}
 23138  	func() {
 23139  		if _pWal.XwriteLock == 0 {
 23140  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56346), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(15561)))
 23141  			crt.X__builtin_abort(tls)
 23142  		}
 23143  	}()
 23144  	if _pInfo.XnBackfill < (_pWal.Xhdr.XmxFrame) {
 23145  		_rc = int32(5)
 23146  		goto _51
 23147  	}
 23148  	if _eMode < int32(2) {
 23149  		goto _51
 23150  	}
 23151  	Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_22_salt1))
 23152  	func() {
 23153  		if _pInfo.XnBackfill != (_pWal.Xhdr.XmxFrame) {
 23154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56352), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(22912)))
 23155  			crt.X__builtin_abort(tls)
 23156  		}
 23157  	}()
 23158  	_rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, int32(4), int32(4))
 23159  	if _rc != int32(0) {
 23160  		goto _54
 23161  	}
 23162  	if _eMode == int32(3) {
 23163  		_walRestartHdr(tls, _pWal, _22_salt1)
 23164  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pWal.XpWalFd), 0)
 23165  	}
 23166  	_walUnlockExclusive(tls, _pWal, int32(4), int32(4))
 23167  _54:
 23168  _51:
 23169  _walcheckpoint_out:
 23170  	_walIteratorFree(tls, _pIter)
 23171  	return _rc
 23172  }
 23173  
 23174  // C comment
 23175  //  /*
 23176  //  ** Construct a WalInterator object that can be used to loop over all
 23177  //  ** pages in the WAL in ascending order. The caller must hold the checkpoint
 23178  //  ** lock.
 23179  //  **
 23180  //  ** On success, make *pp point to the newly allocated WalInterator object
 23181  //  ** return SQLITE_OK. Otherwise, return an error code. If this routine
 23182  //  ** returns an error, the value of *pp is undefined.
 23183  //  **
 23184  //  ** The calling routine should invoke walIteratorFree() to destroy the
 23185  //  ** WalIterator object when it has finished with it.
 23186  //  */
 23187  func _walIteratorInit(tls *crt.TLS, _pWal *XWal, _pp **XWalIterator) (r0 int32) {
 23188  	var _nSegment, _nByte, _i, _rc, _4_j, _4_nEntry int32
 23189  	var _iLast, _3_iZero uint32
 23190  	var _aTmp, _3_aHash, _4_aIndex *uint16
 23191  	var _3_aPgno *uint32
 23192  	var _p *XWalIterator
 23193  	_rc = int32(0)
 23194  	func() {
 23195  		if _pWal.XckptLock == 0 || (_pWal.Xhdr.XmxFrame) <= (0) {
 23196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56044), unsafe.Pointer(&_walIteratorInitØ00__func__Ø000), unsafe.Pointer(str(22948)))
 23197  			crt.X__builtin_abort(tls)
 23198  		}
 23199  	}()
 23200  	_iLast = _pWal.Xhdr.XmxFrame
 23201  	_nSegment = _walFramePage(tls, _iLast) + int32(1)
 23202  	_nByte = int32((uint64(40) + (uint64(_nSegment-int32(1)) * uint64(32))) + (uint64(_iLast) * uint64(2)))
 23203  	_p = (*XWalIterator)(Xsqlite3_malloc64(tls, uint64(_nByte)))
 23204  	if _p == nil {
 23205  		return _sqlite3NomemError(tls, int32(56054))
 23206  	}
 23207  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(_nByte))
 23208  	_p.XnSegment = _nSegment
 23209  	_aTmp = (*uint16)(Xsqlite3_malloc64(tls, uint64(2)*uint64(func() uint32 {
 23210  		if _iLast > uint32(4096) {
 23211  			return uint32(4096)
 23212  		}
 23213  		return _iLast
 23214  	}())))
 23215  	if _aTmp == nil {
 23216  		_rc = _sqlite3NomemError(tls, int32(56066))
 23217  	}
 23218  	_i = int32(0)
 23219  _7:
 23220  	if _rc != int32(0) || _i >= _nSegment {
 23221  		goto _11
 23222  	}
 23223  	_rc = _walHashGet(tls, _pWal, _i, &_3_aHash, &_3_aPgno, &_3_iZero)
 23224  	if _rc != int32(0) {
 23225  		goto _12
 23226  	}
 23227  	*(*uintptr)(unsafe.Pointer(&_3_aPgno)) += uintptr(4)
 23228  	if (_i + int32(1)) == _nSegment {
 23229  		_4_nEntry = int32(_iLast - _3_iZero)
 23230  		goto _14
 23231  	}
 23232  	_4_nEntry = int32(int64((uintptr(unsafe.Pointer(_3_aHash)) - uintptr(unsafe.Pointer(_3_aPgno))) / 4))
 23233  _14:
 23234  	_4_aIndex = elem20((*uint16)(unsafe.Pointer(elem47((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_p.XnSegment)))), uintptr(_3_iZero))
 23235  	_3_iZero += 1
 23236  	_4_j = int32(0)
 23237  _15:
 23238  	if _4_j >= _4_nEntry {
 23239  		goto _18
 23240  	}
 23241  	*elem20(_4_aIndex, uintptr(_4_j)) = uint16(_4_j)
 23242  	_4_j += 1
 23243  	goto _15
 23244  _18:
 23245  	_walMergesort(tls, _3_aPgno, _aTmp, _4_aIndex, &_4_nEntry)
 23246  	elem47((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_i)).XiZero = int32(_3_iZero)
 23247  	elem47((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_i)).XnEntry = _4_nEntry
 23248  	elem47((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_i)).XaIndex = _4_aIndex
 23249  	elem47((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_i)).XaPgno = _3_aPgno
 23250  _12:
 23251  	_i += 1
 23252  	goto _7
 23253  _11:
 23254  	Xsqlite3_free(tls, unsafe.Pointer(_aTmp))
 23255  	if _rc != int32(0) {
 23256  		_walIteratorFree(tls, _p)
 23257  	}
 23258  	*_pp = _p
 23259  	return _rc
 23260  }
 23261  
 23262  var _walIteratorInitØ00__func__Ø000 [16]int8
 23263  
 23264  func init() {
 23265  	crt.Xstrncpy(nil, &_walIteratorInitØ00__func__Ø000[0], str(22986), 16)
 23266  }
 23267  
 23268  // C comment
 23269  //  /*
 23270  //  ** Sort the elements in list aList using aContent[] as the sort key.
 23271  //  ** Remove elements with duplicate keys, preferring to keep the
 23272  //  ** larger aList[] values.
 23273  //  **
 23274  //  ** The aList[] entries are indices into aContent[].  The values in
 23275  //  ** aList[] are to be sorted so that for all J<K:
 23276  //  **
 23277  //  **      aContent[aList[J]] < aContent[aList[K]]
 23278  //  **
 23279  //  ** For any X and Y such that
 23280  //  **
 23281  //  **      aContent[aList[X]] == aContent[aList[Y]]
 23282  //  **
 23283  //  ** Keep the larger of the two values aList[X] and aList[Y] and discard
 23284  //  ** the smaller.
 23285  //  */
 23286  func _walMergesort(tls *crt.TLS, _aContent *uint32, _aBuffer *uint16, _aList *uint16, _pnList *int32) {
 23287  	var _nList, _nMerge, _iList, _5_i int32
 23288  	var _iSub uint32
 23289  	var _aMerge *uint16
 23290  	var _aSub [13]TSublist
 23291  	var _2_p, _4_p *TSublist
 23292  	_nList = *_pnList
 23293  	_nMerge = int32(0)
 23294  	_aMerge = nil
 23295  	_iSub = uint32(0)
 23296  	crt.Xmemset(tls, unsafe.Pointer(&_aSub), int32(0), uint64(208))
 23297  	func() {
 23298  		if _nList > int32(4096) || _nList <= int32(0) {
 23299  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55972), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23002)))
 23300  			crt.X__builtin_abort(tls)
 23301  		}
 23302  	}()
 23303  
 23304  	_iList = int32(0)
 23305  _3:
 23306  	if _iList >= _nList {
 23307  		goto _6
 23308  	}
 23309  	_nMerge = int32(1)
 23310  	_aMerge = elem20(_aList, uintptr(_iList))
 23311  	_iSub = 0
 23312  _7:
 23313  	if (_iList & (int32(1) << uint(int32(_iSub)))) == 0 {
 23314  		goto _10
 23315  	}
 23316  	func() {
 23317  		if _iSub >= uint32(13) {
 23318  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55980), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23036)))
 23319  			crt.X__builtin_abort(tls)
 23320  		}
 23321  	}()
 23322  	_2_p = elem48((*TSublist)(unsafe.Pointer(&_aSub)), uintptr(_iSub))
 23323  	func() {
 23324  		if _2_p.XaList == nil || _2_p.XnList > (int32(1)<<uint(int32(_iSub))) {
 23325  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55982), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23057)))
 23326  			crt.X__builtin_abort(tls)
 23327  		}
 23328  	}()
 23329  	func() {
 23330  		if _2_p.XaList != elem20(_aList, uintptr(_iList&(^((int32(2)<<uint(int32(_iSub)))-int32(1))))) {
 23331  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55983), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23089)))
 23332  			crt.X__builtin_abort(tls)
 23333  		}
 23334  	}()
 23335  	_walMerge(tls, _aContent, _2_p.XaList, _2_p.XnList, &_aMerge, &_nMerge, _aBuffer)
 23336  	_iSub += 1
 23337  	goto _7
 23338  _10:
 23339  	elem48((*TSublist)(unsafe.Pointer(&_aSub)), uintptr(_iSub)).XaList = _aMerge
 23340  	elem48((*TSublist)(unsafe.Pointer(&_aSub)), uintptr(_iSub)).XnList = _nMerge
 23341  	_iList += 1
 23342  	goto _3
 23343  _6:
 23344  	_iSub += 1
 23345  _18:
 23346  	if _iSub >= uint32(13) {
 23347  		goto _21
 23348  	}
 23349  	if (_nList & (int32(1) << uint(int32(_iSub)))) != 0 {
 23350  		func() {
 23351  			if _iSub >= uint32(13) {
 23352  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55993), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23036)))
 23353  				crt.X__builtin_abort(tls)
 23354  			}
 23355  		}()
 23356  		_4_p = elem48((*TSublist)(unsafe.Pointer(&_aSub)), uintptr(_iSub))
 23357  		func() {
 23358  			if _4_p.XnList > (int32(1) << uint(int32(_iSub))) {
 23359  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55995), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23128)))
 23360  				crt.X__builtin_abort(tls)
 23361  			}
 23362  		}()
 23363  		func() {
 23364  			if _4_p.XaList != elem20(_aList, uintptr(_nList&(^((int32(2)<<uint(int32(_iSub)))-int32(1))))) {
 23365  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55996), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23148)))
 23366  				crt.X__builtin_abort(tls)
 23367  			}
 23368  		}()
 23369  		_walMerge(tls, _aContent, _4_p.XaList, _4_p.XnList, &_aMerge, &_nMerge, _aBuffer)
 23370  	}
 23371  	_iSub += 1
 23372  	goto _18
 23373  _21:
 23374  	func() {
 23375  		if _aMerge != _aList {
 23376  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56000), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23187)))
 23377  			crt.X__builtin_abort(tls)
 23378  		}
 23379  	}()
 23380  	*_pnList = _nMerge
 23381  	_5_i = int32(1)
 23382  _31:
 23383  	if _5_i >= (*_pnList) {
 23384  		goto _34
 23385  	}
 23386  	func() {
 23387  		if (*elem31(_aContent, uintptr(*elem20(_aList, uintptr(_5_i))))) <= (*elem31(_aContent, uintptr(*elem20(_aList, uintptr(_5_i-int32(1)))))) {
 23388  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56007), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23201)))
 23389  			crt.X__builtin_abort(tls)
 23390  		}
 23391  	}()
 23392  	_5_i += 1
 23393  	goto _31
 23394  _34:
 23395  	_ = _aSub
 23396  }
 23397  
 23398  var _walMergesortØ00__func__Ø000 [13]int8
 23399  
 23400  func init() {
 23401  	crt.Xstrncpy(nil, &_walMergesortØ00__func__Ø000[0], str(23243), 13)
 23402  }
 23403  
 23404  // C comment
 23405  //  /*
 23406  //  ** This function merges two sorted lists into a single sorted list.
 23407  //  **
 23408  //  ** aLeft[] and aRight[] are arrays of indices.  The sort key is
 23409  //  ** aContent[aLeft[]] and aContent[aRight[]].  Upon entry, the following
 23410  //  ** is guaranteed for all J<K:
 23411  //  **
 23412  //  **        aContent[aLeft[J]] < aContent[aLeft[K]]
 23413  //  **        aContent[aRight[J]] < aContent[aRight[K]]
 23414  //  **
 23415  //  ** This routine overwrites aRight[] with a new (probably longer) sequence
 23416  //  ** of indices such that the aRight[] contains every index that appears in
 23417  //  ** either aLeft[] or the old aRight[] and such that the second condition
 23418  //  ** above is still met.
 23419  //  **
 23420  //  ** The aContent[aLeft[X]] values will be unique for all X.  And the
 23421  //  ** aContent[aRight[X]] values will be unique too.  But there might be
 23422  //  ** one or more combinations of X and Y such that
 23423  //  **
 23424  //  **      aLeft[X]!=aRight[Y]  &&  aContent[aLeft[X]] == aContent[aRight[Y]]
 23425  //  **
 23426  //  ** When that happens, omit the aLeft[X] and use the aRight[Y] index.
 23427  //  */
 23428  func _walMerge(tls *crt.TLS, _aContent *uint32, _aLeft *uint16, _nLeft int32, _paRight **uint16, _pnRight *int32, _aTmp *uint16) {
 23429  	var _iLeft, _iRight, _iOut, _nRight int32
 23430  	var _1_dbpage uint32
 23431  	var _1_logpage uint16
 23432  	var _aRight *uint16
 23433  	_iLeft = int32(0)
 23434  	_iRight = int32(0)
 23435  	_iOut = int32(0)
 23436  	_nRight = *_pnRight
 23437  	_aRight = *_paRight
 23438  	func() {
 23439  		if _nLeft <= int32(0) || _nRight <= int32(0) {
 23440  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55910), unsafe.Pointer(&_walMergeØ00__func__Ø000), unsafe.Pointer(str(23256)))
 23441  			crt.X__builtin_abort(tls)
 23442  		}
 23443  	}()
 23444  _3:
 23445  	if _iRight >= _nRight && _iLeft >= _nLeft {
 23446  		goto _4
 23447  	}
 23448  	if (_iLeft < _nLeft) && ((_iRight >= _nRight) || ((*elem31(_aContent, uintptr(*elem20(_aLeft, uintptr(_iLeft))))) < (*elem31(_aContent, uintptr(*elem20(_aRight, uintptr(_iRight))))))) {
 23449  		_1_logpage = *elem20(_aLeft, uintptr(postInc2(&_iLeft, 1)))
 23450  		goto _9
 23451  	}
 23452  	_1_logpage = *elem20(_aRight, uintptr(postInc2(&_iRight, 1)))
 23453  _9:
 23454  	_1_dbpage = *elem31(_aContent, uintptr(_1_logpage))
 23455  	*elem20(_aTmp, uintptr(postInc2(&_iOut, 1))) = _1_logpage
 23456  	if (_iLeft < _nLeft) && ((*elem31(_aContent, uintptr(*elem20(_aLeft, uintptr(_iLeft))))) == _1_dbpage) {
 23457  		_iLeft += 1
 23458  	}
 23459  	func() {
 23460  		if _iLeft < _nLeft && (*elem31(_aContent, uintptr(*elem20(_aLeft, uintptr(_iLeft))))) <= _1_dbpage {
 23461  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55927), unsafe.Pointer(&_walMergeØ00__func__Ø000), unsafe.Pointer(str(23276)))
 23462  			crt.X__builtin_abort(tls)
 23463  		}
 23464  	}()
 23465  	func() {
 23466  		if _iRight < _nRight && (*elem31(_aContent, uintptr(*elem20(_aRight, uintptr(_iRight))))) <= _1_dbpage {
 23467  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55928), unsafe.Pointer(&_walMergeØ00__func__Ø000), unsafe.Pointer(str(23322)))
 23468  			crt.X__builtin_abort(tls)
 23469  		}
 23470  	}()
 23471  	goto _3
 23472  _4:
 23473  	*_paRight = _aLeft
 23474  	*_pnRight = _iOut
 23475  	crt.Xmemcpy(tls, unsafe.Pointer(_aLeft), unsafe.Pointer(_aTmp), uint64(2)*uint64(_iOut))
 23476  }
 23477  
 23478  var _walMergeØ00__func__Ø000 [9]int8
 23479  
 23480  func init() {
 23481  	crt.Xstrncpy(nil, &_walMergeØ00__func__Ø000[0], str(23372), 9)
 23482  }
 23483  
 23484  // C comment
 23485  //  /*
 23486  //  ** Free an iterator allocated by walIteratorInit().
 23487  //  */
 23488  func _walIteratorFree(tls *crt.TLS, _p *XWalIterator) {
 23489  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 23490  }
 23491  
 23492  var _walCheckpointØ00__func__Ø000 [14]int8
 23493  
 23494  func init() {
 23495  	crt.Xstrncpy(nil, &_walCheckpointØ00__func__Ø000[0], str(23381), 14)
 23496  }
 23497  
 23498  // C comment
 23499  //  /*
 23500  //  ** Find the smallest page number out of all pages held in the WAL that
 23501  //  ** has not been returned by any prior invocation of this method on the
 23502  //  ** same WalIterator object.   Write into *piFrame the frame index where
 23503  //  ** that page was last written into the WAL.  Write into *piPage the page
 23504  //  ** number.
 23505  //  **
 23506  //  ** Return 0 on success.  If there are no pages in the WAL with a page
 23507  //  ** number larger than *piPage, then return 1.
 23508  //  */
 23509  func _walIteratorNext(tls *crt.TLS, _p *XWalIterator, _piPage *uint32, _piFrame *uint32) (r0 int32) {
 23510  	var _i int32
 23511  	var _iMin, _iRet, _2_iPg uint32
 23512  	var _1_pSegment *TWalSegment
 23513  	_iRet = uint32(4294967295)
 23514  	_iMin = uint32(_p.XiPrior)
 23515  	func() {
 23516  		if _iMin >= uint32(4294967295) {
 23517  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55853), unsafe.Pointer(&_walIteratorNextØ00__func__Ø000), unsafe.Pointer(str(23395)))
 23518  			crt.X__builtin_abort(tls)
 23519  		}
 23520  	}()
 23521  	_i = _p.XnSegment - int32(1)
 23522  _2:
 23523  	if _i < int32(0) {
 23524  		goto _5
 23525  	}
 23526  	_1_pSegment = elem47((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_i))
 23527  _6:
 23528  	if _1_pSegment.XiNext >= _1_pSegment.XnEntry {
 23529  		goto _7
 23530  	}
 23531  	_2_iPg = *elem31(_1_pSegment.XaPgno, uintptr(*elem20(_1_pSegment.XaIndex, uintptr(_1_pSegment.XiNext))))
 23532  	if _2_iPg <= _iMin {
 23533  		goto _8
 23534  	}
 23535  	if _2_iPg < _iRet {
 23536  		_iRet = _2_iPg
 23537  		*_piFrame = uint32(_1_pSegment.XiZero + int32(*elem20(_1_pSegment.XaIndex, uintptr(_1_pSegment.XiNext))))
 23538  	}
 23539  	goto _7
 23540  _8:
 23541  	_1_pSegment.XiNext += 1
 23542  	goto _6
 23543  _7:
 23544  	_i -= 1
 23545  	goto _2
 23546  _5:
 23547  	*_piPage = uint32(store2(&_p.XiPrior, int32(_iRet)))
 23548  	return bool2int(_iRet == uint32(4294967295))
 23549  }
 23550  
 23551  var _walIteratorNextØ00__func__Ø000 [16]int8
 23552  
 23553  func init() {
 23554  	crt.Xstrncpy(nil, &_walIteratorNextØ00__func__Ø000[0], str(23411), 16)
 23555  }
 23556  
 23557  // C comment
 23558  //  /*
 23559  //  ** The following is guaranteed when this function is called:
 23560  //  **
 23561  //  **   a) the WRITER lock is held,
 23562  //  **   b) the entire log file has been checkpointed, and
 23563  //  **   c) any existing readers are reading exclusively from the database
 23564  //  **      file - there are no readers that may attempt to read a frame from
 23565  //  **      the log file.
 23566  //  **
 23567  //  ** This function updates the shared-memory structures so that the next
 23568  //  ** client to write to the database (which may be this one) does so by
 23569  //  ** writing frames into the start of the log file.
 23570  //  **
 23571  //  ** The value of parameter salt1 is used as the aSalt[1] value in the
 23572  //  ** new wal-index header. It should be passed a pseudo-random value (i.e.
 23573  //  ** one obtained from sqlite3_randomness()).
 23574  //  */
 23575  func _walRestartHdr(tls *crt.TLS, _pWal *XWal, _salt1 uint32) {
 23576  	var _i int32
 23577  	var _aSalt *uint32
 23578  	var _pInfo *XWalCkptInfo
 23579  	_pInfo = _walCkptInfo(tls, _pWal)
 23580  	_aSalt = (*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaSalt)))
 23581  	_pWal.XnCkpt += 1
 23582  	_pWal.Xhdr.XmxFrame = 0
 23583  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem31(_aSalt, 0))), uint32(1)+_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(elem31(_aSalt, 0)))))
 23584  	crt.Xmemcpy(tls, unsafe.Pointer(elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaSalt))), uintptr(1))), unsafe.Pointer(&_salt1), uint64(4))
 23585  	_walIndexWriteHdr(tls, _pWal)
 23586  	_pInfo.XnBackfill = 0
 23587  	_pInfo.XnBackfillAttempted = 0
 23588  	*elem31((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(1)) = 0
 23589  	_i = int32(2)
 23590  _0:
 23591  	if _i >= int32(5) {
 23592  		goto _3
 23593  	}
 23594  	*elem31((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_i)) = uint32(4294967295)
 23595  	_i += 1
 23596  	goto _0
 23597  _3:
 23598  	func() {
 23599  		if (*elem31((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), 0)) != (0) {
 23600  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56166), unsafe.Pointer(&_walRestartHdrØ00__func__Ø000), unsafe.Pointer(str(23427)))
 23601  			crt.X__builtin_abort(tls)
 23602  		}
 23603  	}()
 23604  }
 23605  
 23606  var _walRestartHdrØ00__func__Ø000 [14]int8
 23607  
 23608  func init() {
 23609  	crt.Xstrncpy(nil, &_walRestartHdrØ00__func__Ø000[0], str(23450), 14)
 23610  }
 23611  
 23612  // C comment
 23613  //  /*
 23614  //  ** If the WAL file is currently larger than nMax bytes in size, truncate
 23615  //  ** it to exactly nMax bytes. If an error occurs while doing so, ignore it.
 23616  //  */
 23617  func _walLimitSize(tls *crt.TLS, _pWal *XWal, _nMax int64) {
 23618  	var _rx int32
 23619  	var _sz int64
 23620  	_sqlite3BeginBenignMalloc(tls)
 23621  	_rx = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.XpWalFd), &_sz)
 23622  	if (_rx == int32(0)) && (_sz > _nMax) {
 23623  		_rx = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pWal.XpWalFd), _nMax)
 23624  	}
 23625  	_sqlite3EndBenignMalloc(tls)
 23626  	if _rx != 0 {
 23627  		Xsqlite3_log(tls, _rx, str(23464), unsafe.Pointer(_pWal.XzWalName))
 23628  	}
 23629  }
 23630  
 23631  // C comment
 23632  //  /*
 23633  //  ** Close an open wal-index.
 23634  //  */
 23635  func _walIndexClose(tls *crt.TLS, _pWal *XWal, _isDelete int32) {
 23636  	var _1_i int32
 23637  	if int32(_pWal.XexclusiveMode) != int32(2) {
 23638  		goto _0
 23639  	}
 23640  	_1_i = int32(0)
 23641  _1:
 23642  	if _1_i >= _pWal.XnWiData {
 23643  		goto _4
 23644  	}
 23645  	Xsqlite3_free(tls, unsafe.Pointer(*elem38(_pWal.XapWiData, uintptr(_1_i))))
 23646  	*elem38(_pWal.XapWiData, uintptr(_1_i)) = nil
 23647  	_1_i += 1
 23648  	goto _1
 23649  _4:
 23650  	goto _5
 23651  _0:
 23652  	_sqlite3OsShmUnmap(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _isDelete)
 23653  _5:
 23654  }
 23655  
 23656  func _sqlite3OsShmUnmap(tls *crt.TLS, _id *Xsqlite3_file, _deleteFlag int32) (r0 int32) {
 23657  	return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 {
 23658  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxShmUnmap
 23659  		return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v))
 23660  	}()(tls, _id, _deleteFlag)
 23661  }
 23662  
 23663  // C comment
 23664  //  /*
 23665  //  ** This function is called before attempting a hot-journal rollback. It
 23666  //  ** syncs the journal file to disk, then sets pPager->journalHdr to the
 23667  //  ** size of the journal file so that the pager_playback() routine knows
 23668  //  ** that the entire journal file has been synced.
 23669  //  **
 23670  //  ** Syncing a hot-journal to disk before attempting to roll it back ensures
 23671  //  ** that if a power-failure occurs during the rollback, the process that
 23672  //  ** attempts rollback following system recovery sees the same journal
 23673  //  ** content as this process.
 23674  //  **
 23675  //  ** If everything goes as planned, SQLITE_OK is returned. Otherwise,
 23676  //  ** an SQLite error code.
 23677  //  */
 23678  func _pagerSyncHotJournal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 23679  	var _rc int32
 23680  	_rc = int32(0)
 23681  	if _pPager.XnoSync == 0 {
 23682  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xjfd), int32(2))
 23683  	}
 23684  	if _rc == int32(0) {
 23685  		_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xjfd), &_pPager.XjournalHdr)
 23686  	}
 23687  	return _rc
 23688  }
 23689  
 23690  // C comment
 23691  //  /*
 23692  //  ** Close a cache.
 23693  //  */
 23694  func _sqlite3PcacheClose(tls *crt.TLS, _pCache *XPCache) {
 23695  	func() {
 23696  		if _pCache.XpCache == nil {
 23697  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44805), unsafe.Pointer(&_sqlite3PcacheCloseØ00__func__Ø000), unsafe.Pointer(str(15913)))
 23698  			crt.X__builtin_abort(tls)
 23699  		}
 23700  	}()
 23701  	(_sqlite3Config.Xpcache2.XxDestroy)(tls, _pCache.XpCache)
 23702  }
 23703  
 23704  var _sqlite3PcacheCloseØ00__func__Ø000 [19]int8
 23705  
 23706  func init() {
 23707  	crt.Xstrncpy(nil, &_sqlite3PcacheCloseØ00__func__Ø000[0], str(23490), 19)
 23708  }
 23709  
 23710  // C comment
 23711  //  /*
 23712  //  ** Free the pBt->pTmpSpace allocation
 23713  //  */
 23714  func _freeTempSpace(tls *crt.TLS, _pBt *XBtShared) {
 23715  	if _pBt.XpTmpSpace != nil {
 23716  		*(*uintptr)(unsafe.Pointer(&_pBt.XpTmpSpace)) -= uintptr(int32(4))
 23717  		_sqlite3PageFree(tls, unsafe.Pointer(_pBt.XpTmpSpace))
 23718  		_pBt.XpTmpSpace = nil
 23719  	}
 23720  }
 23721  
 23722  var _sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000 [32]int8
 23723  
 23724  func init() {
 23725  	crt.Xstrncpy(nil, &_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000[0], str(23509), 32)
 23726  }
 23727  
 23728  // C comment
 23729  //  /*
 23730  //  ** Invoke the destructor function associated with FuncDef p, if any. Except,
 23731  //  ** if this is not the last copy of the function, do not invoke it. Multiple
 23732  //  ** copies of a single function are created when create_function() is called
 23733  //  ** with SQLITE_ANY as the encoding.
 23734  //  */
 23735  func _functionDestroy(tls *crt.TLS, _db *Xsqlite3, _p *XFuncDef) {
 23736  	var _pDestructor *XFuncDestructor
 23737  	_pDestructor = (*XFuncDestructor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
 23738  	if _pDestructor == nil {
 23739  		goto _0
 23740  	}
 23741  	_pDestructor.XnRef -= 1
 23742  	if _pDestructor.XnRef == int32(0) {
 23743  		_pDestructor.XxDestroy(tls, _pDestructor.XpUserData)
 23744  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pDestructor))
 23745  	}
 23746  _0:
 23747  }
 23748  
 23749  // C comment
 23750  //  /*
 23751  //  ** Erase the eponymous virtual table instance associated with
 23752  //  ** virtual table module pMod, if it exists.
 23753  //  */
 23754  func _sqlite3VtabEponymousTableClear(tls *crt.TLS, _db *Xsqlite3, _pMod *XModule) {
 23755  	var _pTab *XTable
 23756  	_pTab = (*XTable)(_pMod.XpEpoTab)
 23757  	if _pTab != nil {
 23758  		_pTab.XtabFlags |= uint32(2)
 23759  		_sqlite3DeleteTable(tls, _db, _pTab)
 23760  		*(**XTable)(unsafe.Pointer(&_pMod.XpEpoTab)) = nil
 23761  	}
 23762  }
 23763  
 23764  // C comment
 23765  //  /*
 23766  //  ** Free an sqlite3_value object
 23767  //  */
 23768  func _sqlite3ValueFree(tls *crt.TLS, _v *XMem) {
 23769  	if _v == nil {
 23770  		return
 23771  	}
 23772  	_sqlite3VdbeMemRelease(tls, _v)
 23773  	_sqlite3DbFreeNN(tls, (*Xsqlite3)(_v.Xdb), unsafe.Pointer(_v))
 23774  }
 23775  
 23776  // C comment
 23777  //  /*
 23778  //  ** Call this routine when the database connection is closing in order
 23779  //  ** to clean up loaded extensions
 23780  //  */
 23781  func _sqlite3CloseExtensions(tls *crt.TLS, _db *Xsqlite3) {
 23782  	var _i int32
 23783  	func() {
 23784  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 23785  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(112416), unsafe.Pointer(&_sqlite3CloseExtensionsØ00__func__Ø000), unsafe.Pointer(str(881)))
 23786  			crt.X__builtin_abort(tls)
 23787  		}
 23788  	}()
 23789  	_i = int32(0)
 23790  _2:
 23791  	if _i >= _db.XnExtension {
 23792  		goto _5
 23793  	}
 23794  	_sqlite3OsDlClose(tls, (*Xsqlite3_vfs)(_db.XpVfs), *elem24(_db.XaExtension, uintptr(_i)))
 23795  	_i += 1
 23796  	goto _2
 23797  _5:
 23798  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_db.XaExtension))
 23799  }
 23800  
 23801  var _sqlite3CloseExtensionsØ00__func__Ø000 [23]int8
 23802  
 23803  func init() {
 23804  	crt.Xstrncpy(nil, &_sqlite3CloseExtensionsØ00__func__Ø000[0], str(23541), 23)
 23805  }
 23806  
 23807  // C comment
 23808  //  /*
 23809  //  ** Register a collation sequence factory callback with the database handle
 23810  //  ** db. Replace any previously installed collation sequence factory.
 23811  //  */
 23812  func Xsqlite3_collation_needed(tls *crt.TLS, _db *Xsqlite3, _pCollNeededArg unsafe.Pointer, _xCollNeeded func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8)) (r0 int32) {
 23813  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 23814  		return _sqlite3MisuseError(tls, int32(143721))
 23815  	}
 23816  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 23817  	*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&_db.XxCollNeeded)) = _xCollNeeded
 23818  	*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&_db.XxCollNeeded16)) = nil
 23819  	_db.XpCollNeededArg = _pCollNeededArg
 23820  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 23821  	return int32(0)
 23822  }
 23823  
 23824  // C comment
 23825  //  /*
 23826  //  ** Register a collation sequence factory callback with the database handle
 23827  //  ** db. Replace any previously installed collation sequence factory.
 23828  //  */
 23829  func Xsqlite3_collation_needed16(tls *crt.TLS, _db *Xsqlite3, _pCollNeededArg unsafe.Pointer, _xCollNeeded16 func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer)) (r0 int32) {
 23830  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 23831  		return _sqlite3MisuseError(tls, int32(143742))
 23832  	}
 23833  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 23834  	*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&_db.XxCollNeeded)) = nil
 23835  	*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&_db.XxCollNeeded16)) = _xCollNeeded16
 23836  	_db.XpCollNeededArg = _pCollNeededArg
 23837  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 23838  	return int32(0)
 23839  }
 23840  
 23841  // C comment
 23842  //  /**************************** sqlite3_column_  *******************************
 23843  //  ** The following routines are used to access elements of the current row
 23844  //  ** in the result set.
 23845  //  */
 23846  func Xsqlite3_column_blob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 unsafe.Pointer) {
 23847  	var _val unsafe.Pointer
 23848  	_val = Xsqlite3_value_blob(tls, _columnMem(tls, _pStmt, _i))
 23849  	_columnMallocFailure(tls, _pStmt)
 23850  	return _val
 23851  }
 23852  
 23853  // C comment
 23854  //  /**************************** sqlite3_value_  *******************************
 23855  //  ** The following routines extract information from a Mem or sqlite3_value
 23856  //  ** structure.
 23857  //  */
 23858  func Xsqlite3_value_blob(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
 23859  	var _p *XMem
 23860  	_p = _pVal
 23861  	if (int32(_p.Xflags) & int32(18)) == 0 {
 23862  		goto _0
 23863  	}
 23864  	if func() int32 {
 23865  		if (int32(_p.Xflags) & int32(16384)) != 0 {
 23866  			return _sqlite3VdbeMemExpandBlob(tls, _p)
 23867  		}
 23868  		return int32(0)
 23869  	}() != int32(0) {
 23870  		func() {
 23871  			if int32(_p.Xflags) != int32(1) || _p.Xz != nil {
 23872  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76270), unsafe.Pointer(&_sqlite3_value_blobØ00__func__Ø000), unsafe.Pointer(str(23564)))
 23873  				crt.X__builtin_abort(tls)
 23874  			}
 23875  		}()
 23876  		return nil
 23877  	}
 23878  	{
 23879  		p := &_p.Xflags
 23880  		*p = uint16(int32(*p) | int32(16))
 23881  	}
 23882  	return unsafe.Pointer(func() *int8 {
 23883  		if _p.Xn != 0 {
 23884  			return _p.Xz
 23885  		}
 23886  		return nil
 23887  	}())
 23888  
 23889  _0:
 23890  	return unsafe.Pointer(Xsqlite3_value_text(tls, _pVal))
 23891  }
 23892  
 23893  var _sqlite3_value_blobØ00__func__Ø000 [19]int8
 23894  
 23895  func init() {
 23896  	crt.Xstrncpy(nil, &_sqlite3_value_blobØ00__func__Ø000[0], str(23594), 19)
 23897  }
 23898  
 23899  // C comment
 23900  //  /*
 23901  //  ** Check to see if column iCol of the given statement is valid.  If
 23902  //  ** it is, return a pointer to the Mem for the value of that column.
 23903  //  ** If iCol is not valid, return a pointer to a Mem which has a value
 23904  //  ** of NULL.
 23905  //  */
 23906  func _columnMem(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *XMem) {
 23907  	var _pVm *TVdbe
 23908  	var _pOut *XMem
 23909  	_pVm = (*TVdbe)(_pStmt)
 23910  	if _pVm == nil {
 23911  		return _columnNullValue(tls)
 23912  	}
 23913  	func() {
 23914  		if _pVm.Xdb == nil {
 23915  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77067), unsafe.Pointer(&_columnMemØ00__func__Ø000), unsafe.Pointer(str(23613)))
 23916  			crt.X__builtin_abort(tls)
 23917  		}
 23918  	}()
 23919  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pVm.Xdb).Xmutex))
 23920  	if (((*XMem)(_pVm.XpResultSet) != nil) && (_i < int32(_pVm.XnResColumn))) && (_i >= int32(0)) {
 23921  		_pOut = elem25((*XMem)(_pVm.XpResultSet), uintptr(_i))
 23922  		goto _6
 23923  	}
 23924  	_sqlite3Error(tls, (*Xsqlite3)(_pVm.Xdb), int32(25))
 23925  	_pOut = _columnNullValue(tls)
 23926  _6:
 23927  	return _pOut
 23928  }
 23929  
 23930  // C comment
 23931  //  /*
 23932  //  ** Return a pointer to static memory containing an SQL NULL value.
 23933  //  */
 23934  func _columnNullValue(tls *crt.TLS) (r0 *XMem) {
 23935  	return &_columnNullValueØ00nullMemØ001
 23936  }
 23937  
 23938  var _columnNullValueØ00nullMemØ001 XMem
 23939  
 23940  func init() {
 23941  	_columnNullValueØ00nullMemØ001 = XMem{Xflags: uint16(1)}
 23942  }
 23943  
 23944  var _columnMemØ00__func__Ø000 [10]int8
 23945  
 23946  func init() {
 23947  	crt.Xstrncpy(nil, &_columnMemØ00__func__Ø000[0], str(23621), 10)
 23948  }
 23949  
 23950  // C comment
 23951  //  /*
 23952  //  ** This function is called after invoking an sqlite3_value_XXX function on a
 23953  //  ** column value (i.e. a value returned by evaluating an SQL expression in the
 23954  //  ** select list of a SELECT statement) that may cause a malloc() failure. If
 23955  //  ** malloc() has failed, the threads mallocFailed flag is cleared and the result
 23956  //  ** code of statement pStmt set to SQLITE_NOMEM.
 23957  //  **
 23958  //  ** Specifically, this is called from within:
 23959  //  **
 23960  //  **     sqlite3_column_int()
 23961  //  **     sqlite3_column_int64()
 23962  //  **     sqlite3_column_text()
 23963  //  **     sqlite3_column_text16()
 23964  //  **     sqlite3_column_real()
 23965  //  **     sqlite3_column_bytes()
 23966  //  **     sqlite3_column_bytes16()
 23967  //  **     sqiite3_column_blob()
 23968  //  */
 23969  func _columnMallocFailure(tls *crt.TLS, _pStmt unsafe.Pointer) {
 23970  	var _p *TVdbe
 23971  	_p = (*TVdbe)(_pStmt)
 23972  	if _p != nil {
 23973  		func() {
 23974  			if (*Xsqlite3)(_p.Xdb) == nil {
 23975  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77105), unsafe.Pointer(&_columnMallocFailureØ00__func__Ø000), unsafe.Pointer(str(23631)))
 23976  				crt.X__builtin_abort(tls)
 23977  			}
 23978  		}()
 23979  		func() {
 23980  			if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 23981  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77106), unsafe.Pointer(&_columnMallocFailureØ00__func__Ø000), unsafe.Pointer(str(8939)))
 23982  				crt.X__builtin_abort(tls)
 23983  			}
 23984  		}()
 23985  		_p.Xrc = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.Xdb), _p.Xrc)
 23986  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 23987  	}
 23988  }
 23989  
 23990  var _columnMallocFailureØ00__func__Ø000 [20]int8
 23991  
 23992  func init() {
 23993  	crt.Xstrncpy(nil, &_columnMallocFailureØ00__func__Ø000[0], str(23640), 20)
 23994  }
 23995  
 23996  func Xsqlite3_column_bytes(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
 23997  	var _val int32
 23998  	_val = Xsqlite3_value_bytes(tls, _columnMem(tls, _pStmt, _i))
 23999  	_columnMallocFailure(tls, _pStmt)
 24000  	return _val
 24001  }
 24002  
 24003  func Xsqlite3_column_bytes16(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
 24004  	var _val int32
 24005  	_val = Xsqlite3_value_bytes16(tls, _columnMem(tls, _pStmt, _i))
 24006  	_columnMallocFailure(tls, _pStmt)
 24007  	return _val
 24008  }
 24009  
 24010  func Xsqlite3_value_bytes16(tls *crt.TLS, _pVal *XMem) (r0 int32) {
 24011  	return _sqlite3ValueBytes(tls, _pVal, uint8(2))
 24012  }
 24013  
 24014  // C comment
 24015  //  /*
 24016  //  ** Return the number of columns in the result set for the statement pStmt.
 24017  //  */
 24018  func Xsqlite3_column_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 24019  	var _pVm *TVdbe
 24020  	_pVm = (*TVdbe)(_pStmt)
 24021  	return func() int32 {
 24022  		if _pVm != nil {
 24023  			return int32(_pVm.XnResColumn)
 24024  		}
 24025  		return int32(0)
 24026  	}()
 24027  }
 24028  
 24029  // C comment
 24030  //  /*
 24031  //  ** Return the column declaration type (if applicable) of the 'i'th column
 24032  //  ** of the result set of SQL statement pStmt.
 24033  //  */
 24034  func Xsqlite3_column_decltype(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 *int8) {
 24035  	return (*int8)(_columnName(tls, _pStmt, _N, func() func(*crt.TLS, *XMem) unsafe.Pointer {
 24036  		v := Xsqlite3_value_text
 24037  		return *(*func(*crt.TLS, *XMem) unsafe.Pointer)(unsafe.Pointer(&v))
 24038  	}(), int32(1)))
 24039  }
 24040  
 24041  // C comment
 24042  //  /*
 24043  //  ** Convert the N-th element of pStmt->pColName[] into a string using
 24044  //  ** xFunc() then return that string.  If N is out of range, return 0.
 24045  //  **
 24046  //  ** There are up to 5 names for each column.  useType determines which
 24047  //  ** name is returned.  Here are the names:
 24048  //  **
 24049  //  **    0      The column name as it should be displayed for output
 24050  //  **    1      The datatype name for the column
 24051  //  **    2      The name of the database that the column derives from
 24052  //  **    3      The name of the table that the column derives from
 24053  //  **    4      The name of the table column that the result column derives from
 24054  //  **
 24055  //  ** If the result is not a simple column reference (if it is an expression
 24056  //  ** or a constant) then useTypes 2, 3, and 4 return NULL.
 24057  //  */
 24058  func _columnName(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32, _xFunc func(*crt.TLS, *XMem) unsafe.Pointer, _useType int32) (r0 unsafe.Pointer) {
 24059  	var _n int32
 24060  	var _ret unsafe.Pointer
 24061  	var _db *Xsqlite3
 24062  	var _p *TVdbe
 24063  	if _pStmt == nil {
 24064  		_sqlite3MisuseError(tls, int32(77206))
 24065  		return nil
 24066  	}
 24067  	_ret = nil
 24068  	_p = (*TVdbe)(_pStmt)
 24069  	_db = (*Xsqlite3)(_p.Xdb)
 24070  	func() {
 24071  		if _db == nil {
 24072  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77213), unsafe.Pointer(&_columnNameØ00__func__Ø000), unsafe.Pointer(str(1219)))
 24073  			crt.X__builtin_abort(tls)
 24074  		}
 24075  	}()
 24076  	_n = Xsqlite3_column_count(tls, _pStmt)
 24077  	if _N >= _n || _N < int32(0) {
 24078  		goto _4
 24079  	}
 24080  	_N += _useType * _n
 24081  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24082  	func() {
 24083  		if int32(_db.XmallocFailed) != int32(0) {
 24084  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77218), unsafe.Pointer(&_columnNameØ00__func__Ø000), unsafe.Pointer(str(1262)))
 24085  			crt.X__builtin_abort(tls)
 24086  		}
 24087  	}()
 24088  	_ret = _xFunc(tls, elem25((*XMem)(_p.XaColName), uintptr(_N)))
 24089  	if _db.XmallocFailed != 0 {
 24090  		_sqlite3OomClear(tls, _db)
 24091  		_ret = nil
 24092  	}
 24093  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24094  _4:
 24095  	return _ret
 24096  }
 24097  
 24098  var _columnNameØ00__func__Ø000 [11]int8
 24099  
 24100  func init() {
 24101  	crt.Xstrncpy(nil, &_columnNameØ00__func__Ø000[0], str(23660), 11)
 24102  }
 24103  
 24104  func Xsqlite3_column_decltype16(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 unsafe.Pointer) {
 24105  	return _columnName(tls, _pStmt, _N, Xsqlite3_value_text16, int32(1))
 24106  }
 24107  
 24108  func Xsqlite3_value_text16(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
 24109  	return _sqlite3ValueText(tls, _pVal, uint8(2))
 24110  }
 24111  
 24112  func Xsqlite3_column_double(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 float64) {
 24113  	var _val float64
 24114  	_val = Xsqlite3_value_double(tls, _columnMem(tls, _pStmt, _i))
 24115  	_columnMallocFailure(tls, _pStmt)
 24116  	return _val
 24117  }
 24118  
 24119  func Xsqlite3_column_int(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
 24120  	var _val int32
 24121  	_val = Xsqlite3_value_int(tls, _columnMem(tls, _pStmt, _i))
 24122  	_columnMallocFailure(tls, _pStmt)
 24123  	return _val
 24124  }
 24125  
 24126  func Xsqlite3_value_int(tls *crt.TLS, _pVal *XMem) (r0 int32) {
 24127  	return int32(_sqlite3VdbeIntValue(tls, _pVal))
 24128  }
 24129  
 24130  func _sqlite3VdbeIntValue(tls *crt.TLS, _pMem *XMem) (r0 int64) {
 24131  	var _flags int32
 24132  	func() {
 24133  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
 24134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70169), unsafe.Pointer(&_sqlite3VdbeIntValueØ00__func__Ø000), unsafe.Pointer(str(4568)))
 24135  			crt.X__builtin_abort(tls)
 24136  		}
 24137  	}()
 24138  	func() {
 24139  		if (int64(uintptr(unsafe.Pointer(_pMem))) & int64(7)) != (0) {
 24140  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70170), unsafe.Pointer(&_sqlite3VdbeIntValueØ00__func__Ø000), unsafe.Pointer(str(6222)))
 24141  			crt.X__builtin_abort(tls)
 24142  		}
 24143  	}()
 24144  	_flags = int32(_pMem.Xflags)
 24145  	if (_flags & int32(4)) != 0 {
 24146  		return *(*int64)(unsafe.Pointer(&_pMem.Xu))
 24147  	}
 24148  	if (_flags & int32(8)) != 0 {
 24149  		return _doubleToInt64(tls, *(*float64)(unsafe.Pointer(&_pMem.Xu)))
 24150  	}
 24151  	if (_flags & int32(18)) != 0 {
 24152  		func() {
 24153  			if _pMem.Xz == nil && _pMem.Xn != int32(0) {
 24154  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70177), unsafe.Pointer(&_sqlite3VdbeIntValueØ00__func__Ø000), unsafe.Pointer(str(23671)))
 24155  				crt.X__builtin_abort(tls)
 24156  			}
 24157  		}()
 24158  		return _memIntValue(tls, _pMem)
 24159  	}
 24160  	return 0
 24161  }
 24162  
 24163  var _sqlite3VdbeIntValueØ00__func__Ø000 [20]int8
 24164  
 24165  func init() {
 24166  	crt.Xstrncpy(nil, &_sqlite3VdbeIntValueØ00__func__Ø000[0], str(23693), 20)
 24167  }
 24168  
 24169  // C comment
 24170  //  /*
 24171  //  ** Convert a 64-bit IEEE double into a 64-bit signed integer.
 24172  //  ** If the double is out of range of a 64-bit signed integer then
 24173  //  ** return the closest available 64-bit signed integer.
 24174  //  */
 24175  func _doubleToInt64(tls *crt.TLS, _r float64) (r0 int64) {
 24176  	if _r <= float64(_doubleToInt64Ø00minIntØ002) {
 24177  		return _doubleToInt64Ø00minIntØ002
 24178  	}
 24179  	if _r >= float64(_doubleToInt64Ø00maxIntØ001) {
 24180  		return _doubleToInt64Ø00maxIntØ001
 24181  	}
 24182  	return int64(_r)
 24183  }
 24184  
 24185  var _doubleToInt64Ø00minIntØ002 int64
 24186  
 24187  func init() {
 24188  	_doubleToInt64Ø00minIntØ002 = int64(-9223372036854775808)
 24189  }
 24190  
 24191  var _doubleToInt64Ø00maxIntØ001 int64
 24192  
 24193  func init() {
 24194  	_doubleToInt64Ø00maxIntØ001 = int64(9223372036854775807)
 24195  }
 24196  
 24197  // C comment
 24198  //  /*
 24199  //  ** Return some kind of integer value which is the best we can do
 24200  //  ** at representing the value that *pMem describes as an integer.
 24201  //  ** If pMem is an integer, then the value is exact.  If pMem is
 24202  //  ** a floating-point then the value returned is the integer part.
 24203  //  ** If pMem is a string or blob, then we make an attempt to convert
 24204  //  ** it into an integer and return that.  If pMem represents an
 24205  //  ** an SQL-NULL value, return 0.
 24206  //  **
 24207  //  ** If pMem represents a string value, its encoding might be changed.
 24208  //  */
 24209  func _memIntValue(tls *crt.TLS, _pMem *XMem) (r0 int64) {
 24210  	var _value int64
 24211  	_value = int64(0)
 24212  	_sqlite3Atoi64(tls, _pMem.Xz, &_value, _pMem.Xn, _pMem.Xenc)
 24213  	return _value
 24214  }
 24215  
 24216  // C comment
 24217  //  /*
 24218  //  ** Convert zNum to a 64-bit signed integer.  zNum must be decimal. This
 24219  //  ** routine does *not* accept hexadecimal notation.
 24220  //  **
 24221  //  ** If the zNum value is representable as a 64-bit twos-complement
 24222  //  ** integer, then write that value into *pNum and return 0.
 24223  //  **
 24224  //  ** If zNum is exactly 9223372036854775808, return 2.  This special
 24225  //  ** case is broken out because while 9223372036854775808 cannot be a
 24226  //  ** signed 64-bit integer, its negative -9223372036854775808 can be.
 24227  //  **
 24228  //  ** If zNum is too big for a 64-bit integer and is not
 24229  //  ** 9223372036854775808  or if zNum contains any non-numeric text,
 24230  //  ** then return 1.
 24231  //  **
 24232  //  ** length is the number of bytes in the string (bytes, not characters).
 24233  //  ** The string is not necessarily zero-terminated.  The encoding is
 24234  //  ** given by enc.
 24235  //  */
 24236  func _sqlite3Atoi64(tls *crt.TLS, _zNum *int8, _pNum *int64, _length int32, _enc uint8) (r0 int32) {
 24237  	var _incr, _neg, _i, _c, _nonNum int32
 24238  	var _u uint64
 24239  	var _zStart, _zEnd *int8
 24240  	_u = uint64(0)
 24241  	_neg = int32(0)
 24242  	_c = int32(0)
 24243  	_nonNum = int32(0)
 24244  	_zEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + uintptr(_length)))
 24245  	func() {
 24246  		if int32(_enc) != int32(1) && int32(_enc) != int32(2) && int32(_enc) != int32(3) {
 24247  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28236), unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000), unsafe.Pointer(str(6989)))
 24248  			crt.X__builtin_abort(tls)
 24249  		}
 24250  	}()
 24251  	if int32(_enc) == int32(1) {
 24252  		_incr = int32(1)
 24253  		goto _5
 24254  	}
 24255  	_incr = int32(2)
 24256  
 24257  	_i = int32(3) - int32(_enc)
 24258  _6:
 24259  	if _i >= _length || int32(*elem1(_zNum, uintptr(_i))) != int32(0) {
 24260  		goto _10
 24261  	}
 24262  	_i += int32(2)
 24263  	goto _6
 24264  _10:
 24265  	_nonNum = bool2int(_i < _length)
 24266  	_zEnd = elem1(_zNum, uintptr(_i^int32(1)))
 24267  	*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(int32(_enc) & int32(1))
 24268  _5:
 24269  	if (crt.P2U(unsafe.Pointer(_zNum)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zNum))))&int32(1)) != 0 {
 24270  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(_incr)
 24271  		goto _5
 24272  	}
 24273  	if crt.P2U(unsafe.Pointer(_zNum)) >= crt.P2U(unsafe.Pointer(_zEnd)) {
 24274  		goto _14
 24275  	}
 24276  	if int32(*_zNum) == int32(45) {
 24277  		_neg = int32(1)
 24278  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(_incr)
 24279  		goto _17
 24280  	}
 24281  	if int32(*_zNum) == int32(43) {
 24282  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(_incr)
 24283  	}
 24284  _17:
 24285  _14:
 24286  	_zStart = _zNum
 24287  _18:
 24288  	if (crt.P2U(unsafe.Pointer(_zNum)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem1(_zNum, 0)) == int32(48)) {
 24289  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(_incr)
 24290  		goto _18
 24291  	}
 24292  	_i = int32(0)
 24293  _21:
 24294  	if crt.P2U(unsafe.Pointer(elem1(_zNum, uintptr(_i)))) >= crt.P2U(unsafe.Pointer(_zEnd)) || store2(&_c, int32(*elem1(_zNum, uintptr(_i)))) < int32(48) || _c > int32(57) {
 24295  		goto _26
 24296  	}
 24297  	_u = ((_u * uint64(10)) + uint64(_c)) - uint64(48)
 24298  	_i += _incr
 24299  	goto _21
 24300  _26:
 24301  	if _u > uint64(9223372036854775807) {
 24302  		*_pNum = func() int64 {
 24303  			if _neg != 0 {
 24304  				return int64(-9223372036854775808)
 24305  			}
 24306  			return int64(9223372036854775807)
 24307  		}()
 24308  		goto _32
 24309  	}
 24310  	if _neg != 0 {
 24311  		*_pNum = -int64(_u)
 24312  		goto _32
 24313  	}
 24314  	*_pNum = int64(_u)
 24315  _32:
 24316  	if (((crt.P2U(unsafe.Pointer(elem1(_zNum, uintptr(_i)))) < crt.P2U(unsafe.Pointer(_zEnd))) || ((_i == int32(0)) && (_zStart == _zNum))) || (_i > (int32(19) * _incr))) || _nonNum != 0 {
 24317  		return int32(1)
 24318  	}
 24319  	if _i < (int32(19) * _incr) {
 24320  		func() {
 24321  			if _u > uint64(9223372036854775807) {
 24322  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28281), unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000), unsafe.Pointer(str(23713)))
 24323  				crt.X__builtin_abort(tls)
 24324  			}
 24325  		}()
 24326  		return int32(0)
 24327  	}
 24328  	_c = _compare2pow63(tls, _zNum, _incr)
 24329  	if _c < int32(0) {
 24330  		func() {
 24331  			if _u > uint64(9223372036854775807) {
 24332  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28288), unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000), unsafe.Pointer(str(23713)))
 24333  				crt.X__builtin_abort(tls)
 24334  			}
 24335  		}()
 24336  		return int32(0)
 24337  	}
 24338  	if _c > int32(0) {
 24339  		return int32(1)
 24340  	}
 24341  	func() {
 24342  		if (_u - uint64(1)) != uint64(9223372036854775807) {
 24343  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28296), unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000), unsafe.Pointer(str(23730)))
 24344  			crt.X__builtin_abort(tls)
 24345  		}
 24346  	}()
 24347  	return func() int32 {
 24348  		if _neg != 0 {
 24349  			return int32(0)
 24350  		}
 24351  		return int32(2)
 24352  	}()
 24353  }
 24354  
 24355  var _sqlite3Atoi64Ø00__func__Ø000 [14]int8
 24356  
 24357  func init() {
 24358  	crt.Xstrncpy(nil, &_sqlite3Atoi64Ø00__func__Ø000[0], str(23749), 14)
 24359  }
 24360  
 24361  // C comment
 24362  //  /*
 24363  //  ** Compare the 19-character string zNum against the text representation
 24364  //  ** value 2^63:  9223372036854775808.  Return negative, zero, or positive
 24365  //  ** if zNum is less than, equal to, or greater than the string.
 24366  //  ** Note that zNum must contain exactly 19 characters.
 24367  //  **
 24368  //  ** Unlike memcmp() this routine is guaranteed to return the difference
 24369  //  ** in the values of the last digit if the only difference is in the
 24370  //  ** last digit.  So, for example,
 24371  //  **
 24372  //  **      compare2pow63("9223372036854775800", 1)
 24373  //  **
 24374  //  ** will return -8.
 24375  //  */
 24376  func _compare2pow63(tls *crt.TLS, _zNum *int8, _incr int32) (r0 int32) {
 24377  	var _c, _i int32
 24378  	var _pow63 *int8
 24379  	_c = int32(0)
 24380  	_pow63 = str(23763)
 24381  	_i = int32(0)
 24382  _0:
 24383  	if _c != int32(0) || _i >= int32(18) {
 24384  		goto _4
 24385  	}
 24386  	_c = (int32(*elem1(_zNum, uintptr(_i*_incr))) - int32(*elem1(_pow63, uintptr(_i)))) * int32(10)
 24387  	_i += 1
 24388  	goto _0
 24389  _4:
 24390  	if _c == int32(0) {
 24391  		_c = int32(*elem1(_zNum, uintptr(int32(18)*_incr))) - int32(56)
 24392  	}
 24393  	return _c
 24394  }
 24395  
 24396  func Xsqlite3_column_int64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int64) {
 24397  	var _val int64
 24398  	_val = Xsqlite3_value_int64(tls, _columnMem(tls, _pStmt, _i))
 24399  	_columnMallocFailure(tls, _pStmt)
 24400  	return _val
 24401  }
 24402  
 24403  func Xsqlite3_value_int64(tls *crt.TLS, _pVal *XMem) (r0 int64) {
 24404  	return _sqlite3VdbeIntValue(tls, _pVal)
 24405  }
 24406  
 24407  // C comment
 24408  //  /*
 24409  //  ** Return the name of the Nth column of the result set returned by SQL
 24410  //  ** statement pStmt.
 24411  //  */
 24412  func Xsqlite3_column_name(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 *int8) {
 24413  	return (*int8)(_columnName(tls, _pStmt, _N, func() func(*crt.TLS, *XMem) unsafe.Pointer {
 24414  		v := Xsqlite3_value_text
 24415  		return *(*func(*crt.TLS, *XMem) unsafe.Pointer)(unsafe.Pointer(&v))
 24416  	}(), int32(0)))
 24417  }
 24418  
 24419  func Xsqlite3_column_name16(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 unsafe.Pointer) {
 24420  	return _columnName(tls, _pStmt, _N, Xsqlite3_value_text16, int32(0))
 24421  }
 24422  
 24423  func Xsqlite3_column_text(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *uint8) {
 24424  	var _val *uint8
 24425  	_val = Xsqlite3_value_text(tls, _columnMem(tls, _pStmt, _i))
 24426  	_columnMallocFailure(tls, _pStmt)
 24427  	return _val
 24428  }
 24429  
 24430  func Xsqlite3_column_text16(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 unsafe.Pointer) {
 24431  	var _val unsafe.Pointer
 24432  	_val = Xsqlite3_value_text16(tls, _columnMem(tls, _pStmt, _i))
 24433  	_columnMallocFailure(tls, _pStmt)
 24434  	return _val
 24435  }
 24436  
 24437  // C comment
 24438  //  /* SQLITE_OMIT_UTF16 */
 24439  func Xsqlite3_column_type(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
 24440  	var _iType int32
 24441  	_iType = Xsqlite3_value_type(tls, _columnMem(tls, _pStmt, _i))
 24442  	_columnMallocFailure(tls, _pStmt)
 24443  	return _iType
 24444  }
 24445  
 24446  func Xsqlite3_column_value(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *XMem) {
 24447  	var _pOut *XMem
 24448  	_pOut = _columnMem(tls, _pStmt, _i)
 24449  	if (int32(_pOut.Xflags) & int32(2048)) != 0 {
 24450  		{
 24451  			p := &_pOut.Xflags
 24452  			*p = uint16(int32(*p) & int32(-2049))
 24453  		}
 24454  		{
 24455  			p := &_pOut.Xflags
 24456  			*p = uint16(int32(*p) | int32(4096))
 24457  		}
 24458  	}
 24459  	_columnMallocFailure(tls, _pStmt)
 24460  	return _pOut
 24461  }
 24462  
 24463  // C comment
 24464  //  /*
 24465  //  ** Register a function to be invoked when a transaction commits.
 24466  //  ** If the invoked function returns non-zero, then the commit becomes a
 24467  //  ** rollback.
 24468  //  */
 24469  func Xsqlite3_commit_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer) int32, _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
 24470  	var _pOld unsafe.Pointer
 24471  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 24472  		_sqlite3MisuseError(tls, int32(142385))
 24473  		return nil
 24474  	}
 24475  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24476  	_pOld = _db.XpCommitArg
 24477  	_db.XxCommitCallback = _xCallback
 24478  	_db.XpCommitArg = _pArg
 24479  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24480  	return _pOld
 24481  }
 24482  
 24483  // C comment
 24484  //  /*
 24485  //  ** Return TRUE if the given SQL string ends in a semicolon.
 24486  //  **
 24487  //  ** Special handling is require for CREATE TRIGGER statements.
 24488  //  ** Whenever the CREATE TRIGGER keywords are seen, the statement
 24489  //  ** must end with ";END;".
 24490  //  **
 24491  //  ** This implementation uses a state machine with 8 states:
 24492  //  **
 24493  //  **   (0) INVALID   We have not yet seen a non-whitespace character.
 24494  //  **
 24495  //  **   (1) START     At the beginning or end of an SQL statement.  This routine
 24496  //  **                 returns 1 if it ends in the START state and 0 if it ends
 24497  //  **                 in any other state.
 24498  //  **
 24499  //  **   (2) NORMAL    We are in the middle of statement which ends with a single
 24500  //  **                 semicolon.
 24501  //  **
 24502  //  **   (3) EXPLAIN   The keyword EXPLAIN has been seen at the beginning of
 24503  //  **                 a statement.
 24504  //  **
 24505  //  **   (4) CREATE    The keyword CREATE has been seen at the beginning of a
 24506  //  **                 statement, possibly preceded by EXPLAIN and/or followed by
 24507  //  **                 TEMP or TEMPORARY
 24508  //  **
 24509  //  **   (5) TRIGGER   We are in the middle of a trigger definition that must be
 24510  //  **                 ended by a semicolon, the keyword END, and another semicolon.
 24511  //  **
 24512  //  **   (6) SEMI      We've seen the first semicolon in the ";END;" that occurs at
 24513  //  **                 the end of a trigger definition.
 24514  //  **
 24515  //  **   (7) END       We've seen the ";END" of the ";END;" that occurs at the end
 24516  //  **                 of a trigger definition.
 24517  //  **
 24518  //  ** Transitions between states above are determined by tokens extracted
 24519  //  ** from the input.  The following tokens are significant:
 24520  //  **
 24521  //  **   (0) tkSEMI      A semicolon.
 24522  //  **   (1) tkWS        Whitespace.
 24523  //  **   (2) tkOTHER     Any other SQL token.
 24524  //  **   (3) tkEXPLAIN   The "explain" keyword.
 24525  //  **   (4) tkCREATE    The "create" keyword.
 24526  //  **   (5) tkTEMP      The "temp" or "temporary" keyword.
 24527  //  **   (6) tkTRIGGER   The "trigger" keyword.
 24528  //  **   (7) tkEND       The "end" keyword.
 24529  //  **
 24530  //  ** Whitespace never causes a state transition and is always ignored.
 24531  //  ** This means that a SQL string of all whitespace is invalid.
 24532  //  **
 24533  //  ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
 24534  //  ** to recognize the end of a trigger can be omitted.  All we have to do
 24535  //  ** is look for a semicolon that is not part of an string or comment.
 24536  //  */
 24537  func Xsqlite3_complete(tls *crt.TLS, _zSql *int8) (r0 int32) {
 24538  	var _14_c, _17_nId int32
 24539  	var _state, _token uint8
 24540  	_state = uint8(0)
 24541  	if _zSql == nil {
 24542  		_sqlite3MisuseError(tls, int32(140223))
 24543  		return int32(0)
 24544  	}
 24545  _0:
 24546  	if (*_zSql) == 0 {
 24547  		goto _2
 24548  	}
 24549  	switch int32(*_zSql) {
 24550  	case int32(9):
 24551  		goto _5
 24552  	case int32(10):
 24553  		goto _5
 24554  	case int32(12):
 24555  		goto _5
 24556  	case int32(13):
 24557  		goto _5
 24558  	case int32(32):
 24559  		goto _5
 24560  	case int32(34):
 24561  		goto _13
 24562  	case int32(39):
 24563  		goto _13
 24564  	case int32(45):
 24565  		goto _11
 24566  	case int32(47):
 24567  		goto _10
 24568  	case int32(59):
 24569  		goto _4
 24570  	case int32(91):
 24571  		goto _12
 24572  	case int32(96):
 24573  		goto _13
 24574  	default:
 24575  		goto _16
 24576  	}
 24577  
 24578  _4:
 24579  	_token = 0
 24580  	goto _17
 24581  _5:
 24582  	_token = uint8(1)
 24583  	goto _17
 24584  _10:
 24585  	if int32(*elem1(_zSql, uintptr(1))) != int32(42) {
 24586  		_token = uint8(2)
 24587  		goto _17
 24588  	}
 24589  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(int32(2))
 24590  _19:
 24591  	if ((*elem1(_zSql, 0)) != 0) && ((int32(*elem1(_zSql, 0)) != int32(42)) || (int32(*elem1(_zSql, uintptr(1))) != int32(47))) {
 24592  		*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24593  		goto _19
 24594  	}
 24595  	if int32(*elem1(_zSql, 0)) == int32(0) {
 24596  		return int32(0)
 24597  	}
 24598  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24599  	_token = uint8(1)
 24600  	goto _17
 24601  _11:
 24602  	if int32(*elem1(_zSql, uintptr(1))) != int32(45) {
 24603  		_token = uint8(2)
 24604  		goto _17
 24605  	}
 24606  _24:
 24607  	if ((*_zSql) != 0) && (int32(*_zSql) != int32(10)) {
 24608  		*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24609  		goto _24
 24610  	}
 24611  	if int32(*_zSql) == int32(0) {
 24612  		return bool2int(int32(_state) == int32(1))
 24613  	}
 24614  	_token = uint8(1)
 24615  	goto _17
 24616  _12:
 24617  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24618  _29:
 24619  	if ((*_zSql) != 0) && (int32(*_zSql) != int32(93)) {
 24620  		*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24621  		goto _29
 24622  	}
 24623  	if int32(*_zSql) == int32(0) {
 24624  		return int32(0)
 24625  	}
 24626  	_token = uint8(2)
 24627  	goto _17
 24628  _13:
 24629  	_14_c = int32(*_zSql)
 24630  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24631  _33:
 24632  	if ((*_zSql) != 0) && (int32(*_zSql) != _14_c) {
 24633  		*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24634  		goto _33
 24635  	}
 24636  	if int32(*_zSql) == int32(0) {
 24637  		return int32(0)
 24638  	}
 24639  	_token = uint8(2)
 24640  	goto _17
 24641  _16:
 24642  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zSql)))) & int32(70)) == int32(0) {
 24643  		goto _37
 24644  	}
 24645  	_17_nId = int32(1)
 24646  _38:
 24647  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zSql, uintptr(_17_nId)))))) & int32(70)) == int32(0) {
 24648  		goto _41
 24649  	}
 24650  	_17_nId += 1
 24651  	goto _38
 24652  _41:
 24653  	switch int32(*_zSql) {
 24654  	case int32(67):
 24655  		goto _43
 24656  	case int32(69):
 24657  		goto _47
 24658  	case int32(84):
 24659  		goto _45
 24660  	case int32(99):
 24661  		goto _43
 24662  	case int32(101):
 24663  		goto _47
 24664  	case int32(116):
 24665  		goto _45
 24666  	default:
 24667  		goto _49
 24668  	}
 24669  
 24670  _43:
 24671  	if (_17_nId == int32(6)) && (Xsqlite3_strnicmp(tls, _zSql, str(23782), int32(6)) == int32(0)) {
 24672  		_token = uint8(4)
 24673  		goto _52
 24674  	}
 24675  	_token = uint8(2)
 24676  _52:
 24677  	goto _53
 24678  _45:
 24679  	if (_17_nId == int32(7)) && (Xsqlite3_strnicmp(tls, _zSql, str(23789), int32(7)) == int32(0)) {
 24680  		_token = uint8(6)
 24681  		goto _62
 24682  	}
 24683  	if (_17_nId == int32(4)) && (Xsqlite3_strnicmp(tls, _zSql, str(23797), int32(4)) == int32(0)) {
 24684  		_token = uint8(5)
 24685  		goto _62
 24686  	}
 24687  	if (_17_nId == int32(9)) && (Xsqlite3_strnicmp(tls, _zSql, str(23802), int32(9)) == int32(0)) {
 24688  		_token = uint8(5)
 24689  		goto _62
 24690  	}
 24691  	_token = uint8(2)
 24692  _62:
 24693  	goto _53
 24694  _47:
 24695  	if (_17_nId == int32(3)) && (Xsqlite3_strnicmp(tls, _zSql, str(23812), int32(3)) == int32(0)) {
 24696  		_token = uint8(7)
 24697  		goto _68
 24698  	}
 24699  	if (_17_nId == int32(7)) && (Xsqlite3_strnicmp(tls, _zSql, str(23816), int32(7)) == int32(0)) {
 24700  		_token = uint8(3)
 24701  		goto _68
 24702  	}
 24703  	_token = uint8(2)
 24704  _68:
 24705  	goto _53
 24706  _49:
 24707  	_token = uint8(2)
 24708  	goto _53
 24709  _53:
 24710  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(_17_nId - int32(1))
 24711  	goto _69
 24712  _37:
 24713  	_token = uint8(2)
 24714  _69:
 24715  	goto _17
 24716  _17:
 24717  	_state = *elem15((*uint8)(unsafe.Pointer(elem49((*[8]uint8)(unsafe.Pointer(&_sqlite3_completeØ00transØ001)), uintptr(_state)))), uintptr(_token))
 24718  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24719  	goto _0
 24720  _2:
 24721  	return bool2int(int32(_state) == int32(1))
 24722  }
 24723  
 24724  var _sqlite3_completeØ00transØ001 [8][8]uint8
 24725  
 24726  func init() {
 24727  	_sqlite3_completeØ00transØ001 = [8][8]uint8{[8]uint8{uint8(1), uint8(0), uint8(2), uint8(3), uint8(4), uint8(2), uint8(2), uint8(2)}, [8]uint8{uint8(1), uint8(1), uint8(2), uint8(3), uint8(4), uint8(2), uint8(2), uint8(2)}, [8]uint8{uint8(1), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2)}, [8]uint8{uint8(1), uint8(3), uint8(3), uint8(2), uint8(4), uint8(2), uint8(2), uint8(2)}, [8]uint8{uint8(1), uint8(4), uint8(2), uint8(2), uint8(2), uint8(4), uint8(5), uint8(2)}, [8]uint8{uint8(6), uint8(5), uint8(5), uint8(5), uint8(5), uint8(5), uint8(5), uint8(5)}, [8]uint8{uint8(6), uint8(6), uint8(5), uint8(5), uint8(5), uint8(5), uint8(5), uint8(7)}, [8]uint8{uint8(1), uint8(7), uint8(5), uint8(5), uint8(5), uint8(5), uint8(5), uint8(5)}}
 24728  }
 24729  
 24730  // C comment
 24731  //  /*
 24732  //  ** This routine is the same as the sqlite3_complete() routine described
 24733  //  ** above, except that the parameter is required to be UTF-16 encoded, not
 24734  //  ** UTF-8.
 24735  //  */
 24736  func Xsqlite3_complete16(tls *crt.TLS, _zSql unsafe.Pointer) (r0 int32) {
 24737  	var _rc int32
 24738  	var _zSql8 *int8
 24739  	var _pVal *XMem
 24740  	_rc = Xsqlite3_initialize(tls)
 24741  	if _rc != 0 {
 24742  		return _rc
 24743  	}
 24744  	_pVal = _sqlite3ValueNew(tls, nil)
 24745  	_sqlite3ValueSetStr(tls, _pVal, int32(-1), _zSql, uint8(2), nil)
 24746  	_zSql8 = (*int8)(_sqlite3ValueText(tls, _pVal, uint8(1)))
 24747  	if _zSql8 != nil {
 24748  		_rc = Xsqlite3_complete(tls, _zSql8)
 24749  		goto _2
 24750  	}
 24751  	_rc = _sqlite3NomemError(tls, int32(140368))
 24752  _2:
 24753  	_sqlite3ValueFree(tls, _pVal)
 24754  	return _rc & int32(255)
 24755  }
 24756  
 24757  // C comment
 24758  //  /*
 24759  //  ** Register a new collation sequence with the database handle db.
 24760  //  */
 24761  func Xsqlite3_create_collation(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc int32, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) (r0 int32) {
 24762  	return Xsqlite3_create_collation_v2(tls, _db, _zName, _enc, _pCtx, _xCompare, nil)
 24763  }
 24764  
 24765  // C comment
 24766  //  /*
 24767  //  ** Register a new collation sequence with the database handle db.
 24768  //  */
 24769  func Xsqlite3_create_collation_v2(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc int32, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 24770  	var _rc int32
 24771  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
 24772  		return _sqlite3MisuseError(tls, int32(143671))
 24773  	}
 24774  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24775  	func() {
 24776  		if _db.XmallocFailed != 0 {
 24777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143674), unsafe.Pointer(&_sqlite3_create_collation_v2Ø00__func__Ø000), unsafe.Pointer(str(23824)))
 24778  			crt.X__builtin_abort(tls)
 24779  		}
 24780  	}()
 24781  	_rc = _createCollation(tls, _db, _zName, uint8(_enc), _pCtx, _xCompare, _xDel)
 24782  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 24783  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24784  	return _rc
 24785  }
 24786  
 24787  var _sqlite3_create_collation_v2Ø00__func__Ø000 [28]int8
 24788  
 24789  func init() {
 24790  	crt.Xstrncpy(nil, &_sqlite3_create_collation_v2Ø00__func__Ø000[0], str(23842), 28)
 24791  }
 24792  
 24793  // C comment
 24794  //  /*
 24795  //  ** Create a new collating function for database "db".  The name is zName
 24796  //  ** and the encoding is enc.
 24797  //  */
 24798  func _createCollation(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc uint8, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 24799  	var _enc2, _5_j int32
 24800  	var _pColl, _5_aColl, _6_p *XCollSeq
 24801  	func() {
 24802  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 24803  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142821), unsafe.Pointer(&_createCollationØ00__func__Ø000), unsafe.Pointer(str(881)))
 24804  			crt.X__builtin_abort(tls)
 24805  		}
 24806  	}()
 24807  	_enc2 = int32(_enc)
 24808  	if (_enc2 == int32(4)) || (_enc2 == int32(8)) {
 24809  		_enc2 = int32(2)
 24810  	}
 24811  	if (_enc2 < int32(1)) || (_enc2 > int32(3)) {
 24812  		return _sqlite3MisuseError(tls, int32(142834))
 24813  	}
 24814  	_pColl = _sqlite3FindCollSeq(tls, _db, uint8(_enc2), _zName, int32(0))
 24815  	if _pColl == nil || _pColl.XxCmp == nil {
 24816  		goto _7
 24817  	}
 24818  	if _db.XnVdbeActive != 0 {
 24819  		_sqlite3ErrorWithMsg(tls, _db, int32(5), str(23870))
 24820  		return int32(5)
 24821  	}
 24822  	_sqlite3ExpirePreparedStatements(tls, _db)
 24823  	if (int32(_pColl.Xenc) & int32(-9)) != _enc2 {
 24824  		goto _9
 24825  	}
 24826  	_5_aColl = (*XCollSeq)(_sqlite3HashFind(tls, &_db.XaCollSeq, _zName))
 24827  	_5_j = int32(0)
 24828  _10:
 24829  	if _5_j >= int32(3) {
 24830  		goto _13
 24831  	}
 24832  	_6_p = elem29(_5_aColl, uintptr(_5_j))
 24833  	if int32(_6_p.Xenc) != int32(_pColl.Xenc) {
 24834  		goto _14
 24835  	}
 24836  	if _6_p.XxDel != nil {
 24837  		_6_p.XxDel(tls, _6_p.XpUser)
 24838  	}
 24839  	_6_p.XxCmp = nil
 24840  _14:
 24841  	_5_j += 1
 24842  	goto _10
 24843  _13:
 24844  _9:
 24845  _7:
 24846  	_pColl = _sqlite3FindCollSeq(tls, _db, uint8(_enc2), _zName, int32(1))
 24847  	if _pColl == nil {
 24848  		return _sqlite3NomemError(tls, int32(142872))
 24849  	}
 24850  	_pColl.XxCmp = _xCompare
 24851  	_pColl.XpUser = _pCtx
 24852  	_pColl.XxDel = _xDel
 24853  	_pColl.Xenc = uint8(_enc2 | (int32(_enc) & int32(8)))
 24854  	_sqlite3Error(tls, _db, int32(0))
 24855  	return int32(0)
 24856  }
 24857  
 24858  var _createCollationØ00__func__Ø000 [16]int8
 24859  
 24860  func init() {
 24861  	crt.Xstrncpy(nil, &_createCollationØ00__func__Ø000[0], str(23938), 16)
 24862  }
 24863  
 24864  // C comment
 24865  //  /*
 24866  //  ** Parameter zName points to a UTF-8 encoded string nName bytes long.
 24867  //  ** Return the CollSeq* pointer for the collation sequence named zName
 24868  //  ** for the encoding 'enc' from the database 'db'.
 24869  //  **
 24870  //  ** If the entry specified is not found and 'create' is true, then create a
 24871  //  ** new entry.  Otherwise return NULL.
 24872  //  **
 24873  //  ** A separate function sqlite3LocateCollSeq() is a wrapper around
 24874  //  ** this routine.  sqlite3LocateCollSeq() invokes the collation factory
 24875  //  ** if necessary and generates an error message if the collating sequence
 24876  //  ** cannot be found.
 24877  //  **
 24878  //  ** See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq()
 24879  //  */
 24880  func _sqlite3FindCollSeq(tls *crt.TLS, _db *Xsqlite3, _enc uint8, _zName *int8, _create int32) (r0 *XCollSeq) {
 24881  	var _pColl *XCollSeq
 24882  	if _zName != nil {
 24883  		_pColl = _findCollSeqEntry(tls, _db, _zName, _create)
 24884  		goto _1
 24885  	}
 24886  	_pColl = (*XCollSeq)(_db.XpDfltColl)
 24887  _1:
 24888  
 24889  	func() {
 24890  		if int32(_enc) < int32(1) || int32(_enc) > int32(3) {
 24891  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104362), unsafe.Pointer(&_sqlite3FindCollSeqØ00__func__Ø000), unsafe.Pointer(str(23954)))
 24892  			crt.X__builtin_abort(tls)
 24893  		}
 24894  	}()
 24895  	if _pColl != nil {
 24896  		*(*uintptr)(unsafe.Pointer(&_pColl)) += 40 * uintptr(int32(_enc)-int32(1))
 24897  	}
 24898  	return _pColl
 24899  }
 24900  
 24901  // C comment
 24902  //  /*
 24903  //  ** Locate and return an entry from the db.aCollSeq hash table. If the entry
 24904  //  ** specified by zName and nName is not found and parameter 'create' is
 24905  //  ** true, then create a new entry. Otherwise return NULL.
 24906  //  **
 24907  //  ** Each pointer stored in the sqlite3.aCollSeq hash table contains an
 24908  //  ** array of three CollSeq structures. The first is the collation sequence
 24909  //  ** preferred for UTF-8, the second UTF-16le, and the third UTF-16be.
 24910  //  **
 24911  //  ** Stored immediately after the three collation sequences is a copy of
 24912  //  ** the collation sequence name. A pointer to this string is stored in
 24913  //  ** each collation sequence structure.
 24914  //  */
 24915  func _findCollSeqEntry(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _create int32) (r0 *XCollSeq) {
 24916  	var _1_nName int32
 24917  	var _pColl, _2_pDel *XCollSeq
 24918  	_pColl = (*XCollSeq)(_sqlite3HashFind(tls, &_db.XaCollSeq, _zName))
 24919  	if nil != _pColl || _create == 0 {
 24920  		goto _1
 24921  	}
 24922  	_1_nName = _sqlite3Strlen30(tls, _zName)
 24923  	_pColl = (*XCollSeq)(_sqlite3DbMallocZero(tls, _db, (uint64(120)+uint64(_1_nName))+uint64(1)))
 24924  	if _pColl == nil {
 24925  		goto _2
 24926  	}
 24927  	_2_pDel = nil
 24928  	elem29(_pColl, 0).XzName = (*int8)(unsafe.Pointer(elem29(_pColl, uintptr(3))))
 24929  	elem29(_pColl, 0).Xenc = uint8(1)
 24930  	elem29(_pColl, uintptr(1)).XzName = (*int8)(unsafe.Pointer(elem29(_pColl, uintptr(3))))
 24931  	elem29(_pColl, uintptr(1)).Xenc = uint8(2)
 24932  	elem29(_pColl, uintptr(2)).XzName = (*int8)(unsafe.Pointer(elem29(_pColl, uintptr(3))))
 24933  	elem29(_pColl, uintptr(2)).Xenc = uint8(3)
 24934  	crt.Xmemcpy(tls, unsafe.Pointer(elem29(_pColl, 0).XzName), unsafe.Pointer(_zName), uint64(_1_nName))
 24935  	*elem1(elem29(_pColl, 0).XzName, uintptr(_1_nName)) = 0
 24936  	_2_pDel = (*XCollSeq)(_sqlite3HashInsert(tls, &_db.XaCollSeq, elem29(_pColl, 0).XzName, unsafe.Pointer(_pColl)))
 24937  	func() {
 24938  		if _2_pDel != nil && _2_pDel != _pColl {
 24939  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104323), unsafe.Pointer(&_findCollSeqEntryØ00__func__Ø000), unsafe.Pointer(str(23994)))
 24940  			crt.X__builtin_abort(tls)
 24941  		}
 24942  	}()
 24943  	if _2_pDel != nil {
 24944  		_sqlite3OomFault(tls, _db)
 24945  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_2_pDel))
 24946  		_pColl = nil
 24947  	}
 24948  _2:
 24949  _1:
 24950  	return _pColl
 24951  }
 24952  
 24953  // C comment
 24954  //  /* Attempt to locate an element of the hash table pH with a key
 24955  //  ** that matches pKey.  Return the data for this element if it is
 24956  //  ** found, or NULL if there is no match.
 24957  //  */
 24958  func _sqlite3HashFind(tls *crt.TLS, _pH *XHash, _pKey *int8) (r0 unsafe.Pointer) {
 24959  	var _h uint32
 24960  	var _elem *XHashElem
 24961  	func() {
 24962  		if _pH == nil {
 24963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29445), unsafe.Pointer(&_sqlite3HashFindØ00__func__Ø000), unsafe.Pointer(str(21125)))
 24964  			crt.X__builtin_abort(tls)
 24965  		}
 24966  	}()
 24967  	func() {
 24968  		if _pKey == nil {
 24969  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29446), unsafe.Pointer(&_sqlite3HashFindØ00__func__Ø000), unsafe.Pointer(str(21560)))
 24970  			crt.X__builtin_abort(tls)
 24971  		}
 24972  	}()
 24973  	_elem = _findElementWithHash(tls, _pH, _pKey, &_h)
 24974  	return func() unsafe.Pointer {
 24975  		if _elem != nil {
 24976  			return _elem.Xdata
 24977  		}
 24978  		return nil
 24979  	}()
 24980  }
 24981  
 24982  var _sqlite3HashFindØ00__func__Ø000 [16]int8
 24983  
 24984  func init() {
 24985  	crt.Xstrncpy(nil, &_sqlite3HashFindØ00__func__Ø000[0], str(24017), 16)
 24986  }
 24987  
 24988  var _findCollSeqEntryØ00__func__Ø000 [17]int8
 24989  
 24990  func init() {
 24991  	crt.Xstrncpy(nil, &_findCollSeqEntryØ00__func__Ø000[0], str(24033), 17)
 24992  }
 24993  
 24994  var _sqlite3FindCollSeqØ00__func__Ø000 [19]int8
 24995  
 24996  func init() {
 24997  	crt.Xstrncpy(nil, &_sqlite3FindCollSeqØ00__func__Ø000[0], str(24050), 19)
 24998  }
 24999  
 25000  // C comment
 25001  //  /*
 25002  //  ** Register a new collation sequence with the database handle db.
 25003  //  */
 25004  func Xsqlite3_create_collation16(tls *crt.TLS, _db *Xsqlite3, _zName unsafe.Pointer, _enc int32, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) (r0 int32) {
 25005  	var _rc int32
 25006  	var _zName8 *int8
 25007  	_rc = int32(0)
 25008  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
 25009  		return _sqlite3MisuseError(tls, int32(143696))
 25010  	}
 25011  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25012  	func() {
 25013  		if _db.XmallocFailed != 0 {
 25014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143699), unsafe.Pointer(&_sqlite3_create_collation16Ø00__func__Ø000), unsafe.Pointer(str(23824)))
 25015  			crt.X__builtin_abort(tls)
 25016  		}
 25017  	}()
 25018  	_zName8 = _sqlite3Utf16to8(tls, _db, _zName, int32(-1), uint8(2))
 25019  	if _zName8 != nil {
 25020  		_rc = _createCollation(tls, _db, _zName8, uint8(_enc), _pCtx, _xCompare, nil)
 25021  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName8))
 25022  	}
 25023  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 25024  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25025  	return _rc
 25026  }
 25027  
 25028  var _sqlite3_create_collation16Ø00__func__Ø000 [27]int8
 25029  
 25030  func init() {
 25031  	crt.Xstrncpy(nil, &_sqlite3_create_collation16Ø00__func__Ø000[0], str(24069), 27)
 25032  }
 25033  
 25034  // C comment
 25035  //  /*
 25036  //  ** Convert a UTF-16 string in the native encoding into a UTF-8 string.
 25037  //  ** Memory to hold the UTF-8 string is obtained from sqlite3_malloc and must
 25038  //  ** be freed by the calling function.
 25039  //  **
 25040  //  ** NULL is returned if there is an allocation error.
 25041  //  */
 25042  func _sqlite3Utf16to8(tls *crt.TLS, _db *Xsqlite3, _z unsafe.Pointer, _nByte int32, _enc uint8) (r0 *int8) {
 25043  	var _m XMem
 25044  	crt.Xmemset(tls, unsafe.Pointer(&_m), int32(0), uint64(72))
 25045  	*(**Xsqlite3)(unsafe.Pointer(&_m.Xdb)) = _db
 25046  	_sqlite3VdbeMemSetStr(tls, &_m, (*int8)(_z), _nByte, _enc, nil)
 25047  	_sqlite3VdbeChangeEncoding(tls, &_m, int32(1))
 25048  	if _db.XmallocFailed != 0 {
 25049  		_sqlite3VdbeMemRelease(tls, &_m)
 25050  		_m.Xz = nil
 25051  	}
 25052  	func() {
 25053  		if (int32(_m.Xflags)&int32(512)) == int32(0) && _db.XmallocFailed == 0 {
 25054  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27570), unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000), unsafe.Pointer(str(24096)))
 25055  			crt.X__builtin_abort(tls)
 25056  		}
 25057  	}()
 25058  	func() {
 25059  		if (int32(_m.Xflags)&int32(2)) == int32(0) && _db.XmallocFailed == 0 {
 25060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27571), unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000), unsafe.Pointer(str(24140)))
 25061  			crt.X__builtin_abort(tls)
 25062  		}
 25063  	}()
 25064  	func() {
 25065  		if _m.Xz == nil && _db.XmallocFailed == 0 {
 25066  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27572), unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000), unsafe.Pointer(str(24183)))
 25067  			crt.X__builtin_abort(tls)
 25068  		}
 25069  	}()
 25070  	return _m.Xz
 25071  }
 25072  
 25073  var _sqlite3Utf16to8Ø00__func__Ø000 [16]int8
 25074  
 25075  func init() {
 25076  	crt.Xstrncpy(nil, &_sqlite3Utf16to8Ø00__func__Ø000[0], str(24207), 16)
 25077  }
 25078  
 25079  // C comment
 25080  //  /*
 25081  //  ** Create new user functions.
 25082  //  */
 25083  func Xsqlite3_create_function(tls *crt.TLS, _db *Xsqlite3, _zFunc *int8, _nArg int32, _enc int32, _p unsafe.Pointer, _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xStep func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xFinal func(*crt.TLS, *Xsqlite3_context)) (r0 int32) {
 25084  	return Xsqlite3_create_function_v2(tls, _db, _zFunc, _nArg, _enc, _p, _xSFunc, _xStep, _xFinal, nil)
 25085  }
 25086  
 25087  func Xsqlite3_create_function_v2(tls *crt.TLS, _db *Xsqlite3, _zFunc *int8, _nArg int32, _enc int32, _p unsafe.Pointer, _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xStep func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xFinal func(*crt.TLS, *Xsqlite3_context), _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 25088  	var _rc int32
 25089  	var _pArg *XFuncDestructor
 25090  	_rc = int32(1)
 25091  	_pArg = nil
 25092  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 25093  		return _sqlite3MisuseError(tls, int32(142198))
 25094  	}
 25095  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25096  	if _xDestroy == nil {
 25097  		goto _1
 25098  	}
 25099  	_pArg = (*XFuncDestructor)(_sqlite3DbMallocZero(tls, _db, uint64(24)))
 25100  	if _pArg == nil {
 25101  		_xDestroy(tls, _p)
 25102  		goto _out
 25103  	}
 25104  	_pArg.XxDestroy = _xDestroy
 25105  	_pArg.XpUserData = _p
 25106  _1:
 25107  	_rc = _sqlite3CreateFunc(tls, _db, _zFunc, _nArg, _enc, _p, _xSFunc, _xStep, _xFinal, _pArg)
 25108  	if (_pArg != nil) && (_pArg.XnRef == int32(0)) {
 25109  		func() {
 25110  			if _rc == int32(0) {
 25111  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142213), unsafe.Pointer(&_sqlite3_create_function_v2Ø00__func__Ø000), unsafe.Pointer(str(18467)))
 25112  				crt.X__builtin_abort(tls)
 25113  			}
 25114  		}()
 25115  		_xDestroy(tls, _p)
 25116  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pArg))
 25117  	}
 25118  _out:
 25119  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 25120  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25121  	return _rc
 25122  }
 25123  
 25124  // C comment
 25125  //  /*
 25126  //  ** This function is exactly the same as sqlite3_create_function(), except
 25127  //  ** that it is designed to be called by internal code. The difference is
 25128  //  ** that if a malloc() fails in sqlite3_create_function(), an error code
 25129  //  ** is returned and the mallocFailed flag cleared.
 25130  //  */
 25131  func _sqlite3CreateFunc(tls *crt.TLS, _db *Xsqlite3, _zFunctionName *int8, _nArg int32, _enc int32, _pUserData unsafe.Pointer, _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xStep func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xFinal func(*crt.TLS, *Xsqlite3_context), _pDestructor *XFuncDestructor) (r0 int32) {
 25132  	var _nName, _extraFlags, _3_rc int32
 25133  	var _p *XFuncDef
 25134  	func() {
 25135  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 25136  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142084), unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000), unsafe.Pointer(str(881)))
 25137  			crt.X__builtin_abort(tls)
 25138  		}
 25139  	}()
 25140  	if (((((_zFunctionName == nil) || ((_xSFunc != nil) && ((_xFinal != nil) || (_xStep != nil)))) || ((_xSFunc == nil) && ((_xFinal != nil) && (_xStep == nil)))) || ((_xSFunc == nil) && ((_xFinal == nil) && (_xStep != nil)))) || ((_nArg < int32(-1)) || (_nArg > int32(127)))) || (int32(255) < store2(&_nName, _sqlite3Strlen30(tls, _zFunctionName))) {
 25141  		return _sqlite3MisuseError(tls, int32(142091))
 25142  	}
 25143  
 25144  	_extraFlags = _enc & int32(2048)
 25145  	_enc &= int32(7)
 25146  	if _enc == int32(4) {
 25147  		_enc = int32(2)
 25148  		goto _17
 25149  	}
 25150  	if _enc != int32(5) {
 25151  		goto _17
 25152  	}
 25153  	_3_rc = _sqlite3CreateFunc(tls, _db, _zFunctionName, _nArg, int32(1)|_extraFlags, _pUserData, _xSFunc, _xStep, _xFinal, _pDestructor)
 25154  	if _3_rc == int32(0) {
 25155  		_3_rc = _sqlite3CreateFunc(tls, _db, _zFunctionName, _nArg, int32(2)|_extraFlags, _pUserData, _xSFunc, _xStep, _xFinal, _pDestructor)
 25156  	}
 25157  	if _3_rc != int32(0) {
 25158  		return _3_rc
 25159  	}
 25160  	_enc = int32(3)
 25161  _17:
 25162  	_p = _sqlite3FindFunction(tls, _db, _zFunctionName, _nArg, uint8(_enc), 0)
 25163  	if _p == nil || (int32(_p.XfuncFlags)&int32(3)) != _enc || int32(_p.XnArg) != _nArg {
 25164  		goto _22
 25165  	}
 25166  	if _db.XnVdbeActive != 0 {
 25167  		_sqlite3ErrorWithMsg(tls, _db, int32(5), str(24223))
 25168  		func() {
 25169  			if _db.XmallocFailed != 0 {
 25170  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142135), unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000), unsafe.Pointer(str(23824)))
 25171  				crt.X__builtin_abort(tls)
 25172  			}
 25173  		}()
 25174  		return int32(5)
 25175  	}
 25176  	_sqlite3ExpirePreparedStatements(tls, _db)
 25177  _22:
 25178  	_p = _sqlite3FindFunction(tls, _db, _zFunctionName, _nArg, uint8(_enc), uint8(1))
 25179  	func() {
 25180  		if _p == nil && _db.XmallocFailed == 0 {
 25181  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142143), unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000), unsafe.Pointer(str(24286)))
 25182  			crt.X__builtin_abort(tls)
 25183  		}
 25184  	}()
 25185  	if _p == nil {
 25186  		return _sqlite3NomemError(tls, int32(142145))
 25187  	}
 25188  	_functionDestroy(tls, _db, _p)
 25189  	if _pDestructor != nil {
 25190  		_pDestructor.XnRef += 1
 25191  	}
 25192  	*(**XFuncDestructor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))) = _pDestructor
 25193  	_p.XfuncFlags = uint16((int32(_p.XfuncFlags) & int32(3)) | _extraFlags)
 25194  	*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&_p.XxSFunc)) = func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) {
 25195  		if _xSFunc != nil {
 25196  			return _xSFunc
 25197  		}
 25198  		return _xStep
 25199  	}()
 25200  	*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&_p.XxFinalize)) = _xFinal
 25201  	_p.XpUserData = _pUserData
 25202  	_p.XnArg = int8(uint16(_nArg))
 25203  	return int32(0)
 25204  
 25205  	_ = _nName
 25206  	panic(0)
 25207  }
 25208  
 25209  var _sqlite3CreateFuncØ00__func__Ø000 [18]int8
 25210  
 25211  func init() {
 25212  	crt.Xstrncpy(nil, &_sqlite3CreateFuncØ00__func__Ø000[0], str(24308), 18)
 25213  }
 25214  
 25215  // C comment
 25216  //  /*
 25217  //  ** Locate a user function given a name, a number of arguments and a flag
 25218  //  ** indicating whether the function prefers UTF-16 over UTF-8.  Return a
 25219  //  ** pointer to the FuncDef structure that defines that function, or return
 25220  //  ** NULL if the function does not exist.
 25221  //  **
 25222  //  ** If the createFlag argument is true, then a new (blank) FuncDef
 25223  //  ** structure is created and liked into the "db" structure if a
 25224  //  ** no matching function previously existed.
 25225  //  **
 25226  //  ** If nArg is -2, then the first valid function found is returned.  A
 25227  //  ** function is valid if xSFunc is non-zero.  The nArg==(-2)
 25228  //  ** case is used to see if zName is a valid function name for some number
 25229  //  ** of arguments.  If nArg is -2, then createFlag must be 0.
 25230  //  **
 25231  //  ** If createFlag is false, then a function with the required name and
 25232  //  ** number of arguments may be returned even if the eTextRep flag does not
 25233  //  ** match that requested.
 25234  //  */
 25235  func _sqlite3FindFunction(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _nArg int32, _enc uint8, _createFlag uint8) (r0 *XFuncDef) {
 25236  	var _bestScore, _h, _nName, _1_score, _4_score int32
 25237  	var _p, _pBest, _6_pOther *XFuncDef
 25238  	_pBest = nil
 25239  	_bestScore = int32(0)
 25240  	func() {
 25241  		if _nArg < int32(-2) {
 25242  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104504), unsafe.Pointer(&_sqlite3FindFunctionØ00__func__Ø000), unsafe.Pointer(str(24326)))
 25243  			crt.X__builtin_abort(tls)
 25244  		}
 25245  	}()
 25246  	func() {
 25247  		if _nArg < int32(-1) && int32(_createFlag) != int32(0) {
 25248  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104505), unsafe.Pointer(&_sqlite3FindFunctionØ00__func__Ø000), unsafe.Pointer(str(24337)))
 25249  			crt.X__builtin_abort(tls)
 25250  		}
 25251  	}()
 25252  	_nName = _sqlite3Strlen30(tls, _zName)
 25253  	_p = (*XFuncDef)(_sqlite3HashFind(tls, &_db.XaFunc, _zName))
 25254  _5:
 25255  	if _p == nil {
 25256  		goto _6
 25257  	}
 25258  	_1_score = _matchQuality(tls, _p, _nArg, _enc)
 25259  	if _1_score > _bestScore {
 25260  		_pBest = _p
 25261  		_bestScore = _1_score
 25262  	}
 25263  	_p = (*XFuncDef)(_p.XpNext)
 25264  	goto _5
 25265  _6:
 25266  	if _createFlag != 0 || _pBest != nil && (_db.Xflags&int32(2097152)) == int32(0) {
 25267  		goto _10
 25268  	}
 25269  	_bestScore = int32(0)
 25270  	_h = (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_zName, 0))))) + _nName) % int32(23)
 25271  	_p = _functionSearch(tls, _h, _zName)
 25272  _11:
 25273  	if _p == nil {
 25274  		goto _12
 25275  	}
 25276  	_4_score = _matchQuality(tls, _p, _nArg, _enc)
 25277  	if _4_score > _bestScore {
 25278  		_pBest = _p
 25279  		_bestScore = _4_score
 25280  	}
 25281  	_p = (*XFuncDef)(_p.XpNext)
 25282  	goto _11
 25283  _12:
 25284  _10:
 25285  	if _createFlag == 0 || _bestScore >= int32(6) || store17(&_pBest, (*XFuncDef)(_sqlite3DbMallocZero(tls, _db, (uint64(56)+uint64(_nName))+uint64(1)))) == nil {
 25286  		goto _16
 25287  	}
 25288  	_pBest.XzName = (*int8)(unsafe.Pointer(elem17(_pBest, uintptr(1))))
 25289  	_pBest.XnArg = int8(uint16(_nArg))
 25290  	_pBest.XfuncFlags = uint16(_enc)
 25291  	crt.Xmemcpy(tls, unsafe.Pointer(elem17(_pBest, uintptr(1))), unsafe.Pointer(_zName), uint64(_nName+int32(1)))
 25292  	_6_pOther = (*XFuncDef)(_sqlite3HashInsert(tls, &_db.XaFunc, _pBest.XzName, unsafe.Pointer(_pBest)))
 25293  	if _6_pOther == _pBest {
 25294  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pBest))
 25295  		_sqlite3OomFault(tls, _db)
 25296  		return nil
 25297  	}
 25298  	*(**XFuncDef)(unsafe.Pointer(&_pBest.XpNext)) = _6_pOther
 25299  _16:
 25300  	if (_pBest != nil) && ((_pBest.XxSFunc != nil) || (_createFlag != 0)) {
 25301  		return _pBest
 25302  	}
 25303  	return nil
 25304  }
 25305  
 25306  var _sqlite3FindFunctionØ00__func__Ø000 [20]int8
 25307  
 25308  func init() {
 25309  	crt.Xstrncpy(nil, &_sqlite3FindFunctionØ00__func__Ø000[0], str(24365), 20)
 25310  }
 25311  
 25312  // C comment
 25313  //  /* The score for a perfect match */
 25314  func _matchQuality(tls *crt.TLS, _p *XFuncDef, _nArg int32, _enc uint8) (r0 int32) {
 25315  	var _match int32
 25316  	if _nArg == int32(-2) {
 25317  		return func() int32 {
 25318  			if func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) {
 25319  				v := _p.XxSFunc
 25320  				return *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&v))
 25321  			}() == nil {
 25322  				return int32(0)
 25323  			}
 25324  			return int32(6)
 25325  		}()
 25326  	}
 25327  	if (int32(_p.XnArg) != _nArg) && (int32(_p.XnArg) >= int32(0)) {
 25328  		return int32(0)
 25329  	}
 25330  	if int32(_p.XnArg) == _nArg {
 25331  		_match = int32(4)
 25332  		goto _6
 25333  	}
 25334  	_match = int32(1)
 25335  _6:
 25336  	if int32(_enc) == (int32(_p.XfuncFlags) & int32(3)) {
 25337  		_match += int32(2)
 25338  		goto _9
 25339  	}
 25340  	if ((int32(_enc) & int32(_p.XfuncFlags)) & int32(2)) != int32(0) {
 25341  		_match += int32(1)
 25342  	}
 25343  _9:
 25344  	return _match
 25345  }
 25346  
 25347  var _sqlite3_create_function_v2Ø00__func__Ø000 [27]int8
 25348  
 25349  func init() {
 25350  	crt.Xstrncpy(nil, &_sqlite3_create_function_v2Ø00__func__Ø000[0], str(24385), 27)
 25351  }
 25352  
 25353  func Xsqlite3_create_function16(tls *crt.TLS, _db *Xsqlite3, _zFunctionName unsafe.Pointer, _nArg int32, _eTextRep int32, _p unsafe.Pointer, _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xStep func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xFinal func(*crt.TLS, *Xsqlite3_context)) (r0 int32) {
 25354  	var _rc int32
 25355  	var _zFunc8 *int8
 25356  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zFunctionName == nil) {
 25357  		return _sqlite3MisuseError(tls, int32(142239))
 25358  	}
 25359  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25360  	func() {
 25361  		if _db.XmallocFailed != 0 {
 25362  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142242), unsafe.Pointer(&_sqlite3_create_function16Ø00__func__Ø000), unsafe.Pointer(str(23824)))
 25363  			crt.X__builtin_abort(tls)
 25364  		}
 25365  	}()
 25366  	_zFunc8 = _sqlite3Utf16to8(tls, _db, _zFunctionName, int32(-1), uint8(2))
 25367  	_rc = _sqlite3CreateFunc(tls, _db, _zFunc8, _nArg, _eTextRep, _p, _xSFunc, _xStep, _xFinal, nil)
 25368  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zFunc8))
 25369  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 25370  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25371  	return _rc
 25372  }
 25373  
 25374  var _sqlite3_create_function16Ø00__func__Ø000 [26]int8
 25375  
 25376  func init() {
 25377  	crt.Xstrncpy(nil, &_sqlite3_create_function16Ø00__func__Ø000[0], str(24412), 26)
 25378  }
 25379  
 25380  // C comment
 25381  //  /*
 25382  //  ** External API function used to create a new virtual-table module.
 25383  //  */
 25384  func Xsqlite3_create_module(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer) (r0 int32) {
 25385  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
 25386  		return _sqlite3MisuseError(tls, int32(125090))
 25387  	}
 25388  	return _createModule(tls, _db, _zName, _pModule, _pAux, nil)
 25389  }
 25390  
 25391  // C comment
 25392  //  /*
 25393  //  ** The actual function that does the work of creating a new module.
 25394  //  ** This function implements the sqlite3_create_module() and
 25395  //  ** sqlite3_create_module_v2() interfaces.
 25396  //  */
 25397  func _createModule(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 25398  	var _rc int32
 25399  	_rc = int32(0)
 25400  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25401  	if _sqlite3HashFind(tls, &_db.XaModule, _zName) != nil {
 25402  		_rc = _sqlite3MisuseError(tls, int32(125069))
 25403  		goto _1
 25404  	}
 25405  	_sqlite3VtabCreateModule(tls, _db, _zName, _pModule, _pAux, _xDestroy)
 25406  _1:
 25407  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 25408  	if (_rc != int32(0)) && (_xDestroy != nil) {
 25409  		_xDestroy(tls, _pAux)
 25410  	}
 25411  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25412  	return _rc
 25413  }
 25414  
 25415  // C comment
 25416  //  /*
 25417  //  ** Construct and install a Module object for a virtual table.  When this
 25418  //  ** routine is called, it is guaranteed that all appropriate locks are held
 25419  //  ** and the module is not already part of the connection.
 25420  //  */
 25421  func _sqlite3VtabCreateModule(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 *XModule) {
 25422  	var _nName int32
 25423  	var _1_zCopy *int8
 25424  	var _pMod, _1_pDel *XModule
 25425  	_nName = _sqlite3Strlen30(tls, _zName)
 25426  	_pMod = (*XModule)(_sqlite3DbMallocRawNN(tls, _db, (uint64(40)+uint64(_nName))+uint64(1)))
 25427  	if _pMod == nil {
 25428  		goto _0
 25429  	}
 25430  	_1_zCopy = (*int8)(unsafe.Pointer(elem50(_pMod, uintptr(1))))
 25431  	crt.Xmemcpy(tls, unsafe.Pointer(_1_zCopy), unsafe.Pointer(_zName), uint64(_nName+int32(1)))
 25432  	_pMod.XzName = _1_zCopy
 25433  	*(**Xsqlite3_module)(unsafe.Pointer(&_pMod.XpModule)) = _pModule
 25434  	_pMod.XpAux = _pAux
 25435  	_pMod.XxDestroy = _xDestroy
 25436  	*(**XTable)(unsafe.Pointer(&_pMod.XpEpoTab)) = nil
 25437  	_1_pDel = (*XModule)(_sqlite3HashInsert(tls, &_db.XaModule, _1_zCopy, unsafe.Pointer(_pMod)))
 25438  	func() {
 25439  		if _1_pDel != nil && _1_pDel != _pMod {
 25440  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125043), unsafe.Pointer(&_sqlite3VtabCreateModuleØ00__func__Ø000), unsafe.Pointer(str(24438)))
 25441  			crt.X__builtin_abort(tls)
 25442  		}
 25443  	}()
 25444  	if _1_pDel != nil {
 25445  		_sqlite3OomFault(tls, _db)
 25446  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pDel))
 25447  		_pMod = nil
 25448  	}
 25449  _0:
 25450  	return _pMod
 25451  }
 25452  
 25453  var _sqlite3VtabCreateModuleØ00__func__Ø000 [24]int8
 25454  
 25455  func init() {
 25456  	crt.Xstrncpy(nil, &_sqlite3VtabCreateModuleØ00__func__Ø000[0], str(24460), 24)
 25457  }
 25458  
 25459  // C comment
 25460  //  /*
 25461  //  ** Return the number of values available from the current row of the
 25462  //  ** currently executing statement pStmt.
 25463  //  */
 25464  func Xsqlite3_data_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 25465  	var _pVm *TVdbe
 25466  	_pVm = (*TVdbe)(_pStmt)
 25467  	if (_pVm == nil) || ((*XMem)(_pVm.XpResultSet) == nil) {
 25468  		return int32(0)
 25469  	}
 25470  	return int32(_pVm.XnResColumn)
 25471  }
 25472  
 25473  // C comment
 25474  //  /*
 25475  //  ** Return the sqlite3* database handle to which the prepared statement given
 25476  //  ** in the argument belongs.  This is the same database handle that was
 25477  //  ** the first argument to the sqlite3_prepare() that was used to create
 25478  //  ** the statement in the first place.
 25479  //  */
 25480  func Xsqlite3_db_handle(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *Xsqlite3) {
 25481  	return func() *Xsqlite3 {
 25482  		if _pStmt != nil {
 25483  			return (*Xsqlite3)((*TVdbe)(_pStmt).Xdb)
 25484  		}
 25485  		return nil
 25486  	}()
 25487  }
 25488  
 25489  // C comment
 25490  //  /*
 25491  //  ** This function is used to set the schema of a virtual table.  It is only
 25492  //  ** valid to call this function from within the xCreate() or xConnect() of a
 25493  //  ** virtual table module.
 25494  //  */
 25495  func Xsqlite3_declare_vtab(tls *crt.TLS, _db *Xsqlite3, _zCreateTable *int8) (r0 int32) {
 25496  	var _rc int32
 25497  	var _zErr *int8
 25498  	var _pTab, _6_pNew *XTable
 25499  	var _pParse *XParse
 25500  	var _6_pIdx *XIndex
 25501  	var _pCtx *XVtabCtx
 25502  	_rc = int32(0)
 25503  	_zErr = nil
 25504  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zCreateTable == nil) {
 25505  		return _sqlite3MisuseError(tls, int32(125730))
 25506  	}
 25507  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25508  	_pCtx = (*XVtabCtx)(_db.XpVtabCtx)
 25509  	if (_pCtx == nil) || _pCtx.XbDeclared != 0 {
 25510  		_sqlite3Error(tls, _db, int32(21))
 25511  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25512  		return _sqlite3MisuseError(tls, int32(125738))
 25513  	}
 25514  	_pTab = (*XTable)(_pCtx.XpTab)
 25515  	func() {
 25516  		if _pTab.XnModuleArg == 0 {
 25517  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125741), unsafe.Pointer(&_sqlite3_declare_vtabØ00__func__Ø000), unsafe.Pointer(str(24484)))
 25518  			crt.X__builtin_abort(tls)
 25519  		}
 25520  	}()
 25521  	_pParse = (*XParse)(_sqlite3DbMallocZero(tls, _db, uint64(600)))
 25522  	if _pParse == nil {
 25523  		_rc = _sqlite3NomemError(tls, int32(125745))
 25524  		goto _7
 25525  	}
 25526  	_pParse.XdeclareVtab = uint8(1)
 25527  	*(**Xsqlite3)(unsafe.Pointer(&_pParse.Xdb)) = _db
 25528  	_pParse.XnQueryLoop = uint32(1)
 25529  	if int32(0) != _sqlite3RunParser(tls, _pParse, _zCreateTable, &_zErr) || _pParse.XpNewTable == nil || _db.XmallocFailed != 0 || ((*XTable)(_pParse.XpNewTable).XpSelect) != nil || ((*XTable)(_pParse.XpNewTable).XnModuleArg) != 0 {
 25530  		goto _12
 25531  	}
 25532  	if _pTab.XaCol != nil {
 25533  		goto _13
 25534  	}
 25535  	_6_pNew = (*XTable)(_pParse.XpNewTable)
 25536  	*(**XColumn)(unsafe.Pointer(&_pTab.XaCol)) = (*XColumn)(_6_pNew.XaCol)
 25537  	_pTab.XnCol = _6_pNew.XnCol
 25538  	_pTab.XtabFlags |= _6_pNew.XtabFlags & uint32(96)
 25539  	_6_pNew.XnCol = 0
 25540  	*(**XColumn)(unsafe.Pointer(&_6_pNew.XaCol)) = nil
 25541  	func() {
 25542  		if (*XIndex)(_pTab.XpIndex) != nil {
 25543  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125765), unsafe.Pointer(&_sqlite3_declare_vtabØ00__func__Ø000), unsafe.Pointer(str(24500)))
 25544  			crt.X__builtin_abort(tls)
 25545  		}
 25546  	}()
 25547  	if ((_6_pNew.XtabFlags & uint32(32)) != (0)) && (func() func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 {
 25548  		v := (*Xsqlite3_module)((*XModule)((*XVTable)(_pCtx.XpVTable).XpMod).XpModule).XxUpdate
 25549  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&v))
 25550  	}() != nil) {
 25551  		_rc = int32(1)
 25552  	}
 25553  	_6_pIdx = (*XIndex)(_6_pNew.XpIndex)
 25554  	if _6_pIdx != nil {
 25555  		func() {
 25556  			if (*XIndex)(_6_pIdx.XpNext) != nil {
 25557  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125771), unsafe.Pointer(&_sqlite3_declare_vtabØ00__func__Ø000), unsafe.Pointer(str(24516)))
 25558  				crt.X__builtin_abort(tls)
 25559  			}
 25560  		}()
 25561  		*(**XIndex)(unsafe.Pointer(&_pTab.XpIndex)) = _6_pIdx
 25562  		*(**XIndex)(unsafe.Pointer(&_6_pNew.XpIndex)) = nil
 25563  		*(**XTable)(unsafe.Pointer(&_6_pIdx.XpTable)) = _pTab
 25564  	}
 25565  _13:
 25566  	_pCtx.XbDeclared = int32(1)
 25567  	goto _21
 25568  _12:
 25569  	_sqlite3ErrorWithMsg(tls, _db, int32(1), func() *int8 {
 25570  		if _zErr != nil {
 25571  			return str(24531)
 25572  		}
 25573  		return nil
 25574  	}(), unsafe.Pointer(_zErr))
 25575  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
 25576  	_rc = int32(1)
 25577  _21:
 25578  	_pParse.XdeclareVtab = 0
 25579  	if _pParse.XpVdbe != nil {
 25580  		_sqlite3VdbeFinalize(tls, (*TVdbe)(_pParse.XpVdbe))
 25581  	}
 25582  	_sqlite3DeleteTable(tls, _db, (*XTable)(_pParse.XpNewTable))
 25583  	_sqlite3ParserReset(tls, _pParse)
 25584  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse))
 25585  _7:
 25586  	func() {
 25587  		if (_rc & int32(255)) != _rc {
 25588  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125793), unsafe.Pointer(&_sqlite3_declare_vtabØ00__func__Ø000), unsafe.Pointer(str(24534)))
 25589  			crt.X__builtin_abort(tls)
 25590  		}
 25591  	}()
 25592  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 25593  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25594  	return _rc
 25595  }
 25596  
 25597  var _sqlite3_declare_vtabØ00__func__Ø000 [21]int8
 25598  
 25599  func init() {
 25600  	crt.Xstrncpy(nil, &_sqlite3_declare_vtabØ00__func__Ø000[0], str(24548), 21)
 25601  }
 25602  
 25603  // C comment
 25604  //  /*
 25605  //  ** Run the parser on the given SQL string.  The parser structure is
 25606  //  ** passed in.  An SQLITE_ status code is returned.  If an error occurs
 25607  //  ** then an and attempt is made to write an error message into
 25608  //  ** memory obtained from sqlite3_malloc() and to make *pzErrMsg point to that
 25609  //  ** error message.
 25610  //  */
 25611  func _sqlite3RunParser(tls *crt.TLS, _pParse *XParse, _zSql *int8, _pzErrMsg **int8) (r0 int32) {
 25612  	var _nErr, _n, _tokenType, _lastTokenParsed, _mxSqlLen int32
 25613  	var _pEngine unsafe.Pointer
 25614  	var _db *Xsqlite3
 25615  	var _20_p *XTable
 25616  	var _19_p *XAutoincInfo
 25617  	var _sEngine XyyParser
 25618  	_nErr = int32(0)
 25619  	_n = int32(0)
 25620  	_lastTokenParsed = int32(-1)
 25621  	_db = (*Xsqlite3)(_pParse.Xdb)
 25622  	func() {
 25623  		if _zSql == nil {
 25624  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139953), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24569)))
 25625  			crt.X__builtin_abort(tls)
 25626  		}
 25627  	}()
 25628  	_mxSqlLen = *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(1))
 25629  	if _db.XnVdbeActive == int32(0) {
 25630  		*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(0)
 25631  	}
 25632  	_pParse.Xrc = int32(0)
 25633  	_pParse.XzTail = _zSql
 25634  	func() {
 25635  		if _pzErrMsg == nil {
 25636  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139960), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24577)))
 25637  			crt.X__builtin_abort(tls)
 25638  		}
 25639  	}()
 25640  	_pEngine = unsafe.Pointer(&_sEngine)
 25641  	_sqlite3ParserInit(tls, _pEngine)
 25642  	func() {
 25643  		if (*XTable)(_pParse.XpNewTable) != nil {
 25644  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139972), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24589)))
 25645  			crt.X__builtin_abort(tls)
 25646  		}
 25647  	}()
 25648  	func() {
 25649  		if (*XTrigger)(_pParse.XpNewTrigger) != nil {
 25650  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139973), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24610)))
 25651  			crt.X__builtin_abort(tls)
 25652  		}
 25653  	}()
 25654  	func() {
 25655  		if int32(_pParse.XnVar) != int32(0) {
 25656  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139974), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24633)))
 25657  			crt.X__builtin_abort(tls)
 25658  		}
 25659  	}()
 25660  	func() {
 25661  		if _pParse.XpVList != nil {
 25662  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139975), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24649)))
 25663  			crt.X__builtin_abort(tls)
 25664  		}
 25665  	}()
 25666  _13:
 25667  	if int32(*elem1(_zSql, 0)) == int32(0) {
 25668  		goto _15
 25669  	}
 25670  	_n = _sqlite3GetToken(tls, (*uint8)(unsafe.Pointer(_zSql)), &_tokenType)
 25671  	_mxSqlLen -= _n
 25672  	if _mxSqlLen < int32(0) {
 25673  		_pParse.Xrc = int32(18)
 25674  		goto _14
 25675  	}
 25676  	goto _17
 25677  _15:
 25678  	if _lastTokenParsed == int32(1) {
 25679  		_tokenType = int32(0)
 25680  		goto _21
 25681  	}
 25682  	if _lastTokenParsed == int32(0) {
 25683  		goto _14
 25684  	}
 25685  	_tokenType = int32(1)
 25686  _21:
 25687  	*(*uintptr)(unsafe.Pointer(&_zSql)) -= uintptr(_n)
 25688  _17:
 25689  	if _tokenType < int32(163) {
 25690  		goto _22
 25691  	}
 25692  	func() {
 25693  		if _tokenType != int32(163) && _tokenType != int32(164) {
 25694  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139997), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24667)))
 25695  			crt.X__builtin_abort(tls)
 25696  		}
 25697  	}()
 25698  	if (*(*int32)(unsafe.Pointer(&_db.Xu1))) != 0 {
 25699  		_pParse.Xrc = int32(9)
 25700  		goto _14
 25701  	}
 25702  	if _tokenType == int32(164) {
 25703  		_sqlite3ErrorMsg(tls, _pParse, str(24712), _n, unsafe.Pointer(_zSql))
 25704  		goto _14
 25705  	}
 25706  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(_n)
 25707  	goto _28
 25708  _22:
 25709  	_pParse.XsLastToken.Xz = _zSql
 25710  	_pParse.XsLastToken.Xn = uint32(_n)
 25711  	_sqlite3Parser(tls, _pEngine, _tokenType, _pParse.XsLastToken, _pParse)
 25712  	_lastTokenParsed = _tokenType
 25713  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(_n)
 25714  	if (_pParse.Xrc != int32(0)) || (_db.XmallocFailed != 0) {
 25715  		goto _14
 25716  	}
 25717  _28:
 25718  	goto _13
 25719  _14:
 25720  	func() {
 25721  		if _nErr != int32(0) {
 25722  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(140016), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24739)))
 25723  			crt.X__builtin_abort(tls)
 25724  		}
 25725  	}()
 25726  	_pParse.XzTail = _zSql
 25727  	_sqlite3ParserFinalize(tls, _pEngine)
 25728  	if _db.XmallocFailed != 0 {
 25729  		_pParse.Xrc = _sqlite3NomemError(tls, int32(140031))
 25730  	}
 25731  	if ((_pParse.Xrc != int32(0)) && (_pParse.Xrc != int32(101))) && (_pParse.XzErrMsg == nil) {
 25732  		_pParse.XzErrMsg = _sqlite3MPrintf(tls, _db, str(24531), unsafe.Pointer(_sqlite3ErrStr(tls, _pParse.Xrc)))
 25733  	}
 25734  	func() {
 25735  		if _pzErrMsg == nil {
 25736  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(140036), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24577)))
 25737  			crt.X__builtin_abort(tls)
 25738  		}
 25739  	}()
 25740  	if _pParse.XzErrMsg != nil {
 25741  		*_pzErrMsg = _pParse.XzErrMsg
 25742  		Xsqlite3_log(tls, _pParse.Xrc, str(24531), unsafe.Pointer(*_pzErrMsg))
 25743  		_pParse.XzErrMsg = nil
 25744  		_nErr += 1
 25745  	}
 25746  	if ((_pParse.XpVdbe != nil) && (_pParse.XnErr > int32(0))) && (int32(_pParse.Xnested) == int32(0)) {
 25747  		_sqlite3VdbeDelete(tls, (*TVdbe)(_pParse.XpVdbe))
 25748  		*(**TVdbe)(unsafe.Pointer(&_pParse.XpVdbe)) = nil
 25749  	}
 25750  	if int32(_pParse.Xnested) == int32(0) {
 25751  		_sqlite3DbFree(tls, _db, _pParse.XaTableLock)
 25752  		*(**XTableLock)(unsafe.Pointer(&_pParse.XaTableLock)) = nil
 25753  		_pParse.XnTableLock = int32(0)
 25754  	}
 25755  	Xsqlite3_free(tls, unsafe.Pointer(_pParse.XapVtabLock))
 25756  	if _pParse.XdeclareVtab == 0 {
 25757  		_sqlite3DeleteTable(tls, _db, (*XTable)(_pParse.XpNewTable))
 25758  	}
 25759  	if _pParse.XpWithToFree != nil {
 25760  		_sqlite3WithDelete(tls, _db, (*XWith)(_pParse.XpWithToFree))
 25761  	}
 25762  	_sqlite3DeleteTrigger(tls, _db, (*XTrigger)(_pParse.XpNewTrigger))
 25763  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse.XpVList))
 25764  _46:
 25765  	if _pParse.XpAinc != nil {
 25766  		_19_p = (*XAutoincInfo)(_pParse.XpAinc)
 25767  		*(**XAutoincInfo)(unsafe.Pointer(&_pParse.XpAinc)) = (*XAutoincInfo)(_19_p.XpNext)
 25768  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_19_p))
 25769  		goto _46
 25770  	}
 25771  _47:
 25772  	if _pParse.XpZombieTab != nil {
 25773  		_20_p = (*XTable)(_pParse.XpZombieTab)
 25774  		*(**XTable)(unsafe.Pointer(&_pParse.XpZombieTab)) = (*XTable)(_20_p.XpNextZombie)
 25775  		_sqlite3DeleteTable(tls, _db, _20_p)
 25776  		goto _47
 25777  	}
 25778  	func() {
 25779  		if _nErr != int32(0) && _pParse.Xrc == int32(0) {
 25780  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(140079), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24747)))
 25781  			crt.X__builtin_abort(tls)
 25782  		}
 25783  	}()
 25784  	return _nErr
 25785  
 25786  	_ = _sEngine
 25787  	panic(0)
 25788  }
 25789  
 25790  var _sqlite3RunParserØ00__func__Ø000 [17]int8
 25791  
 25792  func init() {
 25793  	crt.Xstrncpy(nil, &_sqlite3RunParserØ00__func__Ø000[0], str(24780), 17)
 25794  }
 25795  
 25796  // C comment
 25797  //  /* Initialize a new parser that has already been allocated.
 25798  //  */
 25799  func _sqlite3ParserInit(tls *crt.TLS, _yypParser unsafe.Pointer) {
 25800  	var _pParser *XyyParser
 25801  	_pParser = (*XyyParser)(_yypParser)
 25802  	*(**XyyStackEntry)(unsafe.Pointer(&_pParser.Xyytos)) = (*XyyStackEntry)(unsafe.Pointer(&_pParser.Xyystack))
 25803  	elem51((*XyyStackEntry)(unsafe.Pointer(&_pParser.Xyystack)), 0).Xstateno = 0
 25804  	elem51((*XyyStackEntry)(unsafe.Pointer(&_pParser.Xyystack)), 0).Xmajor = 0
 25805  }
 25806  
 25807  // C comment
 25808  //  /*
 25809  //  ** Add an error message to pParse->zErrMsg and increment pParse->nErr.
 25810  //  ** The following formatting characters are allowed:
 25811  //  **
 25812  //  **      %s      Insert a string
 25813  //  **      %z      A string that should be freed after use
 25814  //  **      %d      Insert an integer
 25815  //  **      %T      Insert a token
 25816  //  **      %S      Insert the first element of a SrcList
 25817  //  **
 25818  //  ** This function should be used to report any error that occurs while
 25819  //  ** compiling an SQL statement (i.e. within sqlite3_prepare()). The
 25820  //  ** last thing the sqlite3_prepare() function does is copy the error
 25821  //  ** stored by this function into the database handle using sqlite3Error().
 25822  //  ** Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used
 25823  //  ** during statement execution (sqlite3_step() etc.).
 25824  //  */
 25825  func _sqlite3ErrorMsg(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ...interface{}) {
 25826  	var _zMsg *int8
 25827  	var _ap []interface{}
 25828  	var _db *Xsqlite3
 25829  	_db = (*Xsqlite3)(_pParse.Xdb)
 25830  	_ap = args
 25831  	_zMsg = _sqlite3VMPrintf(tls, _db, _zFormat, _ap)
 25832  	_ap = nil
 25833  	if _db.XsuppressErr != 0 {
 25834  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zMsg))
 25835  		goto _1
 25836  	}
 25837  	_pParse.XnErr += 1
 25838  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse.XzErrMsg))
 25839  	_pParse.XzErrMsg = _zMsg
 25840  	_pParse.Xrc = int32(1)
 25841  _1:
 25842  }
 25843  
 25844  // C comment
 25845  //  /* The main parser program.
 25846  //  ** The first argument is a pointer to a structure obtained from
 25847  //  ** "sqlite3ParserAlloc" which describes the current state of the parser.
 25848  //  ** The second argument is the major token number.  The third is
 25849  //  ** the minor token.  The fourth optional argument is whatever the
 25850  //  ** user wants (and specified in the grammar) and is available for
 25851  //  ** use by the action routines.
 25852  //  **
 25853  //  ** Inputs:
 25854  //  ** <ul>
 25855  //  ** <li> A pointer to the parser (an opaque structure.)
 25856  //  ** <li> The major token number.
 25857  //  ** <li> The minor token number.
 25858  //  ** <li> An option argument of a grammar-specified type.
 25859  //  ** </ul>
 25860  //  **
 25861  //  ** Outputs:
 25862  //  ** None.
 25863  //  */
 25864  func _sqlite3Parser(tls *crt.TLS, _yyp unsafe.Pointer, _yymajor int32, _yyminor XToken, _pParse *XParse) {
 25865  	var _7_cDiv int8
 25866  	var _yyact uint32
 25867  	var _yypParser *XyyParser
 25868  	var _yyminorunion XYYMINORTYPE
 25869  	var _7_i *XyyStackEntry
 25870  	_yypParser = (*XyyParser)(_yyp)
 25871  	func() {
 25872  		if (*XyyStackEntry)(_yypParser.Xyytos) == nil {
 25873  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139035), unsafe.Pointer(&_sqlite3ParserØ00__func__Ø000), unsafe.Pointer(str(24797)))
 25874  			crt.X__builtin_abort(tls)
 25875  		}
 25876  	}()
 25877  	*(**XParse)(unsafe.Pointer(&_yypParser.XpParse)) = _pParse
 25878  	if _yyTraceFILE != nil {
 25879  		crt.Xfprintf(tls, _yyTraceFILE, str(24817), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr(_yymajor))))
 25880  	}
 25881  _2:
 25882  	_yyact = _yy_find_shift_action(tls, _yypParser, uint8(_yymajor))
 25883  	if _yyact <= uint32(999) {
 25884  		_yy_shift(tls, _yypParser, int32(_yyact), _yymajor, _yyminor)
 25885  		_yymajor = int32(252)
 25886  		goto _7
 25887  	}
 25888  	if _yyact <= uint32(1331) {
 25889  		_yy_reduce(tls, _yypParser, _yyact-uint32(1000))
 25890  		goto _7
 25891  	}
 25892  	func() {
 25893  		if _yyact != uint32(1332) {
 25894  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139058), unsafe.Pointer(&_sqlite3ParserØ00__func__Ø000), unsafe.Pointer(str(24831)))
 25895  			crt.X__builtin_abort(tls)
 25896  		}
 25897  	}()
 25898  	*(*XToken)(unsafe.Pointer(&_yyminorunion)) = _yyminor
 25899  	if _yyTraceFILE != nil {
 25900  		crt.Xfprintf(tls, _yyTraceFILE, str(24856), unsafe.Pointer(_yyTracePrompt))
 25901  	}
 25902  	_yy_syntax_error(tls, _yypParser, _yymajor, _yyminor)
 25903  	_yy_destructor(tls, _yypParser, uint8(_yymajor), &_yyminorunion)
 25904  	_yymajor = int32(252)
 25905  _7:
 25906  	if (_yymajor != int32(252)) && (crt.P2U(_yypParser.Xyytos) > crt.P2U(unsafe.Pointer(&_yypParser.Xyystack))) {
 25907  		goto _2
 25908  	}
 25909  	if _yyTraceFILE == nil {
 25910  		goto _12
 25911  	}
 25912  	_7_cDiv = int8(91)
 25913  	crt.Xfprintf(tls, _yyTraceFILE, str(24873), unsafe.Pointer(_yyTracePrompt))
 25914  	_7_i = elem51((*XyyStackEntry)(unsafe.Pointer(&_yypParser.Xyystack)), uintptr(1))
 25915  _13:
 25916  	if crt.P2U(unsafe.Pointer(_7_i)) > crt.P2U(_yypParser.Xyytos) {
 25917  		goto _16
 25918  	}
 25919  	crt.Xfprintf(tls, _yyTraceFILE, str(24890), int32(_7_cDiv), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr(_7_i.Xmajor))))
 25920  	_7_cDiv = int8(32)
 25921  	*(*uintptr)(unsafe.Pointer(&_7_i)) += uintptr(32)
 25922  	goto _13
 25923  _16:
 25924  	crt.Xfprintf(tls, _yyTraceFILE, str(24895))
 25925  _12:
 25926  }
 25927  
 25928  var _sqlite3ParserØ00__func__Ø000 [14]int8
 25929  
 25930  func init() {
 25931  	crt.Xstrncpy(nil, &_sqlite3ParserØ00__func__Ø000[0], str(24898), 14)
 25932  }
 25933  
 25934  // C comment
 25935  //  /* #include <stdio.h> */
 25936  var _yyTraceFILE *crt.XFILE
 25937  
 25938  var _yyTracePrompt *int8
 25939  
 25940  // C comment
 25941  //  /* For tracing shifts, the names of all terminals and nonterminals
 25942  //  ** are required.  The following table supplies these names */
 25943  var _yyTokenName [251]*int8
 25944  
 25945  func init() {
 25946  	_yyTokenName = [251]*int8{str(24912), str(24914), str(24919), str(24927), str(24933), str(24938), str(24944), str(24956), str(24965), str(24975), str(24985), str(24992), str(24996), str(25005), str(25015), str(25023), str(25026), str(25032), str(25039), str(25042), str(25046), str(25053), str(25058), str(25061), str(25064), str(25067), str(25075), str(25081), str(25084), str(25090), str(25097), str(25103), str(25111), str(25115), str(25122), str(25129), str(25132), str(25140), str(25145), str(25154), str(25163), str(25172), str(25177), str(25184), str(25189), str(25194), str(25198), str(25205), str(25215), str(25223), str(25231), str(25237), str(25240), str(25244), str(25247), str(25254), str(25261), str(25267), str(25277), str(25285), str(25294), str(25298), str(25306), str(25313), str(25318), str(25326), str(25331), str(25339), str(25346), str(25355), str(25359), str(25362), str(25366), str(25369), str(25377), str(25380), str(25387), str(25395), str(25398), str(25401), str(25404), str(25407), str(25410), str(25413), str(25420), str(25427), str(25433), str(25440), str(25447), str(25452), str(25458), str(25463), str(25469), str(25473), str(25480), str(25488), str(25495), str(25503), str(25510), str(25518), str(25529), str(285), str(25537), str(25545), str(25552), str(25558), str(25569), str(25578), str(25581), str(25588), str(25595), str(25602), str(25606), str(25617), str(25625), str(25630), str(25636), str(25640), str(25647), str(25657), str(25664), str(25671), str(25680), str(25684), str(25689), str(25694), str(25700), str(25706), str(25712), str(25719), str(25725), str(25731), str(25736), str(25742), str(25747), str(25755), str(25764), str(25769), str(25774), str(25779), str(25784), str(25790), str(25796), str(25800), str(25806), str(25812), str(25820), str(23816), str(25825), str(25830), str(25834), str(25844), str(25854), str(25857), str(25871), str(25884), str(25902), str(23797), str(25911), str(25923), str(25928), str(25939), str(25952), str(25966), str(25973), str(25984), str(25993), str(26003), str(26012), str(26019), str(26028), str(26038), str(26044), str(26049), str(26054), str(26061), str(26071), str(26079), str(26091), str(26099), str(26115), str(26122), str(26129), str(26152), str(26161), str(26172), str(26178), str(26187), str(26195), str(26215), str(26222), str(26234), str(26244), str(26253), str(26262), str(26275), str(26285), str(26290), str(26305), str(26314), str(26325), str(26330), str(26340), str(26352), str(26363), str(26375), str(26385), str(26392), str(26402), str(26411), str(26416), str(26419), str(26430), str(26441), str(26448), str(26460), str(26467), str(26477), str(26484), str(26492), str(26503), str(26514), str(26521), str(26532), str(26538), str(26553), str(26566), str(26580), str(26590), str(26601), str(26609), str(26615), str(26628), str(26645), str(26658), str(26672), str(26687), str(26699), str(26711), str(26716), str(26724), str(26740), str(26748), str(26768), str(26781), str(26793), str(26805), str(26813), str(26826), str(26829), str(26837)}
 25947  }
 25948  
 25949  // C comment
 25950  //  /*
 25951  //  ** Find the appropriate action for a parser given the terminal
 25952  //  ** look-ahead token iLookAhead.
 25953  //  */
 25954  func _yy_find_shift_action(tls *crt.TLS, _pParser *XyyParser, _iLookAhead uint8) (r0 uint32) {
 25955  	var _i, _stateno, _5_j int32
 25956  	var _2_iFallback uint8
 25957  	_stateno = int32((*XyyStackEntry)(_pParser.Xyytos).Xstateno)
 25958  	if _stateno >= int32(1000) {
 25959  		return uint32(_stateno)
 25960  	}
 25961  	func() {
 25962  		if _stateno > int32(455) {
 25963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137121), unsafe.Pointer(&_yy_find_shift_actionØ00__func__Ø000), unsafe.Pointer(str(26844)))
 25964  			crt.X__builtin_abort(tls)
 25965  		}
 25966  	}()
 25967  _3:
 25968  	_i = int32(*elem52((*int16)(unsafe.Pointer(&_yy_shift_ofst)), uintptr(_stateno)))
 25969  	func() {
 25970  		if int32(_iLookAhead) == int32(252) {
 25971  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137124), unsafe.Pointer(&_yy_find_shift_actionØ00__func__Ø000), unsafe.Pointer(str(26870)))
 25972  			crt.X__builtin_abort(tls)
 25973  		}
 25974  	}()
 25975  	_i += int32(_iLookAhead)
 25976  	if _i >= int32(0) && _i < int32(1566) && int32(*elem15((*uint8)(unsafe.Pointer(&_yy_lookahead)), uintptr(_i))) == int32(_iLookAhead) {
 25977  		goto _8
 25978  	}
 25979  	if uint64(_iLookAhead) >= uint64(69) || int32(store3(&_2_iFallback, *elem15((*uint8)(unsafe.Pointer(&_yyFallback)), uintptr(_iLookAhead)))) == int32(0) {
 25980  		goto _10
 25981  	}
 25982  	if _yyTraceFILE != nil {
 25983  		crt.Xfprintf(tls, _yyTraceFILE, str(26891), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr(_iLookAhead))), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr(_2_iFallback))))
 25984  	}
 25985  	func() {
 25986  		if int32(*elem15((*uint8)(unsafe.Pointer(&_yyFallback)), uintptr(_2_iFallback))) != int32(0) {
 25987  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137137), unsafe.Pointer(&_yy_find_shift_actionØ00__func__Ø000), unsafe.Pointer(str(26912)))
 25988  			crt.X__builtin_abort(tls)
 25989  		}
 25990  	}()
 25991  	_iLookAhead = _2_iFallback
 25992  	goto _3
 25993  _10:
 25994  	_5_j = (_i - int32(_iLookAhead)) + int32(69)
 25995  	if _5_j < int32(0) || _5_j >= int32(1566) || int32(*elem15((*uint8)(unsafe.Pointer(&_yy_lookahead)), uintptr(_5_j))) != int32(69) || int32(_iLookAhead) <= int32(0) {
 25996  		goto _17
 25997  	}
 25998  	if _yyTraceFILE != nil {
 25999  		crt.Xfprintf(tls, _yyTraceFILE, str(26937), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr(_iLookAhead))), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr(69))))
 26000  	}
 26001  	return uint32(*elem20((*uint16)(unsafe.Pointer(&_yy_action)), uintptr(_5_j)))
 26002  
 26003  _17:
 26004  	return uint32(*elem20((*uint16)(unsafe.Pointer(&_yy_default)), uintptr(_stateno)))
 26005  
 26006  _8:
 26007  	return uint32(*elem20((*uint16)(unsafe.Pointer(&_yy_action)), uintptr(_i)))
 26008  }
 26009  
 26010  var _yy_find_shift_actionØ00__func__Ø000 [21]int8
 26011  
 26012  func init() {
 26013  	crt.Xstrncpy(nil, &_yy_find_shift_actionØ00__func__Ø000[0], str(26958), 21)
 26014  }
 26015  
 26016  var _yy_shift_ofst [456]int16
 26017  
 26018  func init() {
 26019  	_yy_shift_ofst = [456]int16{int16(5), int16(1117), int16(1312), int16(1128), int16(1274), int16(1274), int16(1274), int16(1274), int16(61), int16(-19), int16(57), int16(57), int16(183), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(66), int16(66), int16(201), int16(-29), int16(331), int16(318), int16(133), int16(259), int16(335), int16(411), int16(487), int16(563), int16(639), int16(689), int16(765), int16(841), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(891), int16(941), int16(891), int16(991), int16(1041), int16(1041), int16(1217), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1363), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(1274), int16(-70), int16(-47), int16(-47), int16(-47), int16(-47), int16(-47), int16(24), int16(11), int16(146), int16(296), int16(524), int16(444), int16(529), int16(529), int16(296), int16(3), int16(2), int16(-30), int16(1566), int16(1566), int16(1566), int16(-17), int16(-17), int16(-17), int16(145), int16(145), int16(497), int16(497), int16(265), int16(603), int16(653), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(701), int16(1078), int16(147), int16(147), int16(2), int16(164), int16(164), int16(164), int16(164), int16(164), int16(164), int16(1566), int16(1566), int16(1566), int16(223), int16(56), int16(56), int16(268), int16(269), int16(220), int16(347), int16(351), int16(415), int16(359), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(632), int16(632), int16(632), int16(296), int16(296), int16(498), int16(296), int16(296), int16(296), int16(570), int16(296), int16(296), int16(654), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(296), int16(636), int16(200), int16(596), int16(596), int16(596), int16(575), int16(-114), int16(971), int16(740), int16(454), int16(503), int16(503), int16(1134), int16(454), int16(1134), int16(353), int16(588), int16(628), int16(762), int16(503), int16(189), int16(762), int16(762), int16(916), int16(330), int16(668), int16(1245), int16(1167), int16(1167), int16(1255), int16(1255), int16(1167), int16(1277), int16(1230), int16(1172), int16(1291), int16(1291), int16(1291), int16(1291), int16(1167), int16(1310), int16(1172), int16(1277), int16(1230), int16(1230), int16(1172), int16(1167), int16(1310), int16(1204), int16(1299), int16(1167), int16(1167), int16(1310), int16(1335), int16(1167), int16(1310), int16(1167), int16(1310), int16(1335), int16(1258), int16(1258), int16(1258), int16(1329), int16(1335), int16(1258), int16(1273), int16(1258), int16(1329), int16(1258), int16(1258), int16(1256), int16(1288), int16(1256), int16(1288), int16(1256), int16(1288), int16(1256), int16(1288), int16(1167), int16(1375), int16(1167), int16(1267), int16(1335), int16(1320), int16(1320), int16(1335), int16(1287), int16(1295), int16(1294), int16(1301), int16(1172), int16(1407), int16(1408), int16(1422), int16(1422), int16(1433), int16(1433), int16(1433), int16(1433), int16(1566), int16(1566), int16(1566), int16(1566), int16(1566), int16(1566), int16(1566), int16(1566), int16(558), int16(537), int16(684), int16(719), int16(734), int16(799), int16(840), int16(1019), int16(14), int16(1020), int16(1021), int16(1025), int16(1026), int16(1027), int16(1070), int16(1072), int16(997), int16(1047), int16(999), int16(1079), int16(1126), int16(1074), int16(1141), int16(694), int16(819), int16(1174), int16(1136), int16(981), int16(1445), int16(1451), int16(1434), int16(1313), int16(1448), int16(1398), int16(1450), int16(1444), int16(1446), int16(1348), int16(1339), int16(1360), int16(1349), int16(1453), int16(1350), int16(1458), int16(1475), int16(1354), int16(1347), int16(1401), int16(1402), int16(1403), int16(1404), int16(1372), int16(1388), int16(1452), int16(1364), int16(1484), int16(1483), int16(1467), int16(1383), int16(1351), int16(1439), int16(1468), int16(1440), int16(1441), int16(1457), int16(1395), int16(1479), int16(1485), int16(1487), int16(1392), int16(1405), int16(1486), int16(1455), int16(1489), int16(1490), int16(1491), int16(1493), int16(1461), int16(1480), int16(1494), int16(1465), int16(1481), int16(1495), int16(1496), int16(1498), int16(1497), int16(1406), int16(1502), int16(1503), int16(1505), int16(1499), int16(1409), int16(1506), int16(1507), int16(1432), int16(1500), int16(1510), int16(1410), int16(1511), int16(1501), int16(1512), int16(1504), int16(1517), int16(1511), int16(1518), int16(1519), int16(1520), int16(1521), int16(1522), int16(1524), int16(1533), int16(1525), int16(1527), int16(1509), int16(1526), int16(1528), int16(1531), int16(1530), int16(1526), int16(1532), int16(1534), int16(1535), int16(1536), int16(1538), int16(1428), int16(1435), int16(1442), int16(1443), int16(1539), int16(1546), int16(1562)}
 26020  }
 26021  
 26022  var _yy_lookahead [1566]uint8
 26023  
 26024  func init() {
 26025  	_yy_lookahead = [1566]uint8{19, 115, 19, 117, 118, 24, 1, 2, 27, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 144, 145, 146, 147, 58, 49, 50, 79, 80, 81, 82, 22, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 221, 222, 223, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 94, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 94, 97, 108, 109, 110, 99, 100, 101, 102, 103, 104, 105, 32, 119, 120, 78, 27, 152, 112, 93, 94, 41, 88, 89, 90, 91, 92, 93, 94, 49, 50, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 58, 157, 119, 120, 163, 68, 163, 65, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 97, 88, 89, 196, 101, 196, 26, 172, 173, 96, 97, 98, 210, 100, 22, 152, 108, 109, 110, 27, 107, 27, 109, 221, 222, 223, 219, 238, 219, 49, 50, 152, 169, 170, 54, 132, 133, 134, 228, 232, 171, 231, 207, 208, 237, 132, 237, 134, 179, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 27, 65, 30, 152, 49, 50, 34, 52, 90, 91, 92, 93, 94, 96, 97, 98, 97, 22, 230, 27, 48, 217, 27, 172, 173, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 172, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 148, 149, 152, 218, 24, 152, 154, 207, 156, 172, 152, 22, 68, 27, 152, 163, 27, 164, 96, 97, 98, 99, 172, 173, 102, 103, 104, 169, 170, 49, 50, 90, 88, 89, 152, 113, 186, 96, 97, 98, 96, 97, 160, 57, 27, 101, 164, 137, 196, 139, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 11, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 132, 133, 134, 23, 218, 152, 96, 97, 98, 96, 97, 98, 230, 99, 22, 152, 102, 103, 104, 27, 244, 152, 152, 27, 26, 152, 22, 113, 65, 49, 50, 27, 194, 195, 58, 172, 173, 96, 97, 98, 185, 65, 172, 173, 206, 172, 173, 190, 191, 186, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 175, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 175, 207, 208, 23, 207, 208, 119, 120, 108, 109, 110, 27, 96, 97, 98, 116, 96, 97, 98, 152, 121, 152, 179, 180, 96, 97, 98, 250, 106, 49, 50, 188, 19, 221, 222, 223, 168, 169, 170, 172, 173, 172, 173, 250, 124, 172, 221, 222, 223, 26, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 50, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 207, 208, 12, 23, 96, 97, 98, 221, 222, 223, 194, 195, 152, 199, 23, 19, 225, 26, 28, 152, 152, 152, 206, 209, 164, 190, 191, 241, 152, 49, 50, 152, 124, 152, 44, 219, 46, 152, 21, 172, 173, 172, 173, 183, 107, 185, 16, 163, 58, 112, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 207, 130, 152, 23, 196, 64, 152, 172, 173, 22, 152, 24, 152, 98, 27, 61, 96, 63, 26, 211, 212, 186, 172, 173, 49, 50, 172, 173, 23, 49, 50, 26, 172, 173, 88, 89, 186, 24, 238, 124, 27, 238, 22, 23, 103, 187, 26, 152, 73, 74, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 101, 152, 132, 23, 134, 140, 152, 12, 97, 36, 168, 169, 170, 69, 98, 152, 22, 23, 140, 50, 26, 172, 173, 28, 51, 152, 172, 173, 193, 49, 50, 22, 59, 24, 97, 172, 173, 152, 152, 44, 124, 46, 0, 1, 2, 172, 173, 22, 23, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 69, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 152, 107, 152, 193, 49, 50, 181, 22, 23, 111, 108, 109, 110, 7, 8, 9, 16, 247, 248, 69, 172, 173, 172, 173, 152, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 152, 242, 152, 69, 152, 166, 167, 172, 173, 32, 61, 152, 63, 152, 193, 152, 152, 152, 41, 152, 172, 173, 172, 173, 172, 173, 152, 152, 152, 49, 50, 172, 173, 172, 173, 172, 173, 172, 173, 172, 173, 132, 138, 134, 152, 152, 172, 173, 172, 173, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 152, 22, 152, 195, 24, 152, 27, 172, 173, 193, 193, 152, 152, 152, 206, 152, 217, 152, 152, 152, 172, 173, 172, 173, 152, 172, 173, 152, 152, 49, 50, 172, 173, 172, 173, 172, 173, 172, 173, 172, 173, 152, 138, 152, 172, 173, 108, 109, 110, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 152, 97, 152, 152, 49, 50, 26, 193, 172, 173, 152, 152, 152, 146, 147, 132, 152, 134, 217, 181, 172, 173, 172, 173, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 152, 193, 152, 193, 49, 50, 181, 193, 172, 173, 166, 167, 245, 246, 211, 212, 152, 22, 217, 152, 172, 173, 172, 173, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 152, 187, 152, 123, 49, 50, 23, 23, 23, 26, 26, 26, 23, 23, 23, 26, 26, 26, 7, 8, 172, 173, 172, 173, 19, 90, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 152, 116, 152, 217, 49, 50, 121, 23, 172, 173, 26, 100, 101, 27, 101, 27, 23, 122, 152, 26, 172, 173, 172, 173, 152, 112, 163, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 163, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 20, 152, 22, 23, 152, 163, 65, 27, 196, 163, 19, 20, 23, 22, 213, 26, 19, 37, 27, 152, 196, 172, 173, 152, 172, 173, 27, 23, 37, 152, 26, 152, 97, 152, 97, 210, 56, 163, 196, 163, 163, 100, 196, 172, 173, 65, 152, 56, 68, 172, 173, 172, 173, 172, 173, 152, 65, 163, 163, 68, 23, 152, 234, 26, 152, 152, 172, 173, 88, 89, 196, 152, 196, 196, 152, 95, 96, 97, 98, 88, 89, 101, 152, 152, 207, 208, 95, 96, 97, 98, 196, 196, 101, 96, 233, 152, 97, 152, 152, 19, 20, 207, 22, 152, 152, 152, 191, 27, 152, 152, 152, 152, 132, 133, 134, 135, 136, 37, 152, 152, 152, 152, 152, 132, 133, 134, 135, 136, 210, 197, 210, 210, 198, 150, 184, 239, 56, 201, 214, 214, 201, 239, 180, 214, 227, 198, 38, 176, 68, 175, 175, 175, 122, 155, 200, 159, 19, 20, 40, 22, 159, 159, 22, 70, 27, 130, 243, 240, 88, 89, 90, 189, 18, 201, 37, 95, 96, 97, 98, 192, 5, 101, 192, 220, 240, 10, 11, 12, 13, 14, 159, 18, 17, 56, 158, 192, 201, 192, 220, 189, 189, 201, 159, 158, 137, 68, 31, 45, 33, 236, 159, 159, 132, 133, 134, 135, 136, 42, 158, 235, 22, 177, 159, 158, 158, 88, 89, 159, 107, 174, 55, 177, 95, 96, 97, 98, 174, 62, 101, 47, 65, 66, 106, 174, 125, 19, 20, 174, 22, 177, 176, 174, 182, 27, 216, 174, 174, 182, 107, 159, 22, 215, 215, 37, 216, 216, 216, 137, 215, 132, 133, 134, 135, 136, 215, 159, 177, 94, 177, 129, 224, 205, 56, 226, 126, 128, 203, 229, 204, 114, 229, 127, 202, 201, 68, 25, 162, 26, 13, 161, 153, 153, 6, 151, 151, 178, 151, 151, 165, 165, 178, 165, 4, 249, 88, 89, 141, 3, 142, 22, 249, 95, 96, 97, 98, 246, 15, 101, 67, 16, 23, 120, 23, 131, 111, 123, 20, 16, 125, 1, 123, 131, 78, 78, 78, 78, 111, 96, 1, 122, 35, 5, 22, 107, 140, 53, 53, 26, 132, 133, 134, 135, 136, 43, 60, 107, 24, 112, 20, 19, 52, 22, 29, 105, 22, 22, 52, 23, 22, 22, 52, 23, 23, 39, 23, 116, 26, 22, 26, 23, 22, 96, 23, 23, 122, 22, 24, 124, 35, 35, 26, 26, 35, 23, 23, 23, 23, 11, 23, 22, 26, 23, 22, 122, 23, 26, 22, 24, 23, 22, 122, 23, 23, 22, 15, 23, 1, 122, 122}
 26026  }
 26027  
 26028  var _yyFallback [69]uint8
 26029  
 26030  func init() {
 26031  	_yyFallback = [69]uint8{0, 0, 27, 27, 27, 27, 0, 27, 27, 27, 0, 27, 27, 27, 27, 0, 0, 0, 27, 0, 0, 27, 0, 0, 0, 27, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27}
 26032  }
 26033  
 26034  var _yy_action [1566]uint16
 26035  
 26036  func init() {
 26037  	_yy_action = [1566]uint16{uint16(325), uint16(411), uint16(343), uint16(752), uint16(752), uint16(203), uint16(946), uint16(354), uint16(976), uint16(98), uint16(98), uint16(98), uint16(98), uint16(91), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(1333), uint16(155), uint16(155), uint16(2), uint16(813), uint16(978), uint16(978), uint16(98), uint16(98), uint16(98), uint16(98), uint16(20), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(92), uint16(89), uint16(178), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(351), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(325), uint16(340), uint16(976), uint16(262), uint16(365), uint16(251), uint16(212), uint16(169), uint16(287), uint16(405), uint16(282), uint16(404), uint16(199), uint16(791), uint16(242), uint16(412), uint16(21), uint16(957), uint16(379), uint16(280), uint16(93), uint16(351), uint16(792), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(978), uint16(978), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(813), uint16(329), uint16(242), uint16(412), uint16(913), uint16(832), uint16(913), uint16(132), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(450), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(325), uint16(825), uint16(349), uint16(348), uint16(120), uint16(819), uint16(120), uint16(75), uint16(52), uint16(52), uint16(957), uint16(958), uint16(959), uint16(760), uint16(984), uint16(146), uint16(361), uint16(262), uint16(370), uint16(261), uint16(957), uint16(982), uint16(961), uint16(983), uint16(92), uint16(89), uint16(178), uint16(371), uint16(230), uint16(371), uint16(978), uint16(978), uint16(817), uint16(361), uint16(360), uint16(101), uint16(824), uint16(824), uint16(826), uint16(384), uint16(24), uint16(964), uint16(381), uint16(428), uint16(413), uint16(369), uint16(985), uint16(380), uint16(985), uint16(708), uint16(325), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(373), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(957), uint16(132), uint16(897), uint16(450), uint16(978), uint16(978), uint16(896), uint16(60), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(957), uint16(958), uint16(959), uint16(961), uint16(103), uint16(361), uint16(957), uint16(385), uint16(334), uint16(702), uint16(52), uint16(52), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(698), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(325), uint16(455), uint16(670), uint16(450), uint16(227), uint16(61), uint16(157), uint16(243), uint16(344), uint16(114), uint16(701), uint16(888), uint16(147), uint16(832), uint16(957), uint16(373), uint16(747), uint16(957), uint16(320), uint16(957), uint16(958), uint16(959), uint16(194), uint16(10), uint16(10), uint16(402), uint16(399), uint16(398), uint16(888), uint16(890), uint16(978), uint16(978), uint16(762), uint16(171), uint16(170), uint16(157), uint16(397), uint16(337), uint16(957), uint16(958), uint16(959), uint16(702), uint16(825), uint16(310), uint16(153), uint16(957), uint16(819), uint16(321), uint16(82), uint16(23), uint16(80), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(894), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(325), uint16(824), uint16(824), uint16(826), uint16(277), uint16(231), uint16(300), uint16(957), uint16(958), uint16(959), uint16(957), uint16(958), uint16(959), uint16(888), uint16(194), uint16(25), uint16(450), uint16(402), uint16(399), uint16(398), uint16(957), uint16(355), uint16(300), uint16(450), uint16(957), uint16(74), uint16(450), uint16(1), uint16(397), uint16(132), uint16(978), uint16(978), uint16(957), uint16(224), uint16(224), uint16(813), uint16(10), uint16(10), uint16(957), uint16(958), uint16(959), uint16(968), uint16(132), uint16(52), uint16(52), uint16(415), uint16(52), uint16(52), uint16(739), uint16(739), uint16(339), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(790), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(325), uint16(789), uint16(428), uint16(418), uint16(706), uint16(428), uint16(427), uint16(1270), uint16(1270), uint16(262), uint16(370), uint16(261), uint16(957), uint16(957), uint16(958), uint16(959), uint16(757), uint16(957), uint16(958), uint16(959), uint16(450), uint16(756), uint16(450), uint16(734), uint16(713), uint16(957), uint16(958), uint16(959), uint16(443), uint16(711), uint16(978), uint16(978), uint16(734), uint16(394), uint16(92), uint16(89), uint16(178), uint16(447), uint16(447), uint16(447), uint16(51), uint16(51), uint16(52), uint16(52), uint16(439), uint16(778), uint16(700), uint16(92), uint16(89), uint16(178), uint16(172), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(198), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(325), uint16(428), uint16(408), uint16(916), uint16(699), uint16(957), uint16(958), uint16(959), uint16(92), uint16(89), uint16(178), uint16(224), uint16(224), uint16(157), uint16(241), uint16(221), uint16(419), uint16(299), uint16(776), uint16(917), uint16(416), uint16(375), uint16(450), uint16(415), uint16(58), uint16(324), uint16(737), uint16(737), uint16(920), uint16(379), uint16(978), uint16(978), uint16(379), uint16(777), uint16(449), uint16(918), uint16(363), uint16(740), uint16(296), uint16(686), uint16(9), uint16(9), uint16(52), uint16(52), uint16(234), uint16(330), uint16(234), uint16(256), uint16(417), uint16(741), uint16(280), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(450), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(325), uint16(423), uint16(72), uint16(450), uint16(833), uint16(120), uint16(368), uint16(450), uint16(10), uint16(10), uint16(5), uint16(301), uint16(203), uint16(450), uint16(177), uint16(976), uint16(253), uint16(420), uint16(255), uint16(776), uint16(200), uint16(175), uint16(233), uint16(10), uint16(10), uint16(842), uint16(842), uint16(36), uint16(36), uint16(1299), uint16(978), uint16(978), uint16(729), uint16(37), uint16(37), uint16(349), uint16(348), uint16(425), uint16(203), uint16(260), uint16(776), uint16(976), uint16(232), uint16(937), uint16(1326), uint16(876), uint16(338), uint16(1326), uint16(422), uint16(854), uint16(857), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(268), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(325), uint16(846), uint16(450), uint16(985), uint16(818), uint16(985), uint16(1209), uint16(450), uint16(916), uint16(976), uint16(720), uint16(350), uint16(350), uint16(350), uint16(935), uint16(177), uint16(450), uint16(937), uint16(1327), uint16(254), uint16(198), uint16(1327), uint16(12), uint16(12), uint16(917), uint16(403), uint16(450), uint16(27), uint16(27), uint16(250), uint16(978), uint16(978), uint16(118), uint16(721), uint16(162), uint16(976), uint16(38), uint16(38), uint16(268), uint16(176), uint16(918), uint16(776), uint16(433), uint16(1275), uint16(946), uint16(354), uint16(39), uint16(39), uint16(317), uint16(998), uint16(325), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(935), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(450), uint16(330), uint16(450), uint16(358), uint16(978), uint16(978), uint16(717), uint16(317), uint16(936), uint16(341), uint16(900), uint16(900), uint16(387), uint16(673), uint16(674), uint16(675), uint16(275), uint16(996), uint16(318), uint16(999), uint16(40), uint16(40), uint16(41), uint16(41), uint16(268), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(450), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(325), uint16(450), uint16(356), uint16(450), uint16(999), uint16(450), uint16(692), uint16(331), uint16(42), uint16(42), uint16(791), uint16(270), uint16(450), uint16(273), uint16(450), uint16(228), uint16(450), uint16(298), uint16(450), uint16(792), uint16(450), uint16(28), uint16(28), uint16(29), uint16(29), uint16(31), uint16(31), uint16(450), uint16(817), uint16(450), uint16(978), uint16(978), uint16(43), uint16(43), uint16(44), uint16(44), uint16(45), uint16(45), uint16(11), uint16(11), uint16(46), uint16(46), uint16(893), uint16(78), uint16(893), uint16(268), uint16(268), uint16(105), uint16(105), uint16(47), uint16(47), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(450), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(325), uint16(450), uint16(117), uint16(450), uint16(749), uint16(158), uint16(450), uint16(696), uint16(48), uint16(48), uint16(229), uint16(919), uint16(450), uint16(928), uint16(450), uint16(415), uint16(450), uint16(335), uint16(450), uint16(245), uint16(450), uint16(33), uint16(33), uint16(49), uint16(49), uint16(450), uint16(50), uint16(50), uint16(246), uint16(817), uint16(978), uint16(978), uint16(34), uint16(34), uint16(122), uint16(122), uint16(123), uint16(123), uint16(124), uint16(124), uint16(56), uint16(56), uint16(268), uint16(81), uint16(249), uint16(35), uint16(35), uint16(197), uint16(196), uint16(195), uint16(325), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(450), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(450), uint16(696), uint16(450), uint16(817), uint16(978), uint16(978), uint16(975), uint16(884), uint16(106), uint16(106), uint16(268), uint16(886), uint16(268), uint16(944), uint16(2), uint16(892), uint16(268), uint16(892), uint16(336), uint16(716), uint16(53), uint16(53), uint16(107), uint16(107), uint16(325), uint16(99), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(450), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(450), uint16(746), uint16(450), uint16(742), uint16(978), uint16(978), uint16(715), uint16(267), uint16(108), uint16(108), uint16(446), uint16(331), uint16(332), uint16(133), uint16(223), uint16(175), uint16(301), uint16(225), uint16(386), uint16(933), uint16(104), uint16(104), uint16(121), uint16(121), uint16(325), uint16(99), uint16(88), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(817), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(450), uint16(347), uint16(450), uint16(167), uint16(978), uint16(978), uint16(932), uint16(815), uint16(372), uint16(319), uint16(202), uint16(202), uint16(374), uint16(263), uint16(395), uint16(202), uint16(74), uint16(208), uint16(726), uint16(727), uint16(119), uint16(119), uint16(112), uint16(112), uint16(325), uint16(407), uint16(100), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(450), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(450), uint16(757), uint16(450), uint16(345), uint16(978), uint16(978), uint16(756), uint16(278), uint16(111), uint16(111), uint16(74), uint16(719), uint16(718), uint16(709), uint16(286), uint16(883), uint16(754), uint16(1289), uint16(257), uint16(77), uint16(109), uint16(109), uint16(110), uint16(110), uint16(908), uint16(285), uint16(810), uint16(90), uint16(853), uint16(856), uint16(845), uint16(845), uint16(97), uint16(97), uint16(98), uint16(98), uint16(98), uint16(98), uint16(911), uint16(96), uint16(96), uint16(96), uint16(96), uint16(95), uint16(95), uint16(94), uint16(94), uint16(94), uint16(93), uint16(351), uint16(86), uint16(445), uint16(450), uint16(3), uint16(1202), uint16(450), uint16(745), uint16(132), uint16(352), uint16(120), uint16(689), uint16(86), uint16(445), uint16(785), uint16(3), uint16(767), uint16(202), uint16(377), uint16(448), uint16(352), uint16(907), uint16(120), uint16(55), uint16(55), uint16(450), uint16(57), uint16(57), uint16(828), uint16(879), uint16(448), uint16(450), uint16(208), uint16(450), uint16(709), uint16(450), uint16(883), uint16(237), uint16(434), uint16(436), uint16(120), uint16(440), uint16(429), uint16(362), uint16(120), uint16(54), uint16(54), uint16(132), uint16(450), uint16(434), uint16(832), uint16(52), uint16(52), uint16(26), uint16(26), uint16(30), uint16(30), uint16(382), uint16(132), uint16(409), uint16(444), uint16(832), uint16(694), uint16(264), uint16(390), uint16(116), uint16(269), uint16(272), uint16(32), uint16(32), uint16(83), uint16(84), uint16(120), uint16(274), uint16(120), uint16(120), uint16(276), uint16(85), uint16(352), uint16(452), uint16(451), uint16(83), uint16(84), uint16(819), uint16(730), uint16(714), uint16(428), uint16(430), uint16(85), uint16(352), uint16(452), uint16(451), uint16(120), uint16(120), uint16(819), uint16(378), uint16(218), uint16(281), uint16(828), uint16(783), uint16(816), uint16(86), uint16(445), uint16(410), uint16(3), uint16(763), uint16(774), uint16(431), uint16(432), uint16(352), uint16(302), uint16(303), uint16(823), uint16(697), uint16(824), uint16(824), uint16(826), uint16(827), uint16(19), uint16(448), uint16(691), uint16(680), uint16(679), uint16(681), uint16(951), uint16(824), uint16(824), uint16(826), uint16(827), uint16(19), uint16(289), uint16(159), uint16(291), uint16(293), uint16(7), uint16(316), uint16(173), uint16(259), uint16(434), uint16(805), uint16(364), uint16(252), uint16(910), uint16(376), uint16(713), uint16(295), uint16(435), uint16(168), uint16(993), uint16(400), uint16(832), uint16(284), uint16(881), uint16(880), uint16(205), uint16(954), uint16(308), uint16(927), uint16(86), uint16(445), uint16(990), uint16(3), uint16(925), uint16(333), uint16(144), uint16(130), uint16(352), uint16(72), uint16(135), uint16(59), uint16(83), uint16(84), uint16(761), uint16(137), uint16(366), uint16(802), uint16(448), uint16(85), uint16(352), uint16(452), uint16(451), uint16(139), uint16(226), uint16(819), uint16(140), uint16(156), uint16(62), uint16(315), uint16(314), uint16(313), uint16(215), uint16(311), uint16(367), uint16(393), uint16(683), uint16(434), uint16(185), uint16(141), uint16(912), uint16(142), uint16(160), uint16(148), uint16(812), uint16(875), uint16(383), uint16(189), uint16(67), uint16(832), uint16(180), uint16(389), uint16(248), uint16(895), uint16(775), uint16(219), uint16(824), uint16(824), uint16(826), uint16(827), uint16(19), uint16(247), uint16(190), uint16(266), uint16(154), uint16(391), uint16(271), uint16(191), uint16(192), uint16(83), uint16(84), uint16(682), uint16(406), uint16(733), uint16(182), uint16(322), uint16(85), uint16(352), uint16(452), uint16(451), uint16(732), uint16(183), uint16(819), uint16(342), uint16(132), uint16(181), uint16(711), uint16(731), uint16(421), uint16(76), uint16(445), uint16(705), uint16(3), uint16(323), uint16(704), uint16(283), uint16(724), uint16(352), uint16(771), uint16(703), uint16(966), uint16(723), uint16(71), uint16(204), uint16(6), uint16(288), uint16(290), uint16(448), uint16(772), uint16(770), uint16(769), uint16(79), uint16(292), uint16(824), uint16(824), uint16(826), uint16(827), uint16(19), uint16(294), uint16(297), uint16(438), uint16(346), uint16(442), uint16(102), uint16(861), uint16(753), uint16(434), uint16(238), uint16(426), uint16(73), uint16(305), uint16(239), uint16(304), uint16(326), uint16(240), uint16(424), uint16(306), uint16(307), uint16(832), uint16(213), uint16(688), uint16(22), uint16(952), uint16(453), uint16(214), uint16(216), uint16(217), uint16(454), uint16(677), uint16(115), uint16(676), uint16(671), uint16(125), uint16(126), uint16(235), uint16(127), uint16(669), uint16(327), uint16(83), uint16(84), uint16(359), uint16(353), uint16(244), uint16(166), uint16(328), uint16(85), uint16(352), uint16(452), uint16(451), uint16(134), uint16(179), uint16(819), uint16(357), uint16(113), uint16(891), uint16(811), uint16(889), uint16(136), uint16(128), uint16(138), uint16(743), uint16(258), uint16(184), uint16(906), uint16(143), uint16(145), uint16(63), uint16(64), uint16(65), uint16(66), uint16(129), uint16(909), uint16(905), uint16(187), uint16(186), uint16(8), uint16(13), uint16(188), uint16(265), uint16(898), uint16(149), uint16(202), uint16(824), uint16(824), uint16(826), uint16(827), uint16(19), uint16(388), uint16(987), uint16(150), uint16(161), uint16(285), uint16(685), uint16(392), uint16(396), uint16(151), uint16(722), uint16(193), uint16(68), uint16(14), uint16(401), uint16(279), uint16(15), uint16(69), uint16(236), uint16(831), uint16(830), uint16(131), uint16(859), uint16(751), uint16(70), uint16(16), uint16(414), uint16(755), uint16(4), uint16(784), uint16(220), uint16(222), uint16(174), uint16(152), uint16(437), uint16(779), uint16(201), uint16(17), uint16(77), uint16(74), uint16(18), uint16(874), uint16(860), uint16(858), uint16(915), uint16(863), uint16(914), uint16(207), uint16(206), uint16(941), uint16(163), uint16(210), uint16(942), uint16(209), uint16(164), uint16(441), uint16(862), uint16(165), uint16(211), uint16(829), uint16(695), uint16(87), uint16(312), uint16(309), uint16(947), uint16(1291), uint16(1290)}
 26038  }
 26039  
 26040  var _yy_default [456]uint16
 26041  
 26042  func init() {
 26043  	_yy_default = [456]uint16{uint16(1280), uint16(1270), uint16(1270), uint16(1270), uint16(1202), uint16(1202), uint16(1202), uint16(1202), uint16(1270), uint16(1096), uint16(1125), uint16(1125), uint16(1254), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1201), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1270), uint16(1100), uint16(1131), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1203), uint16(1204), uint16(1332), uint16(1332), uint16(1332), uint16(1253), uint16(1255), uint16(1141), uint16(1140), uint16(1139), uint16(1138), uint16(1236), uint16(1112), uint16(1136), uint16(1129), uint16(1133), uint16(1203), uint16(1197), uint16(1198), uint16(1196), uint16(1200), uint16(1204), uint16(1332), uint16(1132), uint16(1167), uint16(1181), uint16(1166), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1175), uint16(1180), uint16(1187), uint16(1179), uint16(1176), uint16(1169), uint16(1168), uint16(1170), uint16(1171), uint16(1332), uint16(1019), uint16(1067), uint16(1332), uint16(1332), uint16(1332), uint16(1172), uint16(1332), uint16(1173), uint16(1184), uint16(1183), uint16(1182), uint16(1261), uint16(1288), uint16(1287), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1280), uint16(1270), uint16(1025), uint16(1025), uint16(1332), uint16(1270), uint16(1270), uint16(1270), uint16(1270), uint16(1270), uint16(1270), uint16(1266), uint16(1100), uint16(1091), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1258), uint16(1256), uint16(1332), uint16(1217), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1096), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1282), uint16(1332), uint16(1231), uint16(1096), uint16(1096), uint16(1096), uint16(1098), uint16(1080), uint16(1090), uint16(1004), uint16(1135), uint16(1114), uint16(1114), uint16(1321), uint16(1135), uint16(1321), uint16(1042), uint16(1302), uint16(1039), uint16(1125), uint16(1114), uint16(1199), uint16(1125), uint16(1125), uint16(1097), uint16(1090), uint16(1332), uint16(1324), uint16(1105), uint16(1105), uint16(1323), uint16(1323), uint16(1105), uint16(1146), uint16(1070), uint16(1135), uint16(1076), uint16(1076), uint16(1076), uint16(1076), uint16(1105), uint16(1016), uint16(1135), uint16(1146), uint16(1070), uint16(1070), uint16(1135), uint16(1105), uint16(1016), uint16(1235), uint16(1318), uint16(1105), uint16(1105), uint16(1016), uint16(1210), uint16(1105), uint16(1016), uint16(1105), uint16(1016), uint16(1210), uint16(1068), uint16(1068), uint16(1068), uint16(1057), uint16(1210), uint16(1068), uint16(1042), uint16(1068), uint16(1057), uint16(1068), uint16(1068), uint16(1118), uint16(1113), uint16(1118), uint16(1113), uint16(1118), uint16(1113), uint16(1118), uint16(1113), uint16(1105), uint16(1205), uint16(1105), uint16(1332), uint16(1210), uint16(1214), uint16(1214), uint16(1210), uint16(1130), uint16(1119), uint16(1128), uint16(1126), uint16(1135), uint16(1022), uint16(1060), uint16(1285), uint16(1285), uint16(1281), uint16(1281), uint16(1281), uint16(1281), uint16(1329), uint16(1329), uint16(1266), uint16(1297), uint16(1297), uint16(1044), uint16(1044), uint16(1297), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1292), uint16(1332), uint16(1219), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1152), uint16(1332), uint16(1000), uint16(1263), uint16(1332), uint16(1332), uint16(1262), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1320), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1234), uint16(1233), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1082), uint16(1332), uint16(1332), uint16(1332), uint16(1306), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1127), uint16(1332), uint16(1120), uint16(1332), uint16(1332), uint16(1311), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1272), uint16(1332), uint16(1332), uint16(1332), uint16(1271), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1154), uint16(1332), uint16(1153), uint16(1157), uint16(1332), uint16(1010), uint16(1332)}
 26044  }
 26045  
 26046  // C comment
 26047  //  /*
 26048  //  ** Perform a shift action.
 26049  //  */
 26050  func _yy_shift(tls *crt.TLS, _yypParser *XyyParser, _yyNewState int32, _yyMajor int32, _yyMinor XToken) {
 26051  	var _yytos *XyyStackEntry
 26052  	*(*uintptr)(unsafe.Pointer(&_yypParser.Xyytos)) += uintptr(32)
 26053  	if crt.P2U(_yypParser.Xyytos) >= crt.P2U(unsafe.Pointer(elem51((*XyyStackEntry)(unsafe.Pointer(&_yypParser.Xyystack)), uintptr(100)))) {
 26054  		*(*uintptr)(unsafe.Pointer(&_yypParser.Xyytos)) += uintptr(18446744073709551584)
 26055  		_yyStackOverflow(tls, _yypParser)
 26056  		return
 26057  	}
 26058  	if _yyNewState > int32(455) {
 26059  		_yyNewState += int32(332)
 26060  	}
 26061  	_yytos = (*XyyStackEntry)(_yypParser.Xyytos)
 26062  	_yytos.Xstateno = uint16(_yyNewState)
 26063  	_yytos.Xmajor = uint8(_yyMajor)
 26064  	*(*XToken)(unsafe.Pointer(&_yytos.Xminor)) = _yyMinor
 26065  	_yyTraceShift(tls, _yypParser, _yyNewState)
 26066  }
 26067  
 26068  // C comment
 26069  //  /*
 26070  //  ** The following routine is called if the stack overflows.
 26071  //  */
 26072  func _yyStackOverflow(tls *crt.TLS, _yypParser *XyyParser) {
 26073  	var _pParse *XParse
 26074  	_pParse = (*XParse)(_yypParser.XpParse)
 26075  	if _yyTraceFILE != nil {
 26076  		crt.Xfprintf(tls, _yyTraceFILE, str(26979), unsafe.Pointer(_yyTracePrompt))
 26077  	}
 26078  _0:
 26079  	if crt.P2U(_yypParser.Xyytos) > crt.P2U(unsafe.Pointer(&_yypParser.Xyystack)) {
 26080  		_yy_pop_parser_stack(tls, _yypParser)
 26081  		goto _0
 26082  	}
 26083  	_sqlite3ErrorMsg(tls, _pParse, str(26998))
 26084  	*(**XParse)(unsafe.Pointer(&_yypParser.XpParse)) = _pParse
 26085  }
 26086  
 26087  // C comment
 26088  //  /*
 26089  //  ** Pop the parser's stack once.
 26090  //  **
 26091  //  ** If there is a destructor routine associated with the token which
 26092  //  ** is popped from the stack, then call it.
 26093  //  */
 26094  func _yy_pop_parser_stack(tls *crt.TLS, _pParser *XyyParser) {
 26095  	var _yytos *XyyStackEntry
 26096  	func() {
 26097  		if (*XyyStackEntry)(_pParser.Xyytos) == nil {
 26098  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137054), unsafe.Pointer(&_yy_pop_parser_stackØ00__func__Ø000), unsafe.Pointer(str(27020)))
 26099  			crt.X__builtin_abort(tls)
 26100  		}
 26101  	}()
 26102  	func() {
 26103  		if crt.P2U(_pParser.Xyytos) <= crt.P2U(unsafe.Pointer(&_pParser.Xyystack)) {
 26104  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137055), unsafe.Pointer(&_yy_pop_parser_stackØ00__func__Ø000), unsafe.Pointer(str(27038)))
 26105  			crt.X__builtin_abort(tls)
 26106  		}
 26107  	}()
 26108  	_yytos = postInc51((**XyyStackEntry)(unsafe.Pointer(&_pParser.Xyytos)), -32)
 26109  	if _yyTraceFILE != nil {
 26110  		crt.Xfprintf(tls, _yyTraceFILE, str(27072), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr(_yytos.Xmajor))))
 26111  	}
 26112  	_yy_destructor(tls, _pParser, _yytos.Xmajor, &_yytos.Xminor)
 26113  }
 26114  
 26115  var _yy_pop_parser_stackØ00__func__Ø000 [20]int8
 26116  
 26117  func init() {
 26118  	crt.Xstrncpy(nil, &_yy_pop_parser_stackØ00__func__Ø000[0], str(27086), 20)
 26119  }
 26120  
 26121  // C comment
 26122  //  /* The following function deletes the "minor type" or semantic value
 26123  //  ** associated with a symbol.  The symbol can be either a terminal
 26124  //  ** or nonterminal. "yymajor" is the symbol code, and "yypminor" is
 26125  //  ** a pointer to the value to be deleted.  The code used to do the
 26126  //  ** deletions is derived from the %destructor and/or %token_destructor
 26127  //  ** directives of the input grammar.
 26128  //  */
 26129  func _yy_destructor(tls *crt.TLS, _yypParser *XyyParser, _yymajor uint8, _yypminor *XYYMINORTYPE) {
 26130  	var _pParse *XParse
 26131  	_pParse = (*XParse)(_yypParser.XpParse)
 26132  	switch int32(_yymajor) {
 26133  	case int32(163):
 26134  		goto _1
 26135  	case int32(172):
 26136  		goto _5
 26137  	case int32(173):
 26138  		goto _5
 26139  	case int32(177):
 26140  		goto _7
 26141  	case int32(186):
 26142  		goto _7
 26143  	case int32(187):
 26144  		goto _7
 26145  	case int32(193):
 26146  		goto _19
 26147  	case int32(194):
 26148  		goto _1
 26149  	case int32(195):
 26150  		goto _1
 26151  	case int32(196):
 26152  		goto _23
 26153  	case int32(199):
 26154  		goto _7
 26155  	case int32(200):
 26156  		goto _19
 26157  	case int32(201):
 26158  		goto _25
 26159  	case int32(202):
 26160  		goto _7
 26161  	case int32(203):
 26162  		goto _25
 26163  	case int32(204):
 26164  		goto _7
 26165  	case int32(206):
 26166  		goto _1
 26167  	case int32(207):
 26168  		goto _7
 26169  	case int32(208):
 26170  		goto _7
 26171  	case int32(209):
 26172  		goto _7
 26173  	case int32(211):
 26174  		goto _19
 26175  	case int32(212):
 26176  		goto _19
 26177  	case int32(215):
 26178  		goto _25
 26179  	case int32(216):
 26180  		goto _32
 26181  	case int32(217):
 26182  		goto _32
 26183  	case int32(218):
 26184  		goto _7
 26185  	case int32(220):
 26186  		goto _32
 26187  	case int32(224):
 26188  		goto _7
 26189  	case int32(225):
 26190  		goto _25
 26191  	case int32(226):
 26192  		goto _7
 26193  	case int32(227):
 26194  		goto _25
 26195  	case int32(232):
 26196  		goto _35
 26197  	case int32(234):
 26198  		goto _37
 26199  	case int32(236):
 26200  		goto _25
 26201  	case int32(237):
 26202  		goto _35
 26203  	case int32(241):
 26204  		goto _25
 26205  	case int32(250):
 26206  		goto _23
 26207  	default:
 26208  		goto _38
 26209  	}
 26210  
 26211  _1:
 26212  	_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26213  	goto _39
 26214  _5:
 26215  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)((*XExprSpan)(unsafe.Pointer(_yypminor)).XpExpr))
 26216  	goto _39
 26217  _7:
 26218  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26219  	goto _39
 26220  _19:
 26221  	_sqlite3SrcListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26222  	goto _39
 26223  _23:
 26224  	_sqlite3WithDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26225  	goto _39
 26226  _25:
 26227  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26228  	goto _39
 26229  _32:
 26230  	_sqlite3IdListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26231  	goto _39
 26232  _35:
 26233  	_sqlite3DeleteTriggerStep(tls, (*Xsqlite3)(_pParse.Xdb), (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26234  	goto _39
 26235  _37:
 26236  	_sqlite3IdListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XIdList)((*t53)(unsafe.Pointer(_yypminor)).Xb))
 26237  	goto _39
 26238  _38:
 26239  	goto _39
 26240  _39:
 26241  }
 26242  
 26243  func _yyTraceShift(tls *crt.TLS, _yypParser *XyyParser, _yyNewState int32) {
 26244  	if _yyTraceFILE == nil {
 26245  		goto _0
 26246  	}
 26247  	if _yyNewState < int32(456) {
 26248  		crt.Xfprintf(tls, _yyTraceFILE, str(27106), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr((*XyyStackEntry)(_yypParser.Xyytos).Xmajor))), _yyNewState)
 26249  		goto _2
 26250  	}
 26251  	crt.Xfprintf(tls, _yyTraceFILE, str(27136), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr((*XyyStackEntry)(_yypParser.Xyytos).Xmajor))))
 26252  _2:
 26253  _0:
 26254  }
 26255  
 26256  // C comment
 26257  //  /*
 26258  //  ** Perform a reduce action and the shift that must immediately
 26259  //  ** follow the reduce.
 26260  //  */
 26261  func _yy_reduce(tls *crt.TLS, _yypParser *XyyParser, _yyruleno uint32) {
 26262  	var _yygoto, _yyact, _yysize, _81_i, _163_bNot, _164_bNot int32
 26263  	var _147_n uint32
 26264  	var _81_z *int8
 26265  	var _75_x, _80_s, _148_t, _209_all XToken
 26266  	var _75_pFrom, _185_pSrc *XSrcList
 26267  	var _105_pNew, _105_pOld *TSrcList_item
 26268  	var _158_pList, _163_pList, _164_pList, _173_pList *XExprList
 26269  	var _71_p, _74_pRhs, _74_pLhs, _85_pRight, _85_pLeft, _106_pSubquery, _185_pSelect *XSelect
 26270  	var _92_p, _93_pRight, _93_pLeft, _93_pDot, _143_temp1, _143_temp2, _144_temp1, _144_temp2, _144_temp3, _144_temp4, _178_pRHS, _186_p *XExpr
 26271  	var _pParse *XParse
 26272  	var _34_v, _35_v XExprSpan
 26273  	var _70_dest XSelectDest
 26274  	var _4_yylhsminor XYYMINORTYPE
 26275  	var _yymsp *XyyStackEntry
 26276  	_pParse = (*XParse)(_yypParser.XpParse)
 26277  	_yymsp = (*XyyStackEntry)(_yypParser.Xyytos)
 26278  	if (_yyTraceFILE != nil) && (_yyruleno < uint32(332)) {
 26279  		_yysize = int32(elem54((*t55)(unsafe.Pointer(&_yyRuleInfo)), uintptr(_yyruleno)).Xnrhs)
 26280  		crt.Xfprintf(tls, _yyTraceFILE, str(27150), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyRuleName)), uintptr(_yyruleno))), int32(elem51(_yymsp, uintptr(-_yysize)).Xstateno))
 26281  	}
 26282  	if int32(elem54((*t55)(unsafe.Pointer(&_yyRuleInfo)), uintptr(_yyruleno)).Xnrhs) != int32(0) {
 26283  		goto _2
 26284  	}
 26285  	if crt.P2U(_yypParser.Xyytos) >= crt.P2U(unsafe.Pointer(elem51((*XyyStackEntry)(unsafe.Pointer(&_yypParser.Xyystack)), uintptr(99)))) {
 26286  		_yyStackOverflow(tls, _yypParser)
 26287  		return
 26288  	}
 26289  _2:
 26290  	switch _yyruleno {
 26291  	case uint32(0):
 26292  		goto _5
 26293  	case uint32(1):
 26294  		goto _6
 26295  	case uint32(2):
 26296  		goto _7
 26297  	case uint32(3):
 26298  		goto _8
 26299  	case uint32(4):
 26300  		goto _9
 26301  	case uint32(5):
 26302  		goto _10
 26303  	case uint32(6):
 26304  		goto _10
 26305  	case uint32(7):
 26306  		goto _10
 26307  	case uint32(8):
 26308  		goto _13
 26309  	case uint32(9):
 26310  		goto _13
 26311  	case uint32(10):
 26312  		goto _15
 26313  	case uint32(11):
 26314  		goto _16
 26315  	case uint32(12):
 26316  		goto _17
 26317  	case uint32(13):
 26318  		goto _18
 26319  	case uint32(14):
 26320  		goto _19
 26321  	case uint32(15):
 26322  		goto _20
 26323  	case uint32(16):
 26324  		goto _21
 26325  	case uint32(17):
 26326  		goto _30
 26327  	case uint32(18):
 26328  		goto _31
 26329  	case uint32(19):
 26330  		goto _21
 26331  	case uint32(20):
 26332  		goto _33
 26333  	case uint32(21):
 26334  		goto _34
 26335  	case uint32(22):
 26336  		goto _21
 26337  	case uint32(23):
 26338  		goto _35
 26339  	case uint32(24):
 26340  		goto _36
 26341  	case uint32(25):
 26342  		goto _37
 26343  	case uint32(26):
 26344  		goto _40
 26345  	case uint32(27):
 26346  		goto _41
 26347  	case uint32(28):
 26348  		goto _42
 26349  	case uint32(29):
 26350  		goto _43
 26351  	case uint32(30):
 26352  		goto _45
 26353  	case uint32(31):
 26354  		goto _47
 26355  	case uint32(32):
 26356  		goto _45
 26357  	case uint32(33):
 26358  		goto _48
 26359  	case uint32(34):
 26360  		goto _49
 26361  	case uint32(35):
 26362  		goto _50
 26363  	case uint32(36):
 26364  		goto _51
 26365  	case uint32(37):
 26366  		goto _52
 26367  	case uint32(38):
 26368  		goto _53
 26369  	case uint32(39):
 26370  		goto _54
 26371  	case uint32(40):
 26372  		goto _55
 26373  	case uint32(41):
 26374  		goto _56
 26375  	case uint32(42):
 26376  		goto _21
 26377  	case uint32(43):
 26378  		goto _31
 26379  	case uint32(44):
 26380  		goto _57
 26381  	case uint32(45):
 26382  		goto _58
 26383  	case uint32(46):
 26384  		goto _59
 26385  	case uint32(47):
 26386  		goto _60
 26387  	case uint32(48):
 26388  		goto _61
 26389  	case uint32(49):
 26390  		goto _62
 26391  	case uint32(50):
 26392  		goto _63
 26393  	case uint32(51):
 26394  		goto _64
 26395  	case uint32(52):
 26396  		goto _65
 26397  	case uint32(53):
 26398  		goto _66
 26399  	case uint32(54):
 26400  		goto _67
 26401  	case uint32(55):
 26402  		goto _68
 26403  	case uint32(56):
 26404  		goto _69
 26405  	case uint32(57):
 26406  		goto _21
 26407  	case uint32(58):
 26408  		goto _72
 26409  	case uint32(59):
 26410  		goto _77
 26411  	case uint32(60):
 26412  		goto _37
 26413  	case uint32(61):
 26414  		goto _78
 26415  	case uint32(62):
 26416  		goto _43
 26417  	case uint32(63):
 26418  		goto _79
 26419  	case uint32(64):
 26420  		goto _80
 26421  	case uint32(65):
 26422  		goto _81
 26423  	case uint32(66):
 26424  		goto _82
 26425  	case uint32(67):
 26426  		goto _21
 26427  	case uint32(68):
 26428  		goto _83
 26429  	case uint32(69):
 26430  		goto _85
 26431  	case uint32(70):
 26432  		goto _83
 26433  	case uint32(71):
 26434  		goto _69
 26435  	case uint32(72):
 26436  		goto _86
 26437  	case uint32(73):
 26438  		goto _87
 26439  	case uint32(74):
 26440  		goto _89
 26441  	case uint32(75):
 26442  		goto _72
 26443  	case uint32(76):
 26444  		goto _21
 26445  	case uint32(77):
 26446  		goto _90
 26447  	case uint32(78):
 26448  		goto _91
 26449  	case uint32(79):
 26450  		goto _92
 26451  	case uint32(80):
 26452  		goto _93
 26453  	case uint32(81):
 26454  		goto _94
 26455  	case uint32(82):
 26456  		goto _95
 26457  	case uint32(83):
 26458  		goto _97
 26459  	case uint32(84):
 26460  		goto _95
 26461  	case uint32(85):
 26462  		goto _98
 26463  	case uint32(86):
 26464  		goto _99
 26465  	case uint32(87):
 26466  		goto _100
 26467  	case uint32(88):
 26468  		goto _101
 26469  	case uint32(89):
 26470  		goto _102
 26471  	case uint32(90):
 26472  		goto _21
 26473  	case uint32(91):
 26474  		goto _103
 26475  	case uint32(92):
 26476  		goto _109
 26477  	case uint32(93):
 26478  		goto _110
 26479  	case uint32(94):
 26480  		goto _111
 26481  	case uint32(95):
 26482  		goto _112
 26483  	case uint32(96):
 26484  		goto _37
 26485  	case uint32(97):
 26486  		goto _116
 26487  	case uint32(98):
 26488  		goto _117
 26489  	case uint32(99):
 26490  		goto _118
 26491  	case uint32(100):
 26492  		goto _119
 26493  	case uint32(101):
 26494  		goto _120
 26495  	case uint32(102):
 26496  		goto _121
 26497  	case uint32(103):
 26498  		goto _122
 26499  	case uint32(104):
 26500  		goto _123
 26501  	case uint32(105):
 26502  		goto _124
 26503  	case uint32(106):
 26504  		goto _112
 26505  	case uint32(107):
 26506  		goto _126
 26507  	case uint32(108):
 26508  		goto _127
 26509  	case uint32(109):
 26510  		goto _128
 26511  	case uint32(110):
 26512  		goto _129
 26513  	case uint32(111):
 26514  		goto _130
 26515  	case uint32(112):
 26516  		goto _131
 26517  	case uint32(113):
 26518  		goto _135
 26519  	case uint32(114):
 26520  		goto _124
 26521  	case uint32(115):
 26522  		goto _140
 26523  	case uint32(116):
 26524  		goto _141
 26525  	case uint32(117):
 26526  		goto _142
 26527  	case uint32(118):
 26528  		goto _143
 26529  	case uint32(119):
 26530  		goto _103
 26531  	case uint32(120):
 26532  		goto _145
 26533  	case uint32(121):
 26534  		goto _147
 26535  	case uint32(122):
 26536  		goto _148
 26537  	case uint32(123):
 26538  		goto _149
 26539  	case uint32(124):
 26540  		goto _150
 26541  	case uint32(125):
 26542  		goto _151
 26543  	case uint32(126):
 26544  		goto _103
 26545  	case uint32(127):
 26546  		goto _145
 26547  	case uint32(128):
 26548  		goto _135
 26549  	case uint32(129):
 26550  		goto _131
 26551  	case uint32(130):
 26552  		goto _152
 26553  	case uint32(131):
 26554  		goto _153
 26555  	case uint32(132):
 26556  		goto _154
 26557  	case uint32(133):
 26558  		goto _155
 26559  	case uint32(134):
 26560  		goto _156
 26561  	case uint32(135):
 26562  		goto _135
 26563  	case uint32(136):
 26564  		goto _131
 26565  	case uint32(137):
 26566  		goto _157
 26567  	case uint32(138):
 26568  		goto _158
 26569  	case uint32(139):
 26570  		goto _159
 26571  	case uint32(140):
 26572  		goto _160
 26573  	case uint32(141):
 26574  		goto _161
 26575  	case uint32(142):
 26576  		goto _162
 26577  	case uint32(143):
 26578  		goto _163
 26579  	case uint32(144):
 26580  		goto _69
 26581  	case uint32(145):
 26582  		goto _87
 26583  	case uint32(146):
 26584  		goto _143
 26585  	case uint32(147):
 26586  		goto _164
 26587  	case uint32(148):
 26588  		goto _165
 26589  	case uint32(149):
 26590  		goto _166
 26591  	case uint32(150):
 26592  		goto _167
 26593  	case uint32(151):
 26594  		goto _168
 26595  	case uint32(152):
 26596  		goto _171
 26597  	case uint32(153):
 26598  		goto _171
 26599  	case uint32(154):
 26600  		goto _173
 26601  	case uint32(155):
 26602  		goto _174
 26603  	case uint32(156):
 26604  		goto _168
 26605  	case uint32(157):
 26606  		goto _168
 26607  	case uint32(158):
 26608  		goto _175
 26609  	case uint32(159):
 26610  		goto _176
 26611  	case uint32(160):
 26612  		goto _177
 26613  	case uint32(161):
 26614  		goto _178
 26615  	case uint32(162):
 26616  		goto _179
 26617  	case uint32(163):
 26618  		goto _180
 26619  	case uint32(164):
 26620  		goto _181
 26621  	case uint32(165):
 26622  		goto _182
 26623  	case uint32(166):
 26624  		goto _183
 26625  	case uint32(167):
 26626  		goto _183
 26627  	case uint32(168):
 26628  		goto _183
 26629  	case uint32(169):
 26630  		goto _183
 26631  	case uint32(170):
 26632  		goto _183
 26633  	case uint32(171):
 26634  		goto _183
 26635  	case uint32(172):
 26636  		goto _183
 26637  	case uint32(173):
 26638  		goto _183
 26639  	case uint32(174):
 26640  		goto _191
 26641  	case uint32(175):
 26642  		goto _192
 26643  	case uint32(176):
 26644  		goto _193
 26645  	case uint32(177):
 26646  		goto _194
 26647  	case uint32(178):
 26648  		goto _195
 26649  	case uint32(179):
 26650  		goto _196
 26651  	case uint32(180):
 26652  		goto _197
 26653  	case uint32(181):
 26654  		goto _198
 26655  	case uint32(182):
 26656  		goto _198
 26657  	case uint32(183):
 26658  		goto _200
 26659  	case uint32(184):
 26660  		goto _201
 26661  	case uint32(185):
 26662  		goto _202
 26663  	case uint32(186):
 26664  		goto _72
 26665  	case uint32(187):
 26666  		goto _204
 26667  	case uint32(188):
 26668  		goto _202
 26669  	case uint32(189):
 26670  		goto _72
 26671  	case uint32(190):
 26672  		goto _205
 26673  	case uint32(191):
 26674  		goto _206
 26675  	case uint32(192):
 26676  		goto _207
 26677  	case uint32(193):
 26678  		goto _208
 26679  	case uint32(194):
 26680  		goto _209
 26681  	case uint32(195):
 26682  		goto _210
 26683  	case uint32(196):
 26684  		goto _211
 26685  	case uint32(197):
 26686  		goto _212
 26687  	case uint32(198):
 26688  		goto _131
 26689  	case uint32(199):
 26690  		goto _135
 26691  	case uint32(200):
 26692  		goto _213
 26693  	case uint32(201):
 26694  		goto _135
 26695  	case uint32(202):
 26696  		goto _103
 26697  	case uint32(203):
 26698  		goto _214
 26699  	case uint32(204):
 26700  		goto _215
 26701  	case uint32(205):
 26702  		goto _103
 26703  	case uint32(206):
 26704  		goto _216
 26705  	case uint32(207):
 26706  		goto _218
 26707  	case uint32(208):
 26708  		goto _219
 26709  	case uint32(209):
 26710  		goto _221
 26711  	case uint32(210):
 26712  		goto _103
 26713  	case uint32(211):
 26714  		goto _216
 26715  	case uint32(212):
 26716  		goto _222
 26717  	case uint32(213):
 26718  		goto _223
 26719  	case uint32(214):
 26720  		goto _21
 26721  	case uint32(215):
 26722  		goto _72
 26723  	case uint32(216):
 26724  		goto _224
 26725  	case uint32(217):
 26726  		goto _225
 26727  	case uint32(218):
 26728  		goto _226
 26729  	case uint32(219):
 26730  		goto _227
 26731  	case uint32(220):
 26732  		goto _228
 26733  	case uint32(221):
 26734  		goto _229
 26735  	case uint32(222):
 26736  		goto _230
 26737  	case uint32(223):
 26738  		goto _231
 26739  	case uint32(224):
 26740  		goto _112
 26741  	case uint32(225):
 26742  		goto _112
 26743  	case uint32(226):
 26744  		goto _232
 26745  	case uint32(227):
 26746  		goto _233
 26747  	case uint32(228):
 26748  		goto _234
 26749  	case uint32(229):
 26750  		goto _235
 26751  	case uint32(230):
 26752  		goto _236
 26753  	case uint32(231):
 26754  		goto _237
 26755  	case uint32(232):
 26756  		goto _238
 26757  	case uint32(233):
 26758  		goto _238
 26759  	case uint32(234):
 26760  		goto _240
 26761  	case uint32(235):
 26762  		goto _241
 26763  	case uint32(236):
 26764  		goto _243
 26765  	case uint32(237):
 26766  		goto _245
 26767  	case uint32(238):
 26768  		goto _246
 26769  	case uint32(239):
 26770  		goto _247
 26771  	case uint32(240):
 26772  		goto _248
 26773  	case uint32(241):
 26774  		goto _249
 26775  	case uint32(242):
 26776  		goto _250
 26777  	case uint32(243):
 26778  		goto _251
 26779  	case uint32(244):
 26780  		goto _252
 26781  	case uint32(245):
 26782  		goto _253
 26783  	case uint32(246):
 26784  		goto _254
 26785  	case uint32(247):
 26786  		goto _255
 26787  	case uint32(248):
 26788  		goto _256
 26789  	case uint32(249):
 26790  		goto _219
 26791  	case uint32(250):
 26792  		goto _257
 26793  	case uint32(251):
 26794  		goto _258
 26795  	case uint32(252):
 26796  		goto _259
 26797  	case uint32(253):
 26798  		goto _260
 26799  	case uint32(254):
 26800  		goto _241
 26801  	case uint32(255):
 26802  		goto _243
 26803  	case uint32(256):
 26804  		goto _261
 26805  	case uint32(257):
 26806  		goto _262
 26807  	case uint32(258):
 26808  		goto _263
 26809  	case uint32(259):
 26810  		goto _264
 26811  	case uint32(260):
 26812  		goto _265
 26813  	case uint32(261):
 26814  		goto _266
 26815  	case uint32(262):
 26816  		goto _267
 26817  	case uint32(263):
 26818  		goto _268
 26819  	case uint32(264):
 26820  		goto _269
 26821  	case uint32(265):
 26822  		goto _270
 26823  	case uint32(266):
 26824  		goto _271
 26825  	case uint32(267):
 26826  		goto _272
 26827  	case uint32(268):
 26828  		goto _272
 26829  	case uint32(269):
 26830  		goto _272
 26831  	case uint32(270):
 26832  		goto _275
 26833  	case uint32(271):
 26834  		goto _276
 26835  	case uint32(272):
 26836  		goto _277
 26837  	case uint32(273):
 26838  		goto _278
 26839  	case uint32(274):
 26840  		goto _279
 26841  	default:
 26842  		goto _280
 26843  	}
 26844  
 26845  _5:
 26846  	_pParse.Xexplain = uint8(1)
 26847  	goto _281
 26848  _6:
 26849  	_pParse.Xexplain = uint8(2)
 26850  	goto _281
 26851  _7:
 26852  	_sqlite3FinishCoding(tls, _pParse)
 26853  	goto _281
 26854  _8:
 26855  	_sqlite3BeginTransaction(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 26856  	goto _281
 26857  _9:
 26858  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))) = int32(7)
 26859  	goto _281
 26860  _10:
 26861  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(elem51(_yymsp, 0).Xmajor)
 26862  	goto _281
 26863  _13:
 26864  	_sqlite3CommitTransaction(tls, _pParse)
 26865  	goto _281
 26866  _15:
 26867  	_sqlite3RollbackTransaction(tls, _pParse)
 26868  	goto _281
 26869  _16:
 26870  	_sqlite3Savepoint(tls, _pParse, int32(0), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 26871  	goto _281
 26872  _17:
 26873  	_sqlite3Savepoint(tls, _pParse, int32(1), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 26874  	goto _281
 26875  _18:
 26876  	_sqlite3Savepoint(tls, _pParse, int32(2), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 26877  	goto _281
 26878  _19:
 26879  	_sqlite3StartTable(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), int32(0), int32(0), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))
 26880  	goto _281
 26881  _20:
 26882  	_disableLookaside(tls, _pParse)
 26883  	goto _281
 26884  _21:
 26885  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))) = int32(0)
 26886  	goto _281
 26887  _30:
 26888  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))) = int32(1)
 26889  	goto _281
 26890  _31:
 26891  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(1)
 26892  	goto _281
 26893  _33:
 26894  	_sqlite3EndTable(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), uint8(*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), nil)
 26895  	goto _281
 26896  _34:
 26897  	_sqlite3EndTable(tls, _pParse, nil, nil, 0, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 26898  	_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 26899  	goto _281
 26900  _35:
 26901  	if (((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn) == uint32(5)) && (Xsqlite3_strnicmp(tls, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz, str(27182), int32(5)) == int32(0)) {
 26902  		*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = int32(96)
 26903  		goto _284
 26904  	}
 26905  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = int32(0)
 26906  	_sqlite3ErrorMsg(tls, _pParse, str(27188), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn, unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz))
 26907  _284:
 26908  	goto _281
 26909  _36:
 26910  	_sqlite3AddColumn(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 26911  	goto _281
 26912  _37:
 26913  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))).Xn = 0
 26914  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))).Xz = nil
 26915  	goto _281
 26916  _40:
 26917  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).Xn = uint32(int32(int64(uintptr(unsafe.Pointer(elem1((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn)))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).Xz)))))
 26918  	goto _281
 26919  _41:
 26920  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))).Xn = uint32(int32(int64(uintptr(unsafe.Pointer(elem1((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn)))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))).Xz)))))
 26921  	goto _281
 26922  _42:
 26923  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xn = ((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn) + uint32(int32(int64(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xz)))))
 26924  	goto _281
 26925  _43:
 26926  	_pParse.XconstraintName = *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))
 26927  	goto _281
 26928  _45:
 26929  	_sqlite3AddDefaultValue(tls, _pParse, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 26930  	goto _281
 26931  _47:
 26932  	_sqlite3AddDefaultValue(tls, _pParse, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 26933  	goto _281
 26934  _48:
 26935  	*(**XExpr)(unsafe.Pointer(&_34_v.XpExpr)) = _sqlite3PExpr(tls, _pParse, int32(155), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr), nil)
 26936  	_34_v.XzStart = (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xz
 26937  	_34_v.XzEnd = (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XzEnd
 26938  	_sqlite3AddDefaultValue(tls, _pParse, &_34_v)
 26939  	goto _281
 26940  _49:
 26941  	_spanExpr(tls, &_35_v, _pParse, int32(97), *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 26942  	_sqlite3AddDefaultValue(tls, _pParse, &_35_v)
 26943  	goto _281
 26944  _50:
 26945  	_sqlite3AddNotNull(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 26946  	goto _281
 26947  _51:
 26948  	_sqlite3AddPrimaryKey(tls, _pParse, nil, *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))
 26949  	goto _281
 26950  _52:
 26951  	_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, nil, *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), nil, nil, int32(0), int32(0), uint8(1))
 26952  	goto _281
 26953  _53:
 26954  	_sqlite3AddCheckConstraint(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).XpExpr))
 26955  	goto _281
 26956  _54:
 26957  	_sqlite3CreateForeignKey(tls, _pParse, nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 26958  	goto _281
 26959  _55:
 26960  	_sqlite3DeferForeignKey(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 26961  	goto _281
 26962  _56:
 26963  	_sqlite3AddCollateType(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 26964  	goto _281
 26965  _57:
 26966  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))) = int32(0)
 26967  	goto _281
 26968  _58:
 26969  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = ((*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))) & (^((*t56)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xmask))) | ((*t56)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xvalue)
 26970  	goto _281
 26971  _59:
 26972  	(*t56)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xvalue = int32(0)
 26973  	(*t56)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xmask = int32(0)
 26974  	goto _281
 26975  _60:
 26976  	(*t56)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xvalue = int32(0)
 26977  	(*t56)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xmask = int32(0)
 26978  	goto _281
 26979  _61:
 26980  	(*t56)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xvalue = *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))
 26981  	(*t56)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xmask = int32(255)
 26982  	goto _281
 26983  _62:
 26984  	(*t56)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xvalue = (*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))) << 8
 26985  	(*t56)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xmask = int32(65280)
 26986  	goto _281
 26987  _63:
 26988  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = int32(7)
 26989  	goto _281
 26990  _64:
 26991  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = int32(8)
 26992  	goto _281
 26993  _65:
 26994  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(9)
 26995  	goto _281
 26996  _66:
 26997  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(6)
 26998  	goto _281
 26999  _67:
 27000  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = int32(0)
 27001  	goto _281
 27002  _68:
 27003  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))) = int32(0)
 27004  	goto _281
 27005  _69:
 27006  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))
 27007  	goto _281
 27008  _72:
 27009  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = int32(1)
 27010  	goto _281
 27011  _77:
 27012  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = int32(0)
 27013  	goto _281
 27014  _78:
 27015  	_pParse.XconstraintName.Xn = 0
 27016  	goto _281
 27017  _79:
 27018  	_sqlite3AddPrimaryKey(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), int32(0))
 27019  	goto _281
 27020  _80:
 27021  	_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), nil, nil, int32(0), int32(0), uint8(1))
 27022  	goto _281
 27023  _81:
 27024  	_sqlite3AddCheckConstraint(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))
 27025  	goto _281
 27026  _82:
 27027  	_sqlite3CreateForeignKey(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27028  	_sqlite3DeferForeignKey(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27029  	goto _281
 27030  _83:
 27031  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))) = int32(10)
 27032  	goto _281
 27033  _85:
 27034  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))) = *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))
 27035  	goto _281
 27036  _86:
 27037  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(4)
 27038  	goto _281
 27039  _87:
 27040  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(5)
 27041  	goto _281
 27042  _89:
 27043  	_sqlite3DropTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), int32(0), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27044  	goto _281
 27045  _90:
 27046  	_sqlite3CreateView(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551609)).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))))
 27047  	goto _281
 27048  _91:
 27049  	_sqlite3DropTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), int32(1), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27050  	goto _281
 27051  _92:
 27052  	_70_dest = XSelectDest{XeDest: uint8(9)}
 27053  	_sqlite3Select(tls, _pParse, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), &_70_dest)
 27054  	_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27055  	goto _281
 27056  _93:
 27057  	_71_p = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27058  	if _71_p != nil {
 27059  		*(**XWith)(unsafe.Pointer(&_71_p.XpWith)) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27060  		_parserDoubleLinkSelect(tls, _pParse, _71_p)
 27061  		goto _286
 27062  	}
 27063  	_sqlite3WithDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27064  _286:
 27065  	*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))) = _71_p
 27066  	goto _281
 27067  _94:
 27068  	_74_pRhs = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27069  	_74_pLhs = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))
 27070  	if (_74_pRhs != nil) && (_74_pRhs.XpPrior != nil) {
 27071  		_75_x.Xn = 0
 27072  		_parserDoubleLinkSelect(tls, _pParse, _74_pRhs)
 27073  		_75_pFrom = _sqlite3SrcListAppendFromTerm(tls, _pParse, nil, nil, nil, &_75_x, _74_pRhs, nil, nil)
 27074  		_74_pRhs = _sqlite3SelectNew(tls, _pParse, nil, _75_pFrom, nil, nil, nil, nil, 0, nil, nil)
 27075  	}
 27076  	if _74_pRhs == nil {
 27077  		goto _289
 27078  	}
 27079  	_74_pRhs.Xop = uint8(*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27080  	*(**XSelect)(unsafe.Pointer(&_74_pRhs.XpPrior)) = _74_pLhs
 27081  	if func() int32 {
 27082  		if _74_pLhs != nil {
 27083  			return int32(1)
 27084  		}
 27085  		return func() int32 {
 27086  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137979), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(4809)))
 27087  			crt.X__builtin_abort(tls)
 27088  			return int32(0)
 27089  		}()
 27090  	}() != 0 {
 27091  		_74_pLhs.XselFlags &= uint32(4294966271)
 27092  	}
 27093  	_74_pRhs.XselFlags &= uint32(4294966271)
 27094  	if (*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))) != int32(116) {
 27095  		_pParse.XhasCompound = uint8(1)
 27096  	}
 27097  	goto _294
 27098  _289:
 27099  	_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.Xdb), _74_pLhs)
 27100  _294:
 27101  	*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))) = _74_pRhs
 27102  	goto _281
 27103  _95:
 27104  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(elem51(_yymsp, 0).Xmajor)
 27105  	goto _281
 27106  _97:
 27107  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = int32(116)
 27108  	goto _281
 27109  _98:
 27110  	_80_s = *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor)))
 27111  	*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor))))) = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), uint32(*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551609)).Xminor)))), (*XExpr)((*t57)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpLimit), (*XExpr)((*t57)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpOffset))
 27112  	if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor)))) == nil {
 27113  		goto _295
 27114  	}
 27115  	_81_z = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_80_s.Xz)) + uintptr(int32(6))))
 27116  	Xsqlite3_snprintf(tls, int32(12), (*int8)(unsafe.Pointer(&((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor)))).XzSelName))), str(27215), preInc2(&_pParse.XnSelect, 1))
 27117  _296:
 27118  	if int32(*elem1(_81_z, 0)) == int32(32) {
 27119  		*(*uintptr)(unsafe.Pointer(&_81_z)) += uintptr(1)
 27120  		goto _296
 27121  	}
 27122  	if int32(*elem1(_81_z, 0)) != int32(47) || int32(*elem1(_81_z, uintptr(1))) != int32(42) {
 27123  		goto _299
 27124  	}
 27125  	*(*uintptr)(unsafe.Pointer(&_81_z)) += uintptr(int32(2))
 27126  _300:
 27127  	if int32(*elem1(_81_z, 0)) == int32(32) {
 27128  		*(*uintptr)(unsafe.Pointer(&_81_z)) += uintptr(1)
 27129  		goto _300
 27130  	}
 27131  	_81_i = int32(0)
 27132  _302:
 27133  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_81_z, uintptr(_81_i)))))) & int32(6)) == 0 {
 27134  		goto _305
 27135  	}
 27136  	_81_i += 1
 27137  	goto _302
 27138  _305:
 27139  	Xsqlite3_snprintf(tls, int32(12), (*int8)(unsafe.Pointer(&((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor)))).XzSelName))), str(27219), _81_i, unsafe.Pointer(_81_z))
 27140  _299:
 27141  _295:
 27142  	goto _281
 27143  _99:
 27144  	*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))) = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), nil, nil, nil, nil, nil, uint32(512), nil, nil)
 27145  	goto _281
 27146  _100:
 27147  	_85_pLeft = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))
 27148  	_85_pRight = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), nil, nil, nil, nil, nil, uint32(1536), nil, nil)
 27149  	if func() int32 {
 27150  		if _85_pLeft != nil {
 27151  			return int32(1)
 27152  		}
 27153  		return func() int32 {
 27154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138036), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(4809)))
 27155  			crt.X__builtin_abort(tls)
 27156  			return int32(0)
 27157  		}()
 27158  	}() != 0 {
 27159  		_85_pLeft.XselFlags &= uint32(4294966271)
 27160  	}
 27161  	if _85_pRight != nil {
 27162  		_85_pRight.Xop = uint8(116)
 27163  		*(**XSelect)(unsafe.Pointer(&_85_pRight.XpPrior)) = _85_pLeft
 27164  		*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))) = _85_pRight
 27165  		goto _310
 27166  	}
 27167  	*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))) = _85_pLeft
 27168  _310:
 27169  	goto _281
 27170  _101:
 27171  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(1)
 27172  	goto _281
 27173  _102:
 27174  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(2)
 27175  	goto _281
 27176  _103:
 27177  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))))) = nil
 27178  	goto _281
 27179  _109:
 27180  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).XpExpr))
 27181  	if ((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn) > (0) {
 27182  		_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), int32(1))
 27183  	}
 27184  	_sqlite3ExprListSetSpan(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27185  	goto _281
 27186  _110:
 27187  	_92_p = _sqlite3Expr(tls, (*Xsqlite3)(_pParse.Xdb), int32(161), nil)
 27188  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), _92_p)
 27189  	goto _281
 27190  _111:
 27191  	_93_pRight = _sqlite3PExpr(tls, _pParse, int32(161), nil, nil)
 27192  	_93_pLeft = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), int32(1))
 27193  	_93_pDot = _sqlite3PExpr(tls, _pParse, int32(122), _93_pLeft, _93_pRight)
 27194  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), _93_pDot)
 27195  	goto _281
 27196  _112:
 27197  	*(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))
 27198  	goto _281
 27199  _116:
 27200  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))))) = (*XSrcList)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), uint64(120)))
 27201  	goto _281
 27202  _117:
 27203  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))) = (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27204  	_sqlite3SrcListShiftJoinType(tls, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27205  	goto _281
 27206  _118:
 27207  	if func() int32 {
 27208  		if ((*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))) != nil) && (((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))).XnSrc) > int32(0)) {
 27209  			return int32(1)
 27210  		}
 27211  		return func() int32 {
 27212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138098), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(4809)))
 27213  			crt.X__builtin_abort(tls)
 27214  			return int32(0)
 27215  		}()
 27216  	}() != 0 {
 27217  		(elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))).Xa))), uintptr(((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))).XnSrc)-int32(1))).Xfg).Xjointype = uint8(*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27218  	}
 27219  	goto _281
 27220  _119:
 27221  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))))) = nil
 27222  	goto _281
 27223  _120:
 27224  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27225  	_sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))
 27226  	goto _281
 27227  _121:
 27228  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551609)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27229  	_sqlite3SrcListFuncArgs(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor)))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))))
 27230  	goto _281
 27231  _122:
 27232  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))), nil, nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27233  	goto _281
 27234  _123:
 27235  	if ((((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))) == nil) && (((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xn) == (0))) && ((*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))) == nil)) && ((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))) == nil) {
 27236  		*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))))) = (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))
 27237  		goto _323
 27238  	}
 27239  	if ((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))).XnSrc) != int32(1) {
 27240  		goto _321
 27241  	}
 27242  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))), nil, nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27243  	if (*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))) != nil {
 27244  		_105_pNew = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))).Xa))), uintptr(((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))).XnSrc)-int32(1)))
 27245  		_105_pOld = (*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))).Xa)))
 27246  		_105_pNew.XzName = _105_pOld.XzName
 27247  		_105_pNew.XzDatabase = _105_pOld.XzDatabase
 27248  		*(**XSelect)(unsafe.Pointer(&_105_pNew.XpSelect)) = (*XSelect)(_105_pOld.XpSelect)
 27249  		_105_pOld.XzName = store1(&_105_pOld.XzDatabase, nil)
 27250  		*(**XSelect)(unsafe.Pointer(&_105_pOld.XpSelect)) = nil
 27251  	}
 27252  	_sqlite3SrcListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))))
 27253  	goto _323
 27254  _321:
 27255  	_sqlite3SrcListShiftJoinType(tls, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))))
 27256  	_106_pSubquery = _sqlite3SelectNew(tls, _pParse, nil, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), nil, nil, nil, nil, uint32(2048), nil, nil)
 27257  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))), nil, nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), _106_pSubquery, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27258  _323:
 27259  	goto _281
 27260  _124:
 27261  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))).Xz = nil
 27262  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))).Xn = 0
 27263  	goto _281
 27264  _126:
 27265  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))) = _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.Xdb), nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27266  	goto _281
 27267  _127:
 27268  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(1)
 27269  	goto _281
 27270  _128:
 27271  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), nil, nil)
 27272  	goto _281
 27273  _129:
 27274  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), nil)
 27275  	goto _281
 27276  _130:
 27277  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27278  	goto _281
 27279  _131:
 27280  	*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr)
 27281  	goto _281
 27282  _135:
 27283  	*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))))) = nil
 27284  	goto _281
 27285  _140:
 27286  	*(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))) = *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))
 27287  	goto _281
 27288  _141:
 27289  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xz = nil
 27290  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xn = uint32(1)
 27291  	goto _281
 27292  _142:
 27293  	*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27294  	goto _281
 27295  _143:
 27296  	*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))))) = nil
 27297  	goto _281
 27298  _145:
 27299  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27300  	goto _281
 27301  _147:
 27302  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).XpExpr))
 27303  	_sqlite3ExprListSetSortOrder(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27304  	goto _281
 27305  _148:
 27306  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).XpExpr))
 27307  	_sqlite3ExprListSetSortOrder(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27308  	goto _281
 27309  _149:
 27310  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(0)
 27311  	goto _281
 27312  _150:
 27313  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(1)
 27314  	goto _281
 27315  _151:
 27316  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))) = int32(-1)
 27317  	goto _281
 27318  _152:
 27319  	*(**XExpr)(unsafe.Pointer(&((*t57)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))).XpLimit))) = nil
 27320  	*(**XExpr)(unsafe.Pointer(&((*t57)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))).XpOffset))) = nil
 27321  	goto _281
 27322  _153:
 27323  	*(**XExpr)(unsafe.Pointer(&((*t57)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).XpLimit))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr)
 27324  	*(**XExpr)(unsafe.Pointer(&((*t57)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).XpOffset))) = nil
 27325  	goto _281
 27326  _154:
 27327  	*(**XExpr)(unsafe.Pointer(&((*t57)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpLimit))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr)
 27328  	*(**XExpr)(unsafe.Pointer(&((*t57)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpOffset))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr)
 27329  	goto _281
 27330  _155:
 27331  	*(**XExpr)(unsafe.Pointer(&((*t57)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpOffset))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr)
 27332  	*(**XExpr)(unsafe.Pointer(&((*t57)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpLimit))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr)
 27333  	goto _281
 27334  _156:
 27335  	_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor)))), uint8(1))
 27336  	_sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27337  	_sqlite3DeleteFrom(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27338  	goto _281
 27339  _157:
 27340  	_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551609)).Xminor)))), uint8(1))
 27341  	_sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))
 27342  	_sqlite3ExprListCheckLength(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), str(27224))
 27343  	_sqlite3Update(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))))
 27344  	goto _281
 27345  _158:
 27346  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27347  	_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), int32(1))
 27348  	goto _281
 27349  _159:
 27350  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))))) = _sqlite3ExprListAppendVector(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27351  	goto _281
 27352  _160:
 27353  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor)))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27354  	_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), int32(1))
 27355  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor)))
 27356  	goto _281
 27357  _161:
 27358  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))) = _sqlite3ExprListAppendVector(tls, _pParse, nil, (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27359  	goto _281
 27360  _162:
 27361  	_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor)))), uint8(1))
 27362  	_sqlite3Insert(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))
 27363  	goto _281
 27364  _163:
 27365  	_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor)))), uint8(1))
 27366  	_sqlite3Insert(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), nil, (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))))
 27367  	goto _281
 27368  _164:
 27369  	*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27370  	goto _281
 27371  _165:
 27372  	*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))) = _sqlite3IdListAppend(tls, (*Xsqlite3)(_pParse.Xdb), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27373  	goto _281
 27374  _166:
 27375  	*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))) = _sqlite3IdListAppend(tls, (*Xsqlite3)(_pParse.Xdb), nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27376  	goto _281
 27377  _167:
 27378  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27379  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).XpExpr)
 27380  	goto _281
 27381  _168:
 27382  	_spanExpr(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), _pParse, int32(elem51(_yymsp, 0).Xmajor), *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27383  	goto _281
 27384  _171:
 27385  	_spanExpr(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), _pParse, int32(27), *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27386  	goto _281
 27387  _173:
 27388  	_143_temp1 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), int32(1))
 27389  	_143_temp2 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), int32(1))
 27390  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27391  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(122), _143_temp1, _143_temp2)
 27392  	goto _281
 27393  _174:
 27394  	_144_temp1 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), int32(1))
 27395  	_144_temp2 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), int32(1))
 27396  	_144_temp3 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), int32(1))
 27397  	_144_temp4 = _sqlite3PExpr(tls, _pParse, int32(122), _144_temp2, _144_temp3)
 27398  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27399  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(122), _144_temp1, _144_temp4)
 27400  	goto _281
 27401  _175:
 27402  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(134), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), int32(1))
 27403  	(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XzStart = (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz
 27404  	(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XzEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz)) + uintptr((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn)))
 27405  	if ((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr) != nil {
 27406  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr).Xflags |= uint32(8388612)
 27407  	}
 27408  	*(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
 27409  	goto _281
 27410  _176:
 27411  	if int32(*elem1((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz, 0)) != int32(35) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz, uintptr(1))))))&int32(4)) == 0 {
 27412  		_147_n = (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn
 27413  		_spanExpr(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), _pParse, int32(135), *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27414  		_sqlite3ExprAssignVarNumber(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr), _147_n)
 27415  		goto _327
 27416  	}
 27417  	_148_t = *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))
 27418  	func() {
 27419  		if _148_t.Xn < uint32(2) {
 27420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138336), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27233)))
 27421  			crt.X__builtin_abort(tls)
 27422  		}
 27423  	}()
 27424  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), &_148_t, &_148_t)
 27425  	if int32(_pParse.Xnested) == int32(0) {
 27426  		_sqlite3ErrorMsg(tls, _pParse, str(27240), unsafe.Pointer(&_148_t))
 27427  		*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))) = nil
 27428  		goto _331
 27429  	}
 27430  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(157), nil, nil)
 27431  	if ((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr) != nil {
 27432  		_sqlite3GetInt32(tls, elem1(_148_t.Xz, uintptr(1)), &((*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr).XiTable))
 27433  	}
 27434  _331:
 27435  _327:
 27436  	goto _281
 27437  _177:
 27438  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))) = _sqlite3ExprAddCollateToken(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), int32(1))
 27439  	(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XzEnd = elem1((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn))
 27440  	goto _281
 27441  _178:
 27442  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27443  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))).XpExpr))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(37), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), int32(1))
 27444  	_sqlite3ExprAttachSubtrees(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))).XpExpr), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpExpr), nil)
 27445  	goto _281
 27446  _179:
 27447  	if ((*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))) != nil) && (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))).XnExpr) > (*elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.Xdb).XaLimit))), uintptr(6)))) {
 27448  		_sqlite3ErrorMsg(tls, _pParse, str(27264), unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))))
 27449  	}
 27450  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr))) = _sqlite3ExprFunction(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))
 27451  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27452  	if ((*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))) == int32(1)) && (((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr) != nil) {
 27453  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr).Xflags |= uint32(16)
 27454  	}
 27455  	*(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
 27456  	goto _281
 27457  _180:
 27458  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr))) = _sqlite3ExprFunction(tls, _pParse, nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))
 27459  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27460  	*(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
 27461  	goto _281
 27462  _181:
 27463  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr))) = _sqlite3ExprFunction(tls, _pParse, nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27464  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27465  	*(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
 27466  	goto _281
 27467  _182:
 27468  	_158_pList = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).XpExpr))
 27469  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(158), nil, nil)
 27470  	if ((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr) != nil {
 27471  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr).Xx))))) = _158_pList
 27472  		_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27473  		goto _338
 27474  	}
 27475  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _158_pList)
 27476  _338:
 27477  	*(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
 27478  	goto _281
 27479  _183:
 27480  	_spanBinaryExpr(tls, _pParse, int32(elem51(_yymsp, uintptr(18446744073709551615)).Xmajor), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27481  	goto _281
 27482  _191:
 27483  	*(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))
 27484  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xn |= uint32(2147483648)
 27485  	goto _281
 27486  _192:
 27487  	_163_bNot = int32(((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xn) & uint32(2147483648))
 27488  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xn &= uint32(2147483647)
 27489  	_163_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27490  	_163_pList = _sqlite3ExprListAppend(tls, _pParse, _163_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))
 27491  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))) = _sqlite3ExprFunction(tls, _pParse, _163_pList, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27492  	_exprNot(tls, _pParse, _163_bNot, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))
 27493  	(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XzEnd = (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XzEnd
 27494  	if ((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr) != nil {
 27495  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr).Xflags |= uint32(128)
 27496  	}
 27497  	goto _281
 27498  _193:
 27499  	_164_bNot = int32(((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).Xn) & uint32(2147483648))
 27500  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).Xn &= uint32(2147483647)
 27501  	_164_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))
 27502  	_164_pList = _sqlite3ExprListAppend(tls, _pParse, _164_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))
 27503  	_164_pList = _sqlite3ExprListAppend(tls, _pParse, _164_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27504  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))) = _sqlite3ExprFunction(tls, _pParse, _164_pList, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))
 27505  	_exprNot(tls, _pParse, _164_bNot, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))
 27506  	(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XzEnd = (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XzEnd
 27507  	if ((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr) != nil {
 27508  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr).Xflags |= uint32(128)
 27509  	}
 27510  	goto _281
 27511  _194:
 27512  	_spanUnaryPostfix(tls, _pParse, int32(elem51(_yymsp, 0).Xmajor), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27513  	goto _281
 27514  _195:
 27515  	_spanUnaryPostfix(tls, _pParse, int32(76), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27516  	goto _281
 27517  _196:
 27518  	_spanBinaryExpr(tls, _pParse, int32(72), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27519  	_binaryToUnaryIfNull(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr), int32(75))
 27520  	goto _281
 27521  _197:
 27522  	_spanBinaryExpr(tls, _pParse, int32(148), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27523  	_binaryToUnaryIfNull(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpExpr), int32(76))
 27524  	goto _281
 27525  _198:
 27526  	_spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), _pParse, int32(elem51(_yymsp, uintptr(18446744073709551615)).Xmajor), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27527  	goto _281
 27528  _200:
 27529  	_spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), _pParse, int32(155), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27530  	goto _281
 27531  _201:
 27532  	_spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), _pParse, int32(156), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27533  	goto _281
 27534  _202:
 27535  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(0)
 27536  	goto _281
 27537  _204:
 27538  	_173_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))
 27539  	_173_pList = _sqlite3ExprListAppend(tls, _pParse, _173_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27540  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(73), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr), nil)
 27541  	if ((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr) != nil {
 27542  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr).Xx))))) = _173_pList
 27543  		goto _342
 27544  	}
 27545  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _173_pList)
 27546  _342:
 27547  	_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))
 27548  	(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XzEnd = (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XzEnd
 27549  	goto _281
 27550  _205:
 27551  	if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))) == nil {
 27552  		_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))
 27553  		*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(134), elem58((*XToken)(unsafe.Pointer(&_sqlite3IntTokens)), uintptr(*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))), int32(1))
 27554  		goto _351
 27555  	}
 27556  	if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))).XnExpr) != int32(1) {
 27557  		goto _345
 27558  	}
 27559  	_178_pRHS = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))).Xa))), 0).XpExpr)
 27560  	*(**XExpr)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))).Xa))), 0).XpExpr))) = nil
 27561  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27562  	if func() int32 {
 27563  		if _178_pRHS != nil {
 27564  			return int32(1)
 27565  		}
 27566  		return func() int32 {
 27567  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138522), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(4809)))
 27568  			crt.X__builtin_abort(tls)
 27569  			return int32(0)
 27570  		}()
 27571  	}() != 0 {
 27572  		_178_pRHS.Xflags &= uint32(4294967039)
 27573  		_178_pRHS.Xflags |= uint32(512)
 27574  	}
 27575  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, func() int32 {
 27576  		if (*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))) != 0 {
 27577  			return int32(77)
 27578  		}
 27579  		return int32(78)
 27580  	}(), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr), _178_pRHS)
 27581  	goto _351
 27582  _345:
 27583  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr), nil)
 27584  	if ((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr) != nil {
 27585  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr).Xx))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27586  		_sqlite3ExprSetHeightAndFlags(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))
 27587  		goto _353
 27588  	}
 27589  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27590  _353:
 27591  	_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))
 27592  _351:
 27593  	(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XzEnd = elem1((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn))
 27594  	goto _281
 27595  _206:
 27596  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27597  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(119), nil, nil)
 27598  	_sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27599  	goto _281
 27600  _207:
 27601  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr), nil)
 27602  	_sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27603  	_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))
 27604  	(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XzEnd = elem1((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn))
 27605  	goto _281
 27606  _208:
 27607  	_185_pSrc = _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.Xdb), nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27608  	_185_pSelect = _sqlite3SelectNew(tls, _pParse, nil, _185_pSrc, nil, nil, nil, nil, 0, nil, nil)
 27609  	if (*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))) != nil {
 27610  		_sqlite3SrcListFuncArgs(tls, _pParse, func() *XSrcList {
 27611  			if _185_pSelect != nil {
 27612  				return _185_pSrc
 27613  			}
 27614  			return nil
 27615  		}(), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27616  	}
 27617  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr), nil)
 27618  	_sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr), _185_pSelect)
 27619  	_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))
 27620  	(*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XzEnd = func() *int8 {
 27621  		if ((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xz) != nil {
 27622  			return elem1((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xn))
 27623  		}
 27624  		return elem1((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xn))
 27625  	}()
 27626  	goto _281
 27627  _209:
 27628  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27629  	_186_p = store60((**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpExpr))), _sqlite3PExpr(tls, _pParse, int32(20), nil, nil))
 27630  	_sqlite3PExprAddSelect(tls, _pParse, _186_p, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27631  	goto _281
 27632  _210:
 27633  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27634  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(136), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), nil)
 27635  	if ((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr) != nil {
 27636  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr).Xx))))) = func() *XExprList {
 27637  			if (*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))) != nil {
 27638  				return _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27639  			}
 27640  			return (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))
 27641  		}()
 27642  		_sqlite3ExprSetHeightAndFlags(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).XpExpr))
 27643  		goto _362
 27644  	}
 27645  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))))
 27646  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27647  _362:
 27648  	goto _281
 27649  _211:
 27650  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))
 27651  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27652  	goto _281
 27653  _212:
 27654  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).XpExpr))
 27655  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27656  	goto _281
 27657  _213:
 27658  	*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr)
 27659  	goto _281
 27660  _214:
 27661  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27662  	goto _281
 27663  _215:
 27664  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27665  	goto _281
 27666  _216:
 27667  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27668  	goto _281
 27669  _218:
 27670  	_sqlite3CreateIndex(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551609)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))), _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.Xdb), nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), nil), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551606)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551605)).Xminor))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), int32(0), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor))), 0)
 27671  	goto _281
 27672  _219:
 27673  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(2)
 27674  	goto _281
 27675  _221:
 27676  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))) = int32(0)
 27677  	goto _281
 27678  _222:
 27679  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))) = _parserAddExprIdListTerm(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27680  	goto _281
 27681  _223:
 27682  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))) = _parserAddExprIdListTerm(tls, _pParse, nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27683  	goto _281
 27684  _224:
 27685  	_sqlite3DropIndex(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27686  	goto _281
 27687  _225:
 27688  	_sqlite3Vacuum(tls, _pParse, nil)
 27689  	goto _281
 27690  _226:
 27691  	_sqlite3Vacuum(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27692  	goto _281
 27693  _227:
 27694  	_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), nil, int32(0))
 27695  	goto _281
 27696  _228:
 27697  	_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), int32(0))
 27698  	goto _281
 27699  _229:
 27700  	_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), int32(0))
 27701  	goto _281
 27702  _230:
 27703  	_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), int32(1))
 27704  	goto _281
 27705  _231:
 27706  	_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), int32(1))
 27707  	goto _281
 27708  _232:
 27709  	_209_all.Xz = (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).Xz
 27710  	_209_all.Xn = uint32(int32(int64(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xz))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).Xz))))) + ((*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xn)
 27711  	_sqlite3FinishTrigger(tls, _pParse, (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), &_209_all)
 27712  	goto _281
 27713  _233:
 27714  	_sqlite3BeginTrigger(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551609)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))), (*t53)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).Xa, (*XIdList)((*t53)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))).Xb), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551606)).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551608)).Xminor))))
 27715  	*(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551606)).Xminor))) = func() XToken {
 27716  		if ((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))).Xn) == (0) {
 27717  			return (*(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551609)).Xminor))))
 27718  		}
 27719  		return (*(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))))
 27720  	}()
 27721  	goto _281
 27722  _234:
 27723  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(34)
 27724  	goto _281
 27725  _235:
 27726  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(30)
 27727  	goto _281
 27728  _236:
 27729  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))) = int32(48)
 27730  	goto _281
 27731  _237:
 27732  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))) = int32(34)
 27733  	goto _281
 27734  _238:
 27735  	(*t53)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xa = int32(elem51(_yymsp, 0).Xmajor)
 27736  	*(**XIdList)(unsafe.Pointer(&((*t53)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).Xb))) = nil
 27737  	goto _281
 27738  _240:
 27739  	(*t53)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xa = int32(110)
 27740  	*(**XIdList)(unsafe.Pointer(&((*t53)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))).Xb))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27741  	goto _281
 27742  _241:
 27743  	*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))))) = nil
 27744  	goto _281
 27745  _243:
 27746  	*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr)
 27747  	goto _281
 27748  _245:
 27749  	func() {
 27750  		if (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))) == nil {
 27751  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138703), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27298)))
 27752  			crt.X__builtin_abort(tls)
 27753  		}
 27754  	}()
 27755  	*(**XTriggerStep)(unsafe.Pointer(&((*XTriggerStep)((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))).XpLast).XpNext))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27756  	*(**XTriggerStep)(unsafe.Pointer(&((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor)))).XpLast))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27757  	goto _281
 27758  _246:
 27759  	func() {
 27760  		if (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))) == nil {
 27761  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138710), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27323)))
 27762  			crt.X__builtin_abort(tls)
 27763  		}
 27764  	}()
 27765  	*(**XTriggerStep)(unsafe.Pointer(&((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))).XpLast))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27766  	goto _281
 27767  _247:
 27768  	*(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))) = *(*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))
 27769  	_sqlite3ErrorMsg(tls, _pParse, str(27348))
 27770  	goto _281
 27771  _248:
 27772  	_sqlite3ErrorMsg(tls, _pParse, str(27443))
 27773  	goto _281
 27774  _249:
 27775  	_sqlite3ErrorMsg(tls, _pParse, str(27527))
 27776  	goto _281
 27777  _250:
 27778  	*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551610)).Xminor))))) = _sqlite3TriggerUpdateStep(tls, (*Xsqlite3)(_pParse.Xdb), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), uint8(*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor)))))
 27779  	goto _281
 27780  _251:
 27781  	*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))) = _sqlite3TriggerInsertStep(tls, (*Xsqlite3)(_pParse.Xdb), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), uint8(*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))))
 27782  	goto _281
 27783  _252:
 27784  	*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))) = _sqlite3TriggerDeleteStep(tls, (*Xsqlite3)(_pParse.Xdb), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27785  	goto _281
 27786  _253:
 27787  	*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))) = _sqlite3TriggerSelectStep(tls, (*Xsqlite3)(_pParse.Xdb), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27788  	goto _281
 27789  _254:
 27790  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27791  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(56), nil, nil)
 27792  	if ((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpExpr) != nil {
 27793  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpExpr).Xaffinity = int8(4)
 27794  	}
 27795  	goto _281
 27796  _255:
 27797  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27798  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))).XpExpr))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(56), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), int32(1))
 27799  	if ((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))).XpExpr) != nil {
 27800  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))).XpExpr).Xaffinity = int8(*(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))))
 27801  	}
 27802  	goto _281
 27803  _256:
 27804  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(1)
 27805  	goto _281
 27806  _257:
 27807  	*(*int32)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))) = int32(3)
 27808  	goto _281
 27809  _258:
 27810  	_sqlite3DropTrigger(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27811  	goto _281
 27812  _259:
 27813  	_sqlite3Attach(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))).XpExpr), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).XpExpr), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27814  	goto _281
 27815  _260:
 27816  	_sqlite3Detach(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))).XpExpr))
 27817  	goto _281
 27818  _261:
 27819  	_sqlite3Reindex(tls, _pParse, nil, nil)
 27820  	goto _281
 27821  _262:
 27822  	_sqlite3Reindex(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27823  	goto _281
 27824  _263:
 27825  	_sqlite3Analyze(tls, _pParse, nil, nil)
 27826  	goto _281
 27827  _264:
 27828  	_sqlite3Analyze(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27829  	goto _281
 27830  _265:
 27831  	_sqlite3AlterRenameTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27832  	goto _281
 27833  _266:
 27834  	(*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xn = uint32(int32(int64(uintptr(unsafe.Pointer(_pParse.XsLastToken.Xz))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))).Xz))))) + (_pParse.XsLastToken.Xn)
 27835  	_sqlite3AlterFinishAddColumn(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))
 27836  	goto _281
 27837  _267:
 27838  	_disableLookaside(tls, _pParse)
 27839  	_sqlite3AlterBeginAddColumn(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor)))))
 27840  	goto _281
 27841  _268:
 27842  	_sqlite3VtabFinishParse(tls, _pParse, nil)
 27843  	goto _281
 27844  _269:
 27845  	_sqlite3VtabFinishParse(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27846  	goto _281
 27847  _270:
 27848  	_sqlite3VtabBeginParse(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551613)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))), *(*int32)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor))))
 27849  	goto _281
 27850  _271:
 27851  	_sqlite3VtabArgInit(tls, _pParse)
 27852  	goto _281
 27853  _272:
 27854  	_sqlite3VtabArgExtend(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27855  	goto _281
 27856  _275:
 27857  	*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(1)).Xminor))))) = nil
 27858  	goto _281
 27859  _276:
 27860  	*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27861  	goto _281
 27862  _277:
 27863  	*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551614)).Xminor))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, 0).Xminor))))
 27864  	goto _281
 27865  _278:
 27866  	*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))))) = _sqlite3WithAdd(tls, _pParse, nil, (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27867  	goto _281
 27868  _279:
 27869  	*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551609)).Xminor))))) = _sqlite3WithAdd(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551609)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551611)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551612)).Xminor)))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem51(_yymsp, uintptr(18446744073709551615)).Xminor)))))
 27870  	goto _281
 27871  _280:
 27872  	func() {
 27873  		if _yyruleno == uint32(277) {
 27874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138857), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27612)))
 27875  			crt.X__builtin_abort(tls)
 27876  		}
 27877  	}()
 27878  	func() {
 27879  		if _yyruleno == uint32(294) {
 27880  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138874), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27626)))
 27881  			crt.X__builtin_abort(tls)
 27882  		}
 27883  	}()
 27884  	func() {
 27885  		if _yyruleno == uint32(295) {
 27886  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138875), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27640)))
 27887  			crt.X__builtin_abort(tls)
 27888  		}
 27889  	}()
 27890  	func() {
 27891  		if _yyruleno == uint32(301) {
 27892  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138881), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27654)))
 27893  			crt.X__builtin_abort(tls)
 27894  		}
 27895  	}()
 27896  	func() {
 27897  		if _yyruleno == uint32(303) {
 27898  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138883), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27668)))
 27899  			crt.X__builtin_abort(tls)
 27900  		}
 27901  	}()
 27902  	func() {
 27903  		if _yyruleno == uint32(304) {
 27904  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138884), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27682)))
 27905  			crt.X__builtin_abort(tls)
 27906  		}
 27907  	}()
 27908  	func() {
 27909  		if _yyruleno == uint32(305) {
 27910  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138885), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27696)))
 27911  			crt.X__builtin_abort(tls)
 27912  		}
 27913  	}()
 27914  	func() {
 27915  		if _yyruleno == uint32(309) {
 27916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138889), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27710)))
 27917  			crt.X__builtin_abort(tls)
 27918  		}
 27919  	}()
 27920  	func() {
 27921  		if _yyruleno == uint32(312) {
 27922  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138892), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27724)))
 27923  			crt.X__builtin_abort(tls)
 27924  		}
 27925  	}()
 27926  	func() {
 27927  		if _yyruleno == uint32(313) {
 27928  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138893), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27738)))
 27929  			crt.X__builtin_abort(tls)
 27930  		}
 27931  	}()
 27932  	goto _281
 27933  _281:
 27934  	func() {
 27935  		if uint64(_yyruleno) >= uint64(332) {
 27936  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138915), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27752)))
 27937  			crt.X__builtin_abort(tls)
 27938  		}
 27939  	}()
 27940  	_yygoto = int32(elem54((*t55)(unsafe.Pointer(&_yyRuleInfo)), uintptr(_yyruleno)).Xlhs)
 27941  	_yysize = int32(elem54((*t55)(unsafe.Pointer(&_yyRuleInfo)), uintptr(_yyruleno)).Xnrhs)
 27942  	_yyact = _yy_find_reduce_action(tls, int32(elem51(_yymsp, uintptr(-_yysize)).Xstateno), uint8(_yygoto))
 27943  	if _yyact > int32(999) {
 27944  		goto _393
 27945  	}
 27946  	if _yyact > int32(455) {
 27947  		_yyact += int32(332)
 27948  	}
 27949  	*(*uintptr)(unsafe.Pointer(&_yymsp)) -= 32 * uintptr(_yysize-int32(1))
 27950  	*(**XyyStackEntry)(unsafe.Pointer(&_yypParser.Xyytos)) = _yymsp
 27951  	_yymsp.Xstateno = uint16(_yyact)
 27952  	_yymsp.Xmajor = uint8(_yygoto)
 27953  	_yyTraceShift(tls, _yypParser, _yyact)
 27954  	goto _395
 27955  _393:
 27956  	func() {
 27957  		if _yyact != int32(1333) {
 27958  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138929), unsafe.Pointer(&_yy_reduceØ00__func__Ø000), unsafe.Pointer(str(27802)))
 27959  			crt.X__builtin_abort(tls)
 27960  		}
 27961  	}()
 27962  	*(*uintptr)(unsafe.Pointer(&_yypParser.Xyytos)) -= 32 * uintptr(_yysize)
 27963  	_yy_accept(tls, _yypParser)
 27964  _395:
 27965  }
 27966  
 27967  // C comment
 27968  //  /* The following table contains information about every rule that
 27969  //  ** is used during the reduce.
 27970  //  */
 27971  var _yyRuleInfo [332]t55
 27972  
 27973  func init() {
 27974  	_yyRuleInfo = [332]t55{t55{Xlhs: uint8(147), Xnrhs: uint8(1)}, t55{Xlhs: uint8(147), Xnrhs: uint8(3)}, t55{Xlhs: uint8(148), Xnrhs: uint8(1)}, t55{Xlhs: uint8(149), Xnrhs: uint8(3)}, t55{Xlhs: uint8(150)}, t55{Xlhs: uint8(150), Xnrhs: uint8(1)}, t55{Xlhs: uint8(150), Xnrhs: uint8(1)}, t55{Xlhs: uint8(150), Xnrhs: uint8(1)}, t55{Xlhs: uint8(149), Xnrhs: uint8(2)}, t55{Xlhs: uint8(149), Xnrhs: uint8(2)}, t55{Xlhs: uint8(149), Xnrhs: uint8(2)}, t55{Xlhs: uint8(149), Xnrhs: uint8(2)}, t55{Xlhs: uint8(149), Xnrhs: uint8(3)}, t55{Xlhs: uint8(149), Xnrhs: uint8(5)}, t55{Xlhs: uint8(154), Xnrhs: uint8(6)}, t55{Xlhs: uint8(156), Xnrhs: uint8(1)}, t55{Xlhs: uint8(158)}, t55{Xlhs: uint8(158), Xnrhs: uint8(3)}, t55{Xlhs: uint8(157), Xnrhs: uint8(1)}, t55{Xlhs: uint8(157)}, t55{Xlhs: uint8(155), Xnrhs: uint8(5)}, t55{Xlhs: uint8(155), Xnrhs: uint8(2)}, t55{Xlhs: uint8(162)}, t55{Xlhs: uint8(162), Xnrhs: uint8(2)}, t55{Xlhs: uint8(164), Xnrhs: uint8(2)}, t55{Xlhs: uint8(166)}, t55{Xlhs: uint8(166), Xnrhs: uint8(4)}, t55{Xlhs: uint8(166), Xnrhs: uint8(6)}, t55{Xlhs: uint8(167), Xnrhs: uint8(2)}, t55{Xlhs: uint8(171), Xnrhs: uint8(2)}, t55{Xlhs: uint8(171), Xnrhs: uint8(2)}, t55{Xlhs: uint8(171), Xnrhs: uint8(4)}, t55{Xlhs: uint8(171), Xnrhs: uint8(3)}, t55{Xlhs: uint8(171), Xnrhs: uint8(3)}, t55{Xlhs: uint8(171), Xnrhs: uint8(2)}, t55{Xlhs: uint8(171), Xnrhs: uint8(3)}, t55{Xlhs: uint8(171), Xnrhs: uint8(5)}, t55{Xlhs: uint8(171), Xnrhs: uint8(2)}, t55{Xlhs: uint8(171), Xnrhs: uint8(4)}, t55{Xlhs: uint8(171), Xnrhs: uint8(4)}, t55{Xlhs: uint8(171), Xnrhs: uint8(1)}, t55{Xlhs: uint8(171), Xnrhs: uint8(2)}, t55{Xlhs: uint8(176)}, t55{Xlhs: uint8(176), Xnrhs: uint8(1)}, t55{Xlhs: uint8(178)}, t55{Xlhs: uint8(178), Xnrhs: uint8(2)}, t55{Xlhs: uint8(180), Xnrhs: uint8(2)}, t55{Xlhs: uint8(180), Xnrhs: uint8(3)}, t55{Xlhs: uint8(180), Xnrhs: uint8(3)}, t55{Xlhs: uint8(180), Xnrhs: uint8(3)}, t55{Xlhs: uint8(181), Xnrhs: uint8(2)}, t55{Xlhs: uint8(181), Xnrhs: uint8(2)}, t55{Xlhs: uint8(181), Xnrhs: uint8(1)}, t55{Xlhs: uint8(181), Xnrhs: uint8(1)}, t55{Xlhs: uint8(181), Xnrhs: uint8(2)}, t55{Xlhs: uint8(179), Xnrhs: uint8(3)}, t55{Xlhs: uint8(179), Xnrhs: uint8(2)}, t55{Xlhs: uint8(182)}, t55{Xlhs: uint8(182), Xnrhs: uint8(2)}, t55{Xlhs: uint8(182), Xnrhs: uint8(2)}, t55{Xlhs: uint8(161)}, t55{Xlhs: uint8(184), Xnrhs: uint8(1)}, t55{Xlhs: uint8(185), Xnrhs: uint8(2)}, t55{Xlhs: uint8(185), Xnrhs: uint8(7)}, t55{Xlhs: uint8(185), Xnrhs: uint8(5)}, t55{Xlhs: uint8(185), Xnrhs: uint8(5)}, t55{Xlhs: uint8(185), Xnrhs: uint8(10)}, t55{Xlhs: uint8(188)}, t55{Xlhs: uint8(174)}, t55{Xlhs: uint8(174), Xnrhs: uint8(3)}, t55{Xlhs: uint8(189)}, t55{Xlhs: uint8(189), Xnrhs: uint8(2)}, t55{Xlhs: uint8(190), Xnrhs: uint8(1)}, t55{Xlhs: uint8(190), Xnrhs: uint8(1)}, t55{Xlhs: uint8(149), Xnrhs: uint8(4)}, t55{Xlhs: uint8(192), Xnrhs: uint8(2)}, t55{Xlhs: uint8(192)}, t55{Xlhs: uint8(149), Xnrhs: uint8(9)}, t55{Xlhs: uint8(149), Xnrhs: uint8(4)}, t55{Xlhs: uint8(149), Xnrhs: uint8(1)}, t55{Xlhs: uint8(163), Xnrhs: uint8(2)}, t55{Xlhs: uint8(194), Xnrhs: uint8(3)}, t55{Xlhs: uint8(197), Xnrhs: uint8(1)}, t55{Xlhs: uint8(197), Xnrhs: uint8(2)}, t55{Xlhs: uint8(197), Xnrhs: uint8(1)}, t55{Xlhs: uint8(195), Xnrhs: uint8(9)}, t55{Xlhs: uint8(206), Xnrhs: uint8(4)}, t55{Xlhs: uint8(206), Xnrhs: uint8(5)}, t55{Xlhs: uint8(198), Xnrhs: uint8(1)}, t55{Xlhs: uint8(198), Xnrhs: uint8(1)}, t55{Xlhs: uint8(198)}, t55{Xlhs: uint8(209)}, t55{Xlhs: uint8(199), Xnrhs: uint8(3)}, t55{Xlhs: uint8(199), Xnrhs: uint8(2)}, t55{Xlhs: uint8(199), Xnrhs: uint8(4)}, t55{Xlhs: uint8(210), Xnrhs: uint8(2)}, t55{Xlhs: uint8(210)}, t55{Xlhs: uint8(200)}, t55{Xlhs: uint8(200), Xnrhs: uint8(2)}, t55{Xlhs: uint8(212), Xnrhs: uint8(2)}, t55{Xlhs: uint8(212)}, t55{Xlhs: uint8(211), Xnrhs: uint8(7)}, t55{Xlhs: uint8(211), Xnrhs: uint8(9)}, t55{Xlhs: uint8(211), Xnrhs: uint8(7)}, t55{Xlhs: uint8(211), Xnrhs: uint8(7)}, t55{Xlhs: uint8(159)}, t55{Xlhs: uint8(159), Xnrhs: uint8(2)}, t55{Xlhs: uint8(193), Xnrhs: uint8(2)}, t55{Xlhs: uint8(213), Xnrhs: uint8(1)}, t55{Xlhs: uint8(213), Xnrhs: uint8(2)}, t55{Xlhs: uint8(213), Xnrhs: uint8(3)}, t55{Xlhs: uint8(213), Xnrhs: uint8(4)}, t55{Xlhs: uint8(215), Xnrhs: uint8(2)}, t55{Xlhs: uint8(215)}, t55{Xlhs: uint8(214)}, t55{Xlhs: uint8(214), Xnrhs: uint8(3)}, t55{Xlhs: uint8(214), Xnrhs: uint8(2)}, t55{Xlhs: uint8(216), Xnrhs: uint8(4)}, t55{Xlhs: uint8(216)}, t55{Xlhs: uint8(204)}, t55{Xlhs: uint8(204), Xnrhs: uint8(3)}, t55{Xlhs: uint8(186), Xnrhs: uint8(4)}, t55{Xlhs: uint8(186), Xnrhs: uint8(2)}, t55{Xlhs: uint8(175), Xnrhs: uint8(1)}, t55{Xlhs: uint8(175), Xnrhs: uint8(1)}, t55{Xlhs: uint8(175)}, t55{Xlhs: uint8(202)}, t55{Xlhs: uint8(202), Xnrhs: uint8(3)}, t55{Xlhs: uint8(203)}, t55{Xlhs: uint8(203), Xnrhs: uint8(2)}, t55{Xlhs: uint8(205)}, t55{Xlhs: uint8(205), Xnrhs: uint8(2)}, t55{Xlhs: uint8(205), Xnrhs: uint8(4)}, t55{Xlhs: uint8(205), Xnrhs: uint8(4)}, t55{Xlhs: uint8(149), Xnrhs: uint8(6)}, t55{Xlhs: uint8(201)}, t55{Xlhs: uint8(201), Xnrhs: uint8(2)}, t55{Xlhs: uint8(149), Xnrhs: uint8(8)}, t55{Xlhs: uint8(218), Xnrhs: uint8(5)}, t55{Xlhs: uint8(218), Xnrhs: uint8(7)}, t55{Xlhs: uint8(218), Xnrhs: uint8(3)}, t55{Xlhs: uint8(218), Xnrhs: uint8(5)}, t55{Xlhs: uint8(149), Xnrhs: uint8(6)}, t55{Xlhs: uint8(149), Xnrhs: uint8(7)}, t55{Xlhs: uint8(219), Xnrhs: uint8(2)}, t55{Xlhs: uint8(219), Xnrhs: uint8(1)}, t55{Xlhs: uint8(220)}, t55{Xlhs: uint8(220), Xnrhs: uint8(3)}, t55{Xlhs: uint8(217), Xnrhs: uint8(3)}, t55{Xlhs: uint8(217), Xnrhs: uint8(1)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(172), Xnrhs: uint8(1)}, t55{Xlhs: uint8(173), Xnrhs: uint8(1)}, t55{Xlhs: uint8(173), Xnrhs: uint8(1)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(5)}, t55{Xlhs: uint8(172), Xnrhs: uint8(1)}, t55{Xlhs: uint8(172), Xnrhs: uint8(1)}, t55{Xlhs: uint8(172), Xnrhs: uint8(1)}, t55{Xlhs: uint8(173), Xnrhs: uint8(1)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(6)}, t55{Xlhs: uint8(173), Xnrhs: uint8(5)}, t55{Xlhs: uint8(173), Xnrhs: uint8(4)}, t55{Xlhs: uint8(172), Xnrhs: uint8(1)}, t55{Xlhs: uint8(173), Xnrhs: uint8(5)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(221), Xnrhs: uint8(2)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(5)}, t55{Xlhs: uint8(173), Xnrhs: uint8(2)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(4)}, t55{Xlhs: uint8(173), Xnrhs: uint8(2)}, t55{Xlhs: uint8(173), Xnrhs: uint8(2)}, t55{Xlhs: uint8(173), Xnrhs: uint8(2)}, t55{Xlhs: uint8(173), Xnrhs: uint8(2)}, t55{Xlhs: uint8(222), Xnrhs: uint8(1)}, t55{Xlhs: uint8(222), Xnrhs: uint8(2)}, t55{Xlhs: uint8(173), Xnrhs: uint8(5)}, t55{Xlhs: uint8(223), Xnrhs: uint8(1)}, t55{Xlhs: uint8(223), Xnrhs: uint8(2)}, t55{Xlhs: uint8(173), Xnrhs: uint8(5)}, t55{Xlhs: uint8(173), Xnrhs: uint8(3)}, t55{Xlhs: uint8(173), Xnrhs: uint8(5)}, t55{Xlhs: uint8(173), Xnrhs: uint8(5)}, t55{Xlhs: uint8(173), Xnrhs: uint8(4)}, t55{Xlhs: uint8(173), Xnrhs: uint8(5)}, t55{Xlhs: uint8(226), Xnrhs: uint8(5)}, t55{Xlhs: uint8(226), Xnrhs: uint8(4)}, t55{Xlhs: uint8(227), Xnrhs: uint8(2)}, t55{Xlhs: uint8(227)}, t55{Xlhs: uint8(225), Xnrhs: uint8(1)}, t55{Xlhs: uint8(225)}, t55{Xlhs: uint8(208)}, t55{Xlhs: uint8(207), Xnrhs: uint8(3)}, t55{Xlhs: uint8(207), Xnrhs: uint8(1)}, t55{Xlhs: uint8(224)}, t55{Xlhs: uint8(224), Xnrhs: uint8(3)}, t55{Xlhs: uint8(149), Xnrhs: uint8(12)}, t55{Xlhs: uint8(228), Xnrhs: uint8(1)}, t55{Xlhs: uint8(228)}, t55{Xlhs: uint8(177)}, t55{Xlhs: uint8(177), Xnrhs: uint8(3)}, t55{Xlhs: uint8(187), Xnrhs: uint8(5)}, t55{Xlhs: uint8(187), Xnrhs: uint8(3)}, t55{Xlhs: uint8(229)}, t55{Xlhs: uint8(229), Xnrhs: uint8(2)}, t55{Xlhs: uint8(149), Xnrhs: uint8(4)}, t55{Xlhs: uint8(149), Xnrhs: uint8(1)}, t55{Xlhs: uint8(149), Xnrhs: uint8(2)}, t55{Xlhs: uint8(149), Xnrhs: uint8(3)}, t55{Xlhs: uint8(149), Xnrhs: uint8(5)}, t55{Xlhs: uint8(149), Xnrhs: uint8(6)}, t55{Xlhs: uint8(149), Xnrhs: uint8(5)}, t55{Xlhs: uint8(149), Xnrhs: uint8(6)}, t55{Xlhs: uint8(169), Xnrhs: uint8(2)}, t55{Xlhs: uint8(170), Xnrhs: uint8(2)}, t55{Xlhs: uint8(149), Xnrhs: uint8(5)}, t55{Xlhs: uint8(231), Xnrhs: uint8(11)}, t55{Xlhs: uint8(233), Xnrhs: uint8(1)}, t55{Xlhs: uint8(233), Xnrhs: uint8(1)}, t55{Xlhs: uint8(233), Xnrhs: uint8(2)}, t55{Xlhs: uint8(233)}, t55{Xlhs: uint8(234), Xnrhs: uint8(1)}, t55{Xlhs: uint8(234), Xnrhs: uint8(1)}, t55{Xlhs: uint8(234), Xnrhs: uint8(3)}, t55{Xlhs: uint8(236)}, t55{Xlhs: uint8(236), Xnrhs: uint8(2)}, t55{Xlhs: uint8(232), Xnrhs: uint8(3)}, t55{Xlhs: uint8(232), Xnrhs: uint8(2)}, t55{Xlhs: uint8(238), Xnrhs: uint8(3)}, t55{Xlhs: uint8(239), Xnrhs: uint8(3)}, t55{Xlhs: uint8(239), Xnrhs: uint8(2)}, t55{Xlhs: uint8(237), Xnrhs: uint8(7)}, t55{Xlhs: uint8(237), Xnrhs: uint8(5)}, t55{Xlhs: uint8(237), Xnrhs: uint8(5)}, t55{Xlhs: uint8(237), Xnrhs: uint8(1)}, t55{Xlhs: uint8(173), Xnrhs: uint8(4)}, t55{Xlhs: uint8(173), Xnrhs: uint8(6)}, t55{Xlhs: uint8(191), Xnrhs: uint8(1)}, t55{Xlhs: uint8(191), Xnrhs: uint8(1)}, t55{Xlhs: uint8(191), Xnrhs: uint8(1)}, t55{Xlhs: uint8(149), Xnrhs: uint8(4)}, t55{Xlhs: uint8(149), Xnrhs: uint8(6)}, t55{Xlhs: uint8(149), Xnrhs: uint8(3)}, t55{Xlhs: uint8(241)}, t55{Xlhs: uint8(241), Xnrhs: uint8(2)}, t55{Xlhs: uint8(149), Xnrhs: uint8(1)}, t55{Xlhs: uint8(149), Xnrhs: uint8(3)}, t55{Xlhs: uint8(149), Xnrhs: uint8(1)}, t55{Xlhs: uint8(149), Xnrhs: uint8(3)}, t55{Xlhs: uint8(149), Xnrhs: uint8(6)}, t55{Xlhs: uint8(149), Xnrhs: uint8(7)}, t55{Xlhs: uint8(242), Xnrhs: uint8(1)}, t55{Xlhs: uint8(149), Xnrhs: uint8(1)}, t55{Xlhs: uint8(149), Xnrhs: uint8(4)}, t55{Xlhs: uint8(244), Xnrhs: uint8(8)}, t55{Xlhs: uint8(246)}, t55{Xlhs: uint8(247), Xnrhs: uint8(1)}, t55{Xlhs: uint8(247), Xnrhs: uint8(3)}, t55{Xlhs: uint8(248), Xnrhs: uint8(1)}, t55{Xlhs: uint8(196)}, t55{Xlhs: uint8(196), Xnrhs: uint8(2)}, t55{Xlhs: uint8(196), Xnrhs: uint8(3)}, t55{Xlhs: uint8(250), Xnrhs: uint8(6)}, t55{Xlhs: uint8(250), Xnrhs: uint8(8)}, t55{Xlhs: uint8(144), Xnrhs: uint8(1)}, t55{Xlhs: uint8(145), Xnrhs: uint8(2)}, t55{Xlhs: uint8(145), Xnrhs: uint8(1)}, t55{Xlhs: uint8(146), Xnrhs: uint8(1)}, t55{Xlhs: uint8(146), Xnrhs: uint8(3)}, t55{Xlhs: uint8(147)}, t55{Xlhs: uint8(151)}, t55{Xlhs: uint8(151), Xnrhs: uint8(1)}, t55{Xlhs: uint8(151), Xnrhs: uint8(2)}, t55{Xlhs: uint8(153), Xnrhs: uint8(1)}, t55{Xlhs: uint8(153)}, t55{Xlhs: uint8(149), Xnrhs: uint8(2)}, t55{Xlhs: uint8(160), Xnrhs: uint8(4)}, t55{Xlhs: uint8(160), Xnrhs: uint8(2)}, t55{Xlhs: uint8(152), Xnrhs: uint8(1)}, t55{Xlhs: uint8(152), Xnrhs: uint8(1)}, t55{Xlhs: uint8(152), Xnrhs: uint8(1)}, t55{Xlhs: uint8(166), Xnrhs: uint8(1)}, t55{Xlhs: uint8(167), Xnrhs: uint8(1)}, t55{Xlhs: uint8(168), Xnrhs: uint8(1)}, t55{Xlhs: uint8(168), Xnrhs: uint8(1)}, t55{Xlhs: uint8(165), Xnrhs: uint8(2)}, t55{Xlhs: uint8(165)}, t55{Xlhs: uint8(171), Xnrhs: uint8(2)}, t55{Xlhs: uint8(161), Xnrhs: uint8(2)}, t55{Xlhs: uint8(183), Xnrhs: uint8(3)}, t55{Xlhs: uint8(183), Xnrhs: uint8(1)}, t55{Xlhs: uint8(184)}, t55{Xlhs: uint8(188), Xnrhs: uint8(1)}, t55{Xlhs: uint8(190), Xnrhs: uint8(1)}, t55{Xlhs: uint8(194), Xnrhs: uint8(1)}, t55{Xlhs: uint8(195), Xnrhs: uint8(1)}, t55{Xlhs: uint8(209), Xnrhs: uint8(2)}, t55{Xlhs: uint8(210), Xnrhs: uint8(1)}, t55{Xlhs: uint8(173), Xnrhs: uint8(1)}, t55{Xlhs: uint8(221), Xnrhs: uint8(1)}, t55{Xlhs: uint8(208), Xnrhs: uint8(1)}, t55{Xlhs: uint8(230), Xnrhs: uint8(1)}, t55{Xlhs: uint8(230), Xnrhs: uint8(1)}, t55{Xlhs: uint8(230), Xnrhs: uint8(1)}, t55{Xlhs: uint8(230), Xnrhs: uint8(1)}, t55{Xlhs: uint8(230), Xnrhs: uint8(1)}, t55{Xlhs: uint8(169), Xnrhs: uint8(1)}, t55{Xlhs: uint8(235)}, t55{Xlhs: uint8(235), Xnrhs: uint8(3)}, t55{Xlhs: uint8(238), Xnrhs: uint8(1)}, t55{Xlhs: uint8(239)}, t55{Xlhs: uint8(240), Xnrhs: uint8(1)}, t55{Xlhs: uint8(240)}, t55{Xlhs: uint8(243)}, t55{Xlhs: uint8(243), Xnrhs: uint8(1)}, t55{Xlhs: uint8(245), Xnrhs: uint8(1)}, t55{Xlhs: uint8(245), Xnrhs: uint8(3)}, t55{Xlhs: uint8(246), Xnrhs: uint8(2)}, t55{Xlhs: uint8(249)}, t55{Xlhs: uint8(249), Xnrhs: uint8(4)}, t55{Xlhs: uint8(249), Xnrhs: uint8(2)}}
 27975  }
 27976  
 27977  // C comment
 27978  //  /* For tracing reduce actions, the names of all rules are required.
 27979  //  */
 27980  var _yyRuleName [332]*int8
 27981  
 27982  func init() {
 27983  	_yyRuleName = [332]*int8{str(27828), str(27848), str(27879), str(27892), str(27926), str(27940), str(27963), str(27987), str(28011), str(28036), str(28058), str(28085), str(28106), str(28139), str(28186), str(28243), str(28263), str(28279), str(28309), str(28323), str(28332), str(28398), str(28430), str(28448), str(28477), str(28505), str(28519), str(28555), str(28604), str(28636), str(28660), str(28683), str(28712), str(28740), str(28769), str(28798), str(28824), str(28871), str(28895), str(28922), str(28966), str(28992), str(29020), str(29032), str(29053), str(29065), str(29092), str(29112), str(29140), str(29168), str(29196), str(29216), str(29239), str(29258), str(29278), str(29299), str(29357), str(29411), str(29438), str(29484), str(29531), str(29548), str(29569), str(29593), str(29645), str(29684), str(29718), str(29808), str(29832), str(29843), str(29878), str(29889), str(29915), str(29938), str(29962), str(29999), str(30022), str(30035), str(30104), str(30140), str(30155), str(30184), str(30239), str(30264), str(30293), str(30329), str(30430), str(30464), str(30503), str(30525), str(30542), str(30555), str(30564), str(30592), str(30617), str(30649), str(30662), str(30669), str(30678), str(30703), str(30736), str(30751), str(30817), str(30886), str(30945), str(31008), str(31017), str(31033), str(31054), str(31076), str(31100), str(31127), str(31157), str(31176), str(31187), str(31203), str(31233), str(31261), str(31294), str(31308), str(31324), str(31358), str(31401), str(31429), str(31447), str(31466), str(31480), str(31496), str(31531), str(31546), str(31573), str(31587), str(31612), str(31649), str(31685), str(31741), str(31755), str(31780), str(31850), str(31887), str(31934), str(31957), str(31990), str(32046), str(32110), str(32139), str(32162), str(32177), str(32205), str(32232), str(32246), str(32266), str(32280), str(32300), str(32317), str(32336), str(32362), str(32382), str(32398), str(32415), str(32433), str(32465), str(32503), str(32547), str(32578), str(32596), str(32632), str(32655), str(32677), str(32708), str(32733), str(32779), str(32809), str(32843), str(32869), str(32898), str(32924), str(32962), str(32991), str(33014), str(33036), str(33062), str(33080), str(33101), str(33121), str(33140), str(33163), str(33190), str(33229), str(33242), str(33259), str(33294), str(33316), str(33349), str(33392), str(33421), str(33476), str(33528), str(33566), str(33590), str(33604), str(33626), str(33643), str(33656), str(33691), str(33710), str(33729), str(33763), str(33848), str(33870), str(33885), str(33901), str(33931), str(33978), str(34011), str(34023), str(34053), str(34090), str(34105), str(34123), str(34146), str(34178), str(34213), str(34249), str(34288), str(34320), str(34354), str(34411), str(34527), str(34551), str(34574), str(34602), str(34619), str(34651), str(34676), str(34711), str(34727), str(34753), str(34808), str(34846), str(34865), str(34891), str(34915), str(34980), str(35035), str(35086), str(35109), str(35137), str(35177), str(35200), str(35220), str(35239), str(35278), str(35330), str(35366), str(35378), str(35399), str(35415), str(35439), str(35455), str(35479), str(35521), str(35598), str(35631), str(35651), str(35689), str(35757), str(35769), str(35790), str(35821), str(35831), str(35840), str(35861), str(35892), str(35934), str(35989), str(36007), str(36032), str(36049), str(36063), str(36090), str(36102), str(36116), str(36142), str(36171), str(36199), str(36217), str(36256), str(36308), str(36343), str(36361), str(36375), str(36390), str(36413), str(36436), str(36456), str(36477), str(36505), str(36518), str(36540), str(36572), str(36611), str(36630), str(36645), str(36685), str(36711), str(36738), str(36759), str(36785), str(36802), str(36816), str(36841), str(36864), str(36883), str(36896), str(36909), str(36926), str(36944), str(36971), str(36990), str(37022), str(37034), str(37046), str(37075), str(37095), str(37112), str(37138), str(37162), str(37204), str(37237), str(37249), str(37283)}
 27984  }
 27985  
 27986  // C comment
 27987  //  /*
 27988  //  ** This routine is called after a single SQL statement has been
 27989  //  ** parsed and a VDBE program to execute that statement has been
 27990  //  ** prepared.  This routine puts the finishing touches on the
 27991  //  ** VDBE program and resets the pParse structure for the next
 27992  //  ** parse.
 27993  //  **
 27994  //  ** Note that if an error occurred, it might be the case that
 27995  //  ** no VDBE code was generated.
 27996  //  */
 27997  func _sqlite3FinishCoding(tls *crt.TLS, _pParse *XParse) {
 27998  	var _3_iDb, _3_i int32
 27999  	var _5_vtab *int8
 28000  	var _db *Xsqlite3
 28001  	var _4_pSchema *XSchema
 28002  	var _v *TVdbe
 28003  	var _6_pEL *XExprList
 28004  	func() {
 28005  		if (*XParse)(_pParse.XpToplevel) != nil {
 28006  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99832), unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000), unsafe.Pointer(str(37307)))
 28007  			crt.X__builtin_abort(tls)
 28008  		}
 28009  	}()
 28010  	_db = (*Xsqlite3)(_pParse.Xdb)
 28011  	if _pParse.Xnested != 0 {
 28012  		return
 28013  	}
 28014  	if _db.XmallocFailed == 0 && _pParse.XnErr == 0 {
 28015  		goto _4
 28016  	}
 28017  	if _pParse.Xrc == int32(0) {
 28018  		_pParse.Xrc = int32(1)
 28019  	}
 28020  	return
 28021  _4:
 28022  	_v = _sqlite3GetVdbe(tls, _pParse)
 28023  	func() {
 28024  		if _pParse.XisMultiWrite != 0 && _sqlite3VdbeAssertMayAbort(tls, _v, int32(_pParse.XmayAbort)) == 0 {
 28025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99844), unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000), unsafe.Pointer(str(37328)))
 28026  			crt.X__builtin_abort(tls)
 28027  		}
 28028  	}()
 28029  	if _v == nil {
 28030  		goto _9
 28031  	}
 28032  	_sqlite3VdbeAddOp0(tls, _v, int32(55))
 28033  	if int32(_db.XmallocFailed) != int32(0) || _pParse.XcookieMask == (0) && _pParse.XpConstExpr == nil {
 28034  		goto _12
 28035  	}
 28036  	func() {
 28037  		if int32(_sqlite3VdbeGetOp(tls, _v, int32(0)).Xopcode) != int32(51) {
 28038  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99870), unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000), unsafe.Pointer(str(37400)))
 28039  			crt.X__builtin_abort(tls)
 28040  		}
 28041  	}()
 28042  	_sqlite3VdbeJumpHere(tls, _v, int32(0))
 28043  	_3_iDb = int32(0)
 28044  _15:
 28045  	if _3_iDb >= _db.XnDb {
 28046  		goto _18
 28047  	}
 28048  	if bool2int((_pParse.XcookieMask&(uint32(1)<<uint(_3_iDb))) != (0)) == int32(0) {
 28049  		goto _16
 28050  	}
 28051  	_sqlite3VdbeUsesBtree(tls, _v, _3_iDb)
 28052  	_4_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_3_iDb)).XpSchema)
 28053  	_sqlite3VdbeAddOp4Int(tls, _v, int32(2), _3_iDb, bool2int((_pParse.XwriteMask&(uint32(1)<<uint(_3_iDb))) != (0)), _4_pSchema.Xschema_cookie, _4_pSchema.XiGeneration)
 28054  	if int32(_db.Xinit.Xbusy) == int32(0) {
 28055  		_sqlite3VdbeChangeP5(tls, _v, uint16(1))
 28056  	}
 28057  	_sqlite3VdbeComment(tls, _v, str(37440), bool2int((_pParse.XmayAbort != 0) && (_pParse.XisMultiWrite != 0)))
 28058  _16:
 28059  	_3_iDb += 1
 28060  	goto _15
 28061  _18:
 28062  	_3_i = int32(0)
 28063  _22:
 28064  	if _3_i >= _pParse.XnVtabLock {
 28065  		goto _25
 28066  	}
 28067  	_5_vtab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, *elem61((**XTable)(unsafe.Pointer(_pParse.XapVtabLock)), uintptr(_3_i)))))
 28068  	_sqlite3VdbeAddOp4(tls, _v, int32(155), int32(0), int32(0), int32(0), _5_vtab, int32(-8))
 28069  	_3_i += 1
 28070  	goto _22
 28071  _25:
 28072  	_pParse.XnVtabLock = int32(0)
 28073  	_codeTableLocks(tls, _pParse)
 28074  	_sqlite3AutoincrementBegin(tls, _pParse)
 28075  	if _pParse.XpConstExpr == nil {
 28076  		goto _26
 28077  	}
 28078  	_6_pEL = (*XExprList)(_pParse.XpConstExpr)
 28079  	_pParse.XokConstFactor = 0
 28080  	_3_i = int32(0)
 28081  _27:
 28082  	if _3_i >= _6_pEL.XnExpr {
 28083  		goto _30
 28084  	}
 28085  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_6_pEL.Xa)), uintptr(_3_i)).XpExpr), *(*int32)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&_6_pEL.Xa)), uintptr(_3_i)).Xu))))
 28086  	_3_i += 1
 28087  	goto _27
 28088  _30:
 28089  _26:
 28090  	_sqlite3VdbeGoto(tls, _v, int32(1))
 28091  _12:
 28092  _9:
 28093  	if _v == nil || _pParse.XnErr != int32(0) || _db.XmallocFailed != 0 {
 28094  		goto _33
 28095  	}
 28096  	func() {
 28097  		if _pParse.XiCacheLevel != int32(0) {
 28098  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99924), unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000), unsafe.Pointer(str(37459)))
 28099  			crt.X__builtin_abort(tls)
 28100  		}
 28101  	}()
 28102  	if ((*XAutoincInfo)(_pParse.XpAinc) != nil) && (_pParse.XnTab == int32(0)) {
 28103  		_pParse.XnTab = int32(1)
 28104  	}
 28105  	_sqlite3VdbeMakeReady(tls, _v, _pParse)
 28106  	_pParse.Xrc = int32(101)
 28107  	goto _38
 28108  _33:
 28109  	_pParse.Xrc = int32(1)
 28110  _38:
 28111  }
 28112  
 28113  var _sqlite3FinishCodingØ00__func__Ø000 [20]int8
 28114  
 28115  func init() {
 28116  	crt.Xstrncpy(nil, &_sqlite3FinishCodingØ00__func__Ø000[0], str(37482), 20)
 28117  }
 28118  
 28119  func _sqlite3GetVdbe(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) {
 28120  	var _v *TVdbe
 28121  	_v = (*TVdbe)(_pParse.XpVdbe)
 28122  	return func() *TVdbe {
 28123  		if _v != nil {
 28124  			return _v
 28125  		}
 28126  		return _allocVdbe(tls, _pParse)
 28127  	}()
 28128  }
 28129  
 28130  // C comment
 28131  //  /*
 28132  //  ** Get a VDBE for the given parser context.  Create a new one if necessary.
 28133  //  ** If an error occurs, return NULL and leave a message in pParse.
 28134  //  */
 28135  func _allocVdbe(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) {
 28136  	var _v *TVdbe
 28137  	_v = store62((**TVdbe)(unsafe.Pointer(&_pParse.XpVdbe)), _sqlite3VdbeCreate(tls, _pParse))
 28138  	if _v != nil {
 28139  		_sqlite3VdbeAddOp2(tls, _v, int32(51), int32(0), int32(1))
 28140  	}
 28141  	if ((*XParse)(_pParse.XpToplevel) == nil) && ((int32((*Xsqlite3)(_pParse.Xdb).XdbOptFlags) & int32(8)) == int32(0)) {
 28142  		_pParse.XokConstFactor = uint8(1)
 28143  	}
 28144  	return _v
 28145  }
 28146  
 28147  // C comment
 28148  //  /*
 28149  //  ** Create a new virtual database engine.
 28150  //  */
 28151  func _sqlite3VdbeCreate(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) {
 28152  	var _db *Xsqlite3
 28153  	var _p *TVdbe
 28154  	_db = (*Xsqlite3)(_pParse.Xdb)
 28155  	_p = (*TVdbe)(_sqlite3DbMallocRawNN(tls, _db, uint64(288)))
 28156  	if _p == nil {
 28157  		return nil
 28158  	}
 28159  	crt.Xmemset(tls, unsafe.Pointer(&_p.XaOp), int32(0), uint64(184))
 28160  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 28161  	if _db.XpVdbe != nil {
 28162  		*(**TVdbe)(unsafe.Pointer(&((*TVdbe)(_db.XpVdbe).XpPrev))) = _p
 28163  	}
 28164  	*(**TVdbe)(unsafe.Pointer(&_p.XpNext)) = (*TVdbe)(_db.XpVdbe)
 28165  	*(**TVdbe)(unsafe.Pointer(&_p.XpPrev)) = nil
 28166  	*(**TVdbe)(unsafe.Pointer(&_db.XpVdbe)) = _p
 28167  	_p.Xmagic = uint32(381479589)
 28168  	*(**XParse)(unsafe.Pointer(&_p.XpParse)) = _pParse
 28169  	func() {
 28170  		if _pParse.XaLabel != nil {
 28171  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71456), unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000), unsafe.Pointer(str(37502)))
 28172  			crt.X__builtin_abort(tls)
 28173  		}
 28174  	}()
 28175  	func() {
 28176  		if _pParse.XnLabel != int32(0) {
 28177  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71457), unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000), unsafe.Pointer(str(37520)))
 28178  			crt.X__builtin_abort(tls)
 28179  		}
 28180  	}()
 28181  	func() {
 28182  		if _pParse.XnOpAlloc != int32(0) {
 28183  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71458), unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000), unsafe.Pointer(str(37538)))
 28184  			crt.X__builtin_abort(tls)
 28185  		}
 28186  	}()
 28187  	func() {
 28188  		if _pParse.XszOpAlloc != int32(0) {
 28189  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71459), unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000), unsafe.Pointer(str(37558)))
 28190  			crt.X__builtin_abort(tls)
 28191  		}
 28192  	}()
 28193  	return _p
 28194  }
 28195  
 28196  var _sqlite3VdbeCreateØ00__func__Ø000 [18]int8
 28197  
 28198  func init() {
 28199  	crt.Xstrncpy(nil, &_sqlite3VdbeCreateØ00__func__Ø000[0], str(37579), 18)
 28200  }
 28201  
 28202  func _sqlite3VdbeAddOp2(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32) (r0 int32) {
 28203  	return _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, int32(0))
 28204  }
 28205  
 28206  func _sqlite3VdbeAddOp3(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32) (r0 int32) {
 28207  	var _i, _2_jj, _2_kk int32
 28208  	var _2_pParse *XParse
 28209  	var _pOp *XVdbeOp
 28210  	var _3_x *TyColCache
 28211  	_i = _p.XnOp
 28212  	func() {
 28213  		if _p.Xmagic != uint32(381479589) {
 28214  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71595), unsafe.Pointer(&_sqlite3VdbeAddOp3Ø00__func__Ø000), unsafe.Pointer(str(37597)))
 28215  			crt.X__builtin_abort(tls)
 28216  		}
 28217  	}()
 28218  	func() {
 28219  		if _op < int32(0) || _op >= int32(255) {
 28220  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71596), unsafe.Pointer(&_sqlite3VdbeAddOp3Ø00__func__Ø000), unsafe.Pointer(str(37623)))
 28221  			crt.X__builtin_abort(tls)
 28222  		}
 28223  	}()
 28224  	if ((*XParse)(_p.XpParse).XnOpAlloc) <= _i {
 28225  		return _growOp3(tls, _p, _op, _p1, _p2, _p3)
 28226  	}
 28227  	_p.XnOp += 1
 28228  	_pOp = elem63((*XVdbeOp)(_p.XaOp), uintptr(_i))
 28229  	_pOp.Xopcode = uint8(_op)
 28230  	_pOp.Xp5 = 0
 28231  	_pOp.Xp1 = _p1
 28232  	_pOp.Xp2 = _p2
 28233  	_pOp.Xp3 = _p3
 28234  	*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)) = nil
 28235  	_pOp.Xp4type = 0
 28236  	_pOp.XzComment = nil
 28237  	if (((*Xsqlite3)(_p.Xdb).Xflags) & int32(4096)) == 0 {
 28238  		goto _6
 28239  	}
 28240  	_2_pParse = (*XParse)(_p.XpParse)
 28241  	_2_jj = store2(&_2_kk, int32(0))
 28242  _7:
 28243  	if _2_jj >= int32(_2_pParse.XnColCache) {
 28244  		goto _10
 28245  	}
 28246  	_3_x = (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer(&_2_pParse.XaColCache)) + uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer(uintptr(_2_jj)*uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer(uintptr(20)))))))))))
 28247  	crt.Xprintf(tls, str(37640), _3_x.XiReg, _3_x.XiTable, int32(_3_x.XiColumn))
 28248  	_2_kk += 1
 28249  	_2_jj += 1
 28250  	goto _7
 28251  _10:
 28252  	if _2_kk != 0 {
 28253  		crt.Xprintf(tls, str(37655))
 28254  	}
 28255  	_sqlite3VdbePrintOp(tls, nil, _i, elem63((*XVdbeOp)(_p.XaOp), uintptr(_i)))
 28256  	_test_addop_breakpoint(tls)
 28257  _6:
 28258  	return _i
 28259  }
 28260  
 28261  var _sqlite3VdbeAddOp3Ø00__func__Ø000 [18]int8
 28262  
 28263  func init() {
 28264  	crt.Xstrncpy(nil, &_sqlite3VdbeAddOp3Ø00__func__Ø000[0], str(37657), 18)
 28265  }
 28266  
 28267  // C comment
 28268  //  /*
 28269  //  ** Add a new instruction to the list of instructions current in the
 28270  //  ** VDBE.  Return the address of the new instruction.
 28271  //  **
 28272  //  ** Parameters:
 28273  //  **
 28274  //  **    p               Pointer to the VDBE
 28275  //  **
 28276  //  **    op              The opcode for this instruction
 28277  //  **
 28278  //  **    p1, p2, p3      Operands
 28279  //  **
 28280  //  ** Use the sqlite3VdbeResolveLabel() function to fix an address and
 28281  //  ** the sqlite3VdbeChangeP4() function to change the value of the P4
 28282  //  ** operand.
 28283  //  */
 28284  func _growOp3(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32) (r0 int32) {
 28285  	func() {
 28286  		if ((*XParse)(_p.XpParse).XnOpAlloc) > _p.XnOp {
 28287  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71585), unsafe.Pointer(&_growOp3Ø00__func__Ø000), unsafe.Pointer(str(37675)))
 28288  			crt.X__builtin_abort(tls)
 28289  		}
 28290  	}()
 28291  	if _growOpArray(tls, _p, int32(1)) != 0 {
 28292  		return int32(1)
 28293  	}
 28294  	func() {
 28295  		if ((*XParse)(_p.XpParse).XnOpAlloc) <= _p.XnOp {
 28296  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71587), unsafe.Pointer(&_growOp3Ø00__func__Ø000), unsafe.Pointer(str(37703)))
 28297  			crt.X__builtin_abort(tls)
 28298  		}
 28299  	}()
 28300  	return _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3)
 28301  }
 28302  
 28303  var _growOp3Ø00__func__Ø000 [8]int8
 28304  
 28305  func init() {
 28306  	crt.Xstrncpy(nil, &_growOp3Ø00__func__Ø000[0], str(37730), 8)
 28307  }
 28308  
 28309  // C comment
 28310  //  /*
 28311  //  ** Resize the Vdbe.aOp array so that it is at least nOp elements larger
 28312  //  ** than its current size. nOp is guaranteed to be less than or equal
 28313  //  ** to 1024/sizeof(Op).
 28314  //  **
 28315  //  ** If an out-of-memory error occurs while resizing the array, return
 28316  //  ** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain
 28317  //  ** unchanged (this is so that any opcodes already allocated can be
 28318  //  ** correctly deallocated along with the rest of the Vdbe).
 28319  //  */
 28320  func _growOpArray(tls *crt.TLS, _v *TVdbe, _nOp int32) (r0 int32) {
 28321  	var _nNew int32
 28322  	var _p *XParse
 28323  	var _pNew *XVdbeOp
 28324  	_p = (*XParse)(_v.XpParse)
 28325  	_nNew = func() int32 {
 28326  		if _p.XnOpAlloc != 0 {
 28327  			return (_p.XnOpAlloc * int32(2))
 28328  		}
 28329  		return int32(32)
 28330  	}()
 28331  
 28332  	if _nNew > (*elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_p.Xdb).XaLimit))), uintptr(5))) {
 28333  		_sqlite3OomFault(tls, (*Xsqlite3)(_p.Xdb))
 28334  		return int32(7)
 28335  	}
 28336  	func() {
 28337  		if uint64(_nOp) > uint64(32) {
 28338  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71546), unsafe.Pointer(&_growOpArrayØ00__func__Ø000), unsafe.Pointer(str(37738)))
 28339  			crt.X__builtin_abort(tls)
 28340  		}
 28341  	}()
 28342  	func() {
 28343  		if _nNew < (_p.XnOpAlloc + _nOp) {
 28344  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71547), unsafe.Pointer(&_growOpArrayØ00__func__Ø000), unsafe.Pointer(str(37761)))
 28345  			crt.X__builtin_abort(tls)
 28346  		}
 28347  	}()
 28348  	_pNew = (*XVdbeOp)(_sqlite3DbRealloc(tls, (*Xsqlite3)(_p.Xdb), _v.XaOp, uint64(_nNew)*uint64(32)))
 28349  	if _pNew != nil {
 28350  		_p.XszOpAlloc = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_pNew))
 28351  		_p.XnOpAlloc = int32(uint64(_p.XszOpAlloc) / uint64(32))
 28352  		*(**XVdbeOp)(unsafe.Pointer(&_v.XaOp)) = _pNew
 28353  	}
 28354  	return func() int32 {
 28355  		if _pNew != nil {
 28356  			return int32(0)
 28357  		}
 28358  		return _sqlite3NomemError(tls, int32(71554))
 28359  	}()
 28360  }
 28361  
 28362  var _growOpArrayØ00__func__Ø000 [12]int8
 28363  
 28364  func init() {
 28365  	crt.Xstrncpy(nil, &_growOpArrayØ00__func__Ø000[0], str(37785), 12)
 28366  }
 28367  
 28368  // C comment
 28369  //  /*
 28370  //  ** Print a single opcode.  This routine is used for debugging only.
 28371  //  */
 28372  func _sqlite3VdbePrintOp(tls *crt.TLS, _pOut *crt.XFILE, _pc int32, _pOp *XVdbeOp) {
 28373  	var _zP4 *int8
 28374  	var _zCom [100]int8
 28375  	var _zPtr [50]int8
 28376  	if _pOut == nil {
 28377  		_pOut = (*crt.XFILE)(Xstdout)
 28378  	}
 28379  	_zP4 = _displayP4(tls, _pOp, (*int8)(unsafe.Pointer(&_zPtr)), int32(50))
 28380  	_displayComment(tls, _pOp, _zP4, (*int8)(unsafe.Pointer(&_zCom)), int32(100))
 28381  	crt.Xfprintf(tls, _pOut, _sqlite3VdbePrintOpØ00zFormat1Ø001, _pc, unsafe.Pointer(_sqlite3OpcodeName(tls, int32(_pOp.Xopcode))), _pOp.Xp1, _pOp.Xp2, _pOp.Xp3, unsafe.Pointer(_zP4), int32(_pOp.Xp5), unsafe.Pointer(&_zCom))
 28382  	crt.Xfflush(tls, _pOut)
 28383  	_ = _zPtr
 28384  	_ = _zCom
 28385  }
 28386  
 28387  // C comment
 28388  //  /*
 28389  //  ** Compute a string that describes the P4 parameter for an opcode.
 28390  //  ** Use zTemp for any required temporary buffer space.
 28391  //  */
 28392  func _displayP4(tls *crt.TLS, _pOp *XVdbeOp, _zTemp *int8, _nTemp int32) (r0 *int8) {
 28393  	var _2_j, _17_i, _17_n int32
 28394  	var _17_ai *int32
 28395  	var _zP4, _3_zColl *int8
 28396  	var _10_pMem *XMem
 28397  	var _5_pDef, _6_pDef *XFuncDef
 28398  	var _x XStrAccum
 28399  	var _2_pKeyInfo *XKeyInfo
 28400  	var _3_pColl, _4_pColl *XCollSeq
 28401  	var _16_pVtab *Xsqlite3_vtab
 28402  	_zP4 = _zTemp
 28403  	func() {
 28404  		if _nTemp < int32(20) {
 28405  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72711), unsafe.Pointer(&_displayP4Ø00__func__Ø000), unsafe.Pointer(str(37797)))
 28406  			crt.X__builtin_abort(tls)
 28407  		}
 28408  	}()
 28409  	_sqlite3StrAccumInit(tls, &_x, nil, _zTemp, _nTemp, int32(0))
 28410  	switch int32(_pOp.Xp4type) {
 28411  	case int32(-16):
 28412  		goto _6
 28413  	case int32(-15):
 28414  		goto _15
 28415  	case int32(-14):
 28416  		goto _14
 28417  	case int32(-13):
 28418  		goto _13
 28419  	case int32(-12):
 28420  		goto _12
 28421  	case int32(-11):
 28422  		goto _8
 28423  	case int32(-10):
 28424  		goto _7
 28425  	case int32(-9):
 28426  		goto _9
 28427  	case int32(-8):
 28428  		goto _11
 28429  	case int32(-7):
 28430  		goto _10
 28431  	case int32(-5):
 28432  		goto _3
 28433  	case int32(-4):
 28434  		goto _5
 28435  	case int32(-3):
 28436  		goto _4
 28437  	default:
 28438  		goto _16
 28439  	}
 28440  
 28441  _3:
 28442  	_2_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 28443  	func() {
 28444  		if _2_pKeyInfo.XaSortOrder == nil {
 28445  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72717), unsafe.Pointer(&_displayP4Ø00__func__Ø000), unsafe.Pointer(str(37807)))
 28446  			crt.X__builtin_abort(tls)
 28447  		}
 28448  	}()
 28449  	_sqlite3XPrintf(tls, &_x, str(37831), int32(_2_pKeyInfo.XnField))
 28450  	_2_j = int32(0)
 28451  _19:
 28452  	if _2_j >= int32(_2_pKeyInfo.XnField) {
 28453  		goto _22
 28454  	}
 28455  	_3_pColl = *elem64((**XCollSeq)(unsafe.Pointer(&_2_pKeyInfo.XaColl)), uintptr(_2_j))
 28456  	_3_zColl = func() *int8 {
 28457  		if _3_pColl != nil {
 28458  			return _3_pColl.XzName
 28459  		}
 28460  		return str(284)
 28461  	}()
 28462  	if crt.Xstrcmp(tls, _3_zColl, str(37836)) == int32(0) {
 28463  		_3_zColl = str(37843)
 28464  	}
 28465  	_sqlite3XPrintf(tls, &_x, str(37845), unsafe.Pointer(func() *int8 {
 28466  		if (*elem15(_2_pKeyInfo.XaSortOrder, uintptr(_2_j))) != 0 {
 28467  			return str(37851)
 28468  		}
 28469  		return str(284)
 28470  	}()), unsafe.Pointer(_3_zColl))
 28471  	_2_j += 1
 28472  	goto _19
 28473  _22:
 28474  	_sqlite3StrAccumAppend(tls, &_x, str(37853), int32(1))
 28475  	goto _28
 28476  _4:
 28477  	_4_pColl = (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 28478  	_sqlite3XPrintf(tls, &_x, str(37855), unsafe.Pointer(_4_pColl.XzName))
 28479  	goto _28
 28480  _5:
 28481  	_5_pDef = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 28482  	_sqlite3XPrintf(tls, &_x, str(37863), unsafe.Pointer(_5_pDef.XzName), int32(_5_pDef.XnArg))
 28483  	goto _28
 28484  _6:
 28485  	_6_pDef = (*XFuncDef)((*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XpFunc)
 28486  	_sqlite3XPrintf(tls, &_x, str(37863), unsafe.Pointer(_6_pDef.XzName), int32(_6_pDef.XnArg))
 28487  	goto _28
 28488  _7:
 28489  	_sqlite3XPrintf(tls, &_x, str(6249), *(*(**int64)(unsafe.Pointer(&_pOp.Xp4))))
 28490  	goto _28
 28491  _8:
 28492  	_sqlite3XPrintf(tls, &_x, str(37870), *(*int32)(unsafe.Pointer(&_pOp.Xp4)))
 28493  	goto _28
 28494  _9:
 28495  	_sqlite3XPrintf(tls, &_x, str(7453), *(*(**float64)(unsafe.Pointer(&_pOp.Xp4))))
 28496  	goto _28
 28497  _10:
 28498  	_10_pMem = (*XMem)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 28499  	if (int32(_10_pMem.Xflags) & int32(2)) != 0 {
 28500  		_zP4 = _10_pMem.Xz
 28501  		goto _36
 28502  	}
 28503  	if (int32(_10_pMem.Xflags) & int32(4)) != 0 {
 28504  		_sqlite3XPrintf(tls, &_x, str(6249), *(*int64)(unsafe.Pointer(&_10_pMem.Xu)))
 28505  		goto _36
 28506  	}
 28507  	if (int32(_10_pMem.Xflags) & int32(8)) != 0 {
 28508  		_sqlite3XPrintf(tls, &_x, str(7453), *(*float64)(unsafe.Pointer(&_10_pMem.Xu)))
 28509  		goto _36
 28510  	}
 28511  	if (int32(_10_pMem.Xflags) & int32(1)) != 0 {
 28512  		_zP4 = str(285)
 28513  		goto _36
 28514  	}
 28515  	func() {
 28516  		if (int32(_10_pMem.Xflags) & int32(16)) == 0 {
 28517  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72774), unsafe.Pointer(&_displayP4Ø00__func__Ø000), unsafe.Pointer(str(37873)))
 28518  			crt.X__builtin_abort(tls)
 28519  		}
 28520  	}()
 28521  	_zP4 = str(37896)
 28522  _36:
 28523  	goto _28
 28524  _11:
 28525  	_16_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XpVtab)
 28526  	_sqlite3XPrintf(tls, &_x, str(37903), unsafe.Pointer(_16_pVtab))
 28527  	goto _28
 28528  _12:
 28529  	_17_ai = *(**int32)(unsafe.Pointer(&_pOp.Xp4))
 28530  	_17_n = *elem8(_17_ai, 0)
 28531  	_17_i = int32(1)
 28532  _39:
 28533  	if _17_i >= _17_n {
 28534  		goto _42
 28535  	}
 28536  	_sqlite3XPrintf(tls, &_x, str(37911), *elem8(_17_ai, uintptr(_17_i)))
 28537  	_17_i += 1
 28538  	goto _39
 28539  _42:
 28540  	*elem1(_zTemp, 0) = int8(91)
 28541  	_sqlite3StrAccumAppend(tls, &_x, str(37915), int32(1))
 28542  	goto _28
 28543  _13:
 28544  	_sqlite3XPrintf(tls, &_x, str(37917))
 28545  	goto _28
 28546  _14:
 28547  	*elem1(_zTemp, 0) = 0
 28548  	goto _28
 28549  _15:
 28550  	_sqlite3XPrintf(tls, &_x, str(24531), unsafe.Pointer((*XTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XzName))
 28551  	goto _28
 28552  _16:
 28553  	_zP4 = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 28554  	if _zP4 == nil {
 28555  		_zP4 = _zTemp
 28556  		*elem1(_zTemp, 0) = 0
 28557  	}
 28558  _28:
 28559  	_sqlite3StrAccumFinish(tls, &_x)
 28560  	func() {
 28561  		if _zP4 == nil {
 28562  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72819), unsafe.Pointer(&_displayP4Ø00__func__Ø000), unsafe.Pointer(str(37925)))
 28563  			crt.X__builtin_abort(tls)
 28564  		}
 28565  	}()
 28566  	return _zP4
 28567  }
 28568  
 28569  var _displayP4Ø00__func__Ø000 [10]int8
 28570  
 28571  func init() {
 28572  	crt.Xstrncpy(nil, &_displayP4Ø00__func__Ø000[0], str(37932), 10)
 28573  }
 28574  
 28575  // C comment
 28576  //  /*
 28577  //  ** variable-argument wrapper around sqlite3VXPrintf().  The bFlags argument
 28578  //  ** can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats.
 28579  //  */
 28580  func _sqlite3XPrintf(tls *crt.TLS, _p *XStrAccum, _zFormat *int8, args ...interface{}) {
 28581  	var _ap []interface{}
 28582  	_ap = args
 28583  	_sqlite3VXPrintf(tls, _p, _zFormat, _ap)
 28584  	_ap = nil
 28585  }
 28586  
 28587  // C comment
 28588  //  /*
 28589  //  ** Compute a string for the "comment" field of a VDBE opcode listing.
 28590  //  **
 28591  //  ** The Synopsis: field in comments in the vdbe.c source file gets converted
 28592  //  ** to an extra string that is appended to the sqlite3OpcodeName().  In the
 28593  //  ** absence of other comments, this synopsis becomes the comment on the opcode.
 28594  //  ** Some translation occurs:
 28595  //  **
 28596  //  **       "PX"      ->  "r[X]"
 28597  //  **       "PX@PY"   ->  "r[X..X+Y-1]"  or "r[x]" if y is 0 or 1
 28598  //  **       "PX@PY+1" ->  "r[X..X+Y]"    or "r[x]" if y is 0
 28599  //  **       "PY..PY"  ->  "r[X..Y]"      or "r[x]" if y<=x
 28600  //  */
 28601  func _displayComment(tls *crt.TLS, _pOp *XVdbeOp, _zP4 *int8, _zTemp *int8, _nTemp int32) (r0 int32) {
 28602  	var _nOpName, _ii, _jj, _1_seenCom, _9_v1, _9_v2 int32
 28603  	var _1_c int8
 28604  	var _zOpName, _zSynopsis *int8
 28605  	var _zAlt [50]int8
 28606  	_zOpName = _sqlite3OpcodeName(tls, int32(_pOp.Xopcode))
 28607  	_nOpName = _sqlite3Strlen30(tls, _zOpName)
 28608  	if (*elem1(_zOpName, uintptr(_nOpName+int32(1)))) == 0 {
 28609  		goto _0
 28610  	}
 28611  	_1_seenCom = int32(0)
 28612  	_zSynopsis = store1(func() (**int8, *int8) { p := &_zOpName; return p, elem1(*p, uintptr(_nOpName+int32(1))) }())
 28613  	if crt.Xstrncmp(tls, _zSynopsis, str(37942), uint64(3)) != int32(0) {
 28614  		goto _1
 28615  	}
 28616  	if (int32(_pOp.Xp5) & int32(32)) != 0 {
 28617  		Xsqlite3_snprintf(tls, int32(50), (*int8)(unsafe.Pointer(&_zAlt)), str(37946), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(int32(3))))))
 28618  		goto _3
 28619  	}
 28620  	Xsqlite3_snprintf(tls, int32(50), (*int8)(unsafe.Pointer(&_zAlt)), str(37959), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(int32(3))))))
 28621  _3:
 28622  	_zSynopsis = (*int8)(unsafe.Pointer(&_zAlt))
 28623  _1:
 28624  	_ii = store2(&_jj, int32(0))
 28625  _4:
 28626  	if _jj >= (_nTemp-int32(1)) || int32(store5(&_1_c, *elem1(_zSynopsis, uintptr(_ii)))) == int32(0) {
 28627  		goto _8
 28628  	}
 28629  	if int32(_1_c) != int32(80) {
 28630  		goto _9
 28631  	}
 28632  	_1_c = *elem1(_zSynopsis, uintptr(preInc2(&_ii, 1)))
 28633  	if int32(_1_c) == int32(52) {
 28634  		Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(24531), unsafe.Pointer(_zP4))
 28635  		goto _13
 28636  	}
 28637  	if int32(_1_c) == int32(88) {
 28638  		Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(24531), unsafe.Pointer(_pOp.XzComment))
 28639  		_1_seenCom = int32(1)
 28640  		goto _13
 28641  	}
 28642  	_9_v1 = _translateP(tls, _1_c, _pOp)
 28643  	Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(37870), _9_v1)
 28644  	if crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(_ii)))))+uintptr(int32(1)))), str(37973), uint64(2)) != int32(0) {
 28645  		goto _14
 28646  	}
 28647  	_ii += int32(3)
 28648  	_jj += _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))))
 28649  	_9_v2 = _translateP(tls, *elem1(_zSynopsis, uintptr(_ii)), _pOp)
 28650  	if crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(_ii)))))+uintptr(int32(1)))), str(37976), uint64(2)) == int32(0) {
 28651  		_ii += int32(2)
 28652  		_9_v2 += 1
 28653  	}
 28654  	if _9_v2 > int32(1) {
 28655  		Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(37979), (_9_v1+_9_v2)-int32(1))
 28656  	}
 28657  	goto _19
 28658  _14:
 28659  	if (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(_ii)))))+uintptr(int32(1)))), str(37984), uint64(4)) == int32(0)) && (_pOp.Xp3 == int32(0)) {
 28660  		_ii += int32(4)
 28661  	}
 28662  _19:
 28663  _13:
 28664  	_jj += _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))))
 28665  	goto _20
 28666  _9:
 28667  	*elem1(_zTemp, uintptr(postInc2(&_jj, 1))) = _1_c
 28668  _20:
 28669  	_ii += 1
 28670  	goto _4
 28671  _8:
 28672  	if ((_1_seenCom == 0) && (_jj < (_nTemp - int32(5)))) && (_pOp.XzComment != nil) {
 28673  		Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(37989), unsafe.Pointer(_pOp.XzComment))
 28674  		_jj += _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))))
 28675  	}
 28676  	if _jj < _nTemp {
 28677  		*elem1(_zTemp, uintptr(_jj)) = 0
 28678  	}
 28679  	goto _27
 28680  _0:
 28681  	if _pOp.XzComment != nil {
 28682  		Xsqlite3_snprintf(tls, _nTemp, _zTemp, str(24531), unsafe.Pointer(_pOp.XzComment))
 28683  		_jj = _sqlite3Strlen30(tls, _zTemp)
 28684  		goto _27
 28685  	}
 28686  	*elem1(_zTemp, 0) = 0
 28687  	_jj = int32(0)
 28688  _27:
 28689  	return _jj
 28690  
 28691  	_ = _zAlt
 28692  	panic(0)
 28693  }
 28694  
 28695  func _sqlite3OpcodeName(tls *crt.TLS, _i int32) (r0 *int8) {
 28696  	return *elem0((**int8)(unsafe.Pointer(&_sqlite3OpcodeNameØ00azNameØ001)), uintptr(_i))
 28697  }
 28698  
 28699  var _sqlite3OpcodeNameØ00azNameØ001 [166]*int8
 28700  
 28701  func init() {
 28702  	_sqlite3OpcodeNameØ00azNameØ001 = [166]*int8{str(37994), str(38005), str(38017), str(38030), str(38042), str(38054), str(38066), str(38072), str(38078), str(38090), str(38103), str(38111), str(38142), str(38164), str(38170), str(38177), str(38192), str(38199), str(38210), str(38216), str(38234), str(38240), str(38244), str(38251), str(38300), str(38320), str(38340), str(38360), str(38380), str(38404), str(38426), str(38445), str(38468), str(38491), str(38497), str(38508), str(38520), str(38526), str(38534), str(38553), str(38572), str(38591), str(38610), str(38638), str(38680), str(38689), str(38722), str(38763), str(38807), str(38844), str(38856), str(38863), str(38880), str(38888), str(38902), str(38932), str(38938), str(38955), str(38970), str(38997), str(39017), str(39037), str(39060), str(39092), str(39115), str(39142), str(39160), str(39180), str(39206), str(39215), str(39246), str(39272), str(39299), str(39329), str(39351), str(39365), str(39395), str(39426), str(39445), str(39464), str(39482), str(39501), str(39519), str(39538), str(39549), str(39574), str(39598), str(39627), str(39657), str(39679), str(39706), str(39733), str(39758), str(39786), str(39811), str(39832), str(39853), str(39866), str(39885), str(39915), str(39931), str(39959), str(39992), str(40012), str(40024), str(40035), str(40060), str(40084), str(40109), str(40118), str(40143), str(40168), str(40180), str(40224), str(40255), str(40262), str(40275), str(40307), str(40328), str(40359), str(40390), str(40398), str(40410), str(40459), str(40481), str(40500), str(40518), str(40527), str(40550), str(40570), str(40593), str(40618), str(40639), str(40653), str(40662), str(40669), str(40682), str(40712), str(40742), str(40751), str(40764), str(40778), str(40789), str(40800), str(40813), str(40826), str(40853), str(40860), str(40884), str(40914), str(40983), str(41019), str(41054), str(41080), str(41088), str(41122), str(41130), str(41139), str(41149), str(41156), str(41182), str(41191), str(41202), str(41212), str(41224), str(41230)}
 28703  }
 28704  
 28705  // C comment
 28706  //  /*
 28707  //  ** Return an integer value for one of the parameters to the opcode pOp
 28708  //  ** determined by character c.
 28709  //  */
 28710  func _translateP(tls *crt.TLS, _c int8, _pOp *XVdbeOp) (r0 int32) {
 28711  	if int32(_c) == int32(49) {
 28712  		return _pOp.Xp1
 28713  	}
 28714  	if int32(_c) == int32(50) {
 28715  		return _pOp.Xp2
 28716  	}
 28717  	if int32(_c) == int32(51) {
 28718  		return _pOp.Xp3
 28719  	}
 28720  	if int32(_c) == int32(52) {
 28721  		return *(*int32)(unsafe.Pointer(&_pOp.Xp4))
 28722  	}
 28723  	return int32(_pOp.Xp5)
 28724  }
 28725  
 28726  var _sqlite3VdbePrintOpØ00zFormat1Ø001 *int8
 28727  
 28728  func init() {
 28729  	_sqlite3VdbePrintOpØ00zFormat1Ø001 = str(41239)
 28730  }
 28731  
 28732  // C comment
 28733  //  /* This routine is just a convenient place to set a breakpoint that will
 28734  //  ** fire after each opcode is inserted and displayed using
 28735  //  ** "PRAGMA vdbe_addoptrace=on".
 28736  //  */
 28737  func _test_addop_breakpoint(tls *crt.TLS) {
 28738  	_test_addop_breakpointØ00nØ001 += 1
 28739  }
 28740  
 28741  var _test_addop_breakpointØ00nØ001 int32
 28742  
 28743  // C comment
 28744  //  /*
 28745  //  ** Check if the program stored in the VM associated with pParse may
 28746  //  ** throw an ABORT exception (causing the statement, but not entire transaction
 28747  //  ** to be rolled back). This condition is true if the main program or any
 28748  //  ** sub-programs contains any of the following:
 28749  //  **
 28750  //  **   *  OP_Halt with P1=SQLITE_CONSTRAINT and P2=OE_Abort.
 28751  //  **   *  OP_HaltIfNull with P1=SQLITE_CONSTRAINT and P2=OE_Abort.
 28752  //  **   *  OP_Destroy
 28753  //  **   *  OP_VUpdate
 28754  //  **   *  OP_VRename
 28755  //  **   *  OP_FkCounter with P2==0 (immediate foreign key constraint)
 28756  //  **   *  OP_CreateTable and OP_InitCoroutine (for CREATE TABLE AS SELECT ...)
 28757  //  **
 28758  //  ** Then check that the value of Parse.mayAbort is true if an
 28759  //  ** ABORT may be thrown, or false otherwise. Return true if it does
 28760  //  ** match, or false otherwise. This function is intended to be used as
 28761  //  ** part of an assert statement in the compiler. Similar to:
 28762  //  **
 28763  //  **   assert( sqlite3VdbeAssertMayAbort(pParse->pVdbe, pParse->mayAbort) );
 28764  //  */
 28765  func _sqlite3VdbeAssertMayAbort(tls *crt.TLS, _v *TVdbe, _mayAbort int32) (r0 int32) {
 28766  	var _hasAbort, _hasFkCounter, _hasCreateTable, _hasInitCoroutine, _1_opcode int32
 28767  	var _pOp *XVdbeOp
 28768  	var _sIter XVdbeOpIter
 28769  	_hasAbort = int32(0)
 28770  	_hasFkCounter = int32(0)
 28771  	_hasCreateTable = int32(0)
 28772  	_hasInitCoroutine = int32(0)
 28773  	crt.Xmemset(tls, unsafe.Pointer(&_sIter), int32(0), uint64(32))
 28774  	*(**TVdbe)(unsafe.Pointer(&_sIter.Xv)) = _v
 28775  _0:
 28776  	if store63(&_pOp, _opIterNext(tls, &_sIter)) == nil {
 28777  		goto _1
 28778  	}
 28779  	_1_opcode = int32(_pOp.Xopcode)
 28780  	if (((_1_opcode == int32(133)) || (_1_opcode == int32(12))) || (_1_opcode == int32(160))) || (((_1_opcode == int32(55)) || (_1_opcode == int32(54))) && (((_pOp.Xp1 & int32(255)) == int32(19)) && (_pOp.Xp2 == int32(2)))) {
 28781  		_hasAbort = int32(1)
 28782  		goto _1
 28783  	}
 28784  	if _1_opcode == int32(137) {
 28785  		_hasCreateTable = int32(1)
 28786  	}
 28787  	if _1_opcode == int32(15) {
 28788  		_hasInitCoroutine = int32(1)
 28789  	}
 28790  	if ((_1_opcode == int32(147)) && (_pOp.Xp1 == int32(0))) && (_pOp.Xp2 == int32(1)) {
 28791  		_hasFkCounter = int32(1)
 28792  	}
 28793  	goto _0
 28794  _1:
 28795  	_sqlite3DbFree(tls, (*Xsqlite3)(_v.Xdb), unsafe.Pointer(_sIter.XapSub))
 28796  	return bool2int((((((*Xsqlite3)(_v.Xdb).XmallocFailed) != 0) || (_hasAbort == _mayAbort)) || _hasFkCounter != 0) || (_hasCreateTable != 0 && _hasInitCoroutine != 0))
 28797  }
 28798  
 28799  func _opIterNext(tls *crt.TLS, _p *XVdbeOpIter) (r0 *XVdbeOp) {
 28800  	var _nOp, _5_nByte, _5_j int32
 28801  	var _v *TVdbe
 28802  	var _pRet, _aOp *XVdbeOp
 28803  	_v = (*TVdbe)(_p.Xv)
 28804  	_pRet = nil
 28805  	if _p.XiSub > _p.XnSub {
 28806  		goto _0
 28807  	}
 28808  	if _p.XiSub == int32(0) {
 28809  		_aOp = (*XVdbeOp)(_v.XaOp)
 28810  		_nOp = _v.XnOp
 28811  		goto _2
 28812  	}
 28813  	_aOp = (*XVdbeOp)((*elem65((**XSubProgram)(unsafe.Pointer(_p.XapSub)), uintptr(_p.XiSub-int32(1)))).XaOp)
 28814  	_nOp = (*elem65((**XSubProgram)(unsafe.Pointer(_p.XapSub)), uintptr(_p.XiSub-int32(1)))).XnOp
 28815  _2:
 28816  	func() {
 28817  		if _p.XiAddr >= _nOp {
 28818  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71866), unsafe.Pointer(&_opIterNextØ00__func__Ø000), unsafe.Pointer(str(41276)))
 28819  			crt.X__builtin_abort(tls)
 28820  		}
 28821  	}()
 28822  	_pRet = elem63(_aOp, uintptr(_p.XiAddr))
 28823  	_p.XiAddr += 1
 28824  	if _p.XiAddr == _nOp {
 28825  		_p.XiSub += 1
 28826  		_p.XiAddr = int32(0)
 28827  	}
 28828  	if int32(_pRet.Xp4type) != int32(-13) {
 28829  		goto _6
 28830  	}
 28831  	_5_nByte = int32(uint64(_p.XnSub+int32(1)) * uint64(8))
 28832  	_5_j = int32(0)
 28833  _7:
 28834  	if _5_j >= _p.XnSub {
 28835  		goto _10
 28836  	}
 28837  	if (*elem65((**XSubProgram)(unsafe.Pointer(_p.XapSub)), uintptr(_5_j))) == (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer(&_pRet.Xp4))) {
 28838  		goto _10
 28839  	}
 28840  	_5_j += 1
 28841  	goto _7
 28842  _10:
 28843  	if _5_j != _p.XnSub {
 28844  		goto _12
 28845  	}
 28846  	*(***XSubProgram)(unsafe.Pointer(&_p.XapSub)) = (**XSubProgram)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_v.Xdb), unsafe.Pointer(_p.XapSub), uint64(_5_nByte)))
 28847  	if _p.XapSub == nil {
 28848  		_pRet = nil
 28849  		goto _14
 28850  	}
 28851  	*elem65((**XSubProgram)(unsafe.Pointer(_p.XapSub)), uintptr(postInc2(&_p.XnSub, 1))) = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer(&_pRet.Xp4)))
 28852  _14:
 28853  _12:
 28854  _6:
 28855  _0:
 28856  	return _pRet
 28857  }
 28858  
 28859  var _opIterNextØ00__func__Ø000 [11]int8
 28860  
 28861  func init() {
 28862  	crt.Xstrncpy(nil, &_opIterNextØ00__func__Ø000[0], str(41289), 11)
 28863  }
 28864  
 28865  func _sqlite3VdbeAddOp0(tls *crt.TLS, _p *TVdbe, _op int32) (r0 int32) {
 28866  	return _sqlite3VdbeAddOp3(tls, _p, _op, int32(0), int32(0), int32(0))
 28867  }
 28868  
 28869  // C comment
 28870  //  /*
 28871  //  ** Return the opcode for a given address.  If the address is -1, then
 28872  //  ** return the most recently inserted opcode.
 28873  //  **
 28874  //  ** If a memory allocation error has occurred prior to the calling of this
 28875  //  ** routine, then a pointer to a dummy VdbeOp will be returned.  That opcode
 28876  //  ** is readable but not writable, though it is cast to a writable value.
 28877  //  ** The return of a dummy opcode allows the call to continue functioning
 28878  //  ** after an OOM fault without having to check to see if the return from
 28879  //  ** this routine is a valid pointer.  But because the dummy.opcode is 0,
 28880  //  ** dummy will never be written to.  This is verified by code inspection and
 28881  //  ** by running with Valgrind.
 28882  //  */
 28883  func _sqlite3VdbeGetOp(tls *crt.TLS, _p *TVdbe, _addr int32) (r0 *XVdbeOp) {
 28884  	func() {
 28885  		if _p.Xmagic != uint32(381479589) {
 28886  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72518), unsafe.Pointer(&_sqlite3VdbeGetOpØ00__func__Ø000), unsafe.Pointer(str(37597)))
 28887  			crt.X__builtin_abort(tls)
 28888  		}
 28889  	}()
 28890  	if _addr < int32(0) {
 28891  		_addr = _p.XnOp - int32(1)
 28892  	}
 28893  	func() {
 28894  		if (_addr < int32(0) || _addr >= _p.XnOp) && ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 28895  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72522), unsafe.Pointer(&_sqlite3VdbeGetOpØ00__func__Ø000), unsafe.Pointer(str(41300)))
 28896  			crt.X__builtin_abort(tls)
 28897  		}
 28898  	}()
 28899  	if ((*Xsqlite3)(_p.Xdb).XmallocFailed) != 0 {
 28900  		return &_sqlite3VdbeGetOpØ00dummyØ001
 28901  	}
 28902  	return elem63((*XVdbeOp)(_p.XaOp), uintptr(_addr))
 28903  }
 28904  
 28905  var _sqlite3VdbeGetOpØ00__func__Ø000 [17]int8
 28906  
 28907  func init() {
 28908  	crt.Xstrncpy(nil, &_sqlite3VdbeGetOpØ00__func__Ø000[0], str(41348), 17)
 28909  }
 28910  
 28911  var _sqlite3VdbeGetOpØ00dummyØ001 XVdbeOp
 28912  
 28913  // C comment
 28914  //  /*
 28915  //  ** Change the P2 operand of instruction addr so that it points to
 28916  //  ** the address of the next instruction to be coded.
 28917  //  */
 28918  func _sqlite3VdbeJumpHere(tls *crt.TLS, _p *TVdbe, _addr int32) {
 28919  	_sqlite3VdbeChangeP2(tls, _p, uint32(_addr), _p.XnOp)
 28920  }
 28921  
 28922  func _sqlite3VdbeChangeP2(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) {
 28923  	_sqlite3VdbeGetOp(tls, _p, int32(_addr)).Xp2 = _val
 28924  }
 28925  
 28926  // C comment
 28927  //  /*
 28928  //  ** Declare to the Vdbe that the BTree object at db->aDb[i] is used.
 28929  //  **
 28930  //  ** The prepared statements need to know in advance the complete set of
 28931  //  ** attached databases that will be use.  A mask of these databases
 28932  //  ** is maintained in p->btreeMask.  The p->lockMask value is the subset of
 28933  //  ** p->btreeMask of databases that will require a lock.
 28934  //  */
 28935  func _sqlite3VdbeUsesBtree(tls *crt.TLS, _p *TVdbe, _i int32) {
 28936  	func() {
 28937  		if _i < int32(0) || _i >= ((*Xsqlite3)(_p.Xdb).XnDb) || _i >= int32(32) {
 28938  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72833), unsafe.Pointer(&_sqlite3VdbeUsesBtreeØ00__func__Ø000), unsafe.Pointer(str(41365)))
 28939  			crt.X__builtin_abort(tls)
 28940  		}
 28941  	}()
 28942  	func() {
 28943  		if _i >= int32(32) {
 28944  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72834), unsafe.Pointer(&_sqlite3VdbeUsesBtreeØ00__func__Ø000), unsafe.Pointer(str(41414)))
 28945  			crt.X__builtin_abort(tls)
 28946  		}
 28947  	}()
 28948  	_p.XbtreeMask |= uint32(1) << uint(_i)
 28949  	if (_i != int32(1)) && _sqlite3BtreeSharable(tls, (*XBtree)(elem27((*XDb)((*Xsqlite3)(_p.Xdb).XaDb), uintptr(_i)).XpBt)) != 0 {
 28950  		_p.XlockMask |= uint32(1) << uint(_i)
 28951  	}
 28952  }
 28953  
 28954  var _sqlite3VdbeUsesBtreeØ00__func__Ø000 [21]int8
 28955  
 28956  func init() {
 28957  	crt.Xstrncpy(nil, &_sqlite3VdbeUsesBtreeØ00__func__Ø000[0], str(41444), 21)
 28958  }
 28959  
 28960  // C comment
 28961  //  /*
 28962  //  ** Return true if the Btree passed as the only argument is sharable.
 28963  //  */
 28964  func _sqlite3BtreeSharable(tls *crt.TLS, _p *XBtree) (r0 int32) {
 28965  	return int32(_p.Xsharable)
 28966  }
 28967  
 28968  // C comment
 28969  //  /*
 28970  //  ** Add an opcode that includes the p4 value as an integer.
 28971  //  */
 28972  func _sqlite3VdbeAddOp4Int(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _p4 int32) (r0 int32) {
 28973  	var _addr int32
 28974  	var _1_pOp *XVdbeOp
 28975  	_addr = _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3)
 28976  	if int32((*Xsqlite3)(_p.Xdb).XmallocFailed) == int32(0) {
 28977  		_1_pOp = elem63((*XVdbeOp)(_p.XaOp), uintptr(_addr))
 28978  		_1_pOp.Xp4type = int8(-11)
 28979  		*(*int32)(unsafe.Pointer(&_1_pOp.Xp4)) = _p4
 28980  	}
 28981  	return _addr
 28982  }
 28983  
 28984  func _sqlite3VdbeChangeP5(tls *crt.TLS, _p *TVdbe, _p5 uint16) {
 28985  	func() {
 28986  		if _p.XnOp <= int32(0) && ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 28987  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72215), unsafe.Pointer(&_sqlite3VdbeChangeP5Ø00__func__Ø000), unsafe.Pointer(str(41465)))
 28988  			crt.X__builtin_abort(tls)
 28989  		}
 28990  	}()
 28991  	if _p.XnOp > int32(0) {
 28992  		elem63((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1))).Xp5 = _p5
 28993  	}
 28994  }
 28995  
 28996  var _sqlite3VdbeChangeP5Ø00__func__Ø000 [20]int8
 28997  
 28998  func init() {
 28999  	crt.Xstrncpy(nil, &_sqlite3VdbeChangeP5Ø00__func__Ø000[0], str(41497), 20)
 29000  }
 29001  
 29002  func _sqlite3VdbeComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interface{}) {
 29003  	var _ap []interface{}
 29004  	if _p != nil {
 29005  		_ap = args
 29006  		_vdbeVComment(tls, _p, _zFormat, _ap)
 29007  		_ap = nil
 29008  	}
 29009  }
 29010  
 29011  // C comment
 29012  //  /*
 29013  //  ** Change the comment on the most recently coded instruction.  Or
 29014  //  ** insert a No-op and add the comment to that new instruction.  This
 29015  //  ** makes the code easier to read during debugging.  None of this happens
 29016  //  ** in a production build.
 29017  //  */
 29018  func _vdbeVComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, _ap []interface{}) {
 29019  	func() {
 29020  		if _p.XnOp <= int32(0) && (*XVdbeOp)(_p.XaOp) != nil {
 29021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72465), unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000), unsafe.Pointer(str(41517)))
 29022  			crt.X__builtin_abort(tls)
 29023  		}
 29024  	}()
 29025  	func() {
 29026  		if (*XVdbeOp)(_p.XaOp) != nil && (elem63((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1))).XzComment) != nil && ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 29027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72466), unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000), unsafe.Pointer(str(41539)))
 29028  			crt.X__builtin_abort(tls)
 29029  		}
 29030  	}()
 29031  	if _p.XnOp != 0 {
 29032  		func() {
 29033  			if _p.XaOp == nil {
 29034  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72468), unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000), unsafe.Pointer(str(41604)))
 29035  				crt.X__builtin_abort(tls)
 29036  			}
 29037  		}()
 29038  		_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(elem63((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1))).XzComment))
 29039  		elem63((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1))).XzComment = _sqlite3VMPrintf(tls, (*Xsqlite3)(_p.Xdb), _zFormat, _ap)
 29040  	}
 29041  }
 29042  
 29043  var _vdbeVCommentØ00__func__Ø000 [13]int8
 29044  
 29045  func init() {
 29046  	crt.Xstrncpy(nil, &_vdbeVCommentØ00__func__Ø000[0], str(41611), 13)
 29047  }
 29048  
 29049  // C comment
 29050  //  /*
 29051  //  ** pTab is a pointer to a Table structure representing a virtual-table.
 29052  //  ** Return a pointer to the VTable object used by connection db to access
 29053  //  ** this virtual-table, if one has been created, or NULL otherwise.
 29054  //  */
 29055  func _sqlite3GetVTable(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable) (r0 *XVTable) {
 29056  	var _pVtab *XVTable
 29057  	func() {
 29058  		if _pTab.XnModuleArg == 0 {
 29059  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125131), unsafe.Pointer(&_sqlite3GetVTableØ00__func__Ø000), unsafe.Pointer(str(24484)))
 29060  			crt.X__builtin_abort(tls)
 29061  		}
 29062  	}()
 29063  	_pVtab = (*XVTable)(_pTab.XpVTable)
 29064  _2:
 29065  	if _pVtab == nil || (*Xsqlite3)(_pVtab.Xdb) == _db {
 29066  		goto _6
 29067  	}
 29068  	_pVtab = (*XVTable)(_pVtab.XpNext)
 29069  	goto _2
 29070  _6:
 29071  	return _pVtab
 29072  }
 29073  
 29074  var _sqlite3GetVTableØ00__func__Ø000 [17]int8
 29075  
 29076  func init() {
 29077  	crt.Xstrncpy(nil, &_sqlite3GetVTableØ00__func__Ø000[0], str(41624), 17)
 29078  }
 29079  
 29080  // C comment
 29081  //  /*
 29082  //  ** Add an opcode that includes the p4 value as a pointer.
 29083  //  */
 29084  func _sqlite3VdbeAddOp4(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _zP4 *int8, _p4type int32) (r0 int32) {
 29085  	var _addr int32
 29086  	_addr = _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3)
 29087  	_sqlite3VdbeChangeP4(tls, _p, _addr, _zP4, _p4type)
 29088  	return _addr
 29089  }
 29090  
 29091  func _sqlite3VdbeChangeP4(tls *crt.TLS, _p *TVdbe, _addr int32, _zP4 *int8, _n int32) {
 29092  	var _db *Xsqlite3
 29093  	var _pOp *XVdbeOp
 29094  	func() {
 29095  		if _p == nil {
 29096  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72388), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(807)))
 29097  			crt.X__builtin_abort(tls)
 29098  		}
 29099  	}()
 29100  	_db = (*Xsqlite3)(_p.Xdb)
 29101  	func() {
 29102  		if _p.Xmagic != uint32(381479589) {
 29103  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72390), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(37597)))
 29104  			crt.X__builtin_abort(tls)
 29105  		}
 29106  	}()
 29107  	func() {
 29108  		if (*XVdbeOp)(_p.XaOp) == nil && _db.XmallocFailed == 0 {
 29109  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72391), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(41641)))
 29110  			crt.X__builtin_abort(tls)
 29111  		}
 29112  	}()
 29113  	if _db.XmallocFailed == 0 {
 29114  		goto _7
 29115  	}
 29116  	if _n != int32(-8) {
 29117  		_freeP4(tls, _db, _n, unsafe.Pointer(_zP4))
 29118  	}
 29119  	return
 29120  _7:
 29121  	func() {
 29122  		if _p.XnOp <= int32(0) {
 29123  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72396), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(41671)))
 29124  			crt.X__builtin_abort(tls)
 29125  		}
 29126  	}()
 29127  	func() {
 29128  		if _addr >= _p.XnOp {
 29129  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72397), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(41680)))
 29130  			crt.X__builtin_abort(tls)
 29131  		}
 29132  	}()
 29133  	if _addr < int32(0) {
 29134  		_addr = _p.XnOp - int32(1)
 29135  	}
 29136  	_pOp = elem63((*XVdbeOp)(_p.XaOp), uintptr(_addr))
 29137  	if (_n >= int32(0)) || (_pOp.Xp4type != 0) {
 29138  		_vdbeChangeP4Full(tls, _p, _pOp, _zP4, _n)
 29139  		return
 29140  	}
 29141  	if _n == int32(-11) {
 29142  		*(*int32)(unsafe.Pointer(&_pOp.Xp4)) = int32(int64(crt.P2U(unsafe.Pointer(_zP4))))
 29143  		_pOp.Xp4type = int8(-11)
 29144  		goto _18
 29145  	}
 29146  	if _zP4 == nil {
 29147  		goto _18
 29148  	}
 29149  	func() {
 29150  		if _n >= int32(0) {
 29151  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72412), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(41692)))
 29152  			crt.X__builtin_abort(tls)
 29153  		}
 29154  	}()
 29155  	*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)) = unsafe.Pointer(_zP4)
 29156  	_pOp.Xp4type = int8(_n)
 29157  	if _n == int32(-8) {
 29158  		_sqlite3VtabLock(tls, (*XVTable)(unsafe.Pointer(_zP4)))
 29159  	}
 29160  _18:
 29161  }
 29162  
 29163  var _sqlite3VdbeChangeP4Ø00__func__Ø000 [20]int8
 29164  
 29165  func init() {
 29166  	crt.Xstrncpy(nil, &_sqlite3VdbeChangeP4Ø00__func__Ø000[0], str(41696), 20)
 29167  }
 29168  
 29169  func _freeP4(tls *crt.TLS, _db *Xsqlite3, _p4type int32, _p4 unsafe.Pointer) {
 29170  	func() {
 29171  		if _db == nil {
 29172  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72252), unsafe.Pointer(&_freeP4Ø00__func__Ø000), unsafe.Pointer(str(9430)))
 29173  			crt.X__builtin_abort(tls)
 29174  		}
 29175  	}()
 29176  	switch _p4type {
 29177  	case int32(-16):
 29178  		goto _3
 29179  	case int32(-12):
 29180  		goto _4
 29181  	case int32(-10):
 29182  		goto _4
 29183  	case int32(-9):
 29184  		goto _4
 29185  	case int32(-8):
 29186  		goto _11
 29187  	case int32(-7):
 29188  		goto _10
 29189  	case int32(-5):
 29190  		goto _8
 29191  	case int32(-4):
 29192  		goto _9
 29193  	case int32(-1):
 29194  		goto _4
 29195  	default:
 29196  		goto _12
 29197  	}
 29198  
 29199  _3:
 29200  	_freeP4FuncCtx(tls, _db, (*Xsqlite3_context)(_p4))
 29201  	goto _12
 29202  _4:
 29203  	_sqlite3DbFree(tls, _db, _p4)
 29204  	goto _12
 29205  _8:
 29206  	if _db.XpnBytesFreed == nil {
 29207  		_sqlite3KeyInfoUnref(tls, (*XKeyInfo)(_p4))
 29208  	}
 29209  	goto _12
 29210  _9:
 29211  	_freeEphemeralFunction(tls, _db, (*XFuncDef)(_p4))
 29212  	goto _12
 29213  _10:
 29214  	if _db.XpnBytesFreed == nil {
 29215  		_sqlite3ValueFree(tls, (*XMem)(_p4))
 29216  		goto _15
 29217  	}
 29218  	_freeP4Mem(tls, _db, (*XMem)(_p4))
 29219  _15:
 29220  	goto _12
 29221  _11:
 29222  	if _db.XpnBytesFreed == nil {
 29223  		_sqlite3VtabUnlock(tls, (*XVTable)(_p4))
 29224  	}
 29225  	goto _12
 29226  _12:
 29227  }
 29228  
 29229  var _freeP4Ø00__func__Ø000 [7]int8
 29230  
 29231  func init() {
 29232  	crt.Xstrncpy(nil, &_freeP4Ø00__func__Ø000[0], str(41716), 7)
 29233  }
 29234  
 29235  func _freeP4FuncCtx(tls *crt.TLS, _db *Xsqlite3, _p *Xsqlite3_context) {
 29236  	_freeEphemeralFunction(tls, _db, (*XFuncDef)(_p.XpFunc))
 29237  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 29238  }
 29239  
 29240  // C comment
 29241  //  /*
 29242  //  ** If the input FuncDef structure is ephemeral, then free it.  If
 29243  //  ** the FuncDef is not ephermal, then do nothing.
 29244  //  */
 29245  func _freeEphemeralFunction(tls *crt.TLS, _db *Xsqlite3, _pDef *XFuncDef) {
 29246  	if (int32(_pDef.XfuncFlags) & int32(16)) != int32(0) {
 29247  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pDef))
 29248  	}
 29249  }
 29250  
 29251  // C comment
 29252  //  /*
 29253  //  ** Deallocate a KeyInfo object
 29254  //  */
 29255  func _sqlite3KeyInfoUnref(tls *crt.TLS, _p *XKeyInfo) {
 29256  	if _p == nil {
 29257  		goto _0
 29258  	}
 29259  	func() {
 29260  		if _p.XnRef <= (0) {
 29261  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117576), unsafe.Pointer(&_sqlite3KeyInfoUnrefØ00__func__Ø000), unsafe.Pointer(str(13812)))
 29262  			crt.X__builtin_abort(tls)
 29263  		}
 29264  	}()
 29265  	_p.XnRef -= 1
 29266  	if _p.XnRef == (0) {
 29267  		_sqlite3DbFreeNN(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p))
 29268  	}
 29269  _0:
 29270  }
 29271  
 29272  var _sqlite3KeyInfoUnrefØ00__func__Ø000 [20]int8
 29273  
 29274  func init() {
 29275  	crt.Xstrncpy(nil, &_sqlite3KeyInfoUnrefØ00__func__Ø000[0], str(41723), 20)
 29276  }
 29277  
 29278  // C comment
 29279  //  /*
 29280  //  ** Delete a P4 value if necessary.
 29281  //  */
 29282  func _freeP4Mem(tls *crt.TLS, _db *Xsqlite3, _p *XMem) {
 29283  	if _p.XszMalloc != 0 {
 29284  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzMalloc))
 29285  	}
 29286  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 29287  }
 29288  
 29289  // C comment
 29290  //  /*
 29291  //  ** Change the value of the P4 operand for a specific instruction.
 29292  //  ** This routine is useful when a large program is loaded from a
 29293  //  ** static array using sqlite3VdbeAddOpList but we want to make a
 29294  //  ** few minor changes to the program.
 29295  //  **
 29296  //  ** If n>=0 then the P4 operand is dynamic, meaning that a copy of
 29297  //  ** the string is made into memory obtained from sqlite3_malloc().
 29298  //  ** A value of n==0 means copy bytes of zP4 up to and including the
 29299  //  ** first null byte.  If n>0 then copy n+1 bytes of zP4.
 29300  //  **
 29301  //  ** Other values of n (P4_STATIC, P4_COLLSEQ etc.) indicate that zP4 points
 29302  //  ** to a string or structure that is guaranteed to exist for the lifetime of
 29303  //  ** the Vdbe. In these cases we can just copy the pointer.
 29304  //  **
 29305  //  ** If addr<0 then change P4 on the most recently inserted instruction.
 29306  //  */
 29307  func _vdbeChangeP4Full(tls *crt.TLS, _p *TVdbe, _pOp *XVdbeOp, _zP4 *int8, _n int32) {
 29308  	if _pOp.Xp4type != 0 {
 29309  		_freeP4(tls, (*Xsqlite3)(_p.Xdb), int32(_pOp.Xp4type), *(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 29310  		_pOp.Xp4type = 0
 29311  		*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)) = nil
 29312  	}
 29313  	if _n < int32(0) {
 29314  		_sqlite3VdbeChangeP4(tls, _p, int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(_p.XaOp))/32)), _zP4, _n)
 29315  		goto _2
 29316  	}
 29317  	if _n == int32(0) {
 29318  		_n = _sqlite3Strlen30(tls, _zP4)
 29319  	}
 29320  	*(**int8)(unsafe.Pointer(&_pOp.Xp4)) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_p.Xdb), _zP4, uint64(_n))
 29321  	_pOp.Xp4type = int8(-1)
 29322  _2:
 29323  }
 29324  
 29325  // C comment
 29326  //  /*
 29327  //  ** Lock the virtual table so that it cannot be disconnected.
 29328  //  ** Locks nest.  Every lock should have a corresponding unlock.
 29329  //  ** If an unlock is omitted, resources leaks will occur.
 29330  //  **
 29331  //  ** If a disconnect is attempted while a virtual table is locked,
 29332  //  ** the disconnect is deferred until all locks have been removed.
 29333  //  */
 29334  func _sqlite3VtabLock(tls *crt.TLS, _pVTab *XVTable) {
 29335  	_pVTab.XnRef += 1
 29336  }
 29337  
 29338  // C comment
 29339  //  /*
 29340  //  ** Code an OP_TableLock instruction for each table locked by the
 29341  //  ** statement (configured by calls to sqlite3TableLock()).
 29342  //  */
 29343  func _codeTableLocks(tls *crt.TLS, _pParse *XParse) {
 29344  	var _i, _1_p1 int32
 29345  	var _pVdbe *TVdbe
 29346  	var _1_p *XTableLock
 29347  	_pVdbe = _sqlite3GetVdbe(tls, _pParse)
 29348  	func() {
 29349  		if _pVdbe == nil {
 29350  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99792), unsafe.Pointer(&_codeTableLocksØ00__func__Ø000), unsafe.Pointer(str(41743)))
 29351  			crt.X__builtin_abort(tls)
 29352  		}
 29353  	}()
 29354  	_i = int32(0)
 29355  _2:
 29356  	if _i >= _pParse.XnTableLock {
 29357  		goto _5
 29358  	}
 29359  	_1_p = elem66((*XTableLock)(_pParse.XaTableLock), uintptr(_i))
 29360  	_1_p1 = _1_p.XiDb
 29361  	_sqlite3VdbeAddOp4(tls, _pVdbe, int32(154), _1_p1, _1_p.XiTab, int32(_1_p.XisWriteLock), _1_p.XzLockName, int32(-2))
 29362  	_i += 1
 29363  	goto _2
 29364  _5:
 29365  }
 29366  
 29367  var _codeTableLocksØ00__func__Ø000 [15]int8
 29368  
 29369  func init() {
 29370  	crt.Xstrncpy(nil, &_codeTableLocksØ00__func__Ø000[0], str(41752), 15)
 29371  }
 29372  
 29373  // C comment
 29374  //  /*
 29375  //  ** This routine generates code that will initialize all of the
 29376  //  ** register used by the autoincrement tracker.
 29377  //  */
 29378  func _sqlite3AutoincrementBegin(tls *crt.TLS, _pParse *XParse) {
 29379  	var _memId int32
 29380  	var _db *Xsqlite3
 29381  	var _pDb *XDb
 29382  	var _v *TVdbe
 29383  	var _1_aOp *XVdbeOp
 29384  	var _p *XAutoincInfo
 29385  	_db = (*Xsqlite3)(_pParse.Xdb)
 29386  	_v = (*TVdbe)(_pParse.XpVdbe)
 29387  	func() {
 29388  		if (*XTable)(_pParse.XpTriggerTab) != nil {
 29389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109100), unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000), unsafe.Pointer(str(41767)))
 29390  			crt.X__builtin_abort(tls)
 29391  		}
 29392  	}()
 29393  	func() {
 29394  		if (*XParse)(_pParse.XpToplevel) != nil {
 29395  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109101), unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000), unsafe.Pointer(str(41790)))
 29396  			crt.X__builtin_abort(tls)
 29397  		}
 29398  	}()
 29399  	func() {
 29400  		if _v == nil {
 29401  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109103), unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000), unsafe.Pointer(str(41816)))
 29402  			crt.X__builtin_abort(tls)
 29403  		}
 29404  	}()
 29405  	_p = (*XAutoincInfo)(_pParse.XpAinc)
 29406  _6:
 29407  	if _p == nil {
 29408  		goto _9
 29409  	}
 29410  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_p.XiDb))
 29411  	_memId = _p.XregCtr
 29412  	func() {
 29413  		if _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_pDb.XpSchema)) == 0 {
 29414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109121), unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000), unsafe.Pointer(str(41818)))
 29415  			crt.X__builtin_abort(tls)
 29416  		}
 29417  	}()
 29418  	_sqlite3OpenTable(tls, _pParse, int32(0), _p.XiDb, (*XTable)((*XSchema)(_pDb.XpSchema).XpSeqTab), int32(106))
 29419  	_sqlite3VdbeLoadString(tls, _v, _memId-int32(1), (*XTable)(_p.XpTab).XzName)
 29420  	_1_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(10), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3AutoincrementBeginØ00autoIncØ002)), _sqlite3AutoincrementBeginØ00iLnØ001)
 29421  	if _1_aOp == nil {
 29422  		goto _9
 29423  	}
 29424  	elem63(_1_aOp, 0).Xp2 = _memId
 29425  	elem63(_1_aOp, 0).Xp3 = _memId + int32(1)
 29426  	elem63(_1_aOp, uintptr(2)).Xp3 = _memId
 29427  	elem63(_1_aOp, uintptr(3)).Xp1 = _memId - int32(1)
 29428  	elem63(_1_aOp, uintptr(3)).Xp3 = _memId
 29429  	elem63(_1_aOp, uintptr(3)).Xp5 = uint16(16)
 29430  	elem63(_1_aOp, uintptr(4)).Xp2 = _memId + int32(1)
 29431  	elem63(_1_aOp, uintptr(5)).Xp3 = _memId
 29432  	elem63(_1_aOp, uintptr(8)).Xp2 = _memId
 29433  	_p = (*XAutoincInfo)(_p.XpNext)
 29434  	goto _6
 29435  _9:
 29436  }
 29437  
 29438  var _sqlite3AutoincrementBeginØ00__func__Ø000 [26]int8
 29439  
 29440  func init() {
 29441  	crt.Xstrncpy(nil, &_sqlite3AutoincrementBeginØ00__func__Ø000[0], str(41862), 26)
 29442  }
 29443  
 29444  // C comment
 29445  //  /*
 29446  //  ** Generate code that will
 29447  //  **
 29448  //  **   (1) acquire a lock for table pTab then
 29449  //  **   (2) open pTab as cursor iCur.
 29450  //  **
 29451  //  ** If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index
 29452  //  ** for that table that is actually opened.
 29453  //  */
 29454  func _sqlite3OpenTable(tls *crt.TLS, _pParse *XParse, _iCur int32, _iDb int32, _pTab *XTable, _opcode int32) {
 29455  	var _v *TVdbe
 29456  	var _2_pPk *XIndex
 29457  	func() {
 29458  		if _pTab.XnModuleArg != 0 {
 29459  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108869), unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000), unsafe.Pointer(str(41888)))
 29460  			crt.X__builtin_abort(tls)
 29461  		}
 29462  	}()
 29463  	_v = _sqlite3GetVdbe(tls, _pParse)
 29464  	func() {
 29465  		if _opcode != int32(107) && _opcode != int32(106) {
 29466  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108871), unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000), unsafe.Pointer(str(41905)))
 29467  			crt.X__builtin_abort(tls)
 29468  		}
 29469  	}()
 29470  	_sqlite3TableLock(tls, _pParse, _iDb, _pTab.Xtnum, uint8(func() int32 {
 29471  		if _opcode == int32(107) {
 29472  			return int32(1)
 29473  		}
 29474  		return int32(0)
 29475  	}()), _pTab.XzName)
 29476  	if (_pTab.XtabFlags & uint32(32)) == (0) {
 29477  		_sqlite3VdbeAddOp4Int(tls, _v, _opcode, _iCur, _pTab.Xtnum, _iDb, int32(_pTab.XnCol))
 29478  		_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pTab.XzName))
 29479  		goto _8
 29480  	}
 29481  	_2_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 29482  	func() {
 29483  		if _2_pPk == nil {
 29484  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108879), unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000), unsafe.Pointer(str(41949)))
 29485  			crt.X__builtin_abort(tls)
 29486  		}
 29487  	}()
 29488  	func() {
 29489  		if _2_pPk.Xtnum != _pTab.Xtnum {
 29490  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108880), unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000), unsafe.Pointer(str(41956)))
 29491  			crt.X__builtin_abort(tls)
 29492  		}
 29493  	}()
 29494  	_sqlite3VdbeAddOp3(tls, _v, _opcode, _iCur, _2_pPk.Xtnum, _iDb)
 29495  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _2_pPk)
 29496  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pTab.XzName))
 29497  _8:
 29498  }
 29499  
 29500  var _sqlite3OpenTableØ00__func__Ø000 [17]int8
 29501  
 29502  func init() {
 29503  	crt.Xstrncpy(nil, &_sqlite3OpenTableØ00__func__Ø000[0], str(41978), 17)
 29504  }
 29505  
 29506  // C comment
 29507  //  /*
 29508  //  ** Record the fact that we want to lock a table at run-time.
 29509  //  **
 29510  //  ** The table to be locked has root page iTab and is found in database iDb.
 29511  //  ** A read or a write lock can be taken depending on isWritelock.
 29512  //  **
 29513  //  ** This routine just records the fact that the lock is desired.  The
 29514  //  ** code to make the lock occur is generated by a later call to
 29515  //  ** codeTableLocks() which occurs during sqlite3FinishCoding().
 29516  //  */
 29517  func _sqlite3TableLock(tls *crt.TLS, _pParse *XParse, _iDb int32, _iTab int32, _isWriteLock uint8, _zName *int8) {
 29518  	var _i, _nBytes int32
 29519  	var _pToplevel *XParse
 29520  	var _p *XTableLock
 29521  	_pToplevel = func() *XParse {
 29522  		if _pParse.XpToplevel != nil {
 29523  			return (*XParse)(_pParse.XpToplevel)
 29524  		}
 29525  		return _pParse
 29526  	}()
 29527  	func() {
 29528  		if _iDb < int32(0) {
 29529  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99756), unsafe.Pointer(&_sqlite3TableLockØ00__func__Ø000), unsafe.Pointer(str(41995)))
 29530  			crt.X__builtin_abort(tls)
 29531  		}
 29532  	}()
 29533  	if _iDb == int32(1) {
 29534  		return
 29535  	}
 29536  	if _sqlite3BtreeSharable(tls, (*XBtree)(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_iDb)).XpBt)) == 0 {
 29537  		return
 29538  	}
 29539  	_i = int32(0)
 29540  _6:
 29541  	if _i >= _pToplevel.XnTableLock {
 29542  		goto _9
 29543  	}
 29544  	_p = elem66((*XTableLock)(_pToplevel.XaTableLock), uintptr(_i))
 29545  	if (_p.XiDb == _iDb) && (_p.XiTab == _iTab) {
 29546  		_p.XisWriteLock = uint8(bool2int((_p.XisWriteLock != 0) || (_isWriteLock != 0)))
 29547  		return
 29548  	}
 29549  	_i += 1
 29550  	goto _6
 29551  _9:
 29552  	_nBytes = int32(uint64(24) * uint64(_pToplevel.XnTableLock+int32(1)))
 29553  	*(**XTableLock)(unsafe.Pointer(&_pToplevel.XaTableLock)) = (*XTableLock)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pToplevel.Xdb), _pToplevel.XaTableLock, uint64(_nBytes)))
 29554  	if _pToplevel.XaTableLock != nil {
 29555  		_p = elem66((*XTableLock)(_pToplevel.XaTableLock), uintptr(postInc2(&_pToplevel.XnTableLock, 1)))
 29556  		_p.XiDb = _iDb
 29557  		_p.XiTab = _iTab
 29558  		_p.XisWriteLock = _isWriteLock
 29559  		_p.XzLockName = _zName
 29560  		goto _14
 29561  	}
 29562  	_pToplevel.XnTableLock = int32(0)
 29563  	_sqlite3OomFault(tls, (*Xsqlite3)(_pToplevel.Xdb))
 29564  _14:
 29565  }
 29566  
 29567  var _sqlite3TableLockØ00__func__Ø000 [17]int8
 29568  
 29569  func init() {
 29570  	crt.Xstrncpy(nil, &_sqlite3TableLockØ00__func__Ø000[0], str(42002), 17)
 29571  }
 29572  
 29573  // C comment
 29574  //  /*
 29575  //  ** Return the PRIMARY KEY index of a table
 29576  //  */
 29577  func _sqlite3PrimaryKeyIndex(tls *crt.TLS, _pTab *XTable) (r0 *XIndex) {
 29578  	var _p *XIndex
 29579  	_p = (*XIndex)(_pTab.XpIndex)
 29580  _0:
 29581  	if _p == nil || int32((uint32(_p.XidxType)<<30)>>30) == int32(2) {
 29582  		goto _4
 29583  	}
 29584  	_p = (*XIndex)(_p.XpNext)
 29585  	goto _0
 29586  _4:
 29587  	return _p
 29588  }
 29589  
 29590  // C comment
 29591  //  /*
 29592  //  ** Set the P4 on the most recently added opcode to the KeyInfo for the
 29593  //  ** index given.
 29594  //  */
 29595  func _sqlite3VdbeSetP4KeyInfo(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex) {
 29596  	var _v *TVdbe
 29597  	var _pKeyInfo *XKeyInfo
 29598  	_v = (*TVdbe)(_pParse.XpVdbe)
 29599  	func() {
 29600  		if _v == nil {
 29601  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72451), unsafe.Pointer(&_sqlite3VdbeSetP4KeyInfoØ00__func__Ø000), unsafe.Pointer(str(42019)))
 29602  			crt.X__builtin_abort(tls)
 29603  		}
 29604  	}()
 29605  	func() {
 29606  		if _pIdx == nil {
 29607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72452), unsafe.Pointer(&_sqlite3VdbeSetP4KeyInfoØ00__func__Ø000), unsafe.Pointer(str(42024)))
 29608  			crt.X__builtin_abort(tls)
 29609  		}
 29610  	}()
 29611  	_pKeyInfo = _sqlite3KeyInfoOfIndex(tls, _pParse, _pIdx)
 29612  	if _pKeyInfo != nil {
 29613  		_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_pKeyInfo), int32(-5))
 29614  	}
 29615  }
 29616  
 29617  var _sqlite3VdbeSetP4KeyInfoØ00__func__Ø000 [24]int8
 29618  
 29619  func init() {
 29620  	crt.Xstrncpy(nil, &_sqlite3VdbeSetP4KeyInfoØ00__func__Ø000[0], str(42032), 24)
 29621  }
 29622  
 29623  // C comment
 29624  //  /*
 29625  //  ** Return a KeyInfo structure that is appropriate for the given Index.
 29626  //  **
 29627  //  ** The caller should invoke sqlite3KeyInfoUnref() on the returned object
 29628  //  ** when it has finished using it.
 29629  //  */
 29630  func _sqlite3KeyInfoOfIndex(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex) (r0 *XKeyInfo) {
 29631  	var _i, _nCol, _nKey int32
 29632  	var _4_zColl *int8
 29633  	var _pKey *XKeyInfo
 29634  	_nCol = int32(_pIdx.XnColumn)
 29635  	_nKey = int32(_pIdx.XnKeyCol)
 29636  	if _pParse.XnErr != 0 {
 29637  		return nil
 29638  	}
 29639  	if ((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0 {
 29640  		_pKey = _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.Xdb), _nKey, _nCol-_nKey)
 29641  		goto _2
 29642  	}
 29643  	_pKey = _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.Xdb), _nCol, int32(0))
 29644  _2:
 29645  	if _pKey == nil {
 29646  		goto _3
 29647  	}
 29648  	func() {
 29649  		if _sqlite3KeyInfoIsWriteable(tls, _pKey) == 0 {
 29650  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104060), unsafe.Pointer(&_sqlite3KeyInfoOfIndexØ00__func__Ø000), unsafe.Pointer(str(42056)))
 29651  			crt.X__builtin_abort(tls)
 29652  		}
 29653  	}()
 29654  	_i = int32(0)
 29655  _6:
 29656  	if _i >= _nCol {
 29657  		goto _9
 29658  	}
 29659  	_4_zColl = *elem0(_pIdx.XazColl, uintptr(_i))
 29660  	*elem64((**XCollSeq)(unsafe.Pointer(&_pKey.XaColl)), uintptr(_i)) = func() *XCollSeq {
 29661  		if _4_zColl == (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) {
 29662  			return nil
 29663  		}
 29664  		return _sqlite3LocateCollSeq(tls, _pParse, _4_zColl)
 29665  	}()
 29666  	*elem15(_pKey.XaSortOrder, uintptr(_i)) = *elem15(_pIdx.XaSortOrder, uintptr(_i))
 29667  	_i += 1
 29668  	goto _6
 29669  _9:
 29670  	if _pParse.XnErr != 0 {
 29671  		_sqlite3KeyInfoUnref(tls, _pKey)
 29672  		_pKey = nil
 29673  	}
 29674  _3:
 29675  	return _pKey
 29676  }
 29677  
 29678  // C comment
 29679  //  /*
 29680  //  ** Allocate a KeyInfo object sufficient for an index of N key columns and
 29681  //  ** X extra columns.
 29682  //  */
 29683  func _sqlite3KeyInfoAlloc(tls *crt.TLS, _db *Xsqlite3, _N int32, _X int32) (r0 *XKeyInfo) {
 29684  	var _nExtra int32
 29685  	var _p *XKeyInfo
 29686  	_nExtra = int32(uint64(_N+_X) * uint64(9))
 29687  	_p = (*XKeyInfo)(_sqlite3DbMallocRawNN(tls, _db, uint64(40)+uint64(_nExtra)))
 29688  	if _p != nil {
 29689  		_p.XaSortOrder = (*uint8)(unsafe.Pointer(elem64((**XCollSeq)(unsafe.Pointer(&_p.XaColl)), uintptr(_N+_X))))
 29690  		_p.XnField = uint16(_N)
 29691  		_p.XnXField = uint16(_X)
 29692  		_p.Xenc = _db.Xenc
 29693  		*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 29694  		_p.XnRef = uint32(1)
 29695  		crt.Xmemset(tls, unsafe.Pointer(elem67(_p, uintptr(1))), int32(0), uint64(_nExtra))
 29696  		goto _1
 29697  	}
 29698  	_sqlite3OomFault(tls, _db)
 29699  _1:
 29700  	return _p
 29701  }
 29702  
 29703  // C comment
 29704  //  /*
 29705  //  ** Return TRUE if a KeyInfo object can be change.  The KeyInfo object
 29706  //  ** can only be changed if this is just a single reference to the object.
 29707  //  **
 29708  //  ** This routine is used only inside of assert() statements.
 29709  //  */
 29710  func _sqlite3KeyInfoIsWriteable(tls *crt.TLS, _p *XKeyInfo) (r0 int32) {
 29711  	return bool2int(_p.XnRef == uint32(1))
 29712  }
 29713  
 29714  var _sqlite3KeyInfoOfIndexØ00__func__Ø000 [22]int8
 29715  
 29716  func init() {
 29717  	crt.Xstrncpy(nil, &_sqlite3KeyInfoOfIndexØ00__func__Ø000[0], str(42088), 22)
 29718  }
 29719  
 29720  // C comment
 29721  //  /*
 29722  //  ** Name of the default collating sequence
 29723  //  */
 29724  var _sqlite3StrBINARY [7]int8
 29725  
 29726  func init() {
 29727  	crt.Xstrncpy(nil, &_sqlite3StrBINARY[0], str(37836), 7)
 29728  }
 29729  
 29730  // C comment
 29731  //  /*
 29732  //  ** This function returns the collation sequence for database native text
 29733  //  ** encoding identified by the string zName, length nName.
 29734  //  **
 29735  //  ** If the requested collation sequence is not available, or not available
 29736  //  ** in the database native encoding, the collation factory is invoked to
 29737  //  ** request it. If the collation factory does not supply such a sequence,
 29738  //  ** and the sequence is available in another text encoding, then that is
 29739  //  ** returned instead.
 29740  //  **
 29741  //  ** If no versions of the requested collations sequence are available, or
 29742  //  ** another error occurs, NULL is returned and an error message written into
 29743  //  ** pParse.
 29744  //  **
 29745  //  ** This routine is a wrapper around sqlite3FindCollSeq().  This routine
 29746  //  ** invokes the collation factory if the named collation cannot be found
 29747  //  ** and generates an error message.
 29748  //  **
 29749  //  ** See also: sqlite3FindCollSeq(), sqlite3GetCollSeq()
 29750  //  */
 29751  func _sqlite3LocateCollSeq(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 *XCollSeq) {
 29752  	var _enc, _initbusy uint8
 29753  	var _db *Xsqlite3
 29754  	var _pColl *XCollSeq
 29755  	_db = (*Xsqlite3)(_pParse.Xdb)
 29756  	_enc = _db.Xenc
 29757  	_initbusy = _db.Xinit.Xbusy
 29758  	_pColl = _sqlite3FindCollSeq(tls, _db, _enc, _zName, int32(_initbusy))
 29759  	if (_initbusy == 0) && ((_pColl == nil) || (_pColl.XxCmp == nil)) {
 29760  		_pColl = _sqlite3GetCollSeq(tls, _pParse, _enc, _pColl, _zName)
 29761  	}
 29762  	return _pColl
 29763  }
 29764  
 29765  // C comment
 29766  //  /*
 29767  //  ** This function is responsible for invoking the collation factory callback
 29768  //  ** or substituting a collation sequence of a different encoding when the
 29769  //  ** requested collation sequence is not available in the desired encoding.
 29770  //  **
 29771  //  ** If it is not NULL, then pColl must point to the database native encoding
 29772  //  ** collation sequence with name zName, length nName.
 29773  //  **
 29774  //  ** The return value is either the collation sequence to be used in database
 29775  //  ** db for collation type name zName, length nName, or NULL, if no collation
 29776  //  ** sequence can be found.  If no collation is found, leave an error message.
 29777  //  **
 29778  //  ** See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq()
 29779  //  */
 29780  func _sqlite3GetCollSeq(tls *crt.TLS, _pParse *XParse, _enc uint8, _pColl *XCollSeq, _zName *int8) (r0 *XCollSeq) {
 29781  	var _db *Xsqlite3
 29782  	var _p *XCollSeq
 29783  	_db = (*Xsqlite3)(_pParse.Xdb)
 29784  	_p = _pColl
 29785  	if _p == nil {
 29786  		_p = _sqlite3FindCollSeq(tls, _db, _enc, _zName, int32(0))
 29787  	}
 29788  	if (_p == nil) || (_p.XxCmp == nil) {
 29789  		_callCollNeeded(tls, _db, int32(_enc), _zName)
 29790  		_p = _sqlite3FindCollSeq(tls, _db, _enc, _zName, int32(0))
 29791  	}
 29792  	if ((_p != nil) && (_p.XxCmp == nil)) && _synthCollSeq(tls, _db, _p) != 0 {
 29793  		_p = nil
 29794  	}
 29795  	func() {
 29796  		if _p != nil && _p.XxCmp == nil {
 29797  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104250), unsafe.Pointer(&_sqlite3GetCollSeqØ00__func__Ø000), unsafe.Pointer(str(42110)))
 29798  			crt.X__builtin_abort(tls)
 29799  		}
 29800  	}()
 29801  	if _p == nil {
 29802  		_sqlite3ErrorMsg(tls, _pParse, str(42124), unsafe.Pointer(_zName))
 29803  	}
 29804  	return _p
 29805  }
 29806  
 29807  // C comment
 29808  //  /*
 29809  //  ** Invoke the 'collation needed' callback to request a collation sequence
 29810  //  ** in the encoding enc of name zName, length nName.
 29811  //  */
 29812  func _callCollNeeded(tls *crt.TLS, _db *Xsqlite3, _enc int32, _zName *int8) {
 29813  	var _1_zExternal, _2_zExternal *int8
 29814  	var _2_pTmp *XMem
 29815  	func() {
 29816  		if _db.XxCollNeeded != nil && _db.XxCollNeeded16 != nil {
 29817  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104169), unsafe.Pointer(&_callCollNeededØ00__func__Ø000), unsafe.Pointer(str(42155)))
 29818  			crt.X__builtin_abort(tls)
 29819  		}
 29820  	}()
 29821  	if _db.XxCollNeeded == nil {
 29822  		goto _3
 29823  	}
 29824  	_1_zExternal = _sqlite3DbStrDup(tls, _db, _zName)
 29825  	if _1_zExternal == nil {
 29826  		return
 29827  	}
 29828  	func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8) {
 29829  		v := _db.XxCollNeeded
 29830  		return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&v))
 29831  	}()(tls, _db.XpCollNeededArg, _db, _enc, _1_zExternal)
 29832  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_zExternal))
 29833  _3:
 29834  	if _db.XxCollNeeded16 == nil {
 29835  		goto _5
 29836  	}
 29837  	_2_pTmp = _sqlite3ValueNew(tls, _db)
 29838  	_sqlite3ValueSetStr(tls, _2_pTmp, int32(-1), unsafe.Pointer(_zName), uint8(1), nil)
 29839  	_2_zExternal = (*int8)(_sqlite3ValueText(tls, _2_pTmp, uint8(2)))
 29840  	if _2_zExternal != nil {
 29841  		func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer) {
 29842  			v := _db.XxCollNeeded16
 29843  			return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&v))
 29844  		}()(tls, _db.XpCollNeededArg, _db, int32(_db.Xenc), unsafe.Pointer(_2_zExternal))
 29845  	}
 29846  	_sqlite3ValueFree(tls, _2_pTmp)
 29847  _5:
 29848  }
 29849  
 29850  var _callCollNeededØ00__func__Ø000 [15]int8
 29851  
 29852  func init() {
 29853  	crt.Xstrncpy(nil, &_callCollNeededØ00__func__Ø000[0], str(42194), 15)
 29854  }
 29855  
 29856  // C comment
 29857  //  /*
 29858  //  ** Make a copy of a string in memory obtained from sqliteMalloc(). These
 29859  //  ** functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This
 29860  //  ** is because when memory debugging is turned on, these two functions are
 29861  //  ** called via macros that record the current file and line number in the
 29862  //  ** ThreadData structure.
 29863  //  */
 29864  func _sqlite3DbStrDup(tls *crt.TLS, _db *Xsqlite3, _z *int8) (r0 *int8) {
 29865  	var _n uint64
 29866  	var _zNew *int8
 29867  	if _z == nil {
 29868  		return nil
 29869  	}
 29870  	_n = crt.Xstrlen(tls, _z) + uint64(1)
 29871  	_zNew = (*int8)(_sqlite3DbMallocRaw(tls, _db, _n))
 29872  	if _zNew != nil {
 29873  		crt.Xmemcpy(tls, unsafe.Pointer(_zNew), unsafe.Pointer(_z), _n)
 29874  	}
 29875  	return _zNew
 29876  }
 29877  
 29878  // C comment
 29879  //  /*
 29880  //  ** This routine is called if the collation factory fails to deliver a
 29881  //  ** collation function in the best encoding but there may be other versions
 29882  //  ** of this collation function (for other text encodings) available. Use one
 29883  //  ** of these instead if they exist. Avoid a UTF-8 <-> UTF-16 conversion if
 29884  //  ** possible.
 29885  //  */
 29886  func _synthCollSeq(tls *crt.TLS, _db *Xsqlite3, _pColl *XCollSeq) (r0 int32) {
 29887  	var _i int32
 29888  	var _z *int8
 29889  	var _pColl2 *XCollSeq
 29890  	_z = _pColl.XzName
 29891  	_i = int32(0)
 29892  _0:
 29893  	if _i >= int32(3) {
 29894  		goto _3
 29895  	}
 29896  	_pColl2 = _sqlite3FindCollSeq(tls, _db, *elem15((*uint8)(unsafe.Pointer(&_synthCollSeqØ00aEncØ001)), uintptr(_i)), _z, int32(0))
 29897  	if _pColl2.XxCmp != nil {
 29898  		crt.Xmemcpy(tls, unsafe.Pointer(_pColl), unsafe.Pointer(_pColl2), uint64(40))
 29899  		_pColl.XxDel = nil
 29900  		return int32(0)
 29901  	}
 29902  	_i += 1
 29903  	goto _0
 29904  _3:
 29905  	return int32(1)
 29906  }
 29907  
 29908  var _synthCollSeqØ00aEncØ001 [3]uint8
 29909  
 29910  func init() {
 29911  	_synthCollSeqØ00aEncØ001 = [3]uint8{3, 2, 1}
 29912  }
 29913  
 29914  var _sqlite3GetCollSeqØ00__func__Ø000 [18]int8
 29915  
 29916  func init() {
 29917  	crt.Xstrncpy(nil, &_sqlite3GetCollSeqØ00__func__Ø000[0], str(42209), 18)
 29918  }
 29919  
 29920  // C comment
 29921  //  /*
 29922  //  ** Change the P4 operand of the most recently coded instruction
 29923  //  ** to the value defined by the arguments.  This is a high-speed
 29924  //  ** version of sqlite3VdbeChangeP4().
 29925  //  **
 29926  //  ** The P4 operand must not have been previously defined.  And the new
 29927  //  ** P4 must not be P4_INT32.  Use sqlite3VdbeChangeP4() in either of
 29928  //  ** those cases.
 29929  //  */
 29930  func _sqlite3VdbeAppendP4(tls *crt.TLS, _p *TVdbe, _pP4 unsafe.Pointer, _n int32) {
 29931  	var _pOp *XVdbeOp
 29932  	func() {
 29933  		if _n == int32(-11) || _n == int32(-8) {
 29934  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72430), unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000), unsafe.Pointer(str(42227)))
 29935  			crt.X__builtin_abort(tls)
 29936  		}
 29937  	}()
 29938  	func() {
 29939  		if _n > int32(0) {
 29940  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72431), unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000), unsafe.Pointer(str(42253)))
 29941  			crt.X__builtin_abort(tls)
 29942  		}
 29943  	}()
 29944  	if ((*Xsqlite3)(_p.Xdb).XmallocFailed) != 0 {
 29945  		_freeP4(tls, (*Xsqlite3)(_p.Xdb), _n, _pP4)
 29946  		goto _6
 29947  	}
 29948  	func() {
 29949  		if _pP4 == nil {
 29950  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72435), unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000), unsafe.Pointer(str(42258)))
 29951  			crt.X__builtin_abort(tls)
 29952  		}
 29953  	}()
 29954  	func() {
 29955  		if _p.XnOp <= int32(0) {
 29956  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72436), unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000), unsafe.Pointer(str(41671)))
 29957  			crt.X__builtin_abort(tls)
 29958  		}
 29959  	}()
 29960  	_pOp = elem63((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1)))
 29961  	func() {
 29962  		if int32(_pOp.Xp4type) != int32(0) {
 29963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72438), unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000), unsafe.Pointer(str(42265)))
 29964  			crt.X__builtin_abort(tls)
 29965  		}
 29966  	}()
 29967  	_pOp.Xp4type = int8(_n)
 29968  	*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)) = _pP4
 29969  _6:
 29970  }
 29971  
 29972  var _sqlite3VdbeAppendP4Ø00__func__Ø000 [20]int8
 29973  
 29974  func init() {
 29975  	crt.Xstrncpy(nil, &_sqlite3VdbeAppendP4Ø00__func__Ø000[0], str(42289), 20)
 29976  }
 29977  
 29978  // C comment
 29979  //  /* Generate code to cause the string zStr to be loaded into
 29980  //  ** register iDest
 29981  //  */
 29982  func _sqlite3VdbeLoadString(tls *crt.TLS, _p *TVdbe, _iDest int32, _zStr *int8) (r0 int32) {
 29983  	return _sqlite3VdbeAddOp4(tls, _p, int32(97), int32(0), _iDest, int32(0), _zStr, int32(0))
 29984  }
 29985  
 29986  // C comment
 29987  //  /*
 29988  //  ** Add a whole list of operations to the operation stack.  Return a
 29989  //  ** pointer to the first operation inserted.
 29990  //  **
 29991  //  ** Non-zero P2 arguments to jump instructions are automatically adjusted
 29992  //  ** so that the jump target is relative to the first operation inserted.
 29993  //  */
 29994  func _sqlite3VdbeAddOpList(tls *crt.TLS, _p *TVdbe, _nOp int32, _aOp *XVdbeOpList, _iLineno int32) (r0 *XVdbeOp) {
 29995  	var _i int32
 29996  	var _pOut, _pFirst *XVdbeOp
 29997  	func() {
 29998  		if _nOp <= int32(0) {
 29999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72134), unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000), unsafe.Pointer(str(42309)))
 30000  			crt.X__builtin_abort(tls)
 30001  		}
 30002  	}()
 30003  	func() {
 30004  		if _p.Xmagic != uint32(381479589) {
 30005  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72135), unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000), unsafe.Pointer(str(37597)))
 30006  			crt.X__builtin_abort(tls)
 30007  		}
 30008  	}()
 30009  	if ((_p.XnOp + _nOp) > ((*XParse)(_p.XpParse).XnOpAlloc)) && _growOpArray(tls, _p, _nOp) != 0 {
 30010  		return nil
 30011  	}
 30012  	_pFirst = store63(&_pOut, elem63((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp)))
 30013  	_i = int32(0)
 30014  _6:
 30015  	if _i >= _nOp {
 30016  		goto _9
 30017  	}
 30018  	_pOut.Xopcode = _aOp.Xopcode
 30019  	_pOut.Xp1 = int32(_aOp.Xp1)
 30020  	_pOut.Xp2 = int32(_aOp.Xp2)
 30021  	func() {
 30022  		if int32(_aOp.Xp2) < int32(0) {
 30023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72144), unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000), unsafe.Pointer(str(42315)))
 30024  			crt.X__builtin_abort(tls)
 30025  		}
 30026  	}()
 30027  	if ((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3OpcodeProperty)), uintptr(_aOp.Xopcode))) & int32(1)) != int32(0)) && (int32(_aOp.Xp2) > int32(0)) {
 30028  		_pOut.Xp2 += _p.XnOp
 30029  	}
 30030  	_pOut.Xp3 = int32(_aOp.Xp3)
 30031  	_pOut.Xp4type = 0
 30032  	*(*unsafe.Pointer)(unsafe.Pointer(&_pOut.Xp4)) = nil
 30033  	_pOut.Xp5 = 0
 30034  	_pOut.XzComment = nil
 30035  
 30036  	if (((*Xsqlite3)(_p.Xdb).Xflags) & int32(4096)) != 0 {
 30037  		_sqlite3VdbePrintOp(tls, nil, _i+_p.XnOp, elem63((*XVdbeOp)(_p.XaOp), uintptr(_i+_p.XnOp)))
 30038  	}
 30039  	*(*uintptr)(unsafe.Pointer(func() **XVdbeOp {
 30040  		*(*uintptr)(unsafe.Pointer(func() **XVdbeOpList { _i += 1; return &_aOp }())) += uintptr(4)
 30041  		return &_pOut
 30042  	}())) += uintptr(32)
 30043  	goto _6
 30044  _9:
 30045  	_p.XnOp += _nOp
 30046  	return _pFirst
 30047  }
 30048  
 30049  var _sqlite3VdbeAddOpListØ00__func__Ø000 [21]int8
 30050  
 30051  func init() {
 30052  	crt.Xstrncpy(nil, &_sqlite3VdbeAddOpListØ00__func__Ø000[0], str(42326), 21)
 30053  }
 30054  
 30055  // C comment
 30056  //  /* #include "opcodes.h" */
 30057  //  /*
 30058  //  ** Properties of opcodes.  The OPFLG_INITIALIZER macro is
 30059  //  ** created by mkopcodeh.awk during compilation.  Data is obtained
 30060  //  ** from the comments following the "case OP_xxxx:" statements in
 30061  //  ** the vdbe.c file.
 30062  //  */
 30063  var _sqlite3OpcodeProperty [166]uint8
 30064  
 30065  func init() {
 30066  	_sqlite3OpcodeProperty = [166]uint8{0, 0, 0, 1, 1, 1, 1, 1, 0, 16, 0, 1, 0, 1, 1, 1, 3, 3, 1, 18, 1, 3, 3, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 11, 1, 1, 3, 3, 3, 1, 1, 1, 2, 2, 8, 0, 16, 16, 16, 16, 0, 16, 16, 0, 0, 16, 16, 0, 0, 0, 38, 38, 0, 2, 2, 3, 3, 11, 11, 11, 11, 11, 11, 1, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 2, 18, 0, 16, 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 0, 0, 16, 16, 16, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 6, 16, 0, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0}
 30067  }
 30068  
 30069  var _sqlite3AutoincrementBeginØ00autoIncØ002 [10]XVdbeOpList
 30070  
 30071  func init() {
 30072  	_sqlite3AutoincrementBeginØ00autoIncØ002 = [10]XVdbeOpList{XVdbeOpList{Xopcode: uint8(59)}, XVdbeOpList{Xopcode: uint8(37), Xp2: int8(9)}, XVdbeOpList{Xopcode: uint8(99)}, XVdbeOpList{Xopcode: uint8(77), Xp2: int8(7)}, XVdbeOpList{Xopcode: uint8(125)}, XVdbeOpList{Xopcode: uint8(99), Xp2: int8(1)}, XVdbeOpList{Xopcode: uint8(13), Xp2: int8(9)}, XVdbeOpList{Xopcode: uint8(7), Xp2: int8(2)}, XVdbeOpList{Xopcode: uint8(56)}, XVdbeOpList{Xopcode: uint8(114)}}
 30073  }
 30074  
 30075  var _sqlite3AutoincrementBeginØ00iLnØ001 int32
 30076  
 30077  // C comment
 30078  //  /*
 30079  //  ** Generate code that will evaluate expression pExpr and store the
 30080  //  ** results in register target.  The results are guaranteed to appear
 30081  //  ** in register target.
 30082  //  */
 30083  func _sqlite3ExprCode(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
 30084  	var _inReg int32
 30085  	func() {
 30086  		if _target <= int32(0) || _target > _pParse.XnMem {
 30087  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95060), unsafe.Pointer(&_sqlite3ExprCodeØ00__func__Ø000), unsafe.Pointer(str(42347)))
 30088  			crt.X__builtin_abort(tls)
 30089  		}
 30090  	}()
 30091  	if (_pExpr != nil) && (int32(_pExpr.Xop) == int32(157)) {
 30092  		_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.XpVdbe), int32(64), _pExpr.XiTable, _target)
 30093  		goto _5
 30094  	}
 30095  	_inReg = _sqlite3ExprCodeTarget(tls, _pParse, _pExpr, _target)
 30096  	func() {
 30097  		if (*TVdbe)(_pParse.XpVdbe) == nil && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 30098  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95065), unsafe.Pointer(&_sqlite3ExprCodeØ00__func__Ø000), unsafe.Pointer(str(42380)))
 30099  			crt.X__builtin_abort(tls)
 30100  		}
 30101  	}()
 30102  	if (_inReg != _target) && (_pParse.XpVdbe != nil) {
 30103  		_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.XpVdbe), int32(65), _inReg, _target)
 30104  	}
 30105  _5:
 30106  }
 30107  
 30108  var _sqlite3ExprCodeØ00__func__Ø000 [16]int8
 30109  
 30110  func init() {
 30111  	crt.Xstrncpy(nil, &_sqlite3ExprCodeØ00__func__Ø000[0], str(42425), 16)
 30112  }
 30113  
 30114  // C comment
 30115  //  /*
 30116  //  ** Generate code into the current Vdbe to evaluate the given
 30117  //  ** expression.  Attempt to store the results in register "target".
 30118  //  ** Return the register where results are stored.
 30119  //  **
 30120  //  ** With this routine, there is no guarantee that results will
 30121  //  ** be stored in target.  The result might be stored in some other
 30122  //  ** register if it is convenient to do so.  The calling function
 30123  //  ** must check the return code and move the results to the desired
 30124  //  ** register.
 30125  //  */
 30126  func _sqlite3ExprCodeTarget(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) (r0 int32) {
 30127  	var _op, _inReg, _regFree1, _regFree2, _r1, _r2, _p5, _8_iTab, _16_n, _31_addr, _35_nFarg, _35_i, _40_endCoalesce, _57_nCol, _60_n, _63_destIfFalse, _63_destIfNull, _66_p1, _69_addrINR, _70_endLabel, _70_nextCase, _70_nExpr, _70_i, _70_iCacheLevel int32
 30128  	var _43_aff int8
 30129  	var _35_constMask uint32
 30130  	var _16_z, _16_zBlob, _18_z, _35_zId *int8
 30131  	var _35_enc, _50_exprOp uint8
 30132  	var _35_db *Xsqlite3
 30133  	var _66_pTab *XTable
 30134  	var _v *TVdbe
 30135  	var _35_pDef *XFuncDef
 30136  	var _35_pFarg, _70_pEList *XExprList
 30137  	var _70_aListelem *TExprList_item
 30138  	var _22_pLeft, _26_pLeft, _70_pX, _70_pTest *XExpr
 30139  	var _tempX, _70_opCompare XExpr
 30140  	var _35_pColl *XCollSeq
 30141  	var _5_pAggInfo, _32_pInfo *XAggInfo
 30142  	var _5_pCol *TAggInfo_col
 30143  	var _43_azAff [5]*int8
 30144  	_v = (*TVdbe)(_pParse.XpVdbe)
 30145  	_inReg = _target
 30146  	_regFree1 = int32(0)
 30147  	_regFree2 = int32(0)
 30148  	_p5 = int32(0)
 30149  	func() {
 30150  		if _target <= int32(0) || _target > _pParse.XnMem {
 30151  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94349), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42347)))
 30152  			crt.X__builtin_abort(tls)
 30153  		}
 30154  	}()
 30155  	if _v == nil {
 30156  		func() {
 30157  			if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 30158  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94351), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42441)))
 30159  				crt.X__builtin_abort(tls)
 30160  			}
 30161  		}()
 30162  		return int32(0)
 30163  	}
 30164  	if _pExpr == nil {
 30165  		_op = int32(101)
 30166  		goto _7
 30167  	}
 30168  	_op = int32(_pExpr.Xop)
 30169  _7:
 30170  	switch _op {
 30171  	case int32(19):
 30172  		goto _40
 30173  	case int32(20):
 30174  		goto _46
 30175  	case int32(37):
 30176  		goto _18
 30177  	case int32(56):
 30178  		goto _58
 30179  	case int32(61):
 30180  		goto _54
 30181  	case int32(70):
 30182  		goto _27
 30183  	case int32(71):
 30184  		goto _27
 30185  	case int32(72):
 30186  		goto _19
 30187  	case int32(73):
 30188  		goto _50
 30189  	case int32(74):
 30190  		goto _49
 30191  	case int32(75):
 30192  		goto _42
 30193  	case int32(76):
 30194  		goto _42
 30195  	case int32(77):
 30196  		goto _21
 30197  	case int32(78):
 30198  		goto _21
 30199  	case int32(79):
 30200  		goto _21
 30201  	case int32(80):
 30202  		goto _21
 30203  	case int32(81):
 30204  		goto _21
 30205  	case int32(82):
 30206  		goto _21
 30207  	case int32(84):
 30208  		goto _27
 30209  	case int32(85):
 30210  		goto _27
 30211  	case int32(86):
 30212  		goto _27
 30213  	case int32(87):
 30214  		goto _27
 30215  	case int32(88):
 30216  		goto _27
 30217  	case int32(89):
 30218  		goto _27
 30219  	case int32(90):
 30220  		goto _27
 30221  	case int32(91):
 30222  		goto _27
 30223  	case int32(92):
 30224  		goto _27
 30225  	case int32(93):
 30226  		goto _27
 30227  	case int32(94):
 30228  		goto _51
 30229  	case int32(95):
 30230  		goto _40
 30231  	case int32(97):
 30232  		goto _13
 30233  	case int32(101):
 30234  		goto _14
 30235  	case int32(119):
 30236  		goto _46
 30237  	case int32(132):
 30238  		goto _12
 30239  	case int32(133):
 30240  		goto _15
 30241  	case int32(134):
 30242  		goto _11
 30243  	case int32(135):
 30244  		goto _16
 30245  	case int32(148):
 30246  		goto _19
 30247  	case int32(151):
 30248  		goto _45
 30249  	case int32(152):
 30250  		goto _10
 30251  	case int32(153):
 30252  		goto _44
 30253  	case int32(154):
 30254  		goto _9
 30255  	case int32(155):
 30256  		goto _39
 30257  	case int32(156):
 30258  		goto _51
 30259  	case int32(157):
 30260  		goto _17
 30261  	case int32(158):
 30262  		goto _55
 30263  	case int32(159):
 30264  		goto _48
 30265  	case int32(160):
 30266  		goto _56
 30267  	case int32(162):
 30268  		goto _51
 30269  	default:
 30270  		goto _57
 30271  	}
 30272  
 30273  _9:
 30274  	_5_pAggInfo = (*XAggInfo)(_pExpr.XpAggInfo)
 30275  	_5_pCol = elem68((*TAggInfo_col)(_5_pAggInfo.XaCol), uintptr(_pExpr.XiAgg))
 30276  	if _5_pAggInfo.XdirectMode == 0 {
 30277  		func() {
 30278  			if _5_pCol.XiMem <= int32(0) {
 30279  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94365), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42466)))
 30280  				crt.X__builtin_abort(tls)
 30281  			}
 30282  		}()
 30283  		return _5_pCol.XiMem
 30284  	}
 30285  	if _5_pAggInfo.XuseSortingIdx != 0 {
 30286  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _5_pAggInfo.XsortingIdxPTab, _5_pCol.XiSorterColumn, _target)
 30287  		return _target
 30288  	}
 30289  _10:
 30290  	_8_iTab = _pExpr.XiTable
 30291  	if _8_iTab >= int32(0) {
 30292  		goto _64
 30293  	}
 30294  	if _pParse.XckBase > int32(0) {
 30295  		return int32(_pExpr.XiColumn) + _pParse.XckBase
 30296  	}
 30297  	_8_iTab = _pParse.XiSelfTab
 30298  _64:
 30299  	return _sqlite3ExprCodeGetColumn(tls, _pParse, (*XTable)(_pExpr.XpTab), int32(_pExpr.XiColumn), _8_iTab, _target, _pExpr.Xop2)
 30300  
 30301  _11:
 30302  	_codeInteger(tls, _pParse, _pExpr, int32(0), _target)
 30303  	return _target
 30304  
 30305  _12:
 30306  	func() {
 30307  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30308  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94396), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30309  			crt.X__builtin_abort(tls)
 30310  		}
 30311  	}()
 30312  	_codeReal(tls, _v, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), int32(0), _target)
 30313  	return _target
 30314  
 30315  _13:
 30316  	func() {
 30317  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30318  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94402), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30319  			crt.X__builtin_abort(tls)
 30320  		}
 30321  	}()
 30322  	_sqlite3VdbeLoadString(tls, _v, _target, *(**int8)(unsafe.Pointer(&_pExpr.Xu)))
 30323  	return _target
 30324  
 30325  _14:
 30326  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _target)
 30327  	return _target
 30328  
 30329  _15:
 30330  	func() {
 30331  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94415), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30333  			crt.X__builtin_abort(tls)
 30334  		}
 30335  	}()
 30336  	func() {
 30337  		if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) != int32(120) && int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) != int32(88) {
 30338  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94416), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42516)))
 30339  			crt.X__builtin_abort(tls)
 30340  		}
 30341  	}()
 30342  	func() {
 30343  		if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), uintptr(1))) != int32(39) {
 30344  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94417), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42567)))
 30345  			crt.X__builtin_abort(tls)
 30346  		}
 30347  	}()
 30348  	_16_z = elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), uintptr(2))
 30349  	_16_n = _sqlite3Strlen30(tls, _16_z) - int32(1)
 30350  	func() {
 30351  		if int32(*elem1(_16_z, uintptr(_16_n))) != int32(39) {
 30352  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94420), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42592)))
 30353  			crt.X__builtin_abort(tls)
 30354  		}
 30355  	}()
 30356  	_16_zBlob = (*int8)(_sqlite3HexToBlob(tls, _sqlite3VdbeDb(tls, _v), _16_z, _16_n))
 30357  	_sqlite3VdbeAddOp4(tls, _v, int32(61), _16_n/int32(2), _target, int32(0), _16_zBlob, int32(-1))
 30358  	return _target
 30359  
 30360  _16:
 30361  	func() {
 30362  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30363  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94427), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30364  			crt.X__builtin_abort(tls)
 30365  		}
 30366  	}()
 30367  	func() {
 30368  		if (*(**int8)(unsafe.Pointer(&_pExpr.Xu))) == nil {
 30369  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94428), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42603)))
 30370  			crt.X__builtin_abort(tls)
 30371  		}
 30372  	}()
 30373  	func() {
 30374  		if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) == int32(0) {
 30375  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94429), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42622)))
 30376  			crt.X__builtin_abort(tls)
 30377  		}
 30378  	}()
 30379  	_sqlite3VdbeAddOp2(tls, _v, int32(62), int32(_pExpr.XiColumn), _target)
 30380  	if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), uintptr(1))) != int32(0) {
 30381  		_18_z = _sqlite3VListNumToName(tls, _pParse.XpVList, int32(_pExpr.XiColumn))
 30382  		func() {
 30383  			if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) != int32(63) && crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), _18_z) != int32(0) {
 30384  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94433), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42644)))
 30385  				crt.X__builtin_abort(tls)
 30386  			}
 30387  		}()
 30388  		*elem8(_pParse.XpVList, 0) = int32(0)
 30389  		_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_18_z), int32(-2))
 30390  	}
 30391  	return _target
 30392  
 30393  _17:
 30394  	return _pExpr.XiTable
 30395  
 30396  _18:
 30397  	_inReg = _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _target)
 30398  	if _inReg != _target {
 30399  		_sqlite3VdbeAddOp2(tls, _v, int32(65), _inReg, _target)
 30400  		_inReg = _target
 30401  	}
 30402  	_sqlite3VdbeAddOp2(tls, _v, int32(94), _target, int32(_sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), nil)))
 30403  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _inReg, int32(1))
 30404  	return _inReg
 30405  
 30406  _19:
 30407  	_op = func() int32 {
 30408  		if _op == int32(72) {
 30409  			return int32(78)
 30410  		}
 30411  		return int32(77)
 30412  	}()
 30413  	_p5 = int32(128)
 30414  _21:
 30415  	_22_pLeft = (*XExpr)(_pExpr.XpLeft)
 30416  	if _sqlite3ExprIsVector(tls, _22_pLeft) != 0 {
 30417  		_codeVectorCompare(tls, _pParse, _pExpr, _target, uint8(_op), uint8(_p5))
 30418  		goto _94
 30419  	}
 30420  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, _22_pLeft, &_regFree1)
 30421  	_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpRight), &_regFree2)
 30422  	_codeCompare(tls, _pParse, _22_pLeft, (*XExpr)(_pExpr.XpRight), _op, _r1, _r2, _inReg, int32(32)|_p5)
 30423  
 30424  _94:
 30425  	goto _95
 30426  _27:
 30427  
 30428  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 30429  	_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpRight), &_regFree2)
 30430  	_sqlite3VdbeAddOp3(tls, _v, _op, _r2, _r1, _target)
 30431  	goto _95
 30432  _39:
 30433  	_26_pLeft = (*XExpr)(_pExpr.XpLeft)
 30434  	func() {
 30435  		if _26_pLeft == nil {
 30436  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94519), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42701)))
 30437  			crt.X__builtin_abort(tls)
 30438  		}
 30439  	}()
 30440  	if int32(_26_pLeft.Xop) == int32(134) {
 30441  		_codeInteger(tls, _pParse, _26_pLeft, int32(1), _target)
 30442  		return _target
 30443  	}
 30444  	if int32(_26_pLeft.Xop) == int32(132) {
 30445  		func() {
 30446  			if (_pExpr.Xflags & uint32(1024)) != (0) {
 30447  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94525), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30448  				crt.X__builtin_abort(tls)
 30449  			}
 30450  		}()
 30451  		_codeReal(tls, _v, *(**int8)(unsafe.Pointer(&_26_pLeft.Xu)), int32(1), _target)
 30452  		return _target
 30453  	}
 30454  	_tempX.Xop = uint8(134)
 30455  	_tempX.Xflags = uint32(17408)
 30456  	*(*int32)(unsafe.Pointer(&_tempX.Xu)) = int32(0)
 30457  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, &_tempX, &_regFree1)
 30458  	_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree2)
 30459  	_sqlite3VdbeAddOp3(tls, _v, int32(89), _r2, _r1, _target)
 30460  	goto _95
 30461  _40:
 30462  
 30463  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 30464  	_sqlite3VdbeAddOp2(tls, _v, _op, _r1, _inReg)
 30465  	goto _95
 30466  _42:
 30467  
 30468  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _target)
 30469  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 30470  	_31_addr = _sqlite3VdbeAddOp1(tls, _v, _op, _r1)
 30471  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _target)
 30472  	_sqlite3VdbeJumpHere(tls, _v, _31_addr)
 30473  	goto _95
 30474  _44:
 30475  	_32_pInfo = (*XAggInfo)(_pExpr.XpAggInfo)
 30476  	if _32_pInfo == nil {
 30477  		func() {
 30478  			if (_pExpr.Xflags & uint32(1024)) != (0) {
 30479  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94567), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30480  				crt.X__builtin_abort(tls)
 30481  			}
 30482  		}()
 30483  		_sqlite3ErrorMsg(tls, _pParse, str(42707), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 30484  		goto _107
 30485  	}
 30486  	return elem69((*TAggInfo_func)(_32_pInfo.XaFunc), uintptr(_pExpr.XiAgg)).XiMem
 30487  
 30488  _107:
 30489  	goto _95
 30490  _45:
 30491  	_35_constMask = uint32(0)
 30492  	_35_db = (*Xsqlite3)(_pParse.Xdb)
 30493  	_35_enc = _35_db.Xenc
 30494  	_35_pColl = nil
 30495  	if (_pParse.XokConstFactor != 0) && _sqlite3ExprIsConstantNotJoin(tls, _pExpr) != 0 {
 30496  		return _sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, int32(-1))
 30497  	}
 30498  	func() {
 30499  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 30500  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94590), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42733)))
 30501  			crt.X__builtin_abort(tls)
 30502  		}
 30503  	}()
 30504  	if (_pExpr.Xflags & uint32(16384)) != (0) {
 30505  		_35_pFarg = nil
 30506  		goto _113
 30507  	}
 30508  	_35_pFarg = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 30509  _113:
 30510  	_35_nFarg = func() int32 {
 30511  		if _35_pFarg != nil {
 30512  			return _35_pFarg.XnExpr
 30513  		}
 30514  		return int32(0)
 30515  	}()
 30516  	func() {
 30517  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30518  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94597), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30519  			crt.X__builtin_abort(tls)
 30520  		}
 30521  	}()
 30522  	_35_zId = *(**int8)(unsafe.Pointer(&_pExpr.Xu))
 30523  	_35_pDef = _sqlite3FindFunction(tls, _35_db, _35_zId, _35_nFarg, _35_enc, 0)
 30524  	if (_35_pDef == nil) || (func() func(*crt.TLS, *Xsqlite3_context) {
 30525  		v := _35_pDef.XxFinalize
 30526  		return *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&v))
 30527  	}() != nil) {
 30528  		_sqlite3ErrorMsg(tls, _pParse, str(42771), unsafe.Pointer(_35_zId))
 30529  		goto _95
 30530  	}
 30531  	if (int32(_35_pDef.XfuncFlags) & int32(512)) == 0 {
 30532  		goto _120
 30533  	}
 30534  	_40_endCoalesce = _sqlite3VdbeMakeLabel(tls, _v)
 30535  	func() {
 30536  		if _35_nFarg < int32(2) {
 30537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94616), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42794)))
 30538  			crt.X__builtin_abort(tls)
 30539  		}
 30540  	}()
 30541  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr), _target)
 30542  	_35_i = int32(1)
 30543  _123:
 30544  	if _35_i >= _35_nFarg {
 30545  		goto _126
 30546  	}
 30547  	_sqlite3VdbeAddOp2(tls, _v, int32(76), _target, _40_endCoalesce)
 30548  	_sqlite3ExprCacheRemove(tls, _pParse, _target, int32(1))
 30549  	_sqlite3ExprCachePush(tls, _pParse)
 30550  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), uintptr(_35_i)).XpExpr), _target)
 30551  	_sqlite3ExprCachePop(tls, _pParse)
 30552  	_35_i += 1
 30553  	goto _123
 30554  _126:
 30555  	_sqlite3VdbeResolveLabel(tls, _v, _40_endCoalesce)
 30556  	goto _95
 30557  _120:
 30558  	if (int32(_35_pDef.XfuncFlags) & int32(1024)) != 0 {
 30559  		func() {
 30560  			if _35_nFarg < int32(1) {
 30561  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94634), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42803)))
 30562  				crt.X__builtin_abort(tls)
 30563  			}
 30564  		}()
 30565  		return _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr), _target)
 30566  	}
 30567  	if (int32(_35_pDef.XfuncFlags) & int32(16384)) != 0 {
 30568  		_43_azAff = [5]*int8{}
 30569  		*elem0((**int8)(unsafe.Pointer(&_43_azAff)), 0) = str(42812)
 30570  		*elem0((**int8)(unsafe.Pointer(&_43_azAff)), uintptr(1)) = str(42817)
 30571  		*elem0((**int8)(unsafe.Pointer(&_43_azAff)), uintptr(2)) = str(42822)
 30572  		*elem0((**int8)(unsafe.Pointer(&_43_azAff)), uintptr(3)) = str(42830)
 30573  		*elem0((**int8)(unsafe.Pointer(&_43_azAff)), uintptr(4)) = str(42838)
 30574  		func() {
 30575  			if _35_nFarg != int32(1) {
 30576  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94646), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42843)))
 30577  				crt.X__builtin_abort(tls)
 30578  			}
 30579  		}()
 30580  		_43_aff = _sqlite3ExprAffinity(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr))
 30581  		_sqlite3VdbeLoadString(tls, _v, _target, func() *int8 {
 30582  			if _43_aff != 0 {
 30583  				return (*elem0((**int8)(unsafe.Pointer(&_43_azAff)), uintptr(int32(_43_aff)-int32(65))))
 30584  			}
 30585  			return str(42852)
 30586  		}())
 30587  		return _target
 30588  	}
 30589  	_35_i = int32(0)
 30590  _135:
 30591  	if _35_i >= _35_nFarg {
 30592  		goto _138
 30593  	}
 30594  	if (_35_i < int32(32)) && _sqlite3ExprIsConstant(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), uintptr(_35_i)).XpExpr)) != 0 {
 30595  		_35_constMask |= uint32(1) << uint(_35_i)
 30596  	}
 30597  	if ((int32(_35_pDef.XfuncFlags) & int32(32)) != int32(0)) && (_35_pColl == nil) {
 30598  		_35_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), uintptr(_35_i)).XpExpr))
 30599  	}
 30600  	_35_i += 1
 30601  	goto _135
 30602  _138:
 30603  	if _35_pFarg == nil {
 30604  		goto _143
 30605  	}
 30606  	if _35_constMask != 0 {
 30607  		_r1 = _pParse.XnMem + int32(1)
 30608  		_pParse.XnMem += _35_nFarg
 30609  		goto _145
 30610  	}
 30611  	_r1 = _sqlite3GetTempRange(tls, _pParse, _35_nFarg)
 30612  _145:
 30613  	if (int32(_35_pDef.XfuncFlags) & int32(192)) == int32(0) {
 30614  		goto _146
 30615  	}
 30616  	func() {
 30617  		if _35_nFarg != int32(1) {
 30618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94678), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42843)))
 30619  			crt.X__builtin_abort(tls)
 30620  		}
 30621  	}()
 30622  	func() {
 30623  		if (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr) == nil {
 30624  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94679), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42857)))
 30625  			crt.X__builtin_abort(tls)
 30626  		}
 30627  	}()
 30628  	_50_exprOp = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr).Xop
 30629  	if (int32(_50_exprOp) == int32(152)) || (int32(_50_exprOp) == int32(154)) {
 30630  		(*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr).Xop2 = uint8(int32(_35_pDef.XfuncFlags) & int32(192))
 30631  	}
 30632  _146:
 30633  	_sqlite3ExprCachePush(tls, _pParse)
 30634  	_sqlite3ExprCodeExprList(tls, _pParse, _35_pFarg, _r1, int32(0), uint8(3))
 30635  	_sqlite3ExprCachePop(tls, _pParse)
 30636  	goto _153
 30637  _143:
 30638  	_r1 = int32(0)
 30639  _153:
 30640  	if (_35_nFarg >= int32(2)) && ((_pExpr.Xflags & uint32(128)) != 0) {
 30641  		_35_pDef = _sqlite3VtabOverloadFunction(tls, _35_db, _35_pDef, _35_nFarg, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), uintptr(1)).XpExpr))
 30642  		goto _157
 30643  	}
 30644  	if _35_nFarg > int32(0) {
 30645  		_35_pDef = _sqlite3VtabOverloadFunction(tls, _35_db, _35_pDef, _35_nFarg, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr))
 30646  	}
 30647  _157:
 30648  	if (int32(_35_pDef.XfuncFlags) & int32(32)) == 0 {
 30649  		goto _158
 30650  	}
 30651  	if _35_pColl == nil {
 30652  		_35_pColl = (*XCollSeq)(_35_db.XpDfltColl)
 30653  	}
 30654  	_sqlite3VdbeAddOp4(tls, _v, int32(68), int32(0), int32(0), int32(0), (*int8)(unsafe.Pointer(_35_pColl)), int32(-3))
 30655  _158:
 30656  	_sqlite3VdbeAddOp4(tls, _v, int32(69), int32(_35_constMask), _r1, _target, (*int8)(unsafe.Pointer(_35_pDef)), int32(-4))
 30657  	_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_35_nFarg)))
 30658  	if _35_nFarg != 0 && (_35_constMask == (0)) {
 30659  		_sqlite3ReleaseTempRange(tls, _pParse, _r1, _35_nFarg)
 30660  	}
 30661  	return _target
 30662  
 30663  _46:
 30664  	if (_op == int32(119)) && (store2(&_57_nCol, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpEList).XnExpr) != int32(1)) {
 30665  		_sqlite3SubselectError(tls, _pParse, _57_nCol, int32(1))
 30666  		goto _164
 30667  	}
 30668  	return _sqlite3CodeSubselect(tls, _pParse, _pExpr, int32(0), int32(0))
 30669  
 30670  _164:
 30671  	goto _95
 30672  _48:
 30673  	if ((*XExpr)(_pExpr.XpLeft).XiTable) == int32(0) {
 30674  		(*XExpr)(_pExpr.XpLeft).XiTable = _sqlite3CodeSubselect(tls, _pParse, (*XExpr)(_pExpr.XpLeft), int32(0), int32(0))
 30675  	}
 30676  	func() {
 30677  		if _pExpr.XiTable != int32(0) && int32((*XExpr)(_pExpr.XpLeft).Xop) != int32(119) {
 30678  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94746), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42878)))
 30679  			crt.X__builtin_abort(tls)
 30680  		}
 30681  	}()
 30682  	if _pExpr.XiTable != 0 && (_pExpr.XiTable != store2(&_60_n, _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpLeft)))) {
 30683  		_sqlite3ErrorMsg(tls, _pParse, str(42926), _pExpr.XiTable, _60_n)
 30684  	}
 30685  	return ((*XExpr)(_pExpr.XpLeft).XiTable) + int32(_pExpr.XiColumn)
 30686  
 30687  _49:
 30688  	_63_destIfFalse = _sqlite3VdbeMakeLabel(tls, _v)
 30689  	_63_destIfNull = _sqlite3VdbeMakeLabel(tls, _v)
 30690  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _target)
 30691  	_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _63_destIfFalse, _63_destIfNull)
 30692  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _target)
 30693  	_sqlite3VdbeResolveLabel(tls, _v, _63_destIfFalse)
 30694  	_sqlite3VdbeAddOp2(tls, _v, int32(73), _target, int32(0))
 30695  	_sqlite3VdbeResolveLabel(tls, _v, _63_destIfNull)
 30696  	return _target
 30697  
 30698  _50:
 30699  	_exprCodeBetween(tls, _pParse, _pExpr, _target, nil, int32(0))
 30700  	return _target
 30701  
 30702  _51:
 30703  	return _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _target)
 30704  
 30705  _54:
 30706  	_66_pTab = (*XTable)(_pExpr.XpTab)
 30707  	_66_p1 = ((_pExpr.XiTable * (int32(_66_pTab.XnCol) + int32(1))) + int32(1)) + int32(_pExpr.XiColumn)
 30708  	func() {
 30709  		if _pExpr.XiTable != int32(0) && _pExpr.XiTable != int32(1) {
 30710  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94819), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42956)))
 30711  			crt.X__builtin_abort(tls)
 30712  		}
 30713  	}()
 30714  	func() {
 30715  		if int32(_pExpr.XiColumn) < int32(-1) || int32(_pExpr.XiColumn) >= int32(_66_pTab.XnCol) {
 30716  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94820), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42993)))
 30717  			crt.X__builtin_abort(tls)
 30718  		}
 30719  	}()
 30720  	func() {
 30721  		if int32(_66_pTab.XiPKey) >= int32(0) && int32(_pExpr.XiColumn) == int32(_66_pTab.XiPKey) {
 30722  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94821), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43041)))
 30723  			crt.X__builtin_abort(tls)
 30724  		}
 30725  	}()
 30726  	func() {
 30727  		if _66_p1 < int32(0) || _66_p1 >= ((int32(_66_pTab.XnCol)*int32(2))+int32(2)) {
 30728  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94822), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43086)))
 30729  			crt.X__builtin_abort(tls)
 30730  		}
 30731  	}()
 30732  	_sqlite3VdbeAddOp2(tls, _v, int32(146), _66_p1, _target)
 30733  	_sqlite3VdbeComment(tls, _v, str(43115), unsafe.Pointer(func() *int8 {
 30734  		if _pExpr.XiTable != 0 {
 30735  			return str(43128)
 30736  		}
 30737  		return str(43132)
 30738  	}()), unsafe.Pointer(func() *int8 {
 30739  		if int32(_pExpr.XiColumn) < int32(0) {
 30740  			return str(27182)
 30741  		}
 30742  		return (elem43((*XColumn)((*XTable)(_pExpr.XpTab).XaCol), uintptr(_pExpr.XiColumn)).XzName)
 30743  	}()), _target)
 30744  	if (int32(_pExpr.XiColumn) >= int32(0)) && (int32(elem43((*XColumn)(_66_pTab.XaCol), uintptr(_pExpr.XiColumn)).Xaffinity) == int32(69)) {
 30745  		_sqlite3VdbeAddOp1(tls, _v, int32(74), _target)
 30746  	}
 30747  	goto _95
 30748  _55:
 30749  	_sqlite3ErrorMsg(tls, _pParse, str(43136))
 30750  	goto _95
 30751  _56:
 30752  	_69_addrINR = _sqlite3VdbeAddOp1(tls, _v, int32(23), _pExpr.XiTable)
 30753  	_sqlite3ExprCachePush(tls, _pParse)
 30754  	_inReg = _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _target)
 30755  	_sqlite3ExprCachePop(tls, _pParse)
 30756  	_sqlite3VdbeJumpHere(tls, _v, _69_addrINR)
 30757  	_sqlite3VdbeChangeP3(tls, _v, uint32(_69_addrINR), _inReg)
 30758  	goto _95
 30759  _57:
 30760  	func() {
 30761  		if _op != int32(136) {
 30762  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94883), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43154)))
 30763  			crt.X__builtin_abort(tls)
 30764  		}
 30765  	}()
 30766  	_70_pTest = nil
 30767  	_70_iCacheLevel = _pParse.XiCacheLevel
 30768  	func() {
 30769  		if (_pExpr.Xflags&uint32(2048)) != (0) || (*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) == nil {
 30770  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94895), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43166)))
 30771  			crt.X__builtin_abort(tls)
 30772  		}
 30773  	}()
 30774  	func() {
 30775  		if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XnExpr) <= int32(0) {
 30776  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94896), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43222)))
 30777  			crt.X__builtin_abort(tls)
 30778  		}
 30779  	}()
 30780  	_70_pEList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 30781  	_70_aListelem = (*TExprList_item)(unsafe.Pointer(&_70_pEList.Xa))
 30782  	_70_nExpr = _70_pEList.XnExpr
 30783  	_70_endLabel = _sqlite3VdbeMakeLabel(tls, _v)
 30784  	if store60(&_70_pX, (*XExpr)(_pExpr.XpLeft)) != nil {
 30785  		_tempX = *_70_pX
 30786  		_exprToRegister(tls, &_tempX, _exprCodeVector(tls, _pParse, &_tempX, &_regFree1))
 30787  		crt.Xmemset(tls, unsafe.Pointer(&_70_opCompare), int32(0), uint64(72))
 30788  		_70_opCompare.Xop = uint8(78)
 30789  		*(**XExpr)(unsafe.Pointer(&_70_opCompare.XpLeft)) = &_tempX
 30790  		_70_pTest = &_70_opCompare
 30791  		_regFree1 = int32(0)
 30792  	}
 30793  	_70_i = int32(0)
 30794  _197:
 30795  	if _70_i >= (_70_nExpr - int32(1)) {
 30796  		goto _200
 30797  	}
 30798  	_sqlite3ExprCachePush(tls, _pParse)
 30799  	if _70_pX != nil {
 30800  		func() {
 30801  			if _70_pTest == nil {
 30802  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94919), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43248)))
 30803  				crt.X__builtin_abort(tls)
 30804  			}
 30805  		}()
 30806  		*(**XExpr)(unsafe.Pointer(&_70_opCompare.XpRight)) = (*XExpr)(elem59(_70_aListelem, uintptr(_70_i)).XpExpr)
 30807  		goto _204
 30808  	}
 30809  	_70_pTest = (*XExpr)(elem59(_70_aListelem, uintptr(_70_i)).XpExpr)
 30810  _204:
 30811  	_70_nextCase = _sqlite3VdbeMakeLabel(tls, _v)
 30812  	_sqlite3ExprIfFalse(tls, _pParse, _70_pTest, _70_nextCase, int32(16))
 30813  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59(_70_aListelem, uintptr(_70_i+int32(1))).XpExpr), _target)
 30814  	_sqlite3VdbeGoto(tls, _v, _70_endLabel)
 30815  	_sqlite3ExprCachePop(tls, _pParse)
 30816  	_sqlite3VdbeResolveLabel(tls, _v, _70_nextCase)
 30817  	_70_i = _70_i + int32(2)
 30818  	goto _197
 30819  _200:
 30820  	if (_70_nExpr & int32(1)) != int32(0) {
 30821  		_sqlite3ExprCachePush(tls, _pParse)
 30822  		_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_70_pEList.Xa)), uintptr(_70_nExpr-int32(1))).XpExpr), _target)
 30823  		_sqlite3ExprCachePop(tls, _pParse)
 30824  		goto _206
 30825  	}
 30826  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _target)
 30827  _206:
 30828  	func() {
 30829  		if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 && _pParse.XnErr <= int32(0) && _pParse.XiCacheLevel != _70_iCacheLevel {
 30830  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94940), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43257)))
 30831  			crt.X__builtin_abort(tls)
 30832  		}
 30833  	}()
 30834  	_sqlite3VdbeResolveLabel(tls, _v, _70_endLabel)
 30835  	goto _95
 30836  _58:
 30837  	func() {
 30838  		if int32(_pExpr.Xaffinity) != int32(1) && int32(_pExpr.Xaffinity) != int32(2) && int32(_pExpr.Xaffinity) != int32(3) && int32(_pExpr.Xaffinity) != int32(4) {
 30839  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94947), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43336)))
 30840  			crt.X__builtin_abort(tls)
 30841  		}
 30842  	}()
 30843  	if _pParse.XpTriggerTab == nil {
 30844  		_sqlite3ErrorMsg(tls, _pParse, str(43452))
 30845  		return int32(0)
 30846  	}
 30847  	if int32(_pExpr.Xaffinity) == int32(2) {
 30848  		_sqlite3MayAbort(tls, _pParse)
 30849  	}
 30850  	func() {
 30851  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30852  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94960), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30853  			crt.X__builtin_abort(tls)
 30854  		}
 30855  	}()
 30856  	if int32(_pExpr.Xaffinity) == int32(4) {
 30857  		_sqlite3VdbeAddOp4(tls, _v, int32(55), int32(0), int32(4), int32(0), *(**int8)(unsafe.Pointer(&_pExpr.Xu)), int32(0))
 30858  		goto _221
 30859  	}
 30860  	_sqlite3HaltConstraint(tls, _pParse, int32(1811), int32(_pExpr.Xaffinity), *(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0, 0)
 30861  _221:
 30862  	goto _95
 30863  _95:
 30864  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
 30865  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree2)
 30866  	return _inReg
 30867  
 30868  	_ = _43_azAff
 30869  	panic(0)
 30870  }
 30871  
 30872  var _sqlite3ExprCodeTargetØ00__func__Ø000 [22]int8
 30873  
 30874  func init() {
 30875  	crt.Xstrncpy(nil, &_sqlite3ExprCodeTargetØ00__func__Ø000[0], str(43502), 22)
 30876  }
 30877  
 30878  // C comment
 30879  //  /*
 30880  //  ** Generate code that will extract the iColumn-th column from
 30881  //  ** table pTab and store the column value in a register.
 30882  //  **
 30883  //  ** An effort is made to store the column value in register iReg.  This
 30884  //  ** is not garanteeed for GetColumn() - the result can be stored in
 30885  //  ** any register.  But the result is guaranteed to land in register iReg
 30886  //  ** for GetColumnToReg().
 30887  //  **
 30888  //  ** There must be an open cursor to pTab in iTable when this routine
 30889  //  ** is called.  If iColumn<0 then code is generated that extracts the rowid.
 30890  //  */
 30891  func _sqlite3ExprCodeGetColumn(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iColumn int32, _iTable int32, _iReg int32, _p5 uint8) (r0 int32) {
 30892  	var _i int32
 30893  	var _v *TVdbe
 30894  	var _p *TyColCache
 30895  	_v = (*TVdbe)(_pParse.XpVdbe)
 30896  	*func() **TyColCache { _i = int32(0); return &_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 30897  _0:
 30898  	if _i >= int32(_pParse.XnColCache) {
 30899  		goto _3
 30900  	}
 30901  	if (_p.XiTable == _iTable) && (int32(_p.XiColumn) == _iColumn) {
 30902  		_p.Xlru = postInc2(&_pParse.XiCacheCnt, 1)
 30903  		_sqlite3ExprCachePinRegister(tls, _pParse, _p.XiReg)
 30904  		return _p.XiReg
 30905  	}
 30906  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
 30907  	goto _0
 30908  _3:
 30909  	func() {
 30910  		if _v == nil {
 30911  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94200), unsafe.Pointer(&_sqlite3ExprCodeGetColumnØ00__func__Ø000), unsafe.Pointer(str(42019)))
 30912  			crt.X__builtin_abort(tls)
 30913  		}
 30914  	}()
 30915  	_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iTable, _iColumn, _iReg)
 30916  	if _p5 != 0 {
 30917  		_sqlite3VdbeChangeP5(tls, _v, uint16(_p5))
 30918  		goto _9
 30919  	}
 30920  	_sqlite3ExprCacheStore(tls, _pParse, _iTable, _iColumn, _iReg)
 30921  _9:
 30922  	return _iReg
 30923  }
 30924  
 30925  // C comment
 30926  //  /*
 30927  //  ** When a cached column is reused, make sure that its register is
 30928  //  ** no longer available as a temp register.  ticket #3879:  that same
 30929  //  ** register might be in the cache in multiple places, so be sure to
 30930  //  ** get them all.
 30931  //  */
 30932  func _sqlite3ExprCachePinRegister(tls *crt.TLS, _pParse *XParse, _iReg int32) {
 30933  	var _i int32
 30934  	var _p *TyColCache
 30935  	*func() **TyColCache { _i = int32(0); return &_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 30936  _0:
 30937  	if _i >= int32(_pParse.XnColCache) {
 30938  		goto _3
 30939  	}
 30940  	if _p.XiReg == _iReg {
 30941  		_p.XtempReg = 0
 30942  	}
 30943  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
 30944  	goto _0
 30945  _3:
 30946  }
 30947  
 30948  var _sqlite3ExprCodeGetColumnØ00__func__Ø000 [25]int8
 30949  
 30950  func init() {
 30951  	crt.Xstrncpy(nil, &_sqlite3ExprCodeGetColumnØ00__func__Ø000[0], str(43524), 25)
 30952  }
 30953  
 30954  // C comment
 30955  //  /*
 30956  //  ** Generate code to extract the value of the iCol-th column of a table.
 30957  //  */
 30958  func _sqlite3ExprCodeGetColumnOfTable(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _iTabCur int32, _iCol int32, _regOut int32) {
 30959  	var _3_op, _3_x int32
 30960  	if _pTab == nil {
 30961  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _iTabCur, _iCol, _regOut)
 30962  		return
 30963  	}
 30964  	if (_iCol < int32(0)) || (_iCol == int32(_pTab.XiPKey)) {
 30965  		_sqlite3VdbeAddOp2(tls, _v, int32(125), _iTabCur, _regOut)
 30966  		goto _3
 30967  	}
 30968  	_3_op = func() int32 {
 30969  		if _pTab.XnModuleArg != 0 {
 30970  			return int32(159)
 30971  		}
 30972  		return int32(99)
 30973  	}()
 30974  	_3_x = _iCol
 30975  	if ((_pTab.XtabFlags & uint32(32)) != (0)) && (_pTab.XnModuleArg == 0) {
 30976  		_3_x = int32(_sqlite3ColumnOfIndex(tls, _sqlite3PrimaryKeyIndex(tls, _pTab), int16(_iCol)))
 30977  	}
 30978  	_sqlite3VdbeAddOp3(tls, _v, _3_op, _iTabCur, _3_x, _regOut)
 30979  _3:
 30980  	if _iCol >= int32(0) {
 30981  		_sqlite3ColumnDefault(tls, _v, _pTab, _iCol, _regOut)
 30982  	}
 30983  }
 30984  
 30985  // C comment
 30986  //  /*
 30987  //  ** Return the column of index pIdx that corresponds to table
 30988  //  ** column iCol.  Return -1 if not found.
 30989  //  */
 30990  func _sqlite3ColumnOfIndex(tls *crt.TLS, _pIdx *XIndex, _iCol int16) (r0 int16) {
 30991  	var _i int32
 30992  	_i = int32(0)
 30993  _0:
 30994  	if _i >= int32(_pIdx.XnColumn) {
 30995  		goto _3
 30996  	}
 30997  	if int32(_iCol) == int32(*elem52(_pIdx.XaiColumn, uintptr(_i))) {
 30998  		return int16(_i)
 30999  	}
 31000  	_i += 1
 31001  	goto _0
 31002  _3:
 31003  	return int16(-1)
 31004  }
 31005  
 31006  // C comment
 31007  //  /*
 31008  //  ** The most recently coded instruction was an OP_Column to retrieve the
 31009  //  ** i-th column of table pTab. This routine sets the P4 parameter of the
 31010  //  ** OP_Column to the default value, if any.
 31011  //  **
 31012  //  ** The default value of a column is specified by a DEFAULT clause in the
 31013  //  ** column definition. This was either supplied by the user when the table
 31014  //  ** was created, or added later to the table definition by an ALTER TABLE
 31015  //  ** command. If the latter, then the row-records in the table btree on disk
 31016  //  ** may not contain a value for the column and the default value, taken
 31017  //  ** from the P4 parameter of the OP_Column instruction, is returned instead.
 31018  //  ** If the former, then all row-records are guaranteed to include a value
 31019  //  ** for the column and the P4 value is not required.
 31020  //  **
 31021  //  ** Column definitions created by an ALTER TABLE command may only have
 31022  //  ** literal default values specified: a number, null or a string. (If a more
 31023  //  ** complicated default expression value was provided, it is evaluated
 31024  //  ** when the ALTER TABLE is executed and one of the literal values written
 31025  //  ** into the sqlite_master table.)
 31026  //  **
 31027  //  ** Therefore, the P4 parameter is only required if the default value for
 31028  //  ** the column is a literal number, string or null. The sqlite3ValueFromExpr()
 31029  //  ** function is capable of transforming these types of expressions into
 31030  //  ** sqlite3_value objects.
 31031  //  **
 31032  //  ** If parameter iReg is not negative, code an OP_RealAffinity instruction
 31033  //  ** on register iReg. This is used when an equivalent integer value is
 31034  //  ** stored in place of an 8-byte floating point value in order to save
 31035  //  ** space.
 31036  //  */
 31037  func _sqlite3ColumnDefault(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _i int32, _iReg int32) {
 31038  	var _1_enc uint8
 31039  	var _1_pValue *XMem
 31040  	var _1_pCol *XColumn
 31041  	func() {
 31042  		if _pTab == nil {
 31043  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123808), unsafe.Pointer(&_sqlite3ColumnDefaultØ00__func__Ø000), unsafe.Pointer(str(43549)))
 31044  			crt.X__builtin_abort(tls)
 31045  		}
 31046  	}()
 31047  	if _pTab.XpSelect != nil {
 31048  		goto _2
 31049  	}
 31050  	_1_pValue = nil
 31051  	_1_enc = _sqlite3VdbeDb(tls, _v).Xenc
 31052  	_1_pCol = elem43((*XColumn)(_pTab.XaCol), uintptr(_i))
 31053  	_sqlite3VdbeComment(tls, _v, str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(_1_pCol.XzName))
 31054  	func() {
 31055  		if _i >= int32(_pTab.XnCol) {
 31056  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123814), unsafe.Pointer(&_sqlite3ColumnDefaultØ00__func__Ø000), unsafe.Pointer(str(43557)))
 31057  			crt.X__builtin_abort(tls)
 31058  		}
 31059  	}()
 31060  	_sqlite3ValueFromExpr(tls, _sqlite3VdbeDb(tls, _v), (*XExpr)(_1_pCol.XpDflt), _1_enc, uint8(_1_pCol.Xaffinity), &_1_pValue)
 31061  	if _1_pValue != nil {
 31062  		_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_1_pValue), int32(-7))
 31063  	}
 31064  _2:
 31065  	if int32(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).Xaffinity) == int32(69) {
 31066  		_sqlite3VdbeAddOp1(tls, _v, int32(74), _iReg)
 31067  	}
 31068  }
 31069  
 31070  var _sqlite3ColumnDefaultØ00__func__Ø000 [21]int8
 31071  
 31072  func init() {
 31073  	crt.Xstrncpy(nil, &_sqlite3ColumnDefaultØ00__func__Ø000[0], str(43570), 21)
 31074  }
 31075  
 31076  // C comment
 31077  //  /*
 31078  //  ** Return the database associated with the Vdbe.
 31079  //  */
 31080  func _sqlite3VdbeDb(tls *crt.TLS, _v *TVdbe) (r0 *Xsqlite3) {
 31081  	return (*Xsqlite3)(_v.Xdb)
 31082  }
 31083  
 31084  // C comment
 31085  //  /*
 31086  //  ** Create a new sqlite3_value object, containing the value of pExpr.
 31087  //  **
 31088  //  ** This only works for very simple expressions that consist of one constant
 31089  //  ** token (i.e. "5", "5.1", "'a string'"). If the expression can
 31090  //  ** be converted directly into a value, then the value is allocated and
 31091  //  ** a pointer written to *ppVal. The caller is responsible for deallocating
 31092  //  ** the value by passing it to sqlite3ValueFree() later on. If the expression
 31093  //  ** cannot be converted to a value, then *ppVal is set to NULL.
 31094  //  */
 31095  func _sqlite3ValueFromExpr(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _enc uint8, _affinity uint8, _ppVal **XMem) (r0 int32) {
 31096  	return func() int32 {
 31097  		if _pExpr != nil {
 31098  			return _valueFromExpr(tls, _db, _pExpr, _enc, _affinity, _ppVal, nil)
 31099  		}
 31100  		return int32(0)
 31101  	}()
 31102  }
 31103  
 31104  // C comment
 31105  //  /*
 31106  //  ** Extract a value from the supplied expression in the manner described
 31107  //  ** above sqlite3ValueFromExpr(). Allocate the sqlite3_value object
 31108  //  ** using valueNew().
 31109  //  **
 31110  //  ** If pCtx is NULL and an error occurs after the sqlite3_value object
 31111  //  ** has been allocated, it is freed before returning. Or, if pCtx is not
 31112  //  ** NULL, it is assumed that the caller will free any allocated object
 31113  //  ** in all cases.
 31114  //  */
 31115  func _valueFromExpr(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _enc uint8, _affinity uint8, _ppVal **XMem, _pCtx *t70) (r0 int32) {
 31116  	var _op, _negInt, _rc, _16_nVal int32
 31117  	var _zVal, _zNeg *int8
 31118  	var _1_aff uint8
 31119  	var _pVal *XMem
 31120  	_zVal = nil
 31121  	_pVal = nil
 31122  	_negInt = int32(1)
 31123  	_zNeg = str(284)
 31124  	_rc = int32(0)
 31125  	func() {
 31126  		if _pExpr == nil {
 31127  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70976), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(43591)))
 31128  			crt.X__builtin_abort(tls)
 31129  		}
 31130  	}()
 31131  _2:
 31132  	if (store2(&_op, int32(_pExpr.Xop)) == int32(156)) || (_op == int32(162)) {
 31133  		_pExpr = (*XExpr)(_pExpr.XpLeft)
 31134  		goto _2
 31135  	}
 31136  	if func() int32 {
 31137  		if _op == int32(157) {
 31138  			return func() int32 {
 31139  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70978), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(4809)))
 31140  				crt.X__builtin_abort(tls)
 31141  				return int32(1)
 31142  			}()
 31143  		}
 31144  		return int32(0)
 31145  	}() != 0 {
 31146  		_op = int32(_pExpr.Xop2)
 31147  	}
 31148  	func() {
 31149  		if (_pExpr.Xflags&uint32(16384)) != (0) && _pCtx != nil {
 31150  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70984), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(43600)))
 31151  			crt.X__builtin_abort(tls)
 31152  		}
 31153  	}()
 31154  	if _op != int32(37) {
 31155  		goto _11
 31156  	}
 31157  	_1_aff = uint8(_sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), nil))
 31158  	_rc = _valueFromExpr(tls, _db, (*XExpr)(_pExpr.XpLeft), _enc, _1_aff, _ppVal, _pCtx)
 31159  	if (*_ppVal) != nil {
 31160  		_sqlite3VdbeMemCast(tls, *_ppVal, _1_aff, uint8(1))
 31161  		_sqlite3ValueApplyAffinity(tls, *_ppVal, _affinity, uint8(1))
 31162  	}
 31163  	return _rc
 31164  
 31165  _11:
 31166  	if (_op == int32(155)) && ((int32((*XExpr)(_pExpr.XpLeft).Xop) == int32(134)) || (int32((*XExpr)(_pExpr.XpLeft).Xop) == int32(132))) {
 31167  		_pExpr = (*XExpr)(_pExpr.XpLeft)
 31168  		_op = int32(_pExpr.Xop)
 31169  		_negInt = int32(-1)
 31170  		_zNeg = str(37851)
 31171  	}
 31172  	if _op != int32(97) && _op != int32(132) && _op != int32(134) {
 31173  		goto _18
 31174  	}
 31175  	_pVal = _valueNew(tls, _db, _pCtx)
 31176  	if _pVal == nil {
 31177  		goto _no_mem
 31178  	}
 31179  	if (_pExpr.Xflags & uint32(1024)) != (0) {
 31180  		_sqlite3VdbeMemSetInt64(tls, _pVal, int64(*(*int32)(unsafe.Pointer(&_pExpr.Xu)))*int64(_negInt))
 31181  		goto _21
 31182  	}
 31183  	_zVal = _sqlite3MPrintf(tls, _db, str(6791), unsafe.Pointer(_zNeg), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 31184  	if _zVal == nil {
 31185  		goto _no_mem
 31186  	}
 31187  	_sqlite3ValueSetStr(tls, _pVal, int32(-1), unsafe.Pointer(_zVal), uint8(1), func() func(*crt.TLS, unsafe.Pointer) {
 31188  		v := _sqlite3MallocSize
 31189  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 31190  	}())
 31191  _21:
 31192  	if ((_op == int32(134)) || (_op == int32(132))) && (int32(_affinity) == int32(65)) {
 31193  		_sqlite3ValueApplyAffinity(tls, _pVal, uint8(67), uint8(1))
 31194  		goto _26
 31195  	}
 31196  	_sqlite3ValueApplyAffinity(tls, _pVal, _affinity, uint8(1))
 31197  _26:
 31198  	if (int32(_pVal.Xflags) & int32(12)) != 0 {
 31199  		{
 31200  			p := &_pVal.Xflags
 31201  			*p = uint16(int32(*p) & int32(-3))
 31202  		}
 31203  	}
 31204  	if int32(_enc) != int32(1) {
 31205  		_rc = _sqlite3VdbeChangeEncoding(tls, _pVal, int32(_enc))
 31206  	}
 31207  	goto _41
 31208  _18:
 31209  	if _op != int32(155) {
 31210  		goto _30
 31211  	}
 31212  	if int32(0) != _sqlite3ValueFromExpr(tls, _db, (*XExpr)(_pExpr.XpLeft), _enc, _affinity, &_pVal) || _pVal == nil {
 31213  		goto _32
 31214  	}
 31215  	_sqlite3VdbeMemNumerify(tls, _pVal)
 31216  	if (int32(_pVal.Xflags) & int32(8)) != 0 {
 31217  		*(*float64)(unsafe.Pointer(&_pVal.Xu)) = -(*(*float64)(unsafe.Pointer(&_pVal.Xu)))
 31218  		goto _36
 31219  	}
 31220  	if (*(*int64)(unsafe.Pointer(&_pVal.Xu))) == int64(-9223372036854775808) {
 31221  		*(*float64)(unsafe.Pointer(&_pVal.Xu)) = 9.223372036854776e+18
 31222  		_pVal.Xflags = uint16((int32(_pVal.Xflags) & int32(-49664)) | int32(8))
 31223  		goto _36
 31224  	}
 31225  	*(*int64)(unsafe.Pointer(&_pVal.Xu)) = -(*(*int64)(unsafe.Pointer(&_pVal.Xu)))
 31226  _36:
 31227  	_sqlite3ValueApplyAffinity(tls, _pVal, _affinity, _enc)
 31228  _32:
 31229  	goto _41
 31230  _30:
 31231  	if _op != int32(101) {
 31232  		goto _38
 31233  	}
 31234  	_pVal = _valueNew(tls, _db, _pCtx)
 31235  	if _pVal == nil {
 31236  		goto _no_mem
 31237  	}
 31238  	_sqlite3VdbeMemNumerify(tls, _pVal)
 31239  	goto _41
 31240  _38:
 31241  	if _op != int32(133) {
 31242  		goto _41
 31243  	}
 31244  	func() {
 31245  		if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) != int32(120) && int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) != int32(88) {
 31246  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71051), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(42516)))
 31247  			crt.X__builtin_abort(tls)
 31248  		}
 31249  	}()
 31250  	func() {
 31251  		if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), uintptr(1))) != int32(39) {
 31252  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71052), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(42567)))
 31253  			crt.X__builtin_abort(tls)
 31254  		}
 31255  	}()
 31256  	_pVal = _valueNew(tls, _db, _pCtx)
 31257  	if _pVal == nil {
 31258  		goto _no_mem
 31259  	}
 31260  	_zVal = elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), uintptr(2))
 31261  	_16_nVal = _sqlite3Strlen30(tls, _zVal) - int32(1)
 31262  	func() {
 31263  		if int32(*elem1(_zVal, uintptr(_16_nVal))) != int32(39) {
 31264  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71057), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(43644)))
 31265  			crt.X__builtin_abort(tls)
 31266  		}
 31267  	}()
 31268  	_sqlite3VdbeMemSetStr(tls, _pVal, (*int8)(_sqlite3HexToBlob(tls, _db, _zVal, _16_nVal)), _16_nVal/int32(2), 0, func() func(*crt.TLS, unsafe.Pointer) {
 31269  		v := _sqlite3MallocSize
 31270  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 31271  	}())
 31272  _41:
 31273  	*_ppVal = _pVal
 31274  	return _rc
 31275  
 31276  _no_mem:
 31277  	_sqlite3OomFault(tls, _db)
 31278  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zVal))
 31279  	func() {
 31280  		if (*_ppVal) != nil {
 31281  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71075), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(43661)))
 31282  			crt.X__builtin_abort(tls)
 31283  		}
 31284  	}()
 31285  	func() {
 31286  		if _pCtx != nil {
 31287  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71079), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(43671)))
 31288  			crt.X__builtin_abort(tls)
 31289  		}
 31290  	}()
 31291  	_sqlite3ValueFree(tls, _pVal)
 31292  	return _sqlite3NomemError(tls, int32(71081))
 31293  }
 31294  
 31295  var _valueFromExprØ00__func__Ø000 [14]int8
 31296  
 31297  func init() {
 31298  	crt.Xstrncpy(nil, &_valueFromExprØ00__func__Ø000[0], str(43679), 14)
 31299  }
 31300  
 31301  // C comment
 31302  //  /*
 31303  //  ** Scan the column type name zType (length nType) and return the
 31304  //  ** associated affinity type.
 31305  //  **
 31306  //  ** This routine does a case-independent search of zType for the
 31307  //  ** substrings in the following table. If one of the substrings is
 31308  //  ** found, the corresponding affinity is returned. If zType contains
 31309  //  ** more than one of the substrings, entries toward the top of
 31310  //  ** the table take priority. For example, if zType is 'BLOBINT',
 31311  //  ** SQLITE_AFF_INTEGER is returned.
 31312  //  **
 31313  //  ** Substring     | Affinity
 31314  //  ** --------------------------------
 31315  //  ** 'INT'         | SQLITE_AFF_INTEGER
 31316  //  ** 'CHAR'        | SQLITE_AFF_TEXT
 31317  //  ** 'CLOB'        | SQLITE_AFF_TEXT
 31318  //  ** 'TEXT'        | SQLITE_AFF_TEXT
 31319  //  ** 'BLOB'        | SQLITE_AFF_BLOB
 31320  //  ** 'REAL'        | SQLITE_AFF_REAL
 31321  //  ** 'FLOA'        | SQLITE_AFF_REAL
 31322  //  ** 'DOUB'        | SQLITE_AFF_REAL
 31323  //  **
 31324  //  ** If none of the substrings in the above table are found,
 31325  //  ** SQLITE_AFF_NUMERIC is returned.
 31326  //  */
 31327  func _sqlite3AffinityType(tls *crt.TLS, _zIn *int8, _pszEst *uint8) (r0 int8) {
 31328  	var _14_v int32
 31329  	var _aff int8
 31330  	var _h uint32
 31331  	var _zChar *int8
 31332  	_h = uint32(0)
 31333  	_aff = int8(67)
 31334  	_zChar = nil
 31335  	func() {
 31336  		if _zIn == nil {
 31337  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100847), unsafe.Pointer(&_sqlite3AffinityTypeØ00__func__Ø000), unsafe.Pointer(str(43693)))
 31338  			crt.X__builtin_abort(tls)
 31339  		}
 31340  	}()
 31341  _2:
 31342  	if (*elem1(_zIn, 0)) == 0 {
 31343  		goto _3
 31344  	}
 31345  	_h = (_h << 8) + uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(int32(*_zIn)&int32(255))))
 31346  	*(*uintptr)(unsafe.Pointer(&_zIn)) += uintptr(1)
 31347  	if _h == uint32(1667785074) {
 31348  		_aff = int8(66)
 31349  		_zChar = _zIn
 31350  		goto _24
 31351  	}
 31352  	if _h == uint32(1668050786) {
 31353  		_aff = int8(66)
 31354  		goto _24
 31355  	}
 31356  	if _h == uint32(1952807028) {
 31357  		_aff = int8(66)
 31358  		goto _24
 31359  	}
 31360  	if _h != uint32(1651273570) || int32(_aff) != int32(67) && int32(_aff) != int32(69) {
 31361  		goto _12
 31362  	}
 31363  	_aff = int8(65)
 31364  	if int32(*elem1(_zIn, 0)) == int32(40) {
 31365  		_zChar = _zIn
 31366  	}
 31367  	goto _24
 31368  _12:
 31369  	if (_h == uint32(1919246700)) && (int32(_aff) == int32(67)) {
 31370  		_aff = int8(69)
 31371  		goto _24
 31372  	}
 31373  	if (_h == uint32(1718382433)) && (int32(_aff) == int32(67)) {
 31374  		_aff = int8(69)
 31375  		goto _24
 31376  	}
 31377  	if (_h == uint32(1685026146)) && (int32(_aff) == int32(67)) {
 31378  		_aff = int8(69)
 31379  		goto _24
 31380  	}
 31381  	if (_h & uint32(16777215)) == uint32(6909556) {
 31382  		_aff = int8(68)
 31383  		goto _3
 31384  	}
 31385  _24:
 31386  	goto _2
 31387  _3:
 31388  	if _pszEst == nil {
 31389  		goto _25
 31390  	}
 31391  	*_pszEst = uint8(1)
 31392  	if int32(_aff) >= int32(67) {
 31393  		goto _26
 31394  	}
 31395  	if _zChar == nil {
 31396  		goto _27
 31397  	}
 31398  _28:
 31399  	if (*elem1(_zChar, 0)) == 0 {
 31400  		goto _29
 31401  	}
 31402  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zChar, 0))))) & int32(4)) == 0 {
 31403  		goto _30
 31404  	}
 31405  	_14_v = int32(0)
 31406  	_sqlite3GetInt32(tls, _zChar, &_14_v)
 31407  	_14_v = (_14_v / int32(4)) + int32(1)
 31408  	if _14_v > int32(255) {
 31409  		_14_v = int32(255)
 31410  	}
 31411  	*_pszEst = uint8(_14_v)
 31412  	goto _29
 31413  _30:
 31414  	*(*uintptr)(unsafe.Pointer(&_zChar)) += uintptr(1)
 31415  	goto _28
 31416  _29:
 31417  	goto _32
 31418  _27:
 31419  	*_pszEst = uint8(5)
 31420  _32:
 31421  _26:
 31422  _25:
 31423  	return _aff
 31424  }
 31425  
 31426  var _sqlite3AffinityTypeØ00__func__Ø000 [20]int8
 31427  
 31428  func init() {
 31429  	crt.Xstrncpy(nil, &_sqlite3AffinityTypeØ00__func__Ø000[0], str(43700), 20)
 31430  }
 31431  
 31432  // C comment
 31433  //  /*
 31434  //  ** If zNum represents an integer that will fit in 32-bits, then set
 31435  //  ** *pValue to that integer and return true.  Otherwise return false.
 31436  //  **
 31437  //  ** This routine accepts both decimal and hexadecimal notation for integers.
 31438  //  **
 31439  //  ** Any non-numeric characters that following zNum are ignored.
 31440  //  ** This is different from sqlite3Atoi64() which requires the
 31441  //  ** input number to be zero-terminated.
 31442  //  */
 31443  func _sqlite3GetInt32(tls *crt.TLS, _zNum *int8, _pValue *int32) (r0 int32) {
 31444  	var _i, _c, _neg int32
 31445  	var _v int64
 31446  	var _3_u uint32
 31447  	_v = int64(0)
 31448  	_neg = int32(0)
 31449  	if int32(*elem1(_zNum, 0)) == int32(45) {
 31450  		_neg = int32(1)
 31451  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
 31452  		goto _7
 31453  	}
 31454  	if int32(*elem1(_zNum, 0)) == int32(43) {
 31455  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
 31456  		goto _7
 31457  	}
 31458  	if int32(*elem1(_zNum, 0)) != int32(48) || int32(*elem1(_zNum, uintptr(1))) != int32(120) && int32(*elem1(_zNum, uintptr(1))) != int32(88) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zNum, uintptr(2))))))&int32(8)) == 0 {
 31459  		goto _7
 31460  	}
 31461  	_3_u = uint32(0)
 31462  	*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(int32(2))
 31463  _8:
 31464  	if int32(*elem1(_zNum, 0)) == int32(48) {
 31465  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
 31466  		goto _8
 31467  	}
 31468  	_i = int32(0)
 31469  _10:
 31470  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zNum, uintptr(_i))))))&int32(8)) == 0 || _i >= int32(8) {
 31471  		goto _14
 31472  	}
 31473  	_3_u = (_3_u * uint32(16)) + uint32(_sqlite3HexToInt(tls, int32(*elem1(_zNum, uintptr(_i)))))
 31474  	_i += 1
 31475  	goto _10
 31476  _14:
 31477  	if ((_3_u & uint32(2147483648)) == (0)) && ((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zNum, uintptr(_i)))))) & int32(8)) == int32(0)) {
 31478  		crt.Xmemcpy(tls, unsafe.Pointer(_pValue), unsafe.Pointer(&_3_u), uint64(4))
 31479  		return int32(1)
 31480  	}
 31481  	return int32(0)
 31482  
 31483  _7:
 31484  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zNum, 0))))) & int32(4)) == 0 {
 31485  		return int32(0)
 31486  	}
 31487  _18:
 31488  	if int32(*elem1(_zNum, 0)) == int32(48) {
 31489  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
 31490  		goto _18
 31491  	}
 31492  	_i = int32(0)
 31493  _21:
 31494  	if _i >= int32(11) || store2(&_c, int32(*elem1(_zNum, uintptr(_i)))-int32(48)) < int32(0) || _c > int32(9) {
 31495  		goto _26
 31496  	}
 31497  	_v = (_v * int64(10)) + int64(_c)
 31498  	_i += 1
 31499  	goto _21
 31500  _26:
 31501  	if _i > int32(10) {
 31502  		return int32(0)
 31503  	}
 31504  	if (_v - int64(_neg)) > int64(2147483647) {
 31505  		return int32(0)
 31506  	}
 31507  	if _neg != 0 {
 31508  		_v = -_v
 31509  	}
 31510  	*_pValue = int32(_v)
 31511  	return int32(1)
 31512  }
 31513  
 31514  // C comment
 31515  //  /*
 31516  //  ** Translate a single byte of Hex into an integer.
 31517  //  ** This routine only works if h really is a valid hexadecimal
 31518  //  ** character:  0..9a..fA..F
 31519  //  */
 31520  func _sqlite3HexToInt(tls *crt.TLS, _h int32) (r0 uint8) {
 31521  	func() {
 31522  		if (_h < int32(48) || _h > int32(57)) && (_h < int32(97) || _h > int32(102)) && (_h < int32(65) || _h > int32(70)) {
 31523  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28838), unsafe.Pointer(&_sqlite3HexToIntØ00__func__Ø000), unsafe.Pointer(str(43720)))
 31524  			crt.X__builtin_abort(tls)
 31525  		}
 31526  	}()
 31527  	_h += int32(9) * (int32(1) & (_h >> 6))
 31528  	return uint8(_h & int32(15))
 31529  }
 31530  
 31531  var _sqlite3HexToIntØ00__func__Ø000 [16]int8
 31532  
 31533  func init() {
 31534  	crt.Xstrncpy(nil, &_sqlite3HexToIntØ00__func__Ø000[0], str(43783), 16)
 31535  }
 31536  
 31537  // C comment
 31538  //  /*
 31539  //  ** Cast the datatype of the value in pMem according to the affinity
 31540  //  ** "aff".  Casting is different from applying affinity in that a cast
 31541  //  ** is forced.  In other words, the value is converted into the desired
 31542  //  ** affinity even if that results in loss of data.  This routine is
 31543  //  ** used (for example) to implement the SQL "cast()" operator.
 31544  //  */
 31545  func _sqlite3VdbeMemCast(tls *crt.TLS, _pMem *XMem, _aff uint8, _encoding uint8) {
 31546  	if (int32(_pMem.Xflags) & int32(1)) != 0 {
 31547  		return
 31548  	}
 31549  	switch int32(_aff) {
 31550  	case int32(65):
 31551  		goto _2
 31552  	case int32(67):
 31553  		goto _3
 31554  	case int32(68):
 31555  		goto _4
 31556  	case int32(69):
 31557  		goto _5
 31558  	default:
 31559  		goto _6
 31560  	}
 31561  
 31562  _2:
 31563  	if (int32(_pMem.Xflags) & int32(16)) != int32(0) {
 31564  		goto _7
 31565  	}
 31566  	_sqlite3ValueApplyAffinity(tls, _pMem, uint8(66), _encoding)
 31567  	func() {
 31568  		if (int32(_pMem.Xflags)&int32(2)) == 0 && ((*Xsqlite3)(_pMem.Xdb).XmallocFailed) == 0 {
 31569  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70304), unsafe.Pointer(&_sqlite3VdbeMemCastØ00__func__Ø000), unsafe.Pointer(str(43799)))
 31570  			crt.X__builtin_abort(tls)
 31571  		}
 31572  	}()
 31573  	if (int32(_pMem.Xflags) & int32(2)) != 0 {
 31574  		_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(16))
 31575  	}
 31576  	goto _12
 31577  _7:
 31578  	{
 31579  		p := &_pMem.Xflags
 31580  		*p = uint16(int32(*p) & int32(-33264))
 31581  	}
 31582  _12:
 31583  	goto _13
 31584  _3:
 31585  	_sqlite3VdbeMemNumerify(tls, _pMem)
 31586  	goto _13
 31587  _4:
 31588  	_sqlite3VdbeMemIntegerify(tls, _pMem)
 31589  	goto _13
 31590  _5:
 31591  	_sqlite3VdbeMemRealify(tls, _pMem)
 31592  	goto _13
 31593  _6:
 31594  	func() {
 31595  		if int32(_aff) != int32(66) {
 31596  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70324), unsafe.Pointer(&_sqlite3VdbeMemCastØ00__func__Ø000), unsafe.Pointer(str(43847)))
 31597  			crt.X__builtin_abort(tls)
 31598  		}
 31599  	}()
 31600  
 31601  	{
 31602  		p := &_pMem.Xflags
 31603  		*p = uint16(int32(*p) | ((int32(_pMem.Xflags) & int32(16)) >> 3))
 31604  	}
 31605  	_sqlite3ValueApplyAffinity(tls, _pMem, uint8(66), _encoding)
 31606  	func() {
 31607  		if (int32(_pMem.Xflags)&int32(2)) == 0 && ((*Xsqlite3)(_pMem.Xdb).XmallocFailed) == 0 {
 31608  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70328), unsafe.Pointer(&_sqlite3VdbeMemCastØ00__func__Ø000), unsafe.Pointer(str(43799)))
 31609  			crt.X__builtin_abort(tls)
 31610  		}
 31611  	}()
 31612  	{
 31613  		p := &_pMem.Xflags
 31614  		*p = uint16(int32(*p) & int32(-16413))
 31615  	}
 31616  	goto _13
 31617  _13:
 31618  }
 31619  
 31620  // C comment
 31621  //  /*
 31622  //  ** Exported version of applyAffinity(). This one works on sqlite3_value*,
 31623  //  ** not the internal Mem* type.
 31624  //  */
 31625  func _sqlite3ValueApplyAffinity(tls *crt.TLS, _pVal *XMem, _affinity uint8, _enc uint8) {
 31626  	_applyAffinity(tls, _pVal, int8(_affinity), _enc)
 31627  }
 31628  
 31629  // C comment
 31630  //  /*
 31631  //  ** Processing is determine by the affinity parameter:
 31632  //  **
 31633  //  ** SQLITE_AFF_INTEGER:
 31634  //  ** SQLITE_AFF_REAL:
 31635  //  ** SQLITE_AFF_NUMERIC:
 31636  //  **    Try to convert pRec to an integer representation or a
 31637  //  **    floating-point representation if an integer representation
 31638  //  **    is not possible.  Note that the integer representation is
 31639  //  **    always preferred, even if the affinity is REAL, because
 31640  //  **    an integer representation is more space efficient on disk.
 31641  //  **
 31642  //  ** SQLITE_AFF_TEXT:
 31643  //  **    Convert pRec to a text representation.
 31644  //  **
 31645  //  ** SQLITE_AFF_BLOB:
 31646  //  **    No-op.  pRec is unchanged.
 31647  //  */
 31648  func _applyAffinity(tls *crt.TLS, _pRec *XMem, _affinity int8, _enc uint8) {
 31649  	if int32(_affinity) < int32(67) {
 31650  		goto _0
 31651  	}
 31652  	func() {
 31653  		if int32(_affinity) != int32(68) && int32(_affinity) != int32(69) && int32(_affinity) != int32(67) {
 31654  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78494), unsafe.Pointer(&_applyAffinityØ00__func__Ø000), unsafe.Pointer(str(43868)))
 31655  			crt.X__builtin_abort(tls)
 31656  		}
 31657  	}()
 31658  	if (int32(_pRec.Xflags) & int32(4)) != int32(0) {
 31659  		goto _5
 31660  	}
 31661  	if (int32(_pRec.Xflags) & int32(8)) != int32(0) {
 31662  		goto _6
 31663  	}
 31664  	if (int32(_pRec.Xflags) & int32(2)) != 0 {
 31665  		_applyNumericAffinity(tls, _pRec, int32(1))
 31666  	}
 31667  	goto _8
 31668  _6:
 31669  	_sqlite3VdbeIntegerAffinity(tls, _pRec)
 31670  _8:
 31671  _5:
 31672  	goto _10
 31673  _0:
 31674  	if int32(_affinity) != int32(66) {
 31675  		goto _10
 31676  	}
 31677  	if int32(0) != (int32(_pRec.Xflags) & int32(2)) {
 31678  		goto _11
 31679  	}
 31680  	if (int32(_pRec.Xflags) & int32(12)) != 0 {
 31681  		_sqlite3VdbeMemStringify(tls, _pRec, _enc, uint8(1))
 31682  	}
 31683  _11:
 31684  	{
 31685  		p := &_pRec.Xflags
 31686  		*p = uint16(int32(*p) & int32(-13))
 31687  	}
 31688  _10:
 31689  }
 31690  
 31691  var _applyAffinityØ00__func__Ø000 [14]int8
 31692  
 31693  func init() {
 31694  	crt.Xstrncpy(nil, &_applyAffinityØ00__func__Ø000[0], str(43958), 14)
 31695  }
 31696  
 31697  // C comment
 31698  //  /*
 31699  //  ** Try to convert a value into a numeric representation if we can
 31700  //  ** do so without loss of information.  In other words, if the string
 31701  //  ** looks like a number, convert it into a number.  If it does not
 31702  //  ** look like a number, leave it alone.
 31703  //  **
 31704  //  ** If the bTryForInt flag is true, then extra effort is made to give
 31705  //  ** an integer representation.  Strings that look like floating point
 31706  //  ** values but which have no fractional component (example: '48.00')
 31707  //  ** will have a MEM_Int representation when bTryForInt is true.
 31708  //  **
 31709  //  ** If bTryForInt is false, then if the input string contains a decimal
 31710  //  ** point or exponential notation, the result is only MEM_Real, even
 31711  //  ** if there is an exact integer representation of the quantity.
 31712  //  */
 31713  func _applyNumericAffinity(tls *crt.TLS, _pRec *XMem, _bTryForInt int32) {
 31714  	var _iValue int64
 31715  	var _rValue float64
 31716  	var _enc uint8
 31717  	_enc = _pRec.Xenc
 31718  	func() {
 31719  		if (int32(_pRec.Xflags) & int32(14)) != int32(2) {
 31720  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78458), unsafe.Pointer(&_applyNumericAffinityØ00__func__Ø000), unsafe.Pointer(str(43972)))
 31721  			crt.X__builtin_abort(tls)
 31722  		}
 31723  	}()
 31724  	if _sqlite3AtoF(tls, _pRec.Xz, &_rValue, _pRec.Xn, _enc) == int32(0) {
 31725  		return
 31726  	}
 31727  	if int32(0) == _sqlite3Atoi64(tls, _pRec.Xz, &_iValue, _pRec.Xn, _enc) {
 31728  		*(*int64)(unsafe.Pointer(&_pRec.Xu)) = _iValue
 31729  		{
 31730  			p := &_pRec.Xflags
 31731  			*p = uint16(int32(*p) | int32(4))
 31732  		}
 31733  		goto _4
 31734  	}
 31735  	*(*float64)(unsafe.Pointer(&_pRec.Xu)) = _rValue
 31736  	{
 31737  		p := &_pRec.Xflags
 31738  		*p = uint16(int32(*p) | int32(8))
 31739  	}
 31740  	if _bTryForInt != 0 {
 31741  		_sqlite3VdbeIntegerAffinity(tls, _pRec)
 31742  	}
 31743  _4:
 31744  }
 31745  
 31746  var _applyNumericAffinityØ00__func__Ø000 [21]int8
 31747  
 31748  func init() {
 31749  	crt.Xstrncpy(nil, &_applyNumericAffinityØ00__func__Ø000[0], str(44024), 21)
 31750  }
 31751  
 31752  // C comment
 31753  //  /*
 31754  //  ** The MEM structure is already a MEM_Real.  Try to also make it a
 31755  //  ** MEM_Int if we can.
 31756  //  */
 31757  func _sqlite3VdbeIntegerAffinity(tls *crt.TLS, _pMem *XMem) {
 31758  	var _ix int64
 31759  	func() {
 31760  		if (int32(_pMem.Xflags) & int32(8)) == 0 {
 31761  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70217), unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000), unsafe.Pointer(str(44045)))
 31762  			crt.X__builtin_abort(tls)
 31763  		}
 31764  	}()
 31765  	func() {
 31766  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
 31767  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70218), unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000), unsafe.Pointer(str(6629)))
 31768  			crt.X__builtin_abort(tls)
 31769  		}
 31770  	}()
 31771  	func() {
 31772  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
 31773  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70219), unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000), unsafe.Pointer(str(4568)))
 31774  			crt.X__builtin_abort(tls)
 31775  		}
 31776  	}()
 31777  	func() {
 31778  		if (int64(uintptr(unsafe.Pointer(_pMem))) & int64(7)) != (0) {
 31779  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70220), unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000), unsafe.Pointer(str(6222)))
 31780  			crt.X__builtin_abort(tls)
 31781  		}
 31782  	}()
 31783  	_ix = _doubleToInt64(tls, *(*float64)(unsafe.Pointer(&_pMem.Xu)))
 31784  	if (((*(*float64)(unsafe.Pointer(&_pMem.Xu))) == float64(_ix)) && (_ix > int64(-9223372036854775808))) && (_ix < int64(9223372036854775807)) {
 31785  		*(*int64)(unsafe.Pointer(&_pMem.Xu)) = _ix
 31786  		_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(4))
 31787  	}
 31788  }
 31789  
 31790  var _sqlite3VdbeIntegerAffinityØ00__func__Ø000 [27]int8
 31791  
 31792  func init() {
 31793  	crt.Xstrncpy(nil, &_sqlite3VdbeIntegerAffinityØ00__func__Ø000[0], str(44068), 27)
 31794  }
 31795  
 31796  var _sqlite3VdbeMemCastØ00__func__Ø000 [19]int8
 31797  
 31798  func init() {
 31799  	crt.Xstrncpy(nil, &_sqlite3VdbeMemCastØ00__func__Ø000[0], str(44095), 19)
 31800  }
 31801  
 31802  // C comment
 31803  //  /*
 31804  //  ** Convert pMem so that it has types MEM_Real or MEM_Int or both.
 31805  //  ** Invalidate any prior representations.
 31806  //  **
 31807  //  ** Every effort is made to force the conversion, even if the input
 31808  //  ** is a string that does not look completely like a number.  Convert
 31809  //  ** as much of the string as we can and ignore the rest.
 31810  //  */
 31811  func _sqlite3VdbeMemNumerify(tls *crt.TLS, _pMem *XMem) (r0 int32) {
 31812  	if (int32(_pMem.Xflags) & int32(13)) != int32(0) {
 31813  		goto _0
 31814  	}
 31815  	func() {
 31816  		if (int32(_pMem.Xflags) & int32(18)) == int32(0) {
 31817  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70276), unsafe.Pointer(&_sqlite3VdbeMemNumerifyØ00__func__Ø000), unsafe.Pointer(str(44114)))
 31818  			crt.X__builtin_abort(tls)
 31819  		}
 31820  	}()
 31821  	func() {
 31822  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
 31823  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70277), unsafe.Pointer(&_sqlite3VdbeMemNumerifyØ00__func__Ø000), unsafe.Pointer(str(4568)))
 31824  			crt.X__builtin_abort(tls)
 31825  		}
 31826  	}()
 31827  	if int32(0) == _sqlite3Atoi64(tls, _pMem.Xz, (*int64)(unsafe.Pointer(&_pMem.Xu)), _pMem.Xn, _pMem.Xenc) {
 31828  		_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(4))
 31829  		goto _7
 31830  	}
 31831  	*(*float64)(unsafe.Pointer(&_pMem.Xu)) = _sqlite3VdbeRealValue(tls, _pMem)
 31832  	_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(8))
 31833  	_sqlite3VdbeIntegerAffinity(tls, _pMem)
 31834  _7:
 31835  _0:
 31836  	func() {
 31837  		if (int32(_pMem.Xflags) & int32(13)) == int32(0) {
 31838  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70286), unsafe.Pointer(&_sqlite3VdbeMemNumerifyØ00__func__Ø000), unsafe.Pointer(str(44152)))
 31839  			crt.X__builtin_abort(tls)
 31840  		}
 31841  	}()
 31842  	{
 31843  		p := &_pMem.Xflags
 31844  		*p = uint16(int32(*p) & int32(-16403))
 31845  	}
 31846  	return int32(0)
 31847  }
 31848  
 31849  var _sqlite3VdbeMemNumerifyØ00__func__Ø000 [23]int8
 31850  
 31851  func init() {
 31852  	crt.Xstrncpy(nil, &_sqlite3VdbeMemNumerifyØ00__func__Ø000[0], str(44199), 23)
 31853  }
 31854  
 31855  // C comment
 31856  //  /*
 31857  //  ** Convert pMem to type integer.  Invalidate any prior representations.
 31858  //  */
 31859  func _sqlite3VdbeMemIntegerify(tls *crt.TLS, _pMem *XMem) (r0 int32) {
 31860  	func() {
 31861  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
 31862  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70244), unsafe.Pointer(&_sqlite3VdbeMemIntegerifyØ00__func__Ø000), unsafe.Pointer(str(4568)))
 31863  			crt.X__builtin_abort(tls)
 31864  		}
 31865  	}()
 31866  	func() {
 31867  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
 31868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70245), unsafe.Pointer(&_sqlite3VdbeMemIntegerifyØ00__func__Ø000), unsafe.Pointer(str(6629)))
 31869  			crt.X__builtin_abort(tls)
 31870  		}
 31871  	}()
 31872  	func() {
 31873  		if (int64(uintptr(unsafe.Pointer(_pMem))) & int64(7)) != (0) {
 31874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70246), unsafe.Pointer(&_sqlite3VdbeMemIntegerifyØ00__func__Ø000), unsafe.Pointer(str(6222)))
 31875  			crt.X__builtin_abort(tls)
 31876  		}
 31877  	}()
 31878  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = _sqlite3VdbeIntValue(tls, _pMem)
 31879  	_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(4))
 31880  	return int32(0)
 31881  }
 31882  
 31883  var _sqlite3VdbeMemIntegerifyØ00__func__Ø000 [25]int8
 31884  
 31885  func init() {
 31886  	crt.Xstrncpy(nil, &_sqlite3VdbeMemIntegerifyØ00__func__Ø000[0], str(44222), 25)
 31887  }
 31888  
 31889  // C comment
 31890  //  /*
 31891  //  ** Convert pMem so that it is of type MEM_Real.
 31892  //  ** Invalidate any prior representations.
 31893  //  */
 31894  func _sqlite3VdbeMemRealify(tls *crt.TLS, _pMem *XMem) (r0 int32) {
 31895  	func() {
 31896  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
 31897  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70258), unsafe.Pointer(&_sqlite3VdbeMemRealifyØ00__func__Ø000), unsafe.Pointer(str(4568)))
 31898  			crt.X__builtin_abort(tls)
 31899  		}
 31900  	}()
 31901  	func() {
 31902  		if (int64(uintptr(unsafe.Pointer(_pMem))) & int64(7)) != (0) {
 31903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70259), unsafe.Pointer(&_sqlite3VdbeMemRealifyØ00__func__Ø000), unsafe.Pointer(str(6222)))
 31904  			crt.X__builtin_abort(tls)
 31905  		}
 31906  	}()
 31907  	*(*float64)(unsafe.Pointer(&_pMem.Xu)) = _sqlite3VdbeRealValue(tls, _pMem)
 31908  	_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(8))
 31909  	return int32(0)
 31910  }
 31911  
 31912  var _sqlite3VdbeMemRealifyØ00__func__Ø000 [22]int8
 31913  
 31914  func init() {
 31915  	crt.Xstrncpy(nil, &_sqlite3VdbeMemRealifyØ00__func__Ø000[0], str(44247), 22)
 31916  }
 31917  
 31918  // C comment
 31919  //  /*
 31920  //  ** Allocate and return a pointer to a new sqlite3_value object. If
 31921  //  ** the second argument to this function is NULL, the object is allocated
 31922  //  ** by calling sqlite3ValueNew().
 31923  //  **
 31924  //  ** Otherwise, if the second argument is non-zero, then this function is
 31925  //  ** being called indirectly by sqlite3Stat4ProbeSetValue(). If it has not
 31926  //  ** already been allocated, allocate the UnpackedRecord structure that
 31927  //  ** that function will return to its caller here. Then return a pointer to
 31928  //  ** an sqlite3_value within the UnpackedRecord.a[] array.
 31929  //  */
 31930  func _valueNew(tls *crt.TLS, _db *Xsqlite3, _p *t70) (r0 *XMem) {
 31931  	return _sqlite3ValueNew(tls, _db)
 31932  }
 31933  
 31934  // C comment
 31935  //  /*
 31936  //  ** Convert a BLOB literal of the form "x'hhhhhh'" into its binary
 31937  //  ** value.  Return a pointer to its binary value.  Space to hold the
 31938  //  ** binary value has been obtained from malloc and must be freed by
 31939  //  ** the calling routine.
 31940  //  */
 31941  func _sqlite3HexToBlob(tls *crt.TLS, _db *Xsqlite3, _z *int8, _n int32) (r0 unsafe.Pointer) {
 31942  	var _i int32
 31943  	var _zBlob *int8
 31944  	_zBlob = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64((_n/int32(2))+int32(1))))
 31945  	_n -= 1
 31946  	if _zBlob == nil {
 31947  		goto _0
 31948  	}
 31949  	_i = int32(0)
 31950  _1:
 31951  	if _i >= _n {
 31952  		goto _4
 31953  	}
 31954  	*elem1(_zBlob, uintptr(_i/int32(2))) = int8((int32(_sqlite3HexToInt(tls, int32(*elem1(_z, uintptr(_i))))) << 4) | int32(_sqlite3HexToInt(tls, int32(*elem1(_z, uintptr(_i+int32(1)))))))
 31955  	_i += int32(2)
 31956  	goto _1
 31957  _4:
 31958  	*elem1(_zBlob, uintptr(_i/int32(2))) = 0
 31959  _0:
 31960  	return unsafe.Pointer(_zBlob)
 31961  }
 31962  
 31963  func _sqlite3VdbeAddOp1(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32) (r0 int32) {
 31964  	return _sqlite3VdbeAddOp3(tls, _p, _op, _p1, int32(0), int32(0))
 31965  }
 31966  
 31967  // C comment
 31968  //  /*
 31969  //  ** Record in the column cache that a particular column from a
 31970  //  ** particular table is stored in a particular register.
 31971  //  */
 31972  func _sqlite3ExprCacheStore(tls *crt.TLS, _pParse *XParse, _iTab int32, _iCol int32, _iReg int32) {
 31973  	var _i, _minLru, _idxLru int32
 31974  	var _p *TyColCache
 31975  	func() {
 31976  		if _iReg <= int32(0) && _pParse.XnErr == 0 && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 31977  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94005), unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000), unsafe.Pointer(str(44269)))
 31978  			crt.X__builtin_abort(tls)
 31979  		}
 31980  	}()
 31981  	func() {
 31982  		if _iCol < int32(-1) || _iCol >= int32(32768) {
 31983  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94006), unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000), unsafe.Pointer(str(44320)))
 31984  			crt.X__builtin_abort(tls)
 31985  		}
 31986  	}()
 31987  	if (int32((*Xsqlite3)(_pParse.Xdb).XdbOptFlags) & int32(2)) != int32(0) {
 31988  		return
 31989  	}
 31990  	*func() **TyColCache { _i = int32(0); return &_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 31991  _8:
 31992  	if _i >= int32(_pParse.XnColCache) {
 31993  		goto _11
 31994  	}
 31995  	func() {
 31996  		if _p.XiTable == _iTab && int32(_p.XiColumn) == _iCol {
 31997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94021), unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000), unsafe.Pointer(str(44343)))
 31998  			crt.X__builtin_abort(tls)
 31999  		}
 32000  	}()
 32001  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
 32002  	goto _8
 32003  _11:
 32004  	if int32(_pParse.XnColCache) < int32(10) {
 32005  		goto _15
 32006  	}
 32007  	_minLru = int32(2147483647)
 32008  	_idxLru = int32(-1)
 32009  	*func() **TyColCache { _i = int32(0); return &_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 32010  _16:
 32011  	if _i >= int32(10) {
 32012  		goto _19
 32013  	}
 32014  	if _p.Xlru < _minLru {
 32015  		_idxLru = _i
 32016  		_minLru = _p.Xlru
 32017  	}
 32018  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
 32019  	goto _16
 32020  _19:
 32021  	_p = elem71((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_idxLru))
 32022  	goto _21
 32023  _15:
 32024  	_p = elem71((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(postInc3(&_pParse.XnColCache, byte(1))))
 32025  _21:
 32026  	_p.XiLevel = _pParse.XiCacheLevel
 32027  	_p.XiTable = _iTab
 32028  	_p.XiColumn = int16(_iCol)
 32029  	_p.XiReg = _iReg
 32030  	_p.XtempReg = 0
 32031  	_p.Xlru = postInc2(&_pParse.XiCacheCnt, 1)
 32032  }
 32033  
 32034  var _sqlite3ExprCacheStoreØ00__func__Ø000 [22]int8
 32035  
 32036  func init() {
 32037  	crt.Xstrncpy(nil, &_sqlite3ExprCacheStoreØ00__func__Ø000[0], str(44379), 22)
 32038  }
 32039  
 32040  // C comment
 32041  //  /*
 32042  //  ** Generate an instruction that will put the integer describe by
 32043  //  ** text z[0..n-1] into register iMem.
 32044  //  **
 32045  //  ** Expr.u.zToken is always UTF8 and zero-terminated.
 32046  //  */
 32047  func _codeInteger(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _negFlag int32, _iMem int32) {
 32048  	var _1_i, _2_c int32
 32049  	var _2_value int64
 32050  	var _2_z *int8
 32051  	var _v *TVdbe
 32052  	_v = (*TVdbe)(_pParse.XpVdbe)
 32053  	if (_pExpr.Xflags & uint32(1024)) == 0 {
 32054  		goto _0
 32055  	}
 32056  	_1_i = *(*int32)(unsafe.Pointer(&_pExpr.Xu))
 32057  	func() {
 32058  		if _1_i < int32(0) {
 32059  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93949), unsafe.Pointer(&_codeIntegerØ00__func__Ø000), unsafe.Pointer(str(44401)))
 32060  			crt.X__builtin_abort(tls)
 32061  		}
 32062  	}()
 32063  	if _negFlag != 0 {
 32064  		_1_i = -_1_i
 32065  	}
 32066  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _1_i, _iMem)
 32067  	goto _4
 32068  _0:
 32069  	_2_z = *(**int8)(unsafe.Pointer(&_pExpr.Xu))
 32070  	func() {
 32071  		if _2_z == nil {
 32072  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93956), unsafe.Pointer(&_codeIntegerØ00__func__Ø000), unsafe.Pointer(str(44406)))
 32073  			crt.X__builtin_abort(tls)
 32074  		}
 32075  	}()
 32076  	_2_c = _sqlite3DecOrHexToI64(tls, _2_z, &_2_value)
 32077  	if _2_c != int32(1) && (_2_c != int32(2) || _negFlag != 0) && (_negFlag == 0 || _2_value != int64(-9223372036854775808)) {
 32078  		goto _11
 32079  	}
 32080  	if Xsqlite3_strnicmp(tls, _2_z, str(44411), int32(2)) == int32(0) {
 32081  		_sqlite3ErrorMsg(tls, _pParse, str(44414), unsafe.Pointer(func() *int8 {
 32082  			if _negFlag != 0 {
 32083  				return str(37851)
 32084  			}
 32085  			return str(284)
 32086  		}()), unsafe.Pointer(_2_z))
 32087  		goto _15
 32088  	}
 32089  	_codeReal(tls, _v, _2_z, _negFlag, _iMem)
 32090  _15:
 32091  	goto _16
 32092  _11:
 32093  	if _negFlag != 0 {
 32094  		_2_value = func() int64 {
 32095  			if _2_c == int32(2) {
 32096  				return int64(-9223372036854775808)
 32097  			}
 32098  			return (-_2_value)
 32099  		}()
 32100  	}
 32101  	_sqlite3VdbeAddOp4Dup8(tls, _v, int32(57), int32(0), _iMem, int32(0), (*uint8)(unsafe.Pointer(&_2_value)), int32(-10))
 32102  _16:
 32103  _4:
 32104  }
 32105  
 32106  var _codeIntegerØ00__func__Ø000 [12]int8
 32107  
 32108  func init() {
 32109  	crt.Xstrncpy(nil, &_codeIntegerØ00__func__Ø000[0], str(44440), 12)
 32110  }
 32111  
 32112  // C comment
 32113  //  /*
 32114  //  ** Transform a UTF-8 integer literal, in either decimal or hexadecimal,
 32115  //  ** into a 64-bit signed integer.  This routine accepts hexadecimal literals,
 32116  //  ** whereas sqlite3Atoi64() does not.
 32117  //  **
 32118  //  ** Returns:
 32119  //  **
 32120  //  **     0    Successful transformation.  Fits in a 64-bit signed integer.
 32121  //  **     1    Integer too large for a 64-bit signed integer or is malformed
 32122  //  **     2    Special case of 9223372036854775808
 32123  //  */
 32124  func _sqlite3DecOrHexToI64(tls *crt.TLS, _z *int8, _pOut *int64) (r0 int32) {
 32125  	var _1_i, _1_k int32
 32126  	var _1_u uint64
 32127  	if int32(*elem1(_z, 0)) != int32(48) || int32(*elem1(_z, uintptr(1))) != int32(120) && int32(*elem1(_z, uintptr(1))) != int32(88) {
 32128  		goto _2
 32129  	}
 32130  	_1_u = uint64(0)
 32131  	_1_i = int32(2)
 32132  _3:
 32133  	if int32(*elem1(_z, uintptr(_1_i))) != int32(48) {
 32134  		goto _6
 32135  	}
 32136  	_1_i += 1
 32137  	goto _3
 32138  _6:
 32139  	_1_k = _1_i
 32140  _7:
 32141  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_z, uintptr(_1_k)))))) & int32(8)) == 0 {
 32142  		goto _10
 32143  	}
 32144  	_1_u = (_1_u * uint64(16)) + uint64(_sqlite3HexToInt(tls, int32(*elem1(_z, uintptr(_1_k)))))
 32145  	_1_k += 1
 32146  	goto _7
 32147  _10:
 32148  	crt.Xmemcpy(tls, unsafe.Pointer(_pOut), unsafe.Pointer(&_1_u), uint64(8))
 32149  	return func() int32 {
 32150  		if (int32(*elem1(_z, uintptr(_1_k))) == int32(0)) && ((_1_k - _1_i) <= int32(16)) {
 32151  			return int32(0)
 32152  		}
 32153  		return int32(1)
 32154  	}()
 32155  
 32156  _2:
 32157  	return _sqlite3Atoi64(tls, _z, _pOut, _sqlite3Strlen30(tls, _z), uint8(1))
 32158  }
 32159  
 32160  // C comment
 32161  //  /*
 32162  //  ** Generate an instruction that will put the floating point
 32163  //  ** value described by z[0..n-1] into register iMem.
 32164  //  **
 32165  //  ** The z[] string will probably not be zero-terminated.  But the
 32166  //  ** z[n] character is guaranteed to be something that does not look
 32167  //  ** like the continuation of the number.
 32168  //  */
 32169  func _codeReal(tls *crt.TLS, _v *TVdbe, _z *int8, _negateFlag int32, _iMem int32) {
 32170  	var _1_value float64
 32171  	if func() int32 {
 32172  		if _z != nil {
 32173  			return int32(1)
 32174  		}
 32175  		return func() int32 {
 32176  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93928), unsafe.Pointer(&_codeRealØ00__func__Ø000), unsafe.Pointer(str(4809)))
 32177  			crt.X__builtin_abort(tls)
 32178  			return int32(0)
 32179  		}()
 32180  	}() == 0 {
 32181  		goto _2
 32182  	}
 32183  	_sqlite3AtoF(tls, _z, &_1_value, _sqlite3Strlen30(tls, _z), uint8(1))
 32184  	func() {
 32185  		if _sqlite3IsNaN(tls, _1_value) != 0 {
 32186  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93931), unsafe.Pointer(&_codeRealØ00__func__Ø000), unsafe.Pointer(str(44452)))
 32187  			crt.X__builtin_abort(tls)
 32188  		}
 32189  	}()
 32190  	if _negateFlag != 0 {
 32191  		_1_value = -_1_value
 32192  	}
 32193  	_sqlite3VdbeAddOp4Dup8(tls, _v, int32(132), int32(0), _iMem, int32(0), (*uint8)(unsafe.Pointer(&_1_value)), int32(-9))
 32194  _2:
 32195  }
 32196  
 32197  var _codeRealØ00__func__Ø000 [9]int8
 32198  
 32199  func init() {
 32200  	crt.Xstrncpy(nil, &_codeRealØ00__func__Ø000[0], str(44473), 9)
 32201  }
 32202  
 32203  // C comment
 32204  //  /*
 32205  //  ** Add an opcode that includes the p4 value with a P4_INT64 or
 32206  //  ** P4_REAL type.
 32207  //  */
 32208  func _sqlite3VdbeAddOp4Dup8(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _zP4 *uint8, _p4type int32) (r0 int32) {
 32209  	var _p4copy *int8
 32210  	_p4copy = (*int8)(_sqlite3DbMallocRawNN(tls, _sqlite3VdbeDb(tls, _p), uint64(8)))
 32211  	if _p4copy != nil {
 32212  		crt.Xmemcpy(tls, unsafe.Pointer(_p4copy), unsafe.Pointer(_zP4), uint64(8))
 32213  	}
 32214  	return _sqlite3VdbeAddOp4(tls, _p, _op, _p1, _p2, _p3, _p4copy, _p4type)
 32215  }
 32216  
 32217  // C comment
 32218  //  /*
 32219  //  ** Record the fact that an affinity change has occurred on iCount
 32220  //  ** registers starting with iStart.
 32221  //  */
 32222  func _sqlite3ExprCacheAffinityChange(tls *crt.TLS, _pParse *XParse, _iStart int32, _iCount int32) {
 32223  	_sqlite3ExprCacheRemove(tls, _pParse, _iStart, _iCount)
 32224  }
 32225  
 32226  // C comment
 32227  //  /*
 32228  //  ** Indicate that registers between iReg..iReg+nReg-1 are being overwritten.
 32229  //  ** Purge the range of registers from the column cache.
 32230  //  */
 32231  func _sqlite3ExprCacheRemove(tls *crt.TLS, _pParse *XParse, _iReg int32, _nReg int32) {
 32232  	var _i int32
 32233  	var _1_p *TyColCache
 32234  	_i = int32(0)
 32235  _0:
 32236  	if _i >= int32(_pParse.XnColCache) {
 32237  		goto _1
 32238  	}
 32239  	_1_p = elem71((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i))
 32240  	if (_1_p.XiReg >= _iReg) && (_1_p.XiReg < (_iReg + _nReg)) {
 32241  		_cacheEntryClear(tls, _pParse, _i)
 32242  		goto _4
 32243  	}
 32244  	_i += 1
 32245  _4:
 32246  	goto _0
 32247  _1:
 32248  }
 32249  
 32250  // C comment
 32251  //  /*
 32252  //  ** Erase column-cache entry number i
 32253  //  */
 32254  func _cacheEntryClear(tls *crt.TLS, _pParse *XParse, _i int32) {
 32255  	if (elem71((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)).XtempReg) == 0 {
 32256  		goto _0
 32257  	}
 32258  	if int32(_pParse.XnTempReg) < int32(8) {
 32259  		*elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(postInc3(&_pParse.XnTempReg, byte(1)))) = elem71((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)).XiReg
 32260  	}
 32261  _0:
 32262  	_pParse.XnColCache -= 1
 32263  	if _i < int32(_pParse.XnColCache) {
 32264  		*elem71((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)) = *elem71((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_pParse.XnColCache))
 32265  	}
 32266  }
 32267  
 32268  // C comment
 32269  //  /*
 32270  //  ** Return true if expression pExpr is a vector, or false otherwise.
 32271  //  **
 32272  //  ** A vector is defined as any expression that results in two or more
 32273  //  ** columns of result.  Every TK_VECTOR node is an vector because the
 32274  //  ** parser will not generate a TK_VECTOR with fewer than two entries.
 32275  //  ** But a TK_SELECT might be either a vector or a scalar. It is only
 32276  //  ** considered a vector if it has two or more result columns.
 32277  //  */
 32278  func _sqlite3ExprIsVector(tls *crt.TLS, _pExpr *XExpr) (r0 int32) {
 32279  	return bool2int(_sqlite3ExprVectorSize(tls, _pExpr) > int32(1))
 32280  }
 32281  
 32282  // C comment
 32283  //  /*
 32284  //  ** If the expression passed as the only argument is of type TK_VECTOR
 32285  //  ** return the number of expressions in the vector. Or, if the expression
 32286  //  ** is a sub-select, return the number of columns in the sub-select. For
 32287  //  ** any other type of expression, return 1.
 32288  //  */
 32289  func _sqlite3ExprVectorSize(tls *crt.TLS, _pExpr *XExpr) (r0 int32) {
 32290  	var _op uint8
 32291  	_op = _pExpr.Xop
 32292  	if int32(_op) == int32(157) {
 32293  		_op = _pExpr.Xop2
 32294  	}
 32295  	if int32(_op) == int32(158) {
 32296  		return (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XnExpr
 32297  	}
 32298  	if int32(_op) == int32(119) {
 32299  		return (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpEList).XnExpr
 32300  	}
 32301  	return int32(1)
 32302  }
 32303  
 32304  // C comment
 32305  //  /*
 32306  //  ** Expression pExpr is a comparison between two vector values. Compute
 32307  //  ** the result of the comparison (1, 0, or NULL) and write that
 32308  //  ** result into register dest.
 32309  //  **
 32310  //  ** The caller must satisfy the following preconditions:
 32311  //  **
 32312  //  **    if pExpr->op==TK_IS:      op==TK_EQ and p5==SQLITE_NULLEQ
 32313  //  **    if pExpr->op==TK_ISNOT:   op==TK_NE and p5==SQLITE_NULLEQ
 32314  //  **    otherwise:                op==pExpr->op and p5==0
 32315  //  */
 32316  func _codeVectorCompare(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _op uint8, _p5 uint8) {
 32317  	var _nLeft, _i, _regLeft, _regRight, _addrDone, _2_regFree1, _2_regFree2, _2_r1, _2_r2 int32
 32318  	var _opx uint8
 32319  	var _v *TVdbe
 32320  	var _pLeft, _pRight, _2_pL, _2_pR *XExpr
 32321  	_v = (*TVdbe)(_pParse.XpVdbe)
 32322  	_pLeft = (*XExpr)(_pExpr.XpLeft)
 32323  	_pRight = (*XExpr)(_pExpr.XpRight)
 32324  	_nLeft = _sqlite3ExprVectorSize(tls, _pLeft)
 32325  	_regLeft = int32(0)
 32326  	_regRight = int32(0)
 32327  	_opx = _op
 32328  	_addrDone = _sqlite3VdbeMakeLabel(tls, _v)
 32329  	if _nLeft != _sqlite3ExprVectorSize(tls, _pRight) {
 32330  		_sqlite3ErrorMsg(tls, _pParse, str(43136))
 32331  		return
 32332  	}
 32333  	func() {
 32334  		if int32(_pExpr.Xop) != int32(78) && int32(_pExpr.Xop) != int32(77) && int32(_pExpr.Xop) != int32(72) && int32(_pExpr.Xop) != int32(148) && int32(_pExpr.Xop) != int32(81) && int32(_pExpr.Xop) != int32(79) && int32(_pExpr.Xop) != int32(80) && int32(_pExpr.Xop) != int32(82) {
 32335  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91429), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44482)))
 32336  			crt.X__builtin_abort(tls)
 32337  		}
 32338  	}()
 32339  	func() {
 32340  		if int32(_pExpr.Xop) != int32(_op) && (int32(_pExpr.Xop) != int32(72) || int32(_op) != int32(78)) && (int32(_pExpr.Xop) != int32(148) || int32(_op) != int32(77)) {
 32341  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91434), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44642)))
 32342  			crt.X__builtin_abort(tls)
 32343  		}
 32344  	}()
 32345  	func() {
 32346  		if int32(_p5) != int32(0) && int32(_pExpr.Xop) == int32(_op) {
 32347  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91436), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44729)))
 32348  			crt.X__builtin_abort(tls)
 32349  		}
 32350  	}()
 32351  	func() {
 32352  		if int32(_p5) != int32(128) && int32(_pExpr.Xop) != int32(_op) {
 32353  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91437), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44752)))
 32354  			crt.X__builtin_abort(tls)
 32355  		}
 32356  	}()
 32357  	{
 32358  		p := &_p5
 32359  		*p = uint8(int32(*p) | int32(32))
 32360  	}
 32361  	if int32(_opx) == int32(80) {
 32362  		_opx = uint8(81)
 32363  	}
 32364  	if int32(_opx) == int32(82) {
 32365  		_opx = uint8(79)
 32366  	}
 32367  	_regLeft = _exprCodeSubselect(tls, _pParse, _pLeft)
 32368  	_regRight = _exprCodeSubselect(tls, _pParse, _pRight)
 32369  	_i = int32(0)
 32370  _24:
 32371  	_2_regFree1 = int32(0)
 32372  	_2_regFree2 = int32(0)
 32373  	func() {
 32374  		if _i < int32(0) || _i >= _nLeft {
 32375  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91450), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44787)))
 32376  			crt.X__builtin_abort(tls)
 32377  		}
 32378  	}()
 32379  	if _i > int32(0) {
 32380  		_sqlite3ExprCachePush(tls, _pParse)
 32381  	}
 32382  	_2_r1 = _exprVectorRegister(tls, _pParse, _pLeft, _i, _regLeft, &_2_pL, &_2_regFree1)
 32383  	_2_r2 = _exprVectorRegister(tls, _pParse, _pRight, _i, _regRight, &_2_pR, &_2_regFree2)
 32384  	_codeCompare(tls, _pParse, _2_pL, _2_pR, int32(_opx), _2_r1, _2_r2, _dest, int32(_p5))
 32385  	_sqlite3ReleaseTempReg(tls, _pParse, _2_regFree1)
 32386  	_sqlite3ReleaseTempReg(tls, _pParse, _2_regFree2)
 32387  	if _i > int32(0) {
 32388  		_sqlite3ExprCachePop(tls, _pParse)
 32389  	}
 32390  	if _i == (_nLeft - int32(1)) {
 32391  		goto _27
 32392  	}
 32393  	if int32(_opx) == int32(78) {
 32394  		_sqlite3VdbeAddOp2(tls, _v, int32(22), _dest, _addrDone)
 32395  		{
 32396  			p := &_p5
 32397  			*p = uint8(int32(*p) | int32(8))
 32398  		}
 32399  		goto _37
 32400  	}
 32401  	if int32(_opx) == int32(77) {
 32402  		_sqlite3VdbeAddOp2(tls, _v, int32(21), _dest, _addrDone)
 32403  		{
 32404  			p := &_p5
 32405  			*p = uint8(int32(*p) | int32(8))
 32406  		}
 32407  		goto _37
 32408  	}
 32409  	func() {
 32410  		if int32(_op) != int32(81) && int32(_op) != int32(79) && int32(_op) != int32(80) && int32(_op) != int32(82) {
 32411  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91474), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44803)))
 32412  			crt.X__builtin_abort(tls)
 32413  		}
 32414  	}()
 32415  	_sqlite3VdbeAddOp2(tls, _v, int32(83), int32(0), _addrDone)
 32416  	if _i == (_nLeft - int32(2)) {
 32417  		_opx = _op
 32418  	}
 32419  _37:
 32420  	_i += 1
 32421  	goto _24
 32422  _27:
 32423  	_sqlite3VdbeResolveLabel(tls, _v, _addrDone)
 32424  }
 32425  
 32426  // C comment
 32427  //  /*
 32428  //  ** Create a new symbolic label for an instruction that has yet to be
 32429  //  ** coded.  The symbolic label is really just a negative number.  The
 32430  //  ** label can be used as the P2 value of an operation.  Later, when
 32431  //  ** the label is resolved to a specific address, the VDBE will scan
 32432  //  ** through its operation list and change all values of P2 which match
 32433  //  ** the label into the resolved address.
 32434  //  **
 32435  //  ** The VDBE knows that a P2 value is a label because labels are
 32436  //  ** always negative and P2 values are suppose to be non-negative.
 32437  //  ** Hence, a negative P2 value is a label that has yet to be resolved.
 32438  //  **
 32439  //  ** Zero is returned if a malloc() fails.
 32440  //  */
 32441  func _sqlite3VdbeMakeLabel(tls *crt.TLS, _v *TVdbe) (r0 int32) {
 32442  	var _i int32
 32443  	var _p *XParse
 32444  	_p = (*XParse)(_v.XpParse)
 32445  	_i = postInc2(&_p.XnLabel, 1)
 32446  	func() {
 32447  		if _v.Xmagic != uint32(381479589) {
 32448  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71784), unsafe.Pointer(&_sqlite3VdbeMakeLabelØ00__func__Ø000), unsafe.Pointer(str(44852)))
 32449  			crt.X__builtin_abort(tls)
 32450  		}
 32451  	}()
 32452  	if (_i & (_i - int32(1))) == int32(0) {
 32453  		_p.XaLabel = (*int32)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p.XaLabel), uint64((_i*int32(2))+int32(1))*uint64(4)))
 32454  	}
 32455  	if _p.XaLabel != nil {
 32456  		*elem8(_p.XaLabel, uintptr(_i)) = int32(-1)
 32457  	}
 32458  	return int32(-1) - _i
 32459  }
 32460  
 32461  var _sqlite3VdbeMakeLabelØ00__func__Ø000 [21]int8
 32462  
 32463  func init() {
 32464  	crt.Xstrncpy(nil, &_sqlite3VdbeMakeLabelØ00__func__Ø000[0], str(44878), 21)
 32465  }
 32466  
 32467  var _codeVectorCompareØ00__func__Ø000 [18]int8
 32468  
 32469  func init() {
 32470  	crt.Xstrncpy(nil, &_codeVectorCompareØ00__func__Ø000[0], str(44899), 18)
 32471  }
 32472  
 32473  // C comment
 32474  //  /*
 32475  //  ** If expression pExpr is of type TK_SELECT, generate code to evaluate
 32476  //  ** it. Return the register in which the result is stored (or, if the
 32477  //  ** sub-select returns more than one column, the first in an array
 32478  //  ** of registers in which the result is stored).
 32479  //  **
 32480  //  ** If pExpr is not a TK_SELECT expression, return 0.
 32481  //  */
 32482  func _exprCodeSubselect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 int32) {
 32483  	var _reg int32
 32484  	_reg = int32(0)
 32485  	if int32(_pExpr.Xop) == int32(119) {
 32486  		_reg = _sqlite3CodeSubselect(tls, _pParse, _pExpr, int32(0), int32(0))
 32487  	}
 32488  	return _reg
 32489  }
 32490  
 32491  func _sqlite3CodeSubselect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _rHasNullFlag int32, _isRowid int32) (r0 int32) {
 32492  	var _jmpIfDynamic, _rReg, _4_addr, _4_nVal, _6_i, _9_i, _9_r1, _9_r2, _9_r3, _12_iValToIns, _19_nReg int32
 32493  	var _9_affinity int8
 32494  	var _2_zMsg *int8
 32495  	var _v *TVdbe
 32496  	var _5_pEList, _9_pList *XExprList
 32497  	var _9_pItem *TExprList_item
 32498  	var _5_pSelect, _19_pSel *XSelect
 32499  	var _4_pLeft, _8_p, _12_pE2 *XExpr
 32500  	var _4_pKeyInfo *XKeyInfo
 32501  	var _6_dest, _19_dest XSelectDest
 32502  	_jmpIfDynamic = int32(-1)
 32503  	_rReg = int32(0)
 32504  	_v = _sqlite3GetVdbe(tls, _pParse)
 32505  	if func() int32 {
 32506  		if _v == nil {
 32507  			return func() int32 {
 32508  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93411), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(4809)))
 32509  				crt.X__builtin_abort(tls)
 32510  				return int32(1)
 32511  			}()
 32512  		}
 32513  		return int32(0)
 32514  	}() != 0 {
 32515  		return int32(0)
 32516  	}
 32517  	_sqlite3ExprCachePush(tls, _pParse)
 32518  	if (_pExpr.Xflags & uint32(32)) == (0) {
 32519  		_jmpIfDynamic = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 32520  	}
 32521  	if int32(_pParse.Xexplain) == int32(2) {
 32522  		_2_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(44917), unsafe.Pointer(func() *int8 {
 32523  			if _jmpIfDynamic >= int32(0) {
 32524  				return str(284)
 32525  			}
 32526  			return str(44942)
 32527  		}()), unsafe.Pointer(func() *int8 {
 32528  			if int32(_pExpr.Xop) == int32(74) {
 32529  				return str(44954)
 32530  			}
 32531  			return str(44959)
 32532  		}()), _pParse.XiNextSelectId)
 32533  		_sqlite3VdbeAddOp4(tls, _v, int32(165), _pParse.XiSelectId, int32(0), int32(0), _2_zMsg, int32(-1))
 32534  	}
 32535  	switch int32(_pExpr.Xop) {
 32536  	case int32(20):
 32537  		goto _11
 32538  	case int32(74):
 32539  		goto _10
 32540  	case int32(119):
 32541  		goto _11
 32542  	default:
 32543  		goto _11
 32544  	}
 32545  
 32546  _10:
 32547  	_4_pLeft = (*XExpr)(_pExpr.XpLeft)
 32548  	_4_pKeyInfo = nil
 32549  	_4_nVal = _sqlite3ExprVectorSize(tls, _4_pLeft)
 32550  	func() {
 32551  		if _isRowid != 0 && _4_nVal != int32(1) {
 32552  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93447), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(44966)))
 32553  			crt.X__builtin_abort(tls)
 32554  		}
 32555  	}()
 32556  	_pExpr.XiTable = postInc2(&_pParse.XnTab, 1)
 32557  	_4_addr = _sqlite3VdbeAddOp2(tls, _v, int32(110), _pExpr.XiTable, func() int32 {
 32558  		if _isRowid != 0 {
 32559  			return int32(0)
 32560  		}
 32561  		return _4_nVal
 32562  	}())
 32563  	_4_pKeyInfo = func() *XKeyInfo {
 32564  		if _isRowid != 0 {
 32565  			return nil
 32566  		}
 32567  		return _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.Xdb), _4_nVal, int32(1))
 32568  	}()
 32569  	if (_pExpr.Xflags & uint32(2048)) == (0) {
 32570  		goto _21
 32571  	}
 32572  	_5_pSelect = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 32573  	_5_pEList = (*XExprList)(_5_pSelect.XpEList)
 32574  	func() {
 32575  		if _isRowid != 0 {
 32576  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93476), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(44986)))
 32577  			crt.X__builtin_abort(tls)
 32578  		}
 32579  	}()
 32580  	if func() int32 {
 32581  		if _5_pEList.XnExpr == _4_nVal {
 32582  			return int32(1)
 32583  		}
 32584  		return func() int32 {
 32585  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93479), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(4809)))
 32586  			crt.X__builtin_abort(tls)
 32587  			return int32(0)
 32588  		}()
 32589  	}() == 0 {
 32590  		goto _26
 32591  	}
 32592  	_sqlite3SelectDestInit(tls, &_6_dest, int32(11), _pExpr.XiTable)
 32593  	_6_dest.XzAffSdst = _exprINAffinity(tls, _pParse, _pExpr)
 32594  	_5_pSelect.XiLimit = int32(0)
 32595  	if _sqlite3Select(tls, _pParse, _5_pSelect, &_6_dest) != 0 {
 32596  		_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_6_dest.XzAffSdst))
 32597  		_sqlite3KeyInfoUnref(tls, _4_pKeyInfo)
 32598  		return int32(0)
 32599  	}
 32600  	_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_6_dest.XzAffSdst))
 32601  	func() {
 32602  		if _4_pKeyInfo == nil {
 32603  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93493), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(44995)))
 32604  			crt.X__builtin_abort(tls)
 32605  		}
 32606  	}()
 32607  	func() {
 32608  		if _5_pEList == nil {
 32609  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93494), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45007)))
 32610  			crt.X__builtin_abort(tls)
 32611  		}
 32612  	}()
 32613  	func() {
 32614  		if _5_pEList.XnExpr <= int32(0) {
 32615  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93495), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45017)))
 32616  			crt.X__builtin_abort(tls)
 32617  		}
 32618  	}()
 32619  	func() {
 32620  		if _sqlite3KeyInfoIsWriteable(tls, _4_pKeyInfo) == 0 {
 32621  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93496), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45033)))
 32622  			crt.X__builtin_abort(tls)
 32623  		}
 32624  	}()
 32625  	_6_i = int32(0)
 32626  _36:
 32627  	if _6_i >= _4_nVal {
 32628  		goto _39
 32629  	}
 32630  	_8_p = _sqlite3VectorFieldSubexpr(tls, _4_pLeft, _6_i)
 32631  	*elem64((**XCollSeq)(unsafe.Pointer(&_4_pKeyInfo.XaColl)), uintptr(_6_i)) = _sqlite3BinaryCompareCollSeq(tls, _pParse, _8_p, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_5_pEList.Xa)), uintptr(_6_i)).XpExpr))
 32632  	_6_i += 1
 32633  	goto _36
 32634  _39:
 32635  _26:
 32636  	goto _43
 32637  _21:
 32638  	if func() int32 {
 32639  		if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) != nil {
 32640  			return int32(1)
 32641  		}
 32642  		return func() int32 {
 32643  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93504), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(4809)))
 32644  			crt.X__builtin_abort(tls)
 32645  			return int32(0)
 32646  		}()
 32647  	}() == 0 {
 32648  		goto _43
 32649  	}
 32650  	_9_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 32651  	_9_affinity = _sqlite3ExprAffinity(tls, _4_pLeft)
 32652  	if _9_affinity == 0 {
 32653  		_9_affinity = int8(65)
 32654  	}
 32655  	if _4_pKeyInfo != nil {
 32656  		func() {
 32657  			if _sqlite3KeyInfoIsWriteable(tls, _4_pKeyInfo) == 0 {
 32658  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93523), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45033)))
 32659  				crt.X__builtin_abort(tls)
 32660  			}
 32661  		}()
 32662  		*elem64((**XCollSeq)(unsafe.Pointer(&_4_pKeyInfo.XaColl)), 0) = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpLeft))
 32663  	}
 32664  	_9_r1 = _sqlite3GetTempReg(tls, _pParse)
 32665  	_9_r2 = _sqlite3GetTempReg(tls, _pParse)
 32666  	if _isRowid != 0 {
 32667  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _9_r2)
 32668  	}
 32669  	*func() **TExprList_item { _9_i = _9_pList.XnExpr; return &_9_pItem }() = (*TExprList_item)(unsafe.Pointer(&_9_pList.Xa))
 32670  _49:
 32671  	if _9_i <= int32(0) {
 32672  		goto _52
 32673  	}
 32674  	_12_pE2 = (*XExpr)(_9_pItem.XpExpr)
 32675  	if (_jmpIfDynamic >= int32(0)) && (_sqlite3ExprIsConstant(tls, _12_pE2) == 0) {
 32676  		_sqlite3VdbeChangeToNoop(tls, _v, _jmpIfDynamic)
 32677  		_jmpIfDynamic = int32(-1)
 32678  	}
 32679  	if _isRowid != 0 && _sqlite3ExprIsInteger(tls, _12_pE2, &_12_iValToIns) != 0 {
 32680  		_sqlite3VdbeAddOp3(tls, _v, int32(119), _pExpr.XiTable, _9_r2, _12_iValToIns)
 32681  		goto _57
 32682  	}
 32683  	_9_r3 = _sqlite3ExprCodeTarget(tls, _pParse, _12_pE2, _9_r1)
 32684  	if _isRowid != 0 {
 32685  		_sqlite3VdbeAddOp2(tls, _v, int32(17), _9_r3, _sqlite3VdbeCurrentAddr(tls, _v)+int32(2))
 32686  		_sqlite3VdbeAddOp3(tls, _v, int32(118), _pExpr.XiTable, _9_r2, _9_r3)
 32687  		goto _59
 32688  	}
 32689  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _9_r3, int32(1), _9_r2, &_9_affinity, int32(1))
 32690  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _9_r3, int32(1))
 32691  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _pExpr.XiTable, _9_r2, _9_r3, int32(1))
 32692  _59:
 32693  _57:
 32694  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _9_i -= 1; return &_9_pItem }())) += uintptr(32)
 32695  	goto _49
 32696  _52:
 32697  	_sqlite3ReleaseTempReg(tls, _pParse, _9_r1)
 32698  	_sqlite3ReleaseTempReg(tls, _pParse, _9_r2)
 32699  _43:
 32700  	if _4_pKeyInfo != nil {
 32701  		_sqlite3VdbeChangeP4(tls, _v, _4_addr, (*int8)(unsafe.Pointer(_4_pKeyInfo)), int32(-5))
 32702  	}
 32703  	goto _61
 32704  _11:
 32705  	func() {
 32706  		if int32(_pExpr.Xop) != int32(20) && int32(_pExpr.Xop) != int32(119) {
 32707  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93593), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45069)))
 32708  			crt.X__builtin_abort(tls)
 32709  		}
 32710  	}()
 32711  	func() {
 32712  		if (_pExpr.Xflags & uint32(2048)) == (0) {
 32713  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93594), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45114)))
 32714  			crt.X__builtin_abort(tls)
 32715  		}
 32716  	}()
 32717  	_19_pSel = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 32718  	_19_nReg = func() int32 {
 32719  		if int32(_pExpr.Xop) == int32(119) {
 32720  			return ((*XExprList)(_19_pSel.XpEList).XnExpr)
 32721  		}
 32722  		return int32(1)
 32723  	}()
 32724  	_sqlite3SelectDestInit(tls, &_19_dest, int32(0), _pParse.XnMem+int32(1))
 32725  	_pParse.XnMem += _19_nReg
 32726  	if int32(_pExpr.Xop) == int32(119) {
 32727  		_19_dest.XeDest = uint8(10)
 32728  		_19_dest.XiSdst = _19_dest.XiSDParm
 32729  		_19_dest.XnSdst = _19_nReg
 32730  		_sqlite3VdbeAddOp3(tls, _v, int32(59), int32(0), _19_dest.XiSDParm, (_19_dest.XiSDParm+_19_nReg)-int32(1))
 32731  		_sqlite3VdbeComment(tls, _v, str(45151))
 32732  		goto _70
 32733  	}
 32734  	_19_dest.XeDest = uint8(3)
 32735  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _19_dest.XiSDParm)
 32736  	_sqlite3VdbeComment(tls, _v, str(45172))
 32737  _70:
 32738  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(_19_pSel.XpLimit))
 32739  	*(**XExpr)(unsafe.Pointer(&_19_pSel.XpLimit)) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(134), elem58((*XToken)(unsafe.Pointer(&_sqlite3IntTokens)), uintptr(1)), int32(0))
 32740  	_19_pSel.XiLimit = int32(0)
 32741  	_19_pSel.XselFlags &= uint32(4294966271)
 32742  	if _sqlite3Select(tls, _pParse, _19_pSel, &_19_dest) != 0 {
 32743  		return int32(0)
 32744  	}
 32745  	_rReg = _19_dest.XiSDParm
 32746  	_pExpr.Xflags |= uint32(131072)
 32747  	goto _61
 32748  _61:
 32749  	if _rHasNullFlag != 0 {
 32750  		_sqlite3SetHasNullFlag(tls, _v, _pExpr.XiTable, _rHasNullFlag)
 32751  	}
 32752  	if _jmpIfDynamic >= int32(0) {
 32753  		_sqlite3VdbeJumpHere(tls, _v, _jmpIfDynamic)
 32754  	}
 32755  	_sqlite3ExprCachePop(tls, _pParse)
 32756  	return _rReg
 32757  }
 32758  
 32759  var _sqlite3CodeSubselectØ00__func__Ø000 [21]int8
 32760  
 32761  func init() {
 32762  	crt.Xstrncpy(nil, &_sqlite3CodeSubselectØ00__func__Ø000[0], str(45191), 21)
 32763  }
 32764  
 32765  // C comment
 32766  //  /*
 32767  //  ** Remember the current column cache context.  Any new entries added
 32768  //  ** added to the column cache after this call are removed when the
 32769  //  ** corresponding pop occurs.
 32770  //  */
 32771  func _sqlite3ExprCachePush(tls *crt.TLS, _pParse *XParse) {
 32772  	_pParse.XiCacheLevel += 1
 32773  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(4096)) != 0 {
 32774  		crt.Xprintf(tls, str(45212), _pParse.XiCacheLevel)
 32775  	}
 32776  }
 32777  
 32778  // C comment
 32779  //  /*
 32780  //  ** Initialize a SelectDest structure.
 32781  //  */
 32782  func _sqlite3SelectDestInit(tls *crt.TLS, _pDest *XSelectDest, _eDest int32, _iParm int32) {
 32783  	_pDest.XeDest = uint8(_eDest)
 32784  	_pDest.XiSDParm = _iParm
 32785  	_pDest.XzAffSdst = nil
 32786  	_pDest.XiSdst = int32(0)
 32787  	_pDest.XnSdst = int32(0)
 32788  }
 32789  
 32790  // C comment
 32791  //  /*
 32792  //  ** Argument pExpr is an (?, ?...) IN(...) expression. This
 32793  //  ** function allocates and returns a nul-terminated string containing
 32794  //  ** the affinities to be used for each column of the comparison.
 32795  //  **
 32796  //  ** It is the responsibility of the caller to ensure that the returned
 32797  //  ** string is eventually freed using sqlite3DbFree().
 32798  //  */
 32799  func _exprINAffinity(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 *int8) {
 32800  	var _nVal, _1_i int32
 32801  	var _2_a int8
 32802  	var _zRet *int8
 32803  	var _pSelect *XSelect
 32804  	var _pLeft, _2_pA *XExpr
 32805  	_pLeft = (*XExpr)(_pExpr.XpLeft)
 32806  	_nVal = _sqlite3ExprVectorSize(tls, _pLeft)
 32807  	_pSelect = func() *XSelect {
 32808  		if (_pExpr.Xflags & uint32(2048)) != 0 {
 32809  			return (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 32810  		}
 32811  		return nil
 32812  	}()
 32813  	func() {
 32814  		if int32(_pExpr.Xop) != int32(74) {
 32815  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93318), unsafe.Pointer(&_exprINAffinityØ00__func__Ø000), unsafe.Pointer(str(45224)))
 32816  			crt.X__builtin_abort(tls)
 32817  		}
 32818  	}()
 32819  	_zRet = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pParse.Xdb), uint64(_nVal+int32(1))))
 32820  	if _zRet == nil {
 32821  		goto _4
 32822  	}
 32823  	_1_i = int32(0)
 32824  _5:
 32825  	if _1_i >= _nVal {
 32826  		goto _8
 32827  	}
 32828  	_2_pA = _sqlite3VectorFieldSubexpr(tls, _pLeft, _1_i)
 32829  	_2_a = _sqlite3ExprAffinity(tls, _2_pA)
 32830  	if _pSelect != nil {
 32831  		*elem1(_zRet, uintptr(_1_i)) = _sqlite3CompareAffinity(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.XpEList).Xa))), uintptr(_1_i)).XpExpr), _2_a)
 32832  		goto _10
 32833  	}
 32834  	*elem1(_zRet, uintptr(_1_i)) = _2_a
 32835  _10:
 32836  	_1_i += 1
 32837  	goto _5
 32838  _8:
 32839  	*elem1(_zRet, uintptr(_nVal)) = 0
 32840  _4:
 32841  	return _zRet
 32842  }
 32843  
 32844  var _exprINAffinityØ00__func__Ø000 [15]int8
 32845  
 32846  func init() {
 32847  	crt.Xstrncpy(nil, &_exprINAffinityØ00__func__Ø000[0], str(45241), 15)
 32848  }
 32849  
 32850  // C comment
 32851  //  /*
 32852  //  ** Return a pointer to a subexpression of pVector that is the i-th
 32853  //  ** column of the vector (numbered starting with 0).  The caller must
 32854  //  ** ensure that i is within range.
 32855  //  **
 32856  //  ** If pVector is really a scalar (and "scalar" here includes subqueries
 32857  //  ** that return a single column!) then return pVector unmodified.
 32858  //  **
 32859  //  ** pVector retains ownership of the returned subexpression.
 32860  //  **
 32861  //  ** If the vector is a (SELECT ...) then the expression returned is
 32862  //  ** just the expression for the i-th term of the result set, and may
 32863  //  ** not be ready for evaluation because the table cursor has not yet
 32864  //  ** been positioned.
 32865  //  */
 32866  func _sqlite3VectorFieldSubexpr(tls *crt.TLS, _pVector *XExpr, _i int32) (r0 *XExpr) {
 32867  	func() {
 32868  		if _i >= _sqlite3ExprVectorSize(tls, _pVector) {
 32869  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91269), unsafe.Pointer(&_sqlite3VectorFieldSubexprØ00__func__Ø000), unsafe.Pointer(str(45256)))
 32870  			crt.X__builtin_abort(tls)
 32871  		}
 32872  	}()
 32873  	if _sqlite3ExprIsVector(tls, _pVector) == 0 {
 32874  		goto _2
 32875  	}
 32876  	func() {
 32877  		if int32(_pVector.Xop2) != int32(0) && int32(_pVector.Xop) != int32(157) {
 32878  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91271), unsafe.Pointer(&_sqlite3VectorFieldSubexprØ00__func__Ø000), unsafe.Pointer(str(45289)))
 32879  			crt.X__builtin_abort(tls)
 32880  		}
 32881  	}()
 32882  	if (int32(_pVector.Xop) == int32(119)) || (int32(_pVector.Xop2) == int32(119)) {
 32883  		return (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pVector.Xx))).XpEList).Xa))), uintptr(_i)).XpExpr)
 32884  	}
 32885  	return (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pVector.Xx))).Xa))), uintptr(_i)).XpExpr)
 32886  
 32887  _2:
 32888  	return _pVector
 32889  }
 32890  
 32891  var _sqlite3VectorFieldSubexprØ00__func__Ø000 [26]int8
 32892  
 32893  func init() {
 32894  	crt.Xstrncpy(nil, &_sqlite3VectorFieldSubexprØ00__func__Ø000[0], str(45333), 26)
 32895  }
 32896  
 32897  // C comment
 32898  //  /*
 32899  //  ** Return the 'affinity' of the expression pExpr if any.
 32900  //  **
 32901  //  ** If pExpr is a column, a reference to a column via an 'AS' alias,
 32902  //  ** or a sub-select with a column as the return value, then the
 32903  //  ** affinity of that column is returned. Otherwise, 0x00 is returned,
 32904  //  ** indicating no affinity for the expression.
 32905  //  **
 32906  //  ** i.e. the WHERE clause expressions in the following statements all
 32907  //  ** have an affinity:
 32908  //  **
 32909  //  ** CREATE TABLE t1(a);
 32910  //  ** SELECT * FROM t1 WHERE a;
 32911  //  ** SELECT a AS b FROM t1 WHERE b;
 32912  //  ** SELECT * FROM t1 WHERE (select a from t1);
 32913  //  */
 32914  func _sqlite3ExprAffinity(tls *crt.TLS, _pExpr *XExpr) (r0 int8) {
 32915  	var _op int32
 32916  	_pExpr = _sqlite3ExprSkipCollate(tls, _pExpr)
 32917  	if (_pExpr.Xflags & uint32(512)) != 0 {
 32918  		return 0
 32919  	}
 32920  	_op = int32(_pExpr.Xop)
 32921  	if _op == int32(119) {
 32922  		func() {
 32923  			if (_pExpr.Xflags & uint32(2048)) == 0 {
 32924  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90949), unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000), unsafe.Pointer(str(45359)))
 32925  				crt.X__builtin_abort(tls)
 32926  			}
 32927  		}()
 32928  		return _sqlite3ExprAffinity(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpEList).Xa))), 0).XpExpr))
 32929  	}
 32930  	if _op == int32(157) {
 32931  		_op = int32(_pExpr.Xop2)
 32932  	}
 32933  	if _op == int32(37) {
 32934  		func() {
 32935  			if (_pExpr.Xflags & uint32(1024)) != (0) {
 32936  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90955), unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000), unsafe.Pointer(str(42479)))
 32937  				crt.X__builtin_abort(tls)
 32938  			}
 32939  		}()
 32940  		return _sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), nil)
 32941  	}
 32942  	if ((_op == int32(154)) || (_op == int32(152))) && (_pExpr.XpTab != nil) {
 32943  		return _sqlite3TableColumnAffinity(tls, (*XTable)(_pExpr.XpTab), int32(_pExpr.XiColumn))
 32944  	}
 32945  	if _op == int32(159) {
 32946  		func() {
 32947  			if (((*XExpr)(_pExpr.XpLeft).Xflags) & uint32(2048)) == 0 {
 32948  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90963), unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000), unsafe.Pointer(str(45385)))
 32949  				crt.X__builtin_abort(tls)
 32950  			}
 32951  		}()
 32952  		return _sqlite3ExprAffinity(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(_pExpr.XpLeft).Xx)))).XpEList).Xa))), uintptr(_pExpr.XiColumn)).XpExpr))
 32953  	}
 32954  	return _pExpr.Xaffinity
 32955  }
 32956  
 32957  // C comment
 32958  //  /*
 32959  //  ** Skip over any TK_COLLATE operators and any unlikely()
 32960  //  ** or likelihood() function at the root of an expression.
 32961  //  */
 32962  func _sqlite3ExprSkipCollate(tls *crt.TLS, _pExpr *XExpr) (r0 *XExpr) {
 32963  _0:
 32964  	if _pExpr == nil || (_pExpr.Xflags&uint32(4096)) == (0) {
 32965  		goto _1
 32966  	}
 32967  	if (_pExpr.Xflags & uint32(262144)) != (0) {
 32968  		func() {
 32969  			if (_pExpr.Xflags & uint32(2048)) != (0) {
 32970  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91009), unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000), unsafe.Pointer(str(42733)))
 32971  				crt.X__builtin_abort(tls)
 32972  			}
 32973  		}()
 32974  		func() {
 32975  			if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XnExpr) <= int32(0) {
 32976  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91010), unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000), unsafe.Pointer(str(45418)))
 32977  				crt.X__builtin_abort(tls)
 32978  			}
 32979  		}()
 32980  		func() {
 32981  			if int32(_pExpr.Xop) != int32(151) {
 32982  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91011), unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000), unsafe.Pointer(str(45442)))
 32983  				crt.X__builtin_abort(tls)
 32984  			}
 32985  		}()
 32986  		_pExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr)
 32987  		goto _10
 32988  	}
 32989  	func() {
 32990  		if int32(_pExpr.Xop) != int32(94) {
 32991  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91014), unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000), unsafe.Pointer(str(45465)))
 32992  			crt.X__builtin_abort(tls)
 32993  		}
 32994  	}()
 32995  	_pExpr = (*XExpr)(_pExpr.XpLeft)
 32996  _10:
 32997  	goto _0
 32998  _1:
 32999  	return _pExpr
 33000  }
 33001  
 33002  var _sqlite3ExprSkipCollateØ00__func__Ø000 [23]int8
 33003  
 33004  func init() {
 33005  	crt.Xstrncpy(nil, &_sqlite3ExprSkipCollateØ00__func__Ø000[0], str(45487), 23)
 33006  }
 33007  
 33008  var _sqlite3ExprAffinityØ00__func__Ø000 [20]int8
 33009  
 33010  func init() {
 33011  	crt.Xstrncpy(nil, &_sqlite3ExprAffinityØ00__func__Ø000[0], str(45510), 20)
 33012  }
 33013  
 33014  // C comment
 33015  //  /*
 33016  //  ** Return the affinity character for a single column of a table.
 33017  //  */
 33018  func _sqlite3TableColumnAffinity(tls *crt.TLS, _pTab *XTable, _iCol int32) (r0 int8) {
 33019  	func() {
 33020  		if _iCol >= int32(_pTab.XnCol) {
 33021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90923), unsafe.Pointer(&_sqlite3TableColumnAffinityØ00__func__Ø000), unsafe.Pointer(str(45530)))
 33022  			crt.X__builtin_abort(tls)
 33023  		}
 33024  	}()
 33025  	return int8(func() int32 {
 33026  		if _iCol >= int32(0) {
 33027  			return int32(elem43((*XColumn)(_pTab.XaCol), uintptr(_iCol)).Xaffinity)
 33028  		}
 33029  		return int32(68)
 33030  	}())
 33031  }
 33032  
 33033  var _sqlite3TableColumnAffinityØ00__func__Ø000 [27]int8
 33034  
 33035  func init() {
 33036  	crt.Xstrncpy(nil, &_sqlite3TableColumnAffinityØ00__func__Ø000[0], str(45546), 27)
 33037  }
 33038  
 33039  // C comment
 33040  //  /*
 33041  //  ** pExpr is an operand of a comparison operator.  aff2 is the
 33042  //  ** type affinity of the other operand.  This routine returns the
 33043  //  ** type affinity that should be used for the comparison operator.
 33044  //  */
 33045  func _sqlite3CompareAffinity(tls *crt.TLS, _pExpr *XExpr, _aff2 int8) (r0 int8) {
 33046  	var _aff1 int8
 33047  	_aff1 = _sqlite3ExprAffinity(tls, _pExpr)
 33048  	if _aff1 == 0 || _aff2 == 0 {
 33049  		goto _1
 33050  	}
 33051  	if (int32(_aff1) >= int32(67)) || (int32(_aff2) >= int32(67)) {
 33052  		return int8(67)
 33053  	}
 33054  	return int8(65)
 33055  
 33056  _1:
 33057  	if (_aff1 == 0) && (_aff2 == 0) {
 33058  		return int8(65)
 33059  	}
 33060  	func() {
 33061  		if int32(_aff1) != int32(0) && int32(_aff2) != int32(0) {
 33062  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91112), unsafe.Pointer(&_sqlite3CompareAffinityØ00__func__Ø000), unsafe.Pointer(str(45573)))
 33063  			crt.X__builtin_abort(tls)
 33064  		}
 33065  	}()
 33066  	return int8(int32(_aff1) + int32(_aff2))
 33067  }
 33068  
 33069  var _sqlite3CompareAffinityØ00__func__Ø000 [23]int8
 33070  
 33071  func init() {
 33072  	crt.Xstrncpy(nil, &_sqlite3CompareAffinityØ00__func__Ø000[0], str(45592), 23)
 33073  }
 33074  
 33075  // C comment
 33076  //  /*
 33077  //  ** Generate code for the SELECT statement given in the p argument.
 33078  //  **
 33079  //  ** The results are returned according to the SelectDest structure.
 33080  //  ** See comments in sqliteInt.h for further information.
 33081  //  **
 33082  //  ** This routine returns the number of errors.  If any errors are
 33083  //  ** encountered, then an appropriate error message is left in
 33084  //  ** pParse->zErrMsg.
 33085  //  **
 33086  //  ** This routine does NOT free the Select structure passed in.  The
 33087  //  ** calling function needs to do that.
 33088  //  */
 33089  func _sqlite3Select(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
 33090  	var _i, _j, _isAgg, _rc, _iEnd, _iRestoreSelectId, _6_isAggSub, _18_addrTop, _19_topAddr, _19_onceAddr, _19_retAddr, _40_iAMem, _40_iBMem, _40_iUseFlag, _40_iAbortFlag, _40_groupBySort, _40_addrEnd, _40_sortPTab, _40_sortOut, _40_orderByGrp, _41_k, _49_addr1, _49_addrOutputRow, _49_regOutputRow, _49_addrSetAbort, _49_addrTopOfLoop, _49_addrSortingIdx, _49_addrReset, _49_regReset, _51_regBase, _51_regRecord, _51_nCol, _51_nGroupBy, _55_r1, _64_iDb, _64_iCsr, _64_iRoot int32
 33091  	var _34_wctrlFlags uint16
 33092  	var _69_flag uint8
 33093  	var _db *Xsqlite3
 33094  	var _6_pTab, _63_pTab *XTable
 33095  	var _v *TVdbe
 33096  	var _pTabList *XSrcList
 33097  	var _6_pItem, _12_pItem, _19_pPrior *TSrcList_item
 33098  	var _pEList, _pGroupBy, _63_pDel, _69_pMinMax *XExprList
 33099  	var _41_pItem *TExprList_item
 33100  	var _6_pSub, _12_pSub *XSelect
 33101  	var _pWhere, _pHaving *XExpr
 33102  	var _64_pIdx, _64_pBest *XIndex
 33103  	var _27_pKeyInfo, _49_pKeyInfo, _64_pKeyInfo *XKeyInfo
 33104  	var _40_sNC XNameContext
 33105  	var _12_dest XSelectDest
 33106  	var _sAggInfo XAggInfo
 33107  	var _54_pCol *TAggInfo_col
 33108  	var _pWInfo *XWhereInfo
 33109  	var _sSort XSortCtx
 33110  	var _sDistinct XDistinctCtx
 33111  	_pEList = nil
 33112  	_rc = int32(1)
 33113  	_iRestoreSelectId = _pParse.XiSelectId
 33114  	_pParse.XiSelectId = postInc2(&_pParse.XiNextSelectId, 1)
 33115  	_db = (*Xsqlite3)(_pParse.Xdb)
 33116  	if ((_p == nil) || (_db.XmallocFailed != 0)) || _pParse.XnErr != 0 {
 33117  		return int32(1)
 33118  	}
 33119  	if _sqlite3AuthCheck(tls, _pParse, int32(21), nil, nil, nil) != 0 {
 33120  		return int32(1)
 33121  	}
 33122  	crt.Xmemset(tls, unsafe.Pointer(&_sAggInfo), int32(0), uint64(64))
 33123  	_pParse.XnSelectIndent += 1
 33124  	if (Xsqlite3SelectTrace & int32(1)) != 0 {
 33125  		_sqlite3DebugPrintf(tls, func() *int8 {
 33126  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33127  			return str(45626)
 33128  		}())
 33129  	}
 33130  	if (Xsqlite3SelectTrace & int32(256)) != 0 {
 33131  		_sqlite3TreeViewSelect(tls, nil, _p, 0)
 33132  	}
 33133  	func() {
 33134  		if (*XExprList)(_p.XpOrderBy) != nil && int32(_pDest.XeDest) == int32(6) {
 33135  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121570), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(45645)))
 33136  			crt.X__builtin_abort(tls)
 33137  		}
 33138  	}()
 33139  	func() {
 33140  		if (*XExprList)(_p.XpOrderBy) != nil && int32(_pDest.XeDest) == int32(5) {
 33141  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121571), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(45690)))
 33142  			crt.X__builtin_abort(tls)
 33143  		}
 33144  	}()
 33145  	func() {
 33146  		if (*XExprList)(_p.XpOrderBy) != nil && int32(_pDest.XeDest) == int32(8) {
 33147  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121572), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(45731)))
 33148  			crt.X__builtin_abort(tls)
 33149  		}
 33150  	}()
 33151  	func() {
 33152  		if (*XExprList)(_p.XpOrderBy) != nil && int32(_pDest.XeDest) == int32(7) {
 33153  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121573), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(45777)))
 33154  			crt.X__builtin_abort(tls)
 33155  		}
 33156  	}()
 33157  	if int32(_pDest.XeDest) <= int32(8) {
 33158  		func() {
 33159  			if int32(_pDest.XeDest) != int32(3) && int32(_pDest.XeDest) != int32(1) && int32(_pDest.XeDest) != int32(2) && int32(_pDest.XeDest) != int32(4) && int32(_pDest.XeDest) != int32(7) && int32(_pDest.XeDest) != int32(6) && int32(_pDest.XeDest) != int32(8) && int32(_pDest.XeDest) != int32(5) {
 33160  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121575), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(45819)))
 33161  				crt.X__builtin_abort(tls)
 33162  			}
 33163  		}()
 33164  		_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XpOrderBy))
 33165  		*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = nil
 33166  		_p.XselFlags &= uint32(4294967294)
 33167  	}
 33168  	_sqlite3SelectPrep(tls, _pParse, _p, nil)
 33169  	crt.Xmemset(tls, unsafe.Pointer(&_sSort), int32(0), uint64(40))
 33170  	*(**XExprList)(unsafe.Pointer(&_sSort.XpOrderBy)) = (*XExprList)(_p.XpOrderBy)
 33171  	_pTabList = (*XSrcList)(_p.XpSrc)
 33172  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 33173  		goto _select_end
 33174  	}
 33175  	func() {
 33176  		if (*XExprList)(_p.XpEList) == nil {
 33177  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121592), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46042)))
 33178  			crt.X__builtin_abort(tls)
 33179  		}
 33180  	}()
 33181  	_isAgg = bool2int((_p.XselFlags & uint32(8)) != (0))
 33182  	if (Xsqlite3SelectTrace & int32(256)) == 0 {
 33183  		goto _32
 33184  	}
 33185  	if (Xsqlite3SelectTrace & int32(256)) != 0 {
 33186  		_sqlite3DebugPrintf(tls, func() *int8 {
 33187  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33188  			return str(46055)
 33189  		}())
 33190  	}
 33191  	_sqlite3TreeViewSelect(tls, nil, _p, 0)
 33192  _32:
 33193  	_i = int32(0)
 33194  _34:
 33195  	if _p.XpPrior != nil || _i >= _pTabList.XnSrc {
 33196  		goto _38
 33197  	}
 33198  	_6_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_i))
 33199  	_6_pSub = (*XSelect)(_6_pItem.XpSelect)
 33200  	_6_pTab = (*XTable)(_6_pItem.XpTab)
 33201  	if _6_pSub == nil {
 33202  		goto _35
 33203  	}
 33204  	if int32(_6_pTab.XnCol) != ((*XExprList)(_6_pSub.XpEList).XnExpr) {
 33205  		_sqlite3ErrorMsg(tls, _pParse, str(46079), int32(_6_pTab.XnCol), unsafe.Pointer(_6_pTab.XzName), (*XExprList)(_6_pSub.XpEList).XnExpr)
 33206  		goto _select_end
 33207  	}
 33208  	_6_isAggSub = bool2int((_6_pSub.XselFlags & uint32(8)) != (0))
 33209  	if _flattenSubquery(tls, _pParse, _p, _i, _isAgg, _6_isAggSub) == 0 {
 33210  		goto _41
 33211  	}
 33212  	if _6_isAggSub != 0 {
 33213  		_isAgg = int32(1)
 33214  		_p.XselFlags |= uint32(8)
 33215  	}
 33216  	_i = int32(-1)
 33217  _41:
 33218  	_pTabList = (*XSrcList)(_p.XpSrc)
 33219  	if _db.XmallocFailed != 0 {
 33220  		goto _select_end
 33221  	}
 33222  	if int32(_pDest.XeDest) > int32(8) {
 33223  		*(**XExprList)(unsafe.Pointer(&_sSort.XpOrderBy)) = (*XExprList)(_p.XpOrderBy)
 33224  	}
 33225  _35:
 33226  	_i += 1
 33227  	goto _34
 33228  _38:
 33229  	_v = _sqlite3GetVdbe(tls, _pParse)
 33230  	if _v == nil {
 33231  		goto _select_end
 33232  	}
 33233  	if _p.XpPrior == nil {
 33234  		goto _46
 33235  	}
 33236  	_rc = _multiSelect(tls, _pParse, _p, _pDest)
 33237  	_pParse.XiSelectId = _iRestoreSelectId
 33238  	if (Xsqlite3SelectTrace & int32(1)) != 0 {
 33239  		_sqlite3DebugPrintf(tls, func() *int8 {
 33240  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33241  			return str(46119)
 33242  		}())
 33243  	}
 33244  	_pParse.XnSelectIndent -= 1
 33245  	return _rc
 33246  
 33247  _46:
 33248  	_i = int32(0)
 33249  _48:
 33250  	if _i >= _pTabList.XnSrc {
 33251  		goto _51
 33252  	}
 33253  	_12_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_i))
 33254  	if _12_pItem.XcolUsed == (0) {
 33255  		_sqlite3AuthCheck(tls, _pParse, int32(20), _12_pItem.XzName, str(284), _12_pItem.XzDatabase)
 33256  	}
 33257  	_12_pSub = (*XSelect)(_12_pItem.XpSelect)
 33258  	if _12_pSub == nil {
 33259  		goto _49
 33260  	}
 33261  	if _12_pItem.XaddrFillSub == 0 {
 33262  		goto _54
 33263  	}
 33264  	if int32((uint32((_12_pItem.Xfg.XnotIndexed)>>4)<<31)>>31) == int32(0) {
 33265  		_sqlite3VdbeAddOp2(tls, _v, int32(14), _12_pItem.XregReturn, _12_pItem.XaddrFillSub)
 33266  	}
 33267  	goto _49
 33268  _54:
 33269  	_pParse.XnHeight += _sqlite3SelectExprHeight(tls, _p)
 33270  	if (int32(_12_pItem.Xfg.Xjointype)&int32(32)) != int32(0) || _pushDownWhereTerms(tls, _pParse, _12_pSub, (*XExpr)(_p.XpWhere), _12_pItem.XiCursor) == 0 {
 33271  		goto _57
 33272  	}
 33273  	if (Xsqlite3SelectTrace & int32(256)) == 0 {
 33274  		goto _58
 33275  	}
 33276  	if (Xsqlite3SelectTrace & int32(256)) != 0 {
 33277  		_sqlite3DebugPrintf(tls, func() *int8 {
 33278  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33279  			return str(46151)
 33280  		}())
 33281  	}
 33282  	_sqlite3TreeViewSelect(tls, nil, _p, 0)
 33283  _58:
 33284  _57:
 33285  	if (((_i == int32(0)) && ((_pTabList.XnSrc == int32(1)) || ((int32((elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(1)).Xfg).Xjointype) & int32(10)) != int32(0)))) && ((_p.XselFlags & uint32(2)) == (0))) && ((int32(_db.XdbOptFlags) & int32(256)) == int32(0)) {
 33286  		_18_addrTop = _sqlite3VdbeCurrentAddr(tls, _v) + int32(1)
 33287  		_12_pItem.XregReturn = preInc2(&_pParse.XnMem, 1)
 33288  		_sqlite3VdbeAddOp3(tls, _v, int32(15), _12_pItem.XregReturn, int32(0), _18_addrTop)
 33289  		_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer((*XTable)(_12_pItem.XpTab).XzName))
 33290  		_12_pItem.XaddrFillSub = _18_addrTop
 33291  		_sqlite3SelectDestInit(tls, &_12_dest, int32(13), _12_pItem.XregReturn)
 33292  		_12_pItem.XiSelectId = uint8(_pParse.XiNextSelectId)
 33293  		_sqlite3Select(tls, _pParse, _12_pSub, &_12_dest)
 33294  		(*XTable)(_12_pItem.XpTab).XnRowLogEst = _12_pSub.XnSelectRow
 33295  		storebits5(&(_12_pItem.Xfg.XnotIndexed), int8(1), 16, 4)
 33296  		_12_pItem.XregResult = _12_dest.XiSdst
 33297  		_sqlite3VdbeEndCoroutine(tls, _v, _12_pItem.XregReturn)
 33298  		_sqlite3VdbeJumpHere(tls, _v, _18_addrTop-int32(1))
 33299  		_sqlite3ClearTempRegCache(tls, _pParse)
 33300  		goto _65
 33301  	}
 33302  	_19_onceAddr = int32(0)
 33303  	func() {
 33304  		if _12_pItem.XaddrFillSub != int32(0) {
 33305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121778), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46182)))
 33306  			crt.X__builtin_abort(tls)
 33307  		}
 33308  	}()
 33309  	_12_pItem.XregReturn = preInc2(&_pParse.XnMem, 1)
 33310  	_19_topAddr = _sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _12_pItem.XregReturn)
 33311  	_12_pItem.XaddrFillSub = _19_topAddr + int32(1)
 33312  	if int32((uint32((_12_pItem.Xfg.XnotIndexed)>>3)<<31)>>31) == int32(0) {
 33313  		_19_onceAddr = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 33314  		_sqlite3VdbeComment(tls, _v, str(46204), unsafe.Pointer((*XTable)(_12_pItem.XpTab).XzName))
 33315  		goto _69
 33316  	}
 33317  	_sqlite3VdbeNoopComment(tls, _v, str(46204), unsafe.Pointer((*XTable)(_12_pItem.XpTab).XzName))
 33318  _69:
 33319  	_19_pPrior = _isSelfJoinView(tls, _pTabList, _12_pItem)
 33320  	if _19_pPrior != nil {
 33321  		_sqlite3VdbeAddOp2(tls, _v, int32(108), _12_pItem.XiCursor, _19_pPrior.XiCursor)
 33322  		goto _71
 33323  	}
 33324  	_sqlite3SelectDestInit(tls, &_12_dest, int32(12), _12_pItem.XiCursor)
 33325  	_12_pItem.XiSelectId = uint8(_pParse.XiNextSelectId)
 33326  	_sqlite3Select(tls, _pParse, _12_pSub, &_12_dest)
 33327  _71:
 33328  	(*XTable)(_12_pItem.XpTab).XnRowLogEst = _12_pSub.XnSelectRow
 33329  	if _19_onceAddr != 0 {
 33330  		_sqlite3VdbeJumpHere(tls, _v, _19_onceAddr)
 33331  	}
 33332  	_19_retAddr = _sqlite3VdbeAddOp1(tls, _v, int32(52), _12_pItem.XregReturn)
 33333  	_sqlite3VdbeComment(tls, _v, str(46221), unsafe.Pointer((*XTable)(_12_pItem.XpTab).XzName))
 33334  	_sqlite3VdbeChangeP1(tls, _v, uint32(_19_topAddr), _19_retAddr)
 33335  	_sqlite3ClearTempRegCache(tls, _pParse)
 33336  _65:
 33337  	if _db.XmallocFailed != 0 {
 33338  		goto _select_end
 33339  	}
 33340  	_pParse.XnHeight -= _sqlite3SelectExprHeight(tls, _p)
 33341  _49:
 33342  	_i += 1
 33343  	goto _48
 33344  _51:
 33345  	_pEList = (*XExprList)(_p.XpEList)
 33346  	_pWhere = (*XExpr)(_p.XpWhere)
 33347  	_pGroupBy = (*XExprList)(_p.XpGroupBy)
 33348  	_pHaving = (*XExpr)(_p.XpHaving)
 33349  	_sDistinct.XisTnct = uint8(bool2int((_p.XselFlags & uint32(1)) != (0)))
 33350  	if (Xsqlite3SelectTrace & int32(1024)) == 0 {
 33351  		goto _74
 33352  	}
 33353  	if (Xsqlite3SelectTrace & int32(1024)) != 0 {
 33354  		_sqlite3DebugPrintf(tls, func() *int8 {
 33355  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33356  			return str(46228)
 33357  		}())
 33358  	}
 33359  	_sqlite3TreeViewSelect(tls, nil, _p, 0)
 33360  _74:
 33361  	if (_p.XselFlags&uint32(9)) != uint32(1) || _sqlite3ExprListCompare(tls, (*XExprList)(_sSort.XpOrderBy), _pEList, int32(-1)) != int32(0) {
 33362  		goto _77
 33363  	}
 33364  	_p.XselFlags &= uint32(4294967294)
 33365  	_pGroupBy = store72((**XExprList)(unsafe.Pointer(&_p.XpGroupBy)), _sqlite3ExprListDup(tls, _db, _pEList, int32(0)))
 33366  	func() {
 33367  		if _sDistinct.XisTnct == 0 {
 33368  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121849), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46261)))
 33369  			crt.X__builtin_abort(tls)
 33370  		}
 33371  	}()
 33372  	if (Xsqlite3SelectTrace & int32(1024)) == 0 {
 33373  		goto _80
 33374  	}
 33375  	if (Xsqlite3SelectTrace & int32(1024)) != 0 {
 33376  		_sqlite3DebugPrintf(tls, func() *int8 {
 33377  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33378  			return str(46278)
 33379  		}())
 33380  	}
 33381  	_sqlite3TreeViewSelect(tls, nil, _p, 0)
 33382  _80:
 33383  _77:
 33384  	if _sSort.XpOrderBy != nil {
 33385  		_27_pKeyInfo = _keyInfoFromExprList(tls, _pParse, (*XExprList)(_sSort.XpOrderBy), int32(0), _pEList.XnExpr)
 33386  		_sSort.XiECursor = postInc2(&_pParse.XnTab, 1)
 33387  		_sSort.XaddrSortIndex = _sqlite3VdbeAddOp4(tls, _v, int32(110), _sSort.XiECursor, (((*XExprList)(_sSort.XpOrderBy).XnExpr)+int32(1))+_pEList.XnExpr, int32(0), (*int8)(unsafe.Pointer(_27_pKeyInfo)), int32(-5))
 33388  		goto _83
 33389  	}
 33390  	_sSort.XaddrSortIndex = int32(-1)
 33391  _83:
 33392  	if int32(_pDest.XeDest) == int32(12) {
 33393  		_sqlite3VdbeAddOp2(tls, _v, int32(110), _pDest.XiSDParm, _pEList.XnExpr)
 33394  	}
 33395  	_iEnd = _sqlite3VdbeMakeLabel(tls, _v)
 33396  	if (_p.XselFlags & uint32(16384)) == (0) {
 33397  		_p.XnSelectRow = int16(320)
 33398  	}
 33399  	_computeLimitRegisters(tls, _pParse, _p, _iEnd)
 33400  	if (_p.XiLimit == int32(0)) && (_sSort.XaddrSortIndex >= int32(0)) {
 33401  		_sqlite3VdbeChangeOpcode(tls, _v, uint32(_sSort.XaddrSortIndex), uint8(111))
 33402  		{
 33403  			p := &_sSort.XsortFlags
 33404  			*p = uint8(int32(*p) | int32(1))
 33405  		}
 33406  	}
 33407  	if (_p.XselFlags & uint32(1)) != 0 {
 33408  		_sDistinct.XtabTnct = postInc2(&_pParse.XnTab, 1)
 33409  		_sDistinct.XaddrTnct = _sqlite3VdbeAddOp4(tls, _v, int32(110), _sDistinct.XtabTnct, int32(0), int32(0), (*int8)(unsafe.Pointer(_keyInfoFromExprList(tls, _pParse, (*XExprList)(_p.XpEList), int32(0), int32(0)))), int32(-5))
 33410  		_sqlite3VdbeChangeP5(tls, _v, uint16(8))
 33411  		_sDistinct.XeTnctType = uint8(3)
 33412  		goto _89
 33413  	}
 33414  	_sDistinct.XeTnctType = 0
 33415  _89:
 33416  	if _isAgg != 0 || _pGroupBy != nil {
 33417  		goto _91
 33418  	}
 33419  	_34_wctrlFlags = uint16(func() int32 {
 33420  		if _sDistinct.XisTnct != 0 {
 33421  			return int32(256)
 33422  		}
 33423  		return int32(0)
 33424  	}())
 33425  
 33426  	{
 33427  		p := &_34_wctrlFlags
 33428  		*p = uint16(uint32(*p) | (_p.XselFlags & uint32(16384)))
 33429  	}
 33430  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, (*XExprList)(_sSort.XpOrderBy), (*XExprList)(_p.XpEList), _34_wctrlFlags, int32(_p.XnSelectRow))
 33431  	if _pWInfo == nil {
 33432  		goto _select_end
 33433  	}
 33434  	if int32(_sqlite3WhereOutputRowCount(tls, _pWInfo)) < int32(_p.XnSelectRow) {
 33435  		_p.XnSelectRow = _sqlite3WhereOutputRowCount(tls, _pWInfo)
 33436  	}
 33437  	if (_sDistinct.XisTnct != 0) && _sqlite3WhereIsDistinct(tls, _pWInfo) != 0 {
 33438  		_sDistinct.XeTnctType = uint8(_sqlite3WhereIsDistinct(tls, _pWInfo))
 33439  	}
 33440  	if _sSort.XpOrderBy == nil {
 33441  		goto _98
 33442  	}
 33443  	_sSort.XnOBSat = _sqlite3WhereIsOrdered(tls, _pWInfo)
 33444  	_sSort.XbOrderedInnerLoop = uint8(_sqlite3WhereOrderedInnerLoop(tls, _pWInfo))
 33445  	if _sSort.XnOBSat == ((*XExprList)(_sSort.XpOrderBy).XnExpr) {
 33446  		*(**XExprList)(unsafe.Pointer(&_sSort.XpOrderBy)) = nil
 33447  	}
 33448  _98:
 33449  	if (_sSort.XaddrSortIndex >= int32(0)) && ((*XExprList)(_sSort.XpOrderBy) == nil) {
 33450  		_sqlite3VdbeChangeToNoop(tls, _v, _sSort.XaddrSortIndex)
 33451  	}
 33452  	_selectInnerLoop(tls, _pParse, _p, _pEList, int32(-1), &_sSort, &_sDistinct, _pDest, _sqlite3WhereContinueLabel(tls, _pWInfo), _sqlite3WhereBreakLabel(tls, _pWInfo))
 33453  	_sqlite3WhereEnd(tls, _pWInfo)
 33454  	goto _102
 33455  _91:
 33456  	_40_sortPTab = int32(0)
 33457  	_40_sortOut = int32(0)
 33458  	_40_orderByGrp = int32(0)
 33459  	if _pGroupBy == nil {
 33460  		goto _103
 33461  	}
 33462  	*func() **TExprList_item { _41_k = (*XExprList)(_p.XpEList).XnExpr; return &_41_pItem }() = (*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpEList).Xa)))
 33463  _104:
 33464  	if _41_k <= int32(0) {
 33465  		goto _107
 33466  	}
 33467  	(*t73)(unsafe.Pointer(&_41_pItem.Xu)).XiAlias = 0
 33468  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _41_k -= 1; return &_41_pItem }())) += uintptr(32)
 33469  	goto _104
 33470  _107:
 33471  	*func() **TExprList_item { _41_k = _pGroupBy.XnExpr; return &_41_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pGroupBy.Xa))
 33472  _108:
 33473  	if _41_k <= int32(0) {
 33474  		goto _111
 33475  	}
 33476  	(*t73)(unsafe.Pointer(&_41_pItem.Xu)).XiAlias = 0
 33477  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _41_k -= 1; return &_41_pItem }())) += uintptr(32)
 33478  	goto _108
 33479  _111:
 33480  	func() {
 33481  		if int32(66) != int32(_sqlite3LogEst(tls, uint64(100))) {
 33482  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121981), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46313)))
 33483  			crt.X__builtin_abort(tls)
 33484  		}
 33485  	}()
 33486  	if int32(_p.XnSelectRow) > int32(66) {
 33487  		_p.XnSelectRow = int16(66)
 33488  	}
 33489  	goto _115
 33490  _103:
 33491  	func() {
 33492  		if int32(0) != int32(_sqlite3LogEst(tls, uint64(1))) {
 33493  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121984), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46336)))
 33494  			crt.X__builtin_abort(tls)
 33495  		}
 33496  	}()
 33497  	_p.XnSelectRow = 0
 33498  _115:
 33499  	if _sqlite3ExprListCompare(tls, _pGroupBy, (*XExprList)(_sSort.XpOrderBy), int32(-1)) == int32(0) {
 33500  		_40_orderByGrp = int32(1)
 33501  	}
 33502  	_40_addrEnd = _sqlite3VdbeMakeLabel(tls, _v)
 33503  	crt.Xmemset(tls, unsafe.Pointer(&_40_sNC), int32(0), uint64(56))
 33504  	*(**XParse)(unsafe.Pointer(&_40_sNC.XpParse)) = _pParse
 33505  	*(**XSrcList)(unsafe.Pointer(&_40_sNC.XpSrcList)) = _pTabList
 33506  	*(**XAggInfo)(unsafe.Pointer(&_40_sNC.XpAggInfo)) = &_sAggInfo
 33507  	_sAggInfo.XmnReg = _pParse.XnMem + int32(1)
 33508  	_sAggInfo.XnSortingColumn = func() int32 {
 33509  		if _pGroupBy != nil {
 33510  			return _pGroupBy.XnExpr
 33511  		}
 33512  		return int32(0)
 33513  	}()
 33514  	*(**XExprList)(unsafe.Pointer(&_sAggInfo.XpGroupBy)) = _pGroupBy
 33515  	_sqlite3ExprAnalyzeAggList(tls, &_40_sNC, _pEList)
 33516  	_sqlite3ExprAnalyzeAggList(tls, &_40_sNC, (*XExprList)(_sSort.XpOrderBy))
 33517  	if _pHaving == nil {
 33518  		goto _121
 33519  	}
 33520  	if _pGroupBy != nil {
 33521  		func() {
 33522  			if _pWhere != (*XExpr)(_p.XpWhere) {
 33523  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122018), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46356)))
 33524  				crt.X__builtin_abort(tls)
 33525  			}
 33526  		}()
 33527  		_havingToWhere(tls, _pParse, _pGroupBy, _pHaving, (**XExpr)(unsafe.Pointer(&_p.XpWhere)))
 33528  		_pWhere = (*XExpr)(_p.XpWhere)
 33529  	}
 33530  	_sqlite3ExprAnalyzeAggregates(tls, &_40_sNC, _pHaving)
 33531  _121:
 33532  	_sAggInfo.XnAccumulator = _sAggInfo.XnColumn
 33533  	_i = int32(0)
 33534  _125:
 33535  	if _i >= _sAggInfo.XnFunc {
 33536  		goto _128
 33537  	}
 33538  	func() {
 33539  		if (((*XExpr)(elem69((*TAggInfo_func)(_sAggInfo.XaFunc), uintptr(_i)).XpExpr).Xflags) & uint32(2048)) != (0) {
 33540  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122026), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46374)))
 33541  			crt.X__builtin_abort(tls)
 33542  		}
 33543  	}()
 33544  	{
 33545  		p := &_40_sNC.XncFlags
 33546  		*p = uint16(int32(*p) | int32(8))
 33547  	}
 33548  	_sqlite3ExprAnalyzeAggList(tls, &_40_sNC, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(elem69((*TAggInfo_func)(_sAggInfo.XaFunc), uintptr(_i)).XpExpr).Xx)))))
 33549  	{
 33550  		p := &_40_sNC.XncFlags
 33551  		*p = uint16(int32(*p) & int32(-9))
 33552  	}
 33553  	_i += 1
 33554  	goto _125
 33555  _128:
 33556  	_sAggInfo.XmxReg = _pParse.XnMem
 33557  	if _db.XmallocFailed != 0 {
 33558  		goto _select_end
 33559  	}
 33560  	if _pGroupBy == nil {
 33561  		goto _132
 33562  	}
 33563  	_sAggInfo.XsortingIdx = postInc2(&_pParse.XnTab, 1)
 33564  	_49_pKeyInfo = _keyInfoFromExprList(tls, _pParse, _pGroupBy, int32(0), _sAggInfo.XnColumn)
 33565  	_49_addrSortingIdx = _sqlite3VdbeAddOp4(tls, _v, int32(111), _sAggInfo.XsortingIdx, _sAggInfo.XnSortingColumn, int32(0), (*int8)(unsafe.Pointer(_49_pKeyInfo)), int32(-5))
 33566  	_40_iUseFlag = preInc2(&_pParse.XnMem, 1)
 33567  	_40_iAbortFlag = preInc2(&_pParse.XnMem, 1)
 33568  	_49_regOutputRow = preInc2(&_pParse.XnMem, 1)
 33569  	_49_addrOutputRow = _sqlite3VdbeMakeLabel(tls, _v)
 33570  	_49_regReset = preInc2(&_pParse.XnMem, 1)
 33571  	_49_addrReset = _sqlite3VdbeMakeLabel(tls, _v)
 33572  	_40_iAMem = _pParse.XnMem + int32(1)
 33573  	_pParse.XnMem += _pGroupBy.XnExpr
 33574  	_40_iBMem = _pParse.XnMem + int32(1)
 33575  	_pParse.XnMem += _pGroupBy.XnExpr
 33576  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _40_iAbortFlag)
 33577  	_sqlite3VdbeComment(tls, _v, str(46430))
 33578  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _40_iUseFlag)
 33579  	_sqlite3VdbeComment(tls, _v, str(46447))
 33580  	_sqlite3VdbeAddOp3(tls, _v, int32(59), int32(0), _40_iAMem, (_40_iAMem+_pGroupBy.XnExpr)-int32(1))
 33581  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _49_regReset, _49_addrReset)
 33582  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, _pGroupBy, nil, uint16(int32(64)|func() int32 {
 33583  		if _40_orderByGrp != 0 {
 33584  			return int32(512)
 33585  		}
 33586  		return int32(0)
 33587  	}()), int32(0))
 33588  	if _pWInfo == nil {
 33589  		goto _select_end
 33590  	}
 33591  	if _sqlite3WhereIsOrdered(tls, _pWInfo) == _pGroupBy.XnExpr {
 33592  		_40_groupBySort = int32(0)
 33593  		goto _137
 33594  	}
 33595  	_explainTempTable(tls, _pParse, func() *int8 {
 33596  		if (_sDistinct.XisTnct != 0) && ((_p.XselFlags & uint32(1)) == (0)) {
 33597  			return str(25671)
 33598  		}
 33599  		return str(46474)
 33600  	}())
 33601  	_40_groupBySort = int32(1)
 33602  	_51_nGroupBy = _pGroupBy.XnExpr
 33603  	_51_nCol = _51_nGroupBy
 33604  	_j = _51_nGroupBy
 33605  	_i = int32(0)
 33606  _141:
 33607  	if _i >= _sAggInfo.XnColumn {
 33608  		goto _144
 33609  	}
 33610  	if (elem68((*TAggInfo_col)(_sAggInfo.XaCol), uintptr(_i)).XiSorterColumn) >= _j {
 33611  		_51_nCol += 1
 33612  		_j += 1
 33613  	}
 33614  	_i += 1
 33615  	goto _141
 33616  _144:
 33617  	_51_regBase = _sqlite3GetTempRange(tls, _pParse, _51_nCol)
 33618  	_sqlite3ExprCacheClear(tls, _pParse)
 33619  	_sqlite3ExprCodeExprList(tls, _pParse, _pGroupBy, _51_regBase, int32(0), 0)
 33620  	_j = _51_nGroupBy
 33621  	_i = int32(0)
 33622  _146:
 33623  	if _i >= _sAggInfo.XnColumn {
 33624  		goto _149
 33625  	}
 33626  	_54_pCol = elem68((*TAggInfo_col)(_sAggInfo.XaCol), uintptr(_i))
 33627  	if _54_pCol.XiSorterColumn >= _j {
 33628  		_55_r1 = _j + _51_regBase
 33629  		_sqlite3ExprCodeGetColumnToReg(tls, _pParse, (*XTable)(_54_pCol.XpTab), _54_pCol.XiColumn, _54_pCol.XiTable, _55_r1)
 33630  		_j += 1
 33631  	}
 33632  	_i += 1
 33633  	goto _146
 33634  _149:
 33635  	_51_regRecord = _sqlite3GetTempReg(tls, _pParse)
 33636  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _51_regBase, _51_nCol, _51_regRecord)
 33637  	_sqlite3VdbeAddOp2(tls, _v, int32(127), _sAggInfo.XsortingIdx, _51_regRecord)
 33638  	_sqlite3ReleaseTempReg(tls, _pParse, _51_regRecord)
 33639  	_sqlite3ReleaseTempRange(tls, _pParse, _51_regBase, _51_nCol)
 33640  	_sqlite3WhereEnd(tls, _pWInfo)
 33641  	_sAggInfo.XsortingIdxPTab = store2(&_40_sortPTab, postInc2(&_pParse.XnTab, 1))
 33642  	_40_sortOut = _sqlite3GetTempReg(tls, _pParse)
 33643  	_sqlite3VdbeAddOp3(tls, _v, int32(113), _40_sortPTab, _40_sortOut, _51_nCol)
 33644  	_sqlite3VdbeAddOp2(tls, _v, int32(35), _sAggInfo.XsortingIdx, _40_addrEnd)
 33645  	_sqlite3VdbeComment(tls, _v, str(46483))
 33646  	_sAggInfo.XuseSortingIdx = uint8(1)
 33647  	_sqlite3ExprCacheClear(tls, _pParse)
 33648  _137:
 33649  	if (_40_orderByGrp != 0 && ((int32(_db.XdbOptFlags) & int32(4)) == int32(0))) && (_40_groupBySort != 0 || _sqlite3WhereIsSorted(tls, _pWInfo) != 0) {
 33650  		*(**XExprList)(unsafe.Pointer(&_sSort.XpOrderBy)) = nil
 33651  		_sqlite3VdbeChangeToNoop(tls, _v, _sSort.XaddrSortIndex)
 33652  	}
 33653  	_49_addrTopOfLoop = _sqlite3VdbeCurrentAddr(tls, _v)
 33654  	_sqlite3ExprCacheClear(tls, _pParse)
 33655  	if _40_groupBySort != 0 {
 33656  		_sqlite3VdbeAddOp3(tls, _v, int32(123), _sAggInfo.XsortingIdx, _40_sortOut, _40_sortPTab)
 33657  	}
 33658  	_j = int32(0)
 33659  _156:
 33660  	if _j >= _pGroupBy.XnExpr {
 33661  		goto _159
 33662  	}
 33663  	if _40_groupBySort != 0 {
 33664  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _40_sortPTab, _j, _40_iBMem+_j)
 33665  		goto _161
 33666  	}
 33667  	_sAggInfo.XdirectMode = uint8(1)
 33668  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pGroupBy.Xa)), uintptr(_j)).XpExpr), _40_iBMem+_j)
 33669  _161:
 33670  	_j += 1
 33671  	goto _156
 33672  _159:
 33673  	_sqlite3VdbeAddOp4(tls, _v, int32(98), _40_iAMem, _40_iBMem, _pGroupBy.XnExpr, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _49_pKeyInfo))), int32(-5))
 33674  	_49_addr1 = _sqlite3VdbeCurrentAddr(tls, _v)
 33675  	_sqlite3VdbeAddOp3(tls, _v, int32(18), _49_addr1+int32(1), int32(0), _49_addr1+int32(1))
 33676  	_sqlite3ExprCodeMove(tls, _pParse, _40_iBMem, _40_iAMem, _pGroupBy.XnExpr)
 33677  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _49_regOutputRow, _49_addrOutputRow)
 33678  	_sqlite3VdbeComment(tls, _v, str(46497))
 33679  	_sqlite3VdbeAddOp2(tls, _v, int32(46), _40_iAbortFlag, _40_addrEnd)
 33680  	_sqlite3VdbeComment(tls, _v, str(46512))
 33681  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _49_regReset, _49_addrReset)
 33682  	_sqlite3VdbeComment(tls, _v, str(46529))
 33683  	_sqlite3VdbeJumpHere(tls, _v, _49_addr1)
 33684  	_updateAccumulator(tls, _pParse, &_sAggInfo)
 33685  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _40_iUseFlag)
 33686  	_sqlite3VdbeComment(tls, _v, str(46547))
 33687  	if _40_groupBySort != 0 {
 33688  		_sqlite3VdbeAddOp2(tls, _v, int32(3), _sAggInfo.XsortingIdx, _49_addrTopOfLoop)
 33689  		goto _163
 33690  	}
 33691  	_sqlite3WhereEnd(tls, _pWInfo)
 33692  	_sqlite3VdbeChangeToNoop(tls, _v, _49_addrSortingIdx)
 33693  _163:
 33694  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _49_regOutputRow, _49_addrOutputRow)
 33695  	_sqlite3VdbeComment(tls, _v, str(46576))
 33696  	_sqlite3VdbeGoto(tls, _v, _40_addrEnd)
 33697  	_49_addrSetAbort = _sqlite3VdbeCurrentAddr(tls, _v)
 33698  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _40_iAbortFlag)
 33699  	_sqlite3VdbeComment(tls, _v, str(46593))
 33700  	_sqlite3VdbeAddOp1(tls, _v, int32(52), _49_regOutputRow)
 33701  	_sqlite3VdbeResolveLabel(tls, _v, _49_addrOutputRow)
 33702  	_49_addrOutputRow = _sqlite3VdbeCurrentAddr(tls, _v)
 33703  	_sqlite3VdbeAddOp2(tls, _v, int32(46), _40_iUseFlag, _49_addrOutputRow+int32(2))
 33704  	_sqlite3VdbeComment(tls, _v, str(46608))
 33705  	_sqlite3VdbeAddOp1(tls, _v, int32(52), _49_regOutputRow)
 33706  	_finalizeAggFunctions(tls, _pParse, &_sAggInfo)
 33707  	_sqlite3ExprIfFalse(tls, _pParse, _pHaving, _49_addrOutputRow+int32(1), int32(16))
 33708  	_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.XpEList), int32(-1), &_sSort, &_sDistinct, _pDest, _49_addrOutputRow+int32(1), _49_addrSetAbort)
 33709  	_sqlite3VdbeAddOp1(tls, _v, int32(52), _49_regOutputRow)
 33710  	_sqlite3VdbeComment(tls, _v, str(46645))
 33711  	_sqlite3VdbeResolveLabel(tls, _v, _49_addrReset)
 33712  	_resetAccumulator(tls, _pParse, &_sAggInfo)
 33713  	_sqlite3VdbeAddOp1(tls, _v, int32(52), _49_regReset)
 33714  	goto _164
 33715  _132:
 33716  	_63_pDel = nil
 33717  	if store74(&_63_pTab, _isSimpleCount(tls, _p, &_sAggInfo)) == nil {
 33718  		goto _165
 33719  	}
 33720  	_64_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_63_pTab.XpSchema))
 33721  	_64_iCsr = postInc2(&_pParse.XnTab, 1)
 33722  	_64_pKeyInfo = nil
 33723  	_64_pBest = nil
 33724  	_64_iRoot = _63_pTab.Xtnum
 33725  	_sqlite3CodeVerifySchema(tls, _pParse, _64_iDb)
 33726  	_sqlite3TableLock(tls, _pParse, _64_iDb, _63_pTab.Xtnum, 0, _63_pTab.XzName)
 33727  	if (_63_pTab.XtabFlags & uint32(32)) != (0) {
 33728  		_64_pBest = _sqlite3PrimaryKeyIndex(tls, _63_pTab)
 33729  	}
 33730  	_64_pIdx = (*XIndex)(_63_pTab.XpIndex)
 33731  _167:
 33732  	if _64_pIdx == nil {
 33733  		goto _170
 33734  	}
 33735  	if (((int32((uint32(_64_pIdx.XidxType>>2)<<31)>>31) == int32(0)) && (int32(_64_pIdx.XszIdxRow) < int32(_63_pTab.XszTabRow))) && ((*XExpr)(_64_pIdx.XpPartIdxWhere) == nil)) && ((_64_pBest == nil) || (int32(_64_pIdx.XszIdxRow) < int32(_64_pBest.XszIdxRow))) {
 33736  		_64_pBest = _64_pIdx
 33737  	}
 33738  	_64_pIdx = (*XIndex)(_64_pIdx.XpNext)
 33739  	goto _167
 33740  _170:
 33741  	if _64_pBest != nil {
 33742  		_64_iRoot = _64_pBest.Xtnum
 33743  		_64_pKeyInfo = _sqlite3KeyInfoOfIndex(tls, _pParse, _64_pBest)
 33744  	}
 33745  	_sqlite3VdbeAddOp4Int(tls, _v, int32(106), _64_iCsr, _64_iRoot, _64_iDb, int32(1))
 33746  	if _64_pKeyInfo != nil {
 33747  		_sqlite3VdbeChangeP4(tls, _v, int32(-1), (*int8)(unsafe.Pointer(_64_pKeyInfo)), int32(-5))
 33748  	}
 33749  	_sqlite3VdbeAddOp2(tls, _v, int32(102), _64_iCsr, elem69((*TAggInfo_func)(_sAggInfo.XaFunc), 0).XiMem)
 33750  	_sqlite3VdbeAddOp1(tls, _v, int32(114), _64_iCsr)
 33751  	_explainSimpleCount(tls, _pParse, _63_pTab, _64_pBest)
 33752  	goto _178
 33753  _165:
 33754  	_69_pMinMax = nil
 33755  	_69_flag = uint8(0)
 33756  	func() {
 33757  		if (*XExprList)(_p.XpGroupBy) != nil {
 33758  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122352), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46674)))
 33759  			crt.X__builtin_abort(tls)
 33760  		}
 33761  	}()
 33762  	func() {
 33763  		if int32(_69_flag) != int32(0) {
 33764  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122353), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46689)))
 33765  			crt.X__builtin_abort(tls)
 33766  		}
 33767  	}()
 33768  	if (*XExpr)(_p.XpHaving) == nil {
 33769  		_69_flag = _minMaxQuery(tls, &_sAggInfo, &_69_pMinMax)
 33770  	}
 33771  	func() {
 33772  		if int32(_69_flag) != int32(0) && (_69_pMinMax == nil || _69_pMinMax.XnExpr != int32(1)) {
 33773  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122357), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46697)))
 33774  			crt.X__builtin_abort(tls)
 33775  		}
 33776  	}()
 33777  	if _69_flag == 0 {
 33778  		goto _188
 33779  	}
 33780  	_69_pMinMax = _sqlite3ExprListDup(tls, _db, _69_pMinMax, int32(0))
 33781  	_63_pDel = _69_pMinMax
 33782  	func() {
 33783  		if _db.XmallocFailed == 0 && _69_pMinMax == nil {
 33784  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122362), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46742)))
 33785  			crt.X__builtin_abort(tls)
 33786  		}
 33787  	}()
 33788  	if _db.XmallocFailed == 0 {
 33789  		elem59((*TExprList_item)(unsafe.Pointer(&_69_pMinMax.Xa)), 0).XsortOrder = uint8(func() int32 {
 33790  			if int32(_69_flag) != int32(1) {
 33791  				return int32(1)
 33792  			}
 33793  			return int32(0)
 33794  		}())
 33795  		(*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_69_pMinMax.Xa)), 0).XpExpr).Xop = uint8(152)
 33796  	}
 33797  _188:
 33798  	_resetAccumulator(tls, _pParse, &_sAggInfo)
 33799  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, _69_pMinMax, nil, uint16(_69_flag), int32(0))
 33800  	if _pWInfo == nil {
 33801  		_sqlite3ExprListDelete(tls, _db, _63_pDel)
 33802  		goto _select_end
 33803  	}
 33804  	_updateAccumulator(tls, _pParse, &_sAggInfo)
 33805  	func() {
 33806  		if _69_pMinMax != nil && _69_pMinMax.XnExpr != int32(1) {
 33807  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122380), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46773)))
 33808  			crt.X__builtin_abort(tls)
 33809  		}
 33810  	}()
 33811  	if _sqlite3WhereIsOrdered(tls, _pWInfo) > int32(0) {
 33812  		_sqlite3VdbeGoto(tls, _v, _sqlite3WhereBreakLabel(tls, _pWInfo))
 33813  		_sqlite3VdbeComment(tls, _v, str(46805), unsafe.Pointer(func() *int8 {
 33814  			if int32(_69_flag) == int32(1) {
 33815  				return str(7610)
 33816  			}
 33817  			return str(7614)
 33818  		}()))
 33819  	}
 33820  	_sqlite3WhereEnd(tls, _pWInfo)
 33821  	_finalizeAggFunctions(tls, _pParse, &_sAggInfo)
 33822  _178:
 33823  	*(**XExprList)(unsafe.Pointer(&_sSort.XpOrderBy)) = nil
 33824  	_sqlite3ExprIfFalse(tls, _pParse, _pHaving, _40_addrEnd, int32(16))
 33825  	_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.XpEList), int32(-1), nil, nil, _pDest, _40_addrEnd, _40_addrEnd)
 33826  	_sqlite3ExprListDelete(tls, _db, _63_pDel)
 33827  _164:
 33828  	_sqlite3VdbeResolveLabel(tls, _v, _40_addrEnd)
 33829  _102:
 33830  	if int32(_sDistinct.XeTnctType) == int32(3) {
 33831  		_explainTempTable(tls, _pParse, str(25671))
 33832  	}
 33833  	if _sSort.XpOrderBy != nil {
 33834  		_explainTempTable(tls, _pParse, func() *int8 {
 33835  			if _sSort.XnOBSat > int32(0) {
 33836  				return str(46819)
 33837  			}
 33838  			return str(46842)
 33839  		}())
 33840  		_generateSortTail(tls, _pParse, _p, &_sSort, _pEList.XnExpr, _pDest)
 33841  	}
 33842  	_sqlite3VdbeResolveLabel(tls, _v, _iEnd)
 33843  	_rc = bool2int(_pParse.XnErr > int32(0))
 33844  _select_end:
 33845  	_pParse.XiSelectId = _iRestoreSelectId
 33846  	if (_rc == int32(0)) && (int32(_pDest.XeDest) == int32(9)) {
 33847  		_generateColumnNames(tls, _pParse, _pTabList, _pEList)
 33848  	}
 33849  	_sqlite3DbFree(tls, _db, _sAggInfo.XaCol)
 33850  	_sqlite3DbFree(tls, _db, _sAggInfo.XaFunc)
 33851  	if (Xsqlite3SelectTrace & int32(1)) != 0 {
 33852  		_sqlite3DebugPrintf(tls, func() *int8 {
 33853  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33854  			return str(46851)
 33855  		}())
 33856  	}
 33857  	_pParse.XnSelectIndent -= 1
 33858  	return _rc
 33859  }
 33860  
 33861  // C comment
 33862  //  /*
 33863  //  ** Do an authorization check using the code and arguments given.  Return
 33864  //  ** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY.  If SQLITE_DENY
 33865  //  ** is returned, then the error count and error message in pParse are
 33866  //  ** modified appropriately.
 33867  //  */
 33868  func _sqlite3AuthCheck(tls *crt.TLS, _pParse *XParse, _code int32, _zArg1 *int8, _zArg2 *int8, _zArg3 *int8) (r0 int32) {
 33869  	var _rc int32
 33870  	var _db *Xsqlite3
 33871  	_db = (*Xsqlite3)(_pParse.Xdb)
 33872  	if ((_db.Xinit.Xbusy) != 0) || (_pParse.XdeclareVtab != 0) {
 33873  		return int32(0)
 33874  	}
 33875  	if _db.XxAuth == nil {
 33876  		return int32(0)
 33877  	}
 33878  	_rc = _db.XxAuth(tls, _db.XpAuthArg, _code, _zArg1, _zArg2, _zArg3, _pParse.XzAuthContext)
 33879  	if _rc == int32(1) {
 33880  		_sqlite3ErrorMsg(tls, _pParse, str(7881))
 33881  		_pParse.Xrc = int32(23)
 33882  		goto _6
 33883  	}
 33884  	if (_rc != int32(0)) && (_rc != int32(2)) {
 33885  		_rc = int32(1)
 33886  		_sqliteAuthBadReturnCode(tls, _pParse)
 33887  	}
 33888  _6:
 33889  	return _rc
 33890  }
 33891  
 33892  // C comment
 33893  //  /*
 33894  //  ** Write an error message into pParse->zErrMsg that explains that the
 33895  //  ** user-supplied authorization function returned an illegal value.
 33896  //  */
 33897  func _sqliteAuthBadReturnCode(tls *crt.TLS, _pParse *XParse) {
 33898  	_sqlite3ErrorMsg(tls, _pParse, str(46867))
 33899  	_pParse.Xrc = int32(1)
 33900  }
 33901  
 33902  var Xsqlite3SelectTrace int32
 33903  
 33904  // C comment
 33905  //  /*
 33906  //  ** A version of printf() that understands %lld.  Used for debugging.
 33907  //  ** The printf() built into some versions of windows does not understand %lld
 33908  //  ** and segfaults if you give it a long long int.
 33909  //  */
 33910  func _sqlite3DebugPrintf(tls *crt.TLS, _zFormat *int8, args ...interface{}) {
 33911  	var _ap []interface{}
 33912  	var _acc XStrAccum
 33913  	var _zBuf [500]int8
 33914  	_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBuf)), int32(500), int32(0))
 33915  	_ap = args
 33916  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
 33917  	_ap = nil
 33918  	_sqlite3StrAccumFinish(tls, &_acc)
 33919  	crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(24531), unsafe.Pointer(&_zBuf))
 33920  	crt.Xfflush(tls, (*crt.XFILE)(Xstdout))
 33921  	_ = _zBuf
 33922  }
 33923  
 33924  // C comment
 33925  //  /*
 33926  //  ** Generate a human-readable description of a Select object.
 33927  //  */
 33928  func _sqlite3TreeViewSelect(tls *crt.TLS, _pView *t75, _p *XSelect, _moreToFollow uint8) {
 33929  	var _n, _cnt, _6_i int32
 33930  	var _21_zOp *int8
 33931  	var _7_zLine [100]int8
 33932  	var _7_x XStrAccum
 33933  	var _7_pItem *TSrcList_item
 33934  	_n = int32(0)
 33935  	_cnt = int32(0)
 33936  	if _p == nil {
 33937  		_sqlite3TreeViewLine(tls, _pView, str(46890))
 33938  		return
 33939  	}
 33940  	_pView = _sqlite3TreeViewPush(tls, _pView, _moreToFollow)
 33941  	if _p.XpWith != nil {
 33942  		_sqlite3TreeViewWith(tls, _pView, (*XWith)(_p.XpWith), uint8(1))
 33943  		_cnt = int32(1)
 33944  		_sqlite3TreeViewPush(tls, _pView, uint8(1))
 33945  	}
 33946  _1:
 33947  	_sqlite3TreeViewLine(tls, _pView, str(46901), unsafe.Pointer(func() *int8 {
 33948  		if (_p.XselFlags & uint32(1)) != 0 {
 33949  			return str(46947)
 33950  		}
 33951  		return str(284)
 33952  	}()), unsafe.Pointer(func() *int8 {
 33953  		if (_p.XselFlags & uint32(8)) != 0 {
 33954  			return str(46957)
 33955  		}
 33956  		return str(284)
 33957  	}()), unsafe.Pointer(_p), _p.XselFlags, int32(_p.XnSelectRow))
 33958  	if postInc2(&_cnt, 1) != 0 {
 33959  		_sqlite3TreeViewPop(tls, _pView)
 33960  	}
 33961  	if _p.XpPrior != nil {
 33962  		_n = int32(1000)
 33963  		goto _9
 33964  	}
 33965  	_n = int32(0)
 33966  	if (_p.XpSrc != nil) && ((*XSrcList)(_p.XpSrc).XnSrc) != 0 {
 33967  		_n += 1
 33968  	}
 33969  	if _p.XpWhere != nil {
 33970  		_n += 1
 33971  	}
 33972  	if _p.XpGroupBy != nil {
 33973  		_n += 1
 33974  	}
 33975  	if _p.XpHaving != nil {
 33976  		_n += 1
 33977  	}
 33978  	if _p.XpOrderBy != nil {
 33979  		_n += 1
 33980  	}
 33981  	if _p.XpLimit != nil {
 33982  		_n += 1
 33983  	}
 33984  	if _p.XpOffset != nil {
 33985  		_n += 1
 33986  	}
 33987  _9:
 33988  	_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.XpEList), uint8(bool2int(postInc2(&_n, -1) > int32(0))), str(46967))
 33989  	if _p.XpSrc == nil || ((*XSrcList)(_p.XpSrc).XnSrc) == 0 {
 33990  		goto _19
 33991  	}
 33992  	_pView = _sqlite3TreeViewPush(tls, _pView, uint8(bool2int(postInc2(&_n, -1) > int32(0))))
 33993  	_sqlite3TreeViewLine(tls, _pView, str(25684))
 33994  	_6_i = int32(0)
 33995  _20:
 33996  	if _6_i >= ((*XSrcList)(_p.XpSrc).XnSrc) {
 33997  		goto _23
 33998  	}
 33999  	_7_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), uintptr(_6_i))
 34000  	_sqlite3StrAccumInit(tls, &_7_x, nil, (*int8)(unsafe.Pointer(&_7_zLine)), int32(100), int32(0))
 34001  	_sqlite3XPrintf(tls, &_7_x, str(46978), _7_pItem.XiCursor)
 34002  	if _7_pItem.XzDatabase != nil {
 34003  		_sqlite3XPrintf(tls, &_7_x, str(46985), unsafe.Pointer(_7_pItem.XzDatabase), unsafe.Pointer(_7_pItem.XzName))
 34004  		goto _26
 34005  	}
 34006  	if _7_pItem.XzName != nil {
 34007  		_sqlite3XPrintf(tls, &_7_x, str(46992), unsafe.Pointer(_7_pItem.XzName))
 34008  	}
 34009  _26:
 34010  	if _7_pItem.XpTab != nil {
 34011  		_sqlite3XPrintf(tls, &_7_x, str(46996), unsafe.Pointer((*XTable)(_7_pItem.XpTab).XzName))
 34012  	}
 34013  	if _7_pItem.XzAlias != nil {
 34014  		_sqlite3XPrintf(tls, &_7_x, str(47008), unsafe.Pointer(_7_pItem.XzAlias))
 34015  	}
 34016  	if (int32(_7_pItem.Xfg.Xjointype) & int32(8)) != 0 {
 34017  		_sqlite3XPrintf(tls, &_7_x, str(47017))
 34018  	}
 34019  	_sqlite3StrAccumFinish(tls, &_7_x)
 34020  	_sqlite3TreeViewItem(tls, _pView, (*int8)(unsafe.Pointer(&_7_zLine)), uint8(bool2int(_6_i < (((*XSrcList)(_p.XpSrc).XnSrc)-int32(1)))))
 34021  	if _7_pItem.XpSelect != nil {
 34022  		_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(_7_pItem.XpSelect), 0)
 34023  	}
 34024  	if ((uint32((_7_pItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0 {
 34025  		_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_7_pItem.Xu1))), 0, str(47028))
 34026  	}
 34027  	_sqlite3TreeViewPop(tls, _pView)
 34028  	_6_i += 1
 34029  	goto _20
 34030  _23:
 34031  	_sqlite3TreeViewPop(tls, _pView)
 34032  _19:
 34033  	if _p.XpWhere != nil {
 34034  		_sqlite3TreeViewItem(tls, _pView, str(25725), uint8(bool2int(postInc2(&_n, -1) > int32(0))))
 34035  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.XpWhere), 0)
 34036  		_sqlite3TreeViewPop(tls, _pView)
 34037  	}
 34038  	if _p.XpGroupBy != nil {
 34039  		_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.XpGroupBy), uint8(bool2int(postInc2(&_n, -1) > int32(0))), str(47039))
 34040  	}
 34041  	if _p.XpHaving != nil {
 34042  		_sqlite3TreeViewItem(tls, _pView, str(25712), uint8(bool2int(postInc2(&_n, -1) > int32(0))))
 34043  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.XpHaving), 0)
 34044  		_sqlite3TreeViewPop(tls, _pView)
 34045  	}
 34046  	if _p.XpOrderBy != nil {
 34047  		_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.XpOrderBy), uint8(bool2int(postInc2(&_n, -1) > int32(0))), str(47047))
 34048  	}
 34049  	if _p.XpLimit != nil {
 34050  		_sqlite3TreeViewItem(tls, _pView, str(25719), uint8(bool2int(postInc2(&_n, -1) > int32(0))))
 34051  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.XpLimit), 0)
 34052  		_sqlite3TreeViewPop(tls, _pView)
 34053  	}
 34054  	if _p.XpOffset != nil {
 34055  		_sqlite3TreeViewItem(tls, _pView, str(25247), uint8(bool2int(postInc2(&_n, -1) > int32(0))))
 34056  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.XpOffset), 0)
 34057  		_sqlite3TreeViewPop(tls, _pView)
 34058  	}
 34059  	if _p.XpPrior == nil {
 34060  		goto _38
 34061  	}
 34062  	_21_zOp = str(25630)
 34063  	switch int32(_p.Xop) {
 34064  	case int32(116):
 34065  		goto _40
 34066  	case int32(117):
 34067  		goto _42
 34068  	case int32(118):
 34069  		goto _41
 34070  	default:
 34071  		goto _43
 34072  	}
 34073  
 34074  _40:
 34075  	_21_zOp = str(47055)
 34076  	goto _43
 34077  _41:
 34078  	_21_zOp = str(25647)
 34079  	goto _43
 34080  _42:
 34081  	_21_zOp = str(25640)
 34082  	goto _43
 34083  _43:
 34084  	_sqlite3TreeViewItem(tls, _pView, _21_zOp, uint8(1))
 34085  _38:
 34086  	_p = (*XSelect)(_p.XpPrior)
 34087  	if _p != nil {
 34088  		goto _1
 34089  	}
 34090  	_sqlite3TreeViewPop(tls, _pView)
 34091  	_ = _n
 34092  	_ = _cnt
 34093  	_ = _7_zLine
 34094  }
 34095  
 34096  // C comment
 34097  //  /*
 34098  //  ** Generate a single line of output for the tree, with a prefix that contains
 34099  //  ** all the appropriate tree lines
 34100  //  */
 34101  func _sqlite3TreeViewLine(tls *crt.TLS, _p *t75, _zFormat *int8, args ...interface{}) {
 34102  	var _i int32
 34103  	var _ap []interface{}
 34104  	var _acc XStrAccum
 34105  	var _zBuf [500]int8
 34106  	_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBuf)), int32(500), int32(0))
 34107  	if _p == nil {
 34108  		goto _0
 34109  	}
 34110  	_i = int32(0)
 34111  _1:
 34112  	if _i >= _p.XiLevel || uint64(_i) >= uint64(99) {
 34113  		goto _5
 34114  	}
 34115  	_sqlite3StrAccumAppend(tls, &_acc, func() *int8 {
 34116  		if (*elem15((*uint8)(unsafe.Pointer(&_p.XbLine)), uintptr(_i))) != 0 {
 34117  			return str(47065)
 34118  		}
 34119  		return str(47070)
 34120  	}(), int32(4))
 34121  	_i += 1
 34122  	goto _1
 34123  _5:
 34124  	_sqlite3StrAccumAppend(tls, &_acc, func() *int8 {
 34125  		if (*elem15((*uint8)(unsafe.Pointer(&_p.XbLine)), uintptr(_i))) != 0 {
 34126  			return str(47075)
 34127  		}
 34128  		return str(47080)
 34129  	}(), int32(4))
 34130  _0:
 34131  	_ap = args
 34132  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
 34133  	_ap = nil
 34134  	func() {
 34135  		if _acc.XnChar <= (0) {
 34136  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26243), unsafe.Pointer(&_sqlite3TreeViewLineØ00__func__Ø000), unsafe.Pointer(str(47085)))
 34137  			crt.X__builtin_abort(tls)
 34138  		}
 34139  	}()
 34140  	if int32(*elem1((*int8)(unsafe.Pointer(&_zBuf)), uintptr(_acc.XnChar-uint32(1)))) != int32(10) {
 34141  		_sqlite3StrAccumAppend(tls, &_acc, str(37655), int32(1))
 34142  	}
 34143  	_sqlite3StrAccumFinish(tls, &_acc)
 34144  	crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(24531), unsafe.Pointer(&_zBuf))
 34145  	crt.Xfflush(tls, (*crt.XFILE)(Xstdout))
 34146  	_ = _zBuf
 34147  }
 34148  
 34149  var _sqlite3TreeViewLineØ00__func__Ø000 [20]int8
 34150  
 34151  func init() {
 34152  	crt.Xstrncpy(nil, &_sqlite3TreeViewLineØ00__func__Ø000[0], str(47097), 20)
 34153  }
 34154  
 34155  // C comment
 34156  //  /*
 34157  //  ** Add a new subitem to the tree.  The moreToFollow flag indicates that this
 34158  //  ** is not the last item in the tree.
 34159  //  */
 34160  func _sqlite3TreeViewPush(tls *crt.TLS, _p *t75, _moreToFollow uint8) (r0 *t75) {
 34161  	if _p != nil {
 34162  		goto _0
 34163  	}
 34164  	_p = (*t75)(Xsqlite3_malloc64(tls, uint64(104)))
 34165  	if _p == nil {
 34166  		return nil
 34167  	}
 34168  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(104))
 34169  	goto _2
 34170  _0:
 34171  	_p.XiLevel += 1
 34172  _2:
 34173  	func() {
 34174  		if int32(_moreToFollow) != int32(0) && int32(_moreToFollow) != int32(1) {
 34175  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26210), unsafe.Pointer(&_sqlite3TreeViewPushØ00__func__Ø000), unsafe.Pointer(str(47117)))
 34176  			crt.X__builtin_abort(tls)
 34177  		}
 34178  	}()
 34179  	if uint64(_p.XiLevel) < uint64(100) {
 34180  		*elem15((*uint8)(unsafe.Pointer(&_p.XbLine)), uintptr(_p.XiLevel)) = _moreToFollow
 34181  	}
 34182  	return _p
 34183  }
 34184  
 34185  var _sqlite3TreeViewPushØ00__func__Ø000 [20]int8
 34186  
 34187  func init() {
 34188  	crt.Xstrncpy(nil, &_sqlite3TreeViewPushØ00__func__Ø000[0], str(47152), 20)
 34189  }
 34190  
 34191  // C comment
 34192  //  /*
 34193  //  ** Generate a human-readable description of a WITH clause.
 34194  //  */
 34195  func _sqlite3TreeViewWith(tls *crt.TLS, _pView *t75, _pWith *XWith, _moreToFollow uint8) {
 34196  	var _i, _5_j int32
 34197  	var _5_cSep int8
 34198  	var _4_x XStrAccum
 34199  	var _4_zLine [1000]int8
 34200  	var _4_pCte *TCte
 34201  	if _pWith == nil {
 34202  		return
 34203  	}
 34204  	if _pWith.XnCte == int32(0) {
 34205  		return
 34206  	}
 34207  	if _pWith.XpOuter != nil {
 34208  		_sqlite3TreeViewLine(tls, _pView, str(47172), unsafe.Pointer(_pWith), _pWith.XpOuter)
 34209  		goto _3
 34210  	}
 34211  	_sqlite3TreeViewLine(tls, _pView, str(47197), unsafe.Pointer(_pWith))
 34212  _3:
 34213  	if _pWith.XnCte <= int32(0) {
 34214  		goto _4
 34215  	}
 34216  	_pView = _sqlite3TreeViewPush(tls, _pView, uint8(1))
 34217  	_i = int32(0)
 34218  _5:
 34219  	if _i >= _pWith.XnCte {
 34220  		goto _8
 34221  	}
 34222  	_4_pCte = elem45((*TCte)(unsafe.Pointer(&_pWith.Xa)), uintptr(_i))
 34223  	_sqlite3StrAccumInit(tls, &_4_x, nil, (*int8)(unsafe.Pointer(&_4_zLine)), int32(1000), int32(0))
 34224  	_sqlite3XPrintf(tls, &_4_x, str(24531), unsafe.Pointer(_4_pCte.XzName))
 34225  	if _4_pCte.XpCols == nil || ((*XExprList)(_4_pCte.XpCols).XnExpr) <= int32(0) {
 34226  		goto _10
 34227  	}
 34228  	_5_cSep = int8(40)
 34229  	_5_j = int32(0)
 34230  _11:
 34231  	if _5_j >= ((*XExprList)(_4_pCte.XpCols).XnExpr) {
 34232  		goto _14
 34233  	}
 34234  	_sqlite3XPrintf(tls, &_4_x, str(24890), int32(_5_cSep), unsafe.Pointer(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_4_pCte.XpCols).Xa))), uintptr(_5_j)).XzName))
 34235  	_5_cSep = int8(44)
 34236  	_5_j += 1
 34237  	goto _11
 34238  _14:
 34239  	_sqlite3XPrintf(tls, &_4_x, str(37853))
 34240  _10:
 34241  	_sqlite3XPrintf(tls, &_4_x, str(47209))
 34242  	_sqlite3StrAccumFinish(tls, &_4_x)
 34243  	_sqlite3TreeViewItem(tls, _pView, (*int8)(unsafe.Pointer(&_4_zLine)), uint8(bool2int(_i < (_pWith.XnCte-int32(1)))))
 34244  	_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(_4_pCte.XpSelect), 0)
 34245  	_sqlite3TreeViewPop(tls, _pView)
 34246  	_i += 1
 34247  	goto _5
 34248  _8:
 34249  	_sqlite3TreeViewPop(tls, _pView)
 34250  _4:
 34251  	_ = _4_zLine
 34252  }
 34253  
 34254  // C comment
 34255  //  /*
 34256  //  ** Shorthand for starting a new tree item that consists of a single label
 34257  //  */
 34258  func _sqlite3TreeViewItem(tls *crt.TLS, _p *t75, _zLabel *int8, _moreFollows uint8) {
 34259  	_p = _sqlite3TreeViewPush(tls, _p, _moreFollows)
 34260  	_sqlite3TreeViewLine(tls, _p, str(24531), unsafe.Pointer(_zLabel))
 34261  }
 34262  
 34263  // C comment
 34264  //  /*
 34265  //  ** Finished with one layer of the tree
 34266  //  */
 34267  func _sqlite3TreeViewPop(tls *crt.TLS, _p *t75) {
 34268  	if _p == nil {
 34269  		return
 34270  	}
 34271  	_p.XiLevel -= 1
 34272  	if _p.XiLevel < int32(0) {
 34273  		Xsqlite3_free(tls, unsafe.Pointer(_p))
 34274  	}
 34275  }
 34276  
 34277  func _sqlite3TreeViewExprList(tls *crt.TLS, _pView *t75, _pList *XExprList, _moreToFollow uint8, _zLabel *int8) {
 34278  	_pView = _sqlite3TreeViewPush(tls, _pView, _moreToFollow)
 34279  	_sqlite3TreeViewBareExprList(tls, _pView, _pList, _zLabel)
 34280  	_sqlite3TreeViewPop(tls, _pView)
 34281  }
 34282  
 34283  // C comment
 34284  //  /*
 34285  //  ** Generate a human-readable explanation of an expression list.
 34286  //  */
 34287  func _sqlite3TreeViewBareExprList(tls *crt.TLS, _pView *t75, _pList *XExprList, _zLabel *int8) {
 34288  	var _2_i, _3_j int32
 34289  	if (_zLabel == nil) || (int32(*elem1(_zLabel, 0)) == int32(0)) {
 34290  		_zLabel = str(44954)
 34291  	}
 34292  	if _pList == nil {
 34293  		_sqlite3TreeViewLine(tls, _pView, str(47213), unsafe.Pointer(_zLabel))
 34294  		goto _3
 34295  	}
 34296  	_sqlite3TreeViewLine(tls, _pView, str(24531), unsafe.Pointer(_zLabel))
 34297  	_2_i = int32(0)
 34298  _4:
 34299  	if _2_i >= _pList.XnExpr {
 34300  		goto _7
 34301  	}
 34302  	_3_j = int32((*t73)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_2_i)).Xu))).XiOrderByCol)
 34303  	if _3_j != 0 {
 34304  		_sqlite3TreeViewPush(tls, _pView, 0)
 34305  		_sqlite3TreeViewLine(tls, _pView, str(47224), _3_j)
 34306  	}
 34307  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_2_i)).XpExpr), uint8(bool2int(_2_i < (_pList.XnExpr-int32(1)))))
 34308  	if _3_j != 0 {
 34309  		_sqlite3TreeViewPop(tls, _pView)
 34310  	}
 34311  	_2_i += 1
 34312  	goto _4
 34313  _7:
 34314  _3:
 34315  }
 34316  
 34317  // C comment
 34318  //  /*
 34319  //  ** Generate a human-readable explanation of an expression tree.
 34320  //  */
 34321  func _sqlite3TreeViewExpr(tls *crt.TLS, _pView *t75, _pExpr *XExpr, _moreToFollow uint8) {
 34322  	var _zBinOp, _zUniOp, _38_zType *int8
 34323  	var _24_pFarg *XExprList
 34324  	var _35_pX, _35_pY, _35_pZ *XExpr
 34325  	var _zFlgs [60]int8
 34326  	_zBinOp = nil
 34327  	_zUniOp = nil
 34328  	_pView = _sqlite3TreeViewPush(tls, _pView, _moreToFollow)
 34329  	if _pExpr == nil {
 34330  		_sqlite3TreeViewLine(tls, _pView, str(47239))
 34331  		_sqlite3TreeViewPop(tls, _pView)
 34332  		return
 34333  	}
 34334  	if _pExpr.Xflags == 0 {
 34335  		goto _1
 34336  	}
 34337  	if (_pExpr.Xflags & uint32(1)) != (0) {
 34338  		Xsqlite3_snprintf(tls, int32(60), (*int8)(unsafe.Pointer(&_zFlgs)), str(47243), _pExpr.Xflags, int32(_pExpr.XiRightJoinTable))
 34339  		goto _3
 34340  	}
 34341  	Xsqlite3_snprintf(tls, int32(60), (*int8)(unsafe.Pointer(&_zFlgs)), str(47264), _pExpr.Xflags)
 34342  _3:
 34343  	goto _4
 34344  _1:
 34345  	*elem1((*int8)(unsafe.Pointer(&_zFlgs)), 0) = 0
 34346  _4:
 34347  	switch int32(_pExpr.Xop) {
 34348  	case int32(19):
 34349  		goto _41
 34350  	case int32(20):
 34351  		goto _48
 34352  	case int32(27):
 34353  		goto _15
 34354  	case int32(37):
 34355  		goto _16
 34356  	case int32(50):
 34357  		goto _55
 34358  	case int32(56):
 34359  		goto _54
 34360  	case int32(61):
 34361  		goto _52
 34362  	case int32(70):
 34363  		goto _26
 34364  	case int32(71):
 34365  		goto _25
 34366  	case int32(72):
 34367  		goto _23
 34368  	case int32(73):
 34369  		goto _51
 34370  	case int32(74):
 34371  		goto _50
 34372  	case int32(75):
 34373  		goto _42
 34374  	case int32(76):
 34375  		goto _43
 34376  	case int32(77):
 34377  		goto _21
 34378  	case int32(78):
 34379  		goto _22
 34380  	case int32(79):
 34381  		goto _19
 34382  	case int32(80):
 34383  		goto _18
 34384  	case int32(81):
 34385  		goto _17
 34386  	case int32(82):
 34387  		goto _20
 34388  	case int32(84):
 34389  		goto _31
 34390  	case int32(85):
 34391  		goto _32
 34392  	case int32(86):
 34393  		goto _34
 34394  	case int32(87):
 34395  		goto _35
 34396  	case int32(88):
 34397  		goto _27
 34398  	case int32(89):
 34399  		goto _29
 34400  	case int32(90):
 34401  		goto _28
 34402  	case int32(91):
 34403  		goto _33
 34404  	case int32(92):
 34405  		goto _30
 34406  	case int32(93):
 34407  		goto _36
 34408  	case int32(94):
 34409  		goto _45
 34410  	case int32(95):
 34411  		goto _40
 34412  	case int32(97):
 34413  		goto _10
 34414  	case int32(101):
 34415  		goto _11
 34416  	case int32(119):
 34417  		goto _49
 34418  	case int32(122):
 34419  		goto _37
 34420  	case int32(132):
 34421  		goto _9
 34422  	case int32(133):
 34423  		goto _12
 34424  	case int32(134):
 34425  		goto _8
 34426  	case int32(135):
 34427  		goto _13
 34428  	case int32(136):
 34429  		goto _53
 34430  	case int32(148):
 34431  		goto _24
 34432  	case int32(151):
 34433  		goto _46
 34434  	case int32(152):
 34435  		goto _7
 34436  	case int32(153):
 34437  		goto _46
 34438  	case int32(154):
 34439  		goto _6
 34440  	case int32(155):
 34441  		goto _38
 34442  	case int32(156):
 34443  		goto _39
 34444  	case int32(157):
 34445  		goto _14
 34446  	case int32(158):
 34447  		goto _56
 34448  	case int32(159):
 34449  		goto _57
 34450  	case int32(160):
 34451  		goto _58
 34452  	case int32(162):
 34453  		goto _44
 34454  	default:
 34455  		goto _59
 34456  	}
 34457  
 34458  _6:
 34459  	_sqlite3TreeViewLine(tls, _pView, str(47277), _pExpr.XiTable, int32(_pExpr.XiColumn), unsafe.Pointer(&_zFlgs))
 34460  	goto _60
 34461  _7:
 34462  	if _pExpr.XiTable < int32(0) {
 34463  		_sqlite3TreeViewLine(tls, _pView, str(47290), int32(_pExpr.XiColumn), unsafe.Pointer(&_zFlgs))
 34464  		goto _62
 34465  	}
 34466  	_sqlite3TreeViewLine(tls, _pView, str(47303), _pExpr.XiTable, int32(_pExpr.XiColumn), unsafe.Pointer(&_zFlgs))
 34467  _62:
 34468  	goto _60
 34469  _8:
 34470  	if (_pExpr.Xflags & uint32(1024)) != 0 {
 34471  		_sqlite3TreeViewLine(tls, _pView, str(37870), *(*int32)(unsafe.Pointer(&_pExpr.Xu)))
 34472  		goto _64
 34473  	}
 34474  	_sqlite3TreeViewLine(tls, _pView, str(24531), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34475  _64:
 34476  	goto _60
 34477  _9:
 34478  	_sqlite3TreeViewLine(tls, _pView, str(24531), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34479  	goto _60
 34480  _10:
 34481  	_sqlite3TreeViewLine(tls, _pView, str(47313), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34482  	goto _60
 34483  _11:
 34484  	_sqlite3TreeViewLine(tls, _pView, str(285))
 34485  	goto _60
 34486  _12:
 34487  	_sqlite3TreeViewLine(tls, _pView, str(24531), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34488  	goto _60
 34489  _13:
 34490  	_sqlite3TreeViewLine(tls, _pView, str(47316), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))), int32(_pExpr.XiColumn))
 34491  	goto _60
 34492  _14:
 34493  	_sqlite3TreeViewLine(tls, _pView, str(47332), _pExpr.XiTable)
 34494  	goto _60
 34495  _15:
 34496  	_sqlite3TreeViewLine(tls, _pView, str(47345), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34497  	goto _60
 34498  _16:
 34499  	_sqlite3TreeViewLine(tls, _pView, str(47353), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34500  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), 0)
 34501  	goto _60
 34502  _17:
 34503  	_zBinOp = str(25407)
 34504  	goto _60
 34505  _18:
 34506  	_zBinOp = str(25404)
 34507  	goto _60
 34508  _19:
 34509  	_zBinOp = str(25401)
 34510  	goto _60
 34511  _20:
 34512  	_zBinOp = str(25410)
 34513  	goto _60
 34514  _21:
 34515  	_zBinOp = str(25395)
 34516  	goto _60
 34517  _22:
 34518  	_zBinOp = str(25398)
 34519  	goto _60
 34520  _23:
 34521  	_zBinOp = str(25366)
 34522  	goto _60
 34523  _24:
 34524  	_zBinOp = str(47361)
 34525  	goto _60
 34526  _25:
 34527  	_zBinOp = str(25362)
 34528  	goto _60
 34529  _26:
 34530  	_zBinOp = str(25359)
 34531  	goto _60
 34532  _27:
 34533  	_zBinOp = str(25796)
 34534  	goto _60
 34535  _28:
 34536  	_zBinOp = str(47367)
 34537  	goto _60
 34538  _29:
 34539  	_zBinOp = str(47371)
 34540  	goto _60
 34541  _30:
 34542  	_zBinOp = str(25469)
 34543  	goto _60
 34544  _31:
 34545  	_zBinOp = str(25420)
 34546  	goto _60
 34547  _32:
 34548  	_zBinOp = str(25427)
 34549  	goto _60
 34550  _33:
 34551  	_zBinOp = str(47375)
 34552  	goto _60
 34553  _34:
 34554  	_zBinOp = str(25433)
 34555  	goto _60
 34556  _35:
 34557  	_zBinOp = str(25440)
 34558  	goto _60
 34559  _36:
 34560  	_zBinOp = str(25473)
 34561  	goto _60
 34562  _37:
 34563  	_zBinOp = str(25680)
 34564  	goto _60
 34565  _38:
 34566  	_zUniOp = str(47379)
 34567  	goto _60
 34568  _39:
 34569  	_zUniOp = str(47386)
 34570  	goto _60
 34571  _40:
 34572  	_zUniOp = str(25488)
 34573  	goto _60
 34574  _41:
 34575  	_zUniOp = str(25042)
 34576  	goto _60
 34577  _42:
 34578  	_zUniOp = str(25380)
 34579  	goto _60
 34580  _43:
 34581  	_zUniOp = str(25387)
 34582  	goto _60
 34583  _44:
 34584  	_sqlite3TreeViewLine(tls, _pView, str(47392), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34585  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), 0)
 34586  	goto _60
 34587  _45:
 34588  	_sqlite3TreeViewLine(tls, _pView, str(47400), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34589  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), 0)
 34590  	goto _60
 34591  _46:
 34592  	if (_pExpr.Xflags & uint32(16384)) != (0) {
 34593  		_24_pFarg = nil
 34594  		goto _66
 34595  	}
 34596  	_24_pFarg = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 34597  _66:
 34598  	if int32(_pExpr.Xop) == int32(153) {
 34599  		_sqlite3TreeViewLine(tls, _pView, str(47411), int32(_pExpr.Xop2), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34600  		goto _68
 34601  	}
 34602  	_sqlite3TreeViewLine(tls, _pView, str(47429), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34603  _68:
 34604  	if _24_pFarg != nil {
 34605  		_sqlite3TreeViewExprList(tls, _pView, _24_pFarg, 0, nil)
 34606  	}
 34607  	goto _60
 34608  _48:
 34609  	_sqlite3TreeViewLine(tls, _pView, str(47441))
 34610  	_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), 0)
 34611  	goto _60
 34612  _49:
 34613  	_sqlite3TreeViewLine(tls, _pView, str(47453))
 34614  	_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), 0)
 34615  	goto _60
 34616  _50:
 34617  	_sqlite3TreeViewLine(tls, _pView, str(25377))
 34618  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), uint8(1))
 34619  	if (_pExpr.Xflags & uint32(2048)) != (0) {
 34620  		_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), 0)
 34621  		goto _71
 34622  	}
 34623  	_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), 0, nil)
 34624  _71:
 34625  	goto _60
 34626  _51:
 34627  	_35_pX = (*XExpr)(_pExpr.XpLeft)
 34628  	_35_pY = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr)
 34629  	_35_pZ = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), uintptr(1)).XpExpr)
 34630  	_sqlite3TreeViewLine(tls, _pView, str(25369))
 34631  	_sqlite3TreeViewExpr(tls, _pView, _35_pX, uint8(1))
 34632  	_sqlite3TreeViewExpr(tls, _pView, _35_pY, uint8(1))
 34633  	_sqlite3TreeViewExpr(tls, _pView, _35_pZ, 0)
 34634  	goto _60
 34635  _52:
 34636  	_sqlite3TreeViewLine(tls, _pView, str(37863), unsafe.Pointer(func() *int8 {
 34637  		if _pExpr.XiTable != 0 {
 34638  			return str(47465)
 34639  		}
 34640  		return str(47469)
 34641  	}()), int32(_pExpr.XiColumn))
 34642  	goto _60
 34643  _53:
 34644  	_sqlite3TreeViewLine(tls, _pView, str(25764))
 34645  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), uint8(1))
 34646  	_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), 0, nil)
 34647  	goto _60
 34648  _54:
 34649  	_38_zType = str(47473)
 34650  	switch int32(_pExpr.Xaffinity) {
 34651  	case int32(1):
 34652  		goto _75
 34653  	case int32(2):
 34654  		goto _76
 34655  	case int32(3):
 34656  		goto _77
 34657  	case int32(4):
 34658  		goto _78
 34659  	default:
 34660  		goto _79
 34661  	}
 34662  
 34663  _75:
 34664  	_38_zType = str(47477)
 34665  	goto _79
 34666  _76:
 34667  	_38_zType = str(47486)
 34668  	goto _79
 34669  _77:
 34670  	_38_zType = str(47492)
 34671  	goto _79
 34672  _78:
 34673  	_38_zType = str(47497)
 34674  	goto _79
 34675  _79:
 34676  	_sqlite3TreeViewLine(tls, _pView, str(47504), unsafe.Pointer(_38_zType), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34677  	goto _60
 34678  _55:
 34679  	_sqlite3TreeViewLine(tls, _pView, str(47517), _pExpr.XiTable, int32(_pExpr.XiColumn), unsafe.Pointer(&_zFlgs))
 34680  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpRight), 0)
 34681  	goto _60
 34682  _56:
 34683  	_sqlite3TreeViewBareExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), str(47533))
 34684  	goto _60
 34685  _57:
 34686  	_sqlite3TreeViewLine(tls, _pView, str(47540), int32(_pExpr.XiColumn))
 34687  	_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(_pExpr.XpLeft).Xx)))), 0)
 34688  	goto _60
 34689  _58:
 34690  	_sqlite3TreeViewLine(tls, _pView, str(47557), _pExpr.XiTable)
 34691  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), 0)
 34692  	goto _60
 34693  _59:
 34694  	_sqlite3TreeViewLine(tls, _pView, str(47572), int32(_pExpr.Xop))
 34695  	goto _60
 34696  _60:
 34697  	if _zBinOp != nil {
 34698  		_sqlite3TreeViewLine(tls, _pView, str(6791), unsafe.Pointer(_zBinOp), unsafe.Pointer(&_zFlgs))
 34699  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), uint8(1))
 34700  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpRight), 0)
 34701  		goto _82
 34702  	}
 34703  	if _zUniOp != nil {
 34704  		_sqlite3TreeViewLine(tls, _pView, str(6791), unsafe.Pointer(_zUniOp), unsafe.Pointer(&_zFlgs))
 34705  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), 0)
 34706  	}
 34707  _82:
 34708  	_sqlite3TreeViewPop(tls, _pView)
 34709  	_ = _zFlgs
 34710  }
 34711  
 34712  var _sqlite3SelectØ00__func__Ø000 [14]int8
 34713  
 34714  func init() {
 34715  	crt.Xstrncpy(nil, &_sqlite3SelectØ00__func__Ø000[0], str(47578), 14)
 34716  }
 34717  
 34718  // C comment
 34719  //  /*
 34720  //  ** This routine sets up a SELECT statement for processing.  The
 34721  //  ** following is accomplished:
 34722  //  **
 34723  //  **     *  VDBE Cursor numbers are assigned to all FROM-clause terms.
 34724  //  **     *  Ephemeral Table objects are created for all FROM-clause subqueries.
 34725  //  **     *  ON and USING clauses are shifted into WHERE statements
 34726  //  **     *  Wildcards "*" and "TABLE.*" in result sets are expanded.
 34727  //  **     *  Identifiers in expression are matched to tables.
 34728  //  **
 34729  //  ** This routine acts recursively on all subqueries within the SELECT.
 34730  //  */
 34731  func _sqlite3SelectPrep(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pOuterNC *XNameContext) {
 34732  	var _db *Xsqlite3
 34733  	if func() int32 {
 34734  		if _p == nil {
 34735  			return func() int32 {
 34736  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121240), unsafe.Pointer(&_sqlite3SelectPrepØ00__func__Ø000), unsafe.Pointer(str(4809)))
 34737  				crt.X__builtin_abort(tls)
 34738  				return int32(1)
 34739  			}()
 34740  		}
 34741  		return int32(0)
 34742  	}() != 0 {
 34743  		return
 34744  	}
 34745  	_db = (*Xsqlite3)(_pParse.Xdb)
 34746  	if _db.XmallocFailed != 0 {
 34747  		return
 34748  	}
 34749  	if (_p.XselFlags & uint32(128)) != 0 {
 34750  		return
 34751  	}
 34752  	_sqlite3SelectExpand(tls, _pParse, _p)
 34753  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 34754  		return
 34755  	}
 34756  	_sqlite3ResolveSelectNames(tls, _pParse, _p, _pOuterNC)
 34757  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 34758  		return
 34759  	}
 34760  	_sqlite3SelectAddTypeInfo(tls, _pParse, _p)
 34761  }
 34762  
 34763  var _sqlite3SelectPrepØ00__func__Ø000 [18]int8
 34764  
 34765  func init() {
 34766  	crt.Xstrncpy(nil, &_sqlite3SelectPrepØ00__func__Ø000[0], str(47592), 18)
 34767  }
 34768  
 34769  // C comment
 34770  //  /*
 34771  //  ** This routine "expands" a SELECT statement and all of its subqueries.
 34772  //  ** For additional information on what it means to "expand" a SELECT
 34773  //  ** statement, see the comment on the selectExpand worker callback above.
 34774  //  **
 34775  //  ** Expanding a SELECT statement is the first step in processing a
 34776  //  ** SELECT statement.  The SELECT statement must be expanded before
 34777  //  ** name resolution is performed.
 34778  //  **
 34779  //  ** If anything goes wrong, an error message is written into pParse.
 34780  //  ** The calling function can detect the problem by looking at pParse->nErr
 34781  //  ** and/or pParse->db->mallocFailed.
 34782  //  */
 34783  func _sqlite3SelectExpand(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) {
 34784  	var _w XWalker
 34785  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint64(48))
 34786  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _sqlite3ExprWalkNoop
 34787  	*(**XParse)(unsafe.Pointer(&_w.XpParse)) = _pParse
 34788  	if _pParse.XhasCompound != 0 {
 34789  		*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _convertCompoundSelectToSubquery
 34790  		_sqlite3WalkSelect(tls, &_w, _pSelect)
 34791  	}
 34792  	*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _selectExpander
 34793  	*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&_w.XxSelectCallback2)) = _selectPopWith
 34794  	_sqlite3WalkSelect(tls, &_w, _pSelect)
 34795  }
 34796  
 34797  // C comment
 34798  //  /*
 34799  //  ** No-op routine for the parse-tree walker.
 34800  //  **
 34801  //  ** When this routine is the Walker.xExprCallback then expression trees
 34802  //  ** are walked without any actions being taken at each node.  Presumably,
 34803  //  ** when this routine is used for Walker.xExprCallback then
 34804  //  ** Walker.xSelectCallback is set to do something useful for every
 34805  //  ** subquery in the parser tree.
 34806  //  */
 34807  func _sqlite3ExprWalkNoop(tls *crt.TLS, _NotUsed *XWalker, _NotUsed2 *XExpr) (r0 int32) {
 34808  	_ = _NotUsed2
 34809  	return int32(0)
 34810  }
 34811  
 34812  // C comment
 34813  //  /*
 34814  //  ** Detect compound SELECT statements that use an ORDER BY clause with
 34815  //  ** an alternative collating sequence.
 34816  //  **
 34817  //  **    SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ...
 34818  //  **
 34819  //  ** These are rewritten as a subquery:
 34820  //  **
 34821  //  **    SELECT * FROM (SELECT ... FROM t1 EXCEPT SELECT ... FROM t2)
 34822  //  **     ORDER BY ... COLLATE ...
 34823  //  **
 34824  //  ** This transformation is necessary because the multiSelectOrderBy() routine
 34825  //  ** above that generates the code for a compound SELECT with an ORDER BY clause
 34826  //  ** uses a merge algorithm that requires the same collating sequence on the
 34827  //  ** result columns as on the ORDER BY clause.  See ticket
 34828  //  ** http://www.sqlite.org/src/info/6709574d2a
 34829  //  **
 34830  //  ** This transformation is only needed for EXCEPT, INTERSECT, and UNION.
 34831  //  ** The UNION ALL operator works fine with multiSelectOrderBy() even when
 34832  //  ** there are COLLATE terms in the ORDER BY.
 34833  //  */
 34834  func _convertCompoundSelectToSubquery(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 34835  	var _i int32
 34836  	var _dummy XToken
 34837  	var _db *Xsqlite3
 34838  	var _pNewSrc *XSrcList
 34839  	var _a *TExprList_item
 34840  	var _pNew, _pX *XSelect
 34841  	var _pParse *XParse
 34842  	if (*XSelect)(_p.XpPrior) == nil {
 34843  		return int32(0)
 34844  	}
 34845  	if (*XExprList)(_p.XpOrderBy) == nil {
 34846  		return int32(0)
 34847  	}
 34848  	_pX = _p
 34849  _2:
 34850  	if _pX == nil || int32(_pX.Xop) != int32(116) && int32(_pX.Xop) != int32(119) {
 34851  		goto _7
 34852  	}
 34853  	_pX = (*XSelect)(_pX.XpPrior)
 34854  	goto _2
 34855  _7:
 34856  	if _pX == nil {
 34857  		return int32(0)
 34858  	}
 34859  	_a = (*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpOrderBy).Xa)))
 34860  	_i = ((*XExprList)(_p.XpOrderBy).XnExpr) - int32(1)
 34861  _9:
 34862  	if _i < int32(0) {
 34863  		goto _12
 34864  	}
 34865  	if (((*XExpr)(elem59(_a, uintptr(_i)).XpExpr).Xflags) & uint32(256)) != 0 {
 34866  		goto _12
 34867  	}
 34868  	_i -= 1
 34869  	goto _9
 34870  _12:
 34871  	if _i < int32(0) {
 34872  		return int32(0)
 34873  	}
 34874  	_pParse = (*XParse)(_pWalker.XpParse)
 34875  	_db = (*Xsqlite3)(_pParse.Xdb)
 34876  	_pNew = (*XSelect)(_sqlite3DbMallocZero(tls, _db, uint64(128)))
 34877  	if _pNew == nil {
 34878  		return int32(2)
 34879  	}
 34880  	crt.Xmemset(tls, unsafe.Pointer(&_dummy), int32(0), uint64(16))
 34881  	_pNewSrc = _sqlite3SrcListAppendFromTerm(tls, _pParse, nil, nil, nil, &_dummy, _pNew, nil, nil)
 34882  	if _pNewSrc == nil {
 34883  		return int32(2)
 34884  	}
 34885  	*_pNew = *_p
 34886  	*(**XSrcList)(unsafe.Pointer(&_p.XpSrc)) = _pNewSrc
 34887  	*(**XExprList)(unsafe.Pointer(&_p.XpEList)) = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3Expr(tls, _db, int32(161), nil))
 34888  	_p.Xop = uint8(119)
 34889  	*(**XExpr)(unsafe.Pointer(&_p.XpWhere)) = nil
 34890  	*(**XExprList)(unsafe.Pointer(&_pNew.XpGroupBy)) = nil
 34891  	*(**XExpr)(unsafe.Pointer(&_pNew.XpHaving)) = nil
 34892  	*(**XExprList)(unsafe.Pointer(&_pNew.XpOrderBy)) = nil
 34893  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 34894  	*(**XSelect)(unsafe.Pointer(&_p.XpNext)) = nil
 34895  	*(**XWith)(unsafe.Pointer(&_p.XpWith)) = nil
 34896  	_p.XselFlags &= uint32(4294967039)
 34897  	func() {
 34898  		if (_p.XselFlags & uint32(65536)) != (0) {
 34899  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120599), unsafe.Pointer(&_convertCompoundSelectToSubqueryØ00__func__Ø000), unsafe.Pointer(str(47610)))
 34900  			crt.X__builtin_abort(tls)
 34901  		}
 34902  	}()
 34903  	_p.XselFlags |= uint32(65536)
 34904  	func() {
 34905  		if (*XSelect)(_pNew.XpPrior) == nil {
 34906  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120601), unsafe.Pointer(&_convertCompoundSelectToSubqueryØ00__func__Ø000), unsafe.Pointer(str(47642)))
 34907  			crt.X__builtin_abort(tls)
 34908  		}
 34909  	}()
 34910  	*(**XSelect)(unsafe.Pointer(&((*XSelect)(_pNew.XpPrior).XpNext))) = _pNew
 34911  	*(**XExpr)(unsafe.Pointer(&_pNew.XpLimit)) = nil
 34912  	*(**XExpr)(unsafe.Pointer(&_pNew.XpOffset)) = nil
 34913  	return int32(0)
 34914  }
 34915  
 34916  // C comment
 34917  //  /*
 34918  //  ** This routine is called by the parser to add a new term to the
 34919  //  ** end of a growing FROM clause.  The "p" parameter is the part of
 34920  //  ** the FROM clause that has already been constructed.  "p" is NULL
 34921  //  ** if this is the first term of the FROM clause.  pTable and pDatabase
 34922  //  ** are the name of the table and database named in the FROM clause term.
 34923  //  ** pDatabase is NULL if the database name qualifier is missing - the
 34924  //  ** usual case.  If the term has an alias, then pAlias points to the
 34925  //  ** alias token.  If the term is a subquery, then pSubquery is the
 34926  //  ** SELECT statement that the subquery encodes.  The pTable and
 34927  //  ** pDatabase parameters are NULL for subqueries.  The pOn and pUsing
 34928  //  ** parameters are the content of the ON and USING clauses.
 34929  //  **
 34930  //  ** Return a new SrcList which encodes is the FROM with the new
 34931  //  ** term added.
 34932  //  */
 34933  func _sqlite3SrcListAppendFromTerm(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pTable *XToken, _pDatabase *XToken, _pAlias *XToken, _pSubquery *XSelect, _pOn *XExpr, _pUsing *XIdList) (r0 *XSrcList) {
 34934  	var _db *Xsqlite3
 34935  	var _pItem *TSrcList_item
 34936  	_db = (*Xsqlite3)(_pParse.Xdb)
 34937  	if (_p == nil) && ((_pOn != nil) || (_pUsing != nil)) {
 34938  		_sqlite3ErrorMsg(tls, _pParse, str(47658), unsafe.Pointer(func() *int8 {
 34939  			if _pOn != nil {
 34940  				return str(25578)
 34941  			}
 34942  			return str(25694)
 34943  		}()))
 34944  		goto _append_from_error
 34945  	}
 34946  	_p = _sqlite3SrcListAppend(tls, _db, _p, _pTable, _pDatabase)
 34947  	if (_p == nil) || func() int32 {
 34948  		if _p.XnSrc == int32(0) {
 34949  			return func() int32 {
 34950  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103550), unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000), unsafe.Pointer(str(4809)))
 34951  				crt.X__builtin_abort(tls)
 34952  				return int32(1)
 34953  			}()
 34954  		}
 34955  		return int32(0)
 34956  	}() != 0 {
 34957  		goto _append_from_error
 34958  	}
 34959  	_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnSrc-int32(1)))
 34960  	func() {
 34961  		if _pAlias == nil {
 34962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103554), unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000), unsafe.Pointer(str(47694)))
 34963  			crt.X__builtin_abort(tls)
 34964  		}
 34965  	}()
 34966  	if _pAlias.Xn != 0 {
 34967  		_pItem.XzAlias = _sqlite3NameFromToken(tls, _db, _pAlias)
 34968  	}
 34969  	*(**XSelect)(unsafe.Pointer(&_pItem.XpSelect)) = _pSubquery
 34970  	*(**XExpr)(unsafe.Pointer(&_pItem.XpOn)) = _pOn
 34971  	*(**XIdList)(unsafe.Pointer(&_pItem.XpUsing)) = _pUsing
 34972  	return _p
 34973  
 34974  _append_from_error:
 34975  	func() {
 34976  		if _p != nil {
 34977  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103564), unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000), unsafe.Pointer(str(47704)))
 34978  			crt.X__builtin_abort(tls)
 34979  		}
 34980  	}()
 34981  	_sqlite3ExprDelete(tls, _db, _pOn)
 34982  	_sqlite3IdListDelete(tls, _db, _pUsing)
 34983  	_sqlite3SelectDelete(tls, _db, _pSubquery)
 34984  	return nil
 34985  }
 34986  
 34987  // C comment
 34988  //  /*
 34989  //  ** Append a new table name to the given SrcList.  Create a new SrcList if
 34990  //  ** need be.  A new entry is created in the SrcList even if pTable is NULL.
 34991  //  **
 34992  //  ** A SrcList is returned, or NULL if there is an OOM error.  The returned
 34993  //  ** SrcList might be the same as the SrcList that was input or it might be
 34994  //  ** a new one.  If an OOM error does occurs, then the prior value of pList
 34995  //  ** that is input to this routine is automatically freed.
 34996  //  **
 34997  //  ** If pDatabase is not null, it means that the table has an optional
 34998  //  ** database name prefix.  Like this:  "database.table".  The pDatabase
 34999  //  ** points to the table name and the pTable points to the database name.
 35000  //  ** The SrcList.a[].zName field is filled with the table name which might
 35001  //  ** come from pTable (if pDatabase is NULL) or from pDatabase.
 35002  //  ** SrcList.a[].zDatabase is filled with the database name from pTable,
 35003  //  ** or with NULL if no database is specified.
 35004  //  **
 35005  //  ** In other words, if call like this:
 35006  //  **
 35007  //  **         sqlite3SrcListAppend(D,A,B,0);
 35008  //  **
 35009  //  ** Then B is a table name and the database name is unspecified.  If called
 35010  //  ** like this:
 35011  //  **
 35012  //  **         sqlite3SrcListAppend(D,A,B,C);
 35013  //  **
 35014  //  ** Then C is the table name and B is the database name.  If C is defined
 35015  //  ** then so is B.  In other words, we never have a case where:
 35016  //  **
 35017  //  **         sqlite3SrcListAppend(D,A,0,C);
 35018  //  **
 35019  //  ** Both pTable and pDatabase are assumed to be quoted.  They are dequoted
 35020  //  ** before being added to the SrcList.
 35021  //  */
 35022  func _sqlite3SrcListAppend(tls *crt.TLS, _db *Xsqlite3, _pList *XSrcList, _pTable *XToken, _pDatabase *XToken) (r0 *XSrcList) {
 35023  	var _5_pTemp *XToken
 35024  	var _pItem *TSrcList_item
 35025  	func() {
 35026  		if _pDatabase != nil && _pTable == nil {
 35027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103446), unsafe.Pointer(&_sqlite3SrcListAppendØ00__func__Ø000), unsafe.Pointer(str(47709)))
 35028  			crt.X__builtin_abort(tls)
 35029  		}
 35030  	}()
 35031  	func() {
 35032  		if _db == nil {
 35033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103447), unsafe.Pointer(&_sqlite3SrcListAppendØ00__func__Ø000), unsafe.Pointer(str(1219)))
 35034  			crt.X__builtin_abort(tls)
 35035  		}
 35036  	}()
 35037  	if _pList != nil {
 35038  		goto _5
 35039  	}
 35040  	_pList = (*XSrcList)(_sqlite3DbMallocRawNN(tls, _db, uint64(120)))
 35041  	if _pList == nil {
 35042  		return nil
 35043  	}
 35044  	_pList.XnAlloc = uint32(1)
 35045  	_pList.XnSrc = int32(1)
 35046  	crt.Xmemset(tls, unsafe.Pointer(elem6((*TSrcList_item)(unsafe.Pointer(&_pList.Xa)), 0)), int32(0), uint64(112))
 35047  	elem6((*TSrcList_item)(unsafe.Pointer(&_pList.Xa)), 0).XiCursor = int32(-1)
 35048  	goto _7
 35049  _5:
 35050  	_pList = _sqlite3SrcListEnlarge(tls, _db, _pList, int32(1), _pList.XnSrc)
 35051  _7:
 35052  	if _db.XmallocFailed != 0 {
 35053  		_sqlite3SrcListDelete(tls, _db, _pList)
 35054  		return nil
 35055  	}
 35056  	_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_pList.XnSrc-int32(1)))
 35057  	if (_pDatabase != nil) && (_pDatabase.Xz == nil) {
 35058  		_pDatabase = nil
 35059  	}
 35060  	if _pDatabase != nil {
 35061  		_5_pTemp = _pDatabase
 35062  		_pDatabase = _pTable
 35063  		_pTable = _5_pTemp
 35064  	}
 35065  	_pItem.XzName = _sqlite3NameFromToken(tls, _db, _pTable)
 35066  	_pItem.XzDatabase = _sqlite3NameFromToken(tls, _db, _pDatabase)
 35067  	return _pList
 35068  }
 35069  
 35070  var _sqlite3SrcListAppendØ00__func__Ø000 [21]int8
 35071  
 35072  func init() {
 35073  	crt.Xstrncpy(nil, &_sqlite3SrcListAppendØ00__func__Ø000[0], str(47735), 21)
 35074  }
 35075  
 35076  // C comment
 35077  //  /*
 35078  //  ** Expand the space allocated for the given SrcList object by
 35079  //  ** creating nExtra new slots beginning at iStart.  iStart is zero based.
 35080  //  ** New slots are zeroed.
 35081  //  **
 35082  //  ** For example, suppose a SrcList initially contains two entries: A,B.
 35083  //  ** To append 3 new entries onto the end, do this:
 35084  //  **
 35085  //  **    sqlite3SrcListEnlarge(db, pSrclist, 3, 2);
 35086  //  **
 35087  //  ** After the call above it would contain:  A, B, nil, nil, nil.
 35088  //  ** If the iStart argument had been 1 instead of 2, then the result
 35089  //  ** would have been:  A, nil, nil, nil, B.  To prepend the new slots,
 35090  //  ** the iStart value would be 0.  The result then would
 35091  //  ** be: nil, nil, nil, A, B.
 35092  //  **
 35093  //  ** If a memory allocation fails the SrcList is unchanged.  The
 35094  //  ** db->mallocFailed flag will be set to true.
 35095  //  */
 35096  func _sqlite3SrcListEnlarge(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _nExtra int32, _iStart int32) (r0 *XSrcList) {
 35097  	var _i, _1_nAlloc, _1_nGot int32
 35098  	var _1_pNew *XSrcList
 35099  	func() {
 35100  		if _iStart < int32(0) {
 35101  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103366), unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000), unsafe.Pointer(str(47756)))
 35102  			crt.X__builtin_abort(tls)
 35103  		}
 35104  	}()
 35105  	func() {
 35106  		if _nExtra < int32(1) {
 35107  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103367), unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000), unsafe.Pointer(str(47766)))
 35108  			crt.X__builtin_abort(tls)
 35109  		}
 35110  	}()
 35111  	func() {
 35112  		if _pSrc == nil {
 35113  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103368), unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000), unsafe.Pointer(str(47776)))
 35114  			crt.X__builtin_abort(tls)
 35115  		}
 35116  	}()
 35117  	func() {
 35118  		if _iStart > _pSrc.XnSrc {
 35119  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103369), unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000), unsafe.Pointer(str(47784)))
 35120  			crt.X__builtin_abort(tls)
 35121  		}
 35122  	}()
 35123  	if (uint32(_pSrc.XnSrc) + uint32(_nExtra)) <= _pSrc.XnAlloc {
 35124  		goto _8
 35125  	}
 35126  	_1_nAlloc = (_pSrc.XnSrc * int32(2)) + _nExtra
 35127  	_1_pNew = (*XSrcList)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pSrc), uint64(120)+(uint64(_1_nAlloc-int32(1))*uint64(112))))
 35128  	if _1_pNew == nil {
 35129  		func() {
 35130  			if _db.XmallocFailed == 0 {
 35131  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103379), unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000), unsafe.Pointer(str(47803)))
 35132  				crt.X__builtin_abort(tls)
 35133  			}
 35134  		}()
 35135  		return _pSrc
 35136  	}
 35137  	_pSrc = _1_pNew
 35138  	_1_nGot = int32(((uint64(_sqlite3DbMallocSize(tls, _db, unsafe.Pointer(_1_pNew))) - uint64(120)) / uint64(112)) + uint64(1))
 35139  	_pSrc.XnAlloc = uint32(_1_nGot)
 35140  _8:
 35141  	_i = _pSrc.XnSrc - int32(1)
 35142  _12:
 35143  	if _i < _iStart {
 35144  		goto _15
 35145  	}
 35146  	*elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i+_nExtra)) = *elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i))
 35147  	_i -= 1
 35148  	goto _12
 35149  _15:
 35150  	_pSrc.XnSrc += _nExtra
 35151  	crt.Xmemset(tls, unsafe.Pointer(elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iStart))), int32(0), uint64(112)*uint64(_nExtra))
 35152  	_i = _iStart
 35153  _16:
 35154  	if _i >= (_iStart + _nExtra) {
 35155  		goto _19
 35156  	}
 35157  	elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i)).XiCursor = int32(-1)
 35158  	_i += 1
 35159  	goto _16
 35160  _19:
 35161  	return _pSrc
 35162  }
 35163  
 35164  var _sqlite3SrcListEnlargeØ00__func__Ø000 [22]int8
 35165  
 35166  func init() {
 35167  	crt.Xstrncpy(nil, &_sqlite3SrcListEnlargeØ00__func__Ø000[0], str(47820), 22)
 35168  }
 35169  
 35170  // C comment
 35171  //  /*
 35172  //  ** Given a token, return a string that consists of the text of that
 35173  //  ** token.  Space to hold the returned string
 35174  //  ** is obtained from sqliteMalloc() and must be freed by the calling
 35175  //  ** function.
 35176  //  **
 35177  //  ** Any quotation marks (ex:  "name", 'name', [name], or `name`) that
 35178  //  ** surround the body of the token are removed.
 35179  //  **
 35180  //  ** Tokens are often just pointers into the original SQL text and so
 35181  //  ** are not \000 terminated and are not persistent.  The returned string
 35182  //  ** is \000 terminated and is persistent.
 35183  //  */
 35184  func _sqlite3NameFromToken(tls *crt.TLS, _db *Xsqlite3, _pName *XToken) (r0 *int8) {
 35185  	var _zName *int8
 35186  	if _pName != nil {
 35187  		_zName = _sqlite3DbStrNDup(tls, _db, _pName.Xz, uint64(_pName.Xn))
 35188  		_sqlite3Dequote(tls, _zName)
 35189  		goto _1
 35190  	}
 35191  	_zName = nil
 35192  _1:
 35193  	return _zName
 35194  }
 35195  
 35196  var _sqlite3SrcListAppendFromTermØ00__func__Ø000 [29]int8
 35197  
 35198  func init() {
 35199  	crt.Xstrncpy(nil, &_sqlite3SrcListAppendFromTermØ00__func__Ø000[0], str(47842), 29)
 35200  }
 35201  
 35202  // C comment
 35203  //  /*
 35204  //  ** Add a new element to the end of an expression list.  If pList is
 35205  //  ** initially NULL, then create a new expression list.
 35206  //  **
 35207  //  ** If a memory allocation error occurs, the entire list is freed and
 35208  //  ** NULL is returned.  If non-NULL is returned, then it is guaranteed
 35209  //  ** that the new entry was successfully appended.
 35210  //  */
 35211  func _sqlite3ExprListAppend(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pExpr *XExpr) (r0 *XExprList) {
 35212  	var _db *Xsqlite3
 35213  	var _3_pNew *XExprList
 35214  	var _pItem *TExprList_item
 35215  	_db = (*Xsqlite3)(_pParse.Xdb)
 35216  	func() {
 35217  		if _db == nil {
 35218  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92370), unsafe.Pointer(&_sqlite3ExprListAppendØ00__func__Ø000), unsafe.Pointer(str(1219)))
 35219  			crt.X__builtin_abort(tls)
 35220  		}
 35221  	}()
 35222  	if _pList != nil {
 35223  		goto _2
 35224  	}
 35225  	_pList = (*XExprList)(_sqlite3DbMallocRawNN(tls, _db, uint64(40)))
 35226  	if _pList == nil {
 35227  		goto _no_mem
 35228  	}
 35229  	_pList.XnExpr = int32(0)
 35230  	_pList.XnAlloc = int32(1)
 35231  	goto _5
 35232  _2:
 35233  	if _pList.XnExpr != _pList.XnAlloc {
 35234  		goto _5
 35235  	}
 35236  	_3_pNew = (*XExprList)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pList), uint64(40)+(uint64((int32(2)*_pList.XnAlloc)-int32(1))*uint64(32))))
 35237  	if _3_pNew == nil {
 35238  		goto _no_mem
 35239  	}
 35240  	_pList = _3_pNew
 35241  	_pList.XnAlloc *= int32(2)
 35242  _5:
 35243  	_pItem = elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(postInc2(&_pList.XnExpr, 1)))
 35244  	crt.Xmemset(tls, unsafe.Pointer(_pItem), int32(0), uint64(32))
 35245  	*(**XExpr)(unsafe.Pointer(&_pItem.XpExpr)) = _pExpr
 35246  	return _pList
 35247  
 35248  _no_mem:
 35249  	_sqlite3ExprDelete(tls, _db, _pExpr)
 35250  	_sqlite3ExprListDelete(tls, _db, _pList)
 35251  	return nil
 35252  }
 35253  
 35254  var _sqlite3ExprListAppendØ00__func__Ø000 [22]int8
 35255  
 35256  func init() {
 35257  	crt.Xstrncpy(nil, &_sqlite3ExprListAppendØ00__func__Ø000[0], str(47871), 22)
 35258  }
 35259  
 35260  // C comment
 35261  //  /*
 35262  //  ** Allocate a new expression node from a zero-terminated token that has
 35263  //  ** already been dequoted.
 35264  //  */
 35265  func _sqlite3Expr(tls *crt.TLS, _db *Xsqlite3, _op int32, _zToken *int8) (r0 *XExpr) {
 35266  	var _x XToken
 35267  	_x.Xz = _zToken
 35268  	_x.Xn = uint32(func() int32 {
 35269  		if _zToken != nil {
 35270  			return _sqlite3Strlen30(tls, _zToken)
 35271  		}
 35272  		return int32(0)
 35273  	}())
 35274  	return _sqlite3ExprAlloc(tls, _db, _op, &_x, int32(0))
 35275  }
 35276  
 35277  // C comment
 35278  //  /*
 35279  //  ** This routine is the core allocator for Expr nodes.
 35280  //  **
 35281  //  ** Construct a new expression node and return a pointer to it.  Memory
 35282  //  ** for this node and for the pToken argument is a single allocation
 35283  //  ** obtained from sqlite3DbMalloc().  The calling function
 35284  //  ** is responsible for making sure the node eventually gets freed.
 35285  //  **
 35286  //  ** If dequote is true, then the token (if it exists) is dequoted.
 35287  //  ** If dequote is false, no dequoting is performed.  The deQuote
 35288  //  ** parameter is ignored if pToken is NULL or if the token does not
 35289  //  ** appear to be quoted.  If the quotes were of the form "..." (double-quotes)
 35290  //  ** then the EP_DblQuoted flag is set on the expression node.
 35291  //  **
 35292  //  ** Special case:  If op==TK_INTEGER and pToken points to a string that
 35293  //  ** can be translated into a 32-bit integer, then the token is not
 35294  //  ** stored in u.zToken.  Instead, the integer values is written
 35295  //  ** into u.iValue and the EP_IntValue flag is set.  No extra storage
 35296  //  ** is allocated to hold the integer text and the dequote flag is ignored.
 35297  //  */
 35298  func _sqlite3ExprAlloc(tls *crt.TLS, _db *Xsqlite3, _op int32, _pToken *XToken, _dequote int32) (r0 *XExpr) {
 35299  	var _nExtra, _iValue int32
 35300  	var _pNew *XExpr
 35301  	_nExtra = int32(0)
 35302  	_iValue = int32(0)
 35303  	func() {
 35304  		if _db == nil {
 35305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91630), unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000), unsafe.Pointer(str(1219)))
 35306  			crt.X__builtin_abort(tls)
 35307  		}
 35308  	}()
 35309  	if _pToken == nil {
 35310  		goto _2
 35311  	}
 35312  	if ((_op != int32(134)) || (_pToken.Xz == nil)) || (_sqlite3GetInt32(tls, _pToken.Xz, &_iValue) == int32(0)) {
 35313  		_nExtra = int32(_pToken.Xn + uint32(1))
 35314  		func() {
 35315  			if _iValue < int32(0) {
 35316  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91635), unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000), unsafe.Pointer(str(47893)))
 35317  				crt.X__builtin_abort(tls)
 35318  			}
 35319  		}()
 35320  	}
 35321  _2:
 35322  	_pNew = (*XExpr)(_sqlite3DbMallocRawNN(tls, _db, uint64(72)+uint64(_nExtra)))
 35323  	if _pNew == nil {
 35324  		goto _8
 35325  	}
 35326  	crt.Xmemset(tls, unsafe.Pointer(_pNew), int32(0), uint64(72))
 35327  	_pNew.Xop = uint8(_op)
 35328  	_pNew.XiAgg = int16(-1)
 35329  	if _pToken == nil {
 35330  		goto _9
 35331  	}
 35332  	if _nExtra == int32(0) {
 35333  		_pNew.Xflags |= uint32(1024)
 35334  		*(*int32)(unsafe.Pointer(&_pNew.Xu)) = _iValue
 35335  		goto _11
 35336  	}
 35337  	*(**int8)(unsafe.Pointer(&_pNew.Xu)) = (*int8)(unsafe.Pointer(elem60(_pNew, uintptr(1))))
 35338  	func() {
 35339  		if _pToken.Xz == nil && _pToken.Xn != (0) {
 35340  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91649), unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000), unsafe.Pointer(str(47903)))
 35341  			crt.X__builtin_abort(tls)
 35342  		}
 35343  	}()
 35344  	if _pToken.Xn != 0 {
 35345  		crt.Xmemcpy(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pNew.Xu))), unsafe.Pointer(_pToken.Xz), uint64(_pToken.Xn))
 35346  	}
 35347  	*elem1(*(**int8)(unsafe.Pointer(&_pNew.Xu)), uintptr(_pToken.Xn)) = 0
 35348  	if _dequote == 0 || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(*(**int8)(unsafe.Pointer(&_pNew.Xu)), 0)))))&int32(128)) == 0 {
 35349  		goto _17
 35350  	}
 35351  	if int32(*elem1(*(**int8)(unsafe.Pointer(&_pNew.Xu)), 0)) == int32(34) {
 35352  		_pNew.Xflags |= uint32(64)
 35353  	}
 35354  	_sqlite3Dequote(tls, *(**int8)(unsafe.Pointer(&_pNew.Xu)))
 35355  _17:
 35356  _11:
 35357  _9:
 35358  	_pNew.XnHeight = int32(1)
 35359  _8:
 35360  	return _pNew
 35361  }
 35362  
 35363  var _sqlite3ExprAllocØ00__func__Ø000 [17]int8
 35364  
 35365  func init() {
 35366  	crt.Xstrncpy(nil, &_sqlite3ExprAllocØ00__func__Ø000[0], str(47932), 17)
 35367  }
 35368  
 35369  var _convertCompoundSelectToSubqueryØ00__func__Ø000 [32]int8
 35370  
 35371  func init() {
 35372  	crt.Xstrncpy(nil, &_convertCompoundSelectToSubqueryØ00__func__Ø000[0], str(47949), 32)
 35373  }
 35374  
 35375  // C comment
 35376  //  /*
 35377  //  ** Call sqlite3WalkExpr() for every expression in Select statement p.
 35378  //  ** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
 35379  //  ** on the compound select chain, p->pPrior.
 35380  //  **
 35381  //  ** If it is not NULL, the xSelectCallback() callback is invoked before
 35382  //  ** the walk of the expressions and FROM clause. The xSelectCallback2()
 35383  //  ** method, if it is not NULL, is invoked following the walk of the
 35384  //  ** expressions and FROM clause.
 35385  //  **
 35386  //  ** Return WRC_Continue under normal conditions.  Return WRC_Abort if
 35387  //  ** there is an abort request.
 35388  //  **
 35389  //  ** If the Walker does not have an xSelectCallback() then this routine
 35390  //  ** is a no-op returning WRC_Continue.
 35391  //  */
 35392  func _sqlite3WalkSelect(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 35393  	var _rc int32
 35394  	if (_p == nil) || ((func() func(*crt.TLS, *XWalker, *XSelect) int32 {
 35395  		v := _pWalker.XxSelectCallback
 35396  		return *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&v))
 35397  	}() == nil) && (func() func(*crt.TLS, *XWalker, *XSelect) {
 35398  		v := _pWalker.XxSelectCallback2
 35399  		return *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&v))
 35400  	}() == nil)) {
 35401  		return int32(0)
 35402  	}
 35403  	_rc = int32(0)
 35404  	_pWalker.XwalkerDepth += 1
 35405  _3:
 35406  	if _p == nil {
 35407  		goto _4
 35408  	}
 35409  	if _pWalker.XxSelectCallback == nil {
 35410  		goto _5
 35411  	}
 35412  	_rc = func() func(*crt.TLS, *XWalker, *XSelect) int32 {
 35413  		v := _pWalker.XxSelectCallback
 35414  		return *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&v))
 35415  	}()(tls, _pWalker, _p)
 35416  	if _rc != 0 {
 35417  		goto _4
 35418  	}
 35419  _5:
 35420  	if _sqlite3WalkSelectExpr(tls, _pWalker, _p) != 0 || _sqlite3WalkSelectFrom(tls, _pWalker, _p) != 0 {
 35421  		_pWalker.XwalkerDepth -= 1
 35422  		return int32(2)
 35423  	}
 35424  	if _pWalker.XxSelectCallback2 != nil {
 35425  		func() func(*crt.TLS, *XWalker, *XSelect) {
 35426  			v := _pWalker.XxSelectCallback2
 35427  			return *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&v))
 35428  		}()(tls, _pWalker, _p)
 35429  	}
 35430  	_p = (*XSelect)(_p.XpPrior)
 35431  	goto _3
 35432  _4:
 35433  	_pWalker.XwalkerDepth -= 1
 35434  	return _rc & int32(2)
 35435  }
 35436  
 35437  // C comment
 35438  //  /*
 35439  //  ** Walk all expressions associated with SELECT statement p.  Do
 35440  //  ** not invoke the SELECT callback on p, but do (of course) invoke
 35441  //  ** any expr callbacks and SELECT callbacks that come from subqueries.
 35442  //  ** Return WRC_Abort or WRC_Continue.
 35443  //  */
 35444  func _sqlite3WalkSelectExpr(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 35445  	if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(_p.XpEList)) != 0 {
 35446  		return int32(2)
 35447  	}
 35448  	if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.XpWhere)) != 0 {
 35449  		return int32(2)
 35450  	}
 35451  	if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(_p.XpGroupBy)) != 0 {
 35452  		return int32(2)
 35453  	}
 35454  	if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.XpHaving)) != 0 {
 35455  		return int32(2)
 35456  	}
 35457  	if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(_p.XpOrderBy)) != 0 {
 35458  		return int32(2)
 35459  	}
 35460  	if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.XpLimit)) != 0 {
 35461  		return int32(2)
 35462  	}
 35463  	if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.XpOffset)) != 0 {
 35464  		return int32(2)
 35465  	}
 35466  	return int32(0)
 35467  }
 35468  
 35469  // C comment
 35470  //  /*
 35471  //  ** Call sqlite3WalkExpr() for every expression in list p or until
 35472  //  ** an abort request is seen.
 35473  //  */
 35474  func _sqlite3WalkExprList(tls *crt.TLS, _pWalker *XWalker, _p *XExprList) (r0 int32) {
 35475  	var _i int32
 35476  	var _pItem *TExprList_item
 35477  	if _p == nil {
 35478  		goto _0
 35479  	}
 35480  	*func() **TExprList_item { _i = _p.XnExpr; return &_pItem }() = (*TExprList_item)(unsafe.Pointer(&_p.Xa))
 35481  _1:
 35482  	if _i <= int32(0) {
 35483  		goto _4
 35484  	}
 35485  	if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_pItem.XpExpr)) != 0 {
 35486  		return int32(2)
 35487  	}
 35488  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i -= 1; return &_pItem }())) += uintptr(32)
 35489  	goto _1
 35490  _4:
 35491  _0:
 35492  	return int32(0)
 35493  }
 35494  
 35495  // C comment
 35496  //  /* Forward declarations */
 35497  func _sqlite3WalkExpr(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 35498  	return func() int32 {
 35499  		if _pExpr != nil {
 35500  			return _walkExpr(tls, _pWalker, _pExpr)
 35501  		}
 35502  		return int32(0)
 35503  	}()
 35504  }
 35505  
 35506  // C comment
 35507  //  /*
 35508  //  ** Walk an expression tree.  Invoke the callback once for each node
 35509  //  ** of the expression, while descending.  (In other words, the callback
 35510  //  ** is invoked before visiting children.)
 35511  //  **
 35512  //  ** The return value from the callback should be one of the WRC_*
 35513  //  ** constants to specify how to proceed with the walk.
 35514  //  **
 35515  //  **    WRC_Continue      Continue descending down the tree.
 35516  //  **
 35517  //  **    WRC_Prune         Do not descend into child nodes, but allow
 35518  //  **                      the walk to continue with sibling nodes.
 35519  //  **
 35520  //  **    WRC_Abort         Do no more callbacks.  Unwind the stack and
 35521  //  **                      return from the top-level walk call.
 35522  //  **
 35523  //  ** The return value from this routine is WRC_Abort to abandon the tree walk
 35524  //  ** and WRC_Continue to continue.
 35525  //  */
 35526  func _walkExpr(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 35527  	var _rc int32
 35528  	_rc = func() func(*crt.TLS, *XWalker, *XExpr) int32 {
 35529  		v := _pWalker.XxExprCallback
 35530  		return *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&v))
 35531  	}()(tls, _pWalker, _pExpr)
 35532  	if _rc != 0 || ((_pExpr.Xflags & uint32(8404992)) != (0)) {
 35533  		return _rc & int32(2)
 35534  	}
 35535  	if (_pExpr.XpLeft != nil) && _walkExpr(tls, _pWalker, (*XExpr)(_pExpr.XpLeft)) != 0 {
 35536  		return int32(2)
 35537  	}
 35538  	if (_pExpr.XpRight != nil) && _walkExpr(tls, _pWalker, (*XExpr)(_pExpr.XpRight)) != 0 {
 35539  		return int32(2)
 35540  	}
 35541  	if (_pExpr.Xflags & uint32(2048)) == (0) {
 35542  		goto _6
 35543  	}
 35544  	if _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))) != 0 {
 35545  		return int32(2)
 35546  	}
 35547  	goto _9
 35548  _6:
 35549  	if (*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) == nil {
 35550  		goto _9
 35551  	}
 35552  	if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))) != 0 {
 35553  		return int32(2)
 35554  	}
 35555  _9:
 35556  	return int32(0)
 35557  }
 35558  
 35559  // C comment
 35560  //  /*
 35561  //  ** Walk the parse trees associated with all subqueries in the
 35562  //  ** FROM clause of SELECT statement p.  Do not invoke the select
 35563  //  ** callback on p, but do invoke it on each FROM clause subquery
 35564  //  ** and on any subqueries further down in the tree.  Return
 35565  //  ** WRC_Abort or WRC_Continue;
 35566  //  */
 35567  func _sqlite3WalkSelectFrom(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 35568  	var _i int32
 35569  	var _pSrc *XSrcList
 35570  	var _pItem *TSrcList_item
 35571  	_pSrc = (*XSrcList)(_p.XpSrc)
 35572  	if func() int32 {
 35573  		if _pSrc != nil {
 35574  			return int32(1)
 35575  		}
 35576  		return func() int32 {
 35577  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89291), unsafe.Pointer(&_sqlite3WalkSelectFromØ00__func__Ø000), unsafe.Pointer(str(4809)))
 35578  			crt.X__builtin_abort(tls)
 35579  			return int32(0)
 35580  		}()
 35581  	}() == 0 {
 35582  		goto _2
 35583  	}
 35584  	*func() **TSrcList_item { _i = _pSrc.XnSrc; return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa))
 35585  _3:
 35586  	if _i <= int32(0) {
 35587  		goto _6
 35588  	}
 35589  	if _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(_pItem.XpSelect)) != 0 {
 35590  		return int32(2)
 35591  	}
 35592  	if (((uint32((_pItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0) && _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pItem.Xu1)))) != 0 {
 35593  		return int32(2)
 35594  	}
 35595  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i -= 1; return &_pItem }())) += uintptr(112)
 35596  	goto _3
 35597  _6:
 35598  _2:
 35599  	return int32(0)
 35600  }
 35601  
 35602  var _sqlite3WalkSelectFromØ00__func__Ø000 [22]int8
 35603  
 35604  func init() {
 35605  	crt.Xstrncpy(nil, &_sqlite3WalkSelectFromØ00__func__Ø000[0], str(47981), 22)
 35606  }
 35607  
 35608  // C comment
 35609  //  /*
 35610  //  ** This routine is a Walker callback for "expanding" a SELECT statement.
 35611  //  ** "Expanding" means to do the following:
 35612  //  **
 35613  //  **    (1)  Make sure VDBE cursor numbers have been assigned to every
 35614  //  **         element of the FROM clause.
 35615  //  **
 35616  //  **    (2)  Fill in the pTabList->a[].pTab fields in the SrcList that
 35617  //  **         defines FROM clause.  When views appear in the FROM clause,
 35618  //  **         fill pTabList->a[].pSelect with a copy of the SELECT statement
 35619  //  **         that implements the view.  A copy is made of the view's SELECT
 35620  //  **         statement so that we can freely modify or delete that statement
 35621  //  **         without worrying about messing up the persistent representation
 35622  //  **         of the view.
 35623  //  **
 35624  //  **    (3)  Add terms to the WHERE clause to accommodate the NATURAL keyword
 35625  //  **         on joins and the ON and USING clause of joins.
 35626  //  **
 35627  //  **    (4)  Scan the list of columns in the result set (pEList) looking
 35628  //  **         for instances of the "*" operator or the TABLE.* operator.
 35629  //  **         If found, expand each "*" to be every column in every table
 35630  //  **         and TABLE.* to be every column in TABLE.
 35631  //  **
 35632  //  */
 35633  func _selectExpander(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 35634  	var _11_nCol int16
 35635  	var _i, _j, _k, _15_flags, _15_longNames, _19_tableSeen, _21_iDb int32
 35636  	var _19_zTName, _21_zTabName, _21_zSchemaName, _25_zName, _25_zColname, _25_zToFree *int8
 35637  	var _selFlags uint16
 35638  	var _25_sColname XToken
 35639  	var _db *Xsqlite3
 35640  	var _4_pTab, _21_pTab *XTable
 35641  	var _pTabList *XSrcList
 35642  	var _pFrom *TSrcList_item
 35643  	var _pEList, _15_pNew *XExprList
 35644  	var _15_a, _35_pX *TExprList_item
 35645  	var _6_pSel, _21_pSub *XSelect
 35646  	var _pE, _pRight, _pExpr, _31_pLeft *XExpr
 35647  	var _pParse *XParse
 35648  	_pParse = (*XParse)(_pWalker.XpParse)
 35649  	_db = (*Xsqlite3)(_pParse.Xdb)
 35650  	_selFlags = uint16(_p.XselFlags)
 35651  	_p.XselFlags |= uint32(64)
 35652  	if _db.XmallocFailed != 0 {
 35653  		return int32(2)
 35654  	}
 35655  	if func() int32 {
 35656  		if (*XSrcList)(_p.XpSrc) == nil {
 35657  			return func() int32 {
 35658  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120864), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(4809)))
 35659  				crt.X__builtin_abort(tls)
 35660  				return int32(1)
 35661  			}()
 35662  		}
 35663  		return int32(0)
 35664  	}() != 0 || ((int32(_selFlags) & int32(64)) != int32(0)) {
 35665  		return int32(1)
 35666  	}
 35667  	_pTabList = (*XSrcList)(_p.XpSrc)
 35668  	_pEList = (*XExprList)(_p.XpEList)
 35669  	if _p.XpWith != nil {
 35670  		_sqlite3WithPush(tls, _pParse, (*XWith)(_p.XpWith), 0)
 35671  	}
 35672  	_sqlite3SrcListAssignCursors(tls, _pParse, _pTabList)
 35673  	*func() **TSrcList_item { _i = int32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa))
 35674  _6:
 35675  	if _i >= _pTabList.XnSrc {
 35676  		goto _9
 35677  	}
 35678  	func() {
 35679  		if int32((uint32((_pFrom.Xfg.XnotIndexed)>>5)<<31)>>31) != int32(0) && (*XTable)(_pFrom.XpTab) == nil {
 35680  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120884), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48003)))
 35681  			crt.X__builtin_abort(tls)
 35682  		}
 35683  	}()
 35684  	if ((uint32((_pFrom.Xfg.XnotIndexed)>>5) << 31) >> 31) != 0 {
 35685  		goto _7
 35686  	}
 35687  	func() {
 35688  		if (*XTable)(_pFrom.XpTab) != nil {
 35689  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120886), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48046)))
 35690  			crt.X__builtin_abort(tls)
 35691  		}
 35692  	}()
 35693  	if _withExpand(tls, _pWalker, _pFrom) != 0 {
 35694  		return int32(2)
 35695  	}
 35696  	if _pFrom.XpTab != nil {
 35697  		goto _30
 35698  	}
 35699  	if _pFrom.XzName != nil {
 35700  		goto _19
 35701  	}
 35702  	_6_pSel = (*XSelect)(_pFrom.XpSelect)
 35703  	func() {
 35704  		if _6_pSel == nil {
 35705  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120895), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48061)))
 35706  			crt.X__builtin_abort(tls)
 35707  		}
 35708  	}()
 35709  	func() {
 35710  		if (*XTable)(_pFrom.XpTab) != nil {
 35711  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120896), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48046)))
 35712  			crt.X__builtin_abort(tls)
 35713  		}
 35714  	}()
 35715  	if _sqlite3WalkSelect(tls, _pWalker, _6_pSel) != 0 {
 35716  		return int32(2)
 35717  	}
 35718  	*(**XTable)(unsafe.Pointer(&_pFrom.XpTab)) = store74(&_4_pTab, (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(128))))
 35719  	if _4_pTab == nil {
 35720  		return int32(2)
 35721  	}
 35722  	_4_pTab.XnTabRef = uint32(1)
 35723  	_4_pTab.XzName = _sqlite3MPrintf(tls, _db, str(48069), unsafe.Pointer(_4_pTab))
 35724  _26:
 35725  	if _6_pSel.XpPrior != nil {
 35726  		_6_pSel = (*XSelect)(_6_pSel.XpPrior)
 35727  		goto _26
 35728  	}
 35729  	_sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_6_pSel.XpEList), &_4_pTab.XnCol, (**XColumn)(unsafe.Pointer(&_4_pTab.XaCol)))
 35730  	_4_pTab.XiPKey = int16(-1)
 35731  	_4_pTab.XnRowLogEst = int16(200)
 35732  	func() {
 35733  		if int32(200) != int32(_sqlite3LogEst(tls, uint64(1048576))) {
 35734  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120905), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48082)))
 35735  			crt.X__builtin_abort(tls)
 35736  		}
 35737  	}()
 35738  	_4_pTab.XtabFlags |= uint32(2)
 35739  	goto _30
 35740  _19:
 35741  	func() {
 35742  		if (*XTable)(_pFrom.XpTab) != nil {
 35743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120910), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48046)))
 35744  			crt.X__builtin_abort(tls)
 35745  		}
 35746  	}()
 35747  	*(**XTable)(unsafe.Pointer(&_pFrom.XpTab)) = store74(&_4_pTab, _sqlite3LocateTableItem(tls, _pParse, 0, _pFrom))
 35748  	if _4_pTab == nil {
 35749  		return int32(2)
 35750  	}
 35751  	if _4_pTab.XnTabRef >= uint32(65535) {
 35752  		_sqlite3ErrorMsg(tls, _pParse, str(48110), unsafe.Pointer(_4_pTab.XzName))
 35753  		*(**XTable)(unsafe.Pointer(&_pFrom.XpTab)) = nil
 35754  		return int32(2)
 35755  	}
 35756  	_4_pTab.XnTabRef += 1
 35757  	if (_4_pTab.XnModuleArg == 0) && _cannotBeFunction(tls, _pParse, _pFrom) != 0 {
 35758  		return int32(2)
 35759  	}
 35760  	if _4_pTab.XnModuleArg == 0 && _4_pTab.XpSelect == nil {
 35761  		goto _38
 35762  	}
 35763  	if _sqlite3ViewGetColumnNames(tls, _pParse, _4_pTab) != 0 {
 35764  		return int32(2)
 35765  	}
 35766  	func() {
 35767  		if (*XSelect)(_pFrom.XpSelect) != nil {
 35768  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120927), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48149)))
 35769  			crt.X__builtin_abort(tls)
 35770  		}
 35771  	}()
 35772  	*(**XSelect)(unsafe.Pointer(&_pFrom.XpSelect)) = _sqlite3SelectDup(tls, _db, (*XSelect)(_4_pTab.XpSelect), int32(0))
 35773  	_sqlite3SelectSetName(tls, (*XSelect)(_pFrom.XpSelect), _4_pTab.XzName)
 35774  	_11_nCol = _4_pTab.XnCol
 35775  	_4_pTab.XnCol = int16(-1)
 35776  	_sqlite3WalkSelect(tls, _pWalker, (*XSelect)(_pFrom.XpSelect))
 35777  	_4_pTab.XnCol = _11_nCol
 35778  _38:
 35779  _30:
 35780  	if _sqlite3IndexedByLookup(tls, _pParse, _pFrom) != 0 {
 35781  		return int32(2)
 35782  	}
 35783  _7:
 35784  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pFrom }())) += uintptr(112)
 35785  	goto _6
 35786  _9:
 35787  	if (_db.XmallocFailed != 0) || _sqliteProcessJoin(tls, _pParse, _p) != 0 {
 35788  		return int32(2)
 35789  	}
 35790  	_k = int32(0)
 35791  _45:
 35792  	if _k >= _pEList.XnExpr {
 35793  		goto _48
 35794  	}
 35795  	_pE = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_k)).XpExpr)
 35796  	if int32(_pE.Xop) == int32(161) {
 35797  		goto _48
 35798  	}
 35799  	func() {
 35800  		if int32(_pE.Xop) == int32(122) && (*XExpr)(_pE.XpRight) == nil {
 35801  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120964), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48167)))
 35802  			crt.X__builtin_abort(tls)
 35803  		}
 35804  	}()
 35805  	func() {
 35806  		if int32(_pE.Xop) == int32(122) && ((*XExpr)(_pE.XpLeft) == nil || int32((*XExpr)(_pE.XpLeft).Xop) != int32(27)) {
 35807  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120965), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48199)))
 35808  			crt.X__builtin_abort(tls)
 35809  		}
 35810  	}()
 35811  	if (int32(_pE.Xop) == int32(122)) && (int32((*XExpr)(_pE.XpRight).Xop) == int32(161)) {
 35812  		goto _48
 35813  	}
 35814  	_k += 1
 35815  	goto _45
 35816  _48:
 35817  	if _k >= _pEList.XnExpr {
 35818  		goto _59
 35819  	}
 35820  	_15_a = (*TExprList_item)(unsafe.Pointer(&_pEList.Xa))
 35821  	_15_pNew = nil
 35822  	_15_flags = (*Xsqlite3)(_pParse.Xdb).Xflags
 35823  	_15_longNames = bool2int(((_15_flags & int32(4)) != int32(0)) && ((_15_flags & int32(64)) == int32(0)))
 35824  	_k = int32(0)
 35825  _61:
 35826  	if _k >= _pEList.XnExpr {
 35827  		goto _64
 35828  	}
 35829  	_pE = (*XExpr)(elem59(_15_a, uintptr(_k)).XpExpr)
 35830  	_pRight = (*XExpr)(_pE.XpRight)
 35831  	func() {
 35832  		if int32(_pE.Xop) == int32(122) && _pRight == nil {
 35833  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120983), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48256)))
 35834  			crt.X__builtin_abort(tls)
 35835  		}
 35836  	}()
 35837  	if int32(_pE.Xop) == int32(161) || int32(_pE.Xop) == int32(122) && int32(_pRight.Xop) == int32(161) {
 35838  		goto _70
 35839  	}
 35840  	_15_pNew = _sqlite3ExprListAppend(tls, _pParse, _15_pNew, (*XExpr)(elem59(_15_a, uintptr(_k)).XpExpr))
 35841  	if _15_pNew != nil {
 35842  		elem59((*TExprList_item)(unsafe.Pointer(&_15_pNew.Xa)), uintptr(_15_pNew.XnExpr-int32(1))).XzName = elem59(_15_a, uintptr(_k)).XzName
 35843  		elem59((*TExprList_item)(unsafe.Pointer(&_15_pNew.Xa)), uintptr(_15_pNew.XnExpr-int32(1))).XzSpan = elem59(_15_a, uintptr(_k)).XzSpan
 35844  		elem59(_15_a, uintptr(_k)).XzName = nil
 35845  		elem59(_15_a, uintptr(_k)).XzSpan = nil
 35846  	}
 35847  	*(**XExpr)(unsafe.Pointer(&(elem59(_15_a, uintptr(_k)).XpExpr))) = nil
 35848  	goto _72
 35849  _70:
 35850  	_19_tableSeen = int32(0)
 35851  	_19_zTName = nil
 35852  	if int32(_pE.Xop) == int32(122) {
 35853  		func() {
 35854  			if (*XExpr)(_pE.XpLeft) == nil {
 35855  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121003), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48284)))
 35856  				crt.X__builtin_abort(tls)
 35857  			}
 35858  		}()
 35859  		func() {
 35860  			if (((*XExpr)(_pE.XpLeft).Xflags) & uint32(1024)) != (0) {
 35861  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121004), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48297)))
 35862  				crt.X__builtin_abort(tls)
 35863  			}
 35864  		}()
 35865  		_19_zTName = *(**int8)(unsafe.Pointer(&((*XExpr)(_pE.XpLeft).Xu)))
 35866  	}
 35867  	*func() **TSrcList_item { _i = int32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa))
 35868  _78:
 35869  	if _i >= _pTabList.XnSrc {
 35870  		goto _81
 35871  	}
 35872  	_21_pTab = (*XTable)(_pFrom.XpTab)
 35873  	_21_pSub = (*XSelect)(_pFrom.XpSelect)
 35874  	_21_zTabName = _pFrom.XzAlias
 35875  	_21_zSchemaName = nil
 35876  	if _21_zTabName == nil {
 35877  		_21_zTabName = _21_pTab.XzName
 35878  	}
 35879  	if _db.XmallocFailed != 0 {
 35880  		goto _81
 35881  	}
 35882  	if _21_pSub != nil && (_21_pSub.XselFlags&uint32(2048)) != (0) {
 35883  		goto _85
 35884  	}
 35885  	_21_pSub = nil
 35886  	if (_19_zTName != nil) && (_sqlite3StrICmp(tls, _19_zTName, _21_zTabName) != int32(0)) {
 35887  		goto _79
 35888  	}
 35889  	_21_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_21_pTab.XpSchema))
 35890  	_21_zSchemaName = func() *int8 {
 35891  		if _21_iDb >= int32(0) {
 35892  			return (elem27((*XDb)(_db.XaDb), uintptr(_21_iDb)).XzDbSName)
 35893  		}
 35894  		return str(48338)
 35895  	}()
 35896  _85:
 35897  	_j = int32(0)
 35898  _90:
 35899  	if _j >= int32(_21_pTab.XnCol) {
 35900  		goto _93
 35901  	}
 35902  	_25_zName = elem43((*XColumn)(_21_pTab.XaCol), uintptr(_j)).XzName
 35903  	func() {
 35904  		if _25_zName == nil {
 35905  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121031), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48340)))
 35906  			crt.X__builtin_abort(tls)
 35907  		}
 35908  	}()
 35909  	if ((_19_zTName != nil) && (_21_pSub != nil)) && (_sqlite3MatchSpanName(tls, elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_21_pSub.XpEList).Xa))), uintptr(_j)).XzSpan, nil, _19_zTName, nil) == int32(0)) {
 35910  		goto _91
 35911  	}
 35912  	if ((_p.XselFlags & uint32(131072)) == (0)) && ((int32(elem43((*XColumn)(_21_pTab.XaCol), uintptr(_j)).XcolFlags) & int32(2)) != int32(0)) {
 35913  		goto _91
 35914  	}
 35915  	_19_tableSeen = int32(1)
 35916  	if _i <= int32(0) || _19_zTName != nil {
 35917  		goto _102
 35918  	}
 35919  	if ((int32(_pFrom.Xfg.Xjointype) & int32(4)) != int32(0)) && _tableAndColumnIndex(tls, _pTabList, _i, _25_zName, nil, nil) != 0 {
 35920  		goto _91
 35921  	}
 35922  	if _sqlite3IdListIndex(tls, (*XIdList)(_pFrom.XpUsing), _25_zName) >= int32(0) {
 35923  		goto _91
 35924  	}
 35925  _102:
 35926  	_pRight = _sqlite3Expr(tls, _db, int32(27), _25_zName)
 35927  	_25_zColname = _25_zName
 35928  	_25_zToFree = nil
 35929  	if _15_longNames == 0 && _pTabList.XnSrc <= int32(1) {
 35930  		goto _107
 35931  	}
 35932  	_31_pLeft = _sqlite3Expr(tls, _db, int32(27), _21_zTabName)
 35933  	_pExpr = _sqlite3PExpr(tls, _pParse, int32(122), _31_pLeft, _pRight)
 35934  	if _21_zSchemaName != nil {
 35935  		_31_pLeft = _sqlite3Expr(tls, _db, int32(27), _21_zSchemaName)
 35936  		_pExpr = _sqlite3PExpr(tls, _pParse, int32(122), _31_pLeft, _pExpr)
 35937  	}
 35938  	if _15_longNames != 0 {
 35939  		_25_zColname = _sqlite3MPrintf(tls, _db, str(7919), unsafe.Pointer(_21_zTabName), unsafe.Pointer(_25_zName))
 35940  		_25_zToFree = _25_zColname
 35941  	}
 35942  	goto _110
 35943  _107:
 35944  	_pExpr = _pRight
 35945  _110:
 35946  	_15_pNew = _sqlite3ExprListAppend(tls, _pParse, _15_pNew, _pExpr)
 35947  	_sqlite3TokenInit(tls, &_25_sColname, _25_zColname)
 35948  	_sqlite3ExprListSetName(tls, _pParse, _15_pNew, &_25_sColname, int32(0))
 35949  	if _15_pNew == nil || (_p.XselFlags&uint32(2048)) == (0) {
 35950  		goto _112
 35951  	}
 35952  	_35_pX = elem59((*TExprList_item)(unsafe.Pointer(&_15_pNew.Xa)), uintptr(_15_pNew.XnExpr-int32(1)))
 35953  	if _21_pSub != nil {
 35954  		_35_pX.XzSpan = _sqlite3DbStrDup(tls, _db, elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_21_pSub.XpEList).Xa))), uintptr(_j)).XzSpan)
 35955  		goto _114
 35956  	}
 35957  	_35_pX.XzSpan = _sqlite3MPrintf(tls, _db, str(48346), unsafe.Pointer(_21_zSchemaName), unsafe.Pointer(_21_zTabName), unsafe.Pointer(_25_zColname))
 35958  _114:
 35959  	storebits5(&_35_pX.Xdone, int8(1), 2, 1)
 35960  _112:
 35961  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_25_zToFree))
 35962  _91:
 35963  	_j += 1
 35964  	goto _90
 35965  _93:
 35966  _79:
 35967  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pFrom }())) += uintptr(112)
 35968  	goto _78
 35969  _81:
 35970  	if _19_tableSeen != 0 {
 35971  		goto _115
 35972  	}
 35973  	if _19_zTName != nil {
 35974  		_sqlite3ErrorMsg(tls, _pParse, str(48355), unsafe.Pointer(_19_zTName))
 35975  		goto _117
 35976  	}
 35977  	_sqlite3ErrorMsg(tls, _pParse, str(48373))
 35978  _117:
 35979  _115:
 35980  _72:
 35981  	_k += 1
 35982  	goto _61
 35983  _64:
 35984  	_sqlite3ExprListDelete(tls, _db, _pEList)
 35985  	*(**XExprList)(unsafe.Pointer(&_p.XpEList)) = _15_pNew
 35986  _59:
 35987  	if (_p.XpEList != nil) && (((*XExprList)(_p.XpEList).XnExpr) > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(2)))) {
 35988  		_sqlite3ErrorMsg(tls, _pParse, str(48393))
 35989  		return int32(2)
 35990  	}
 35991  	return int32(0)
 35992  }
 35993  
 35994  var _selectExpanderØ00__func__Ø000 [15]int8
 35995  
 35996  func init() {
 35997  	crt.Xstrncpy(nil, &_selectExpanderØ00__func__Ø000[0], str(48424), 15)
 35998  }
 35999  
 36000  // C comment
 36001  //  /* The code generator maintains a stack of active WITH clauses
 36002  //  ** with the inner-most WITH clause being at the top of the stack.
 36003  //  **
 36004  //  ** This routine pushes the WITH clause passed as the second argument
 36005  //  ** onto the top of the stack. If argument bFree is true, then this
 36006  //  ** WITH clause will never be popped from the stack. In this case it
 36007  //  ** should be freed along with the Parse object. In other cases, when
 36008  //  ** bFree==0, the With object will be freed along with the SELECT
 36009  //  ** statement with which it is associated.
 36010  //  */
 36011  func _sqlite3WithPush(tls *crt.TLS, _pParse *XParse, _pWith *XWith, _bFree uint8) {
 36012  	func() {
 36013  		if int32(_bFree) != int32(0) && ((*XWith)(_pParse.XpWith) != nil || (*XWith)(_pParse.XpWithToFree) != nil) {
 36014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120664), unsafe.Pointer(&_sqlite3WithPushØ00__func__Ø000), unsafe.Pointer(str(48439)))
 36015  			crt.X__builtin_abort(tls)
 36016  		}
 36017  	}()
 36018  	if _pWith == nil {
 36019  		goto _4
 36020  	}
 36021  	func() {
 36022  		if (*XWith)(_pParse.XpWith) == _pWith {
 36023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120666), unsafe.Pointer(&_sqlite3WithPushØ00__func__Ø000), unsafe.Pointer(str(48496)))
 36024  			crt.X__builtin_abort(tls)
 36025  		}
 36026  	}()
 36027  	*(**XWith)(unsafe.Pointer(&_pWith.XpOuter)) = (*XWith)(_pParse.XpWith)
 36028  	*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = _pWith
 36029  	if _bFree != 0 {
 36030  		*(**XWith)(unsafe.Pointer(&_pParse.XpWithToFree)) = _pWith
 36031  	}
 36032  _4:
 36033  }
 36034  
 36035  var _sqlite3WithPushØ00__func__Ø000 [16]int8
 36036  
 36037  func init() {
 36038  	crt.Xstrncpy(nil, &_sqlite3WithPushØ00__func__Ø000[0], str(48517), 16)
 36039  }
 36040  
 36041  // C comment
 36042  //  /*
 36043  //  ** Assign VdbeCursor index numbers to all tables in a SrcList
 36044  //  */
 36045  func _sqlite3SrcListAssignCursors(tls *crt.TLS, _pParse *XParse, _pList *XSrcList) {
 36046  	var _i int32
 36047  	var _pItem *TSrcList_item
 36048  	func() {
 36049  		if _pList == nil && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 36050  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103482), unsafe.Pointer(&_sqlite3SrcListAssignCursorsØ00__func__Ø000), unsafe.Pointer(str(48533)))
 36051  			crt.X__builtin_abort(tls)
 36052  		}
 36053  	}()
 36054  	if _pList == nil {
 36055  		goto _3
 36056  	}
 36057  	*func() **TSrcList_item { _i = int32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_pList.Xa))
 36058  _4:
 36059  	if _i >= _pList.XnSrc {
 36060  		goto _7
 36061  	}
 36062  	if _pItem.XiCursor >= int32(0) {
 36063  		goto _7
 36064  	}
 36065  	_pItem.XiCursor = postInc2(&_pParse.XnTab, 1)
 36066  	if _pItem.XpSelect != nil {
 36067  		_sqlite3SrcListAssignCursors(tls, _pParse, (*XSrcList)((*XSelect)(_pItem.XpSelect).XpSrc))
 36068  	}
 36069  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(112)
 36070  	goto _4
 36071  _7:
 36072  _3:
 36073  }
 36074  
 36075  var _sqlite3SrcListAssignCursorsØ00__func__Ø000 [28]int8
 36076  
 36077  func init() {
 36078  	crt.Xstrncpy(nil, &_sqlite3SrcListAssignCursorsØ00__func__Ø000[0], str(48567), 28)
 36079  }
 36080  
 36081  // C comment
 36082  //  /*
 36083  //  ** This function checks if argument pFrom refers to a CTE declared by
 36084  //  ** a WITH clause on the stack currently maintained by the parser. And,
 36085  //  ** if currently processing a CTE expression, if it is a recursive
 36086  //  ** reference to the current CTE.
 36087  //  **
 36088  //  ** If pFrom falls into either of the two categories above, pFrom->pTab
 36089  //  ** and other fields are populated accordingly. The caller should check
 36090  //  ** (pFrom->pTab!=0) to determine whether or not a successful match
 36091  //  ** was found.
 36092  //  **
 36093  //  ** Whether or not a match is found, SQLITE_OK is returned if no error
 36094  //  ** occurs. If an error does occur, an error message is stored in the
 36095  //  ** parser and some error code other than SQLITE_OK returned.
 36096  //  */
 36097  func _withExpand(tls *crt.TLS, _pWalker *XWalker, _pFrom *TSrcList_item) (r0 int32) {
 36098  	var _1_bMayRecursive, _3_i int32
 36099  	var _db *Xsqlite3
 36100  	var _1_pTab *XTable
 36101  	var _3_pSrc *XSrcList
 36102  	var _4_pItem *TSrcList_item
 36103  	var _pWith, _1_pSavedWith *XWith
 36104  	var _pCte *TCte
 36105  	var _1_pEList *XExprList
 36106  	var _1_pSel, _1_pLeft, _7_pPrior *XSelect
 36107  	var _pParse *XParse
 36108  	_pParse = (*XParse)(_pWalker.XpParse)
 36109  	_db = (*Xsqlite3)(_pParse.Xdb)
 36110  	func() {
 36111  		if (*XTable)(_pFrom.XpTab) != nil {
 36112  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120697), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48046)))
 36113  			crt.X__builtin_abort(tls)
 36114  		}
 36115  	}()
 36116  	_pCte = _searchWith(tls, (*XWith)(_pParse.XpWith), _pFrom, &_pWith)
 36117  	if _pCte == nil {
 36118  		goto _2
 36119  	}
 36120  	if _pCte.XzCteErr != nil {
 36121  		_sqlite3ErrorMsg(tls, _pParse, _pCte.XzCteErr, unsafe.Pointer(_pCte.XzName))
 36122  		return int32(1)
 36123  	}
 36124  	if _cannotBeFunction(tls, _pParse, _pFrom) != 0 {
 36125  		return int32(1)
 36126  	}
 36127  	func() {
 36128  		if (*XTable)(_pFrom.XpTab) != nil {
 36129  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120718), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48046)))
 36130  			crt.X__builtin_abort(tls)
 36131  		}
 36132  	}()
 36133  	*(**XTable)(unsafe.Pointer(&_pFrom.XpTab)) = store74(&_1_pTab, (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(128))))
 36134  	if _1_pTab == nil {
 36135  		return int32(2)
 36136  	}
 36137  	_1_pTab.XnTabRef = uint32(1)
 36138  	_1_pTab.XzName = _sqlite3DbStrDup(tls, _db, _pCte.XzName)
 36139  	_1_pTab.XiPKey = int16(-1)
 36140  	_1_pTab.XnRowLogEst = int16(200)
 36141  	func() {
 36142  		if int32(200) != int32(_sqlite3LogEst(tls, uint64(1048576))) {
 36143  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120724), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48082)))
 36144  			crt.X__builtin_abort(tls)
 36145  		}
 36146  	}()
 36147  	_1_pTab.XtabFlags |= uint32(66)
 36148  	*(**XSelect)(unsafe.Pointer(&_pFrom.XpSelect)) = _sqlite3SelectDup(tls, _db, (*XSelect)(_pCte.XpSelect), int32(0))
 36149  	if _db.XmallocFailed != 0 {
 36150  		return _sqlite3NomemError(tls, int32(120727))
 36151  	}
 36152  	func() {
 36153  		if _pFrom.XpSelect == nil {
 36154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120728), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48595)))
 36155  			crt.X__builtin_abort(tls)
 36156  		}
 36157  	}()
 36158  	_1_pSel = (*XSelect)(_pFrom.XpSelect)
 36159  	_1_bMayRecursive = bool2int((int32(_1_pSel.Xop) == int32(116)) || (int32(_1_pSel.Xop) == int32(115)))
 36160  	if _1_bMayRecursive == 0 {
 36161  		goto _14
 36162  	}
 36163  	_3_pSrc = (*XSrcList)((*XSelect)(_pFrom.XpSelect).XpSrc)
 36164  	_3_i = int32(0)
 36165  _15:
 36166  	if _3_i >= _3_pSrc.XnSrc {
 36167  		goto _18
 36168  	}
 36169  	_4_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_3_pSrc.Xa)), uintptr(_3_i))
 36170  	if ((_4_pItem.XzDatabase == nil) && (_4_pItem.XzName != nil)) && (int32(0) == _sqlite3StrICmp(tls, _4_pItem.XzName, _pCte.XzName)) {
 36171  		*(**XTable)(unsafe.Pointer(&_4_pItem.XpTab)) = _1_pTab
 36172  		storebits5(&(_4_pItem.Xfg.XnotIndexed), int8(1), 32, 5)
 36173  		_1_pTab.XnTabRef += 1
 36174  		_1_pSel.XselFlags |= uint32(8192)
 36175  	}
 36176  	_3_i += 1
 36177  	goto _15
 36178  _18:
 36179  _14:
 36180  	if _1_pTab.XnTabRef > uint32(2) {
 36181  		_sqlite3ErrorMsg(tls, _pParse, str(48610), unsafe.Pointer(_pCte.XzName))
 36182  		return int32(1)
 36183  	}
 36184  	func() {
 36185  		if _1_pTab.XnTabRef != uint32(1) && ((_1_pSel.XselFlags&uint32(8192)) == 0 || _1_pTab.XnTabRef != uint32(2)) {
 36186  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120757), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48653)))
 36187  			crt.X__builtin_abort(tls)
 36188  		}
 36189  	}()
 36190  	_pCte.XzCteErr = str(48726)
 36191  	_1_pSavedWith = (*XWith)(_pParse.XpWith)
 36192  	*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = _pWith
 36193  	if _1_bMayRecursive != 0 {
 36194  		_7_pPrior = (*XSelect)(_1_pSel.XpPrior)
 36195  		func() {
 36196  			if (*XWith)(_7_pPrior.XpWith) != nil {
 36197  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120764), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48749)))
 36198  				crt.X__builtin_abort(tls)
 36199  			}
 36200  		}()
 36201  		*(**XWith)(unsafe.Pointer(&_7_pPrior.XpWith)) = (*XWith)(_1_pSel.XpWith)
 36202  		_sqlite3WalkSelect(tls, _pWalker, _7_pPrior)
 36203  		*(**XWith)(unsafe.Pointer(&_7_pPrior.XpWith)) = nil
 36204  		goto _30
 36205  	}
 36206  	_sqlite3WalkSelect(tls, _pWalker, _1_pSel)
 36207  _30:
 36208  	*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = _pWith
 36209  	_1_pLeft = _1_pSel
 36210  _31:
 36211  	if _1_pLeft.XpPrior == nil {
 36212  		goto _34
 36213  	}
 36214  	_1_pLeft = (*XSelect)(_1_pLeft.XpPrior)
 36215  	goto _31
 36216  _34:
 36217  	_1_pEList = (*XExprList)(_1_pLeft.XpEList)
 36218  	if _pCte.XpCols == nil {
 36219  		goto _35
 36220  	}
 36221  	if (_1_pEList != nil) && (_1_pEList.XnExpr != ((*XExprList)(_pCte.XpCols).XnExpr)) {
 36222  		_sqlite3ErrorMsg(tls, _pParse, str(48766), unsafe.Pointer(_pCte.XzName), _1_pEList.XnExpr, (*XExprList)(_pCte.XpCols).XnExpr)
 36223  		*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = _1_pSavedWith
 36224  		return int32(1)
 36225  	}
 36226  	_1_pEList = (*XExprList)(_pCte.XpCols)
 36227  _35:
 36228  	_sqlite3ColumnsFromExprList(tls, _pParse, _1_pEList, &_1_pTab.XnCol, (**XColumn)(unsafe.Pointer(&_1_pTab.XaCol)))
 36229  	if _1_bMayRecursive == 0 {
 36230  		goto _38
 36231  	}
 36232  	if (_1_pSel.XselFlags & uint32(8192)) != 0 {
 36233  		_pCte.XzCteErr = str(48804)
 36234  		goto _40
 36235  	}
 36236  	_pCte.XzCteErr = str(48838)
 36237  _40:
 36238  	_sqlite3WalkSelect(tls, _pWalker, _1_pSel)
 36239  _38:
 36240  	_pCte.XzCteErr = nil
 36241  	*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = _1_pSavedWith
 36242  _2:
 36243  	return int32(0)
 36244  }
 36245  
 36246  var _withExpandØ00__func__Ø000 [11]int8
 36247  
 36248  func init() {
 36249  	crt.Xstrncpy(nil, &_withExpandØ00__func__Ø000[0], str(48876), 11)
 36250  }
 36251  
 36252  // C comment
 36253  //  /*
 36254  //  ** Argument pWith (which may be NULL) points to a linked list of nested
 36255  //  ** WITH contexts, from inner to outermost. If the table identified by
 36256  //  ** FROM clause element pItem is really a common-table-expression (CTE)
 36257  //  ** then return a pointer to the CTE definition for that table. Otherwise
 36258  //  ** return NULL.
 36259  //  **
 36260  //  ** If a non-NULL value is returned, set *ppContext to point to the With
 36261  //  ** object that the returned CTE belongs to.
 36262  //  */
 36263  func _searchWith(tls *crt.TLS, _pWith *XWith, _pItem *TSrcList_item, _ppContext **XWith) (r0 *TCte) {
 36264  	var _2_i int32
 36265  	var _zName *int8
 36266  	var _1_p *XWith
 36267  	if _pItem.XzDatabase != nil || store1(&_zName, _pItem.XzName) == nil {
 36268  		goto _1
 36269  	}
 36270  	_1_p = _pWith
 36271  _2:
 36272  	if _1_p == nil {
 36273  		goto _5
 36274  	}
 36275  	_2_i = int32(0)
 36276  _6:
 36277  	if _2_i >= _1_p.XnCte {
 36278  		goto _9
 36279  	}
 36280  	if _sqlite3StrICmp(tls, _zName, elem45((*TCte)(unsafe.Pointer(&_1_p.Xa)), uintptr(_2_i)).XzName) == int32(0) {
 36281  		*_ppContext = _1_p
 36282  		return elem45((*TCte)(unsafe.Pointer(&_1_p.Xa)), uintptr(_2_i))
 36283  	}
 36284  	_2_i += 1
 36285  	goto _6
 36286  _9:
 36287  	_1_p = (*XWith)(_1_p.XpOuter)
 36288  	goto _2
 36289  _5:
 36290  _1:
 36291  	return nil
 36292  }
 36293  
 36294  // C comment
 36295  //  /*
 36296  //  ** Check to see if the FROM clause term pFrom has table-valued function
 36297  //  ** arguments.  If it does, leave an error message in pParse and return
 36298  //  ** non-zero, since pFrom is not allowed to be a table-valued function.
 36299  //  */
 36300  func _cannotBeFunction(tls *crt.TLS, _pParse *XParse, _pFrom *TSrcList_item) (r0 int32) {
 36301  	if ((uint32((_pFrom.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0 {
 36302  		_sqlite3ErrorMsg(tls, _pParse, str(48887), unsafe.Pointer(_pFrom.XzName))
 36303  		return int32(1)
 36304  	}
 36305  	return int32(0)
 36306  }
 36307  
 36308  // C comment
 36309  //  /*
 36310  //  ** Convert an integer into a LogEst.  In other words, compute an
 36311  //  ** approximation for 10*log2(x).
 36312  //  */
 36313  func _sqlite3LogEst(tls *crt.TLS, _x uint64) (r0 int16) {
 36314  	var _y int16
 36315  	_y = int16(40)
 36316  	if _x >= uint64(8) {
 36317  		goto _0
 36318  	}
 36319  	if _x < uint64(2) {
 36320  		return 0
 36321  	}
 36322  _1:
 36323  	if _x < uint64(8) {
 36324  		{
 36325  			p := &_y
 36326  			*p = int16(int32(*p) - int32(10))
 36327  		}
 36328  		_x <<= 1
 36329  		goto _1
 36330  	}
 36331  	goto _4
 36332  _0:
 36333  _5:
 36334  	if _x > uint64(255) {
 36335  		{
 36336  			p := &_y
 36337  			*p = int16(int32(*p) + int32(40))
 36338  		}
 36339  		_x >>= 4
 36340  		goto _5
 36341  	}
 36342  _6:
 36343  	if _x > uint64(15) {
 36344  		{
 36345  			p := &_y
 36346  			*p = int16(int32(*p) + int32(10))
 36347  		}
 36348  		_x >>= 1
 36349  		goto _6
 36350  	}
 36351  _4:
 36352  	return int16((int32(*elem52((*int16)(unsafe.Pointer(&_sqlite3LogEstØ00aØ001)), uintptr(_x&uint64(7)))) + int32(_y)) - int32(10))
 36353  }
 36354  
 36355  var _sqlite3LogEstØ00aØ001 [8]int16
 36356  
 36357  func init() {
 36358  	_sqlite3LogEstØ00aØ001 = [8]int16{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)}
 36359  }
 36360  
 36361  func _sqlite3SelectDup(tls *crt.TLS, _db *Xsqlite3, _pDup *XSelect, _flags int32) (r0 *XSelect) {
 36362  	var _pRet, _pNext, _p, _1_pNew *XSelect
 36363  	var _pp **XSelect
 36364  	_pRet = nil
 36365  	_pNext = nil
 36366  	_pp = &_pRet
 36367  	func() {
 36368  		if _db == nil {
 36369  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92317), unsafe.Pointer(&_sqlite3SelectDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
 36370  			crt.X__builtin_abort(tls)
 36371  		}
 36372  	}()
 36373  	_p = _pDup
 36374  _2:
 36375  	if _p == nil {
 36376  		goto _5
 36377  	}
 36378  	_1_pNew = (*XSelect)(_sqlite3DbMallocRawNN(tls, _db, uint64(128)))
 36379  	if _1_pNew == nil {
 36380  		goto _5
 36381  	}
 36382  	*(**XExprList)(unsafe.Pointer(&_1_pNew.XpEList)) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.XpEList), _flags)
 36383  	*(**XSrcList)(unsafe.Pointer(&_1_pNew.XpSrc)) = _sqlite3SrcListDup(tls, _db, (*XSrcList)(_p.XpSrc), _flags)
 36384  	*(**XExpr)(unsafe.Pointer(&_1_pNew.XpWhere)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpWhere), _flags)
 36385  	*(**XExprList)(unsafe.Pointer(&_1_pNew.XpGroupBy)) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.XpGroupBy), _flags)
 36386  	*(**XExpr)(unsafe.Pointer(&_1_pNew.XpHaving)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpHaving), _flags)
 36387  	*(**XExprList)(unsafe.Pointer(&_1_pNew.XpOrderBy)) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.XpOrderBy), _flags)
 36388  	_1_pNew.Xop = _p.Xop
 36389  	*(**XSelect)(unsafe.Pointer(&_1_pNew.XpNext)) = _pNext
 36390  	*(**XSelect)(unsafe.Pointer(&_1_pNew.XpPrior)) = nil
 36391  	*(**XExpr)(unsafe.Pointer(&_1_pNew.XpLimit)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpLimit), _flags)
 36392  	*(**XExpr)(unsafe.Pointer(&_1_pNew.XpOffset)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpOffset), _flags)
 36393  	_1_pNew.XiLimit = int32(0)
 36394  	_1_pNew.XiOffset = int32(0)
 36395  	_1_pNew.XselFlags = _p.XselFlags & uint32(4294967263)
 36396  	*elem8((*int32)(unsafe.Pointer(&_1_pNew.XaddrOpenEphm)), 0) = int32(-1)
 36397  	*elem8((*int32)(unsafe.Pointer(&_1_pNew.XaddrOpenEphm)), uintptr(1)) = int32(-1)
 36398  	_1_pNew.XnSelectRow = _p.XnSelectRow
 36399  	*(**XWith)(unsafe.Pointer(&_1_pNew.XpWith)) = _withDup(tls, _db, (*XWith)(_p.XpWith))
 36400  	_sqlite3SelectSetName(tls, _1_pNew, (*int8)(unsafe.Pointer(&_p.XzSelName)))
 36401  	*_pp = _1_pNew
 36402  	_pp = (**XSelect)(unsafe.Pointer(&_1_pNew.XpPrior))
 36403  	_pNext = _1_pNew
 36404  	_p = (*XSelect)(_p.XpPrior)
 36405  	goto _2
 36406  _5:
 36407  	return _pRet
 36408  }
 36409  
 36410  var _sqlite3SelectDupØ00__func__Ø000 [17]int8
 36411  
 36412  func init() {
 36413  	crt.Xstrncpy(nil, &_sqlite3SelectDupØ00__func__Ø000[0], str(48910), 17)
 36414  }
 36415  
 36416  func _sqlite3ExprListDup(tls *crt.TLS, _db *Xsqlite3, _p *XExprList, _flags int32) (r0 *XExprList) {
 36417  	var _i int32
 36418  	var _pNew *XExprList
 36419  	var _pItem, _pOldItem *TExprList_item
 36420  	var _pPriorSelectCol, _1_pOldExpr, _1_pNewExpr *XExpr
 36421  	_pPriorSelectCol = nil
 36422  	func() {
 36423  		if _db == nil {
 36424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92200), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
 36425  			crt.X__builtin_abort(tls)
 36426  		}
 36427  	}()
 36428  	if _p == nil {
 36429  		return nil
 36430  	}
 36431  	_pNew = (*XExprList)(_sqlite3DbMallocRawNN(tls, _db, uint64(40)+(uint64(32)*uint64(_p.XnExpr-int32(1)))))
 36432  	if _pNew == nil {
 36433  		return nil
 36434  	}
 36435  	_pNew.XnAlloc = store2(&_pNew.XnExpr, _p.XnExpr)
 36436  	_pItem = (*TExprList_item)(unsafe.Pointer(&_pNew.Xa))
 36437  	_pOldItem = (*TExprList_item)(unsafe.Pointer(&_p.Xa))
 36438  	_i = int32(0)
 36439  _4:
 36440  	if _i >= _p.XnExpr {
 36441  		goto _7
 36442  	}
 36443  	_1_pOldExpr = (*XExpr)(_pOldItem.XpExpr)
 36444  	*(**XExpr)(unsafe.Pointer(&_pItem.XpExpr)) = _sqlite3ExprDup(tls, _db, _1_pOldExpr, _flags)
 36445  	if _1_pOldExpr == nil || int32(_1_pOldExpr.Xop) != int32(159) || store60(&_1_pNewExpr, (*XExpr)(_pItem.XpExpr)) == nil {
 36446  		goto _10
 36447  	}
 36448  	func() {
 36449  		if int32(_1_pNewExpr.XiColumn) != int32(0) && _i <= int32(0) {
 36450  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92216), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(48927)))
 36451  			crt.X__builtin_abort(tls)
 36452  		}
 36453  	}()
 36454  	if int32(_1_pNewExpr.XiColumn) == int32(0) {
 36455  		func() {
 36456  			if (*XExpr)(_1_pOldExpr.XpLeft) != (*XExpr)(_1_pOldExpr.XpRight) {
 36457  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92218), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(48955)))
 36458  				crt.X__builtin_abort(tls)
 36459  			}
 36460  		}()
 36461  		_pPriorSelectCol = store60((**XExpr)(unsafe.Pointer(&_1_pNewExpr.XpLeft)), (*XExpr)(_1_pNewExpr.XpRight))
 36462  		goto _17
 36463  	}
 36464  	func() {
 36465  		if _i <= int32(0) {
 36466  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92221), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(12925)))
 36467  			crt.X__builtin_abort(tls)
 36468  		}
 36469  	}()
 36470  	func() {
 36471  		if (*XExpr)(elem59(_pItem, uintptr(18446744073709551615)).XpExpr) == nil {
 36472  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92222), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(48989)))
 36473  			crt.X__builtin_abort(tls)
 36474  		}
 36475  	}()
 36476  	func() {
 36477  		if int32(_1_pNewExpr.XiColumn) != (int32((*XExpr)(elem59(_pItem, uintptr(18446744073709551615)).XpExpr).XiColumn) + int32(1)) {
 36478  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92223), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(49008)))
 36479  			crt.X__builtin_abort(tls)
 36480  		}
 36481  	}()
 36482  	func() {
 36483  		if _pPriorSelectCol != (*XExpr)((*XExpr)(elem59(_pItem, uintptr(18446744073709551615)).XpExpr).XpLeft) {
 36484  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92224), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(49054)))
 36485  			crt.X__builtin_abort(tls)
 36486  		}
 36487  	}()
 36488  	*(**XExpr)(unsafe.Pointer(&_1_pNewExpr.XpLeft)) = _pPriorSelectCol
 36489  _17:
 36490  _10:
 36491  	_pItem.XzName = _sqlite3DbStrDup(tls, _db, _pOldItem.XzName)
 36492  	_pItem.XzSpan = _sqlite3DbStrDup(tls, _db, _pOldItem.XzSpan)
 36493  	_pItem.XsortOrder = _pOldItem.XsortOrder
 36494  	storebits5(&_pItem.Xdone, 0, 1, 0)
 36495  	storebits5(&_pItem.Xdone, int8((uint32(_pOldItem.Xdone>>1)<<31)>>31), 2, 1)
 36496  	_pItem.Xu = _pOldItem.Xu
 36497  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item {
 36498  		*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(32)
 36499  		return &_pOldItem
 36500  	}())) += uintptr(32)
 36501  	goto _4
 36502  _7:
 36503  	return _pNew
 36504  }
 36505  
 36506  var _sqlite3ExprListDupØ00__func__Ø000 [19]int8
 36507  
 36508  func init() {
 36509  	crt.Xstrncpy(nil, &_sqlite3ExprListDupØ00__func__Ø000[0], str(49094), 19)
 36510  }
 36511  
 36512  // C comment
 36513  //  /*
 36514  //  ** The following group of routines make deep copies of expressions,
 36515  //  ** expression lists, ID lists, and select statements.  The copies can
 36516  //  ** be deleted (by being passed to their respective ...Delete() routines)
 36517  //  ** without effecting the originals.
 36518  //  **
 36519  //  ** The expression list, ID, and source lists return by sqlite3ExprListDup(),
 36520  //  ** sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded
 36521  //  ** by subsequent calls to sqlite*ListAppend() routines.
 36522  //  **
 36523  //  ** Any tables that the SrcList might point to are not duplicated.
 36524  //  **
 36525  //  ** The flags parameter contains a combination of the EXPRDUP_XXX flags.
 36526  //  ** If the EXPRDUP_REDUCE flag is set, then the structure returned is a
 36527  //  ** truncated version of the usual Expr structure that will be stored as
 36528  //  ** part of the in-memory representation of the database schema.
 36529  //  */
 36530  func _sqlite3ExprDup(tls *crt.TLS, _db *Xsqlite3, _p *XExpr, _flags int32) (r0 *XExpr) {
 36531  	func() {
 36532  		if _flags != int32(0) && _flags != int32(1) {
 36533  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92192), unsafe.Pointer(&_sqlite3ExprDupØ00__func__Ø000), unsafe.Pointer(str(49113)))
 36534  			crt.X__builtin_abort(tls)
 36535  		}
 36536  	}()
 36537  	return func() *XExpr {
 36538  		if _p != nil {
 36539  			return _exprDup(tls, _db, _p, _flags, nil)
 36540  		}
 36541  		return nil
 36542  	}()
 36543  }
 36544  
 36545  var _sqlite3ExprDupØ00__func__Ø000 [15]int8
 36546  
 36547  func init() {
 36548  	crt.Xstrncpy(nil, &_sqlite3ExprDupØ00__func__Ø000[0], str(49147), 15)
 36549  }
 36550  
 36551  // C comment
 36552  //  /*
 36553  //  ** This function is similar to sqlite3ExprDup(), except that if pzBuffer
 36554  //  ** is not NULL then *pzBuffer is assumed to point to a buffer large enough
 36555  //  ** to store the copy of expression p, the copies of p->u.zToken
 36556  //  ** (if applicable), and the copies of the p->pLeft and p->pRight expressions,
 36557  //  ** if any. Before returning, *pzBuffer is set to the first byte past the
 36558  //  ** portion of the buffer copied into by this function.
 36559  //  */
 36560  func _exprDup(tls *crt.TLS, _db *Xsqlite3, _p *XExpr, _dupFlags int32, _pzBuffer **uint8) (r0 *XExpr) {
 36561  	var _3_nNewSize, _3_nToken int32
 36562  	var _staticFlag, _3_nStructSize, _7_nSize uint32
 36563  	var _9_zToken *int8
 36564  	var _zAlloc *uint8
 36565  	var _pNew *XExpr
 36566  	func() {
 36567  		if _db == nil {
 36568  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92059), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
 36569  			crt.X__builtin_abort(tls)
 36570  		}
 36571  	}()
 36572  	func() {
 36573  		if _p == nil {
 36574  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92060), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(9615)))
 36575  			crt.X__builtin_abort(tls)
 36576  		}
 36577  	}()
 36578  	func() {
 36579  		if _dupFlags != int32(0) && _dupFlags != int32(1) {
 36580  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92061), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(49162)))
 36581  			crt.X__builtin_abort(tls)
 36582  		}
 36583  	}()
 36584  	func() {
 36585  		if _pzBuffer != nil && _dupFlags != int32(1) {
 36586  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92062), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(49202)))
 36587  			crt.X__builtin_abort(tls)
 36588  		}
 36589  	}()
 36590  	if _pzBuffer != nil {
 36591  		_zAlloc = *_pzBuffer
 36592  		_staticFlag = uint32(32768)
 36593  		goto _11
 36594  	}
 36595  	_zAlloc = (*uint8)(_sqlite3DbMallocRawNN(tls, _db, uint64(_dupedExprSize(tls, _p, _dupFlags))))
 36596  	_staticFlag = 0
 36597  _11:
 36598  	_pNew = (*XExpr)(unsafe.Pointer(_zAlloc))
 36599  	if _pNew == nil {
 36600  		goto _12
 36601  	}
 36602  	_3_nStructSize = uint32(_dupedExprStructSize(tls, _p, _dupFlags))
 36603  	_3_nNewSize = int32(_3_nStructSize & uint32(4095))
 36604  	if ((_p.Xflags & uint32(1024)) == (0)) && ((*(**int8)(unsafe.Pointer(&_p.Xu))) != nil) {
 36605  		_3_nToken = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_p.Xu))) + int32(1)
 36606  		goto _15
 36607  	}
 36608  	_3_nToken = int32(0)
 36609  _15:
 36610  	if _dupFlags != 0 {
 36611  		func() {
 36612  			if bool2int((_p.Xflags&uint32(8192)) != (0)) != int32(0) {
 36613  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92089), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(49242)))
 36614  				crt.X__builtin_abort(tls)
 36615  			}
 36616  		}()
 36617  		crt.Xmemcpy(tls, unsafe.Pointer(_zAlloc), unsafe.Pointer(_p), uint64(_3_nNewSize))
 36618  		goto _19
 36619  	}
 36620  	_7_nSize = uint32(_exprStructSize(tls, _p))
 36621  	crt.Xmemcpy(tls, unsafe.Pointer(_zAlloc), unsafe.Pointer(_p), uint64(_7_nSize))
 36622  	if uint64(_7_nSize) < uint64(72) {
 36623  		crt.Xmemset(tls, unsafe.Pointer(elem15(_zAlloc, uintptr(_7_nSize))), int32(0), uint64(72)-uint64(_7_nSize))
 36624  	}
 36625  _19:
 36626  	_pNew.Xflags &= uint32(4294844415)
 36627  	_pNew.Xflags |= _3_nStructSize & uint32(24576)
 36628  	_pNew.Xflags |= _staticFlag
 36629  	if _3_nToken != 0 {
 36630  		_9_zToken = store1((**int8)(unsafe.Pointer(&_pNew.Xu)), (*int8)(unsafe.Pointer(elem15(_zAlloc, uintptr(_3_nNewSize)))))
 36631  		crt.Xmemcpy(tls, unsafe.Pointer(_9_zToken), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_p.Xu))), uint64(_3_nToken))
 36632  	}
 36633  	if (0) != ((_p.Xflags | _pNew.Xflags) & uint32(8404992)) {
 36634  		goto _22
 36635  	}
 36636  	if (_p.Xflags & uint32(2048)) != (0) {
 36637  		*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.Xx)))) = _sqlite3SelectDup(tls, _db, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))), _dupFlags)
 36638  		goto _24
 36639  	}
 36640  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.Xx)))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))), _dupFlags)
 36641  _24:
 36642  _22:
 36643  	if (_pNew.Xflags & uint32(24576)) == (0) {
 36644  		goto _25
 36645  	}
 36646  	*(*uintptr)(unsafe.Pointer(&_zAlloc)) += uintptr(_dupedExprNodeSize(tls, _p, _dupFlags))
 36647  	if (_pNew.Xflags & uint32(8404992)) == (0) {
 36648  		*(**XExpr)(unsafe.Pointer(&_pNew.XpLeft)) = func() *XExpr {
 36649  			if _p.XpLeft != nil {
 36650  				return _exprDup(tls, _db, (*XExpr)(_p.XpLeft), int32(1), &_zAlloc)
 36651  			}
 36652  			return nil
 36653  		}()
 36654  		*(**XExpr)(unsafe.Pointer(&_pNew.XpRight)) = func() *XExpr {
 36655  			if _p.XpRight != nil {
 36656  				return _exprDup(tls, _db, (*XExpr)(_p.XpRight), int32(1), &_zAlloc)
 36657  			}
 36658  			return nil
 36659  		}()
 36660  	}
 36661  	if _pzBuffer != nil {
 36662  		*_pzBuffer = _zAlloc
 36663  	}
 36664  	goto _32
 36665  _25:
 36666  	if (_p.Xflags & uint32(8404992)) != (0) {
 36667  		goto _33
 36668  	}
 36669  	if int32(_pNew.Xop) == int32(159) {
 36670  		*(**XExpr)(unsafe.Pointer(&_pNew.XpLeft)) = (*XExpr)(_p.XpLeft)
 36671  		func() {
 36672  			if int32(_p.XiColumn) != int32(0) && (*XExpr)(_p.XpRight) != nil {
 36673  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92135), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(49276)))
 36674  				crt.X__builtin_abort(tls)
 36675  			}
 36676  		}()
 36677  		func() {
 36678  			if (*XExpr)(_p.XpRight) != nil && (*XExpr)(_p.XpRight) != (*XExpr)(_p.XpLeft) {
 36679  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92136), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(49306)))
 36680  				crt.X__builtin_abort(tls)
 36681  			}
 36682  		}()
 36683  		goto _41
 36684  	}
 36685  	*(**XExpr)(unsafe.Pointer(&_pNew.XpLeft)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpLeft), int32(0))
 36686  _41:
 36687  	*(**XExpr)(unsafe.Pointer(&_pNew.XpRight)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpRight), int32(0))
 36688  _33:
 36689  _32:
 36690  _12:
 36691  	return _pNew
 36692  }
 36693  
 36694  var _exprDupØ00__func__Ø000 [8]int8
 36695  
 36696  func init() {
 36697  	crt.Xstrncpy(nil, &_exprDupØ00__func__Ø000[0], str(49342), 8)
 36698  }
 36699  
 36700  // C comment
 36701  //  /*
 36702  //  ** Return the number of bytes required to create a duplicate of the
 36703  //  ** expression passed as the first argument. The second argument is a
 36704  //  ** mask containing EXPRDUP_XXX flags.
 36705  //  **
 36706  //  ** The value returned includes space to create a copy of the Expr struct
 36707  //  ** itself and the buffer referred to by Expr.u.zToken, if any.
 36708  //  **
 36709  //  ** If the EXPRDUP_REDUCE flag is set, then the return value includes
 36710  //  ** space to duplicate all Expr nodes in the tree formed by Expr.pLeft
 36711  //  ** and Expr.pRight variables (but not for any structures pointed to or
 36712  //  ** descended from the Expr.x.pList or Expr.x.pSelect variables).
 36713  //  */
 36714  func _dupedExprSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) {
 36715  	var _nByte int32
 36716  	_nByte = int32(0)
 36717  	if _p == nil {
 36718  		goto _0
 36719  	}
 36720  	_nByte = _dupedExprNodeSize(tls, _p, _flags)
 36721  	if (_flags & int32(1)) != 0 {
 36722  		_nByte += _dupedExprSize(tls, (*XExpr)(_p.XpLeft), _flags) + _dupedExprSize(tls, (*XExpr)(_p.XpRight), _flags)
 36723  	}
 36724  _0:
 36725  	return _nByte
 36726  }
 36727  
 36728  // C comment
 36729  //  /*
 36730  //  ** This function returns the space in bytes required to store the copy
 36731  //  ** of the Expr structure and a copy of the Expr.u.zToken string (if that
 36732  //  ** string is defined.)
 36733  //  */
 36734  func _dupedExprNodeSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) {
 36735  	var _nByte int32
 36736  	_nByte = _dupedExprStructSize(tls, _p, _flags) & int32(4095)
 36737  	if ((_p.Xflags & uint32(1024)) == (0)) && ((*(**int8)(unsafe.Pointer(&_p.Xu))) != nil) {
 36738  		_nByte += _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_p.Xu))) + int32(1)
 36739  	}
 36740  	return (_nByte + int32(7)) & int32(-8)
 36741  }
 36742  
 36743  // C comment
 36744  //  /*
 36745  //  ** The dupedExpr*Size() routines each return the number of bytes required
 36746  //  ** to store a copy of an expression or expression tree.  They differ in
 36747  //  ** how much of the tree is measured.
 36748  //  **
 36749  //  **     dupedExprStructSize()     Size of only the Expr structure
 36750  //  **     dupedExprNodeSize()       Size of Expr + space for token
 36751  //  **     dupedExprSize()           Expr + token + subtree components
 36752  //  **
 36753  //  ***************************************************************************
 36754  //  **
 36755  //  ** The dupedExprStructSize() function returns two values OR-ed together:
 36756  //  ** (1) the space required for a copy of the Expr structure only and
 36757  //  ** (2) the EP_xxx flags that indicate what the structure size should be.
 36758  //  ** The return values is always one of:
 36759  //  **
 36760  //  **      EXPR_FULLSIZE
 36761  //  **      EXPR_REDUCEDSIZE   | EP_Reduced
 36762  //  **      EXPR_TOKENONLYSIZE | EP_TokenOnly
 36763  //  **
 36764  //  ** The size of the structure can be found by masking the return value
 36765  //  ** of this routine with 0xfff.  The flags can be found by masking the
 36766  //  ** return value with EP_Reduced|EP_TokenOnly.
 36767  //  **
 36768  //  ** Note that with flags==EXPRDUP_REDUCE, this routines works on full-size
 36769  //  ** (unreduced) Expr objects as they or originally constructed by the parser.
 36770  //  ** During expression analysis, extra information is computed and moved into
 36771  //  ** later parts of teh Expr object and that extra information might get chopped
 36772  //  ** off if the expression is reduced.  Note also that it does not work to
 36773  //  ** make an EXPRDUP_REDUCE copy of a reduced expression.  It is only legal
 36774  //  ** to reduce a pristine expression tree from the parser.  The implementation
 36775  //  ** of dupedExprStructSize() contain multiple assert() statements that attempt
 36776  //  ** to enforce this constraint.
 36777  //  */
 36778  func _dupedExprStructSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) {
 36779  	var _nSize int32
 36780  	func() {
 36781  		if _flags != int32(1) && _flags != int32(0) {
 36782  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91989), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(49350)))
 36783  			crt.X__builtin_abort(tls)
 36784  		}
 36785  	}()
 36786  
 36787  	if (int32(0) == _flags) || (int32(_p.Xop) == int32(159)) {
 36788  		_nSize = int32(72)
 36789  		goto _5
 36790  	}
 36791  	func() {
 36792  		if (_p.Xflags & uint32(24576)) != (0) {
 36793  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91995), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(49384)))
 36794  			crt.X__builtin_abort(tls)
 36795  		}
 36796  	}()
 36797  	func() {
 36798  		if (_p.Xflags & uint32(1)) != (0) {
 36799  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91996), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(49429)))
 36800  			crt.X__builtin_abort(tls)
 36801  		}
 36802  	}()
 36803  	func() {
 36804  		if (_p.Xflags & uint32(65536)) != (0) {
 36805  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91997), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(49462)))
 36806  			crt.X__builtin_abort(tls)
 36807  		}
 36808  	}()
 36809  	func() {
 36810  		if (_p.Xflags & uint32(131072)) != (0) {
 36811  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91998), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(49495)))
 36812  			crt.X__builtin_abort(tls)
 36813  		}
 36814  	}()
 36815  	if (_p.XpLeft != nil) || ((*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil) {
 36816  		_nSize = int32(8236)
 36817  		goto _16
 36818  	}
 36819  	func() {
 36820  		if (*XExpr)(_p.XpRight) != nil {
 36821  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92002), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(21211)))
 36822  			crt.X__builtin_abort(tls)
 36823  		}
 36824  	}()
 36825  	_nSize = int32(16400)
 36826  _16:
 36827  _5:
 36828  	return _nSize
 36829  }
 36830  
 36831  var _dupedExprStructSizeØ00__func__Ø000 [20]int8
 36832  
 36833  func init() {
 36834  	crt.Xstrncpy(nil, &_dupedExprStructSizeØ00__func__Ø000[0], str(49528), 20)
 36835  }
 36836  
 36837  // C comment
 36838  //  /*
 36839  //  ** Return the number of bytes allocated for the expression structure
 36840  //  ** passed as the first argument. This is always one of EXPR_FULLSIZE,
 36841  //  ** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE.
 36842  //  */
 36843  func _exprStructSize(tls *crt.TLS, _p *XExpr) (r0 int32) {
 36844  	if (_p.Xflags & uint32(16384)) != (0) {
 36845  		return int32(16)
 36846  	}
 36847  	if (_p.Xflags & uint32(8192)) != (0) {
 36848  		return int32(44)
 36849  	}
 36850  	return int32(72)
 36851  }
 36852  
 36853  func _sqlite3SrcListDup(tls *crt.TLS, _db *Xsqlite3, _p *XSrcList, _flags int32) (r0 *XSrcList) {
 36854  	var _i, _nByte int32
 36855  	var _1_pTab *XTable
 36856  	var _pNew *XSrcList
 36857  	var _1_pNewItem, _1_pOldItem *TSrcList_item
 36858  	func() {
 36859  		if _db == nil {
 36860  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92250), unsafe.Pointer(&_sqlite3SrcListDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
 36861  			crt.X__builtin_abort(tls)
 36862  		}
 36863  	}()
 36864  	if _p == nil {
 36865  		return nil
 36866  	}
 36867  	_nByte = int32(uint64(120) + func() uint64 {
 36868  		if _p.XnSrc > int32(0) {
 36869  			return (uint64(112) * uint64(_p.XnSrc-int32(1)))
 36870  		}
 36871  		return (0)
 36872  	}())
 36873  	_pNew = (*XSrcList)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nByte)))
 36874  	if _pNew == nil {
 36875  		return nil
 36876  	}
 36877  	_pNew.XnSrc = int32(store34(&_pNew.XnAlloc, uint32(_p.XnSrc)))
 36878  	_i = int32(0)
 36879  _6:
 36880  	if _i >= _p.XnSrc {
 36881  		goto _9
 36882  	}
 36883  	_1_pNewItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pNew.Xa)), uintptr(_i))
 36884  	_1_pOldItem = elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_i))
 36885  	*(**XSchema)(unsafe.Pointer(&_1_pNewItem.XpSchema)) = (*XSchema)(_1_pOldItem.XpSchema)
 36886  	_1_pNewItem.XzDatabase = _sqlite3DbStrDup(tls, _db, _1_pOldItem.XzDatabase)
 36887  	_1_pNewItem.XzName = _sqlite3DbStrDup(tls, _db, _1_pOldItem.XzName)
 36888  	_1_pNewItem.XzAlias = _sqlite3DbStrDup(tls, _db, _1_pOldItem.XzAlias)
 36889  	_1_pNewItem.Xfg = _1_pOldItem.Xfg
 36890  	_1_pNewItem.XiCursor = _1_pOldItem.XiCursor
 36891  	_1_pNewItem.XaddrFillSub = _1_pOldItem.XaddrFillSub
 36892  	_1_pNewItem.XregReturn = _1_pOldItem.XregReturn
 36893  	if ((uint32((_1_pNewItem.Xfg.XnotIndexed)>>1) << 31) >> 31) != 0 {
 36894  		*(**int8)(unsafe.Pointer(&_1_pNewItem.Xu1)) = _sqlite3DbStrDup(tls, _db, *(**int8)(unsafe.Pointer(&_1_pOldItem.Xu1)))
 36895  	}
 36896  	*(**XIndex)(unsafe.Pointer(&_1_pNewItem.XpIBIndex)) = (*XIndex)(_1_pOldItem.XpIBIndex)
 36897  	if ((uint32((_1_pNewItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0 {
 36898  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNewItem.Xu1)))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pOldItem.Xu1))), _flags)
 36899  	}
 36900  	_1_pTab = store74((**XTable)(unsafe.Pointer(&_1_pNewItem.XpTab)), (*XTable)(_1_pOldItem.XpTab))
 36901  	if _1_pTab != nil {
 36902  		_1_pTab.XnTabRef += 1
 36903  	}
 36904  	*(**XSelect)(unsafe.Pointer(&_1_pNewItem.XpSelect)) = _sqlite3SelectDup(tls, _db, (*XSelect)(_1_pOldItem.XpSelect), _flags)
 36905  	*(**XExpr)(unsafe.Pointer(&_1_pNewItem.XpOn)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_1_pOldItem.XpOn), _flags)
 36906  	*(**XIdList)(unsafe.Pointer(&_1_pNewItem.XpUsing)) = _sqlite3IdListDup(tls, _db, (*XIdList)(_1_pOldItem.XpUsing))
 36907  	_1_pNewItem.XcolUsed = _1_pOldItem.XcolUsed
 36908  	_i += 1
 36909  	goto _6
 36910  _9:
 36911  	return _pNew
 36912  }
 36913  
 36914  var _sqlite3SrcListDupØ00__func__Ø000 [18]int8
 36915  
 36916  func init() {
 36917  	crt.Xstrncpy(nil, &_sqlite3SrcListDupØ00__func__Ø000[0], str(49548), 18)
 36918  }
 36919  
 36920  func _sqlite3IdListDup(tls *crt.TLS, _db *Xsqlite3, _p *XIdList) (r0 *XIdList) {
 36921  	var _i int32
 36922  	var _pNew *XIdList
 36923  	var _2_pNewItem, _2_pOldItem *TIdList_item
 36924  	func() {
 36925  		if _db == nil {
 36926  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92290), unsafe.Pointer(&_sqlite3IdListDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
 36927  			crt.X__builtin_abort(tls)
 36928  		}
 36929  	}()
 36930  	if _p == nil {
 36931  		return nil
 36932  	}
 36933  	_pNew = (*XIdList)(_sqlite3DbMallocRawNN(tls, _db, uint64(16)))
 36934  	if _pNew == nil {
 36935  		return nil
 36936  	}
 36937  	_pNew.XnId = _p.XnId
 36938  	*(**TIdList_item)(unsafe.Pointer(&_pNew.Xa)) = (*TIdList_item)(_sqlite3DbMallocRawNN(tls, _db, uint64(_p.XnId)*uint64(16)))
 36939  	if (*TIdList_item)(_pNew.Xa) == nil {
 36940  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pNew))
 36941  		return nil
 36942  	}
 36943  	_i = int32(0)
 36944  _5:
 36945  	if _i >= _p.XnId {
 36946  		goto _8
 36947  	}
 36948  	_2_pNewItem = elem44((*TIdList_item)(_pNew.Xa), uintptr(_i))
 36949  	_2_pOldItem = elem44((*TIdList_item)(_p.Xa), uintptr(_i))
 36950  	_2_pNewItem.XzName = _sqlite3DbStrDup(tls, _db, _2_pOldItem.XzName)
 36951  	_2_pNewItem.Xidx = _2_pOldItem.Xidx
 36952  	_i += 1
 36953  	goto _5
 36954  _8:
 36955  	return _pNew
 36956  }
 36957  
 36958  var _sqlite3IdListDupØ00__func__Ø000 [17]int8
 36959  
 36960  func init() {
 36961  	crt.Xstrncpy(nil, &_sqlite3IdListDupØ00__func__Ø000[0], str(49566), 17)
 36962  }
 36963  
 36964  func _withDup(tls *crt.TLS, _db *Xsqlite3, _p *XWith) (r0 *XWith) {
 36965  	var _1_nByte, _2_i int32
 36966  	var _pRet *XWith
 36967  	_pRet = nil
 36968  	if _p == nil {
 36969  		goto _0
 36970  	}
 36971  	_1_nByte = int32(uint64(48) + (uint64(32) * uint64(_p.XnCte-int32(1))))
 36972  	_pRet = (*XWith)(_sqlite3DbMallocZero(tls, _db, uint64(_1_nByte)))
 36973  	if _pRet == nil {
 36974  		goto _1
 36975  	}
 36976  	_pRet.XnCte = _p.XnCte
 36977  	_2_i = int32(0)
 36978  _2:
 36979  	if _2_i >= _p.XnCte {
 36980  		goto _5
 36981  	}
 36982  	*(**XSelect)(unsafe.Pointer(&(elem45((*TCte)(unsafe.Pointer(&_pRet.Xa)), uintptr(_2_i)).XpSelect))) = _sqlite3SelectDup(tls, _db, (*XSelect)(elem45((*TCte)(unsafe.Pointer(&_p.Xa)), uintptr(_2_i)).XpSelect), int32(0))
 36983  	*(**XExprList)(unsafe.Pointer(&(elem45((*TCte)(unsafe.Pointer(&_pRet.Xa)), uintptr(_2_i)).XpCols))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(elem45((*TCte)(unsafe.Pointer(&_p.Xa)), uintptr(_2_i)).XpCols), int32(0))
 36984  	elem45((*TCte)(unsafe.Pointer(&_pRet.Xa)), uintptr(_2_i)).XzName = _sqlite3DbStrDup(tls, _db, elem45((*TCte)(unsafe.Pointer(&_p.Xa)), uintptr(_2_i)).XzName)
 36985  	_2_i += 1
 36986  	goto _2
 36987  _5:
 36988  _1:
 36989  _0:
 36990  	return _pRet
 36991  }
 36992  
 36993  // C comment
 36994  //  /*
 36995  //  ** Set the name of a Select object
 36996  //  */
 36997  func _sqlite3SelectSetName(tls *crt.TLS, _p *XSelect, _zName *int8) {
 36998  	if (_p != nil) && (_zName != nil) {
 36999  		Xsqlite3_snprintf(tls, int32(12), (*int8)(unsafe.Pointer(&_p.XzSelName)), str(24531), unsafe.Pointer(_zName))
 37000  	}
 37001  }
 37002  
 37003  // C comment
 37004  //  /*
 37005  //  ** Given an expression list (which is really the list of expressions
 37006  //  ** that form the result set of a SELECT statement) compute appropriate
 37007  //  ** column names for a table that would hold the expression list.
 37008  //  **
 37009  //  ** All column names will be unique.
 37010  //  **
 37011  //  ** Only the column names are computed.  Column.zType, Column.zColl,
 37012  //  ** and other fields of Column are zeroed.
 37013  //  **
 37014  //  ** Return SQLITE_OK on success.  If a memory allocation error occurs,
 37015  //  ** store NULL in *paCol and 0 in *pnCol and return SQLITE_NOMEM.
 37016  //  */
 37017  func _sqlite3ColumnsFromExprList(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pnCol *int16, _paCol **XColumn) (r0 int32) {
 37018  	var _i, _j, _nCol, _nName, _7_iCol int32
 37019  	var _cnt uint32
 37020  	var _zName *int8
 37021  	var _ht XHash
 37022  	var _db *Xsqlite3
 37023  	var _5_pTab *XTable
 37024  	var _p, _5_pColExpr *XExpr
 37025  	var _aCol, _pCol *XColumn
 37026  	_db = (*Xsqlite3)(_pParse.Xdb)
 37027  	_sqlite3HashInit(tls, &_ht)
 37028  	if _pEList != nil {
 37029  		_nCol = _pEList.XnExpr
 37030  		_aCol = (*XColumn)(_sqlite3DbMallocZero(tls, _db, uint64(32)*uint64(_nCol)))
 37031  		goto _1
 37032  	}
 37033  	_nCol = int32(0)
 37034  	_aCol = nil
 37035  _1:
 37036  	func() {
 37037  		if _nCol != int32(int16(_nCol)) {
 37038  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118197), unsafe.Pointer(&_sqlite3ColumnsFromExprListØ00__func__Ø000), unsafe.Pointer(str(49583)))
 37039  			crt.X__builtin_abort(tls)
 37040  		}
 37041  	}()
 37042  	*_pnCol = int16(_nCol)
 37043  	*_paCol = _aCol
 37044  	*func() **XColumn { _i = int32(0); return &_pCol }() = _aCol
 37045  _4:
 37046  	if _i >= _nCol || _db.XmallocFailed != 0 {
 37047  		goto _8
 37048  	}
 37049  	_p = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr))
 37050  	if store1(&_zName, elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzName) != nil {
 37051  		goto _10
 37052  	}
 37053  	_5_pColExpr = _p
 37054  _11:
 37055  	if int32(_5_pColExpr.Xop) == int32(122) {
 37056  		_5_pColExpr = (*XExpr)(_5_pColExpr.XpRight)
 37057  		func() {
 37058  			if _5_pColExpr == nil {
 37059  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118212), unsafe.Pointer(&_sqlite3ColumnsFromExprListØ00__func__Ø000), unsafe.Pointer(str(49599)))
 37060  				crt.X__builtin_abort(tls)
 37061  			}
 37062  		}()
 37063  		goto _11
 37064  	}
 37065  	if int32(_5_pColExpr.Xop) != int32(152) || (*XTable)(_5_pColExpr.XpTab) == nil {
 37066  		goto _16
 37067  	}
 37068  	_7_iCol = int32(_5_pColExpr.XiColumn)
 37069  	_5_pTab = (*XTable)(_5_pColExpr.XpTab)
 37070  	if _7_iCol < int32(0) {
 37071  		_7_iCol = int32(_5_pTab.XiPKey)
 37072  	}
 37073  	_zName = func() *int8 {
 37074  		if _7_iCol >= int32(0) {
 37075  			return (elem43((*XColumn)(_5_pTab.XaCol), uintptr(_7_iCol)).XzName)
 37076  		}
 37077  		return str(27182)
 37078  	}()
 37079  	goto _24
 37080  _16:
 37081  	if int32(_5_pColExpr.Xop) == int32(27) {
 37082  		func() {
 37083  			if (_5_pColExpr.Xflags & uint32(1024)) != (0) {
 37084  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118221), unsafe.Pointer(&_sqlite3ColumnsFromExprListØ00__func__Ø000), unsafe.Pointer(str(49611)))
 37085  				crt.X__builtin_abort(tls)
 37086  			}
 37087  		}()
 37088  		_zName = *(**int8)(unsafe.Pointer(&_5_pColExpr.Xu))
 37089  		goto _24
 37090  	}
 37091  	_zName = elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzSpan
 37092  _24:
 37093  _10:
 37094  	_zName = _sqlite3MPrintf(tls, _db, str(24531), unsafe.Pointer(_zName))
 37095  	_cnt = 0
 37096  _25:
 37097  	if _zName == nil || _sqlite3HashFind(tls, &_ht, _zName) == nil {
 37098  		goto _26
 37099  	}
 37100  	_nName = _sqlite3Strlen30(tls, _zName)
 37101  	if _nName <= int32(0) {
 37102  		goto _28
 37103  	}
 37104  	_j = _nName - int32(1)
 37105  _29:
 37106  	if _j <= int32(0) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zName, uintptr(_j))))))&int32(4)) == 0 {
 37107  		goto _33
 37108  	}
 37109  	_j -= 1
 37110  	goto _29
 37111  _33:
 37112  	if int32(*elem1(_zName, uintptr(_j))) == int32(58) {
 37113  		_nName = _j
 37114  	}
 37115  _28:
 37116  	_zName = _sqlite3MPrintf(tls, _db, str(49651), _nName, unsafe.Pointer(_zName), preInc34(&_cnt, uint32(1)))
 37117  	if _cnt > uint32(3) {
 37118  		Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_cnt))
 37119  	}
 37120  	goto _25
 37121  _26:
 37122  	_pCol.XzName = _zName
 37123  	if (_zName != nil) && (_sqlite3HashInsert(tls, &_ht, _zName, unsafe.Pointer(_pCol)) == unsafe.Pointer(_pCol)) {
 37124  		_sqlite3OomFault(tls, _db)
 37125  	}
 37126  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(32)
 37127  	goto _4
 37128  _8:
 37129  	_sqlite3HashClear(tls, &_ht)
 37130  	if _db.XmallocFailed == 0 {
 37131  		goto _38
 37132  	}
 37133  	_j = int32(0)
 37134  _39:
 37135  	if _j >= _i {
 37136  		goto _42
 37137  	}
 37138  	_sqlite3DbFree(tls, _db, unsafe.Pointer(elem43(_aCol, uintptr(_j)).XzName))
 37139  	_j += 1
 37140  	goto _39
 37141  _42:
 37142  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_aCol))
 37143  	*_paCol = nil
 37144  	*_pnCol = 0
 37145  	return _sqlite3NomemError(tls, int32(118257))
 37146  
 37147  _38:
 37148  	return int32(0)
 37149  }
 37150  
 37151  var _sqlite3ColumnsFromExprListØ00__func__Ø000 [27]int8
 37152  
 37153  func init() {
 37154  	crt.Xstrncpy(nil, &_sqlite3ColumnsFromExprListØ00__func__Ø000[0], str(49659), 27)
 37155  }
 37156  
 37157  // C comment
 37158  //  /*
 37159  //  ** Locate the table identified by *p.
 37160  //  **
 37161  //  ** This is a wrapper around sqlite3LocateTable(). The difference between
 37162  //  ** sqlite3LocateTable() and this function is that this function restricts
 37163  //  ** the search to schema (p->pSchema) if it is not NULL. p->pSchema may be
 37164  //  ** non-NULL if it is part of a view or trigger program definition. See
 37165  //  ** sqlite3FixSrcList() for details.
 37166  //  */
 37167  func _sqlite3LocateTableItem(tls *crt.TLS, _pParse *XParse, _flags uint32, _p *TSrcList_item) (r0 *XTable) {
 37168  	var _1_iDb int32
 37169  	var _zDb *int8
 37170  	func() {
 37171  		if (*XSchema)(_p.XpSchema) != nil && _p.XzDatabase != nil {
 37172  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100094), unsafe.Pointer(&_sqlite3LocateTableItemØ00__func__Ø000), unsafe.Pointer(str(49686)))
 37173  			crt.X__builtin_abort(tls)
 37174  		}
 37175  	}()
 37176  	if _p.XpSchema != nil {
 37177  		_1_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_p.XpSchema))
 37178  		_zDb = elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_1_iDb)).XzDbSName
 37179  		goto _4
 37180  	}
 37181  	_zDb = _p.XzDatabase
 37182  _4:
 37183  	return _sqlite3LocateTable(tls, _pParse, _flags, _p.XzName, _zDb)
 37184  }
 37185  
 37186  var _sqlite3LocateTableItemØ00__func__Ø000 [23]int8
 37187  
 37188  func init() {
 37189  	crt.Xstrncpy(nil, &_sqlite3LocateTableItemØ00__func__Ø000[0], str(49719), 23)
 37190  }
 37191  
 37192  // C comment
 37193  //  /*
 37194  //  ** Locate the in-memory structure that describes a particular database
 37195  //  ** table given the name of that table and (optionally) the name of the
 37196  //  ** database containing the table.  Return NULL if not found.  Also leave an
 37197  //  ** error message in pParse->zErrMsg.
 37198  //  **
 37199  //  ** The difference between this routine and sqlite3FindTable() is that this
 37200  //  ** routine leaves an error message in pParse->zErrMsg where
 37201  //  ** sqlite3FindTable() does not.
 37202  //  */
 37203  func _sqlite3LocateTable(tls *crt.TLS, _pParse *XParse, _flags uint32, _zName *int8, _zDbase *int8) (r0 *XTable) {
 37204  	var _2_zMsg *int8
 37205  	var _p *XTable
 37206  	var _3_pMod *XModule
 37207  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
 37208  		return nil
 37209  	}
 37210  	_p = _sqlite3FindTable(tls, (*Xsqlite3)(_pParse.Xdb), _zName, _zDbase)
 37211  	if _p != nil {
 37212  		goto _1
 37213  	}
 37214  	_2_zMsg = func() *int8 {
 37215  		if (_flags & uint32(1)) != 0 {
 37216  			return str(49742)
 37217  		}
 37218  		return str(49755)
 37219  	}()
 37220  	if _sqlite3FindDbName(tls, (*Xsqlite3)(_pParse.Xdb), _zDbase) >= int32(1) {
 37221  		goto _4
 37222  	}
 37223  	_3_pMod = (*XModule)(_sqlite3HashFind(tls, &((*Xsqlite3)(_pParse.Xdb).XaModule), _zName))
 37224  	if (_3_pMod == nil) && (Xsqlite3_strnicmp(tls, _zName, str(49769), int32(7)) == int32(0)) {
 37225  		_3_pMod = _sqlite3PragmaVtabRegister(tls, (*Xsqlite3)(_pParse.Xdb), _zName)
 37226  	}
 37227  	if (_3_pMod != nil) && _sqlite3VtabEponymousTableInit(tls, _pParse, _3_pMod) != 0 {
 37228  		return (*XTable)(_3_pMod.XpEpoTab)
 37229  	}
 37230  _4:
 37231  	if (_flags & uint32(2)) != (0) {
 37232  		goto _9
 37233  	}
 37234  	if _zDbase != nil {
 37235  		_sqlite3ErrorMsg(tls, _pParse, str(49777), unsafe.Pointer(_2_zMsg), unsafe.Pointer(_zDbase), unsafe.Pointer(_zName))
 37236  		goto _11
 37237  	}
 37238  	_sqlite3ErrorMsg(tls, _pParse, str(49787), unsafe.Pointer(_2_zMsg), unsafe.Pointer(_zName))
 37239  _11:
 37240  	_pParse.XcheckSchema = uint8(1)
 37241  _9:
 37242  _1:
 37243  	return _p
 37244  }
 37245  
 37246  // C comment
 37247  //  /*
 37248  //  ** This routine is a no-op if the database schema is already initialized.
 37249  //  ** Otherwise, the schema is loaded. An error code is returned.
 37250  //  */
 37251  func _sqlite3ReadSchema(tls *crt.TLS, _pParse *XParse) (r0 int32) {
 37252  	var _rc int32
 37253  	var _db *Xsqlite3
 37254  	_rc = int32(0)
 37255  	_db = (*Xsqlite3)(_pParse.Xdb)
 37256  	func() {
 37257  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 37258  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116068), unsafe.Pointer(&_sqlite3ReadSchemaØ00__func__Ø000), unsafe.Pointer(str(881)))
 37259  			crt.X__builtin_abort(tls)
 37260  		}
 37261  	}()
 37262  	if (_db.Xinit.Xbusy) == 0 {
 37263  		_rc = _sqlite3Init(tls, _db, &_pParse.XzErrMsg)
 37264  	}
 37265  	if _rc != int32(0) {
 37266  		_pParse.Xrc = _rc
 37267  		_pParse.XnErr += 1
 37268  	}
 37269  	return _rc
 37270  }
 37271  
 37272  var _sqlite3ReadSchemaØ00__func__Ø000 [18]int8
 37273  
 37274  func init() {
 37275  	crt.Xstrncpy(nil, &_sqlite3ReadSchemaØ00__func__Ø000[0], str(49794), 18)
 37276  }
 37277  
 37278  // C comment
 37279  //  /*
 37280  //  ** Initialize all database files - the main database file, the file
 37281  //  ** used to store temporary tables, and any additional database files
 37282  //  ** created using ATTACH statements.  Return a success code.  If an
 37283  //  ** error occurs, write an error message into *pzErrMsg.
 37284  //  **
 37285  //  ** After a database is initialized, the DB_SchemaLoaded bit is set
 37286  //  ** bit is set in the flags field of the Db structure. If the database
 37287  //  ** file was of zero-length, then the DB_Empty flag is also set.
 37288  //  */
 37289  func _sqlite3Init(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8) (r0 int32) {
 37290  	var _i, _rc, _commit_internal int32
 37291  	_commit_internal = bool2int((_db.Xflags & int32(2)) == 0)
 37292  	func() {
 37293  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 37294  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116025), unsafe.Pointer(&_sqlite3InitØ00__func__Ø000), unsafe.Pointer(str(881)))
 37295  			crt.X__builtin_abort(tls)
 37296  		}
 37297  	}()
 37298  	func() {
 37299  		if _sqlite3BtreeHoldsMutex(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt)) == 0 {
 37300  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116026), unsafe.Pointer(&_sqlite3InitØ00__func__Ø000), unsafe.Pointer(str(49812)))
 37301  			crt.X__builtin_abort(tls)
 37302  		}
 37303  	}()
 37304  	func() {
 37305  		if int32(_db.Xinit.Xbusy) != int32(0) {
 37306  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116027), unsafe.Pointer(&_sqlite3InitØ00__func__Ø000), unsafe.Pointer(str(49851)))
 37307  			crt.X__builtin_abort(tls)
 37308  		}
 37309  	}()
 37310  	_rc = int32(0)
 37311  	_db.Xinit.Xbusy = uint8(1)
 37312  	_db.Xenc = (*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema).Xenc
 37313  	_i = int32(0)
 37314  _6:
 37315  	if _rc != int32(0) || _i >= _db.XnDb {
 37316  		goto _10
 37317  	}
 37318  	if ((int32((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpSchema).XschemaFlags) & int32(1)) == int32(1)) || (_i == int32(1)) {
 37319  		goto _7
 37320  	}
 37321  	_rc = _sqlite3InitOne(tls, _db, _i, _pzErrMsg)
 37322  	if _rc != 0 {
 37323  		_sqlite3ResetOneSchema(tls, _db, _i)
 37324  	}
 37325  _7:
 37326  	_i += 1
 37327  	goto _6
 37328  _10:
 37329  	func() {
 37330  		if _db.XnDb <= int32(1) {
 37331  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116044), unsafe.Pointer(&_sqlite3InitØ00__func__Ø000), unsafe.Pointer(str(49868)))
 37332  			crt.X__builtin_abort(tls)
 37333  		}
 37334  	}()
 37335  	if _rc != int32(0) || (int32((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema).XschemaFlags)&int32(1)) == int32(1) {
 37336  		goto _17
 37337  	}
 37338  	_rc = _sqlite3InitOne(tls, _db, int32(1), _pzErrMsg)
 37339  	if _rc != 0 {
 37340  		_sqlite3ResetOneSchema(tls, _db, int32(1))
 37341  	}
 37342  _17:
 37343  	_db.Xinit.Xbusy = 0
 37344  	if (_rc == int32(0)) && _commit_internal != 0 {
 37345  		_sqlite3CommitInternalChanges(tls, _db)
 37346  	}
 37347  	return _rc
 37348  }
 37349  
 37350  var _sqlite3InitØ00__func__Ø000 [12]int8
 37351  
 37352  func init() {
 37353  	crt.Xstrncpy(nil, &_sqlite3InitØ00__func__Ø000[0], str(49878), 12)
 37354  }
 37355  
 37356  // C comment
 37357  //  /*
 37358  //  ** Attempt to read the database schema and initialize internal
 37359  //  ** data structures for a single database file.  The index of the
 37360  //  ** database file is given by iDb.  iDb==0 is used for the main
 37361  //  ** database.  iDb==1 should never be used.  iDb>=2 is used for
 37362  //  ** auxiliary databases.  Return one of the SQLITE_ error codes to
 37363  //  ** indicate success or failure.
 37364  //  */
 37365  func _sqlite3InitOne(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pzErrMsg **int8) (r0 int32) {
 37366  	var _rc, _i, _size, _openedTransaction int32
 37367  	var _zMasterName, _17_zSql *int8
 37368  	var _8_encoding uint8
 37369  	var _18_xAuth func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
 37370  	var _pDb *XDb
 37371  	var _meta [5]int32
 37372  	var _azArg [4]*int8
 37373  	var _initData XInitData
 37374  	_openedTransaction = int32(0)
 37375  	func() {
 37376  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 37377  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115814), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(21693)))
 37378  			crt.X__builtin_abort(tls)
 37379  		}
 37380  	}()
 37381  	func() {
 37382  		if (elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema) == nil {
 37383  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115815), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(49890)))
 37384  			crt.X__builtin_abort(tls)
 37385  		}
 37386  	}()
 37387  	func() {
 37388  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 37389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115816), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(881)))
 37390  			crt.X__builtin_abort(tls)
 37391  		}
 37392  	}()
 37393  	func() {
 37394  		if _iDb != int32(1) && _sqlite3BtreeHoldsMutex(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt)) == 0 {
 37395  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115817), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(49911)))
 37396  			crt.X__builtin_abort(tls)
 37397  		}
 37398  	}()
 37399  	*elem0((**int8)(unsafe.Pointer(&_azArg)), 0) = store1(&_zMasterName, func() *int8 {
 37400  		if int32(1) != 0 && (_iDb == int32(1)) {
 37401  			return str(49962)
 37402  		}
 37403  		return str(49981)
 37404  	}())
 37405  	*elem0((**int8)(unsafe.Pointer(&_azArg)), uintptr(1)) = str(49995)
 37406  	*elem0((**int8)(unsafe.Pointer(&_azArg)), uintptr(2)) = str(49997)
 37407  	*elem0((**int8)(unsafe.Pointer(&_azArg)), uintptr(3)) = nil
 37408  	*(**Xsqlite3)(unsafe.Pointer(&_initData.Xdb)) = _db
 37409  	_initData.XiDb = _iDb
 37410  	_initData.Xrc = int32(0)
 37411  	_initData.XpzErrMsg = _pzErrMsg
 37412  	_sqlite3InitCallback(tls, unsafe.Pointer(&_initData), int32(3), (**int8)(unsafe.Pointer(&_azArg)), nil)
 37413  	if _initData.Xrc != 0 {
 37414  		_rc = _initData.Xrc
 37415  		goto _error_out
 37416  	}
 37417  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 37418  	if (*XBtree)(_pDb.XpBt) != nil {
 37419  		goto _14
 37420  	}
 37421  	if int32(1) != 0 && func() int32 {
 37422  		if _iDb == int32(1) {
 37423  			return int32(1)
 37424  		}
 37425  		return func() int32 {
 37426  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115843), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(4809)))
 37427  			crt.X__builtin_abort(tls)
 37428  			return int32(0)
 37429  		}()
 37430  	}() != 0 {
 37431  		{
 37432  			p := &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema).XschemaFlags)
 37433  			*p = uint16(int32(*p) | int32(1))
 37434  		}
 37435  	}
 37436  	return int32(0)
 37437  
 37438  _14:
 37439  	_sqlite3BtreeEnter(tls, (*XBtree)(_pDb.XpBt))
 37440  	if _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(_pDb.XpBt)) != 0 {
 37441  		goto _19
 37442  	}
 37443  	_rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_pDb.XpBt), int32(0))
 37444  	if _rc != int32(0) {
 37445  		_sqlite3SetString(tls, _pzErrMsg, _db, _sqlite3ErrStr(tls, _rc))
 37446  		goto _initone_error_out
 37447  	}
 37448  	_openedTransaction = int32(1)
 37449  _19:
 37450  	_i = int32(0)
 37451  _21:
 37452  	if _i >= int32(5) {
 37453  		goto _24
 37454  	}
 37455  	_sqlite3BtreeGetMeta(tls, (*XBtree)(_pDb.XpBt), _i+int32(1), (*uint32)(unsafe.Pointer(elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(_i)))))
 37456  	_i += 1
 37457  	goto _21
 37458  _24:
 37459  	(*XSchema)(_pDb.XpSchema).Xschema_cookie = *elem8((*int32)(unsafe.Pointer(&_meta)), 0)
 37460  	if (*elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(4))) == 0 {
 37461  		goto _25
 37462  	}
 37463  	if _iDb != int32(0) {
 37464  		goto _26
 37465  	}
 37466  	_8_encoding = uint8(int32(uint8(*elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(4)))) & int32(3))
 37467  	if int32(_8_encoding) == int32(0) {
 37468  		_8_encoding = uint8(1)
 37469  	}
 37470  	_db.Xenc = _8_encoding
 37471  	goto _28
 37472  _26:
 37473  	if (*elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(4))) != int32(_db.Xenc) {
 37474  		_sqlite3SetString(tls, _pzErrMsg, _db, str(50073))
 37475  		_rc = int32(1)
 37476  		goto _initone_error_out
 37477  	}
 37478  _28:
 37479  	goto _30
 37480  _25:
 37481  	{
 37482  		p := &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XschemaFlags)
 37483  		*p = uint16(int32(*p) | int32(4))
 37484  	}
 37485  _30:
 37486  	(*XSchema)(_pDb.XpSchema).Xenc = _db.Xenc
 37487  	if ((*XSchema)(_pDb.XpSchema).Xcache_size) != int32(0) {
 37488  		goto _31
 37489  	}
 37490  	_size = _sqlite3AbsInt32(tls, *elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(2)))
 37491  	if _size == int32(0) {
 37492  		_size = int32(-2000)
 37493  	}
 37494  	(*XSchema)(_pDb.XpSchema).Xcache_size = _size
 37495  	_sqlite3BtreeSetCacheSize(tls, (*XBtree)(_pDb.XpBt), (*XSchema)(_pDb.XpSchema).Xcache_size)
 37496  _31:
 37497  	(*XSchema)(_pDb.XpSchema).Xfile_format = uint8(*elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(1)))
 37498  	if int32((*XSchema)(_pDb.XpSchema).Xfile_format) == int32(0) {
 37499  		(*XSchema)(_pDb.XpSchema).Xfile_format = uint8(1)
 37500  	}
 37501  	if int32((*XSchema)(_pDb.XpSchema).Xfile_format) > int32(4) {
 37502  		_sqlite3SetString(tls, _pzErrMsg, _db, str(50141))
 37503  		_rc = int32(1)
 37504  		goto _initone_error_out
 37505  	}
 37506  	if (_iDb == int32(0)) && ((*elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(1))) >= int32(4)) {
 37507  		_db.Xflags &= int32(-32769)
 37508  	}
 37509  	func() {
 37510  		if (_db.Xinit.Xbusy) == 0 {
 37511  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115952), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(50165)))
 37512  			crt.X__builtin_abort(tls)
 37513  		}
 37514  	}()
 37515  	_17_zSql = _sqlite3MPrintf(tls, _db, str(50179), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(_zMasterName))
 37516  	_18_xAuth = _db.XxAuth
 37517  	_db.XxAuth = nil
 37518  	_rc = Xsqlite3_exec(tls, _db, _17_zSql, _sqlite3InitCallback, unsafe.Pointer(&_initData), nil)
 37519  	_db.XxAuth = _18_xAuth
 37520  	if _rc == int32(0) {
 37521  		_rc = _initData.Xrc
 37522  	}
 37523  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_17_zSql))
 37524  	if _rc == int32(0) {
 37525  		_sqlite3AnalysisLoad(tls, _db, _iDb)
 37526  	}
 37527  	if _db.XmallocFailed != 0 {
 37528  		_rc = _sqlite3NomemError(tls, int32(115978))
 37529  		_sqlite3ResetAllSchemasOfConnection(tls, _db)
 37530  	}
 37531  	if (_rc == int32(0)) || (_db.Xflags&int32(65536)) != 0 {
 37532  		{
 37533  			p := &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XschemaFlags)
 37534  			*p = uint16(int32(*p) | int32(1))
 37535  		}
 37536  		_rc = int32(0)
 37537  	}
 37538  _initone_error_out:
 37539  	if _openedTransaction != 0 {
 37540  		_sqlite3BtreeCommit(tls, (*XBtree)(_pDb.XpBt))
 37541  	}
 37542  	_sqlite3BtreeLeave(tls, (*XBtree)(_pDb.XpBt))
 37543  _error_out:
 37544  	if (_rc == int32(7)) || (_rc == int32(3082)) {
 37545  		_sqlite3OomFault(tls, _db)
 37546  	}
 37547  	return _rc
 37548  
 37549  	_ = _azArg
 37550  	_ = _meta
 37551  	panic(0)
 37552  }
 37553  
 37554  var _sqlite3InitOneØ00__func__Ø000 [15]int8
 37555  
 37556  func init() {
 37557  	crt.Xstrncpy(nil, &_sqlite3InitOneØ00__func__Ø000[0], str(50234), 15)
 37558  }
 37559  
 37560  // C comment
 37561  //  /*
 37562  //  ** This is the callback routine for the code that initializes the
 37563  //  ** database.  See sqlite3Init() below for additional information.
 37564  //  ** This routine is also called from the OP_ParseSchema opcode of the VDBE.
 37565  //  **
 37566  //  ** Each callback contains the following information:
 37567  //  **
 37568  //  **     argv[0] = name of thing being created
 37569  //  **     argv[1] = root page number for table or index. 0 for trigger or view.
 37570  //  **     argv[2] = SQL text for the CREATE statement.
 37571  //  **
 37572  //  */
 37573  func _sqlite3InitCallback(tls *crt.TLS, _pInit unsafe.Pointer, _argc int32, _argv **int8, _NotUsed **int8) (r0 int32) {
 37574  	var _iDb, _3_rc, _3_rcp int32
 37575  	var _3_pStmt unsafe.Pointer
 37576  	var _3_saved_iDb uint8
 37577  	var _db *Xsqlite3
 37578  	var _10_pIndex *XIndex
 37579  	var _pData *XInitData
 37580  	_pData = (*XInitData)(_pInit)
 37581  	_db = (*Xsqlite3)(_pData.Xdb)
 37582  	_iDb = _pData.XiDb
 37583  	func() {
 37584  		if _argc != int32(3) {
 37585  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115722), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(50249)))
 37586  			crt.X__builtin_abort(tls)
 37587  		}
 37588  	}()
 37589  	_ = _argc
 37590  
 37591  	func() {
 37592  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 37593  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115724), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(881)))
 37594  			crt.X__builtin_abort(tls)
 37595  		}
 37596  	}()
 37597  	{
 37598  		p := &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XschemaFlags)
 37599  		*p = uint16(int32(*p) & int32(-5))
 37600  	}
 37601  	if _db.XmallocFailed != 0 {
 37602  		_corruptSchema(tls, _pData, *elem0(_argv, 0), nil)
 37603  		return int32(1)
 37604  	}
 37605  	func() {
 37606  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 37607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115731), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(21693)))
 37608  			crt.X__builtin_abort(tls)
 37609  		}
 37610  	}()
 37611  	if _argv == nil {
 37612  		return int32(0)
 37613  	}
 37614  	if (*elem0(_argv, uintptr(1))) == nil {
 37615  		_corruptSchema(tls, _pData, *elem0(_argv, 0), nil)
 37616  		goto _32
 37617  	}
 37618  	if Xsqlite3_strnicmp(tls, *elem0(_argv, uintptr(2)), str(50257), int32(7)) != int32(0) {
 37619  		goto _11
 37620  	}
 37621  	_3_saved_iDb = _db.Xinit.XiDb
 37622  	func() {
 37623  		if (_db.Xinit.Xbusy) == 0 {
 37624  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115746), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(50165)))
 37625  			crt.X__builtin_abort(tls)
 37626  		}
 37627  	}()
 37628  	_db.Xinit.XiDb = uint8(_iDb)
 37629  	_db.Xinit.XnewTnum = _sqlite3Atoi(tls, *elem0(_argv, uintptr(1)))
 37630  	_db.Xinit.XorphanTrigger = 0
 37631  	_3_rcp = Xsqlite3_prepare(tls, _db, *elem0(_argv, uintptr(2)), int32(-1), &_3_pStmt, nil)
 37632  	_3_rc = _db.XerrCode
 37633  	func() {
 37634  		if (_3_rc & int32(255)) != (_3_rcp & int32(255)) {
 37635  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115752), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(50265)))
 37636  			crt.X__builtin_abort(tls)
 37637  		}
 37638  	}()
 37639  	_db.Xinit.XiDb = _3_saved_iDb
 37640  	func() {
 37641  		if int32(_3_saved_iDb) != int32(0) && (_db.Xflags&int32(268435456)) == int32(0) {
 37642  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115754), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(50287)))
 37643  			crt.X__builtin_abort(tls)
 37644  		}
 37645  	}()
 37646  	if int32(0) == _3_rc {
 37647  		goto _19
 37648  	}
 37649  	if (_db.Xinit.XorphanTrigger) != 0 {
 37650  		func() {
 37651  			if _iDb != int32(1) {
 37652  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115757), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(50334)))
 37653  				crt.X__builtin_abort(tls)
 37654  			}
 37655  		}()
 37656  		goto _23
 37657  	}
 37658  	_pData.Xrc = _3_rc
 37659  	if _3_rc == int32(7) {
 37660  		_sqlite3OomFault(tls, _db)
 37661  		goto _27
 37662  	}
 37663  	if (_3_rc != int32(9)) && ((_3_rc & int32(255)) != int32(6)) {
 37664  		_corruptSchema(tls, _pData, *elem0(_argv, 0), Xsqlite3_errmsg(tls, _db))
 37665  	}
 37666  _27:
 37667  _23:
 37668  _19:
 37669  	Xsqlite3_finalize(tls, _3_pStmt)
 37670  	goto _32
 37671  _11:
 37672  	if ((*elem0(_argv, 0)) == nil) || (((*elem0(_argv, uintptr(2))) != nil) && (int32(*elem1(*elem0(_argv, uintptr(2)), 0)) != int32(0))) {
 37673  		_corruptSchema(tls, _pData, *elem0(_argv, 0), nil)
 37674  		goto _32
 37675  	}
 37676  	_10_pIndex = _sqlite3FindIndex(tls, _db, *elem0(_argv, 0), elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 37677  	if _10_pIndex == nil {
 37678  		goto _35
 37679  	}
 37680  	if _sqlite3GetInt32(tls, *elem0(_argv, uintptr(1)), &_10_pIndex.Xtnum) == int32(0) {
 37681  		_corruptSchema(tls, _pData, *elem0(_argv, 0), str(50341))
 37682  	}
 37683  _35:
 37684  _32:
 37685  	return int32(0)
 37686  }
 37687  
 37688  var _sqlite3InitCallbackØ00__func__Ø000 [20]int8
 37689  
 37690  func init() {
 37691  	crt.Xstrncpy(nil, &_sqlite3InitCallbackØ00__func__Ø000[0], str(50358), 20)
 37692  }
 37693  
 37694  // C comment
 37695  //  /*
 37696  //  ** Fill the InitData structure with an error message that indicates
 37697  //  ** that the database is corrupt.
 37698  //  */
 37699  func _corruptSchema(tls *crt.TLS, _pData *XInitData, _zObj *int8, _zExtra *int8) {
 37700  	var _1_z *int8
 37701  	var _db *Xsqlite3
 37702  	_db = (*Xsqlite3)(_pData.Xdb)
 37703  	if _db.XmallocFailed != 0 || (_db.Xflags&int32(65536)) != int32(0) {
 37704  		goto _1
 37705  	}
 37706  	if _zObj == nil {
 37707  		_zObj = str(50378)
 37708  	}
 37709  	_1_z = _sqlite3MPrintf(tls, _db, str(50380), unsafe.Pointer(_zObj))
 37710  	if _zExtra != nil {
 37711  		_1_z = _sqlite3MPrintf(tls, _db, str(50411), unsafe.Pointer(_1_z), unsafe.Pointer(_zExtra))
 37712  	}
 37713  	_sqlite3DbFree(tls, _db, unsafe.Pointer(*_pData.XpzErrMsg))
 37714  	*_pData.XpzErrMsg = _1_z
 37715  _1:
 37716  	_pData.Xrc = func() int32 {
 37717  		if _db.XmallocFailed != 0 {
 37718  			return _sqlite3NomemError(tls, int32(115702))
 37719  		}
 37720  		return _sqlite3CorruptError(tls, int32(115702))
 37721  	}()
 37722  }
 37723  
 37724  // C comment
 37725  //  /*
 37726  //  ** Return a 32-bit integer value extracted from a string.  If the
 37727  //  ** string is not an integer, just return 0.
 37728  //  */
 37729  func _sqlite3Atoi(tls *crt.TLS, _z *int8) (r0 int32) {
 37730  	var _x int32
 37731  	_x = int32(0)
 37732  	if _z != nil {
 37733  		_sqlite3GetInt32(tls, _z, &_x)
 37734  	}
 37735  	return _x
 37736  }
 37737  
 37738  // C comment
 37739  //  /*
 37740  //  ** Two versions of the official API.  Legacy and new use.  In the legacy
 37741  //  ** version, the original SQL text is not saved in the prepared statement
 37742  //  ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
 37743  //  ** sqlite3_step().  In the new version, the original SQL text is retained
 37744  //  ** and the statement is automatically recompiled if an schema change
 37745  //  ** occurs.
 37746  //  */
 37747  func Xsqlite3_prepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
 37748  	var _rc int32
 37749  	_rc = _sqlite3LockAndPrepare(tls, _db, _zSql, _nBytes, int32(0), nil, _ppStmt, _pzTail)
 37750  	func() {
 37751  		if _rc != int32(0) && _ppStmt != nil && (*_ppStmt) != nil {
 37752  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116414), unsafe.Pointer(&_sqlite3_prepareØ00__func__Ø000), unsafe.Pointer(str(50419)))
 37753  			crt.X__builtin_abort(tls)
 37754  		}
 37755  	}()
 37756  	return _rc
 37757  }
 37758  
 37759  func _sqlite3LockAndPrepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _saveSqlFlag int32, _pOld *TVdbe, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
 37760  	var _rc int32
 37761  	if _ppStmt == nil {
 37762  		return _sqlite3MisuseError(tls, int32(116341))
 37763  	}
 37764  	*_ppStmt = nil
 37765  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zSql == nil) {
 37766  		return _sqlite3MisuseError(tls, int32(116345))
 37767  	}
 37768  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 37769  	_sqlite3BtreeEnterAll(tls, _db)
 37770  	_rc = _sqlite3Prepare(tls, _db, _zSql, _nBytes, _saveSqlFlag, _pOld, _ppStmt, _pzTail)
 37771  	if _rc == int32(17) {
 37772  		Xsqlite3_finalize(tls, *_ppStmt)
 37773  		_rc = _sqlite3Prepare(tls, _db, _zSql, _nBytes, _saveSqlFlag, _pOld, _ppStmt, _pzTail)
 37774  	}
 37775  	_sqlite3BtreeLeaveAll(tls, _db)
 37776  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 37777  	func() {
 37778  		if _rc != int32(0) && (*_ppStmt) != nil {
 37779  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116356), unsafe.Pointer(&_sqlite3LockAndPrepareØ00__func__Ø000), unsafe.Pointer(str(50460)))
 37780  			crt.X__builtin_abort(tls)
 37781  		}
 37782  	}()
 37783  	return _rc
 37784  }
 37785  
 37786  // C comment
 37787  //  /*
 37788  //  ** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
 37789  //  */
 37790  func _sqlite3Prepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _saveSqlFlag int32, _pReprepare *TVdbe, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
 37791  	var _rc, _i, _4_mxLen, _12_iFirst, _12_mx int32
 37792  	var _zErrMsg, _3_zDb, _4_zSqlCopy *int8
 37793  	var _1_pBt *XBtree
 37794  	var _16_pVdbe *TVdbe
 37795  	var _sParse XParse
 37796  	var _21_pT *XTriggerPrg
 37797  	_zErrMsg = nil
 37798  	_rc = int32(0)
 37799  	crt.Xmemset(tls, unsafe.Pointer(&_sParse), int32(0), uint64(204))
 37800  	crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sParse))+uintptr(uint64(456))))), int32(0), uint64(144))
 37801  	*(**TVdbe)(unsafe.Pointer(&_sParse.XpReprepare)) = _pReprepare
 37802  	func() {
 37803  		if _ppStmt == nil || (*_ppStmt) != nil {
 37804  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116195), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(50488)))
 37805  			crt.X__builtin_abort(tls)
 37806  		}
 37807  	}()
 37808  	func() {
 37809  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 37810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116197), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(881)))
 37811  			crt.X__builtin_abort(tls)
 37812  		}
 37813  	}()
 37814  	_i = int32(0)
 37815  _5:
 37816  	if _i >= _db.XnDb {
 37817  		goto _8
 37818  	}
 37819  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 37820  	if _1_pBt == nil {
 37821  		goto _9
 37822  	}
 37823  	func() {
 37824  		if _sqlite3BtreeHoldsMutex(tls, _1_pBt) == 0 {
 37825  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116225), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(50509)))
 37826  			crt.X__builtin_abort(tls)
 37827  		}
 37828  	}()
 37829  	_rc = _sqlite3BtreeSchemaLocked(tls, _1_pBt)
 37830  	if _rc != 0 {
 37831  		_3_zDb = elem27((*XDb)(_db.XaDb), uintptr(_i)).XzDbSName
 37832  		_sqlite3ErrorWithMsg(tls, _db, _rc, str(50537), unsafe.Pointer(_3_zDb))
 37833  		goto _end_prepare
 37834  	}
 37835  _9:
 37836  	_i += 1
 37837  	goto _5
 37838  _8:
 37839  	_sqlite3VtabUnlockList(tls, _db)
 37840  	*(**Xsqlite3)(unsafe.Pointer(&_sParse.Xdb)) = _db
 37841  	if _nBytes < int32(0) || _nBytes != int32(0) && int32(*elem1(_zSql, uintptr(_nBytes-int32(1)))) == int32(0) {
 37842  		goto _15
 37843  	}
 37844  	_4_mxLen = *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(1))
 37845  	if _nBytes > _4_mxLen {
 37846  		_sqlite3ErrorWithMsg(tls, _db, int32(18), str(50567))
 37847  		_rc = _sqlite3ApiExit(tls, _db, int32(18))
 37848  		goto _end_prepare
 37849  	}
 37850  	_4_zSqlCopy = _sqlite3DbStrNDup(tls, _db, _zSql, uint64(_nBytes))
 37851  	if _4_zSqlCopy != nil {
 37852  		_sqlite3RunParser(tls, &_sParse, _4_zSqlCopy, &_zErrMsg)
 37853  		_sParse.XzTail = elem1(_zSql, uintptr(int64(uintptr(unsafe.Pointer(_sParse.XzTail))-uintptr(unsafe.Pointer(_4_zSqlCopy)))))
 37854  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_4_zSqlCopy))
 37855  		goto _18
 37856  	}
 37857  	_sParse.XzTail = elem1(_zSql, uintptr(_nBytes))
 37858  _18:
 37859  	goto _19
 37860  _15:
 37861  	_sqlite3RunParser(tls, &_sParse, _zSql, &_zErrMsg)
 37862  _19:
 37863  	func() {
 37864  		if (0) != _sParse.XnQueryLoop {
 37865  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116260), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(50586)))
 37866  			crt.X__builtin_abort(tls)
 37867  		}
 37868  	}()
 37869  	if _sParse.Xrc == int32(101) {
 37870  		_sParse.Xrc = int32(0)
 37871  	}
 37872  	if _sParse.XcheckSchema != 0 {
 37873  		_schemaIsValid(tls, &_sParse)
 37874  	}
 37875  	if _db.XmallocFailed != 0 {
 37876  		_sParse.Xrc = _sqlite3NomemError(tls, int32(116267))
 37877  	}
 37878  	if _pzTail != nil {
 37879  		*_pzTail = _sParse.XzTail
 37880  	}
 37881  	_rc = _sParse.Xrc
 37882  	if _rc != int32(0) || _sParse.XpVdbe == nil || _sParse.Xexplain == 0 {
 37883  		goto _28
 37884  	}
 37885  	if int32(_sParse.Xexplain) == int32(2) {
 37886  		_sqlite3VdbeSetNumCols(tls, (*TVdbe)(_sParse.XpVdbe), int32(4))
 37887  		_12_iFirst = int32(8)
 37888  		_12_mx = int32(12)
 37889  		goto _30
 37890  	}
 37891  	_sqlite3VdbeSetNumCols(tls, (*TVdbe)(_sParse.XpVdbe), int32(8))
 37892  	_12_iFirst = int32(0)
 37893  	_12_mx = int32(8)
 37894  _30:
 37895  	_i = _12_iFirst
 37896  _31:
 37897  	if _i >= _12_mx {
 37898  		goto _34
 37899  	}
 37900  	_sqlite3VdbeSetColName(tls, (*TVdbe)(_sParse.XpVdbe), _i-_12_iFirst, int32(0), *elem0((**int8)(unsafe.Pointer(&_sqlite3PrepareØ00azColNameØ001)), uintptr(_i)), nil)
 37901  	_i += 1
 37902  	goto _31
 37903  _34:
 37904  _28:
 37905  	if int32(_db.Xinit.Xbusy) == int32(0) {
 37906  		_16_pVdbe = (*TVdbe)(_sParse.XpVdbe)
 37907  		_sqlite3VdbeSetSql(tls, _16_pVdbe, _zSql, int32(int64(uintptr(unsafe.Pointer(_sParse.XzTail))-uintptr(unsafe.Pointer(_zSql)))), _saveSqlFlag)
 37908  	}
 37909  	if (_sParse.XpVdbe != nil) && ((_rc != int32(0)) || (_db.XmallocFailed != 0)) {
 37910  		_sqlite3VdbeFinalize(tls, (*TVdbe)(_sParse.XpVdbe))
 37911  		func() {
 37912  			if (*_ppStmt) != nil {
 37913  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116303), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(50607)))
 37914  				crt.X__builtin_abort(tls)
 37915  			}
 37916  		}()
 37917  		goto _41
 37918  	}
 37919  	*_ppStmt = _sParse.XpVdbe
 37920  _41:
 37921  	if _zErrMsg != nil {
 37922  		_sqlite3ErrorWithMsg(tls, _db, _rc, str(24531), unsafe.Pointer(_zErrMsg))
 37923  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg))
 37924  		goto _43
 37925  	}
 37926  	_sqlite3Error(tls, _db, _rc)
 37927  _43:
 37928  	if _sParse.XpTriggerPrg != nil {
 37929  		_21_pT = (*XTriggerPrg)(_sParse.XpTriggerPrg)
 37930  		*(**XTriggerPrg)(unsafe.Pointer(&_sParse.XpTriggerPrg)) = (*XTriggerPrg)(_21_pT.XpNext)
 37931  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_21_pT))
 37932  		goto _43
 37933  	}
 37934  _end_prepare:
 37935  	_sqlite3ParserReset(tls, &_sParse)
 37936  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 37937  	func() {
 37938  		if (_rc & _db.XerrMask) != _rc {
 37939  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116326), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(50618)))
 37940  			crt.X__builtin_abort(tls)
 37941  		}
 37942  	}()
 37943  	return _rc
 37944  }
 37945  
 37946  var _sqlite3PrepareØ00__func__Ø000 [15]int8
 37947  
 37948  func init() {
 37949  	crt.Xstrncpy(nil, &_sqlite3PrepareØ00__func__Ø000[0], str(50639), 15)
 37950  }
 37951  
 37952  // C comment
 37953  //  /*
 37954  //  ** Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared
 37955  //  ** btree as the argument handle holds an exclusive lock on the
 37956  //  ** sqlite_master table. Otherwise SQLITE_OK.
 37957  //  */
 37958  func _sqlite3BtreeSchemaLocked(tls *crt.TLS, _p *XBtree) (r0 int32) {
 37959  	var _rc int32
 37960  	func() {
 37961  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 37962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68723), unsafe.Pointer(&_sqlite3BtreeSchemaLockedØ00__func__Ø000), unsafe.Pointer(str(8939)))
 37963  			crt.X__builtin_abort(tls)
 37964  		}
 37965  	}()
 37966  	_sqlite3BtreeEnter(tls, _p)
 37967  	_rc = _querySharedCacheTableLock(tls, _p, uint32(1), uint8(1))
 37968  	func() {
 37969  		if _rc != int32(0) && _rc != int32(262) {
 37970  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68726), unsafe.Pointer(&_sqlite3BtreeSchemaLockedØ00__func__Ø000), unsafe.Pointer(str(50654)))
 37971  			crt.X__builtin_abort(tls)
 37972  		}
 37973  	}()
 37974  	_sqlite3BtreeLeave(tls, _p)
 37975  	return _rc
 37976  }
 37977  
 37978  var _sqlite3BtreeSchemaLockedØ00__func__Ø000 [25]int8
 37979  
 37980  func init() {
 37981  	crt.Xstrncpy(nil, &_sqlite3BtreeSchemaLockedØ00__func__Ø000[0], str(50701), 25)
 37982  }
 37983  
 37984  // C comment
 37985  //  /*
 37986  //  ** Query to see if Btree handle p may obtain a lock of type eLock
 37987  //  ** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return
 37988  //  ** SQLITE_OK if the lock may be obtained (by calling
 37989  //  ** setSharedCacheTableLock()), or SQLITE_LOCKED if not.
 37990  //  */
 37991  func _querySharedCacheTableLock(tls *crt.TLS, _p *XBtree, _iTab uint32, _eLock uint8) (r0 int32) {
 37992  	var _pBt *XBtShared
 37993  	var _pIter *XBtLock
 37994  	_pBt = (*XBtShared)(_p.XpBt)
 37995  	func() {
 37996  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 37997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59285), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(17442)))
 37998  			crt.X__builtin_abort(tls)
 37999  		}
 38000  	}()
 38001  	func() {
 38002  		if int32(_eLock) != int32(1) && int32(_eLock) != int32(2) {
 38003  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59286), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50726)))
 38004  			crt.X__builtin_abort(tls)
 38005  		}
 38006  	}()
 38007  	func() {
 38008  		if (*Xsqlite3)(_p.Xdb) == nil {
 38009  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59287), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(23631)))
 38010  			crt.X__builtin_abort(tls)
 38011  		}
 38012  	}()
 38013  	func() {
 38014  		if (((*Xsqlite3)(_p.Xdb).Xflags)&int32(16384)) != 0 && int32(_eLock) != int32(2) && _iTab != uint32(1) {
 38015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59288), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50764)))
 38016  			crt.X__builtin_abort(tls)
 38017  		}
 38018  	}()
 38019  	func() {
 38020  		if int32(_eLock) != int32(1) && (_p != (*XBtree)(_pBt.XpWriter) || int32(_p.XinTrans) != int32(2)) {
 38021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59294), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50831)))
 38022  			crt.X__builtin_abort(tls)
 38023  		}
 38024  	}()
 38025  	func() {
 38026  		if int32(_eLock) != int32(1) && int32(_pBt.XinTransaction) != int32(2) {
 38027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59295), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50896)))
 38028  			crt.X__builtin_abort(tls)
 38029  		}
 38030  	}()
 38031  	if _p.Xsharable == 0 {
 38032  		return int32(0)
 38033  	}
 38034  	if ((*XBtree)(_pBt.XpWriter) != _p) && ((int32(_pBt.XbtsFlags) & int32(32)) != int32(0)) {
 38035  		return int32(262)
 38036  	}
 38037  	_pIter = (*XBtLock)(_pBt.XpLock)
 38038  _21:
 38039  	if _pIter == nil {
 38040  		goto _24
 38041  	}
 38042  	func() {
 38043  		if int32(_pIter.XeLock) != int32(1) && int32(_pIter.XeLock) != int32(2) {
 38044  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59320), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50948)))
 38045  			crt.X__builtin_abort(tls)
 38046  		}
 38047  	}()
 38048  	func() {
 38049  		if int32(_eLock) != int32(1) && (*XBtree)(_pIter.XpBtree) != _p && int32(_pIter.XeLock) != int32(1) {
 38050  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59321), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(51000)))
 38051  			crt.X__builtin_abort(tls)
 38052  		}
 38053  	}()
 38054  	if (*XBtree)(_pIter.XpBtree) == _p || _pIter.XiTable != _iTab || int32(_pIter.XeLock) == int32(_eLock) {
 38055  		goto _34
 38056  	}
 38057  	if int32(_eLock) == int32(2) {
 38058  		func() {
 38059  			if _p != (*XBtree)(_pBt.XpWriter) {
 38060  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59325), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(51064)))
 38061  				crt.X__builtin_abort(tls)
 38062  			}
 38063  		}()
 38064  		{
 38065  			p := &_pBt.XbtsFlags
 38066  			*p = uint16(int32(*p) | int32(64))
 38067  		}
 38068  	}
 38069  	return int32(262)
 38070  
 38071  _34:
 38072  	_pIter = (*XBtLock)(_pIter.XpNext)
 38073  	goto _21
 38074  _24:
 38075  	return int32(0)
 38076  }
 38077  
 38078  var _querySharedCacheTableLockØ00__func__Ø000 [26]int8
 38079  
 38080  func init() {
 38081  	crt.Xstrncpy(nil, &_querySharedCacheTableLockØ00__func__Ø000[0], str(51080), 26)
 38082  }
 38083  
 38084  // C comment
 38085  //  /*
 38086  //  ** Check schema cookies in all databases.  If any cookie is out
 38087  //  ** of date set pParse->rc to SQLITE_SCHEMA.  If all schema cookies
 38088  //  ** make no changes to pParse->rc.
 38089  //  */
 38090  func _schemaIsValid(tls *crt.TLS, _pParse *XParse) {
 38091  	var _iDb, _rc, _cookie, _1_openedTransaction int32
 38092  	var _db *Xsqlite3
 38093  	var _1_pBt *XBtree
 38094  	_db = (*Xsqlite3)(_pParse.Xdb)
 38095  	func() {
 38096  		if _pParse.XcheckSchema == 0 {
 38097  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116091), unsafe.Pointer(&_schemaIsValidØ00__func__Ø000), unsafe.Pointer(str(51106)))
 38098  			crt.X__builtin_abort(tls)
 38099  		}
 38100  	}()
 38101  	func() {
 38102  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 38103  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116092), unsafe.Pointer(&_schemaIsValidØ00__func__Ø000), unsafe.Pointer(str(881)))
 38104  			crt.X__builtin_abort(tls)
 38105  		}
 38106  	}()
 38107  	_iDb = int32(0)
 38108  _4:
 38109  	if _iDb >= _db.XnDb {
 38110  		goto _7
 38111  	}
 38112  	_1_openedTransaction = int32(0)
 38113  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt)
 38114  	if _1_pBt == nil {
 38115  		goto _5
 38116  	}
 38117  	if _sqlite3BtreeIsInReadTrans(tls, _1_pBt) != 0 {
 38118  		goto _9
 38119  	}
 38120  	_rc = _sqlite3BtreeBeginTrans(tls, _1_pBt, int32(0))
 38121  	if (_rc == int32(7)) || (_rc == int32(3082)) {
 38122  		_sqlite3OomFault(tls, _db)
 38123  	}
 38124  	if _rc != int32(0) {
 38125  		return
 38126  	}
 38127  	_1_openedTransaction = int32(1)
 38128  _9:
 38129  	_sqlite3BtreeGetMeta(tls, _1_pBt, int32(1), (*uint32)(unsafe.Pointer(&_cookie)))
 38130  	func() {
 38131  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 38132  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116114), unsafe.Pointer(&_schemaIsValidØ00__func__Ø000), unsafe.Pointer(str(51126)))
 38133  			crt.X__builtin_abort(tls)
 38134  		}
 38135  	}()
 38136  	if _cookie != ((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).Xschema_cookie) {
 38137  		_sqlite3ResetOneSchema(tls, _db, _iDb)
 38138  		_pParse.Xrc = int32(17)
 38139  	}
 38140  	if _1_openedTransaction != 0 {
 38141  		_sqlite3BtreeCommit(tls, _1_pBt)
 38142  	}
 38143  _5:
 38144  	_iDb += 1
 38145  	goto _4
 38146  _7:
 38147  }
 38148  
 38149  var _schemaIsValidØ00__func__Ø000 [14]int8
 38150  
 38151  func init() {
 38152  	crt.Xstrncpy(nil, &_schemaIsValidØ00__func__Ø000[0], str(51161), 14)
 38153  }
 38154  
 38155  // C comment
 38156  //  /*
 38157  //  ** Return non-zero if a read (or write) transaction is active.
 38158  //  */
 38159  func _sqlite3BtreeIsInReadTrans(tls *crt.TLS, _p *XBtree) (r0 int32) {
 38160  	func() {
 38161  		if _p == nil {
 38162  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68674), unsafe.Pointer(&_sqlite3BtreeIsInReadTransØ00__func__Ø000), unsafe.Pointer(str(9615)))
 38163  			crt.X__builtin_abort(tls)
 38164  		}
 38165  	}()
 38166  	func() {
 38167  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 38168  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68675), unsafe.Pointer(&_sqlite3BtreeIsInReadTransØ00__func__Ø000), unsafe.Pointer(str(8939)))
 38169  			crt.X__builtin_abort(tls)
 38170  		}
 38171  	}()
 38172  	return bool2int(int32(_p.XinTrans) != int32(0))
 38173  }
 38174  
 38175  var _sqlite3BtreeIsInReadTransØ00__func__Ø000 [26]int8
 38176  
 38177  func init() {
 38178  	crt.Xstrncpy(nil, &_sqlite3BtreeIsInReadTransØ00__func__Ø000[0], str(51175), 26)
 38179  }
 38180  
 38181  // C comment
 38182  //  /*
 38183  //  ** Attempt to start a new transaction. A write-transaction
 38184  //  ** is started if the second argument is nonzero, otherwise a read-
 38185  //  ** transaction.  If the second argument is 2 or more and exclusive
 38186  //  ** transaction is started, meaning that no other process is allowed
 38187  //  ** to access the database.  A preexisting transaction may not be
 38188  //  ** upgraded to exclusive by calling this routine a second time - the
 38189  //  ** exclusivity flag only works for a new transaction.
 38190  //  **
 38191  //  ** A write-transaction must be started before attempting any
 38192  //  ** changes to the database.  None of the following routines
 38193  //  ** will work unless a transaction is started first:
 38194  //  **
 38195  //  **      sqlite3BtreeCreateTable()
 38196  //  **      sqlite3BtreeCreateIndex()
 38197  //  **      sqlite3BtreeClearTable()
 38198  //  **      sqlite3BtreeDropTable()
 38199  //  **      sqlite3BtreeInsert()
 38200  //  **      sqlite3BtreeDelete()
 38201  //  **      sqlite3BtreeUpdateMeta()
 38202  //  **
 38203  //  ** If an initial attempt to acquire the lock fails because of lock contention
 38204  //  ** and the database was previously unlocked, then invoke the busy handler
 38205  //  ** if there is one.  But if there was previously a read-lock, do not
 38206  //  ** invoke the busy handler - just return SQLITE_BUSY.  SQLITE_BUSY is
 38207  //  ** returned when there is already a read-lock in order to avoid a deadlock.
 38208  //  **
 38209  //  ** Suppose there are two processes A and B.  A has a read lock and B has
 38210  //  ** a reserved lock.  B tries to promote to exclusive but is blocked because
 38211  //  ** of A's read lock.  A tries to promote to reserved but is blocked by B.
 38212  //  ** One or the other of the two processes must give way or there can be
 38213  //  ** no progress.  By returning SQLITE_BUSY and not invoking the busy callback
 38214  //  ** when A already has a read lock, we encourage A to give up and let B
 38215  //  ** proceed.
 38216  //  */
 38217  func _sqlite3BtreeBeginTrans(tls *crt.TLS, _p *XBtree, _wrflag int32) (r0 int32) {
 38218  	var _rc int32
 38219  	var _3_pBlock *Xsqlite3
 38220  	var _pBt *XBtShared
 38221  	var _5_pIter *XBtLock
 38222  	var _19_pPage1 *XMemPage
 38223  	_pBt = (*XBtShared)(_p.XpBt)
 38224  	_rc = int32(0)
 38225  	_sqlite3BtreeEnter(tls, _p)
 38226  	func() {
 38227  		if int32((*XBtShared)(_p.XpBt).XinTransaction) == int32(0) && ((*XBtShared)(_p.XpBt).XnTransaction) != int32(0) {
 38228  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62247), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(9932)))
 38229  			crt.X__builtin_abort(tls)
 38230  		}
 38231  	}()
 38232  	func() {
 38233  		if int32((*XBtShared)(_p.XpBt).XinTransaction) < int32(_p.XinTrans) {
 38234  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62247), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(9993)))
 38235  			crt.X__builtin_abort(tls)
 38236  		}
 38237  	}()
 38238  	if (int32(_p.XinTrans) == int32(2)) || ((int32(_p.XinTrans) == int32(1)) && (_wrflag == 0)) {
 38239  		goto _trans_begun
 38240  	}
 38241  	func() {
 38242  		if int32(_pBt.XinTransaction) != int32(2) && int32(_pBt.XbDoTruncate) != int32(0) {
 38243  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62256), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(51201)))
 38244  			crt.X__builtin_abort(tls)
 38245  		}
 38246  	}()
 38247  	if ((int32(_pBt.XbtsFlags) & int32(1)) != int32(0)) && _wrflag != 0 {
 38248  		_rc = int32(8)
 38249  		goto _trans_begun
 38250  	}
 38251  	_3_pBlock = nil
 38252  	if (_wrflag != 0 && (int32(_pBt.XinTransaction) == int32(2))) || ((int32(_pBt.XbtsFlags) & int32(64)) != int32(0)) {
 38253  		_3_pBlock = (*Xsqlite3)((*XBtree)(_pBt.XpWriter).Xdb)
 38254  		goto _17
 38255  	}
 38256  	if _wrflag <= int32(1) {
 38257  		goto _17
 38258  	}
 38259  	_5_pIter = (*XBtLock)(_pBt.XpLock)
 38260  _18:
 38261  	if _5_pIter == nil {
 38262  		goto _21
 38263  	}
 38264  	if (*XBtree)(_5_pIter.XpBtree) != _p {
 38265  		_3_pBlock = (*Xsqlite3)((*XBtree)(_5_pIter.XpBtree).Xdb)
 38266  		goto _21
 38267  	}
 38268  	_5_pIter = (*XBtLock)(_5_pIter.XpNext)
 38269  	goto _18
 38270  _21:
 38271  _17:
 38272  	if _3_pBlock != nil {
 38273  		_rc = int32(262)
 38274  		goto _trans_begun
 38275  	}
 38276  	_rc = _querySharedCacheTableLock(tls, _p, uint32(1), uint8(1))
 38277  	if int32(0) != _rc {
 38278  		goto _trans_begun
 38279  	}
 38280  	{
 38281  		p := &_pBt.XbtsFlags
 38282  		*p = uint16(int32(*p) & int32(-9))
 38283  	}
 38284  	if _pBt.XnPage == (0) {
 38285  		{
 38286  			p := &_pBt.XbtsFlags
 38287  			*p = uint16(int32(*p) | int32(8))
 38288  		}
 38289  	}
 38290  _25:
 38291  _27:
 38292  	if ((*XMemPage)(_pBt.XpPage1) == nil) && (int32(0) == store2(&_rc, _lockBtree(tls, _pBt))) {
 38293  		goto _27
 38294  	}
 38295  	if _rc != int32(0) || _wrflag == 0 {
 38296  		goto _31
 38297  	}
 38298  	if (int32(_pBt.XbtsFlags) & int32(1)) != int32(0) {
 38299  		_rc = int32(8)
 38300  		goto _33
 38301  	}
 38302  	_rc = _sqlite3PagerBegin(tls, (*XPager)(_pBt.XpPager), bool2int(_wrflag > int32(1)), _sqlite3TempInMemory(tls, (*Xsqlite3)(_p.Xdb)))
 38303  	if _rc == int32(0) {
 38304  		_rc = _newDatabase(tls, _pBt)
 38305  	}
 38306  _33:
 38307  _31:
 38308  	if _rc != int32(0) {
 38309  		_unlockBtreeIfUnused(tls, _pBt)
 38310  	}
 38311  	if (((_rc & int32(255)) == int32(5)) && (int32(_pBt.XinTransaction) == int32(0))) && _btreeInvokeBusyHandler(tls, unsafe.Pointer(_pBt)) != 0 {
 38312  		goto _25
 38313  	}
 38314  	if _rc != int32(0) {
 38315  		goto _trans_begun
 38316  	}
 38317  	if int32(_p.XinTrans) != int32(0) {
 38318  		goto _39
 38319  	}
 38320  	_pBt.XnTransaction += 1
 38321  	if _p.Xsharable != 0 {
 38322  		func() {
 38323  			if (*XBtree)(_p.Xlock.XpBtree) != _p || (_p.Xlock.XiTable) != uint32(1) {
 38324  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62332), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(51269)))
 38325  				crt.X__builtin_abort(tls)
 38326  			}
 38327  		}()
 38328  		_p.Xlock.XeLock = uint8(1)
 38329  		*(**XBtLock)(unsafe.Pointer(&(_p.Xlock.XpNext))) = (*XBtLock)(_pBt.XpLock)
 38330  		*(**XBtLock)(unsafe.Pointer(&_pBt.XpLock)) = &_p.Xlock
 38331  	}
 38332  _39:
 38333  	_p.XinTrans = uint8(func() int32 {
 38334  		if _wrflag != 0 {
 38335  			return int32(2)
 38336  		}
 38337  		return int32(1)
 38338  	}())
 38339  	if int32(_p.XinTrans) > int32(_pBt.XinTransaction) {
 38340  		_pBt.XinTransaction = _p.XinTrans
 38341  	}
 38342  	if _wrflag == 0 {
 38343  		goto _47
 38344  	}
 38345  	_19_pPage1 = (*XMemPage)(_pBt.XpPage1)
 38346  	func() {
 38347  		if _pBt.XpWriter != nil {
 38348  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62346), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(51308)))
 38349  			crt.X__builtin_abort(tls)
 38350  		}
 38351  	}()
 38352  	*(**XBtree)(unsafe.Pointer(&_pBt.XpWriter)) = _p
 38353  	{
 38354  		p := &_pBt.XbtsFlags
 38355  		*p = uint16(int32(*p) & int32(-33))
 38356  	}
 38357  	if _wrflag > int32(1) {
 38358  		{
 38359  			p := &_pBt.XbtsFlags
 38360  			*p = uint16(int32(*p) | int32(32))
 38361  		}
 38362  	}
 38363  	if _pBt.XnPage == _sqlite3Get4byte(tls, elem15(_19_pPage1.XaData, uintptr(28))) {
 38364  		goto _51
 38365  	}
 38366  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_19_pPage1.XpDbPage))
 38367  	if _rc == int32(0) {
 38368  		_sqlite3Put4byte(tls, elem15(_19_pPage1.XaData, uintptr(28)), _pBt.XnPage)
 38369  	}
 38370  _51:
 38371  _47:
 38372  _trans_begun:
 38373  	if (_rc == int32(0)) && _wrflag != 0 {
 38374  		_rc = _sqlite3PagerOpenSavepoint(tls, (*XPager)(_pBt.XpPager), (*Xsqlite3)(_p.Xdb).XnSavepoint)
 38375  	}
 38376  	func() {
 38377  		if int32((*XBtShared)(_p.XpBt).XinTransaction) == int32(0) && ((*XBtShared)(_p.XpBt).XnTransaction) != int32(0) {
 38378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62377), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(9932)))
 38379  			crt.X__builtin_abort(tls)
 38380  		}
 38381  	}()
 38382  	func() {
 38383  		if int32((*XBtShared)(_p.XpBt).XinTransaction) < int32(_p.XinTrans) {
 38384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62377), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(9993)))
 38385  			crt.X__builtin_abort(tls)
 38386  		}
 38387  	}()
 38388  	_sqlite3BtreeLeave(tls, _p)
 38389  	return _rc
 38390  }
 38391  
 38392  var _sqlite3BtreeBeginTransØ00__func__Ø000 [23]int8
 38393  
 38394  func init() {
 38395  	crt.Xstrncpy(nil, &_sqlite3BtreeBeginTransØ00__func__Ø000[0], str(51322), 23)
 38396  }
 38397  
 38398  // C comment
 38399  //  /*
 38400  //  ** Get a reference to pPage1 of the database file.  This will
 38401  //  ** also acquire a readlock on that file.
 38402  //  **
 38403  //  ** SQLITE_OK is returned on success.  If the file is not a
 38404  //  ** well-formed database file, then SQLITE_CORRUPT is returned.
 38405  //  ** SQLITE_BUSY is returned if the database is locked.  SQLITE_NOMEM
 38406  //  ** is returned if we run out of memory.
 38407  //  */
 38408  func _lockBtree(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
 38409  	var _rc, _nPage, _nPageFile, _nPageHeader, _6_isOpen int32
 38410  	var _2_pageSize, _2_usableSize uint32
 38411  	var _2_page1 *uint8
 38412  	var _pPage1 *XMemPage
 38413  	_nPageFile = int32(0)
 38414  	func() {
 38415  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 38416  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61941), unsafe.Pointer(&_lockBtreeØ00__func__Ø000), unsafe.Pointer(str(9235)))
 38417  			crt.X__builtin_abort(tls)
 38418  		}
 38419  	}()
 38420  	func() {
 38421  		if (*XMemPage)(_pBt.XpPage1) != nil {
 38422  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61942), unsafe.Pointer(&_lockBtreeØ00__func__Ø000), unsafe.Pointer(str(51345)))
 38423  			crt.X__builtin_abort(tls)
 38424  		}
 38425  	}()
 38426  	_rc = _sqlite3PagerSharedLock(tls, (*XPager)(_pBt.XpPager))
 38427  	if _rc != int32(0) {
 38428  		return _rc
 38429  	}
 38430  	_rc = _btreeGetPage(tls, _pBt, uint32(1), &_pPage1, int32(0))
 38431  	if _rc != int32(0) {
 38432  		return _rc
 38433  	}
 38434  	_nPage = store2(&_nPageHeader, int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(int32(28))+uintptr(unsafe.Pointer(_pPage1.XaData)))))))
 38435  	_sqlite3PagerPagecount(tls, (*XPager)(_pBt.XpPager), &_nPageFile)
 38436  	if (_nPage == int32(0)) || (crt.Xmemcmp(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(24))+uintptr(unsafe.Pointer(_pPage1.XaData))))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(92))+uintptr(unsafe.Pointer(_pPage1.XaData))))), uint64(4)) != int32(0)) {
 38437  		_nPage = _nPageFile
 38438  	}
 38439  	if _nPage <= int32(0) {
 38440  		goto _8
 38441  	}
 38442  	_2_page1 = _pPage1.XaData
 38443  	_rc = int32(26)
 38444  	if crt.Xmemcmp(tls, unsafe.Pointer(_2_page1), unsafe.Pointer(&_zMagicHeader), uint64(16)) != int32(0) {
 38445  		goto _page1_init_failed
 38446  	}
 38447  	if int32(*elem15(_2_page1, uintptr(18))) > int32(2) {
 38448  		{
 38449  			p := &_pBt.XbtsFlags
 38450  			*p = uint16(int32(*p) | int32(1))
 38451  		}
 38452  	}
 38453  	if int32(*elem15(_2_page1, uintptr(19))) > int32(2) {
 38454  		goto _page1_init_failed
 38455  	}
 38456  	if int32(*elem15(_2_page1, uintptr(19))) != int32(2) || (int32(_pBt.XbtsFlags)&int32(16)) != int32(0) {
 38457  		goto _13
 38458  	}
 38459  	_6_isOpen = int32(0)
 38460  	_rc = _sqlite3PagerOpenWal(tls, (*XPager)(_pBt.XpPager), &_6_isOpen)
 38461  	if _rc != int32(0) {
 38462  		goto _page1_init_failed
 38463  	}
 38464  	if _6_isOpen == int32(0) {
 38465  		_releasePage(tls, _pPage1)
 38466  		return int32(0)
 38467  	}
 38468  	_rc = int32(26)
 38469  	goto _17
 38470  _13:
 38471  _17:
 38472  	if crt.Xmemcmp(tls, unsafe.Pointer(elem15(_2_page1, uintptr(21))), unsafe.Pointer(str(51360)), uint64(3)) != int32(0) {
 38473  		goto _page1_init_failed
 38474  	}
 38475  	_2_pageSize = uint32((int32(*elem15(_2_page1, uintptr(16))) << 8) | (int32(*elem15(_2_page1, uintptr(17))) << 16))
 38476  	if ((((_2_pageSize - uint32(1)) & _2_pageSize) != (0)) || (_2_pageSize > uint32(65536))) || (_2_pageSize <= uint32(256)) {
 38477  		goto _page1_init_failed
 38478  	}
 38479  	func() {
 38480  		if (_2_pageSize & uint32(7)) != (0) {
 38481  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62030), unsafe.Pointer(&_lockBtreeØ00__func__Ø000), unsafe.Pointer(str(51364)))
 38482  			crt.X__builtin_abort(tls)
 38483  		}
 38484  	}()
 38485  	_2_usableSize = _2_pageSize - uint32(*elem15(_2_page1, uintptr(20)))
 38486  	if _2_pageSize != _pBt.XpageSize {
 38487  		_releasePage(tls, _pPage1)
 38488  		_pBt.XusableSize = _2_usableSize
 38489  		_pBt.XpageSize = _2_pageSize
 38490  		_freeTempSpace(tls, _pBt)
 38491  		_rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.XpPager), &_pBt.XpageSize, int32(_2_pageSize-_2_usableSize))
 38492  		return _rc
 38493  	}
 38494  	if ((((*Xsqlite3)(_pBt.Xdb).Xflags) & int32(65536)) == int32(0)) && (_nPage > _nPageFile) {
 38495  		_rc = _sqlite3CorruptError(tls, int32(62055))
 38496  		goto _page1_init_failed
 38497  	}
 38498  	if _2_usableSize < uint32(480) {
 38499  		goto _page1_init_failed
 38500  	}
 38501  	_pBt.XpageSize = _2_pageSize
 38502  	_pBt.XusableSize = _2_usableSize
 38503  	_pBt.XautoVacuum = uint8(func() int32 {
 38504  		if _sqlite3Get4byte(tls, elem15(_2_page1, uintptr(52))) != 0 {
 38505  			return int32(1)
 38506  		}
 38507  		return int32(0)
 38508  	}())
 38509  	_pBt.XincrVacuum = uint8(func() int32 {
 38510  		if _sqlite3Get4byte(tls, elem15(_2_page1, uintptr(64))) != 0 {
 38511  			return int32(1)
 38512  		}
 38513  		return int32(0)
 38514  	}())
 38515  _8:
 38516  	_pBt.XmaxLocal = uint16((((_pBt.XusableSize - uint32(12)) * uint32(64)) / uint32(255)) - uint32(23))
 38517  	_pBt.XminLocal = uint16((((_pBt.XusableSize - uint32(12)) * uint32(32)) / uint32(255)) - uint32(23))
 38518  	_pBt.XmaxLeaf = uint16(_pBt.XusableSize - uint32(35))
 38519  	_pBt.XminLeaf = uint16((((_pBt.XusableSize - uint32(12)) * uint32(32)) / uint32(255)) - uint32(23))
 38520  	if int32(_pBt.XmaxLocal) > int32(127) {
 38521  		_pBt.Xmax1bytePayload = uint8(127)
 38522  		goto _33
 38523  	}
 38524  	_pBt.Xmax1bytePayload = uint8(_pBt.XmaxLocal)
 38525  _33:
 38526  	func() {
 38527  		if (int32(_pBt.XmaxLeaf) + int32(23)) > int32(_pBt.XpageSize-uint32(8)) {
 38528  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62094), unsafe.Pointer(&_lockBtreeØ00__func__Ø000), unsafe.Pointer(str(51382)))
 38529  			crt.X__builtin_abort(tls)
 38530  		}
 38531  	}()
 38532  	*(**XMemPage)(unsafe.Pointer(&_pBt.XpPage1)) = _pPage1
 38533  	_pBt.XnPage = uint32(_nPage)
 38534  	return int32(0)
 38535  
 38536  _page1_init_failed:
 38537  	_releasePage(tls, _pPage1)
 38538  	*(**XMemPage)(unsafe.Pointer(&_pBt.XpPage1)) = nil
 38539  	return _rc
 38540  
 38541  	_ = _nPageHeader
 38542  	panic(0)
 38543  }
 38544  
 38545  var _lockBtreeØ00__func__Ø000 [10]int8
 38546  
 38547  func init() {
 38548  	crt.Xstrncpy(nil, &_lockBtreeØ00__func__Ø000[0], str(51421), 10)
 38549  }
 38550  
 38551  // C comment
 38552  //  /*
 38553  //  ** This function is called to obtain a shared lock on the database file.
 38554  //  ** It is illegal to call sqlite3PagerGet() until after this function
 38555  //  ** has been successfully called. If a shared-lock is already held when
 38556  //  ** this function is called, it is a no-op.
 38557  //  **
 38558  //  ** The following operations are also performed by this function.
 38559  //  **
 38560  //  **   1) If the pager is currently in PAGER_OPEN state (no lock held
 38561  //  **      on the database file), then an attempt is made to obtain a
 38562  //  **      SHARED lock on the database file. Immediately after obtaining
 38563  //  **      the SHARED lock, the file-system is checked for a hot-journal,
 38564  //  **      which is played back if present. Following any hot-journal
 38565  //  **      rollback, the contents of the cache are validated by checking
 38566  //  **      the 'change-counter' field of the database file header and
 38567  //  **      discarded if they are found to be invalid.
 38568  //  **
 38569  //  **   2) If the pager is running in exclusive-mode, and there are currently
 38570  //  **      no outstanding references to any pages, and is in the error state,
 38571  //  **      then an attempt is made to clear the error state by discarding
 38572  //  **      the contents of the page cache and rolling back any open journal
 38573  //  **      file.
 38574  //  **
 38575  //  ** If everything is successful, SQLITE_OK is returned. If an IO error
 38576  //  ** occurs while locking the database, checking for a hot-journal file or
 38577  //  ** rolling back a journal file, the IO error code is returned.
 38578  //  */
 38579  func _sqlite3PagerSharedLock(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 38580  	var _rc, _1_bHotJournal, _8_bExists, _9_fout, _9_f int32
 38581  	var _15_nPage uint32
 38582  	var _15_dbFileVers [16]int8
 38583  	var _8_pVfs *Xsqlite3_vfs
 38584  	_rc = int32(0)
 38585  	func() {
 38586  		if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache)) != int32(0) {
 38587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52037), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51431)))
 38588  			crt.X__builtin_abort(tls)
 38589  		}
 38590  	}()
 38591  	func() {
 38592  		if _assert_pager_state(tls, _pPager) == 0 {
 38593  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52038), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(10971)))
 38594  			crt.X__builtin_abort(tls)
 38595  		}
 38596  	}()
 38597  	func() {
 38598  		if int32(_pPager.XeState) != int32(0) && int32(_pPager.XeState) != int32(1) {
 38599  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52039), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51473)))
 38600  			crt.X__builtin_abort(tls)
 38601  		}
 38602  	}()
 38603  	func() {
 38604  		if _pPager.XerrCode != int32(0) {
 38605  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52040), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(11709)))
 38606  			crt.X__builtin_abort(tls)
 38607  		}
 38608  	}()
 38609  	if (*XWal)(_pPager.XpWal) != nil || int32(_pPager.XeState) != int32(0) {
 38610  		goto _10
 38611  	}
 38612  	_1_bHotJournal = int32(1)
 38613  	func() {
 38614  		if _pPager.XmemDb != 0 {
 38615  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52045), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(11702)))
 38616  			crt.X__builtin_abort(tls)
 38617  		}
 38618  	}()
 38619  	func() {
 38620  		if int32(_pPager.XtempFile) != int32(0) && int32(_pPager.XeLock) != int32(4) {
 38621  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52046), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51532)))
 38622  			crt.X__builtin_abort(tls)
 38623  		}
 38624  	}()
 38625  	_rc = _pager_wait_on_lock(tls, _pPager, int32(1))
 38626  	if _rc != int32(0) {
 38627  		func() {
 38628  			if int32(_pPager.XeLock) != int32(0) && int32(_pPager.XeLock) != int32(5) {
 38629  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52050), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51585)))
 38630  				crt.X__builtin_abort(tls)
 38631  			}
 38632  		}()
 38633  		goto _failed
 38634  	}
 38635  	if int32(_pPager.XeLock) <= int32(1) {
 38636  		_rc = _hasHotJournal(tls, _pPager, &_1_bHotJournal)
 38637  	}
 38638  	if _rc != int32(0) {
 38639  		goto _failed
 38640  	}
 38641  	if _1_bHotJournal == 0 {
 38642  		goto _22
 38643  	}
 38644  	if _pPager.XreadOnly != 0 {
 38645  		_rc = int32(776)
 38646  		goto _failed
 38647  	}
 38648  	_rc = _pagerLockDb(tls, _pPager, int32(4))
 38649  	if _rc != int32(0) {
 38650  		goto _failed
 38651  	}
 38652  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil {
 38653  		goto _25
 38654  	}
 38655  	_8_pVfs = (*Xsqlite3_vfs)(_pPager.XpVfs)
 38656  	_rc = _sqlite3OsAccess(tls, _8_pVfs, _pPager.XzJournal, int32(0), &_8_bExists)
 38657  	if _rc != int32(0) || _8_bExists == 0 {
 38658  		goto _27
 38659  	}
 38660  	_9_fout = int32(0)
 38661  	_9_f = int32(2050)
 38662  	func() {
 38663  		if _pPager.XtempFile != 0 {
 38664  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52110), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51639)))
 38665  			crt.X__builtin_abort(tls)
 38666  		}
 38667  	}()
 38668  	_rc = _sqlite3OsOpen(tls, _8_pVfs, _pPager.XzJournal, (*Xsqlite3_file)(_pPager.Xjfd), _9_f, &_9_fout)
 38669  	func() {
 38670  		if _rc == int32(0) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 38671  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52112), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(13465)))
 38672  			crt.X__builtin_abort(tls)
 38673  		}
 38674  	}()
 38675  	if (_rc == int32(0)) && (_9_fout&int32(1)) != 0 {
 38676  		_rc = _sqlite3CantopenError(tls, int32(52114))
 38677  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 38678  	}
 38679  _27:
 38680  _25:
 38681  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 38682  		goto _35
 38683  	}
 38684  	func() {
 38685  		if _rc != int32(0) {
 38686  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52129), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(14967)))
 38687  			crt.X__builtin_abort(tls)
 38688  		}
 38689  	}()
 38690  	_rc = _pagerSyncHotJournal(tls, _pPager)
 38691  	if _rc == int32(0) {
 38692  		_rc = _pager_playback(tls, _pPager, bool2int(_pPager.XtempFile == 0))
 38693  		_pPager.XeState = 0
 38694  	}
 38695  	goto _40
 38696  _35:
 38697  	if _pPager.XexclusiveMode == 0 {
 38698  		_pagerUnlockDb(tls, _pPager, int32(1))
 38699  	}
 38700  _40:
 38701  	if _rc != int32(0) {
 38702  		_pager_error(tls, _pPager, _rc)
 38703  		goto _failed
 38704  	}
 38705  	func() {
 38706  		if int32(_pPager.XeState) != int32(0) {
 38707  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52160), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51657)))
 38708  			crt.X__builtin_abort(tls)
 38709  		}
 38710  	}()
 38711  	func() {
 38712  		if int32(_pPager.XeLock) != int32(1) && (_pPager.XexclusiveMode == 0 || int32(_pPager.XeLock) <= int32(1)) {
 38713  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52161), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51684)))
 38714  			crt.X__builtin_abort(tls)
 38715  		}
 38716  	}()
 38717  _22:
 38718  	if _pPager.XtempFile != 0 || _pPager.XhasHeldSharedLock == 0 {
 38719  		goto _49
 38720  	}
 38721  	_15_nPage = uint32(0)
 38722  	_rc = _pagerPagecount(tls, _pPager, &_15_nPage)
 38723  	if _rc != 0 {
 38724  		goto _failed
 38725  	}
 38726  	if _15_nPage <= (0) {
 38727  		goto _51
 38728  	}
 38729  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xfd), unsafe.Pointer(&_15_dbFileVers), int32(16), int64(24))
 38730  	if (_rc != int32(0)) && (_rc != int32(522)) {
 38731  		goto _failed
 38732  	}
 38733  	goto _54
 38734  _51:
 38735  	crt.Xmemset(tls, unsafe.Pointer(&_15_dbFileVers), int32(0), uint64(16))
 38736  _54:
 38737  	if crt.Xmemcmp(tls, unsafe.Pointer(&_pPager.XdbFileVers), unsafe.Pointer(&_15_dbFileVers), uint64(16)) == int32(0) {
 38738  		goto _55
 38739  	}
 38740  	_pager_reset(tls, _pPager)
 38741  	if _pPager.XbUseFetch != 0 {
 38742  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), 0, nil)
 38743  	}
 38744  _55:
 38745  _49:
 38746  	_rc = _pagerOpenWalIfPresent(tls, _pPager)
 38747  	func() {
 38748  		if (*XWal)(_pPager.XpWal) != nil && _rc != int32(0) {
 38749  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52219), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51769)))
 38750  			crt.X__builtin_abort(tls)
 38751  		}
 38752  	}()
 38753  _10:
 38754  	if (*XWal)(_pPager.XpWal) != nil {
 38755  		func() {
 38756  			if _rc != int32(0) {
 38757  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52224), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(14967)))
 38758  				crt.X__builtin_abort(tls)
 38759  			}
 38760  		}()
 38761  		_rc = _pagerBeginReadTransaction(tls, _pPager)
 38762  	}
 38763  	if ((int32(_pPager.XtempFile) == int32(0)) && (int32(_pPager.XeState) == int32(0))) && (_rc == int32(0)) {
 38764  		_rc = _pagerPagecount(tls, _pPager, &_pPager.XdbSize)
 38765  	}
 38766  _failed:
 38767  	if _rc != int32(0) {
 38768  		func() {
 38769  			if _pPager.XmemDb != 0 {
 38770  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52234), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(11702)))
 38771  				crt.X__builtin_abort(tls)
 38772  			}
 38773  		}()
 38774  		_pager_unlock(tls, _pPager)
 38775  		func() {
 38776  			if int32(_pPager.XeState) != int32(0) {
 38777  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52236), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51657)))
 38778  				crt.X__builtin_abort(tls)
 38779  			}
 38780  		}()
 38781  		goto _71
 38782  	}
 38783  	_pPager.XeState = uint8(1)
 38784  	_pPager.XhasHeldSharedLock = uint8(1)
 38785  _71:
 38786  	return _rc
 38787  
 38788  	_ = _15_dbFileVers
 38789  	panic(0)
 38790  }
 38791  
 38792  var _sqlite3PagerSharedLockØ00__func__Ø000 [23]int8
 38793  
 38794  func init() {
 38795  	crt.Xstrncpy(nil, &_sqlite3PagerSharedLockØ00__func__Ø000[0], str(51802), 23)
 38796  }
 38797  
 38798  // C comment
 38799  //  /*
 38800  //  ** Try to obtain a lock of type locktype on the database file. If
 38801  //  ** a similar or greater lock is already held, this function is a no-op
 38802  //  ** (returning SQLITE_OK immediately).
 38803  //  **
 38804  //  ** Otherwise, attempt to obtain the lock using sqlite3OsLock(). Invoke
 38805  //  ** the busy callback if the lock is currently not available. Repeat
 38806  //  ** until the busy callback returns false or until the attempt to
 38807  //  ** obtain the lock succeeds.
 38808  //  **
 38809  //  ** Return SQLITE_OK on success and an error code if we cannot obtain
 38810  //  ** the lock. If the lock is obtained successfully, set the Pager.state
 38811  //  ** variable to locktype before returning.
 38812  //  */
 38813  func _pager_wait_on_lock(tls *crt.TLS, _pPager *XPager, _locktype int32) (r0 int32) {
 38814  	var _rc int32
 38815  	func() {
 38816  		if int32(_pPager.XeLock) < _locktype && (int32(_pPager.XeLock) != int32(0) || _locktype != int32(1)) && (int32(_pPager.XeLock) != int32(2) || _locktype != int32(4)) {
 38817  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50819), unsafe.Pointer(&_pager_wait_on_lockØ00__func__Ø000), unsafe.Pointer(str(51825)))
 38818  			crt.X__builtin_abort(tls)
 38819  		}
 38820  	}()
 38821  _6:
 38822  	_rc = _pagerLockDb(tls, _pPager, _locktype)
 38823  	if (_rc == int32(5)) && _pPager.XxBusyHandler(tls, _pPager.XpBusyHandlerArg) != 0 {
 38824  		goto _6
 38825  	}
 38826  	return _rc
 38827  }
 38828  
 38829  var _pager_wait_on_lockØ00__func__Ø000 [19]int8
 38830  
 38831  func init() {
 38832  	crt.Xstrncpy(nil, &_pager_wait_on_lockØ00__func__Ø000[0], str(51966), 19)
 38833  }
 38834  
 38835  // C comment
 38836  //  /*
 38837  //  ** Lock the database file to level eLock, which must be either SHARED_LOCK,
 38838  //  ** RESERVED_LOCK or EXCLUSIVE_LOCK. If the caller is successful, set the
 38839  //  ** Pager.eLock variable to the new locking state.
 38840  //  **
 38841  //  ** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is
 38842  //  ** called, do not modify it unless the new locking state is EXCLUSIVE_LOCK.
 38843  //  ** See the comment above the #define of UNKNOWN_LOCK for an explanation
 38844  //  ** of this.
 38845  //  */
 38846  func _pagerLockDb(tls *crt.TLS, _pPager *XPager, _eLock int32) (r0 int32) {
 38847  	var _rc int32
 38848  	_rc = int32(0)
 38849  	func() {
 38850  		if _eLock != int32(1) && _eLock != int32(2) && _eLock != int32(4) {
 38851  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48076), unsafe.Pointer(&_pagerLockDbØ00__func__Ø000), unsafe.Pointer(str(51985)))
 38852  			crt.X__builtin_abort(tls)
 38853  		}
 38854  	}()
 38855  	if int32(_pPager.XeLock) >= _eLock && int32(_pPager.XeLock) != int32(5) {
 38856  		goto _5
 38857  	}
 38858  	_rc = func() int32 {
 38859  		if _pPager.XnoLock != 0 {
 38860  			return int32(0)
 38861  		}
 38862  		return _sqlite3OsLock(tls, (*Xsqlite3_file)(_pPager.Xfd), _eLock)
 38863  	}()
 38864  	if (_rc == int32(0)) && ((int32(_pPager.XeLock) != int32(5)) || (_eLock == int32(4))) {
 38865  		_pPager.XeLock = uint8(_eLock)
 38866  	}
 38867  _5:
 38868  	return _rc
 38869  }
 38870  
 38871  var _pagerLockDbØ00__func__Ø000 [12]int8
 38872  
 38873  func init() {
 38874  	crt.Xstrncpy(nil, &_pagerLockDbØ00__func__Ø000[0], str(52053), 12)
 38875  }
 38876  
 38877  // C comment
 38878  //  /*
 38879  //  ** This function is called after transitioning from PAGER_UNLOCK to
 38880  //  ** PAGER_SHARED state. It tests if there is a hot journal present in
 38881  //  ** the file-system for the given pager. A hot journal is one that
 38882  //  ** needs to be played back. According to this function, a hot-journal
 38883  //  ** file exists if the following criteria are met:
 38884  //  **
 38885  //  **   * The journal file exists in the file system, and
 38886  //  **   * No process holds a RESERVED or greater lock on the database file, and
 38887  //  **   * The database file itself is greater than 0 bytes in size, and
 38888  //  **   * The first byte of the journal file exists and is not 0x00.
 38889  //  **
 38890  //  ** If the current size of the database file is 0 but a journal file
 38891  //  ** exists, that is probably an old journal left over from a prior
 38892  //  ** database with the same name. In this case the journal file is
 38893  //  ** just deleted using OsDelete, *pExists is set to 0 and SQLITE_OK
 38894  //  ** is returned.
 38895  //  **
 38896  //  ** This routine does not check if there is a master journal filename
 38897  //  ** at the end of the file. If there is, and that master journal file
 38898  //  ** does not exist, then the journal file is not really hot. In this
 38899  //  ** case this routine will return a false-positive. The pager_playback()
 38900  //  ** routine will discover that the journal file is not really hot and
 38901  //  ** will not roll it back.
 38902  //  **
 38903  //  ** If a hot-journal file is found to exist, *pExists is set to 1 and
 38904  //  ** SQLITE_OK returned. If no hot-journal file is present, *pExists is
 38905  //  ** set to 0 and SQLITE_OK returned. If an IO error occurs while trying
 38906  //  ** to determine whether or not a hot-journal file exists, the IO error
 38907  //  ** code is returned and the value of *pExists is undefined.
 38908  //  */
 38909  func _hasHotJournal(tls *crt.TLS, _pPager *XPager, _pExists *int32) (r0 int32) {
 38910  	var _rc, _exists, _jrnlOpen, _2_locked, _8_f int32
 38911  	var _3_nPage uint32
 38912  	var _9_first uint8
 38913  	var _pVfs *Xsqlite3_vfs
 38914  	_pVfs = (*Xsqlite3_vfs)(_pPager.XpVfs)
 38915  	_rc = int32(0)
 38916  	_exists = int32(1)
 38917  	_jrnlOpen = bool2int((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil)
 38918  	func() {
 38919  		if _pPager.XuseJournal == 0 {
 38920  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51916), unsafe.Pointer(&_hasHotJournalØ00__func__Ø000), unsafe.Pointer(str(12340)))
 38921  			crt.X__builtin_abort(tls)
 38922  		}
 38923  	}()
 38924  	func() {
 38925  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 38926  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51917), unsafe.Pointer(&_hasHotJournalØ00__func__Ø000), unsafe.Pointer(str(16463)))
 38927  			crt.X__builtin_abort(tls)
 38928  		}
 38929  	}()
 38930  	func() {
 38931  		if int32(_pPager.XeState) != int32(0) {
 38932  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51918), unsafe.Pointer(&_hasHotJournalØ00__func__Ø000), unsafe.Pointer(str(51657)))
 38933  			crt.X__builtin_abort(tls)
 38934  		}
 38935  	}()
 38936  	func() {
 38937  		if _jrnlOpen != int32(0) && (_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xjfd))&int32(2048)) == 0 {
 38938  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51920), unsafe.Pointer(&_hasHotJournalØ00__func__Ø000), unsafe.Pointer(str(52065)))
 38939  			crt.X__builtin_abort(tls)
 38940  		}
 38941  	}()
 38942  	*_pExists = int32(0)
 38943  	if _jrnlOpen == 0 {
 38944  		_rc = _sqlite3OsAccess(tls, _pVfs, _pPager.XzJournal, int32(0), &_exists)
 38945  	}
 38946  	if _rc != int32(0) || _exists == 0 {
 38947  		goto _11
 38948  	}
 38949  	_2_locked = int32(0)
 38950  	_rc = _sqlite3OsCheckReservedLock(tls, (*Xsqlite3_file)(_pPager.Xfd), &_2_locked)
 38951  	if _rc != int32(0) || _2_locked != 0 {
 38952  		goto _13
 38953  	}
 38954  	func() {
 38955  		if int32(_pPager.XtempFile) != int32(0) {
 38956  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51943), unsafe.Pointer(&_hasHotJournalØ00__func__Ø000), unsafe.Pointer(str(10998)))
 38957  			crt.X__builtin_abort(tls)
 38958  		}
 38959  	}()
 38960  	_rc = _pagerPagecount(tls, _pPager, &_3_nPage)
 38961  	if _rc != int32(0) {
 38962  		goto _16
 38963  	}
 38964  	if _3_nPage != (0) || _jrnlOpen != 0 {
 38965  		goto _18
 38966  	}
 38967  	_sqlite3BeginBenignMalloc(tls)
 38968  	if _pagerLockDb(tls, _pPager, int32(2)) != int32(0) {
 38969  		goto _19
 38970  	}
 38971  	_sqlite3OsDelete(tls, _pVfs, _pPager.XzJournal, int32(0))
 38972  	if _pPager.XexclusiveMode == 0 {
 38973  		_pagerUnlockDb(tls, _pPager, int32(1))
 38974  	}
 38975  _19:
 38976  	_sqlite3EndBenignMalloc(tls)
 38977  	goto _21
 38978  _18:
 38979  	if _jrnlOpen == 0 {
 38980  		_8_f = int32(2049)
 38981  		_rc = _sqlite3OsOpen(tls, _pVfs, _pPager.XzJournal, (*Xsqlite3_file)(_pPager.Xjfd), _8_f, &_8_f)
 38982  	}
 38983  	if _rc != int32(0) {
 38984  		goto _23
 38985  	}
 38986  	_9_first = uint8(0)
 38987  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_9_first), int32(1), 0)
 38988  	if _rc == int32(522) {
 38989  		_rc = int32(0)
 38990  	}
 38991  	if _jrnlOpen == 0 {
 38992  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 38993  	}
 38994  	*_pExists = bool2int(int32(_9_first) != int32(0))
 38995  	goto _27
 38996  _23:
 38997  	if _rc == int32(14) {
 38998  		*_pExists = int32(1)
 38999  		_rc = int32(0)
 39000  	}
 39001  _27:
 39002  _21:
 39003  _16:
 39004  _13:
 39005  _11:
 39006  	return _rc
 39007  }
 39008  
 39009  var _hasHotJournalØ00__func__Ø000 [14]int8
 39010  
 39011  func init() {
 39012  	crt.Xstrncpy(nil, &_hasHotJournalØ00__func__Ø000[0], str(52165), 14)
 39013  }
 39014  
 39015  func _sqlite3OsCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) {
 39016  	return func() func(*crt.TLS, *Xsqlite3_file, *int32) int32 {
 39017  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxCheckReservedLock
 39018  		return *(*func(*crt.TLS, *Xsqlite3_file, *int32) int32)(unsafe.Pointer(&v))
 39019  	}()(tls, _id, _pResOut)
 39020  }
 39021  
 39022  // C comment
 39023  //  /*
 39024  //  ** This function is called as part of the transition from PAGER_OPEN
 39025  //  ** to PAGER_READER state to determine the size of the database file
 39026  //  ** in pages (assuming the page size currently stored in Pager.pageSize).
 39027  //  **
 39028  //  ** If no error occurs, SQLITE_OK is returned and the size of the database
 39029  //  ** in pages is stored in *pnPage. Otherwise, an error code (perhaps
 39030  //  ** SQLITE_IOERR_FSTAT) is returned and *pnPage is left unmodified.
 39031  //  */
 39032  func _pagerPagecount(tls *crt.TLS, _pPager *XPager, _pnPage *uint32) (r0 int32) {
 39033  	var _1_rc int32
 39034  	var _1_n int64
 39035  	var _nPage uint32
 39036  	func() {
 39037  		if int32(_pPager.XeState) != int32(0) {
 39038  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50166), unsafe.Pointer(&_pagerPagecountØ00__func__Ø000), unsafe.Pointer(str(51657)))
 39039  			crt.X__builtin_abort(tls)
 39040  		}
 39041  	}()
 39042  	func() {
 39043  		if int32(_pPager.XeLock) < int32(1) {
 39044  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50167), unsafe.Pointer(&_pagerPagecountØ00__func__Ø000), unsafe.Pointer(str(52179)))
 39045  			crt.X__builtin_abort(tls)
 39046  		}
 39047  	}()
 39048  	func() {
 39049  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 39050  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50168), unsafe.Pointer(&_pagerPagecountØ00__func__Ø000), unsafe.Pointer(str(16463)))
 39051  			crt.X__builtin_abort(tls)
 39052  		}
 39053  	}()
 39054  	func() {
 39055  		if int32(_pPager.XtempFile) != int32(0) {
 39056  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50169), unsafe.Pointer(&_pagerPagecountØ00__func__Ø000), unsafe.Pointer(str(10998)))
 39057  			crt.X__builtin_abort(tls)
 39058  		}
 39059  	}()
 39060  	_nPage = _sqlite3WalDbsize(tls, (*XWal)(_pPager.XpWal))
 39061  	if _nPage != (0) || func() int32 {
 39062  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil {
 39063  			return int32(1)
 39064  		}
 39065  		return func() int32 {
 39066  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50177), unsafe.Pointer(&_pagerPagecountØ00__func__Ø000), unsafe.Pointer(str(4809)))
 39067  			crt.X__builtin_abort(tls)
 39068  			return int32(0)
 39069  		}()
 39070  	}() == 0 {
 39071  		goto _11
 39072  	}
 39073  	_1_n = int64(0)
 39074  	_1_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xfd), &_1_n)
 39075  	if _1_rc != int32(0) {
 39076  		return _1_rc
 39077  	}
 39078  	_nPage = uint32(((_1_n + int64(_pPager.XpageSize)) - int64(1)) / int64(_pPager.XpageSize))
 39079  _11:
 39080  	if _nPage > _pPager.XmxPgno {
 39081  		_pPager.XmxPgno = _nPage
 39082  	}
 39083  	*_pnPage = _nPage
 39084  	return int32(0)
 39085  }
 39086  
 39087  var _pagerPagecountØ00__func__Ø000 [15]int8
 39088  
 39089  func init() {
 39090  	crt.Xstrncpy(nil, &_pagerPagecountØ00__func__Ø000[0], str(52206), 15)
 39091  }
 39092  
 39093  // C comment
 39094  //  /*
 39095  //  ** Return the size of the database in pages (or zero, if unknown).
 39096  //  */
 39097  func _sqlite3WalDbsize(tls *crt.TLS, _pWal *XWal) (r0 uint32) {
 39098  	if (_pWal != nil) && func() int32 {
 39099  		if int32(_pWal.XreadLock) >= int32(0) {
 39100  			return int32(1)
 39101  		}
 39102  		return func() int32 {
 39103  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57179), unsafe.Pointer(&_sqlite3WalDbsizeØ00__func__Ø000), unsafe.Pointer(str(4809)))
 39104  			crt.X__builtin_abort(tls)
 39105  			return int32(0)
 39106  		}()
 39107  	}() != 0 {
 39108  		return _pWal.Xhdr.XnPage
 39109  	}
 39110  	return 0
 39111  }
 39112  
 39113  var _sqlite3WalDbsizeØ00__func__Ø000 [17]int8
 39114  
 39115  func init() {
 39116  	crt.Xstrncpy(nil, &_sqlite3WalDbsizeØ00__func__Ø000[0], str(52221), 17)
 39117  }
 39118  
 39119  // C comment
 39120  //  /*
 39121  //  ** Check if the *-wal file that corresponds to the database opened by pPager
 39122  //  ** exists if the database is not empy, or verify that the *-wal file does
 39123  //  ** not exist (by deleting it) if the database file is empty.
 39124  //  **
 39125  //  ** If the database is not empty and the *-wal file exists, open the pager
 39126  //  ** in WAL mode.  If the database is empty or if no *-wal file exists and
 39127  //  ** if no error occurs, make sure Pager.journalMode is not set to
 39128  //  ** PAGER_JOURNALMODE_WAL.
 39129  //  **
 39130  //  ** Return SQLITE_OK or an error code.
 39131  //  **
 39132  //  ** The caller must hold a SHARED lock on the database file to call this
 39133  //  ** function. Because an EXCLUSIVE lock on the db file is required to delete
 39134  //  ** a WAL on a none-empty database, this ensures there is no race condition
 39135  //  ** between the xAccess() below and an xDelete() being executed by some
 39136  //  ** other connection.
 39137  //  */
 39138  func _pagerOpenWalIfPresent(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 39139  	var _rc, _1_isWal int32
 39140  	var _1_nPage uint32
 39141  	_rc = int32(0)
 39142  	func() {
 39143  		if int32(_pPager.XeState) != int32(0) {
 39144  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50219), unsafe.Pointer(&_pagerOpenWalIfPresentØ00__func__Ø000), unsafe.Pointer(str(51657)))
 39145  			crt.X__builtin_abort(tls)
 39146  		}
 39147  	}()
 39148  	func() {
 39149  		if int32(_pPager.XeLock) < int32(1) {
 39150  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50220), unsafe.Pointer(&_pagerOpenWalIfPresentØ00__func__Ø000), unsafe.Pointer(str(52179)))
 39151  			crt.X__builtin_abort(tls)
 39152  		}
 39153  	}()
 39154  	if _pPager.XtempFile != 0 {
 39155  		goto _4
 39156  	}
 39157  	_rc = _pagerPagecount(tls, _pPager, &_1_nPage)
 39158  	if _rc != 0 {
 39159  		return _rc
 39160  	}
 39161  	if _1_nPage != (0) {
 39162  		goto _6
 39163  	}
 39164  	_rc = _sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzWal, int32(0))
 39165  	if _rc == int32(5898) {
 39166  		_rc = int32(0)
 39167  	}
 39168  	_1_isWal = int32(0)
 39169  	goto _8
 39170  _6:
 39171  	_rc = _sqlite3OsAccess(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzWal, int32(0), &_1_isWal)
 39172  _8:
 39173  	if _rc != int32(0) {
 39174  		goto _9
 39175  	}
 39176  	if _1_isWal != 0 {
 39177  		_rc = _sqlite3PagerOpenWal(tls, _pPager, nil)
 39178  		goto _12
 39179  	}
 39180  	if int32(_pPager.XjournalMode) == int32(5) {
 39181  		_pPager.XjournalMode = 0
 39182  	}
 39183  _12:
 39184  _9:
 39185  _4:
 39186  	return _rc
 39187  }
 39188  
 39189  var _pagerOpenWalIfPresentØ00__func__Ø000 [22]int8
 39190  
 39191  func init() {
 39192  	crt.Xstrncpy(nil, &_pagerOpenWalIfPresentØ00__func__Ø000[0], str(52238), 22)
 39193  }
 39194  
 39195  // C comment
 39196  //  /*
 39197  //  ** The caller must be holding a SHARED lock on the database file to call
 39198  //  ** this function.
 39199  //  **
 39200  //  ** If the pager passed as the first argument is open on a real database
 39201  //  ** file (not a temp file or an in-memory database), and the WAL file
 39202  //  ** is not already open, make an attempt to open it now. If successful,
 39203  //  ** return SQLITE_OK. If an error occurs or the VFS used by the pager does
 39204  //  ** not support the xShmXXX() methods, return an error code. *pbOpen is
 39205  //  ** not modified in either case.
 39206  //  **
 39207  //  ** If the pager is open on a temp-file (or in-memory database), or if
 39208  //  ** the WAL file is already open, set *pbOpen to 1 and return SQLITE_OK
 39209  //  ** without doing anything.
 39210  //  */
 39211  func _sqlite3PagerOpenWal(tls *crt.TLS, _pPager *XPager, _pbOpen *int32) (r0 int32) {
 39212  	var _rc int32
 39213  	_rc = int32(0)
 39214  	func() {
 39215  		if _assert_pager_state(tls, _pPager) == 0 {
 39216  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54344), unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(10971)))
 39217  			crt.X__builtin_abort(tls)
 39218  		}
 39219  	}()
 39220  	func() {
 39221  		if int32(_pPager.XeState) != int32(0) && _pbOpen == nil {
 39222  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54345), unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52260)))
 39223  			crt.X__builtin_abort(tls)
 39224  		}
 39225  	}()
 39226  	func() {
 39227  		if int32(_pPager.XeState) != int32(1) && _pbOpen != nil {
 39228  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54346), unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52297)))
 39229  			crt.X__builtin_abort(tls)
 39230  		}
 39231  	}()
 39232  	func() {
 39233  		if _pbOpen != nil && (*_pbOpen) != int32(0) {
 39234  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54347), unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52337)))
 39235  			crt.X__builtin_abort(tls)
 39236  		}
 39237  	}()
 39238  	func() {
 39239  		if _pbOpen == nil && (_pPager.XtempFile != 0 || _pPager.XpWal != nil) {
 39240  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54348), unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52361)))
 39241  			crt.X__builtin_abort(tls)
 39242  		}
 39243  	}()
 39244  	if _pPager.XtempFile != 0 || _pPager.XpWal != nil {
 39245  		goto _16
 39246  	}
 39247  	if _sqlite3PagerWalSupported(tls, _pPager) == 0 {
 39248  		return int32(14)
 39249  	}
 39250  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 39251  	_rc = _pagerOpenWal(tls, _pPager)
 39252  	if _rc == int32(0) {
 39253  		_pPager.XjournalMode = uint8(5)
 39254  		_pPager.XeState = 0
 39255  	}
 39256  	goto _19
 39257  _16:
 39258  	*_pbOpen = int32(1)
 39259  _19:
 39260  	return _rc
 39261  }
 39262  
 39263  var _sqlite3PagerOpenWalØ00__func__Ø000 [20]int8
 39264  
 39265  func init() {
 39266  	crt.Xstrncpy(nil, &_sqlite3PagerOpenWalØ00__func__Ø000[0], str(52411), 20)
 39267  }
 39268  
 39269  // C comment
 39270  //  /*
 39271  //  ** Return true if the underlying VFS for the given pager supports the
 39272  //  ** primitives necessary for write-ahead logging.
 39273  //  */
 39274  func _sqlite3PagerWalSupported(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 39275  	var _pMethods *Xsqlite3_io_methods
 39276  	_pMethods = (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods)
 39277  	if _pPager.XnoLock != 0 {
 39278  		return int32(0)
 39279  	}
 39280  	return bool2int((_pPager.XexclusiveMode != 0) || ((_pMethods.XiVersion >= int32(2)) && (_pMethods.XxShmMap != nil)))
 39281  }
 39282  
 39283  // C comment
 39284  //  /*
 39285  //  ** Call sqlite3WalOpen() to open the WAL handle. If the pager is in
 39286  //  ** exclusive-locking mode when this function is called, take an EXCLUSIVE
 39287  //  ** lock on the database file and use heap-memory to store the wal-index
 39288  //  ** in. Otherwise, use the normal shared-memory.
 39289  //  */
 39290  func _pagerOpenWal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 39291  	var _rc int32
 39292  	_rc = int32(0)
 39293  	func() {
 39294  		if (*XWal)(_pPager.XpWal) != nil || int32(_pPager.XtempFile) != int32(0) {
 39295  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54296), unsafe.Pointer(&_pagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52431)))
 39296  			crt.X__builtin_abort(tls)
 39297  		}
 39298  	}()
 39299  	func() {
 39300  		if int32(_pPager.XeLock) != int32(1) && int32(_pPager.XeLock) != int32(4) {
 39301  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54297), unsafe.Pointer(&_pagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52470)))
 39302  			crt.X__builtin_abort(tls)
 39303  		}
 39304  	}()
 39305  	if _pPager.XexclusiveMode != 0 {
 39306  		_rc = _pagerExclusiveLock(tls, _pPager)
 39307  	}
 39308  	if _rc == int32(0) {
 39309  		_rc = _sqlite3WalOpen(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), (*Xsqlite3_file)(_pPager.Xfd), _pPager.XzWal, int32(_pPager.XexclusiveMode), _pPager.XjournalSizeLimit, (**XWal)(unsafe.Pointer(&_pPager.XpWal)))
 39310  	}
 39311  	_pagerFixMaplimit(tls, _pPager)
 39312  	return _rc
 39313  }
 39314  
 39315  var _pagerOpenWalØ00__func__Ø000 [13]int8
 39316  
 39317  func init() {
 39318  	crt.Xstrncpy(nil, &_pagerOpenWalØ00__func__Ø000[0], str(52530), 13)
 39319  }
 39320  
 39321  // C comment
 39322  //  /*
 39323  //  ** Attempt to take an exclusive lock on the database file. If a PENDING lock
 39324  //  ** is obtained instead, immediately release it.
 39325  //  */
 39326  func _pagerExclusiveLock(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 39327  	var _rc int32
 39328  	func() {
 39329  		if int32(_pPager.XeLock) != int32(1) && int32(_pPager.XeLock) != int32(4) {
 39330  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54276), unsafe.Pointer(&_pagerExclusiveLockØ00__func__Ø000), unsafe.Pointer(str(52470)))
 39331  			crt.X__builtin_abort(tls)
 39332  		}
 39333  	}()
 39334  	_rc = _pagerLockDb(tls, _pPager, int32(4))
 39335  	if _rc != int32(0) {
 39336  		_pagerUnlockDb(tls, _pPager, int32(1))
 39337  	}
 39338  	return _rc
 39339  }
 39340  
 39341  var _pagerExclusiveLockØ00__func__Ø000 [19]int8
 39342  
 39343  func init() {
 39344  	crt.Xstrncpy(nil, &_pagerExclusiveLockØ00__func__Ø000[0], str(52543), 19)
 39345  }
 39346  
 39347  // C comment
 39348  //  /*
 39349  //  ** Open a connection to the WAL file zWalName. The database file must
 39350  //  ** already be opened on connection pDbFd. The buffer that zWalName points
 39351  //  ** to must remain valid for the lifetime of the returned Wal* handle.
 39352  //  **
 39353  //  ** A SHARED lock should be held on the database file when this function
 39354  //  ** is called. The purpose of this SHARED lock is to prevent any other
 39355  //  ** client from unlinking the WAL or wal-index file. If another process
 39356  //  ** were to do this just after this client opened one of these files, the
 39357  //  ** system would be badly broken.
 39358  //  **
 39359  //  ** If the log file is successfully opened, SQLITE_OK is returned and
 39360  //  ** *ppWal is set to point to a new WAL handle. If an error occurs,
 39361  //  ** an SQLite error code is returned and *ppWal is left unmodified.
 39362  //  */
 39363  func _sqlite3WalOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pDbFd *Xsqlite3_file, _zWalName *int8, _bNoShm int32, _mxWalSize int64, _ppWal **XWal) (r0 int32) {
 39364  	var _rc, _flags, _4_iDC int32
 39365  	var _pRet *XWal
 39366  	func() {
 39367  		if _zWalName == nil || (*elem1(_zWalName, 0)) == 0 {
 39368  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55767), unsafe.Pointer(&_sqlite3WalOpenØ00__func__Ø000), unsafe.Pointer(str(52562)))
 39369  			crt.X__builtin_abort(tls)
 39370  		}
 39371  	}()
 39372  	func() {
 39373  		if _pDbFd == nil {
 39374  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55768), unsafe.Pointer(&_sqlite3WalOpenØ00__func__Ø000), unsafe.Pointer(str(52586)))
 39375  			crt.X__builtin_abort(tls)
 39376  		}
 39377  	}()
 39378  
 39379  	*_ppWal = nil
 39380  	_pRet = (*XWal)(_sqlite3MallocZero(tls, uint64(144)+uint64(_pVfs.XszOsFile)))
 39381  	if _pRet == nil {
 39382  		return _sqlite3NomemError(tls, int32(55790))
 39383  	}
 39384  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_pRet.XpVfs)) = _pVfs
 39385  	*(**Xsqlite3_file)(unsafe.Pointer(&_pRet.XpWalFd)) = (*Xsqlite3_file)(unsafe.Pointer(elem76(_pRet, uintptr(1))))
 39386  	*(**Xsqlite3_file)(unsafe.Pointer(&_pRet.XpDbFd)) = _pDbFd
 39387  	_pRet.XreadLock = int16(-1)
 39388  	_pRet.XmxWalSize = _mxWalSize
 39389  	_pRet.XzWalName = _zWalName
 39390  	_pRet.XsyncHeader = uint8(1)
 39391  	_pRet.XpadToSectorBoundary = uint8(1)
 39392  	_pRet.XexclusiveMode = uint8(func() int32 {
 39393  		if _bNoShm != 0 {
 39394  			return int32(2)
 39395  		}
 39396  		return int32(0)
 39397  	}())
 39398  	_flags = int32(524294)
 39399  	_rc = _sqlite3OsOpen(tls, _pVfs, _zWalName, (*Xsqlite3_file)(_pRet.XpWalFd), _flags, &_flags)
 39400  	if (_rc == int32(0)) && (_flags&int32(1)) != 0 {
 39401  		_pRet.XreadOnly = uint8(1)
 39402  	}
 39403  	if _rc != int32(0) {
 39404  		_walIndexClose(tls, _pRet, int32(0))
 39405  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pRet.XpWalFd))
 39406  		Xsqlite3_free(tls, unsafe.Pointer(_pRet))
 39407  		goto _11
 39408  	}
 39409  	_4_iDC = _sqlite3OsDeviceCharacteristics(tls, _pDbFd)
 39410  	if (_4_iDC & int32(1024)) != 0 {
 39411  		_pRet.XsyncHeader = 0
 39412  	}
 39413  	if (_4_iDC & int32(4096)) != 0 {
 39414  		_pRet.XpadToSectorBoundary = 0
 39415  	}
 39416  	*_ppWal = _pRet
 39417  _11:
 39418  	return _rc
 39419  }
 39420  
 39421  var _sqlite3WalOpenØ00__func__Ø000 [15]int8
 39422  
 39423  func init() {
 39424  	crt.Xstrncpy(nil, &_sqlite3WalOpenØ00__func__Ø000[0], str(52592), 15)
 39425  }
 39426  
 39427  // C comment
 39428  //  /*
 39429  //  ** Begin a read transaction on the WAL.
 39430  //  **
 39431  //  ** This routine used to be called "pagerOpenSnapshot()" because it essentially
 39432  //  ** makes a snapshot of the database at the current point in time and preserves
 39433  //  ** that snapshot for use by the reader in spite of concurrently changes by
 39434  //  ** other writers or checkpointers.
 39435  //  */
 39436  func _pagerBeginReadTransaction(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 39437  	var _rc, _changed int32
 39438  	_changed = int32(0)
 39439  	func() {
 39440  		if (*XWal)(_pPager.XpWal) == nil {
 39441  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50128), unsafe.Pointer(&_pagerBeginReadTransactionØ00__func__Ø000), unsafe.Pointer(str(15781)))
 39442  			crt.X__builtin_abort(tls)
 39443  		}
 39444  	}()
 39445  	func() {
 39446  		if int32(_pPager.XeState) != int32(0) && int32(_pPager.XeState) != int32(1) {
 39447  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50129), unsafe.Pointer(&_pagerBeginReadTransactionØ00__func__Ø000), unsafe.Pointer(str(51473)))
 39448  			crt.X__builtin_abort(tls)
 39449  		}
 39450  	}()
 39451  	_sqlite3WalEndReadTransaction(tls, (*XWal)(_pPager.XpWal))
 39452  	_rc = _sqlite3WalBeginReadTransaction(tls, (*XWal)(_pPager.XpWal), &_changed)
 39453  	if _rc == int32(0) && _changed == 0 {
 39454  		goto _6
 39455  	}
 39456  	_pager_reset(tls, _pPager)
 39457  	if _pPager.XbUseFetch != 0 {
 39458  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), 0, nil)
 39459  	}
 39460  _6:
 39461  	return _rc
 39462  }
 39463  
 39464  var _pagerBeginReadTransactionØ00__func__Ø000 [26]int8
 39465  
 39466  func init() {
 39467  	crt.Xstrncpy(nil, &_pagerBeginReadTransactionØ00__func__Ø000[0], str(52607), 26)
 39468  }
 39469  
 39470  // C comment
 39471  //  /*
 39472  //  ** Begin a read transaction on the database.
 39473  //  **
 39474  //  ** This routine used to be called sqlite3OpenSnapshot() and with good reason:
 39475  //  ** it takes a snapshot of the state of the WAL and wal-index for the current
 39476  //  ** instant in time.  The current thread will continue to use this snapshot.
 39477  //  ** Other threads might append new content to the WAL and wal-index but
 39478  //  ** that extra content is ignored by the current thread.
 39479  //  **
 39480  //  ** If the database contents have changes since the previous read
 39481  //  ** transaction, then *pChanged is set to 1 before returning.  The
 39482  //  ** Pager layer will use this to know that is cache is stale and
 39483  //  ** needs to be flushed.
 39484  //  */
 39485  func _sqlite3WalBeginReadTransaction(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) {
 39486  	var _rc, _cnt int32
 39487  	_cnt = int32(0)
 39488  _0:
 39489  	_rc = _walTryBeginRead(tls, _pWal, _pChanged, int32(0), preInc2(&_cnt, 1))
 39490  	if _rc == int32(-1) {
 39491  		goto _0
 39492  	}
 39493  	return _rc
 39494  
 39495  	_ = _cnt
 39496  	panic(0)
 39497  }
 39498  
 39499  // C comment
 39500  //  /*
 39501  //  ** Attempt to start a read transaction.  This might fail due to a race or
 39502  //  ** other transient condition.  When that happens, it returns WAL_RETRY to
 39503  //  ** indicate to the caller that it is safe to retry immediately.
 39504  //  **
 39505  //  ** On success return SQLITE_OK.  On a permanent failure (such an
 39506  //  ** I/O error or an SQLITE_BUSY because another process is running
 39507  //  ** recovery) return a positive error code.
 39508  //  **
 39509  //  ** The useWal parameter is true to force the use of the WAL and disable
 39510  //  ** the case where the WAL is bypassed because it has been completely
 39511  //  ** checkpointed.  If useWal==0 then this routine calls walIndexReadHdr()
 39512  //  ** to make a copy of the wal-index header into pWal->hdr.  If the
 39513  //  ** wal-index header has changed, *pChanged is set to 1 (as an indication
 39514  //  ** to the caller that the local paget cache is obsolete and needs to be
 39515  //  ** flushed.)  When useWal==1, the wal-index header is assumed to already
 39516  //  ** be loaded and the pChanged parameter is unused.
 39517  //  **
 39518  //  ** The caller must set the cnt parameter to the number of prior calls to
 39519  //  ** this routine during the current read attempt that returned WAL_RETRY.
 39520  //  ** This routine will start taking more aggressive measures to clear the
 39521  //  ** race conditions after multiple WAL_RETRY returns, and after an excessive
 39522  //  ** number of errors will ultimately return SQLITE_PROTOCOL.  The
 39523  //  ** SQLITE_PROTOCOL return indicates that some other process has gone rogue
 39524  //  ** and is not honoring the locking protocol.  There is a vanishingly small
 39525  //  ** chance that SQLITE_PROTOCOL could be returned because of a run of really
 39526  //  ** bad luck when there is lots of contention for the wal-index, but that
 39527  //  ** possibility is so small that it can be safely neglected, we believe.
 39528  //  **
 39529  //  ** On success, this routine obtains a read lock on
 39530  //  ** WAL_READ_LOCK(pWal->readLock).  The pWal->readLock integer is
 39531  //  ** in the range 0 <= pWal->readLock < WAL_NREADER.  If pWal->readLock==(-1)
 39532  //  ** that means the Wal does not hold any read lock.  The reader must not
 39533  //  ** access any database page that is modified by a WAL frame up to and
 39534  //  ** including frame number aReadMark[pWal->readLock].  The reader will
 39535  //  ** use WAL frames up to and including pWal->hdr.mxFrame if pWal->readLock>0
 39536  //  ** Or if pWal->readLock==0, then the reader will ignore the WAL
 39537  //  ** completely and get all content directly from the database file.
 39538  //  ** If the useWal parameter is 1 then the WAL will never be ignored and
 39539  //  ** this routine will always set pWal->readLock>0 on success.
 39540  //  ** When the read transaction is completed, the caller must release the
 39541  //  ** lock on WAL_READ_LOCK(pWal->readLock) and set pWal->readLock to -1.
 39542  //  **
 39543  //  ** This routine uses the nBackfill and aReadMark[] fields of the header
 39544  //  ** to select a particular WAL_READ_LOCK() that strives to let the
 39545  //  ** checkpoint process do as much work as possible.  This routine might
 39546  //  ** update values of the aReadMark[] array in the header, but if it does
 39547  //  ** so it takes care to hold an exclusive lock on the corresponding
 39548  //  ** WAL_READ_LOCK() while changing values.
 39549  //  */
 39550  func _walTryBeginRead(tls *crt.TLS, _pWal *XWal, _pChanged *int32, _useWal int32, _cnt int32) (r0 int32) {
 39551  	var _mxI, _i, _rc, _1_nDelay int32
 39552  	var _mxReadMark, _mxFrame, _13_thisMark uint32
 39553  	var _pInfo *XWalCkptInfo
 39554  	_rc = int32(0)
 39555  	func() {
 39556  		if int32(_pWal.XreadLock) >= int32(0) {
 39557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56667), unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000), unsafe.Pointer(str(52633)))
 39558  			crt.X__builtin_abort(tls)
 39559  		}
 39560  	}()
 39561  	if _cnt <= int32(5) {
 39562  		goto _2
 39563  	}
 39564  	_1_nDelay = int32(1)
 39565  	if _cnt > int32(100) {
 39566  		_pWal.XlockError = uint8(1)
 39567  		return int32(15)
 39568  	}
 39569  	if _cnt >= int32(10) {
 39570  		_1_nDelay = ((_cnt - int32(9)) * (_cnt - int32(9))) * int32(39)
 39571  	}
 39572  	_sqlite3OsSleep(tls, (*Xsqlite3_vfs)(_pWal.XpVfs), _1_nDelay)
 39573  _2:
 39574  	if _useWal != 0 {
 39575  		goto _5
 39576  	}
 39577  	_rc = _walIndexReadHdr(tls, _pWal, _pChanged)
 39578  	if _rc != int32(5) {
 39579  		goto _6
 39580  	}
 39581  	if (*elem38(_pWal.XapWiData, 0)) == nil {
 39582  		_rc = int32(-1)
 39583  		goto _11
 39584  	}
 39585  	if int32(0) == store2(&_rc, _walLockShared(tls, _pWal, int32(2))) {
 39586  		_walUnlockShared(tls, _pWal, int32(2))
 39587  		_rc = int32(-1)
 39588  		goto _11
 39589  	}
 39590  	if _rc == int32(5) {
 39591  		_rc = int32(261)
 39592  	}
 39593  _11:
 39594  _6:
 39595  	if _rc != int32(0) {
 39596  		return _rc
 39597  	}
 39598  _5:
 39599  	_pInfo = _walCkptInfo(tls, _pWal)
 39600  	if _useWal != 0 || _pInfo.XnBackfill != (_pWal.Xhdr.XmxFrame) {
 39601  		goto _14
 39602  	}
 39603  	_rc = _walLockShared(tls, _pWal, int32(3))
 39604  	_walShmBarrier(tls, _pWal)
 39605  	if _rc != int32(0) {
 39606  		goto _15
 39607  	}
 39608  	if crt.Xmemcmp(tls, unsafe.Pointer(_walIndexHdr(tls, _pWal)), unsafe.Pointer(&_pWal.Xhdr), uint64(48)) != 0 {
 39609  		_walUnlockShared(tls, _pWal, int32(3))
 39610  		return int32(-1)
 39611  	}
 39612  	_pWal.XreadLock = 0
 39613  	return int32(0)
 39614  
 39615  _15:
 39616  	if _rc != int32(5) {
 39617  		return _rc
 39618  	}
 39619  _14:
 39620  	_mxReadMark = 0
 39621  	_mxI = int32(0)
 39622  	_mxFrame = _pWal.Xhdr.XmxFrame
 39623  	_i = int32(1)
 39624  _19:
 39625  	if _i >= int32(5) {
 39626  		goto _22
 39627  	}
 39628  	_13_thisMark = *elem31((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_i))
 39629  	if (_mxReadMark <= _13_thisMark) && (_13_thisMark <= _mxFrame) {
 39630  		func() {
 39631  			if _13_thisMark == uint32(4294967295) {
 39632  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56781), unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000), unsafe.Pointer(str(52650)))
 39633  				crt.X__builtin_abort(tls)
 39634  			}
 39635  		}()
 39636  		_mxReadMark = _13_thisMark
 39637  		_mxI = _i
 39638  	}
 39639  	_i += 1
 39640  	goto _19
 39641  _22:
 39642  	if (int32(_pWal.XreadOnly)&int32(2)) != int32(0) || _mxReadMark >= _mxFrame && _mxI != int32(0) {
 39643  		goto _29
 39644  	}
 39645  	_i = int32(1)
 39646  _30:
 39647  	if _i >= int32(5) {
 39648  		goto _33
 39649  	}
 39650  	_rc = _walLockExclusive(tls, _pWal, int32(3)+_i, int32(1))
 39651  	if _rc == int32(0) {
 39652  		_mxReadMark = store34(elem31((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_i)), _mxFrame)
 39653  		_mxI = _i
 39654  		_walUnlockExclusive(tls, _pWal, int32(3)+_i, int32(1))
 39655  		goto _33
 39656  	}
 39657  	if _rc != int32(5) {
 39658  		return _rc
 39659  	}
 39660  	_i += 1
 39661  	goto _30
 39662  _33:
 39663  _29:
 39664  	if _mxI == int32(0) {
 39665  		func() {
 39666  			if _rc != int32(5) && (int32(_pWal.XreadOnly)&int32(2)) == int32(0) {
 39667  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56802), unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000), unsafe.Pointer(str(52678)))
 39668  				crt.X__builtin_abort(tls)
 39669  			}
 39670  		}()
 39671  		return func() int32 {
 39672  			if _rc == int32(5) {
 39673  				return int32(-1)
 39674  			}
 39675  			return int32(520)
 39676  		}()
 39677  	}
 39678  	_rc = _walLockShared(tls, _pWal, int32(3)+_mxI)
 39679  	if _rc != 0 {
 39680  		return func() int32 {
 39681  			if _rc == int32(5) {
 39682  				return int32(-1)
 39683  			}
 39684  			return _rc
 39685  		}()
 39686  	}
 39687  	_pWal.XminFrame = _pInfo.XnBackfill + uint32(1)
 39688  	_walShmBarrier(tls, _pWal)
 39689  	if ((*elem31((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_mxI))) != _mxReadMark) || crt.Xmemcmp(tls, unsafe.Pointer(_walIndexHdr(tls, _pWal)), unsafe.Pointer(&_pWal.Xhdr), uint64(48)) != 0 {
 39690  		_walUnlockShared(tls, _pWal, int32(3)+_mxI)
 39691  		return int32(-1)
 39692  	}
 39693  	func() {
 39694  		if _mxReadMark > (_pWal.Xhdr.XmxFrame) {
 39695  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56852), unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000), unsafe.Pointer(str(52734)))
 39696  			crt.X__builtin_abort(tls)
 39697  		}
 39698  	}()
 39699  	_pWal.XreadLock = int16(_mxI)
 39700  	return _rc
 39701  }
 39702  
 39703  var _walTryBeginReadØ00__func__Ø000 [16]int8
 39704  
 39705  func init() {
 39706  	crt.Xstrncpy(nil, &_walTryBeginReadØ00__func__Ø000[0], str(52764), 16)
 39707  }
 39708  
 39709  // C comment
 39710  //  /*
 39711  //  ** The header string that appears at the beginning of every
 39712  //  ** SQLite database.
 39713  //  */
 39714  var _zMagicHeader [16]int8
 39715  
 39716  func init() {
 39717  	crt.Xstrncpy(nil, &_zMagicHeader[0], str(52780), 16)
 39718  }
 39719  
 39720  // C comment
 39721  //  /*
 39722  //  ** Begin a write-transaction on the specified pager object. If a
 39723  //  ** write-transaction has already been opened, this function is a no-op.
 39724  //  **
 39725  //  ** If the exFlag argument is false, then acquire at least a RESERVED
 39726  //  ** lock on the database file. If exFlag is true, then acquire at least
 39727  //  ** an EXCLUSIVE lock. If such a lock is already held, no locking
 39728  //  ** functions need be called.
 39729  //  **
 39730  //  ** If the subjInMemory argument is non-zero, then any sub-journal opened
 39731  //  ** within this transaction will be opened as an in-memory file. This
 39732  //  ** has no effect if the sub-journal is already opened (as it may be when
 39733  //  ** running in exclusive mode) or if the transaction does not require a
 39734  //  ** sub-journal. If the subjInMemory argument is zero, then any required
 39735  //  ** sub-journal is implemented in-memory if pPager is an in-memory database,
 39736  //  ** or using a temporary file otherwise.
 39737  //  */
 39738  func _sqlite3PagerBegin(tls *crt.TLS, _pPager *XPager, _exFlag int32, _subjInMemory int32) (r0 int32) {
 39739  	var _rc int32
 39740  	_rc = int32(0)
 39741  	if _pPager.XerrCode != 0 {
 39742  		return _pPager.XerrCode
 39743  	}
 39744  	func() {
 39745  		if int32(_pPager.XeState) < int32(1) || int32(_pPager.XeState) >= int32(6) {
 39746  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52679), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(52796)))
 39747  			crt.X__builtin_abort(tls)
 39748  		}
 39749  	}()
 39750  	_pPager.XsubjInMemory = uint8(_subjInMemory)
 39751  	if func() int32 {
 39752  		if int32(_pPager.XeState) == int32(1) {
 39753  			return int32(1)
 39754  		}
 39755  		return func() int32 {
 39756  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52682), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(4809)))
 39757  			crt.X__builtin_abort(tls)
 39758  			return int32(0)
 39759  		}()
 39760  	}() == 0 {
 39761  		goto _6
 39762  	}
 39763  	func() {
 39764  		if (*XBitvec)(_pPager.XpInJournal) != nil {
 39765  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52683), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(13443)))
 39766  			crt.X__builtin_abort(tls)
 39767  		}
 39768  	}()
 39769  	if (*XWal)(_pPager.XpWal) == nil {
 39770  		goto _9
 39771  	}
 39772  	if _pPager.XexclusiveMode == 0 || _sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.XpWal), int32(-1)) == 0 {
 39773  		goto _11
 39774  	}
 39775  	_rc = _pagerLockDb(tls, _pPager, int32(4))
 39776  	if _rc != int32(0) {
 39777  		return _rc
 39778  	}
 39779  	_sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.XpWal), int32(1))
 39780  _11:
 39781  	_rc = _sqlite3WalBeginWriteTransaction(tls, (*XWal)(_pPager.XpWal))
 39782  	goto _13
 39783  _9:
 39784  	_rc = _pagerLockDb(tls, _pPager, int32(2))
 39785  	if (_rc == int32(0)) && _exFlag != 0 {
 39786  		_rc = _pager_wait_on_lock(tls, _pPager, int32(4))
 39787  	}
 39788  _13:
 39789  	if _rc == int32(0) {
 39790  		_pPager.XeState = uint8(2)
 39791  		_pPager.XdbHintSize = _pPager.XdbSize
 39792  		_pPager.XdbFileSize = _pPager.XdbSize
 39793  		_pPager.XdbOrigSize = _pPager.XdbSize
 39794  		_pPager.XjournalOff = 0
 39795  	}
 39796  	func() {
 39797  		if _rc != int32(0) && int32(_pPager.XeState) != int32(1) {
 39798  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52732), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(52855)))
 39799  			crt.X__builtin_abort(tls)
 39800  		}
 39801  	}()
 39802  	func() {
 39803  		if _rc == int32(0) && int32(_pPager.XeState) != int32(2) {
 39804  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52733), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(52901)))
 39805  			crt.X__builtin_abort(tls)
 39806  		}
 39807  	}()
 39808  	func() {
 39809  		if _assert_pager_state(tls, _pPager) == 0 {
 39810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52734), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(10971)))
 39811  			crt.X__builtin_abort(tls)
 39812  		}
 39813  	}()
 39814  _6:
 39815  	return _rc
 39816  }
 39817  
 39818  var _sqlite3PagerBeginØ00__func__Ø000 [18]int8
 39819  
 39820  func init() {
 39821  	crt.Xstrncpy(nil, &_sqlite3PagerBeginØ00__func__Ø000[0], str(52954), 18)
 39822  }
 39823  
 39824  // C comment
 39825  //  /*
 39826  //  ** This function starts a write transaction on the WAL.
 39827  //  **
 39828  //  ** A read transaction must have already been started by a prior call
 39829  //  ** to sqlite3WalBeginReadTransaction().
 39830  //  **
 39831  //  ** If another thread or process has written into the database since
 39832  //  ** the read transaction was started, then it is not possible for this
 39833  //  ** thread to write as doing so would cause a fork.  So this routine
 39834  //  ** returns SQLITE_BUSY in that case and no write transaction is started.
 39835  //  **
 39836  //  ** There can only be a single writer active at a time.
 39837  //  */
 39838  func _sqlite3WalBeginWriteTransaction(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 39839  	var _rc int32
 39840  	func() {
 39841  		if int32(_pWal.XreadLock) < int32(0) {
 39842  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57204), unsafe.Pointer(&_sqlite3WalBeginWriteTransactionØ00__func__Ø000), unsafe.Pointer(str(19182)))
 39843  			crt.X__builtin_abort(tls)
 39844  		}
 39845  	}()
 39846  	func() {
 39847  		if int32(_pWal.XwriteLock) != int32(0) || _pWal.XiReCksum != (0) {
 39848  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57205), unsafe.Pointer(&_sqlite3WalBeginWriteTransactionØ00__func__Ø000), unsafe.Pointer(str(52972)))
 39849  			crt.X__builtin_abort(tls)
 39850  		}
 39851  	}()
 39852  	if _pWal.XreadOnly != 0 {
 39853  		return int32(8)
 39854  	}
 39855  	_rc = _walLockExclusive(tls, _pWal, int32(0), int32(1))
 39856  	if _rc != 0 {
 39857  		return _rc
 39858  	}
 39859  	_pWal.XwriteLock = uint8(1)
 39860  	if crt.Xmemcmp(tls, unsafe.Pointer(&_pWal.Xhdr), unsafe.Pointer(_walIndexHdr(tls, _pWal)), uint64(48)) != int32(0) {
 39861  		_walUnlockExclusive(tls, _pWal, int32(0), int32(1))
 39862  		_pWal.XwriteLock = 0
 39863  		_rc = int32(517)
 39864  	}
 39865  	return _rc
 39866  }
 39867  
 39868  var _sqlite3WalBeginWriteTransactionØ00__func__Ø000 [32]int8
 39869  
 39870  func init() {
 39871  	crt.Xstrncpy(nil, &_sqlite3WalBeginWriteTransactionØ00__func__Ø000[0], str(53012), 32)
 39872  }
 39873  
 39874  // C comment
 39875  //  /*
 39876  //  ** This function returns true if main-memory should be used instead of
 39877  //  ** a temporary file for transient pager files and statement journals.
 39878  //  ** The value returned depends on the value of db->temp_store (runtime
 39879  //  ** parameter) and the compile time value of SQLITE_TEMP_STORE. The
 39880  //  ** following table describes the relationship between these two values
 39881  //  ** and this functions return value.
 39882  //  **
 39883  //  **   SQLITE_TEMP_STORE     db->temp_store     Location of temporary database
 39884  //  **   -----------------     --------------     ------------------------------
 39885  //  **   0                     any                file      (return 0)
 39886  //  **   1                     1                  file      (return 0)
 39887  //  **   1                     2                  memory    (return 1)
 39888  //  **   1                     0                  file      (return 0)
 39889  //  **   2                     1                  file      (return 0)
 39890  //  **   2                     2                  memory    (return 1)
 39891  //  **   2                     0                  memory    (return 1)
 39892  //  **   3                     any                memory    (return 1)
 39893  //  */
 39894  func _sqlite3TempInMemory(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 39895  	return bool2int(int32(_db.Xtemp_store) == int32(2))
 39896  }
 39897  
 39898  // C comment
 39899  //  /*
 39900  //  ** If pBt points to an empty file then convert that empty file
 39901  //  ** into a new empty database by initializing the first page of
 39902  //  ** the database.
 39903  //  */
 39904  func _newDatabase(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
 39905  	var _rc int32
 39906  	var _data *uint8
 39907  	var _pP1 *XMemPage
 39908  	func() {
 39909  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 39910  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62159), unsafe.Pointer(&_newDatabaseØ00__func__Ø000), unsafe.Pointer(str(9235)))
 39911  			crt.X__builtin_abort(tls)
 39912  		}
 39913  	}()
 39914  	if _pBt.XnPage > (0) {
 39915  		return int32(0)
 39916  	}
 39917  	_pP1 = (*XMemPage)(_pBt.XpPage1)
 39918  	func() {
 39919  		if _pP1 == nil {
 39920  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62164), unsafe.Pointer(&_newDatabaseØ00__func__Ø000), unsafe.Pointer(str(53044)))
 39921  			crt.X__builtin_abort(tls)
 39922  		}
 39923  	}()
 39924  	_data = _pP1.XaData
 39925  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pP1.XpDbPage))
 39926  	if _rc != 0 {
 39927  		return _rc
 39928  	}
 39929  	crt.Xmemcpy(tls, unsafe.Pointer(_data), unsafe.Pointer(&_zMagicHeader), uint64(16))
 39930  
 39931  	*elem15(_data, uintptr(16)) = uint8((_pBt.XpageSize >> 8) & uint32(255))
 39932  	*elem15(_data, uintptr(17)) = uint8((_pBt.XpageSize >> 16) & uint32(255))
 39933  	*elem15(_data, uintptr(18)) = uint8(1)
 39934  	*elem15(_data, uintptr(19)) = uint8(1)
 39935  	func() {
 39936  		if _pBt.XusableSize > _pBt.XpageSize || (_pBt.XusableSize+uint32(255)) < _pBt.XpageSize {
 39937  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62174), unsafe.Pointer(&_newDatabaseØ00__func__Ø000), unsafe.Pointer(str(53051)))
 39938  			crt.X__builtin_abort(tls)
 39939  		}
 39940  	}()
 39941  	*elem15(_data, uintptr(20)) = uint8(_pBt.XpageSize - _pBt.XusableSize)
 39942  	*elem15(_data, uintptr(21)) = uint8(64)
 39943  	*elem15(_data, uintptr(22)) = uint8(32)
 39944  	*elem15(_data, uintptr(23)) = uint8(32)
 39945  	crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(24))), int32(0), uint64(76))
 39946  	_zeroPage(tls, _pP1, int32(13))
 39947  	{
 39948  		p := &_pBt.XbtsFlags
 39949  		*p = uint16(int32(*p) | int32(2))
 39950  	}
 39951  	func() {
 39952  		if int32(_pBt.XautoVacuum) != int32(1) && int32(_pBt.XautoVacuum) != int32(0) {
 39953  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62183), unsafe.Pointer(&_newDatabaseØ00__func__Ø000), unsafe.Pointer(str(53120)))
 39954  			crt.X__builtin_abort(tls)
 39955  		}
 39956  	}()
 39957  	func() {
 39958  		if int32(_pBt.XincrVacuum) != int32(1) && int32(_pBt.XincrVacuum) != int32(0) {
 39959  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62184), unsafe.Pointer(&_newDatabaseØ00__func__Ø000), unsafe.Pointer(str(53161)))
 39960  			crt.X__builtin_abort(tls)
 39961  		}
 39962  	}()
 39963  	_sqlite3Put4byte(tls, elem15(_data, uintptr(52)), uint32(_pBt.XautoVacuum))
 39964  	_sqlite3Put4byte(tls, elem15(_data, uintptr(64)), uint32(_pBt.XincrVacuum))
 39965  	_pBt.XnPage = uint32(1)
 39966  	*elem15(_data, uintptr(31)) = uint8(1)
 39967  	return int32(0)
 39968  }
 39969  
 39970  var _newDatabaseØ00__func__Ø000 [12]int8
 39971  
 39972  func init() {
 39973  	crt.Xstrncpy(nil, &_newDatabaseØ00__func__Ø000[0], str(53202), 12)
 39974  }
 39975  
 39976  // C comment
 39977  //  /*
 39978  //  ** Set up a raw page so that it looks like a database page holding
 39979  //  ** no entries.
 39980  //  */
 39981  func _zeroPage(tls *crt.TLS, _pPage *XMemPage, _flags int32) {
 39982  	var _first uint16
 39983  	var _hdr uint8
 39984  	var _data *uint8
 39985  	var _pBt *XBtShared
 39986  	_data = _pPage.XaData
 39987  	_pBt = (*XBtShared)(_pPage.XpBt)
 39988  	_hdr = _pPage.XhdrOffset
 39989  	func() {
 39990  		if _sqlite3PagerPagenumber(tls, (*XPgHdr)(_pPage.XpDbPage)) != _pPage.Xpgno {
 39991  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60959), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(53214)))
 39992  			crt.X__builtin_abort(tls)
 39993  		}
 39994  	}()
 39995  	func() {
 39996  		if _sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.XpDbPage)) != unsafe.Pointer(_pPage) {
 39997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60960), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(20291)))
 39998  			crt.X__builtin_abort(tls)
 39999  		}
 40000  	}()
 40001  	func() {
 40002  		if _sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.XpDbPage)) != unsafe.Pointer(_data) {
 40003  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60961), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(53266)))
 40004  			crt.X__builtin_abort(tls)
 40005  		}
 40006  	}()
 40007  	func() {
 40008  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 40009  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60962), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(53310)))
 40010  			crt.X__builtin_abort(tls)
 40011  		}
 40012  	}()
 40013  	func() {
 40014  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 40015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60963), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 40016  			crt.X__builtin_abort(tls)
 40017  		}
 40018  	}()
 40019  	if (int32(_pBt.XbtsFlags) & int32(4)) != 0 {
 40020  		crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(_hdr))), int32(0), uint64(_pBt.XusableSize-uint32(_hdr)))
 40021  	}
 40022  	*elem15(_data, uintptr(_hdr)) = uint8(int8(_flags))
 40023  	_first = uint16(int32(_hdr) + func() int32 {
 40024  		if (_flags & int32(8)) == int32(0) {
 40025  			return int32(12)
 40026  		}
 40027  		return int32(8)
 40028  	}())
 40029  	crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(int32(_hdr)+int32(1)))), int32(0), uint64(4))
 40030  	*elem15(_data, uintptr(int32(_hdr)+int32(7))) = 0
 40031  	*elem15(elem15(func() *uint8 {
 40032  		*elem15(elem15(_data, uintptr(int32(_hdr)+int32(5))), 0) = uint8(_pBt.XusableSize >> 8)
 40033  		return _data
 40034  	}(), uintptr(int32(_hdr)+int32(5))), uintptr(1)) = uint8(_pBt.XusableSize)
 40035  	_pPage.XnFree = uint16(_pBt.XusableSize - uint32(_first))
 40036  	_decodeFlags(tls, _pPage, _flags)
 40037  	_pPage.XcellOffset = _first
 40038  	_pPage.XaDataEnd = elem15(_data, uintptr(_pBt.XusableSize))
 40039  	_pPage.XaCellIdx = elem15(_data, uintptr(_first))
 40040  	_pPage.XaDataOfst = elem15(_data, uintptr(_pPage.XchildPtrSize))
 40041  	_pPage.XnOverflow = 0
 40042  	func() {
 40043  		if _pBt.XpageSize < uint32(512) || _pBt.XpageSize > uint32(65536) {
 40044  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60979), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(53350)))
 40045  			crt.X__builtin_abort(tls)
 40046  		}
 40047  	}()
 40048  	_pPage.XmaskPage = uint16(_pBt.XpageSize - uint32(1))
 40049  	_pPage.XnCell = 0
 40050  	_pPage.XisInit = uint8(1)
 40051  }
 40052  
 40053  // C comment
 40054  //  /*
 40055  //  ** Return the page number for page pPg.
 40056  //  */
 40057  func _sqlite3PagerPagenumber(tls *crt.TLS, _pPg *XPgHdr) (r0 uint32) {
 40058  	return _pPg.Xpgno
 40059  }
 40060  
 40061  var _zeroPageØ00__func__Ø000 [9]int8
 40062  
 40063  func init() {
 40064  	crt.Xstrncpy(nil, &_zeroPageØ00__func__Ø000[0], str(53393), 9)
 40065  }
 40066  
 40067  func _sqlite3PagerIswriteable(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 40068  	return int32(_pPg.Xflags) & int32(4)
 40069  }
 40070  
 40071  // C comment
 40072  //  /*
 40073  //  ** Decode the flags byte (the first byte of the header) for a page
 40074  //  ** and initialize fields of the MemPage structure accordingly.
 40075  //  **
 40076  //  ** Only the following combinations are supported.  Anything different
 40077  //  ** indicates a corrupt database files:
 40078  //  **
 40079  //  **         PTF_ZERODATA
 40080  //  **         PTF_ZERODATA | PTF_LEAF
 40081  //  **         PTF_LEAFDATA | PTF_INTKEY
 40082  //  **         PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF
 40083  //  */
 40084  func _decodeFlags(tls *crt.TLS, _pPage *XMemPage, _flagByte int32) (r0 int32) {
 40085  	var _pBt *XBtShared
 40086  	func() {
 40087  		if int32(_pPage.XhdrOffset) != func() int32 {
 40088  			if _pPage.Xpgno == uint32(1) {
 40089  				return int32(100)
 40090  			}
 40091  			return int32(0)
 40092  		}() {
 40093  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60762), unsafe.Pointer(&_decodeFlagsØ00__func__Ø000), unsafe.Pointer(str(53402)))
 40094  			crt.X__builtin_abort(tls)
 40095  		}
 40096  	}()
 40097  	func() {
 40098  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 40099  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60763), unsafe.Pointer(&_decodeFlagsØ00__func__Ø000), unsafe.Pointer(str(20394)))
 40100  			crt.X__builtin_abort(tls)
 40101  		}
 40102  	}()
 40103  	_pPage.Xleaf = uint8(_flagByte >> 3)
 40104  
 40105  	_flagByte &= int32(-9)
 40106  	_pPage.XchildPtrSize = uint8(int32(4) - (int32(4) * int32(_pPage.Xleaf)))
 40107  	*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&_pPage.XxCellSize)) = _cellSizePtr
 40108  	_pBt = (*XBtShared)(_pPage.XpBt)
 40109  	if _flagByte != int32(5) {
 40110  		goto _6
 40111  	}
 40112  
 40113  	_pPage.XintKey = uint8(1)
 40114  	if _pPage.Xleaf != 0 {
 40115  		_pPage.XintKeyLeaf = uint8(1)
 40116  		*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&_pPage.XxParseCell)) = _btreeParseCellPtr
 40117  		goto _8
 40118  	}
 40119  	_pPage.XintKeyLeaf = 0
 40120  	*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&_pPage.XxCellSize)) = _cellSizePtrNoPayload
 40121  	*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&_pPage.XxParseCell)) = _btreeParseCellPtrNoPayload
 40122  _8:
 40123  	_pPage.XmaxLocal = _pBt.XmaxLeaf
 40124  	_pPage.XminLocal = _pBt.XminLeaf
 40125  	goto _11
 40126  _6:
 40127  	if _flagByte == int32(2) {
 40128  		_pPage.XintKey = 0
 40129  		_pPage.XintKeyLeaf = 0
 40130  		*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&_pPage.XxParseCell)) = _btreeParseCellPtrIndex
 40131  		_pPage.XmaxLocal = _pBt.XmaxLocal
 40132  		_pPage.XminLocal = _pBt.XminLocal
 40133  		goto _11
 40134  	}
 40135  	return _sqlite3CorruptError(tls, int32(60802))
 40136  
 40137  _11:
 40138  	_pPage.Xmax1bytePayload = _pBt.Xmax1bytePayload
 40139  	return int32(0)
 40140  }
 40141  
 40142  var _decodeFlagsØ00__func__Ø000 [12]int8
 40143  
 40144  func init() {
 40145  	crt.Xstrncpy(nil, &_decodeFlagsØ00__func__Ø000[0], str(53447), 12)
 40146  }
 40147  
 40148  // C comment
 40149  //  /*
 40150  //  ** The following routines are implementations of the MemPage.xCellSize
 40151  //  ** method.
 40152  //  **
 40153  //  ** Compute the total number of bytes that a Cell needs in the cell
 40154  //  ** data area of the btree-page.  The return number includes the cell
 40155  //  ** data header and the local payload, but not any overflow page or
 40156  //  ** the space used by the cell pointer.
 40157  //  **
 40158  //  ** cellSizePtrNoPayload()    =>   table internal nodes
 40159  //  ** cellSizePtr()             =>   all index nodes & table leaf nodes
 40160  //  */
 40161  func _cellSizePtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8) (r0 uint16) {
 40162  	var _5_minLocal int32
 40163  	var _nSize uint32
 40164  	var _pIter, _pEnd *uint8
 40165  	var _debuginfo XCellInfo
 40166  	_pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(_pPage.XchildPtrSize)))
 40167  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 40168  		v := _pPage.XxParseCell
 40169  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 40170  	}()(tls, _pPage, _pCell, &_debuginfo)
 40171  	_nSize = uint32(*_pIter)
 40172  	if _nSize < uint32(128) {
 40173  		goto _0
 40174  	}
 40175  	_pEnd = elem15(_pIter, uintptr(8))
 40176  	_nSize &= uint32(127)
 40177  _1:
 40178  	_nSize = (_nSize << 7) | uint32(int32(*preInc15(&_pIter, 1))&int32(127))
 40179  	if (int32(*_pIter) >= int32(128)) && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_pEnd))) {
 40180  		goto _1
 40181  	}
 40182  _0:
 40183  	*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
 40184  	if _pPage.XintKey == 0 {
 40185  		goto _3
 40186  	}
 40187  	_pEnd = elem15(_pIter, uintptr(9))
 40188  _4:
 40189  	if (int32(*postInc15(&_pIter, 1))&int32(128)) != 0 && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_pEnd))) {
 40190  		goto _4
 40191  	}
 40192  _3:
 40193  	if _nSize > uint32(_pPage.XmaxLocal) {
 40194  		goto _7
 40195  	}
 40196  	_nSize += uint32(int64(uintptr(unsafe.Pointer(_pIter)) - uintptr(unsafe.Pointer(_pCell))))
 40197  	if _nSize < uint32(4) {
 40198  		_nSize = uint32(4)
 40199  	}
 40200  	goto _9
 40201  _7:
 40202  	_5_minLocal = int32(_pPage.XminLocal)
 40203  	_nSize = uint32(_5_minLocal) + ((_nSize - uint32(_5_minLocal)) % (((*XBtShared)(_pPage.XpBt).XusableSize) - uint32(4)))
 40204  	if _nSize > uint32(_pPage.XmaxLocal) {
 40205  		_nSize = uint32(_5_minLocal)
 40206  	}
 40207  	_nSize += uint32(int32(4) + int32(uint16(int64(uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell))))))
 40208  _9:
 40209  	func() {
 40210  		if _nSize != uint32(_debuginfo.XnSize) && _sqlite3Config.XneverCorrupt != int32(0) {
 40211  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60301), unsafe.Pointer(&_cellSizePtrØ00__func__Ø000), unsafe.Pointer(str(53459)))
 40212  			crt.X__builtin_abort(tls)
 40213  		}
 40214  	}()
 40215  	return uint16(_nSize)
 40216  }
 40217  
 40218  var _cellSizePtrØ00__func__Ø000 [12]int8
 40219  
 40220  func init() {
 40221  	crt.Xstrncpy(nil, &_cellSizePtrØ00__func__Ø000[0], str(53496), 12)
 40222  }
 40223  
 40224  func _btreeParseCellPtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
 40225  	var _nPayload uint32
 40226  	var _iKey uint64
 40227  	var _pIter, _1_pEnd, _3_pEnd *uint8
 40228  	func() {
 40229  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 40230  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60140), unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000), unsafe.Pointer(str(20394)))
 40231  			crt.X__builtin_abort(tls)
 40232  		}
 40233  	}()
 40234  	func() {
 40235  		if int32(_pPage.Xleaf) != int32(0) && int32(_pPage.Xleaf) != int32(1) {
 40236  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60141), unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000), unsafe.Pointer(str(53508)))
 40237  			crt.X__builtin_abort(tls)
 40238  		}
 40239  	}()
 40240  	func() {
 40241  		if _pPage.XintKeyLeaf == 0 {
 40242  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60142), unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000), unsafe.Pointer(str(53541)))
 40243  			crt.X__builtin_abort(tls)
 40244  		}
 40245  	}()
 40246  	func() {
 40247  		if int32(_pPage.XchildPtrSize) != int32(0) {
 40248  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60143), unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000), unsafe.Pointer(str(53559)))
 40249  			crt.X__builtin_abort(tls)
 40250  		}
 40251  	}()
 40252  	_pIter = _pCell
 40253  	_nPayload = uint32(*_pIter)
 40254  	if _nPayload < uint32(128) {
 40255  		goto _9
 40256  	}
 40257  	_1_pEnd = elem15(_pIter, uintptr(8))
 40258  	_nPayload &= uint32(127)
 40259  _10:
 40260  	_nPayload = (_nPayload << 7) | uint32(int32(*preInc15(&_pIter, 1))&int32(127))
 40261  	if (int32(*_pIter) >= int32(128)) && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_1_pEnd))) {
 40262  		goto _10
 40263  	}
 40264  _9:
 40265  	*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
 40266  	_iKey = uint64(*_pIter)
 40267  	if _iKey < uint64(128) {
 40268  		goto _12
 40269  	}
 40270  	_3_pEnd = elem15(_pIter, uintptr(7))
 40271  	_iKey &= uint64(127)
 40272  _13:
 40273  	_iKey = (_iKey << 7) | uint64(int32(*preInc15(&_pIter, 1))&int32(127))
 40274  	if int32(*_pIter) < int32(128) {
 40275  		goto _14
 40276  	}
 40277  	if crt.P2U(unsafe.Pointer(_pIter)) >= crt.P2U(unsafe.Pointer(_3_pEnd)) {
 40278  		_iKey = (_iKey << 8) | uint64(*preInc15(&_pIter, 1))
 40279  		goto _14
 40280  	}
 40281  	goto _13
 40282  _14:
 40283  _12:
 40284  	*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
 40285  	_pInfo.XnKey = *(*int64)(unsafe.Pointer(&_iKey))
 40286  	_pInfo.XnPayload = _nPayload
 40287  	_pInfo.XpPayload = _pIter
 40288  	if _nPayload > uint32(_pPage.XmaxLocal) {
 40289  		goto _17
 40290  	}
 40291  	_pInfo.XnSize = uint16(_nPayload + uint32(uint16(int64(uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell))))))
 40292  	if int32(_pInfo.XnSize) < int32(4) {
 40293  		_pInfo.XnSize = uint16(4)
 40294  	}
 40295  	_pInfo.XnLocal = uint16(_nPayload)
 40296  	goto _19
 40297  _17:
 40298  	_btreeParseCellAdjustSizeForOverflow(tls, _pPage, _pCell, _pInfo)
 40299  _19:
 40300  }
 40301  
 40302  var _btreeParseCellPtrØ00__func__Ø000 [18]int8
 40303  
 40304  func init() {
 40305  	crt.Xstrncpy(nil, &_btreeParseCellPtrØ00__func__Ø000[0], str(53582), 18)
 40306  }
 40307  
 40308  // C comment
 40309  //  /*
 40310  //  ** This is common tail processing for btreeParseCellPtr() and
 40311  //  ** btreeParseCellPtrIndex() for the case when the cell does not fit entirely
 40312  //  ** on a single B-tree page.  Make necessary adjustments to the CellInfo
 40313  //  ** structure.
 40314  //  */
 40315  func _btreeParseCellAdjustSizeForOverflow(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
 40316  	var _minLocal, _maxLocal, _surplus int32
 40317  	_minLocal = int32(_pPage.XminLocal)
 40318  	_maxLocal = int32(_pPage.XmaxLocal)
 40319  	_surplus = int32(uint32(_minLocal) + ((_pInfo.XnPayload - uint32(_minLocal)) % (((*XBtShared)(_pPage.XpBt).XusableSize) - uint32(4))))
 40320  	if _surplus <= _maxLocal {
 40321  		_pInfo.XnLocal = uint16(_surplus)
 40322  		goto _1
 40323  	}
 40324  	_pInfo.XnLocal = uint16(_minLocal)
 40325  _1:
 40326  	_pInfo.XnSize = uint16(int32(uint16(int64(uintptr(unsafe.Pointer(elem15(_pInfo.XpPayload, uintptr(_pInfo.XnLocal))))-uintptr(unsafe.Pointer(_pCell))))) + int32(4))
 40327  }
 40328  
 40329  func _cellSizePtrNoPayload(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8) (r0 uint16) {
 40330  	var _pIter, _pEnd *uint8
 40331  	var _debuginfo XCellInfo
 40332  	_pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(int32(4))))
 40333  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 40334  		v := _pPage.XxParseCell
 40335  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 40336  	}()(tls, _pPage, _pCell, &_debuginfo)
 40337  	func() {
 40338  		if int32(_pPage.XchildPtrSize) != int32(4) {
 40339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60319), unsafe.Pointer(&_cellSizePtrNoPayloadØ00__func__Ø000), unsafe.Pointer(str(53600)))
 40340  			crt.X__builtin_abort(tls)
 40341  		}
 40342  	}()
 40343  	_pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIter)) + uintptr(int32(9))))
 40344  _2:
 40345  	if (int32(*postInc15(&_pIter, 1))&int32(128)) != 0 && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_pEnd))) {
 40346  		goto _2
 40347  	}
 40348  	func() {
 40349  		if int32(_debuginfo.XnSize) != int32(uint16(int64(uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell))))) && _sqlite3Config.XneverCorrupt != int32(0) {
 40350  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60322), unsafe.Pointer(&_cellSizePtrNoPayloadØ00__func__Ø000), unsafe.Pointer(str(53623)))
 40351  			crt.X__builtin_abort(tls)
 40352  		}
 40353  	}()
 40354  	return uint16(int64(uintptr(unsafe.Pointer(_pIter)) - uintptr(unsafe.Pointer(_pCell))))
 40355  }
 40356  
 40357  var _cellSizePtrNoPayloadØ00__func__Ø000 [21]int8
 40358  
 40359  func init() {
 40360  	crt.Xstrncpy(nil, &_cellSizePtrNoPayloadØ00__func__Ø000[0], str(53675), 21)
 40361  }
 40362  
 40363  // C comment
 40364  //  /*
 40365  //  ** The following routines are implementations of the MemPage.xParseCell()
 40366  //  ** method.
 40367  //  **
 40368  //  ** Parse a cell content block and fill in the CellInfo structure.
 40369  //  **
 40370  //  ** btreeParseCellPtr()        =>   table btree leaf nodes
 40371  //  ** btreeParseCellNoPayload()  =>   table btree internal nodes
 40372  //  ** btreeParseCellPtrIndex()   =>   index btree nodes
 40373  //  **
 40374  //  ** There is also a wrapper function btreeParseCell() that works for
 40375  //  ** all MemPage types and that references the cell by index rather than
 40376  //  ** by pointer.
 40377  //  */
 40378  func _btreeParseCellPtrNoPayload(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
 40379  	func() {
 40380  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 40381  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60119), unsafe.Pointer(&_btreeParseCellPtrNoPayloadØ00__func__Ø000), unsafe.Pointer(str(20394)))
 40382  			crt.X__builtin_abort(tls)
 40383  		}
 40384  	}()
 40385  	func() {
 40386  		if int32(_pPage.Xleaf) != int32(0) {
 40387  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60120), unsafe.Pointer(&_btreeParseCellPtrNoPayloadØ00__func__Ø000), unsafe.Pointer(str(53696)))
 40388  			crt.X__builtin_abort(tls)
 40389  		}
 40390  	}()
 40391  	func() {
 40392  		if int32(_pPage.XchildPtrSize) != int32(4) {
 40393  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60121), unsafe.Pointer(&_btreeParseCellPtrNoPayloadØ00__func__Ø000), unsafe.Pointer(str(53600)))
 40394  			crt.X__builtin_abort(tls)
 40395  		}
 40396  	}()
 40397  	_pInfo.XnSize = uint16(int32(4) + int32(_sqlite3GetVarint(tls, elem15(_pCell, uintptr(4)), (*uint64)(unsafe.Pointer(&_pInfo.XnKey)))))
 40398  	_pInfo.XnPayload = 0
 40399  	_pInfo.XnLocal = 0
 40400  	_pInfo.XpPayload = nil
 40401  }
 40402  
 40403  var _btreeParseCellPtrNoPayloadØ00__func__Ø000 [27]int8
 40404  
 40405  func init() {
 40406  	crt.Xstrncpy(nil, &_btreeParseCellPtrNoPayloadØ00__func__Ø000[0], str(53711), 27)
 40407  }
 40408  
 40409  // C comment
 40410  //  /*
 40411  //  ** Read a 64-bit variable-length integer from memory starting at p[0].
 40412  //  ** Return the number of bytes read.  The value is stored in *v.
 40413  //  */
 40414  func _sqlite3GetVarint(tls *crt.TLS, _p *uint8, _v *uint64) (r0 uint8) {
 40415  	var _a, _b, _s uint32
 40416  	_a = uint32(*_p)
 40417  	if (_a & uint32(128)) == 0 {
 40418  		*_v = uint64(_a)
 40419  		return uint8(1)
 40420  	}
 40421  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40422  	_b = uint32(*_p)
 40423  	if (_b & uint32(128)) == 0 {
 40424  		_a &= uint32(127)
 40425  		_a = _a << 7
 40426  		_a |= _b
 40427  		*_v = uint64(_a)
 40428  		return uint8(2)
 40429  	}
 40430  
 40431  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40432  	_a = _a << 14
 40433  	_a |= uint32(*_p)
 40434  	if (_a & uint32(128)) == 0 {
 40435  		_a &= uint32(2080895)
 40436  		_b &= uint32(127)
 40437  		_b = _b << 7
 40438  		_a |= _b
 40439  		*_v = uint64(_a)
 40440  		return uint8(3)
 40441  	}
 40442  	_a &= uint32(2080895)
 40443  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40444  	_b = _b << 14
 40445  	_b |= uint32(*_p)
 40446  	if (_b & uint32(128)) == 0 {
 40447  		_b &= uint32(2080895)
 40448  		_a = _a << 7
 40449  		_a |= _b
 40450  		*_v = uint64(_a)
 40451  		return uint8(4)
 40452  	}
 40453  	_b &= uint32(2080895)
 40454  	_s = _a
 40455  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40456  	_a = _a << 14
 40457  	_a |= uint32(*_p)
 40458  	if (_a & uint32(128)) == 0 {
 40459  		_b = _b << 7
 40460  		_a |= _b
 40461  		_s = _s >> 18
 40462  		*_v = (uint64(_s) << 32) | uint64(_a)
 40463  		return uint8(5)
 40464  	}
 40465  	_s = _s << 7
 40466  	_s |= _b
 40467  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40468  	_b = _b << 14
 40469  	_b |= uint32(*_p)
 40470  	if (_b & uint32(128)) == 0 {
 40471  		_a &= uint32(2080895)
 40472  		_a = _a << 7
 40473  		_a |= _b
 40474  		_s = _s >> 18
 40475  		*_v = (uint64(_s) << 32) | uint64(_a)
 40476  		return uint8(6)
 40477  	}
 40478  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40479  	_a = _a << 14
 40480  	_a |= uint32(*_p)
 40481  	if (_a & uint32(128)) == 0 {
 40482  		_a &= uint32(4028612735)
 40483  		_b &= uint32(2080895)
 40484  		_b = _b << 7
 40485  		_a |= _b
 40486  		_s = _s >> 11
 40487  		*_v = (uint64(_s) << 32) | uint64(_a)
 40488  		return uint8(7)
 40489  	}
 40490  	_a &= uint32(2080895)
 40491  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40492  	_b = _b << 14
 40493  	_b |= uint32(*_p)
 40494  	if (_b & uint32(128)) == 0 {
 40495  		_b &= uint32(4028612735)
 40496  		_a = _a << 7
 40497  		_a |= _b
 40498  		_s = _s >> 4
 40499  		*_v = (uint64(_s) << 32) | uint64(_a)
 40500  		return uint8(8)
 40501  	}
 40502  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40503  	_a = _a << 15
 40504  	_a |= uint32(*_p)
 40505  	_b &= uint32(2080895)
 40506  	_b = _b << 8
 40507  	_a |= _b
 40508  	_s = _s << 4
 40509  	_b = uint32(*elem15(_p, uintptr(18446744073709551612)))
 40510  	_b &= uint32(127)
 40511  	_b = _b >> 3
 40512  	_s |= _b
 40513  	*_v = (uint64(_s) << 32) | uint64(_a)
 40514  	return uint8(9)
 40515  }
 40516  
 40517  func _btreeParseCellPtrIndex(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
 40518  	var _nPayload uint32
 40519  	var _pIter, _1_pEnd *uint8
 40520  	func() {
 40521  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 40522  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60207), unsafe.Pointer(&_btreeParseCellPtrIndexØ00__func__Ø000), unsafe.Pointer(str(20394)))
 40523  			crt.X__builtin_abort(tls)
 40524  		}
 40525  	}()
 40526  	func() {
 40527  		if int32(_pPage.Xleaf) != int32(0) && int32(_pPage.Xleaf) != int32(1) {
 40528  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60208), unsafe.Pointer(&_btreeParseCellPtrIndexØ00__func__Ø000), unsafe.Pointer(str(53508)))
 40529  			crt.X__builtin_abort(tls)
 40530  		}
 40531  	}()
 40532  	func() {
 40533  		if int32(_pPage.XintKeyLeaf) != int32(0) {
 40534  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60209), unsafe.Pointer(&_btreeParseCellPtrIndexØ00__func__Ø000), unsafe.Pointer(str(53738)))
 40535  			crt.X__builtin_abort(tls)
 40536  		}
 40537  	}()
 40538  	_pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(_pPage.XchildPtrSize)))
 40539  	_nPayload = uint32(*_pIter)
 40540  	if _nPayload < uint32(128) {
 40541  		goto _7
 40542  	}
 40543  	_1_pEnd = elem15(_pIter, uintptr(8))
 40544  	_nPayload &= uint32(127)
 40545  _8:
 40546  	_nPayload = (_nPayload << 7) | uint32(int32(*preInc15(&_pIter, 1))&int32(127))
 40547  	if (int32(*_pIter) >= int32(128)) && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_1_pEnd))) {
 40548  		goto _8
 40549  	}
 40550  _7:
 40551  	*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
 40552  	_pInfo.XnKey = int64(_nPayload)
 40553  	_pInfo.XnPayload = _nPayload
 40554  	_pInfo.XpPayload = _pIter
 40555  	if _nPayload > uint32(_pPage.XmaxLocal) {
 40556  		goto _10
 40557  	}
 40558  	_pInfo.XnSize = uint16(_nPayload + uint32(uint16(int64(uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell))))))
 40559  	if int32(_pInfo.XnSize) < int32(4) {
 40560  		_pInfo.XnSize = uint16(4)
 40561  	}
 40562  	_pInfo.XnLocal = uint16(_nPayload)
 40563  	goto _12
 40564  _10:
 40565  	_btreeParseCellAdjustSizeForOverflow(tls, _pPage, _pCell, _pInfo)
 40566  _12:
 40567  }
 40568  
 40569  var _btreeParseCellPtrIndexØ00__func__Ø000 [23]int8
 40570  
 40571  func init() {
 40572  	crt.Xstrncpy(nil, &_btreeParseCellPtrIndexØ00__func__Ø000[0], str(53759), 23)
 40573  }
 40574  
 40575  // C comment
 40576  //  /*
 40577  //  ** Invoke the busy handler for a btree.
 40578  //  */
 40579  func _btreeInvokeBusyHandler(tls *crt.TLS, _pArg unsafe.Pointer) (r0 int32) {
 40580  	var _pBt *XBtShared
 40581  	_pBt = (*XBtShared)(_pArg)
 40582  	func() {
 40583  		if _pBt.Xdb == nil {
 40584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61201), unsafe.Pointer(&_btreeInvokeBusyHandlerØ00__func__Ø000), unsafe.Pointer(str(53782)))
 40585  			crt.X__builtin_abort(tls)
 40586  		}
 40587  	}()
 40588  	func() {
 40589  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pBt.Xdb).Xmutex)) == 0 {
 40590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61202), unsafe.Pointer(&_btreeInvokeBusyHandlerØ00__func__Ø000), unsafe.Pointer(str(53790)))
 40591  			crt.X__builtin_abort(tls)
 40592  		}
 40593  	}()
 40594  	return _sqlite3InvokeBusyHandler(tls, &((*Xsqlite3)(_pBt.Xdb).XbusyHandler))
 40595  }
 40596  
 40597  var _btreeInvokeBusyHandlerØ00__func__Ø000 [23]int8
 40598  
 40599  func init() {
 40600  	crt.Xstrncpy(nil, &_btreeInvokeBusyHandlerØ00__func__Ø000[0], str(53825), 23)
 40601  }
 40602  
 40603  // C comment
 40604  //  /*
 40605  //  ** Invoke the given busy handler.
 40606  //  **
 40607  //  ** This routine is called when an operation failed with a lock.
 40608  //  ** If this routine returns non-zero, the lock is retried.  If it
 40609  //  ** returns 0, the operation aborts with an SQLITE_BUSY error.
 40610  //  */
 40611  func _sqlite3InvokeBusyHandler(tls *crt.TLS, _p *t77) (r0 int32) {
 40612  	var _rc int32
 40613  	if (func() int32 {
 40614  		if _p == nil {
 40615  			return func() int32 {
 40616  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141968), unsafe.Pointer(&_sqlite3InvokeBusyHandlerØ00__func__Ø000), unsafe.Pointer(str(4809)))
 40617  				crt.X__builtin_abort(tls)
 40618  				return int32(1)
 40619  			}()
 40620  		}
 40621  		return int32(0)
 40622  	}() != 0 || (_p.XxFunc == nil)) || (_p.XnBusy < int32(0)) {
 40623  		return int32(0)
 40624  	}
 40625  	_rc = _p.XxFunc(tls, _p.XpArg, _p.XnBusy)
 40626  	if _rc == int32(0) {
 40627  		_p.XnBusy = int32(-1)
 40628  		goto _6
 40629  	}
 40630  	_p.XnBusy += 1
 40631  _6:
 40632  	return _rc
 40633  }
 40634  
 40635  var _sqlite3InvokeBusyHandlerØ00__func__Ø000 [25]int8
 40636  
 40637  func init() {
 40638  	crt.Xstrncpy(nil, &_sqlite3InvokeBusyHandlerØ00__func__Ø000[0], str(53848), 25)
 40639  }
 40640  
 40641  func _sqlite3PagerOpenSavepoint(tls *crt.TLS, _pPager *XPager, _nSavepoint int32) (r0 int32) {
 40642  	func() {
 40643  		if int32(_pPager.XeState) < int32(2) {
 40644  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53654), unsafe.Pointer(&_sqlite3PagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(10935)))
 40645  			crt.X__builtin_abort(tls)
 40646  		}
 40647  	}()
 40648  	func() {
 40649  		if _assert_pager_state(tls, _pPager) == 0 {
 40650  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53655), unsafe.Pointer(&_sqlite3PagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(10971)))
 40651  			crt.X__builtin_abort(tls)
 40652  		}
 40653  	}()
 40654  	if (_nSavepoint > _pPager.XnSavepoint) && (_pPager.XuseJournal != 0) {
 40655  		return _pagerOpenSavepoint(tls, _pPager, _nSavepoint)
 40656  	}
 40657  	return int32(0)
 40658  }
 40659  
 40660  var _sqlite3PagerOpenSavepointØ00__func__Ø000 [26]int8
 40661  
 40662  func init() {
 40663  	crt.Xstrncpy(nil, &_sqlite3PagerOpenSavepointØ00__func__Ø000[0], str(53873), 26)
 40664  }
 40665  
 40666  // C comment
 40667  //  /*
 40668  //  ** Check that there are at least nSavepoint savepoints open. If there are
 40669  //  ** currently less than nSavepoints open, then open one or more savepoints
 40670  //  ** to make up the difference. If the number of savepoints is already
 40671  //  ** equal to nSavepoint, then this function is a no-op.
 40672  //  **
 40673  //  ** If a memory allocation fails, SQLITE_NOMEM is returned. If an error
 40674  //  ** occurs while opening the sub-journal file, then an IO error code is
 40675  //  ** returned. Otherwise, SQLITE_OK.
 40676  //  */
 40677  func _pagerOpenSavepoint(tls *crt.TLS, _pPager *XPager, _nSavepoint int32) (r0 int32) {
 40678  	var _rc, _nCurrent, _ii int32
 40679  	var _aNew *XPagerSavepoint
 40680  	_rc = int32(0)
 40681  	_nCurrent = _pPager.XnSavepoint
 40682  	func() {
 40683  		if int32(_pPager.XeState) < int32(2) {
 40684  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53614), unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(10935)))
 40685  			crt.X__builtin_abort(tls)
 40686  		}
 40687  	}()
 40688  	func() {
 40689  		if _assert_pager_state(tls, _pPager) == 0 {
 40690  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53615), unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(10971)))
 40691  			crt.X__builtin_abort(tls)
 40692  		}
 40693  	}()
 40694  	func() {
 40695  		if _nSavepoint <= _nCurrent || _pPager.XuseJournal == 0 {
 40696  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53616), unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(53899)))
 40697  			crt.X__builtin_abort(tls)
 40698  		}
 40699  	}()
 40700  	_aNew = (*XPagerSavepoint)(_sqlite3Realloc(tls, _pPager.XaSavepoint, uint64(48)*uint64(_nSavepoint)))
 40701  	if _aNew == nil {
 40702  		return _sqlite3NomemError(tls, int32(53626))
 40703  	}
 40704  	crt.Xmemset(tls, unsafe.Pointer(elem32(_aNew, uintptr(_nCurrent))), int32(0), uint64(_nSavepoint-_nCurrent)*uint64(48))
 40705  	*(**XPagerSavepoint)(unsafe.Pointer(&_pPager.XaSavepoint)) = _aNew
 40706  	_ii = _nCurrent
 40707  _8:
 40708  	if _ii >= _nSavepoint {
 40709  		goto _11
 40710  	}
 40711  	elem32(_aNew, uintptr(_ii)).XnOrig = _pPager.XdbSize
 40712  	if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil) && (_pPager.XjournalOff > (0)) {
 40713  		elem32(_aNew, uintptr(_ii)).XiOffset = _pPager.XjournalOff
 40714  		goto _14
 40715  	}
 40716  	elem32(_aNew, uintptr(_ii)).XiOffset = int64(_pPager.XsectorSize)
 40717  _14:
 40718  	elem32(_aNew, uintptr(_ii)).XiSubRec = _pPager.XnSubRec
 40719  	*(**XBitvec)(unsafe.Pointer(&(elem32(_aNew, uintptr(_ii)).XpInSavepoint))) = _sqlite3BitvecCreate(tls, _pPager.XdbSize)
 40720  	if (elem32(_aNew, uintptr(_ii)).XpInSavepoint) == nil {
 40721  		return _sqlite3NomemError(tls, int32(53642))
 40722  	}
 40723  	if (*XWal)(_pPager.XpWal) != nil {
 40724  		_sqlite3WalSavepoint(tls, (*XWal)(_pPager.XpWal), (*uint32)(unsafe.Pointer(&(elem32(_aNew, uintptr(_ii)).XaWalData))))
 40725  	}
 40726  	_pPager.XnSavepoint = _ii + int32(1)
 40727  	_ii += 1
 40728  	goto _8
 40729  _11:
 40730  	func() {
 40731  		if _pPager.XnSavepoint != _nSavepoint {
 40732  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53649), unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(53941)))
 40733  			crt.X__builtin_abort(tls)
 40734  		}
 40735  	}()
 40736  	_assertTruncateConstraint(tls, _pPager)
 40737  	return _rc
 40738  }
 40739  
 40740  var _pagerOpenSavepointØ00__func__Ø000 [19]int8
 40741  
 40742  func init() {
 40743  	crt.Xstrncpy(nil, &_pagerOpenSavepointØ00__func__Ø000[0], str(53972), 19)
 40744  }
 40745  
 40746  // C comment
 40747  //  /*
 40748  //  ** Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32
 40749  //  ** values. This function populates the array with values required to
 40750  //  ** "rollback" the write position of the WAL handle back to the current
 40751  //  ** point in the event of a savepoint rollback (via WalSavepointUndo()).
 40752  //  */
 40753  func _sqlite3WalSavepoint(tls *crt.TLS, _pWal *XWal, _aWalData *uint32) {
 40754  	func() {
 40755  		if _pWal.XwriteLock == 0 {
 40756  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57300), unsafe.Pointer(&_sqlite3WalSavepointØ00__func__Ø000), unsafe.Pointer(str(15561)))
 40757  			crt.X__builtin_abort(tls)
 40758  		}
 40759  	}()
 40760  	*elem31(_aWalData, 0) = _pWal.Xhdr.XmxFrame
 40761  	*elem31(_aWalData, uintptr(1)) = *elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0)
 40762  	*elem31(_aWalData, uintptr(2)) = *elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1))
 40763  	*elem31(_aWalData, uintptr(3)) = _pWal.XnCkpt
 40764  }
 40765  
 40766  var _sqlite3WalSavepointØ00__func__Ø000 [20]int8
 40767  
 40768  func init() {
 40769  	crt.Xstrncpy(nil, &_sqlite3WalSavepointØ00__func__Ø000[0], str(53991), 20)
 40770  }
 40771  
 40772  func _assertTruncateConstraint(tls *crt.TLS, _pPager *XPager) {
 40773  	_sqlite3PcacheIterateDirty(tls, (*XPCache)(_pPager.XpPCache), _assertTruncateConstraintCb)
 40774  }
 40775  
 40776  // C comment
 40777  //  /*
 40778  //  ** For all dirty pages currently in the cache, invoke the specified
 40779  //  ** callback. This is only used if the SQLITE_CHECK_PAGES macro is
 40780  //  ** defined.
 40781  //  */
 40782  func _sqlite3PcacheIterateDirty(tls *crt.TLS, _pCache *XPCache, _xIter func(*crt.TLS, *XPgHdr)) {
 40783  	var _pDirty *XPgHdr
 40784  	_pDirty = (*XPgHdr)(_pCache.XpDirty)
 40785  _0:
 40786  	if _pDirty == nil {
 40787  		goto _3
 40788  	}
 40789  	_xIter(tls, _pDirty)
 40790  	_pDirty = (*XPgHdr)(_pDirty.XpDirtyNext)
 40791  	goto _0
 40792  _3:
 40793  }
 40794  
 40795  func _assertTruncateConstraintCb(tls *crt.TLS, _pPg *XPgHdr) {
 40796  	func() {
 40797  		if (int32(_pPg.Xflags) & int32(2)) == 0 {
 40798  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50854), unsafe.Pointer(&_assertTruncateConstraintCbØ00__func__Ø000), unsafe.Pointer(str(54011)))
 40799  			crt.X__builtin_abort(tls)
 40800  		}
 40801  	}()
 40802  	func() {
 40803  		if _subjRequiresPage(tls, _pPg) != 0 && _pPg.Xpgno > ((*XPager)(_pPg.XpPager).XdbSize) {
 40804  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50855), unsafe.Pointer(&_assertTruncateConstraintCbØ00__func__Ø000), unsafe.Pointer(str(54034)))
 40805  			crt.X__builtin_abort(tls)
 40806  		}
 40807  	}()
 40808  }
 40809  
 40810  var _assertTruncateConstraintCbØ00__func__Ø000 [27]int8
 40811  
 40812  func init() {
 40813  	crt.Xstrncpy(nil, &_assertTruncateConstraintCbØ00__func__Ø000[0], str(54091), 27)
 40814  }
 40815  
 40816  // C comment
 40817  //  /*
 40818  //  ** This function may only be called if the b-tree connection already
 40819  //  ** has a read or write transaction open on the database.
 40820  //  **
 40821  //  ** Read the meta-information out of a database file.  Meta[0]
 40822  //  ** is the number of free pages currently in the database.  Meta[1]
 40823  //  ** through meta[15] are available for use by higher layers.  Meta[0]
 40824  //  ** is read-only, the others are read/write.
 40825  //  **
 40826  //  ** The schema layer numbers meta values differently.  At the schema
 40827  //  ** layer (and the SetCookie and ReadCookie opcodes) the number of
 40828  //  ** free pages is not visible.  So Cookie[0] is the same as Meta[1].
 40829  //  **
 40830  //  ** This routine treats Meta[BTREE_DATA_VERSION] as a special case.  Instead
 40831  //  ** of reading the value out of the header, it instead loads the "DataVersion"
 40832  //  ** from the pager.  The BTREE_DATA_VERSION value is not actually stored in the
 40833  //  ** database file.  It is a number computed by the pager.  But its access
 40834  //  ** pattern is the same as header meta values, and so it is convenient to
 40835  //  ** read it from this routine.
 40836  //  */
 40837  func _sqlite3BtreeGetMeta(tls *crt.TLS, _p *XBtree, _idx int32, _pMeta *uint32) {
 40838  	var _pBt *XBtShared
 40839  	_pBt = (*XBtShared)(_p.XpBt)
 40840  	_sqlite3BtreeEnter(tls, _p)
 40841  	func() {
 40842  		if int32(_p.XinTrans) <= int32(0) {
 40843  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67861), unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000), unsafe.Pointer(str(54118)))
 40844  			crt.X__builtin_abort(tls)
 40845  		}
 40846  	}()
 40847  	func() {
 40848  		if int32(0) != _querySharedCacheTableLock(tls, _p, uint32(1), uint8(1)) {
 40849  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67862), unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000), unsafe.Pointer(str(54140)))
 40850  			crt.X__builtin_abort(tls)
 40851  		}
 40852  	}()
 40853  	func() {
 40854  		if _pBt.XpPage1 == nil {
 40855  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67863), unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000), unsafe.Pointer(str(54204)))
 40856  			crt.X__builtin_abort(tls)
 40857  		}
 40858  	}()
 40859  	func() {
 40860  		if _idx < int32(0) || _idx > int32(15) {
 40861  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67864), unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000), unsafe.Pointer(str(54216)))
 40862  			crt.X__builtin_abort(tls)
 40863  		}
 40864  	}()
 40865  	if _idx == int32(15) {
 40866  		*_pMeta = _sqlite3PagerDataVersion(tls, (*XPager)(_pBt.XpPager)) + _p.XiDataVersion
 40867  		goto _10
 40868  	}
 40869  	*_pMeta = _sqlite3Get4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(int32(36)+(_idx*int32(4)))))
 40870  _10:
 40871  	_sqlite3BtreeLeave(tls, _p)
 40872  }
 40873  
 40874  var _sqlite3BtreeGetMetaØ00__func__Ø000 [20]int8
 40875  
 40876  func init() {
 40877  	crt.Xstrncpy(nil, &_sqlite3BtreeGetMetaØ00__func__Ø000[0], str(54234), 20)
 40878  }
 40879  
 40880  // C comment
 40881  //  /*
 40882  //  ** Return the pPager->iDataVersion value
 40883  //  */
 40884  func _sqlite3PagerDataVersion(tls *crt.TLS, _pPager *XPager) (r0 uint32) {
 40885  	func() {
 40886  		if int32(_pPager.XeState) <= int32(0) {
 40887  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48656), unsafe.Pointer(&_sqlite3PagerDataVersionØ00__func__Ø000), unsafe.Pointer(str(54254)))
 40888  			crt.X__builtin_abort(tls)
 40889  		}
 40890  	}()
 40891  	return _pPager.XiDataVersion
 40892  }
 40893  
 40894  var _sqlite3PagerDataVersionØ00__func__Ø000 [24]int8
 40895  
 40896  func init() {
 40897  	crt.Xstrncpy(nil, &_sqlite3PagerDataVersionØ00__func__Ø000[0], str(54280), 24)
 40898  }
 40899  
 40900  // C comment
 40901  //  /*
 40902  //  ** Reset the schema for the database at index iDb.  Also reset the
 40903  //  ** TEMP schema.
 40904  //  */
 40905  func _sqlite3ResetOneSchema(tls *crt.TLS, _db *Xsqlite3, _iDb int32) {
 40906  	var _pDb *XDb
 40907  	func() {
 40908  		if _iDb >= _db.XnDb {
 40909  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100217), unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000), unsafe.Pointer(str(54304)))
 40910  			crt.X__builtin_abort(tls)
 40911  		}
 40912  	}()
 40913  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 40914  	func() {
 40915  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 40916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100221), unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000), unsafe.Pointer(str(51126)))
 40917  			crt.X__builtin_abort(tls)
 40918  		}
 40919  	}()
 40920  	func() {
 40921  		if (*XSchema)(_pDb.XpSchema) == nil {
 40922  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100222), unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000), unsafe.Pointer(str(54316)))
 40923  			crt.X__builtin_abort(tls)
 40924  		}
 40925  	}()
 40926  	_sqlite3SchemaClear(tls, _pDb.XpSchema)
 40927  	if _iDb != int32(1) {
 40928  		_pDb = elem27((*XDb)(_db.XaDb), uintptr(1))
 40929  		func() {
 40930  			if (*XSchema)(_pDb.XpSchema) == nil {
 40931  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100231), unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000), unsafe.Pointer(str(54316)))
 40932  				crt.X__builtin_abort(tls)
 40933  			}
 40934  		}()
 40935  		_sqlite3SchemaClear(tls, _pDb.XpSchema)
 40936  	}
 40937  }
 40938  
 40939  var _sqlite3ResetOneSchemaØ00__func__Ø000 [22]int8
 40940  
 40941  func init() {
 40942  	crt.Xstrncpy(nil, &_sqlite3ResetOneSchemaØ00__func__Ø000[0], str(54332), 22)
 40943  }
 40944  
 40945  // C comment
 40946  //  /*
 40947  //  ** Do both phases of a commit.
 40948  //  */
 40949  func _sqlite3BtreeCommit(tls *crt.TLS, _p *XBtree) (r0 int32) {
 40950  	var _rc int32
 40951  	_sqlite3BtreeEnter(tls, _p)
 40952  	_rc = _sqlite3BtreeCommitPhaseOne(tls, _p, nil)
 40953  	if _rc == int32(0) {
 40954  		_rc = _sqlite3BtreeCommitPhaseTwo(tls, _p, int32(0))
 40955  	}
 40956  	_sqlite3BtreeLeave(tls, _p)
 40957  	return _rc
 40958  }
 40959  
 40960  // C comment
 40961  //  /*
 40962  //  ** This routine does the first phase of a two-phase commit.  This routine
 40963  //  ** causes a rollback journal to be created (if it does not already exist)
 40964  //  ** and populated with enough information so that if a power loss occurs
 40965  //  ** the database can be restored to its original state by playing back
 40966  //  ** the journal.  Then the contents of the journal are flushed out to
 40967  //  ** the disk.  After the journal is safely on oxide, the changes to the
 40968  //  ** database are written into the database file and flushed to oxide.
 40969  //  ** At the end of this call, the rollback journal still exists on the
 40970  //  ** disk and we are still holding all locks, so the transaction has not
 40971  //  ** committed.  See sqlite3BtreeCommitPhaseTwo() for the second phase of the
 40972  //  ** commit process.
 40973  //  **
 40974  //  ** This call is a no-op if no write-transaction is currently active on pBt.
 40975  //  **
 40976  //  ** Otherwise, sync the database file for the btree pBt. zMaster points to
 40977  //  ** the name of a master journal file that should be written into the
 40978  //  ** individual journal file, or is NULL, indicating no master journal file
 40979  //  ** (single database transaction).
 40980  //  **
 40981  //  ** When this is called, the master journal should already have been
 40982  //  ** created, populated with this journal pointer and synced to disk.
 40983  //  **
 40984  //  ** Once this is routine has returned, the only thing required to commit
 40985  //  ** the write-transaction for this database file is to delete the journal.
 40986  //  */
 40987  func _sqlite3BtreeCommitPhaseOne(tls *crt.TLS, _p *XBtree, _zMaster *int8) (r0 int32) {
 40988  	var _rc int32
 40989  	var _1_pBt *XBtShared
 40990  	_rc = int32(0)
 40991  	if int32(_p.XinTrans) != int32(2) {
 40992  		goto _0
 40993  	}
 40994  	_1_pBt = (*XBtShared)(_p.XpBt)
 40995  	_sqlite3BtreeEnter(tls, _p)
 40996  	if _1_pBt.XautoVacuum == 0 {
 40997  		goto _1
 40998  	}
 40999  	_rc = _autoVacuumCommit(tls, _1_pBt)
 41000  	if _rc != int32(0) {
 41001  		_sqlite3BtreeLeave(tls, _p)
 41002  		return _rc
 41003  	}
 41004  _1:
 41005  	if _1_pBt.XbDoTruncate != 0 {
 41006  		_sqlite3PagerTruncateImage(tls, (*XPager)(_1_pBt.XpPager), _1_pBt.XnPage)
 41007  	}
 41008  	_rc = _sqlite3PagerCommitPhaseOne(tls, (*XPager)(_1_pBt.XpPager), _zMaster, int32(0))
 41009  	_sqlite3BtreeLeave(tls, _p)
 41010  _0:
 41011  	return _rc
 41012  }
 41013  
 41014  // C comment
 41015  //  /*
 41016  //  ** This routine is called prior to sqlite3PagerCommit when a transaction
 41017  //  ** is committed for an auto-vacuum database.
 41018  //  **
 41019  //  ** If SQLITE_OK is returned, then *pnTrunc is set to the number of pages
 41020  //  ** the database file should be truncated to during the commit process.
 41021  //  ** i.e. the database has been reorganized so that only the first *pnTrunc
 41022  //  ** pages are in use.
 41023  //  */
 41024  func _autoVacuumCommit(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
 41025  	var _rc, _nRef int32
 41026  	var _1_nFin, _1_nFree, _1_iFree, _1_nOrig uint32
 41027  	var _pPager *XPager
 41028  	_rc = int32(0)
 41029  	_pPager = (*XPager)(_pBt.XpPager)
 41030  	_nRef = _sqlite3PagerRefcount(tls, _pPager)
 41031  	func() {
 41032  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 41033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62757), unsafe.Pointer(&_autoVacuumCommitØ00__func__Ø000), unsafe.Pointer(str(9235)))
 41034  			crt.X__builtin_abort(tls)
 41035  		}
 41036  	}()
 41037  	_invalidateAllOverflowCache(tls, _pBt)
 41038  	func() {
 41039  		if _pBt.XautoVacuum == 0 {
 41040  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62759), unsafe.Pointer(&_autoVacuumCommitØ00__func__Ø000), unsafe.Pointer(str(54354)))
 41041  			crt.X__builtin_abort(tls)
 41042  		}
 41043  	}()
 41044  	if _pBt.XincrVacuum != 0 {
 41045  		goto _4
 41046  	}
 41047  	_1_nOrig = _btreePagecount(tls, _pBt)
 41048  	if (_ptrmapPageno(tls, _pBt, _1_nOrig) == _1_nOrig) || (_1_nOrig == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 41049  		return _sqlite3CorruptError(tls, int32(62772))
 41050  	}
 41051  	_1_nFree = _sqlite3Get4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(36)))
 41052  	_1_nFin = _finalDbSize(tls, _pBt, _1_nOrig, _1_nFree)
 41053  	if _1_nFin > _1_nOrig {
 41054  		return _sqlite3CorruptError(tls, int32(62777))
 41055  	}
 41056  	if _1_nFin < _1_nOrig {
 41057  		_rc = _saveAllCursors(tls, _pBt, 0, nil)
 41058  	}
 41059  	_1_iFree = _1_nOrig
 41060  _9:
 41061  	if _1_iFree <= _1_nFin || _rc != int32(0) {
 41062  		goto _13
 41063  	}
 41064  	_rc = _incrVacuumStep(tls, _pBt, _1_nFin, _1_iFree, int32(1))
 41065  	_1_iFree -= 1
 41066  	goto _9
 41067  _13:
 41068  	if ((_rc == int32(101)) || (_rc == int32(0))) && (_1_nFree > (0)) {
 41069  		_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage))
 41070  		_sqlite3Put4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(32)), 0)
 41071  		_sqlite3Put4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(36)), 0)
 41072  		_sqlite3Put4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(28)), _1_nFin)
 41073  		_pBt.XbDoTruncate = uint8(1)
 41074  		_pBt.XnPage = _1_nFin
 41075  	}
 41076  	if _rc != int32(0) {
 41077  		_sqlite3PagerRollback(tls, _pPager)
 41078  	}
 41079  _4:
 41080  	func() {
 41081  		if _nRef < _sqlite3PagerRefcount(tls, _pPager) {
 41082  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62797), unsafe.Pointer(&_autoVacuumCommitØ00__func__Ø000), unsafe.Pointer(str(54370)))
 41083  			crt.X__builtin_abort(tls)
 41084  		}
 41085  	}()
 41086  	return _rc
 41087  }
 41088  
 41089  var _autoVacuumCommitØ00__func__Ø000 [17]int8
 41090  
 41091  func init() {
 41092  	crt.Xstrncpy(nil, &_autoVacuumCommitØ00__func__Ø000[0], str(54405), 17)
 41093  }
 41094  
 41095  // C comment
 41096  //  /*
 41097  //  ** Invalidate the overflow page-list cache for all cursors opened
 41098  //  ** on the shared btree structure pBt.
 41099  //  */
 41100  func _invalidateAllOverflowCache(tls *crt.TLS, _pBt *XBtShared) {
 41101  	var _p *XBtCursor
 41102  	func() {
 41103  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 41104  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59514), unsafe.Pointer(&_invalidateAllOverflowCacheØ00__func__Ø000), unsafe.Pointer(str(9235)))
 41105  			crt.X__builtin_abort(tls)
 41106  		}
 41107  	}()
 41108  	_p = (*XBtCursor)(_pBt.XpCursor)
 41109  _2:
 41110  	if _p == nil {
 41111  		goto _5
 41112  	}
 41113  	{
 41114  		p := &_p.XcurFlags
 41115  		*p = uint8(int32(*p) & int32(-5))
 41116  	}
 41117  	_p = (*XBtCursor)(_p.XpNext)
 41118  	goto _2
 41119  _5:
 41120  }
 41121  
 41122  var _invalidateAllOverflowCacheØ00__func__Ø000 [27]int8
 41123  
 41124  func init() {
 41125  	crt.Xstrncpy(nil, &_invalidateAllOverflowCacheØ00__func__Ø000[0], str(54422), 27)
 41126  }
 41127  
 41128  // C comment
 41129  //  /*
 41130  //  ** The database opened by the first argument is an auto-vacuum database
 41131  //  ** nOrig pages in size containing nFree free pages. Return the expected
 41132  //  ** size of the database in pages following an auto-vacuum operation.
 41133  //  */
 41134  func _finalDbSize(tls *crt.TLS, _pBt *XBtShared, _nOrig uint32, _nFree uint32) (r0 uint32) {
 41135  	var _nEntry int32
 41136  	var _nPtrmap, _nFin uint32
 41137  	_nEntry = int32(_pBt.XusableSize / uint32(5))
 41138  	_nPtrmap = (((_nFree - _nOrig) + _ptrmapPageno(tls, _pBt, _nOrig)) + uint32(_nEntry)) / uint32(_nEntry)
 41139  	_nFin = (_nOrig - _nFree) - _nPtrmap
 41140  	if (_nOrig > ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) && (_nFin < ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 41141  		_nFin -= 1
 41142  	}
 41143  _1:
 41144  	if (_ptrmapPageno(tls, _pBt, _nFin) == _nFin) || (_nFin == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 41145  		_nFin -= 1
 41146  		goto _1
 41147  	}
 41148  	return _nFin
 41149  }
 41150  
 41151  // C comment
 41152  //  /*
 41153  //  ** Perform a single step of an incremental-vacuum. If successful, return
 41154  //  ** SQLITE_OK. If there is no work to do (and therefore no point in
 41155  //  ** calling this function again), return SQLITE_DONE. Or, if an error
 41156  //  ** occurs, return some other error code.
 41157  //  **
 41158  //  ** More specifically, this function attempts to re-organize the database so
 41159  //  ** that the last page of the file currently in use is no longer in use.
 41160  //  **
 41161  //  ** Parameter nFin is the number of pages that this database would contain
 41162  //  ** were this function called until it returns SQLITE_DONE.
 41163  //  **
 41164  //  ** If the bCommit parameter is non-zero, this function assumes that the
 41165  //  ** caller will keep calling incrVacuumStep() until it returns SQLITE_DONE
 41166  //  ** or an error. bCommit is passed true for an auto-vacuum-on-commit
 41167  //  ** operation, or false for an incremental vacuum.
 41168  //  */
 41169  func _incrVacuumStep(tls *crt.TLS, _pBt *XBtShared, _nFin uint32, _iLastPg uint32, _bCommit int32) (r0 int32) {
 41170  	var _rc int32
 41171  	var _nFreeList, _1_iPtrPage, _6_iFreePg, _8_iFreePg, _8_iNear uint32
 41172  	var _1_eType, _8_eMode uint8
 41173  	var _6_pFreePg, _8_pLastPg, _11_pFreePg *XMemPage
 41174  	func() {
 41175  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 41176  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62592), unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000), unsafe.Pointer(str(9235)))
 41177  			crt.X__builtin_abort(tls)
 41178  		}
 41179  	}()
 41180  	func() {
 41181  		if _iLastPg <= _nFin {
 41182  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62593), unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000), unsafe.Pointer(str(54449)))
 41183  			crt.X__builtin_abort(tls)
 41184  		}
 41185  	}()
 41186  	if _ptrmapPageno(tls, _pBt, _iLastPg) == _iLastPg || _iLastPg == ((uint32(_sqlite3PendingByte)/_pBt.XpageSize)+uint32(1)) {
 41187  		goto _5
 41188  	}
 41189  	_nFreeList = _sqlite3Get4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(36)))
 41190  	if _nFreeList == (0) {
 41191  		return int32(101)
 41192  	}
 41193  	_rc = _ptrmapGet(tls, _pBt, _iLastPg, &_1_eType, &_1_iPtrPage)
 41194  	if _rc != int32(0) {
 41195  		return _rc
 41196  	}
 41197  	if int32(_1_eType) == int32(1) {
 41198  		return _sqlite3CorruptError(tls, int32(62609))
 41199  	}
 41200  	if int32(_1_eType) != int32(2) {
 41201  		goto _9
 41202  	}
 41203  	if _bCommit != int32(0) {
 41204  		goto _10
 41205  	}
 41206  	_rc = _allocateBtreePage(tls, _pBt, &_6_pFreePg, &_6_iFreePg, _iLastPg, uint8(1))
 41207  	if _rc != int32(0) {
 41208  		return _rc
 41209  	}
 41210  	func() {
 41211  		if _6_iFreePg != _iLastPg {
 41212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62625), unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000), unsafe.Pointer(str(54462)))
 41213  			crt.X__builtin_abort(tls)
 41214  		}
 41215  	}()
 41216  	_releasePage(tls, _6_pFreePg)
 41217  _10:
 41218  	goto _14
 41219  _9:
 41220  	_8_eMode = uint8(0)
 41221  	_8_iNear = uint32(0)
 41222  	_rc = _btreeGetPage(tls, _pBt, _iLastPg, &_8_pLastPg, int32(0))
 41223  	if _rc != int32(0) {
 41224  		return _rc
 41225  	}
 41226  	if _bCommit == int32(0) {
 41227  		_8_eMode = uint8(2)
 41228  		_8_iNear = _nFin
 41229  	}
 41230  _16:
 41231  	_rc = _allocateBtreePage(tls, _pBt, &_11_pFreePg, &_8_iFreePg, _8_iNear, _8_eMode)
 41232  	if _rc != int32(0) {
 41233  		_releasePage(tls, _8_pLastPg)
 41234  		return _rc
 41235  	}
 41236  	_releasePage(tls, _11_pFreePg)
 41237  	if _bCommit != 0 && (_8_iFreePg > _nFin) {
 41238  		goto _16
 41239  	}
 41240  	func() {
 41241  		if _8_iFreePg >= _iLastPg {
 41242  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62659), unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000), unsafe.Pointer(str(54479)))
 41243  			crt.X__builtin_abort(tls)
 41244  		}
 41245  	}()
 41246  	_rc = _relocatePage(tls, _pBt, _8_pLastPg, _1_eType, _1_iPtrPage, _8_iFreePg, _bCommit)
 41247  	_releasePage(tls, _8_pLastPg)
 41248  	if _rc != int32(0) {
 41249  		return _rc
 41250  	}
 41251  _14:
 41252  _5:
 41253  	if _bCommit != int32(0) {
 41254  		goto _23
 41255  	}
 41256  _24:
 41257  	_iLastPg -= 1
 41258  	if (_iLastPg == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) || (_ptrmapPageno(tls, _pBt, _iLastPg) == _iLastPg) {
 41259  		goto _24
 41260  	}
 41261  	_pBt.XbDoTruncate = uint8(1)
 41262  	_pBt.XnPage = _iLastPg
 41263  _23:
 41264  	return int32(0)
 41265  }
 41266  
 41267  var _incrVacuumStepØ00__func__Ø000 [15]int8
 41268  
 41269  func init() {
 41270  	crt.Xstrncpy(nil, &_incrVacuumStepØ00__func__Ø000[0], str(54495), 15)
 41271  }
 41272  
 41273  // C comment
 41274  //  /*
 41275  //  ** Allocate a new page from the database file.
 41276  //  **
 41277  //  ** The new page is marked as dirty.  (In other words, sqlite3PagerWrite()
 41278  //  ** has already been called on the new page.)  The new page has also
 41279  //  ** been referenced and the calling routine is responsible for calling
 41280  //  ** sqlite3PagerUnref() on the new page when it is done.
 41281  //  **
 41282  //  ** SQLITE_OK is returned on success.  Any other return value indicates
 41283  //  ** an error.  *ppPage is set to NULL in the event of an error.
 41284  //  **
 41285  //  ** If the "nearby" parameter is not 0, then an effort is made to
 41286  //  ** locate a page close to the page number "nearby".  This can be used in an
 41287  //  ** attempt to keep related pages close to each other in the database file,
 41288  //  ** which in turn can make database access faster.
 41289  //  **
 41290  //  ** If the eMode parameter is BTALLOC_EXACT and the nearby page exists
 41291  //  ** anywhere on the free-list, then it is guaranteed to be returned.  If
 41292  //  ** eMode is BTALLOC_LT then the page returned will be less than or equal
 41293  //  ** to nearby if any such page exists.  If eMode is BTALLOC_ANY then there
 41294  //  ** are no restrictions on which page is returned.
 41295  //  */
 41296  func _allocateBtreePage(tls *crt.TLS, _pBt *XBtShared, _ppPage **XMemPage, _pPgno *uint32, _nearby uint32, _eMode uint8) (r0 int32) {
 41297  	var _rc, _34_dist, _35_d2, _39_noContent, _43_bNoContent int32
 41298  	var _n, _k, _mxPage, _2_iTrunk, _2_nSearch, _22_iNewTrunk, _29_closest, _29_iPage, _30_i uint32
 41299  	var _2_searchList, _4_eType uint8
 41300  	var _29_aData *uint8
 41301  	var _pPage1, _pTrunk, _pPrevTrunk, _22_pNewTrunk, _44_pPg *XMemPage
 41302  	_pTrunk = nil
 41303  	_pPrevTrunk = nil
 41304  	func() {
 41305  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 41306  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64690), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 41307  			crt.X__builtin_abort(tls)
 41308  		}
 41309  	}()
 41310  	func() {
 41311  		if int32(_eMode) != int32(0) && (_nearby <= (0) || _pBt.XautoVacuum == 0) {
 41312  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64691), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54510)))
 41313  			crt.X__builtin_abort(tls)
 41314  		}
 41315  	}()
 41316  	_pPage1 = (*XMemPage)(_pBt.XpPage1)
 41317  	_mxPage = _btreePagecount(tls, _pBt)
 41318  	_n = _sqlite3Get4byte(tls, elem15(_pPage1.XaData, uintptr(36)))
 41319  	if _n >= _mxPage {
 41320  		return _sqlite3CorruptError(tls, int32(64699))
 41321  	}
 41322  	if _n <= (0) {
 41323  		goto _7
 41324  	}
 41325  	_2_searchList = uint8(0)
 41326  	_2_nSearch = uint32(0)
 41327  	if int32(_eMode) != int32(1) {
 41328  		goto _8
 41329  	}
 41330  	if _nearby > _mxPage {
 41331  		goto _9
 41332  	}
 41333  	func() {
 41334  		if _nearby <= (0) {
 41335  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64715), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54575)))
 41336  			crt.X__builtin_abort(tls)
 41337  		}
 41338  	}()
 41339  	func() {
 41340  		if _pBt.XautoVacuum == 0 {
 41341  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64716), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54354)))
 41342  			crt.X__builtin_abort(tls)
 41343  		}
 41344  	}()
 41345  	_rc = _ptrmapGet(tls, _pBt, _nearby, &_4_eType, nil)
 41346  	if _rc != 0 {
 41347  		return _rc
 41348  	}
 41349  	if int32(_4_eType) == int32(2) {
 41350  		_2_searchList = uint8(1)
 41351  	}
 41352  _9:
 41353  	goto _17
 41354  _8:
 41355  	if int32(_eMode) == int32(2) {
 41356  		_2_searchList = uint8(1)
 41357  	}
 41358  _17:
 41359  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage1.XpDbPage))
 41360  	if _rc != 0 {
 41361  		return _rc
 41362  	}
 41363  	_sqlite3Put4byte(tls, elem15(_pPage1.XaData, uintptr(36)), _n-uint32(1))
 41364  _19:
 41365  	_pPrevTrunk = _pTrunk
 41366  	if _pPrevTrunk != nil {
 41367  		_2_iTrunk = _sqlite3Get4byte(tls, elem15(_pPrevTrunk.XaData, 0))
 41368  		goto _21
 41369  	}
 41370  	_2_iTrunk = _sqlite3Get4byte(tls, elem15(_pPage1.XaData, uintptr(32)))
 41371  _21:
 41372  	if (_2_iTrunk > _mxPage) || (postInc34(&_2_nSearch, uint32(1)) > _n) {
 41373  		_rc = _sqlite3CorruptError(tls, int32(64755))
 41374  		goto _24
 41375  	}
 41376  	_rc = _btreeGetUnusedPage(tls, _pBt, _2_iTrunk, &_pTrunk, int32(0))
 41377  _24:
 41378  	if _rc != 0 {
 41379  		_pTrunk = nil
 41380  		goto _end_allocate_page
 41381  	}
 41382  	func() {
 41383  		if _pTrunk == nil {
 41384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64763), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54584)))
 41385  			crt.X__builtin_abort(tls)
 41386  		}
 41387  	}()
 41388  	func() {
 41389  		if _pTrunk.XaData == nil {
 41390  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64764), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54594)))
 41391  			crt.X__builtin_abort(tls)
 41392  		}
 41393  	}()
 41394  	_k = _sqlite3Get4byte(tls, elem15(_pTrunk.XaData, uintptr(4)))
 41395  	if _k != (0) || _2_searchList != 0 {
 41396  		goto _31
 41397  	}
 41398  	func() {
 41399  		if _pPrevTrunk != nil {
 41400  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64772), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54611)))
 41401  			crt.X__builtin_abort(tls)
 41402  		}
 41403  	}()
 41404  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.XpDbPage))
 41405  	if _rc != 0 {
 41406  		goto _end_allocate_page
 41407  	}
 41408  	*_pPgno = _2_iTrunk
 41409  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_pPage1.XaData, uintptr(32))), unsafe.Pointer(elem15(_pTrunk.XaData, 0)), uint64(4))
 41410  	*_ppPage = _pTrunk
 41411  	_pTrunk = nil
 41412  	goto _57
 41413  _31:
 41414  	if _k > ((_pBt.XusableSize / uint32(4)) - uint32(2)) {
 41415  		_rc = _sqlite3CorruptError(tls, int32(64784))
 41416  		goto _end_allocate_page
 41417  	}
 41418  	if _2_searchList == 0 || _nearby != _2_iTrunk && (_2_iTrunk >= _nearby || int32(_eMode) != int32(2)) {
 41419  		goto _41
 41420  	}
 41421  	*_pPgno = _2_iTrunk
 41422  	*_ppPage = _pTrunk
 41423  	_2_searchList = 0
 41424  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.XpDbPage))
 41425  	if _rc != 0 {
 41426  		goto _end_allocate_page
 41427  	}
 41428  	if _k != (0) {
 41429  		goto _43
 41430  	}
 41431  	if _pPrevTrunk == nil {
 41432  		crt.Xmemcpy(tls, unsafe.Pointer(elem15(_pPage1.XaData, uintptr(32))), unsafe.Pointer(elem15(_pTrunk.XaData, 0)), uint64(4))
 41433  		goto _45
 41434  	}
 41435  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPrevTrunk.XpDbPage))
 41436  	if _rc != int32(0) {
 41437  		goto _end_allocate_page
 41438  	}
 41439  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_pPrevTrunk.XaData, 0)), unsafe.Pointer(elem15(_pTrunk.XaData, 0)), uint64(4))
 41440  _45:
 41441  	goto _47
 41442  _43:
 41443  	_22_iNewTrunk = _sqlite3Get4byte(tls, elem15(_pTrunk.XaData, uintptr(8)))
 41444  	if _22_iNewTrunk > _mxPage {
 41445  		_rc = _sqlite3CorruptError(tls, int32(64818))
 41446  		goto _end_allocate_page
 41447  	}
 41448  	_rc = _btreeGetUnusedPage(tls, _pBt, _22_iNewTrunk, &_22_pNewTrunk, int32(0))
 41449  	if _rc != int32(0) {
 41450  		goto _end_allocate_page
 41451  	}
 41452  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_22_pNewTrunk.XpDbPage))
 41453  	if _rc != int32(0) {
 41454  		_releasePage(tls, _22_pNewTrunk)
 41455  		goto _end_allocate_page
 41456  	}
 41457  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_22_pNewTrunk.XaData, 0)), unsafe.Pointer(elem15(_pTrunk.XaData, 0)), uint64(4))
 41458  	_sqlite3Put4byte(tls, elem15(_22_pNewTrunk.XaData, uintptr(4)), _k-uint32(1))
 41459  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_22_pNewTrunk.XaData, uintptr(8))), unsafe.Pointer(elem15(_pTrunk.XaData, uintptr(12))), uint64((_k-uint32(1))*uint32(4)))
 41460  	_releasePage(tls, _22_pNewTrunk)
 41461  	if _pPrevTrunk == nil {
 41462  		func() {
 41463  			if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage1.XpDbPage)) == 0 {
 41464  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64836), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54625)))
 41465  				crt.X__builtin_abort(tls)
 41466  			}
 41467  		}()
 41468  		_sqlite3Put4byte(tls, elem15(_pPage1.XaData, uintptr(32)), _22_iNewTrunk)
 41469  		goto _54
 41470  	}
 41471  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPrevTrunk.XpDbPage))
 41472  	if _rc != 0 {
 41473  		goto _end_allocate_page
 41474  	}
 41475  	_sqlite3Put4byte(tls, elem15(_pPrevTrunk.XaData, 0), _22_iNewTrunk)
 41476  _54:
 41477  _47:
 41478  	_pTrunk = nil
 41479  	goto _57
 41480  _41:
 41481  	if _k <= (0) {
 41482  		goto _57
 41483  	}
 41484  	_29_aData = _pTrunk.XaData
 41485  	if _nearby <= (0) {
 41486  		goto _58
 41487  	}
 41488  	_29_closest = 0
 41489  	if int32(_eMode) != int32(2) {
 41490  		goto _59
 41491  	}
 41492  	_30_i = 0
 41493  _60:
 41494  	if _30_i >= _k {
 41495  		goto _63
 41496  	}
 41497  	_29_iPage = _sqlite3Get4byte(tls, elem15(_29_aData, uintptr(uint32(8)+(_30_i*uint32(4)))))
 41498  	if _29_iPage <= _nearby {
 41499  		_29_closest = _30_i
 41500  		goto _63
 41501  	}
 41502  	_30_i += 1
 41503  	goto _60
 41504  _63:
 41505  	goto _65
 41506  _59:
 41507  	_34_dist = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, elem15(_29_aData, uintptr(8)))-_nearby))
 41508  	_30_i = uint32(1)
 41509  _66:
 41510  	if _30_i >= _k {
 41511  		goto _69
 41512  	}
 41513  	_35_d2 = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, elem15(_29_aData, uintptr(uint32(8)+(_30_i*uint32(4)))))-_nearby))
 41514  	if _35_d2 < _34_dist {
 41515  		_29_closest = _30_i
 41516  		_34_dist = _35_d2
 41517  	}
 41518  	_30_i += 1
 41519  	goto _66
 41520  _69:
 41521  _65:
 41522  	goto _71
 41523  _58:
 41524  	_29_closest = 0
 41525  _71:
 41526  	_29_iPage = _sqlite3Get4byte(tls, elem15(_29_aData, uintptr(uint32(8)+(_29_closest*uint32(4)))))
 41527  	if _29_iPage > _mxPage {
 41528  		_rc = _sqlite3CorruptError(tls, int32(64883))
 41529  		goto _end_allocate_page
 41530  	}
 41531  	if _2_searchList != 0 && (_29_iPage != _nearby && (_29_iPage >= _nearby || int32(_eMode) != int32(2))) {
 41532  		goto _76
 41533  	}
 41534  	*_pPgno = _29_iPage
 41535  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.XpDbPage))
 41536  	if _rc != 0 {
 41537  		goto _end_allocate_page
 41538  	}
 41539  	if _29_closest < (_k - uint32(1)) {
 41540  		crt.Xmemcpy(tls, unsafe.Pointer(elem15(_29_aData, uintptr(uint32(8)+(_29_closest*uint32(4))))), unsafe.Pointer(elem15(_29_aData, uintptr(uint32(4)+(_k*uint32(4))))), uint64(4))
 41541  	}
 41542  	_sqlite3Put4byte(tls, elem15(_29_aData, uintptr(4)), _k-uint32(1))
 41543  	_39_noContent = func() int32 {
 41544  		if _btreeGetHasContent(tls, _pBt, *_pPgno) == 0 {
 41545  			return int32(1)
 41546  		}
 41547  		return int32(0)
 41548  	}()
 41549  	_rc = _btreeGetUnusedPage(tls, _pBt, *_pPgno, _ppPage, _39_noContent)
 41550  	if _rc != int32(0) {
 41551  		goto _81
 41552  	}
 41553  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*_ppPage).XpDbPage))
 41554  	if _rc != int32(0) {
 41555  		_releasePage(tls, *_ppPage)
 41556  		*_ppPage = nil
 41557  	}
 41558  _81:
 41559  	_2_searchList = 0
 41560  _76:
 41561  _57:
 41562  	_releasePage(tls, _pPrevTrunk)
 41563  	_pPrevTrunk = nil
 41564  	if _2_searchList != 0 {
 41565  		goto _19
 41566  	}
 41567  	goto _83
 41568  _7:
 41569  	_43_bNoContent = func() int32 {
 41570  		if int32(0) == int32(_pBt.XbDoTruncate) {
 41571  			return int32(1)
 41572  		}
 41573  		return int32(0)
 41574  	}()
 41575  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage))
 41576  	if _rc != 0 {
 41577  		return _rc
 41578  	}
 41579  	_pBt.XnPage += 1
 41580  	if _pBt.XnPage == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 41581  		_pBt.XnPage += 1
 41582  	}
 41583  	if _pBt.XautoVacuum == 0 || _ptrmapPageno(tls, _pBt, _pBt.XnPage) != _pBt.XnPage {
 41584  		goto _89
 41585  	}
 41586  	_44_pPg = nil
 41587  	func() {
 41588  		if _pBt.XnPage == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 41589  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64950), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54666)))
 41590  			crt.X__builtin_abort(tls)
 41591  		}
 41592  	}()
 41593  	_rc = _btreeGetUnusedPage(tls, _pBt, _pBt.XnPage, &_44_pPg, _43_bNoContent)
 41594  	if _rc == int32(0) {
 41595  		_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_44_pPg.XpDbPage))
 41596  		_releasePage(tls, _44_pPg)
 41597  	}
 41598  	if _rc != 0 {
 41599  		return _rc
 41600  	}
 41601  	_pBt.XnPage += 1
 41602  	if _pBt.XnPage == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 41603  		_pBt.XnPage += 1
 41604  	}
 41605  _89:
 41606  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(int32(28))+uintptr(unsafe.Pointer((*XMemPage)(_pBt.XpPage1).XaData)))), _pBt.XnPage)
 41607  	*_pPgno = _pBt.XnPage
 41608  	func() {
 41609  		if (*_pPgno) == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 41610  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64964), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54701)))
 41611  			crt.X__builtin_abort(tls)
 41612  		}
 41613  	}()
 41614  	_rc = _btreeGetUnusedPage(tls, _pBt, *_pPgno, _ppPage, _43_bNoContent)
 41615  	if _rc != 0 {
 41616  		return _rc
 41617  	}
 41618  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*_ppPage).XpDbPage))
 41619  	if _rc != int32(0) {
 41620  		_releasePage(tls, *_ppPage)
 41621  		*_ppPage = nil
 41622  	}
 41623  _83:
 41624  	func() {
 41625  		if (*_pPgno) == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 41626  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64975), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54701)))
 41627  			crt.X__builtin_abort(tls)
 41628  		}
 41629  	}()
 41630  _end_allocate_page:
 41631  	_releasePage(tls, _pTrunk)
 41632  	_releasePage(tls, _pPrevTrunk)
 41633  	func() {
 41634  		if _rc == int32(0) && _sqlite3PagerPageRefcount(tls, (*XPgHdr)((*_ppPage).XpDbPage)) > int32(1) {
 41635  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64980), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54732)))
 41636  			crt.X__builtin_abort(tls)
 41637  		}
 41638  	}()
 41639  	func() {
 41640  		if _rc == int32(0) && int32((*_ppPage).XisInit) != int32(0) {
 41641  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64981), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54797)))
 41642  			crt.X__builtin_abort(tls)
 41643  		}
 41644  	}()
 41645  	return _rc
 41646  
 41647  	_ = _2_nSearch
 41648  	panic(0)
 41649  }
 41650  
 41651  var _allocateBtreePageØ00__func__Ø000 [18]int8
 41652  
 41653  func init() {
 41654  	crt.Xstrncpy(nil, &_allocateBtreePageØ00__func__Ø000[0], str(54835), 18)
 41655  }
 41656  
 41657  // C comment
 41658  //  /*
 41659  //  ** Get an unused page.
 41660  //  **
 41661  //  ** This works just like btreeGetPage() with the addition:
 41662  //  **
 41663  //  **   *  If the page is already in use for some other purpose, immediately
 41664  //  **      release it and return an SQLITE_CURRUPT error.
 41665  //  **   *  Make sure the isInit flag is clear
 41666  //  */
 41667  func _btreeGetUnusedPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _flags int32) (r0 int32) {
 41668  	var _rc int32
 41669  	_rc = _btreeGetPage(tls, _pBt, _pgno, _ppPage, _flags)
 41670  	if _rc != int32(0) {
 41671  		goto _0
 41672  	}
 41673  	if _sqlite3PagerPageRefcount(tls, (*XPgHdr)((*_ppPage).XpDbPage)) > int32(1) {
 41674  		_releasePage(tls, *_ppPage)
 41675  		*_ppPage = nil
 41676  		return _sqlite3CorruptError(tls, int32(61159))
 41677  	}
 41678  	(*_ppPage).XisInit = 0
 41679  	goto _2
 41680  _0:
 41681  	*_ppPage = nil
 41682  _2:
 41683  	return _rc
 41684  }
 41685  
 41686  // C comment
 41687  //  /*
 41688  //  ** Return the number of references to the specified page.
 41689  //  */
 41690  func _sqlite3PagerPageRefcount(tls *crt.TLS, _pPage *XPgHdr) (r0 int32) {
 41691  	return _sqlite3PcachePageRefcount(tls, _pPage)
 41692  }
 41693  
 41694  // C comment
 41695  //  /*
 41696  //  ** Compute the absolute value of a 32-bit signed integer, of possible.  Or
 41697  //  ** if the integer has a value of -2147483648, return +2147483647
 41698  //  */
 41699  func _sqlite3AbsInt32(tls *crt.TLS, _x int32) (r0 int32) {
 41700  	if _x >= int32(0) {
 41701  		return _x
 41702  	}
 41703  	if _x == int32(-2147483648) {
 41704  		return int32(2147483647)
 41705  	}
 41706  	return -_x
 41707  }
 41708  
 41709  // C comment
 41710  //  /*
 41711  //  ** Query the BtShared.pHasContent vector.
 41712  //  **
 41713  //  ** This function is called when a free-list leaf page is removed from the
 41714  //  ** free-list for reuse. It returns false if it is safe to retrieve the
 41715  //  ** page from the pager layer with the 'no-content' flag set. True otherwise.
 41716  //  */
 41717  func _btreeGetHasContent(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 int32) {
 41718  	var _p *XBitvec
 41719  	_p = (*XBitvec)(_pBt.XpHasContent)
 41720  	return bool2int((_p != nil) && ((_pgno > _sqlite3BitvecSize(tls, _p)) || _sqlite3BitvecTest(tls, _p, _pgno) != 0))
 41721  }
 41722  
 41723  // C comment
 41724  //  /*
 41725  //  ** Return the value of the iSize parameter specified when Bitvec *p
 41726  //  ** was created.
 41727  //  */
 41728  func _sqlite3BitvecSize(tls *crt.TLS, _p *XBitvec) (r0 uint32) {
 41729  	return _p.XiSize
 41730  }
 41731  
 41732  // C comment
 41733  //  /*
 41734  //  ** Move the open database page pDbPage to location iFreePage in the
 41735  //  ** database. The pDbPage reference remains valid.
 41736  //  **
 41737  //  ** The isCommit flag indicates that there is no need to remember that
 41738  //  ** the journal needs to be sync()ed before database page pDbPage->pgno
 41739  //  ** can be written to. The caller has already promised not to write to that
 41740  //  ** page.
 41741  //  */
 41742  func _relocatePage(tls *crt.TLS, _pBt *XBtShared, _pDbPage *XMemPage, _eType uint8, _iPtrPage uint32, _iFreePage uint32, _isCommit int32) (r0 int32) {
 41743  	var _rc int32
 41744  	var _iDbPage, _4_nextOvfl uint32
 41745  	var _pPager *XPager
 41746  	var _pPtrPage *XMemPage
 41747  	_iDbPage = _pDbPage.Xpgno
 41748  	_pPager = (*XPager)(_pBt.XpPager)
 41749  	func() {
 41750  		if int32(_eType) != int32(4) && int32(_eType) != int32(3) && int32(_eType) != int32(5) && int32(_eType) != int32(1) {
 41751  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62508), unsafe.Pointer(&_relocatePageØ00__func__Ø000), unsafe.Pointer(str(54853)))
 41752  			crt.X__builtin_abort(tls)
 41753  		}
 41754  	}()
 41755  	func() {
 41756  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 41757  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62510), unsafe.Pointer(&_relocatePageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 41758  			crt.X__builtin_abort(tls)
 41759  		}
 41760  	}()
 41761  	func() {
 41762  		if (*XBtShared)(_pDbPage.XpBt) != _pBt {
 41763  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62511), unsafe.Pointer(&_relocatePageØ00__func__Ø000), unsafe.Pointer(str(54953)))
 41764  			crt.X__builtin_abort(tls)
 41765  		}
 41766  	}()
 41767  	_rc = _sqlite3PagerMovepage(tls, _pPager, (*XPgHdr)(_pDbPage.XpDbPage), _iFreePage, _isCommit)
 41768  	if _rc != int32(0) {
 41769  		return _rc
 41770  	}
 41771  	_pDbPage.Xpgno = _iFreePage
 41772  	if int32(_eType) != int32(5) && int32(_eType) != int32(1) {
 41773  		goto _11
 41774  	}
 41775  	_rc = _setChildPtrmaps(tls, _pDbPage)
 41776  	if _rc != int32(0) {
 41777  		return _rc
 41778  	}
 41779  	goto _13
 41780  _11:
 41781  	_4_nextOvfl = _sqlite3Get4byte(tls, _pDbPage.XaData)
 41782  	if _4_nextOvfl == (0) {
 41783  		goto _14
 41784  	}
 41785  	_ptrmapPut(tls, _pBt, _4_nextOvfl, uint8(4), _iFreePage, &_rc)
 41786  	if _rc != int32(0) {
 41787  		return _rc
 41788  	}
 41789  _14:
 41790  _13:
 41791  	if int32(_eType) == int32(1) {
 41792  		goto _16
 41793  	}
 41794  	_rc = _btreeGetPage(tls, _pBt, _iPtrPage, &_pPtrPage, int32(0))
 41795  	if _rc != int32(0) {
 41796  		return _rc
 41797  	}
 41798  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPtrPage.XpDbPage))
 41799  	if _rc != int32(0) {
 41800  		_releasePage(tls, _pPtrPage)
 41801  		return _rc
 41802  	}
 41803  	_rc = _modifyPagePointer(tls, _pPtrPage, _iDbPage, _iFreePage, _eType)
 41804  	_releasePage(tls, _pPtrPage)
 41805  	if _rc == int32(0) {
 41806  		_ptrmapPut(tls, _pBt, _iFreePage, _eType, _iPtrPage, &_rc)
 41807  	}
 41808  _16:
 41809  	return _rc
 41810  }
 41811  
 41812  var _relocatePageØ00__func__Ø000 [13]int8
 41813  
 41814  func init() {
 41815  	crt.Xstrncpy(nil, &_relocatePageØ00__func__Ø000[0], str(54971), 13)
 41816  }
 41817  
 41818  // C comment
 41819  //  /*
 41820  //  ** Move the page pPg to location pgno in the file.
 41821  //  **
 41822  //  ** There must be no references to the page previously located at
 41823  //  ** pgno (which we call pPgOld) though that page is allowed to be
 41824  //  ** in cache.  If the page previously located at pgno is not already
 41825  //  ** in the rollback journal, it is not put there by by this routine.
 41826  //  **
 41827  //  ** References to the page pPg remain valid. Updating any
 41828  //  ** meta-data associated with pPg (i.e. data stored in the nExtra bytes
 41829  //  ** allocated along with the page) is the responsibility of the caller.
 41830  //  **
 41831  //  ** A transaction must be active when this routine is called. It used to be
 41832  //  ** required that a statement transaction was not active, but this restriction
 41833  //  ** has been removed (CREATE INDEX needs to move a page when a statement
 41834  //  ** transaction is active).
 41835  //  **
 41836  //  ** If the fourth argument, isCommit, is non-zero, then this page is being
 41837  //  ** moved as part of a database reorganization just before the transaction
 41838  //  ** is being committed. In this case, it is guaranteed that the database page
 41839  //  ** pPg refers to will not be written to again within this transaction.
 41840  //  **
 41841  //  ** This function may return SQLITE_NOMEM or an IO error code if an error
 41842  //  ** occurs. Otherwise, it returns SQLITE_OK.
 41843  //  */
 41844  func _sqlite3PagerMovepage(tls *crt.TLS, _pPager *XPager, _pPg *XPgHdr, _pgno uint32, _isCommit int32) (r0 int32) {
 41845  	var _rc int32
 41846  	var _needSyncPgno, _origPgno uint32
 41847  	var _pPgOld, _8_pPgHdr *XPgHdr
 41848  	_needSyncPgno = uint32(0)
 41849  	func() {
 41850  		if int32(_pPg.XnRef) <= int32(0) {
 41851  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53886), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(54984)))
 41852  			crt.X__builtin_abort(tls)
 41853  		}
 41854  	}()
 41855  	func() {
 41856  		if int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) {
 41857  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53887), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(54996)))
 41858  			crt.X__builtin_abort(tls)
 41859  		}
 41860  	}()
 41861  	func() {
 41862  		if _assert_pager_state(tls, _pPager) == 0 {
 41863  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53890), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(10971)))
 41864  			crt.X__builtin_abort(tls)
 41865  		}
 41866  	}()
 41867  	func() {
 41868  		if _pPager.XtempFile == 0 && _pPager.XmemDb != 0 {
 41869  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53895), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(55072)))
 41870  			crt.X__builtin_abort(tls)
 41871  		}
 41872  	}()
 41873  	if _pPager.XtempFile == 0 {
 41874  		goto _10
 41875  	}
 41876  	_rc = _sqlite3PagerWrite(tls, _pPg)
 41877  	if _rc != 0 {
 41878  		return _rc
 41879  	}
 41880  _10:
 41881  	if ((int32(_pPg.Xflags) & int32(2)) != int32(0)) && (int32(0) != store2(&_rc, _subjournalPageIfRequired(tls, _pPg))) {
 41882  		return _rc
 41883  	}
 41884  	if (int32(_pPg.Xflags)&int32(8)) != 0 && (_isCommit == 0) {
 41885  		_needSyncPgno = _pPg.Xpgno
 41886  		func() {
 41887  			if int32(_pPager.XjournalMode) != int32(2) && _pageInJournal(tls, _pPager, _pPg) == 0 && _pPg.Xpgno <= _pPager.XdbOrigSize {
 41888  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53938), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(55099)))
 41889  				crt.X__builtin_abort(tls)
 41890  			}
 41891  		}()
 41892  		func() {
 41893  			if (int32(_pPg.Xflags) & int32(2)) == 0 {
 41894  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53940), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(54011)))
 41895  				crt.X__builtin_abort(tls)
 41896  			}
 41897  		}()
 41898  	}
 41899  	{
 41900  		p := &_pPg.Xflags
 41901  		*p = uint16(int32(*p) & int32(-9))
 41902  	}
 41903  	_pPgOld = _sqlite3PagerLookup(tls, _pPager, _pgno)
 41904  	func() {
 41905  		if _pPgOld != nil && int32(_pPgOld.XnRef) != int32(1) {
 41906  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53950), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(55204)))
 41907  			crt.X__builtin_abort(tls)
 41908  		}
 41909  	}()
 41910  	if _pPgOld == nil {
 41911  		goto _25
 41912  	}
 41913  	{
 41914  		p := &_pPg.Xflags
 41915  		*p = uint16(int32(*p) | (int32(_pPgOld.Xflags) & int32(8)))
 41916  	}
 41917  	if _pPager.XtempFile != 0 {
 41918  		_sqlite3PcacheMove(tls, _pPgOld, _pPager.XdbSize+uint32(1))
 41919  		goto _27
 41920  	}
 41921  	_sqlite3PcacheDrop(tls, _pPgOld)
 41922  _27:
 41923  _25:
 41924  	_origPgno = _pPg.Xpgno
 41925  	_sqlite3PcacheMove(tls, _pPg, _pgno)
 41926  	_sqlite3PcacheMakeDirty(tls, _pPg)
 41927  	if (_pPager.XtempFile != 0) && (_pPgOld != nil) {
 41928  		_sqlite3PcacheMove(tls, _pPgOld, _origPgno)
 41929  		_sqlite3PagerUnrefNotNull(tls, _pPgOld)
 41930  	}
 41931  	if _needSyncPgno == 0 {
 41932  		goto _30
 41933  	}
 41934  	_rc = _sqlite3PagerGet(tls, _pPager, _needSyncPgno, &_8_pPgHdr, int32(0))
 41935  	if _rc == int32(0) {
 41936  		goto _31
 41937  	}
 41938  	if _needSyncPgno <= _pPager.XdbOrigSize {
 41939  		func() {
 41940  			if _pPager.XpTmpSpace == nil {
 41941  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53994), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(55231)))
 41942  				crt.X__builtin_abort(tls)
 41943  			}
 41944  		}()
 41945  		_sqlite3BitvecClear(tls, (*XBitvec)(_pPager.XpInJournal), _needSyncPgno, unsafe.Pointer(_pPager.XpTmpSpace))
 41946  	}
 41947  	return _rc
 41948  
 41949  _31:
 41950  	{
 41951  		p := &_8_pPgHdr.Xflags
 41952  		*p = uint16(int32(*p) | int32(8))
 41953  	}
 41954  	_sqlite3PcacheMakeDirty(tls, _8_pPgHdr)
 41955  	_sqlite3PagerUnrefNotNull(tls, _8_pPgHdr)
 41956  _30:
 41957  	return int32(0)
 41958  }
 41959  
 41960  var _sqlite3PagerMovepageØ00__func__Ø000 [21]int8
 41961  
 41962  func init() {
 41963  	crt.Xstrncpy(nil, &_sqlite3PagerMovepageØ00__func__Ø000[0], str(55252), 21)
 41964  }
 41965  
 41966  // C comment
 41967  //  /*
 41968  //  ** Change the page number of page p to newPgno.
 41969  //  */
 41970  func _sqlite3PcacheMove(tls *crt.TLS, _p *XPgHdr, _newPgno uint32) {
 41971  	var _pCache *XPCache
 41972  	_pCache = (*XPCache)(_p.XpCache)
 41973  	func() {
 41974  		if int32(_p.XnRef) <= int32(0) {
 41975  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44751), unsafe.Pointer(&_sqlite3PcacheMoveØ00__func__Ø000), unsafe.Pointer(str(13812)))
 41976  			crt.X__builtin_abort(tls)
 41977  		}
 41978  	}()
 41979  	func() {
 41980  		if _newPgno <= (0) {
 41981  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44752), unsafe.Pointer(&_sqlite3PcacheMoveØ00__func__Ø000), unsafe.Pointer(str(55273)))
 41982  			crt.X__builtin_abort(tls)
 41983  		}
 41984  	}()
 41985  	func() {
 41986  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 41987  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44753), unsafe.Pointer(&_sqlite3PcacheMoveØ00__func__Ø000), unsafe.Pointer(str(13822)))
 41988  			crt.X__builtin_abort(tls)
 41989  		}
 41990  	}()
 41991  	func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32) {
 41992  		v := _sqlite3Config.Xpcache2.XxRekey
 41993  		return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32))(unsafe.Pointer(&v))
 41994  	}()(tls, _pCache.XpCache, (*Xsqlite3_pcache_page)(_p.XpPage), _p.Xpgno, _newPgno)
 41995  	_p.Xpgno = _newPgno
 41996  	if (int32(_p.Xflags)&int32(2)) != 0 && (int32(_p.Xflags)&int32(8)) != 0 {
 41997  		_pcacheManageDirtyList(tls, _p, uint8(3))
 41998  	}
 41999  }
 42000  
 42001  var _sqlite3PcacheMoveØ00__func__Ø000 [18]int8
 42002  
 42003  func init() {
 42004  	crt.Xstrncpy(nil, &_sqlite3PcacheMoveØ00__func__Ø000[0], str(55283), 18)
 42005  }
 42006  
 42007  // C comment
 42008  //  /*
 42009  //  ** Clear the i-th bit.
 42010  //  **
 42011  //  ** pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage
 42012  //  ** that BitvecClear can use to rebuilt its hash table.
 42013  //  */
 42014  func _sqlite3BitvecClear(tls *crt.TLS, _p *XBitvec, _i uint32, _pBuf unsafe.Pointer) {
 42015  	var _1_bin, _4_j, _6_h uint32
 42016  	var _4_aiValues *uint32
 42017  	if _p == nil {
 42018  		return
 42019  	}
 42020  	func() {
 42021  		if _i <= (0) {
 42022  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(43951), unsafe.Pointer(&_sqlite3BitvecClearØ00__func__Ø000), unsafe.Pointer(str(12925)))
 42023  			crt.X__builtin_abort(tls)
 42024  		}
 42025  	}()
 42026  	_i -= 1
 42027  _3:
 42028  	if _p.XiDivisor == 0 {
 42029  		goto _4
 42030  	}
 42031  	_1_bin = _i / _p.XiDivisor
 42032  	_i = _i % _p.XiDivisor
 42033  	_p = *elem33((**XBitvec)(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin))
 42034  	if _p == nil {
 42035  		return
 42036  	}
 42037  	goto _3
 42038  _4:
 42039  	if uint64(_p.XiSize) <= uint64(3968) {
 42040  		{
 42041  			p := elem15((*uint8)(unsafe.Pointer((*[496]uint8)(unsafe.Pointer(&_p.Xu)))), uintptr(_i/uint32(8)))
 42042  			*p = uint8(int32(*p) & (^(int32(1) << uint(int32(_i&uint32(7))))))
 42043  		}
 42044  		goto _7
 42045  	}
 42046  	_4_aiValues = (*uint32)(_pBuf)
 42047  	crt.Xmemcpy(tls, unsafe.Pointer(_4_aiValues), unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu))), uint64(496))
 42048  	crt.Xmemset(tls, unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu))), int32(0), uint64(496))
 42049  	_p.XnSet = 0
 42050  	_4_j = 0
 42051  _8:
 42052  	if uint64(_4_j) >= uint64(124) {
 42053  		goto _11
 42054  	}
 42055  	if (*elem31(_4_aiValues, uintptr(_4_j))) == 0 || (*elem31(_4_aiValues, uintptr(_4_j))) == (_i+uint32(1)) {
 42056  		goto _13
 42057  	}
 42058  	_6_h = uint32(uint64(((*elem31(_4_aiValues, uintptr(_4_j)))-uint32(1))*uint32(1)) % uint64(124))
 42059  	_p.XnSet += 1
 42060  _14:
 42061  	if (*elem31((*uint32)(unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_6_h))) == 0 {
 42062  		goto _15
 42063  	}
 42064  	_6_h += 1
 42065  	if uint64(_6_h) >= uint64(124) {
 42066  		_6_h = 0
 42067  	}
 42068  	goto _14
 42069  _15:
 42070  	*elem31((*uint32)(unsafe.Pointer((*[124]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_6_h)) = *elem31(_4_aiValues, uintptr(_4_j))
 42071  _13:
 42072  	_4_j += 1
 42073  	goto _8
 42074  _11:
 42075  _7:
 42076  }
 42077  
 42078  var _sqlite3BitvecClearØ00__func__Ø000 [19]int8
 42079  
 42080  func init() {
 42081  	crt.Xstrncpy(nil, &_sqlite3BitvecClearØ00__func__Ø000[0], str(55301), 19)
 42082  }
 42083  
 42084  // C comment
 42085  //  /*
 42086  //  ** Set the pointer-map entries for all children of page pPage. Also, if
 42087  //  ** pPage contains cells that point to overflow pages, set the pointer
 42088  //  ** map entries for the overflow pages as well.
 42089  //  */
 42090  func _setChildPtrmaps(tls *crt.TLS, _pPage *XMemPage) (r0 int32) {
 42091  	var _i, _nCell, _rc int32
 42092  	var _pgno, _2_childPgno, _3_childPgno uint32
 42093  	var _1_pCell *uint8
 42094  	var _pBt *XBtShared
 42095  	_pBt = (*XBtShared)(_pPage.XpBt)
 42096  	_pgno = _pPage.Xpgno
 42097  	func() {
 42098  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 42099  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62396), unsafe.Pointer(&_setChildPtrmapsØ00__func__Ø000), unsafe.Pointer(str(20394)))
 42100  			crt.X__builtin_abort(tls)
 42101  		}
 42102  	}()
 42103  	_rc = _btreeInitPage(tls, _pPage)
 42104  	if _rc != int32(0) {
 42105  		return _rc
 42106  	}
 42107  	_nCell = int32(_pPage.XnCell)
 42108  	_i = int32(0)
 42109  _3:
 42110  	if _i >= _nCell {
 42111  		goto _6
 42112  	}
 42113  	_1_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData)) + uintptr(int32(_pPage.XmaskPage)&((int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_i)), 0))<<8)|int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_i)), uintptr(1)))))))
 42114  	_ptrmapPutOvflPtr(tls, _pPage, _1_pCell, &_rc)
 42115  	if _pPage.Xleaf == 0 {
 42116  		_2_childPgno = _sqlite3Get4byte(tls, _1_pCell)
 42117  		_ptrmapPut(tls, _pBt, _2_childPgno, uint8(5), _pgno, &_rc)
 42118  	}
 42119  	_i += 1
 42120  	goto _3
 42121  _6:
 42122  	if _pPage.Xleaf == 0 {
 42123  		_3_childPgno = _sqlite3Get4byte(tls, elem15(_pPage.XaData, uintptr(int32(_pPage.XhdrOffset)+int32(8))))
 42124  		_ptrmapPut(tls, _pBt, _3_childPgno, uint8(5), _pgno, &_rc)
 42125  	}
 42126  	return _rc
 42127  }
 42128  
 42129  var _setChildPtrmapsØ00__func__Ø000 [16]int8
 42130  
 42131  func init() {
 42132  	crt.Xstrncpy(nil, &_setChildPtrmapsØ00__func__Ø000[0], str(55320), 16)
 42133  }
 42134  
 42135  // C comment
 42136  //  /*
 42137  //  ** Initialize the auxiliary information for a disk block.
 42138  //  **
 42139  //  ** Return SQLITE_OK on success.  If we see that the page does
 42140  //  ** not contain a well-formed database page, then return
 42141  //  ** SQLITE_CORRUPT.  Note that a return of SQLITE_OK does not
 42142  //  ** guarantee that the page is well-formed.  It only shows that
 42143  //  ** we failed to detect any corruption.
 42144  //  */
 42145  func _btreeInitPage(tls *crt.TLS, _pPage *XMemPage) (r0 int32) {
 42146  	var _1_pc, _1_usableSize, _1_nFree, _1_top, _1_iCellFirst, _1_iCellLast, _3_i, _3_sz int32
 42147  	var _7_next, _7_size uint32
 42148  	var _1_cellOffset uint16
 42149  	var _1_hdr uint8
 42150  	var _1_data *uint8
 42151  	var _1_pBt *XBtShared
 42152  	func() {
 42153  		if (*XBtShared)(_pPage.XpBt) == nil {
 42154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60819), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55336)))
 42155  			crt.X__builtin_abort(tls)
 42156  		}
 42157  	}()
 42158  	func() {
 42159  		if (*Xsqlite3)((*XBtShared)(_pPage.XpBt).Xdb) == nil {
 42160  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60820), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55350)))
 42161  			crt.X__builtin_abort(tls)
 42162  		}
 42163  	}()
 42164  	func() {
 42165  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 42166  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60821), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(20394)))
 42167  			crt.X__builtin_abort(tls)
 42168  		}
 42169  	}()
 42170  	func() {
 42171  		if _pPage.Xpgno != _sqlite3PagerPagenumber(tls, (*XPgHdr)(_pPage.XpDbPage)) {
 42172  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60822), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55368)))
 42173  			crt.X__builtin_abort(tls)
 42174  		}
 42175  	}()
 42176  	func() {
 42177  		if _pPage != (*XMemPage)(_sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.XpDbPage))) {
 42178  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60823), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55420)))
 42179  			crt.X__builtin_abort(tls)
 42180  		}
 42181  	}()
 42182  	func() {
 42183  		if _pPage.XaData != (*uint8)(_sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.XpDbPage))) {
 42184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60824), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55466)))
 42185  			crt.X__builtin_abort(tls)
 42186  		}
 42187  	}()
 42188  	if _pPage.XisInit != 0 {
 42189  		goto _12
 42190  	}
 42191  	_1_pBt = (*XBtShared)(_pPage.XpBt)
 42192  	_1_hdr = _pPage.XhdrOffset
 42193  	_1_data = _pPage.XaData
 42194  	if _decodeFlags(tls, _pPage, int32(*elem15(_1_data, uintptr(_1_hdr)))) != 0 {
 42195  		return _sqlite3CorruptError(tls, int32(60844))
 42196  	}
 42197  	func() {
 42198  		if _1_pBt.XpageSize < uint32(512) || _1_pBt.XpageSize > uint32(65536) {
 42199  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60845), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(53350)))
 42200  			crt.X__builtin_abort(tls)
 42201  		}
 42202  	}()
 42203  	_pPage.XmaskPage = uint16(_1_pBt.XpageSize - uint32(1))
 42204  	_pPage.XnOverflow = 0
 42205  	_1_usableSize = int32(_1_pBt.XusableSize)
 42206  	_pPage.XcellOffset = store78(&_1_cellOffset, uint16((int32(_1_hdr)+int32(8))+int32(_pPage.XchildPtrSize)))
 42207  	_pPage.XaDataEnd = elem15(_1_data, uintptr(_1_usableSize))
 42208  	_pPage.XaCellIdx = elem15(_1_data, uintptr(_1_cellOffset))
 42209  	_pPage.XaDataOfst = elem15(_1_data, uintptr(_pPage.XchildPtrSize))
 42210  	_1_top = ((((int32(*elem15(elem15(_1_data, uintptr(int32(_1_hdr)+int32(5))), 0)) << 8) | int32(*elem15(elem15(_1_data, uintptr(int32(_1_hdr)+int32(5))), uintptr(1)))) - int32(1)) & int32(65535)) + int32(1)
 42211  	_pPage.XnCell = uint16((int32(*elem15(elem15(_1_data, uintptr(int32(_1_hdr)+int32(3))), 0)) << 8) | int32(*elem15(elem15(_1_data, uintptr(int32(_1_hdr)+int32(3))), uintptr(1))))
 42212  	if uint32(_pPage.XnCell) > ((_1_pBt.XpageSize - uint32(8)) / uint32(6)) {
 42213  		return _sqlite3CorruptError(tls, int32(60862))
 42214  	}
 42215  	func() {
 42216  		if int32(_pPage.XnCell) <= int32(0) && _1_top != _1_usableSize && _sqlite3Config.XneverCorrupt != int32(0) {
 42217  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60869), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55518)))
 42218  			crt.X__builtin_abort(tls)
 42219  		}
 42220  	}()
 42221  	_1_iCellFirst = int32(_1_cellOffset) + (int32(2) * int32(_pPage.XnCell))
 42222  	_1_iCellLast = _1_usableSize - int32(4)
 42223  	if (((*Xsqlite3)(_1_pBt.Xdb).Xflags) & int32(536870912)) == 0 {
 42224  		goto _22
 42225  	}
 42226  	if _pPage.Xleaf == 0 {
 42227  		_1_iCellLast -= 1
 42228  	}
 42229  	_3_i = int32(0)
 42230  _24:
 42231  	if _3_i >= int32(_pPage.XnCell) {
 42232  		goto _27
 42233  	}
 42234  	_1_pc = (int32(*elem15(elem15(_1_data, uintptr(int32(_1_cellOffset)+(_3_i*int32(2)))), 0)) << 8) | int32(*elem15(elem15(_1_data, uintptr(int32(_1_cellOffset)+(_3_i*int32(2)))), uintptr(1)))
 42235  	if (_1_pc < _1_iCellFirst) || (_1_pc > _1_iCellLast) {
 42236  		return _sqlite3CorruptError(tls, int32(60890))
 42237  	}
 42238  	_3_sz = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 42239  		v := _pPage.XxCellSize
 42240  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 42241  	}()(tls, _pPage, elem15(_1_data, uintptr(_1_pc))))
 42242  	if (_1_pc + _3_sz) > _1_usableSize {
 42243  		return _sqlite3CorruptError(tls, int32(60895))
 42244  	}
 42245  	_3_i += 1
 42246  	goto _24
 42247  _27:
 42248  	if _pPage.Xleaf == 0 {
 42249  		_1_iCellLast += 1
 42250  	}
 42251  _22:
 42252  	_1_pc = (int32(*elem15(elem15(_1_data, uintptr(int32(_1_hdr)+int32(1))), 0)) << 8) | int32(*elem15(elem15(_1_data, uintptr(int32(_1_hdr)+int32(1))), uintptr(1)))
 42253  	_1_nFree = int32(*elem15(_1_data, uintptr(int32(_1_hdr)+int32(7)))) + _1_top
 42254  	if _1_pc <= int32(0) {
 42255  		goto _32
 42256  	}
 42257  	if _1_pc < _1_iCellFirst {
 42258  		return _sqlite3CorruptError(tls, int32(60913))
 42259  	}
 42260  _33:
 42261  	if _1_pc > _1_iCellLast {
 42262  		return _sqlite3CorruptError(tls, int32(60917))
 42263  	}
 42264  	_7_next = uint32((int32(*elem15(elem15(_1_data, uintptr(_1_pc)), 0)) << 8) | int32(*elem15(elem15(_1_data, uintptr(_1_pc)), uintptr(1))))
 42265  	_7_size = uint32((int32(*elem15(elem15(_1_data, uintptr(_1_pc+int32(2))), 0)) << 8) | int32(*elem15(elem15(_1_data, uintptr(_1_pc+int32(2))), uintptr(1))))
 42266  	_1_nFree = int32(uint32(_1_nFree) + _7_size)
 42267  	if _7_next <= ((uint32(_1_pc) + _7_size) + uint32(3)) {
 42268  		goto _35
 42269  	}
 42270  	_1_pc = int32(_7_next)
 42271  	goto _33
 42272  _35:
 42273  	if _7_next > (0) {
 42274  		return _sqlite3CorruptError(tls, int32(60926))
 42275  	}
 42276  	if (uint32(_1_pc) + _7_size) > uint32(_1_usableSize) {
 42277  		return _sqlite3CorruptError(tls, int32(60929))
 42278  	}
 42279  _32:
 42280  	if _1_nFree > _1_usableSize {
 42281  		return _sqlite3CorruptError(tls, int32(60941))
 42282  	}
 42283  	_pPage.XnFree = uint16(_1_nFree - _1_iCellFirst)
 42284  	_pPage.XisInit = uint8(1)
 42285  _12:
 42286  	return int32(0)
 42287  }
 42288  
 42289  var _btreeInitPageØ00__func__Ø000 [14]int8
 42290  
 42291  func init() {
 42292  	crt.Xstrncpy(nil, &_btreeInitPageØ00__func__Ø000[0], str(55566), 14)
 42293  }
 42294  
 42295  // C comment
 42296  //  /*
 42297  //  ** If the cell pCell, part of page pPage contains a pointer
 42298  //  ** to an overflow page, insert an entry into the pointer-map
 42299  //  ** for the overflow page.
 42300  //  */
 42301  func _ptrmapPutOvflPtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pRC *int32) {
 42302  	var _1_ovfl uint32
 42303  	var _info XCellInfo
 42304  	if (*_pRC) != 0 {
 42305  		return
 42306  	}
 42307  	func() {
 42308  		if _pCell == nil {
 42309  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60344), unsafe.Pointer(&_ptrmapPutOvflPtrØ00__func__Ø000), unsafe.Pointer(str(55580)))
 42310  			crt.X__builtin_abort(tls)
 42311  		}
 42312  	}()
 42313  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 42314  		v := _pPage.XxParseCell
 42315  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 42316  	}()(tls, _pPage, _pCell, &_info)
 42317  	if uint32(_info.XnLocal) < _info.XnPayload {
 42318  		_1_ovfl = _sqlite3Get4byte(tls, elem15(_pCell, uintptr(int32(_info.XnSize)-int32(4))))
 42319  		_ptrmapPut(tls, (*XBtShared)(_pPage.XpBt), _1_ovfl, uint8(3), _pPage.Xpgno, _pRC)
 42320  	}
 42321  }
 42322  
 42323  var _ptrmapPutOvflPtrØ00__func__Ø000 [17]int8
 42324  
 42325  func init() {
 42326  	crt.Xstrncpy(nil, &_ptrmapPutOvflPtrØ00__func__Ø000[0], str(55589), 17)
 42327  }
 42328  
 42329  // C comment
 42330  //  /*
 42331  //  ** Write an entry into the pointer map.
 42332  //  **
 42333  //  ** This routine updates the pointer map entry for page number 'key'
 42334  //  ** so that it maps to type 'eType' and parent page number 'pgno'.
 42335  //  **
 42336  //  ** If *pRC is initially non-zero (non-SQLITE_OK) then this routine is
 42337  //  ** a no-op.  If an error occurs, the appropriate error code is written
 42338  //  ** into *pRC.
 42339  //  */
 42340  func _ptrmapPut(tls *crt.TLS, _pBt *XBtShared, _key uint32, _eType uint8, _parent uint32, _pRC *int32) {
 42341  	var _offset, _rc int32
 42342  	var _iPtrmap uint32
 42343  	var _pPtrmap *uint8
 42344  	var _pDbPage *XPgHdr
 42345  	if (*_pRC) != 0 {
 42346  		return
 42347  	}
 42348  	func() {
 42349  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 42350  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59967), unsafe.Pointer(&_ptrmapPutØ00__func__Ø000), unsafe.Pointer(str(9235)))
 42351  			crt.X__builtin_abort(tls)
 42352  		}
 42353  	}()
 42354  	func() {
 42355  		if int32(0) != bool2int(_ptrmapPageno(tls, _pBt, (uint32(_sqlite3PendingByte)/_pBt.XpageSize)+uint32(1)) == ((uint32(_sqlite3PendingByte)/_pBt.XpageSize)+uint32(1))) {
 42356  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59969), unsafe.Pointer(&_ptrmapPutØ00__func__Ø000), unsafe.Pointer(str(55606)))
 42357  			crt.X__builtin_abort(tls)
 42358  		}
 42359  	}()
 42360  	func() {
 42361  		if _pBt.XautoVacuum == 0 {
 42362  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59971), unsafe.Pointer(&_ptrmapPutØ00__func__Ø000), unsafe.Pointer(str(54354)))
 42363  			crt.X__builtin_abort(tls)
 42364  		}
 42365  	}()
 42366  	if _key == (0) {
 42367  		*_pRC = _sqlite3CorruptError(tls, int32(59973))
 42368  		return
 42369  	}
 42370  	_iPtrmap = _ptrmapPageno(tls, _pBt, _key)
 42371  	_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.XpPager), _iPtrmap, &_pDbPage, int32(0))
 42372  	if _rc != int32(0) {
 42373  		*_pRC = _rc
 42374  		return
 42375  	}
 42376  	_offset = int32(uint32(5) * ((_key - _iPtrmap) - uint32(1)))
 42377  	if _offset < int32(0) {
 42378  		*_pRC = _sqlite3CorruptError(tls, int32(59984))
 42379  		goto _ptrmap_exit
 42380  	}
 42381  	func() {
 42382  		if _offset > (int32(_pBt.XusableSize) - int32(5)) {
 42383  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59987), unsafe.Pointer(&_ptrmapPutØ00__func__Ø000), unsafe.Pointer(str(20052)))
 42384  			crt.X__builtin_abort(tls)
 42385  		}
 42386  	}()
 42387  	_pPtrmap = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage))
 42388  	if int32(_eType) == int32(*elem15(_pPtrmap, uintptr(_offset))) && _sqlite3Get4byte(tls, elem15(_pPtrmap, uintptr(_offset+int32(1)))) == _parent {
 42389  		goto _ptrmap_exit
 42390  	}
 42391  	*_pRC = store2(&_rc, _sqlite3PagerWrite(tls, _pDbPage))
 42392  	if _rc == int32(0) {
 42393  		*elem15(_pPtrmap, uintptr(_offset)) = _eType
 42394  		_sqlite3Put4byte(tls, elem15(_pPtrmap, uintptr(_offset+int32(1))), _parent)
 42395  	}
 42396  _ptrmap_exit:
 42397  	_sqlite3PagerUnref(tls, _pDbPage)
 42398  }
 42399  
 42400  var _ptrmapPutØ00__func__Ø000 [10]int8
 42401  
 42402  func init() {
 42403  	crt.Xstrncpy(nil, &_ptrmapPutØ00__func__Ø000[0], str(55652), 10)
 42404  }
 42405  
 42406  // C comment
 42407  //  /*
 42408  //  ** Somewhere on pPage is a pointer to page iFrom.  Modify this pointer so
 42409  //  ** that it points to iTo. Parameter eType describes the type of pointer to
 42410  //  ** be modified, as  follows:
 42411  //  **
 42412  //  ** PTRMAP_BTREE:     pPage is a btree-page. The pointer points at a child
 42413  //  **                   page of pPage.
 42414  //  **
 42415  //  ** PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow
 42416  //  **                   page pointed to by one of the cells on pPage.
 42417  //  **
 42418  //  ** PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next
 42419  //  **                   overflow page in the list.
 42420  //  */
 42421  func _modifyPagePointer(tls *crt.TLS, _pPage *XMemPage, _iFrom uint32, _iTo uint32, _eType uint8) (r0 int32) {
 42422  	var _3_i, _3_nCell, _3_rc int32
 42423  	var _4_pCell *uint8
 42424  	var _5_info XCellInfo
 42425  	func() {
 42426  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 42427  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62435), unsafe.Pointer(&_modifyPagePointerØ00__func__Ø000), unsafe.Pointer(str(20394)))
 42428  			crt.X__builtin_abort(tls)
 42429  		}
 42430  	}()
 42431  	func() {
 42432  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 42433  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62436), unsafe.Pointer(&_modifyPagePointerØ00__func__Ø000), unsafe.Pointer(str(53310)))
 42434  			crt.X__builtin_abort(tls)
 42435  		}
 42436  	}()
 42437  	if int32(_eType) != int32(4) {
 42438  		goto _4
 42439  	}
 42440  	if _sqlite3Get4byte(tls, _pPage.XaData) != _iFrom {
 42441  		return _sqlite3CorruptError(tls, int32(62440))
 42442  	}
 42443  	_sqlite3Put4byte(tls, _pPage.XaData, _iTo)
 42444  	goto _6
 42445  _4:
 42446  	_3_rc = _btreeInitPage(tls, _pPage)
 42447  	if _3_rc != 0 {
 42448  		return _3_rc
 42449  	}
 42450  	_3_nCell = int32(_pPage.XnCell)
 42451  	_3_i = int32(0)
 42452  _8:
 42453  	if _3_i >= _3_nCell {
 42454  		goto _11
 42455  	}
 42456  	_4_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData)) + uintptr(int32(_pPage.XmaskPage)&((int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_3_i)), 0))<<8)|int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_3_i)), uintptr(1)))))))
 42457  	if int32(_eType) != int32(3) {
 42458  		goto _12
 42459  	}
 42460  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 42461  		v := _pPage.XxParseCell
 42462  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 42463  	}()(tls, _pPage, _4_pCell, &_5_info)
 42464  	if uint32(_5_info.XnLocal) >= _5_info.XnPayload {
 42465  		goto _13
 42466  	}
 42467  	if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_pCell))+uintptr(_5_info.XnSize))))) > crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData))+uintptr((*XBtShared)(_pPage.XpBt).XusableSize))))) {
 42468  		return _sqlite3CorruptError(tls, int32(62459))
 42469  	}
 42470  	if _iFrom == _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_pCell))+uintptr(_5_info.XnSize)))))-uintptr(int32(4))))) {
 42471  		_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_pCell))+uintptr(_5_info.XnSize)))))-uintptr(int32(4)))), _iTo)
 42472  		goto _11
 42473  	}
 42474  _13:
 42475  	goto _16
 42476  _12:
 42477  	if _sqlite3Get4byte(tls, _4_pCell) == _iFrom {
 42478  		_sqlite3Put4byte(tls, _4_pCell, _iTo)
 42479  		goto _11
 42480  	}
 42481  _16:
 42482  	_3_i += 1
 42483  	goto _8
 42484  _11:
 42485  	if _3_i != _3_nCell {
 42486  		goto _18
 42487  	}
 42488  	if (int32(_eType) != int32(5)) || (_sqlite3Get4byte(tls, elem15(_pPage.XaData, uintptr(int32(_pPage.XhdrOffset)+int32(8)))) != _iFrom) {
 42489  		return _sqlite3CorruptError(tls, int32(62477))
 42490  	}
 42491  	_sqlite3Put4byte(tls, elem15(_pPage.XaData, uintptr(int32(_pPage.XhdrOffset)+int32(8))), _iTo)
 42492  _18:
 42493  _6:
 42494  	return int32(0)
 42495  }
 42496  
 42497  var _modifyPagePointerØ00__func__Ø000 [18]int8
 42498  
 42499  func init() {
 42500  	crt.Xstrncpy(nil, &_modifyPagePointerØ00__func__Ø000[0], str(55662), 18)
 42501  }
 42502  
 42503  // C comment
 42504  //  /*
 42505  //  ** Truncate the in-memory database file image to nPage pages. This
 42506  //  ** function does not actually modify the database file on disk. It
 42507  //  ** just sets the internal state of the pager object so that the
 42508  //  ** truncation will be done when the current transaction is committed.
 42509  //  **
 42510  //  ** This function is only called right before committing a transaction.
 42511  //  ** Once this function has been called, the transaction must either be
 42512  //  ** rolled back or committed. It is not safe to call this function and
 42513  //  ** then continue writing to the database.
 42514  //  */
 42515  func _sqlite3PagerTruncateImage(tls *crt.TLS, _pPager *XPager, _nPage uint32) {
 42516  	func() {
 42517  		if _pPager.XdbSize < _nPage {
 42518  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50876), unsafe.Pointer(&_sqlite3PagerTruncateImageØ00__func__Ø000), unsafe.Pointer(str(55680)))
 42519  			crt.X__builtin_abort(tls)
 42520  		}
 42521  	}()
 42522  	func() {
 42523  		if int32(_pPager.XeState) < int32(3) {
 42524  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50877), unsafe.Pointer(&_sqlite3PagerTruncateImageØ00__func__Ø000), unsafe.Pointer(str(13287)))
 42525  			crt.X__builtin_abort(tls)
 42526  		}
 42527  	}()
 42528  	_pPager.XdbSize = _nPage
 42529  }
 42530  
 42531  var _sqlite3PagerTruncateImageØ00__func__Ø000 [26]int8
 42532  
 42533  func init() {
 42534  	crt.Xstrncpy(nil, &_sqlite3PagerTruncateImageØ00__func__Ø000[0], str(55702), 26)
 42535  }
 42536  
 42537  // C comment
 42538  //  /*
 42539  //  ** Sync the database file for the pager pPager. zMaster points to the name
 42540  //  ** of a master journal file that should be written into the individual
 42541  //  ** journal file. zMaster may be NULL, which is interpreted as no master
 42542  //  ** journal (a single database transaction).
 42543  //  **
 42544  //  ** This routine ensures that:
 42545  //  **
 42546  //  **   * The database file change-counter is updated,
 42547  //  **   * the journal is synced (unless the atomic-write optimization is used),
 42548  //  **   * all dirty pages are written to the database file,
 42549  //  **   * the database file is truncated (if required), and
 42550  //  **   * the database file synced.
 42551  //  **
 42552  //  ** The only thing that remains to commit the transaction is to finalize
 42553  //  ** (delete, truncate or zero the first part of) the journal file (or
 42554  //  ** delete the master journal file if specified).
 42555  //  **
 42556  //  ** Note that if zMaster==NULL, this does not overwrite a previous value
 42557  //  ** passed to an sqlite3PagerCommitPhaseOne() call.
 42558  //  **
 42559  //  ** If the final parameter - noSync - is true, then the database file itself
 42560  //  ** is not synced. The caller must call sqlite3PagerSync() directly to
 42561  //  ** sync the database file before calling CommitPhaseTwo() to delete the
 42562  //  ** journal file in this case.
 42563  //  */
 42564  func _sqlite3PagerCommitPhaseOne(tls *crt.TLS, _pPager *XPager, _zMaster *int8, _noSync int32) (r0 int32) {
 42565  	var _rc int32
 42566  	var _9_nNew uint32
 42567  	var _3_pList, _3_pPageOne *XPgHdr
 42568  	_rc = int32(0)
 42569  	func() {
 42570  		if int32(_pPager.XeState) != int32(2) && int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) && int32(_pPager.XeState) != int32(6) {
 42571  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53228), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(55728)))
 42572  			crt.X__builtin_abort(tls)
 42573  		}
 42574  	}()
 42575  	func() {
 42576  		if _assert_pager_state(tls, _pPager) == 0 {
 42577  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53233), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(10971)))
 42578  			crt.X__builtin_abort(tls)
 42579  		}
 42580  	}()
 42581  	if func() int32 {
 42582  		if _pPager.XerrCode != 0 {
 42583  			return func() int32 {
 42584  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53236), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(4809)))
 42585  				crt.X__builtin_abort(tls)
 42586  				return int32(1)
 42587  			}()
 42588  		}
 42589  		return int32(0)
 42590  	}() != 0 {
 42591  		return _pPager.XerrCode
 42592  	}
 42593  	if _sqlite3FaultSim(tls, int32(400)) != 0 {
 42594  		return int32(10)
 42595  	}
 42596  	if int32(_pPager.XeState) < int32(3) {
 42597  		return int32(0)
 42598  	}
 42599  	func() {
 42600  		if int32(_pPager.XmemDb) != int32(0) && _pPager.XtempFile == 0 {
 42601  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53247), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(55874)))
 42602  			crt.X__builtin_abort(tls)
 42603  		}
 42604  	}()
 42605  	func() {
 42606  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _pPager.XtempFile == 0 {
 42607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53248), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(19520)))
 42608  			crt.X__builtin_abort(tls)
 42609  		}
 42610  	}()
 42611  	if int32(0) == _pagerFlushOnCommit(tls, _pPager, int32(1)) {
 42612  		_sqlite3BackupRestart(tls, (*Xsqlite3_backup)(_pPager.XpBackup))
 42613  		goto _commit_phase_one_exit
 42614  	}
 42615  	if (*XWal)(_pPager.XpWal) == nil {
 42616  		goto _20
 42617  	}
 42618  	_3_pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.XpPCache))
 42619  	_3_pPageOne = nil
 42620  	if _3_pList == nil {
 42621  		_rc = _sqlite3PagerGet(tls, _pPager, uint32(1), &_3_pPageOne, int32(0))
 42622  		_3_pList = _3_pPageOne
 42623  		*(**XPgHdr)(unsafe.Pointer(&_3_pList.XpDirty)) = nil
 42624  	}
 42625  	func() {
 42626  		if _rc != int32(0) {
 42627  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53265), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(14967)))
 42628  			crt.X__builtin_abort(tls)
 42629  		}
 42630  	}()
 42631  	if func() int32 {
 42632  		if _3_pList != nil {
 42633  			return int32(1)
 42634  		}
 42635  		return func() int32 {
 42636  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53266), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(4809)))
 42637  			crt.X__builtin_abort(tls)
 42638  			return int32(0)
 42639  		}()
 42640  	}() != 0 {
 42641  		_rc = _pagerWalFrames(tls, _pPager, _3_pList, _pPager.XdbSize, int32(1))
 42642  	}
 42643  	_sqlite3PagerUnref(tls, _3_pPageOne)
 42644  	if _rc == int32(0) {
 42645  		_sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.XpPCache))
 42646  	}
 42647  	goto _28
 42648  _20:
 42649  	_rc = _pager_incr_changecounter(tls, _pPager, int32(0))
 42650  	if _rc != int32(0) {
 42651  		goto _commit_phase_one_exit
 42652  	}
 42653  	_rc = _writeMasterJournal(tls, _pPager, _zMaster)
 42654  	if _rc != int32(0) {
 42655  		goto _commit_phase_one_exit
 42656  	}
 42657  	_rc = _syncJournal(tls, _pPager, int32(0))
 42658  	if _rc != int32(0) {
 42659  		goto _commit_phase_one_exit
 42660  	}
 42661  	_rc = _pager_write_pagelist(tls, _pPager, _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.XpPCache)))
 42662  	if _rc != int32(0) {
 42663  		func() {
 42664  			if _rc == int32(2826) {
 42665  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53349), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(55903)))
 42666  				crt.X__builtin_abort(tls)
 42667  			}
 42668  		}()
 42669  		goto _commit_phase_one_exit
 42670  	}
 42671  	_sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.XpPCache))
 42672  	if _pPager.XdbSize <= _pPager.XdbFileSize {
 42673  		goto _35
 42674  	}
 42675  	_9_nNew = _pPager.XdbSize - uint32(bool2int(_pPager.XdbSize == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1))))
 42676  	func() {
 42677  		if int32(_pPager.XeState) != int32(4) {
 42678  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53362), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(55928)))
 42679  			crt.X__builtin_abort(tls)
 42680  		}
 42681  	}()
 42682  	_rc = _pager_truncate(tls, _pPager, _9_nNew)
 42683  	if _rc != int32(0) {
 42684  		goto _commit_phase_one_exit
 42685  	}
 42686  _35:
 42687  	if _noSync == 0 {
 42688  		_rc = _sqlite3PagerSync(tls, _pPager, _zMaster)
 42689  	}
 42690  _28:
 42691  _commit_phase_one_exit:
 42692  	if (_rc == int32(0)) && ((*XWal)(_pPager.XpWal) == nil) {
 42693  		_pPager.XeState = uint8(5)
 42694  	}
 42695  	return _rc
 42696  }
 42697  
 42698  var _sqlite3PagerCommitPhaseOneØ00__func__Ø000 [27]int8
 42699  
 42700  func init() {
 42701  	crt.Xstrncpy(nil, &_sqlite3PagerCommitPhaseOneØ00__func__Ø000[0], str(55963), 27)
 42702  }
 42703  
 42704  func _sqlite3FaultSim(tls *crt.TLS, _iTest int32) (r0 int32) {
 42705  	var _xCallback func(*crt.TLS, int32) int32
 42706  	_xCallback = _sqlite3Config.XxTestCallback
 42707  	return func() int32 {
 42708  		if _xCallback != nil {
 42709  			return _xCallback(tls, _iTest)
 42710  		}
 42711  		return int32(0)
 42712  	}()
 42713  }
 42714  
 42715  func _pagerWalFrames(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr, _nTruncate uint32, _isCommit int32) (r0 int32) {
 42716  	var _rc, _nList int32
 42717  	var _p *XPgHdr
 42718  	var _2_ppNext **XPgHdr
 42719  	func() {
 42720  		if _pPager.XpWal == nil {
 42721  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50067), unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000), unsafe.Pointer(str(55990)))
 42722  			crt.X__builtin_abort(tls)
 42723  		}
 42724  	}()
 42725  	func() {
 42726  		if _pList == nil {
 42727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50068), unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000), unsafe.Pointer(str(56003)))
 42728  			crt.X__builtin_abort(tls)
 42729  		}
 42730  	}()
 42731  	_p = _pList
 42732  _4:
 42733  	if _p == nil || _p.XpDirty == nil {
 42734  		goto _8
 42735  	}
 42736  	func() {
 42737  		if _p.Xpgno >= ((*XPgHdr)(_p.XpDirty).Xpgno) {
 42738  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50072), unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000), unsafe.Pointer(str(56009)))
 42739  			crt.X__builtin_abort(tls)
 42740  		}
 42741  	}()
 42742  	_p = (*XPgHdr)(_p.XpDirty)
 42743  	goto _4
 42744  _8:
 42745  	func() {
 42746  		if (*XPgHdr)(_pList.XpDirty) != nil && _isCommit == 0 {
 42747  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50076), unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000), unsafe.Pointer(str(56035)))
 42748  			crt.X__builtin_abort(tls)
 42749  		}
 42750  	}()
 42751  	if _isCommit == 0 {
 42752  		goto _14
 42753  	}
 42754  	_2_ppNext = &_pList
 42755  	_nList = int32(0)
 42756  	_p = _pList
 42757  _15:
 42758  	if store36(_2_ppNext, _p) == nil {
 42759  		goto _18
 42760  	}
 42761  	if _p.Xpgno <= _nTruncate {
 42762  		_2_ppNext = (**XPgHdr)(unsafe.Pointer(&_p.XpDirty))
 42763  		_nList += 1
 42764  	}
 42765  	_p = (*XPgHdr)(_p.XpDirty)
 42766  	goto _15
 42767  _18:
 42768  	func() {
 42769  		if _pList == nil {
 42770  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50090), unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000), unsafe.Pointer(str(56003)))
 42771  			crt.X__builtin_abort(tls)
 42772  		}
 42773  	}()
 42774  	goto _22
 42775  _14:
 42776  	_nList = int32(1)
 42777  _22:
 42778  	*elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), uintptr(2)) += _nList
 42779  	if _pList.Xpgno == uint32(1) {
 42780  		_pager_write_changecounter(tls, _pList)
 42781  	}
 42782  	_rc = _sqlite3WalFrames(tls, (*XWal)(_pPager.XpWal), _pPager.XpageSize, _pList, _nTruncate, _isCommit, int32(_pPager.XwalSyncFlags))
 42783  	if _rc != int32(0) || _pPager.XpBackup == nil {
 42784  		goto _25
 42785  	}
 42786  	_p = _pList
 42787  _26:
 42788  	if _p == nil {
 42789  		goto _29
 42790  	}
 42791  	_sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.XpBackup), _p.Xpgno, (*uint8)(_p.XpData))
 42792  	_p = (*XPgHdr)(_p.XpDirty)
 42793  	goto _26
 42794  _29:
 42795  _25:
 42796  	return _rc
 42797  }
 42798  
 42799  var _pagerWalFramesØ00__func__Ø000 [15]int8
 42800  
 42801  func init() {
 42802  	crt.Xstrncpy(nil, &_pagerWalFramesØ00__func__Ø000[0], str(56064), 15)
 42803  }
 42804  
 42805  // C comment
 42806  //  /*
 42807  //  ** Update the value of the change-counter at offsets 24 and 92 in
 42808  //  ** the header and the sqlite version number at offset 96.
 42809  //  **
 42810  //  ** This is an unconditional update.  See also the pager_incr_changecounter()
 42811  //  ** routine which only updates the change-counter if the update is actually
 42812  //  ** needed, as determined by the pPager->changeCountDone state variable.
 42813  //  */
 42814  func _pager_write_changecounter(tls *crt.TLS, _pPg *XPgHdr) {
 42815  	var _change_counter uint32
 42816  	_change_counter = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(&((*XPager)(_pPg.XpPager).XdbFileVers)))))) + uint32(1)
 42817  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(_pPg.XpData)+uintptr(int32(24)))), _change_counter)
 42818  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(_pPg.XpData)+uintptr(int32(92)))), _change_counter)
 42819  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(_pPg.XpData)+uintptr(int32(96)))), uint32(3019003))
 42820  }
 42821  
 42822  // C comment
 42823  //  /*
 42824  //  ** Write a set of frames to the log. The caller must hold the write-lock
 42825  //  ** on the log file (obtained using sqlite3WalBeginWriteTransaction()).
 42826  //  */
 42827  func _sqlite3WalFrames(tls *crt.TLS, _pWal *XWal, _szPage int32, _pList *XPgHdr, _nTruncate uint32, _isCommit int32, _sync_flags int32) (r0 int32) {
 42828  	var _rc, _nExtra, _szFrame, _6_nDbSize, _11_bSync, _12_sectorSize int32
 42829  	var _iOffset, _8_iOff, _15_sz int64
 42830  	var _iFrame, _iFirst, _7_iWrite uint32
 42831  	var _8_pData unsafe.Pointer
 42832  	var _3_aWalHdr [32]uint8
 42833  	var _p, _pLast *XPgHdr
 42834  	var _3_aCksum [2]uint32
 42835  	var _pLive *XWalIndexHdr
 42836  	var _w XWalWriter
 42837  	_pLast = nil
 42838  	_nExtra = int32(0)
 42839  	_iFirst = uint32(0)
 42840  	func() {
 42841  		if _pList == nil {
 42842  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57536), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(56003)))
 42843  			crt.X__builtin_abort(tls)
 42844  		}
 42845  	}()
 42846  	func() {
 42847  		if _pWal.XwriteLock == 0 {
 42848  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57537), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(15561)))
 42849  			crt.X__builtin_abort(tls)
 42850  		}
 42851  	}()
 42852  	func() {
 42853  		if (_isCommit != int32(0)) != (_nTruncate != (0)) {
 42854  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57541), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(56079)))
 42855  			crt.X__builtin_abort(tls)
 42856  		}
 42857  	}()
 42858  	_pLive = _walIndexHdr(tls, _pWal)
 42859  	if crt.Xmemcmp(tls, unsafe.Pointer(&_pWal.Xhdr), unsafe.Pointer(_pLive), uint64(48)) != int32(0) {
 42860  		_iFirst = _pLive.XmxFrame + uint32(1)
 42861  	}
 42862  	if int32(0) != store2(&_rc, _walRestartLog(tls, _pWal)) {
 42863  		return _rc
 42864  	}
 42865  	_iFrame = _pWal.Xhdr.XmxFrame
 42866  	if _iFrame != (0) {
 42867  		goto _8
 42868  	}
 42869  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), 0), uint32(931071618))
 42870  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(4)), uint32(3007000))
 42871  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(8)), uint32(_szPage))
 42872  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(12)), _pWal.XnCkpt)
 42873  	if _pWal.XnCkpt == (0) {
 42874  		Xsqlite3_randomness(tls, int32(8), unsafe.Pointer(&(_pWal.Xhdr.XaSalt)))
 42875  	}
 42876  	crt.Xmemcpy(tls, unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(16))), unsafe.Pointer(&(_pWal.Xhdr.XaSalt)), uint64(8))
 42877  	_walChecksumBytes(tls, int32(1), (*uint8)(unsafe.Pointer(&_3_aWalHdr)), int32(24), nil, (*uint32)(unsafe.Pointer(&_3_aCksum)))
 42878  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(24)), *elem31((*uint32)(unsafe.Pointer(&_3_aCksum)), 0))
 42879  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(28)), *elem31((*uint32)(unsafe.Pointer(&_3_aCksum)), uintptr(1)))
 42880  	_pWal.XszPage = uint32(_szPage)
 42881  	_pWal.Xhdr.XbigEndCksum = 0
 42882  	*elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0) = *elem31((*uint32)(unsafe.Pointer(&_3_aCksum)), 0)
 42883  	*elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1)) = *elem31((*uint32)(unsafe.Pointer(&_3_aCksum)), uintptr(1))
 42884  	_pWal.XtruncateOnCommit = uint8(1)
 42885  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(&_3_aWalHdr), int32(32), 0)
 42886  	if _rc != int32(0) {
 42887  		return _rc
 42888  	}
 42889  	if _pWal.XsyncHeader == 0 || _sync_flags == 0 {
 42890  		goto _12
 42891  	}
 42892  	_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.XpWalFd), _sync_flags&int32(19))
 42893  	if _rc != 0 {
 42894  		return _rc
 42895  	}
 42896  _12:
 42897  _8:
 42898  	func() {
 42899  		if int32(_pWal.XszPage) != _szPage {
 42900  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57605), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(56109)))
 42901  			crt.X__builtin_abort(tls)
 42902  		}
 42903  	}()
 42904  	*(**XWal)(unsafe.Pointer(&_w.XpWal)) = _pWal
 42905  	*(**Xsqlite3_file)(unsafe.Pointer(&_w.XpFd)) = (*Xsqlite3_file)(_pWal.XpWalFd)
 42906  	_w.XiSyncPoint = 0
 42907  	_w.XsyncFlags = _sync_flags
 42908  	_w.XszPage = _szPage
 42909  	_iOffset = int64(32) + (int64((_iFrame+uint32(1))-uint32(1)) * int64(_szPage+int32(24)))
 42910  	_szFrame = _szPage + int32(24)
 42911  	_p = _pList
 42912  _16:
 42913  	if _p == nil {
 42914  		goto _19
 42915  	}
 42916  	if _iFirst == 0 || _p.XpDirty == nil && _isCommit != int32(0) {
 42917  		goto _22
 42918  	}
 42919  	_7_iWrite = 0
 42920  	_rc = _sqlite3WalFindFrame(tls, _pWal, _p.Xpgno, &_7_iWrite)
 42921  	func() {
 42922  		if _rc != int32(0) && _7_iWrite != (0) {
 42923  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57627), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(56135)))
 42924  			crt.X__builtin_abort(tls)
 42925  		}
 42926  	}()
 42927  	if _7_iWrite < _iFirst {
 42928  		goto _26
 42929  	}
 42930  	_8_iOff = (int64(32) + (int64(_7_iWrite-uint32(1)) * int64(_szPage+int32(24)))) + int64(24)
 42931  	if (_pWal.XiReCksum == (0)) || (_7_iWrite < _pWal.XiReCksum) {
 42932  		_pWal.XiReCksum = _7_iWrite
 42933  	}
 42934  	_8_pData = _p.XpData
 42935  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.XpWalFd), _8_pData, _szPage, _8_iOff)
 42936  	if _rc != 0 {
 42937  		return _rc
 42938  	}
 42939  	{
 42940  		p := &_p.Xflags
 42941  		*p = uint16(int32(*p) & int32(-65))
 42942  	}
 42943  	goto _17
 42944  _26:
 42945  _22:
 42946  	_iFrame += 1
 42947  	func() {
 42948  		if _iOffset != (int64(32) + (int64(_iFrame-uint32(1)) * int64(_szPage+int32(24)))) {
 42949  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57647), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(56162)))
 42950  			crt.X__builtin_abort(tls)
 42951  		}
 42952  	}()
 42953  	_6_nDbSize = int32(func() uint32 {
 42954  		if _isCommit != 0 && ((*XPgHdr)(_p.XpDirty) == nil) {
 42955  			return _nTruncate
 42956  		}
 42957  		return (0)
 42958  	}())
 42959  	_rc = _walWriteOneFrame(tls, &_w, _p, _6_nDbSize, _iOffset)
 42960  	if _rc != 0 {
 42961  		return _rc
 42962  	}
 42963  	_pLast = _p
 42964  	_iOffset += int64(_szFrame)
 42965  	{
 42966  		p := &_p.Xflags
 42967  		*p = uint16(int32(*p) | int32(64))
 42968  	}
 42969  _17:
 42970  	_p = (*XPgHdr)(_p.XpDirty)
 42971  	goto _16
 42972  _19:
 42973  	if _isCommit == 0 || _pWal.XiReCksum == 0 {
 42974  		goto _37
 42975  	}
 42976  	_rc = _walRewriteChecksums(tls, _pWal, _iFrame)
 42977  	if _rc != 0 {
 42978  		return _rc
 42979  	}
 42980  _37:
 42981  	if _isCommit == 0 || (_sync_flags&int32(32)) == int32(0) {
 42982  		goto _40
 42983  	}
 42984  	_11_bSync = int32(1)
 42985  	if _pWal.XpadToSectorBoundary == 0 {
 42986  		goto _41
 42987  	}
 42988  	_12_sectorSize = _sqlite3SectorSize(tls, (*Xsqlite3_file)(_pWal.XpWalFd))
 42989  	_w.XiSyncPoint = (((_iOffset + int64(_12_sectorSize)) - int64(1)) / int64(_12_sectorSize)) * int64(_12_sectorSize)
 42990  	_11_bSync = bool2int(_w.XiSyncPoint == _iOffset)
 42991  _42:
 42992  	if _iOffset >= _w.XiSyncPoint {
 42993  		goto _43
 42994  	}
 42995  	_rc = _walWriteOneFrame(tls, &_w, _pLast, int32(_nTruncate), _iOffset)
 42996  	if _rc != 0 {
 42997  		return _rc
 42998  	}
 42999  	_iOffset += int64(_szFrame)
 43000  	_nExtra += 1
 43001  	goto _42
 43002  _43:
 43003  _41:
 43004  	if _11_bSync != 0 {
 43005  		func() {
 43006  			if _rc != int32(0) {
 43007  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57691), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(14967)))
 43008  				crt.X__builtin_abort(tls)
 43009  			}
 43010  		}()
 43011  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_w.XpFd), _sync_flags&int32(19))
 43012  	}
 43013  _40:
 43014  	if _isCommit == 0 || _pWal.XtruncateOnCommit == 0 || _pWal.XmxWalSize < (0) {
 43015  		goto _50
 43016  	}
 43017  	_15_sz = _pWal.XmxWalSize
 43018  	if (int64(32) + (int64(((_iFrame+uint32(_nExtra))+uint32(1))-uint32(1)) * int64(_szPage+int32(24)))) > _pWal.XmxWalSize {
 43019  		_15_sz = int64(32) + (int64(((_iFrame+uint32(_nExtra))+uint32(1))-uint32(1)) * int64(_szPage+int32(24)))
 43020  	}
 43021  	_walLimitSize(tls, _pWal, _15_sz)
 43022  	_pWal.XtruncateOnCommit = 0
 43023  _50:
 43024  	_iFrame = _pWal.Xhdr.XmxFrame
 43025  	_p = _pList
 43026  _52:
 43027  	if _p == nil || _rc != int32(0) {
 43028  		goto _56
 43029  	}
 43030  	if (int32(_p.Xflags) & int32(64)) == int32(0) {
 43031  		goto _53
 43032  	}
 43033  	_iFrame += 1
 43034  	_rc = _walIndexAppend(tls, _pWal, _iFrame, _p.Xpgno)
 43035  _53:
 43036  	_p = (*XPgHdr)(_p.XpDirty)
 43037  	goto _52
 43038  _56:
 43039  	if (_rc == int32(0)) && (_nExtra > int32(0)) {
 43040  		_iFrame += 1
 43041  		_nExtra -= 1
 43042  		_rc = _walIndexAppend(tls, _pWal, _iFrame, _pLast.Xpgno)
 43043  		goto _56
 43044  	}
 43045  	if _rc != int32(0) {
 43046  		goto _61
 43047  	}
 43048  	_pWal.Xhdr.XszPage = uint16((_szPage & int32(65280)) | (_szPage >> 16))
 43049  	_pWal.Xhdr.XmxFrame = _iFrame
 43050  	if _isCommit != 0 {
 43051  		_pWal.Xhdr.XiChange += 1
 43052  		_pWal.Xhdr.XnPage = _nTruncate
 43053  	}
 43054  	if _isCommit != 0 {
 43055  		_walIndexWriteHdr(tls, _pWal)
 43056  		_pWal.XiCallback = _iFrame
 43057  	}
 43058  _61:
 43059  	return _rc
 43060  
 43061  	_ = _3_aWalHdr
 43062  	_ = _3_aCksum
 43063  	panic(0)
 43064  }
 43065  
 43066  var _sqlite3WalFramesØ00__func__Ø000 [17]int8
 43067  
 43068  func init() {
 43069  	crt.Xstrncpy(nil, &_sqlite3WalFramesØ00__func__Ø000[0], str(56202), 17)
 43070  }
 43071  
 43072  // C comment
 43073  //  /*
 43074  //  ** This function is called just before writing a set of frames to the log
 43075  //  ** file (see sqlite3WalFrames()). It checks to see if, instead of appending
 43076  //  ** to the current log file, it is possible to overwrite the start of the
 43077  //  ** existing log file with the new frames (i.e. "reset" the log). If so,
 43078  //  ** it sets pWal->hdr.mxFrame to 0. Otherwise, pWal->hdr.mxFrame is left
 43079  //  ** unchanged.
 43080  //  **
 43081  //  ** SQLITE_OK is returned if no error is encountered (regardless of whether
 43082  //  ** or not pWal->hdr.mxFrame is modified). An SQLite error code is returned
 43083  //  ** if an error occurs.
 43084  //  */
 43085  func _walRestartLog(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 43086  	var _rc, _cnt, _5_notUsed int32
 43087  	var _2_salt1 uint32
 43088  	var _1_pInfo *XWalCkptInfo
 43089  	_rc = int32(0)
 43090  	if int32(_pWal.XreadLock) != int32(0) {
 43091  		goto _0
 43092  	}
 43093  	_1_pInfo = _walCkptInfo(tls, _pWal)
 43094  	func() {
 43095  		if _1_pInfo.XnBackfill != (_pWal.Xhdr.XmxFrame) {
 43096  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57356), unsafe.Pointer(&_walRestartLogØ00__func__Ø000), unsafe.Pointer(str(22912)))
 43097  			crt.X__builtin_abort(tls)
 43098  		}
 43099  	}()
 43100  	if _1_pInfo.XnBackfill <= (0) {
 43101  		goto _3
 43102  	}
 43103  	Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_2_salt1))
 43104  	_rc = _walLockExclusive(tls, _pWal, int32(4), int32(4))
 43105  	if _rc == int32(0) {
 43106  		_walRestartHdr(tls, _pWal, _2_salt1)
 43107  		_walUnlockExclusive(tls, _pWal, int32(4), int32(4))
 43108  		goto _6
 43109  	}
 43110  	if _rc != int32(5) {
 43111  		return _rc
 43112  	}
 43113  _6:
 43114  _3:
 43115  	_walUnlockShared(tls, _pWal, int32(3))
 43116  	_pWal.XreadLock = int16(-1)
 43117  	_cnt = int32(0)
 43118  _7:
 43119  	_rc = _walTryBeginRead(tls, _pWal, &_5_notUsed, int32(1), preInc2(&_cnt, 1))
 43120  	if _rc == int32(-1) {
 43121  		goto _7
 43122  	}
 43123  	func() {
 43124  		if (_rc & int32(255)) == int32(5) {
 43125  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57384), unsafe.Pointer(&_walRestartLogØ00__func__Ø000), unsafe.Pointer(str(56219)))
 43126  			crt.X__builtin_abort(tls)
 43127  		}
 43128  	}()
 43129  _0:
 43130  	return _rc
 43131  
 43132  	_ = _cnt
 43133  	panic(0)
 43134  }
 43135  
 43136  var _walRestartLogØ00__func__Ø000 [14]int8
 43137  
 43138  func init() {
 43139  	crt.Xstrncpy(nil, &_walRestartLogØ00__func__Ø000[0], str(56242), 14)
 43140  }
 43141  
 43142  // C comment
 43143  //  /*
 43144  //  ** Write out a single frame of the WAL
 43145  //  */
 43146  func _walWriteOneFrame(tls *crt.TLS, _p *XWalWriter, _pPage *XPgHdr, _nTruncate int32, _iOffset int64) (r0 int32) {
 43147  	var _rc int32
 43148  	var _pData unsafe.Pointer
 43149  	var _aFrame [24]uint8
 43150  	_pData = _pPage.XpData
 43151  	_walEncodeFrame(tls, (*XWal)(_p.XpWal), _pPage.Xpgno, uint32(_nTruncate), (*uint8)(_pData), (*uint8)(unsafe.Pointer(&_aFrame)))
 43152  	_rc = _walWriteToLog(tls, _p, unsafe.Pointer(&_aFrame), int32(24), _iOffset)
 43153  	if _rc != 0 {
 43154  		return _rc
 43155  	}
 43156  	_rc = _walWriteToLog(tls, _p, _pData, _p.XszPage, int64(uint64(_iOffset)+uint64(24)))
 43157  	return _rc
 43158  
 43159  	_ = _aFrame
 43160  	panic(0)
 43161  }
 43162  
 43163  // C comment
 43164  //  /*
 43165  //  ** This function encodes a single frame header and writes it to a buffer
 43166  //  ** supplied by the caller. A frame-header is made up of a series of
 43167  //  ** 4-byte big-endian integers, as follows:
 43168  //  **
 43169  //  **     0: Page number.
 43170  //  **     4: For commit records, the size of the database image in pages
 43171  //  **        after the commit. For all other records, zero.
 43172  //  **     8: Salt-1 (copied from the wal-header)
 43173  //  **    12: Salt-2 (copied from the wal-header)
 43174  //  **    16: Checksum-1.
 43175  //  **    20: Checksum-2.
 43176  //  */
 43177  func _walEncodeFrame(tls *crt.TLS, _pWal *XWal, _iPage uint32, _nTruncate uint32, _aData *uint8, _aFrame *uint8) {
 43178  	var _nativeCksum int32
 43179  	var _aCksum *uint32
 43180  	_aCksum = (*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum)))
 43181  
 43182  	_sqlite3Put4byte(tls, elem15(_aFrame, 0), _iPage)
 43183  	_sqlite3Put4byte(tls, elem15(_aFrame, uintptr(4)), _nTruncate)
 43184  	if _pWal.XiReCksum == (0) {
 43185  		crt.Xmemcpy(tls, unsafe.Pointer(elem15(_aFrame, uintptr(8))), unsafe.Pointer(&(_pWal.Xhdr.XaSalt)), uint64(8))
 43186  		_nativeCksum = bool2int(int32(_pWal.Xhdr.XbigEndCksum) == int32(0))
 43187  		_walChecksumBytes(tls, _nativeCksum, _aFrame, int32(8), _aCksum, _aCksum)
 43188  		_walChecksumBytes(tls, _nativeCksum, _aData, int32(_pWal.XszPage), _aCksum, _aCksum)
 43189  		_sqlite3Put4byte(tls, elem15(_aFrame, uintptr(16)), *elem31(_aCksum, 0))
 43190  		_sqlite3Put4byte(tls, elem15(_aFrame, uintptr(20)), *elem31(_aCksum, uintptr(1)))
 43191  		goto _1
 43192  	}
 43193  	crt.Xmemset(tls, unsafe.Pointer(elem15(_aFrame, uintptr(8))), int32(0), uint64(16))
 43194  _1:
 43195  }
 43196  
 43197  // C comment
 43198  //  /*
 43199  //  ** Write iAmt bytes of content into the WAL file beginning at iOffset.
 43200  //  ** Do a sync when crossing the p->iSyncPoint boundary.
 43201  //  **
 43202  //  ** In other words, if iSyncPoint is in between iOffset and iOffset+iAmt,
 43203  //  ** first write the part before iSyncPoint, then sync, then write the
 43204  //  ** rest.
 43205  //  */
 43206  func _walWriteToLog(tls *crt.TLS, _p *XWalWriter, _pContent unsafe.Pointer, _iAmt int32, _iOffset int64) (r0 int32) {
 43207  	var _rc, _1_iFirstAmt int32
 43208  	if _iOffset >= _p.XiSyncPoint || (_iOffset+int64(_iAmt)) < _p.XiSyncPoint {
 43209  		goto _1
 43210  	}
 43211  	_1_iFirstAmt = int32(_p.XiSyncPoint - _iOffset)
 43212  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.XpFd), _pContent, _1_iFirstAmt, _iOffset)
 43213  	if _rc != 0 {
 43214  		return _rc
 43215  	}
 43216  	_iOffset += int64(_1_iFirstAmt)
 43217  	_iAmt -= _1_iFirstAmt
 43218  	_pContent = unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_1_iFirstAmt) + uintptr(_pContent))))
 43219  	func() {
 43220  		if (_p.XsyncFlags & int32(3)) == 0 {
 43221  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57427), unsafe.Pointer(&_walWriteToLogØ00__func__Ø000), unsafe.Pointer(str(56256)))
 43222  			crt.X__builtin_abort(tls)
 43223  		}
 43224  	}()
 43225  	_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_p.XpFd), _p.XsyncFlags&int32(19))
 43226  	if (_iAmt == int32(0)) || _rc != 0 {
 43227  		return _rc
 43228  	}
 43229  _1:
 43230  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.XpFd), _pContent, _iAmt, _iOffset)
 43231  	return _rc
 43232  }
 43233  
 43234  var _walWriteToLogØ00__func__Ø000 [14]int8
 43235  
 43236  func init() {
 43237  	crt.Xstrncpy(nil, &_walWriteToLogØ00__func__Ø000[0], str(56309), 14)
 43238  }
 43239  
 43240  // C comment
 43241  //  /*
 43242  //  ** This function is called as part of committing a transaction within which
 43243  //  ** one or more frames have been overwritten. It updates the checksums for
 43244  //  ** all frames written to the wal file by the current transaction starting
 43245  //  ** with the earliest to have been overwritten.
 43246  //  **
 43247  //  ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 43248  //  */
 43249  func _walRewriteChecksums(tls *crt.TLS, _pWal *XWal, _iLast uint32) (r0 int32) {
 43250  	var _szPage, _rc int32
 43251  	var _iCksumOff, _3_iOff int64
 43252  	var _iRead, _4_iPgno, _4_nDbSize uint32
 43253  	var _aBuf *uint8
 43254  	var _aFrame [24]uint8
 43255  	_szPage = int32(_pWal.XszPage)
 43256  	_rc = int32(0)
 43257  	_aBuf = (*uint8)(Xsqlite3_malloc(tls, _szPage+int32(24)))
 43258  	if _aBuf == nil {
 43259  		return _sqlite3NomemError(tls, int32(57477))
 43260  	}
 43261  	func() {
 43262  		if _pWal.XiReCksum <= (0) {
 43263  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57484), unsafe.Pointer(&_walRewriteChecksumsØ00__func__Ø000), unsafe.Pointer(str(56323)))
 43264  			crt.X__builtin_abort(tls)
 43265  		}
 43266  	}()
 43267  	if _pWal.XiReCksum == uint32(1) {
 43268  		_iCksumOff = int64(24)
 43269  		goto _4
 43270  	}
 43271  	_iCksumOff = (int64(32) + (int64((_pWal.XiReCksum-uint32(1))-uint32(1)) * int64(_szPage+int32(24)))) + int64(16)
 43272  _4:
 43273  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(_aBuf), int32(8), _iCksumOff)
 43274  	*elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0) = _sqlite3Get4byte(tls, _aBuf)
 43275  	*elem31((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1)) = _sqlite3Get4byte(tls, elem15(_aBuf, uintptr(4)))
 43276  	_iRead = _pWal.XiReCksum
 43277  	_pWal.XiReCksum = 0
 43278  _5:
 43279  	if _rc != int32(0) || _iRead > _iLast {
 43280  		goto _9
 43281  	}
 43282  	_3_iOff = int64(32) + (int64(_iRead-uint32(1)) * int64(_szPage+int32(24)))
 43283  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(_aBuf), _szPage+int32(24), _3_iOff)
 43284  	if _rc == int32(0) {
 43285  		_4_iPgno = _sqlite3Get4byte(tls, _aBuf)
 43286  		_4_nDbSize = _sqlite3Get4byte(tls, elem15(_aBuf, uintptr(4)))
 43287  		_walEncodeFrame(tls, _pWal, _4_iPgno, _4_nDbSize, elem15(_aBuf, uintptr(24)), (*uint8)(unsafe.Pointer(&_aFrame)))
 43288  		_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(&_aFrame), int32(24), _3_iOff)
 43289  	}
 43290  	_iRead += 1
 43291  	goto _5
 43292  _9:
 43293  	Xsqlite3_free(tls, unsafe.Pointer(_aBuf))
 43294  	return _rc
 43295  
 43296  	_ = _aFrame
 43297  	panic(0)
 43298  }
 43299  
 43300  var _walRewriteChecksumsØ00__func__Ø000 [20]int8
 43301  
 43302  func init() {
 43303  	crt.Xstrncpy(nil, &_walRewriteChecksumsØ00__func__Ø000[0], str(56340), 20)
 43304  }
 43305  
 43306  // C comment
 43307  //  /*
 43308  //  ** This routine is called to increment the value of the database file
 43309  //  ** change-counter, stored as a 4-byte big-endian integer starting at
 43310  //  ** byte offset 24 of the pager file.  The secondary change counter at
 43311  //  ** 92 is also updated, as is the SQLite version number at offset 96.
 43312  //  **
 43313  //  ** But this only happens if the pPager->changeCountDone flag is false.
 43314  //  ** To avoid excess churning of page 1, the update only happens once.
 43315  //  ** See also the pager_write_changecounter() routine that does an
 43316  //  ** unconditional update of the change counters.
 43317  //  **
 43318  //  ** If the isDirectMode flag is zero, then this is done by calling
 43319  //  ** sqlite3PagerWrite() on page 1, then modifying the contents of the
 43320  //  ** page data. In this case the file will be updated when the current
 43321  //  ** transaction is committed.
 43322  //  **
 43323  //  ** The isDirectMode flag may only be non-zero if the library was compiled
 43324  //  ** with the SQLITE_ENABLE_ATOMIC_WRITE macro defined. In this case,
 43325  //  ** if isDirect is non-zero, then the database file is updated directly
 43326  //  ** by writing an updated version of page 1 using a call to the
 43327  //  ** sqlite3OsWrite() function.
 43328  //  */
 43329  func _pager_incr_changecounter(tls *crt.TLS, _pPager *XPager, _isDirectMode int32) (r0 int32) {
 43330  	var _rc int32
 43331  	var _4_zBuf, _6_pCopy unsafe.Pointer
 43332  	var _1_pPgHdr *XPgHdr
 43333  	_rc = int32(0)
 43334  	func() {
 43335  		if int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) {
 43336  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53073), unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000), unsafe.Pointer(str(54996)))
 43337  			crt.X__builtin_abort(tls)
 43338  		}
 43339  	}()
 43340  	func() {
 43341  		if _assert_pager_state(tls, _pPager) == 0 {
 43342  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53076), unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000), unsafe.Pointer(str(10971)))
 43343  			crt.X__builtin_abort(tls)
 43344  		}
 43345  	}()
 43346  	func() {
 43347  		if _isDirectMode != int32(0) {
 43348  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53090), unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000), unsafe.Pointer(str(56360)))
 43349  			crt.X__builtin_abort(tls)
 43350  		}
 43351  	}()
 43352  
 43353  	if _pPager.XchangeCountDone != 0 || func() int32 {
 43354  		if _pPager.XdbSize > (0) {
 43355  			return int32(1)
 43356  		}
 43357  		return func() int32 {
 43358  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53096), unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000), unsafe.Pointer(str(4809)))
 43359  			crt.X__builtin_abort(tls)
 43360  			return int32(0)
 43361  		}()
 43362  	}() == 0 {
 43363  		goto _10
 43364  	}
 43365  	func() {
 43366  		if _pPager.XtempFile != 0 || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 43367  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53099), unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000), unsafe.Pointer(str(56376)))
 43368  			crt.X__builtin_abort(tls)
 43369  		}
 43370  	}()
 43371  	_rc = _sqlite3PagerGet(tls, _pPager, uint32(1), &_1_pPgHdr, int32(0))
 43372  	func() {
 43373  		if _1_pPgHdr != nil && _rc != int32(0) {
 43374  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53103), unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000), unsafe.Pointer(str(56416)))
 43375  			crt.X__builtin_abort(tls)
 43376  		}
 43377  	}()
 43378  	if int32(1) != 0 && func() int32 {
 43379  		if _rc == int32(0) {
 43380  			return int32(1)
 43381  		}
 43382  		return func() int32 {
 43383  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53110), unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000), unsafe.Pointer(str(4809)))
 43384  			crt.X__builtin_abort(tls)
 43385  			return int32(0)
 43386  		}()
 43387  	}() != 0 {
 43388  		_rc = _sqlite3PagerWrite(tls, _1_pPgHdr)
 43389  	}
 43390  	if _rc != int32(0) {
 43391  		goto _21
 43392  	}
 43393  	_pager_write_changecounter(tls, _1_pPgHdr)
 43394  	goto _22
 43395  _22:
 43396  	_pPager.XchangeCountDone = uint8(1)
 43397  _21:
 43398  	_sqlite3PagerUnref(tls, _1_pPgHdr)
 43399  _10:
 43400  	return _rc
 43401  
 43402  	_ = _4_zBuf
 43403  	_ = _6_pCopy
 43404  	panic(0)
 43405  }
 43406  
 43407  var _pager_incr_changecounterØ00__func__Ø000 [25]int8
 43408  
 43409  func init() {
 43410  	crt.Xstrncpy(nil, &_pager_incr_changecounterØ00__func__Ø000[0], str(56443), 25)
 43411  }
 43412  
 43413  // C comment
 43414  //  /*
 43415  //  ** Write the supplied master journal name into the journal file for pager
 43416  //  ** pPager at the current location. The master journal name must be the last
 43417  //  ** thing written to a journal file. If the pager is in full-sync mode, the
 43418  //  ** journal file descriptor is advanced to the next sector boundary before
 43419  //  ** anything is written. The format is:
 43420  //  **
 43421  //  **   + 4 bytes: PAGER_MJ_PGNO.
 43422  //  **   + N bytes: Master journal filename in utf-8.
 43423  //  **   + 4 bytes: N (length of master journal name in bytes, no nul-terminator).
 43424  //  **   + 4 bytes: Master journal name checksum.
 43425  //  **   + 8 bytes: aJournalMagic[].
 43426  //  **
 43427  //  ** The master journal page checksum is the sum of the bytes in the master
 43428  //  ** journal name, where each byte is interpreted as a signed 8-bit integer.
 43429  //  **
 43430  //  ** If zMaster is a NULL pointer (occurs for a single database transaction),
 43431  //  ** this call is a no-op.
 43432  //  */
 43433  func _writeMasterJournal(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) {
 43434  	var _rc, _nMaster int32
 43435  	var _iHdrOff, _jrnlSize int64
 43436  	var _cksum uint32
 43437  	_cksum = uint32(0)
 43438  	func() {
 43439  		if int32(_pPager.XsetMaster) != int32(0) {
 43440  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48585), unsafe.Pointer(&_writeMasterJournalØ00__func__Ø000), unsafe.Pointer(str(11980)))
 43441  			crt.X__builtin_abort(tls)
 43442  		}
 43443  	}()
 43444  	func() {
 43445  		if (*XWal)(_pPager.XpWal) != nil {
 43446  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48586), unsafe.Pointer(&_writeMasterJournalØ00__func__Ø000), unsafe.Pointer(str(12123)))
 43447  			crt.X__builtin_abort(tls)
 43448  		}
 43449  	}()
 43450  	if ((_zMaster == nil) || (int32(_pPager.XjournalMode) == int32(4))) || ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil) {
 43451  		return int32(0)
 43452  	}
 43453  	_pPager.XsetMaster = uint8(1)
 43454  	func() {
 43455  		if _pPager.XjournalHdr > _pPager.XjournalOff {
 43456  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48595), unsafe.Pointer(&_writeMasterJournalØ00__func__Ø000), unsafe.Pointer(str(13638)))
 43457  			crt.X__builtin_abort(tls)
 43458  		}
 43459  	}()
 43460  	_nMaster = int32(0)
 43461  _9:
 43462  	if (*elem1(_zMaster, uintptr(_nMaster))) == 0 {
 43463  		goto _12
 43464  	}
 43465  	_cksum += uint32(*elem1(_zMaster, uintptr(_nMaster)))
 43466  	_nMaster += 1
 43467  	goto _9
 43468  _12:
 43469  	if _pPager.XfullSync != 0 {
 43470  		_pPager.XjournalOff = _journalHdrOffset(tls, _pPager)
 43471  	}
 43472  	_iHdrOff = _pPager.XjournalOff
 43473  	if ((((int32(0) != store2(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), _iHdrOff, uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1))))) || (int32(0) != store2(&_rc, _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(_zMaster), _nMaster, _iHdrOff+int64(4))))) || (int32(0) != store2(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), (_iHdrOff+int64(4))+int64(_nMaster), uint32(_nMaster))))) || (int32(0) != store2(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), ((_iHdrOff+int64(4))+int64(_nMaster))+int64(4), _cksum)))) || (int32(0) != store2(&_rc, _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_aJournalMagic), int32(8), ((_iHdrOff+int64(4))+int64(_nMaster))+int64(8)))) {
 43474  		return _rc
 43475  	}
 43476  	_pPager.XjournalOff += int64(_nMaster + int32(20))
 43477  	if (int32(0) == store2(&_rc, _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xjfd), &_jrnlSize))) && (_jrnlSize > _pPager.XjournalOff) {
 43478  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xjfd), _pPager.XjournalOff)
 43479  	}
 43480  	return _rc
 43481  }
 43482  
 43483  var _writeMasterJournalØ00__func__Ø000 [19]int8
 43484  
 43485  func init() {
 43486  	crt.Xstrncpy(nil, &_writeMasterJournalØ00__func__Ø000[0], str(56468), 19)
 43487  }
 43488  
 43489  // C comment
 43490  //  /*
 43491  //  ** Sync the journal. In other words, make sure all the pages that have
 43492  //  ** been written to the journal have actually reached the surface of the
 43493  //  ** disk and can be restored in the event of a hot-journal rollback.
 43494  //  **
 43495  //  ** If the Pager.noSync flag is set, then this function is a no-op.
 43496  //  ** Otherwise, the actions required depend on the journal-mode and the
 43497  //  ** device characteristics of the file-system, as follows:
 43498  //  **
 43499  //  **   * If the journal file is an in-memory journal file, no action need
 43500  //  **     be taken.
 43501  //  **
 43502  //  **   * Otherwise, if the device does not support the SAFE_APPEND property,
 43503  //  **     then the nRec field of the most recently written journal header
 43504  //  **     is updated to contain the number of journal records that have
 43505  //  **     been written following it. If the pager is operating in full-sync
 43506  //  **     mode, then the journal file is synced before this field is updated.
 43507  //  **
 43508  //  **   * If the device does not support the SEQUENTIAL property, then
 43509  //  **     journal file is synced.
 43510  //  **
 43511  //  ** Or, in pseudo-code:
 43512  //  **
 43513  //  **   if( NOT <in-memory journal> ){
 43514  //  **     if( NOT SAFE_APPEND ){
 43515  //  **       if( <full-sync mode> ) xSync(<journal file>);
 43516  //  **       <update nRec field>
 43517  //  **     }
 43518  //  **     if( NOT SEQUENTIAL ) xSync(<journal file>);
 43519  //  **   }
 43520  //  **
 43521  //  ** If successful, this routine clears the PGHDR_NEED_SYNC flag of every
 43522  //  ** page currently held in memory before returning SQLITE_OK. If an IO
 43523  //  ** error is encountered, then the IO error code is returned to the caller.
 43524  //  */
 43525  func _syncJournal(tls *crt.TLS, _pPager *XPager, _newHdr int32) (r0 int32) {
 43526  	var _rc, _2_iDc int32
 43527  	var _3_iNextHdrOffset int64
 43528  	var _3_aMagic [8]uint8
 43529  	var _3_zHeader [12]uint8
 43530  	func() {
 43531  		if int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) {
 43532  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51120), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(54996)))
 43533  			crt.X__builtin_abort(tls)
 43534  		}
 43535  	}()
 43536  	func() {
 43537  		if _assert_pager_state(tls, _pPager) == 0 {
 43538  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51123), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(10971)))
 43539  			crt.X__builtin_abort(tls)
 43540  		}
 43541  	}()
 43542  	func() {
 43543  		if (*XWal)(_pPager.XpWal) != nil {
 43544  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51124), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(12123)))
 43545  			crt.X__builtin_abort(tls)
 43546  		}
 43547  	}()
 43548  	_rc = _sqlite3PagerExclusiveLock(tls, _pPager)
 43549  	if _rc != int32(0) {
 43550  		return _rc
 43551  	}
 43552  	if _pPager.XnoSync != 0 {
 43553  		goto _8
 43554  	}
 43555  	func() {
 43556  		if _pPager.XtempFile != 0 {
 43557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51130), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(51639)))
 43558  			crt.X__builtin_abort(tls)
 43559  		}
 43560  	}()
 43561  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil || int32(_pPager.XjournalMode) == int32(4) {
 43562  		goto _12
 43563  	}
 43564  	_2_iDc = _sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xfd))
 43565  	func() {
 43566  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 43567  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51133), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(13581)))
 43568  			crt.X__builtin_abort(tls)
 43569  		}
 43570  	}()
 43571  	if int32(0) != (_2_iDc & int32(512)) {
 43572  		goto _15
 43573  	}
 43574  	crt.Xmemcpy(tls, unsafe.Pointer(&_3_zHeader), unsafe.Pointer(&_aJournalMagic), uint64(8))
 43575  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_zHeader)), uintptr(8)), uint32(_pPager.XnRec))
 43576  	_3_iNextHdrOffset = _journalHdrOffset(tls, _pPager)
 43577  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_3_aMagic), int32(8), _3_iNextHdrOffset)
 43578  	if (_rc == int32(0)) && (int32(0) == crt.Xmemcmp(tls, unsafe.Pointer(&_3_aMagic), unsafe.Pointer(&_aJournalMagic), uint64(8))) {
 43579  		_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_syncJournalØ00zerobyteØ001), int32(1), _3_iNextHdrOffset)
 43580  	}
 43581  	if (_rc != int32(0)) && (_rc != int32(522)) {
 43582  		return _rc
 43583  	}
 43584  	if _pPager.XfullSync == 0 || int32(0) != (_2_iDc&int32(1024)) {
 43585  		goto _21
 43586  	}
 43587  	_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xjfd), int32(_pPager.XsyncFlags))
 43588  	if _rc != int32(0) {
 43589  		return _rc
 43590  	}
 43591  _21:
 43592  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_3_zHeader), int32(12), _pPager.XjournalHdr)
 43593  	if _rc != int32(0) {
 43594  		return _rc
 43595  	}
 43596  _15:
 43597  	if int32(0) != (_2_iDc & int32(1024)) {
 43598  		goto _24
 43599  	}
 43600  	_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xjfd), int32(_pPager.XsyncFlags)|func() int32 {
 43601  		if int32(_pPager.XsyncFlags) == int32(3) {
 43602  			return int32(16)
 43603  		}
 43604  		return int32(0)
 43605  	}())
 43606  	if _rc != int32(0) {
 43607  		return _rc
 43608  	}
 43609  _24:
 43610  	_pPager.XjournalHdr = _pPager.XjournalOff
 43611  	if _newHdr == 0 || int32(0) != (_2_iDc&int32(512)) {
 43612  		goto _29
 43613  	}
 43614  	_pPager.XnRec = int32(0)
 43615  	_rc = _writeJournalHdr(tls, _pPager)
 43616  	if _rc != int32(0) {
 43617  		return _rc
 43618  	}
 43619  _29:
 43620  	goto _31
 43621  _12:
 43622  	_pPager.XjournalHdr = _pPager.XjournalOff
 43623  _31:
 43624  _8:
 43625  	_sqlite3PcacheClearSyncFlags(tls, (*XPCache)(_pPager.XpPCache))
 43626  	_pPager.XeState = uint8(4)
 43627  	func() {
 43628  		if _assert_pager_state(tls, _pPager) == 0 {
 43629  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51224), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(10971)))
 43630  			crt.X__builtin_abort(tls)
 43631  		}
 43632  	}()
 43633  	return int32(0)
 43634  
 43635  	_ = _3_aMagic
 43636  	_ = _3_zHeader
 43637  	panic(0)
 43638  }
 43639  
 43640  var _syncJournalØ00__func__Ø000 [12]int8
 43641  
 43642  func init() {
 43643  	crt.Xstrncpy(nil, &_syncJournalØ00__func__Ø000[0], str(56487), 12)
 43644  }
 43645  
 43646  // C comment
 43647  //  /*
 43648  //  ** This function may only be called while a write-transaction is active in
 43649  //  ** rollback. If the connection is in WAL mode, this call is a no-op.
 43650  //  ** Otherwise, if the connection does not already have an EXCLUSIVE lock on
 43651  //  ** the database file, an attempt is made to obtain one.
 43652  //  **
 43653  //  ** If the EXCLUSIVE lock is already held or the attempt to obtain it is
 43654  //  ** successful, or the connection is in WAL mode, SQLITE_OK is returned.
 43655  //  ** Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is
 43656  //  ** returned.
 43657  //  */
 43658  func _sqlite3PagerExclusiveLock(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 43659  	var _rc int32
 43660  	_rc = _pPager.XerrCode
 43661  	func() {
 43662  		if _assert_pager_state(tls, _pPager) == 0 {
 43663  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53181), unsafe.Pointer(&_sqlite3PagerExclusiveLockØ00__func__Ø000), unsafe.Pointer(str(10971)))
 43664  			crt.X__builtin_abort(tls)
 43665  		}
 43666  	}()
 43667  	if _rc != int32(0) {
 43668  		goto _2
 43669  	}
 43670  	func() {
 43671  		if int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) && int32(_pPager.XeState) != int32(2) {
 43672  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53183), unsafe.Pointer(&_sqlite3PagerExclusiveLockØ00__func__Ø000), unsafe.Pointer(str(56499)))
 43673  			crt.X__builtin_abort(tls)
 43674  		}
 43675  	}()
 43676  	func() {
 43677  		if _assert_pager_state(tls, _pPager) == 0 {
 43678  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53187), unsafe.Pointer(&_sqlite3PagerExclusiveLockØ00__func__Ø000), unsafe.Pointer(str(10971)))
 43679  			crt.X__builtin_abort(tls)
 43680  		}
 43681  	}()
 43682  	if int32(0) == bool2int((*XWal)(_pPager.XpWal) != nil) {
 43683  		_rc = _pager_wait_on_lock(tls, _pPager, int32(4))
 43684  	}
 43685  _2:
 43686  	return _rc
 43687  }
 43688  
 43689  var _sqlite3PagerExclusiveLockØ00__func__Ø000 [26]int8
 43690  
 43691  func init() {
 43692  	crt.Xstrncpy(nil, &_sqlite3PagerExclusiveLockØ00__func__Ø000[0], str(56614), 26)
 43693  }
 43694  
 43695  var _syncJournalØ00zerobyteØ001 uint8
 43696  
 43697  // C comment
 43698  //  /*
 43699  //  ** Clear the PGHDR_NEED_SYNC flag from all dirty pages.
 43700  //  */
 43701  func _sqlite3PcacheClearSyncFlags(tls *crt.TLS, _pCache *XPCache) {
 43702  	var _p *XPgHdr
 43703  	_p = (*XPgHdr)(_pCache.XpDirty)
 43704  _0:
 43705  	if _p == nil {
 43706  		goto _3
 43707  	}
 43708  	{
 43709  		p := &_p.Xflags
 43710  		*p = uint16(int32(*p) & int32(-9))
 43711  	}
 43712  	_p = (*XPgHdr)(_p.XpDirtyNext)
 43713  	goto _0
 43714  _3:
 43715  	*(**XPgHdr)(unsafe.Pointer(&_pCache.XpSynced)) = (*XPgHdr)(_pCache.XpDirtyTail)
 43716  }
 43717  
 43718  // C comment
 43719  //  /*
 43720  //  ** The argument is the first in a linked list of dirty pages connected
 43721  //  ** by the PgHdr.pDirty pointer. This function writes each one of the
 43722  //  ** in-memory pages in the list to the database file. The argument may
 43723  //  ** be NULL, representing an empty list. In this case this function is
 43724  //  ** a no-op.
 43725  //  **
 43726  //  ** The pager must hold at least a RESERVED lock when this function
 43727  //  ** is called. Before writing anything to the database file, this lock
 43728  //  ** is upgraded to an EXCLUSIVE lock. If the lock cannot be obtained,
 43729  //  ** SQLITE_BUSY is returned and no data is written to the database file.
 43730  //  **
 43731  //  ** If the pager is a temp-file pager and the actual file-system file
 43732  //  ** is not yet open, it is created and opened before any data is
 43733  //  ** written out.
 43734  //  **
 43735  //  ** Once the lock has been upgraded and, if necessary, the file opened,
 43736  //  ** the pages are written out to the database file in list order. Writing
 43737  //  ** a page is skipped if it meets either of the following criteria:
 43738  //  **
 43739  //  **   * The page number is greater than Pager.dbSize, or
 43740  //  **   * The PGHDR_DONT_WRITE flag is set on the page.
 43741  //  **
 43742  //  ** If writing out a page causes the database file to grow, Pager.dbFileSize
 43743  //  ** is updated accordingly. If page 1 is written out, then the value cached
 43744  //  ** in Pager.dbFileVers[] is updated to match the new value stored in
 43745  //  ** the database file.
 43746  //  **
 43747  //  ** If everything is successful, SQLITE_OK is returned. If an IO error
 43748  //  ** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot
 43749  //  ** be obtained, SQLITE_BUSY is returned.
 43750  //  */
 43751  func _pager_write_pagelist(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr) (r0 int32) {
 43752  	var _rc int32
 43753  	var _2_szFile, _4_offset int64
 43754  	var _3_pgno uint32
 43755  	var _4_pData *int8
 43756  	_rc = int32(0)
 43757  	func() {
 43758  		if (*XWal)(_pPager.XpWal) != nil {
 43759  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51264), unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000), unsafe.Pointer(str(12123)))
 43760  			crt.X__builtin_abort(tls)
 43761  		}
 43762  	}()
 43763  	func() {
 43764  		if _pPager.XtempFile == 0 && int32(_pPager.XeState) != int32(4) {
 43765  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51265), unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000), unsafe.Pointer(str(56640)))
 43766  			crt.X__builtin_abort(tls)
 43767  		}
 43768  	}()
 43769  	func() {
 43770  		if int32(_pPager.XeLock) != int32(4) {
 43771  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51266), unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000), unsafe.Pointer(str(18843)))
 43772  			crt.X__builtin_abort(tls)
 43773  		}
 43774  	}()
 43775  	func() {
 43776  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && (*XPgHdr)(_pList.XpDirty) != nil {
 43777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51267), unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000), unsafe.Pointer(str(56695)))
 43778  			crt.X__builtin_abort(tls)
 43779  		}
 43780  	}()
 43781  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 43782  		func() {
 43783  			if _pPager.XtempFile == 0 || _rc != int32(0) {
 43784  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51274), unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000), unsafe.Pointer(str(56734)))
 43785  				crt.X__builtin_abort(tls)
 43786  			}
 43787  		}()
 43788  		_rc = _pagerOpentemp(tls, _pPager, (*Xsqlite3_file)(_pPager.Xfd), int32(_pPager.XvfsFlags))
 43789  	}
 43790  	func() {
 43791  		if _rc == int32(0) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 43792  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51281), unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000), unsafe.Pointer(str(56768)))
 43793  			crt.X__builtin_abort(tls)
 43794  		}
 43795  	}()
 43796  	if ((_rc == int32(0)) && (_pPager.XdbHintSize < _pPager.XdbSize)) && ((_pList.XpDirty != nil) || (_pList.Xpgno > _pPager.XdbHintSize)) {
 43797  		_2_szFile = int64(_pPager.XpageSize) * int64(_pPager.XdbSize)
 43798  		_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(5), unsafe.Pointer(&_2_szFile))
 43799  		_pPager.XdbHintSize = _pPager.XdbSize
 43800  	}
 43801  _20:
 43802  	if _rc != int32(0) || _pList == nil {
 43803  		goto _22
 43804  	}
 43805  	_3_pgno = _pList.Xpgno
 43806  	if _3_pgno > _pPager.XdbSize || int32(0) != (int32(_pList.Xflags)&int32(16)) {
 43807  		goto _25
 43808  	}
 43809  	_4_offset = int64(_3_pgno-uint32(1)) * int64(_pPager.XpageSize)
 43810  	func() {
 43811  		if (int32(_pList.Xflags) & int32(8)) != int32(0) {
 43812  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51306), unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000), unsafe.Pointer(str(56804)))
 43813  			crt.X__builtin_abort(tls)
 43814  		}
 43815  	}()
 43816  	if _pList.Xpgno == uint32(1) {
 43817  		_pager_write_changecounter(tls, _pList)
 43818  	}
 43819  	_4_pData = (*int8)(_pList.XpData)
 43820  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xfd), unsafe.Pointer(_4_pData), _pPager.XpageSize, _4_offset)
 43821  	if _3_pgno == uint32(1) {
 43822  		crt.Xmemcpy(tls, unsafe.Pointer(&_pPager.XdbFileVers), unsafe.Pointer(elem1(_4_pData, uintptr(24))), uint64(16))
 43823  	}
 43824  	if _3_pgno > _pPager.XdbFileSize {
 43825  		_pPager.XdbFileSize = _3_pgno
 43826  	}
 43827  	*elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), uintptr(2)) += 1
 43828  	_sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.XpBackup), _3_pgno, (*uint8)(_pList.XpData))
 43829  	goto _31
 43830  _25:
 43831  _31:
 43832  	_pList = (*XPgHdr)(_pList.XpDirty)
 43833  	goto _20
 43834  _22:
 43835  	return _rc
 43836  
 43837  	_ = _2_szFile
 43838  	panic(0)
 43839  }
 43840  
 43841  var _pager_write_pagelistØ00__func__Ø000 [21]int8
 43842  
 43843  func init() {
 43844  	crt.Xstrncpy(nil, &_pager_write_pagelistØ00__func__Ø000[0], str(56838), 21)
 43845  }
 43846  
 43847  // C comment
 43848  //  /*
 43849  //  ** Open a temporary file.
 43850  //  **
 43851  //  ** Write the file descriptor into *pFile. Return SQLITE_OK on success
 43852  //  ** or some other error code if we fail. The OS will automatically
 43853  //  ** delete the temporary file when it is closed.
 43854  //  **
 43855  //  ** The flags passed to the VFS layer xOpen() call are those specified
 43856  //  ** by parameter vfsFlags ORed with the following:
 43857  //  **
 43858  //  **     SQLITE_OPEN_READWRITE
 43859  //  **     SQLITE_OPEN_CREATE
 43860  //  **     SQLITE_OPEN_EXCLUSIVE
 43861  //  **     SQLITE_OPEN_DELETEONCLOSE
 43862  //  */
 43863  func _pagerOpentemp(tls *crt.TLS, _pPager *XPager, _pFile *Xsqlite3_file, _vfsFlags int32) (r0 int32) {
 43864  	var _rc int32
 43865  	_vfsFlags |= int32(30)
 43866  	_rc = _sqlite3OsOpen(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), nil, _pFile, _vfsFlags, nil)
 43867  	func() {
 43868  		if _rc == int32(0) && (*Xsqlite3_io_methods)(_pFile.XpMethods) == nil {
 43869  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50570), unsafe.Pointer(&_pagerOpentempØ00__func__Ø000), unsafe.Pointer(str(56859)))
 43870  			crt.X__builtin_abort(tls)
 43871  		}
 43872  	}()
 43873  	return _rc
 43874  }
 43875  
 43876  var _pagerOpentempØ00__func__Ø000 [14]int8
 43877  
 43878  func init() {
 43879  	crt.Xstrncpy(nil, &_pagerOpentempØ00__func__Ø000[0], str(56890), 14)
 43880  }
 43881  
 43882  // C comment
 43883  //  /*
 43884  //  ** Commit the transaction currently in progress.
 43885  //  **
 43886  //  ** This routine implements the second phase of a 2-phase commit.  The
 43887  //  ** sqlite3BtreeCommitPhaseOne() routine does the first phase and should
 43888  //  ** be invoked prior to calling this routine.  The sqlite3BtreeCommitPhaseOne()
 43889  //  ** routine did all the work of writing information out to disk and flushing the
 43890  //  ** contents so that they are written onto the disk platter.  All this
 43891  //  ** routine has to do is delete or truncate or zero the header in the
 43892  //  ** the rollback journal (which causes the transaction to commit) and
 43893  //  ** drop locks.
 43894  //  **
 43895  //  ** Normally, if an error occurs while the pager layer is attempting to
 43896  //  ** finalize the underlying journal file, this function returns an error and
 43897  //  ** the upper layer will attempt a rollback. However, if the second argument
 43898  //  ** is non-zero then this b-tree transaction is part of a multi-file
 43899  //  ** transaction. In this case, the transaction has already been committed
 43900  //  ** (by deleting a master journal file) and the caller will ignore this
 43901  //  ** functions return code. So, even if an error occurs in the pager layer,
 43902  //  ** reset the b-tree objects internal state to indicate that the write
 43903  //  ** transaction has been closed. This is quite safe, as the pager will have
 43904  //  ** transitioned to the error state.
 43905  //  **
 43906  //  ** This will release the write lock on the database file.  If there
 43907  //  ** are no active cursors, it also releases the read lock.
 43908  //  */
 43909  func _sqlite3BtreeCommitPhaseTwo(tls *crt.TLS, _p *XBtree, _bCleanup int32) (r0 int32) {
 43910  	var _1_rc int32
 43911  	var _1_pBt *XBtShared
 43912  	if int32(_p.XinTrans) == int32(0) {
 43913  		return int32(0)
 43914  	}
 43915  	_sqlite3BtreeEnter(tls, _p)
 43916  	func() {
 43917  		if int32((*XBtShared)(_p.XpBt).XinTransaction) == int32(0) && ((*XBtShared)(_p.XpBt).XnTransaction) != int32(0) {
 43918  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62924), unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(9932)))
 43919  			crt.X__builtin_abort(tls)
 43920  		}
 43921  	}()
 43922  	func() {
 43923  		if int32((*XBtShared)(_p.XpBt).XinTransaction) < int32(_p.XinTrans) {
 43924  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62924), unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(9993)))
 43925  			crt.X__builtin_abort(tls)
 43926  		}
 43927  	}()
 43928  	if int32(_p.XinTrans) != int32(2) {
 43929  		goto _6
 43930  	}
 43931  	_1_pBt = (*XBtShared)(_p.XpBt)
 43932  	func() {
 43933  		if int32(_1_pBt.XinTransaction) != int32(2) {
 43934  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62932), unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(56904)))
 43935  			crt.X__builtin_abort(tls)
 43936  		}
 43937  	}()
 43938  	func() {
 43939  		if _1_pBt.XnTransaction <= int32(0) {
 43940  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62933), unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(56936)))
 43941  			crt.X__builtin_abort(tls)
 43942  		}
 43943  	}()
 43944  	_1_rc = _sqlite3PagerCommitPhaseTwo(tls, (*XPager)(_1_pBt.XpPager))
 43945  	if (_1_rc != int32(0)) && (_bCleanup == int32(0)) {
 43946  		_sqlite3BtreeLeave(tls, _p)
 43947  		return _1_rc
 43948  	}
 43949  	_p.XiDataVersion -= 1
 43950  	_1_pBt.XinTransaction = uint8(1)
 43951  	_btreeClearHasContent(tls, _1_pBt)
 43952  _6:
 43953  	_btreeEndTransaction(tls, _p)
 43954  	_sqlite3BtreeLeave(tls, _p)
 43955  	return int32(0)
 43956  }
 43957  
 43958  var _sqlite3BtreeCommitPhaseTwoØ00__func__Ø000 [27]int8
 43959  
 43960  func init() {
 43961  	crt.Xstrncpy(nil, &_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000[0], str(56956), 27)
 43962  }
 43963  
 43964  // C comment
 43965  //  /*
 43966  //  ** When this function is called, the database file has been completely
 43967  //  ** updated to reflect the changes made by the current transaction and
 43968  //  ** synced to disk. The journal file still exists in the file-system
 43969  //  ** though, and if a failure occurs at this point it will eventually
 43970  //  ** be used as a hot-journal and the current transaction rolled back.
 43971  //  **
 43972  //  ** This function finalizes the journal file, either by deleting,
 43973  //  ** truncating or partially zeroing it, so that it cannot be used
 43974  //  ** for hot-journal rollback. Once this is done the transaction is
 43975  //  ** irrevocably committed.
 43976  //  **
 43977  //  ** If an error occurs, an IO error code is returned and the pager
 43978  //  ** moves into the error state. Otherwise, SQLITE_OK is returned.
 43979  //  */
 43980  func _sqlite3PagerCommitPhaseTwo(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 43981  	var _rc int32
 43982  	_rc = int32(0)
 43983  	if func() int32 {
 43984  		if _pPager.XerrCode != 0 {
 43985  			return func() int32 {
 43986  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53404), unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(4809)))
 43987  				crt.X__builtin_abort(tls)
 43988  				return int32(1)
 43989  			}()
 43990  		}
 43991  		return int32(0)
 43992  	}() != 0 {
 43993  		return _pPager.XerrCode
 43994  	}
 43995  	func() {
 43996  		if int32(_pPager.XeState) != int32(2) && int32(_pPager.XeState) != int32(5) && ((*XWal)(_pPager.XpWal) == nil || int32(_pPager.XeState) != int32(3)) {
 43997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53406), unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(56983)))
 43998  			crt.X__builtin_abort(tls)
 43999  		}
 44000  	}()
 44001  	func() {
 44002  		if _assert_pager_state(tls, _pPager) == 0 {
 44003  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53410), unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(10971)))
 44004  			crt.X__builtin_abort(tls)
 44005  		}
 44006  	}()
 44007  	if ((int32(_pPager.XeState) == int32(2)) && (_pPager.XexclusiveMode != 0)) && (int32(_pPager.XjournalMode) == int32(1)) {
 44008  		func() {
 44009  			if _pPager.XjournalOff != int64(_pPager.XsectorSize) && _pPager.XjournalOff != 0 {
 44010  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53427), unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(57126)))
 44011  				crt.X__builtin_abort(tls)
 44012  			}
 44013  		}()
 44014  		_pPager.XeState = uint8(1)
 44015  		return int32(0)
 44016  	}
 44017  	_pPager.XiDataVersion += 1
 44018  	_rc = _pager_end_transaction(tls, _pPager, int32(_pPager.XsetMaster), int32(1))
 44019  	return _pager_error(tls, _pPager, _rc)
 44020  }
 44021  
 44022  var _sqlite3PagerCommitPhaseTwoØ00__func__Ø000 [27]int8
 44023  
 44024  func init() {
 44025  	crt.Xstrncpy(nil, &_sqlite3PagerCommitPhaseTwoØ00__func__Ø000[0], str(57192), 27)
 44026  }
 44027  
 44028  // C comment
 44029  //  /*
 44030  //  ** Set the number of result columns that will be returned by this SQL
 44031  //  ** statement. This is now set at compile time, rather than during
 44032  //  ** execution of the vdbe program so that sqlite3_column_count() can
 44033  //  ** be called on an SQL statement before sqlite3_step().
 44034  //  */
 44035  func _sqlite3VdbeSetNumCols(tls *crt.TLS, _p *TVdbe, _nResColumn int32) {
 44036  	var _n int32
 44037  	var _db *Xsqlite3
 44038  	var _pColName *XMem
 44039  	_db = (*Xsqlite3)(_p.Xdb)
 44040  	_releaseMemArray(tls, (*XMem)(_p.XaColName), int32(_p.XnResColumn)*int32(2))
 44041  	_sqlite3DbFree(tls, _db, _p.XaColName)
 44042  	_n = _nResColumn * int32(2)
 44043  	_p.XnResColumn = uint16(_nResColumn)
 44044  	*(**XMem)(unsafe.Pointer(&_p.XaColName)) = store25(&_pColName, (*XMem)(_sqlite3DbMallocRawNN(tls, _db, uint64(72)*uint64(_n))))
 44045  	if (*XMem)(_p.XaColName) == nil {
 44046  		return
 44047  	}
 44048  	_initMemArray(tls, (*XMem)(_p.XaColName), _n, (*Xsqlite3)(_p.Xdb), uint16(1))
 44049  	_ = _pColName
 44050  }
 44051  
 44052  // C comment
 44053  //  /*
 44054  //  ** Release an array of N Mem elements
 44055  //  */
 44056  func _releaseMemArray(tls *crt.TLS, _p *XMem, _N int32) {
 44057  	var _1_db *Xsqlite3
 44058  	var _1_pEnd *XMem
 44059  	if _p == nil || _N == 0 {
 44060  		goto _1
 44061  	}
 44062  	_1_pEnd = elem25(_p, uintptr(_N))
 44063  	_1_db = (*Xsqlite3)(_p.Xdb)
 44064  	if _1_db.XpnBytesFreed == nil {
 44065  		goto _2
 44066  	}
 44067  _3:
 44068  	if _p.XszMalloc != 0 {
 44069  		_sqlite3DbFree(tls, _1_db, unsafe.Pointer(_p.XzMalloc))
 44070  	}
 44071  	if crt.P2U(unsafe.Pointer(preInc25(&_p, 72))) < crt.P2U(unsafe.Pointer(_1_pEnd)) {
 44072  		goto _3
 44073  	}
 44074  	return
 44075  _2:
 44076  	func() {
 44077  		if elem25(_p, uintptr(1)) != _1_pEnd && (*Xsqlite3)(elem25(_p, 0).Xdb) != (*Xsqlite3)(elem25(_p, uintptr(1)).Xdb) {
 44078  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72960), unsafe.Pointer(&_releaseMemArrayØ00__func__Ø000), unsafe.Pointer(str(57219)))
 44079  			crt.X__builtin_abort(tls)
 44080  		}
 44081  	}()
 44082  	func() {
 44083  		if _sqlite3VdbeCheckMemInvariants(tls, _p) == 0 {
 44084  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72961), unsafe.Pointer(&_releaseMemArrayØ00__func__Ø000), unsafe.Pointer(str(6078)))
 44085  			crt.X__builtin_abort(tls)
 44086  		}
 44087  	}()
 44088  	if (int32(_p.Xflags) & int32(9312)) != 0 {
 44089  		_sqlite3VdbeMemRelease(tls, _p)
 44090  		goto _13
 44091  	}
 44092  	if _p.XszMalloc != 0 {
 44093  		_sqlite3DbFreeNN(tls, _1_db, unsafe.Pointer(_p.XzMalloc))
 44094  		_p.XszMalloc = int32(0)
 44095  	}
 44096  _13:
 44097  	_p.Xflags = uint16(128)
 44098  	if crt.P2U(unsafe.Pointer(preInc25(&_p, 72))) < crt.P2U(unsafe.Pointer(_1_pEnd)) {
 44099  		goto _2
 44100  	}
 44101  _1:
 44102  }
 44103  
 44104  var _releaseMemArrayØ00__func__Ø000 [16]int8
 44105  
 44106  func init() {
 44107  	crt.Xstrncpy(nil, &_releaseMemArrayØ00__func__Ø000[0], str(57253), 16)
 44108  }
 44109  
 44110  // C comment
 44111  //  /*
 44112  //  ** Initialize an array of N Mem element.
 44113  //  */
 44114  func _initMemArray(tls *crt.TLS, _p *XMem, _N int32, _db *Xsqlite3, _flags uint16) {
 44115  _0:
 44116  	if postInc2(&_N, -1) > int32(0) {
 44117  		*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 44118  		_p.Xflags = _flags
 44119  		_p.XszMalloc = int32(0)
 44120  		*(**XMem)(unsafe.Pointer(&_p.XpScopyFrom)) = nil
 44121  		*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(72)
 44122  		goto _0
 44123  	}
 44124  }
 44125  
 44126  // C comment
 44127  //  /*
 44128  //  ** Set the name of the idx'th column to be returned by the SQL statement.
 44129  //  ** zName must be a pointer to a nul terminated string.
 44130  //  **
 44131  //  ** This call must be made after a call to sqlite3VdbeSetNumCols().
 44132  //  **
 44133  //  ** The final parameter, xDel, must be one of SQLITE_DYNAMIC, SQLITE_STATIC
 44134  //  ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed
 44135  //  ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed.
 44136  //  */
 44137  func _sqlite3VdbeSetColName(tls *crt.TLS, _p *TVdbe, _idx int32, _var int32, _zName *int8, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 44138  	var _rc int32
 44139  	var _pColName *XMem
 44140  	func() {
 44141  		if _idx >= int32(_p.XnResColumn) {
 44142  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73615), unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000), unsafe.Pointer(str(57269)))
 44143  			crt.X__builtin_abort(tls)
 44144  		}
 44145  	}()
 44146  	func() {
 44147  		if _var >= int32(2) {
 44148  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73616), unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000), unsafe.Pointer(str(57287)))
 44149  			crt.X__builtin_abort(tls)
 44150  		}
 44151  	}()
 44152  	if ((*Xsqlite3)(_p.Xdb).XmallocFailed) != 0 {
 44153  		func() {
 44154  			if _zName != nil && *(*uintptr)(unsafe.Pointer(&struct {
 44155  				f func(*crt.TLS, unsafe.Pointer)
 44156  			}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
 44157  				f func(*crt.TLS, unsafe.Pointer)
 44158  			}{func() func(*crt.TLS, unsafe.Pointer) {
 44159  				v := _sqlite3MallocSize
 44160  				return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 44161  			}()})) {
 44162  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73618), unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000), unsafe.Pointer(str(57301)))
 44163  				crt.X__builtin_abort(tls)
 44164  			}
 44165  		}()
 44166  		return _sqlite3NomemError(tls, int32(73619))
 44167  	}
 44168  	func() {
 44169  		if (*XMem)(_p.XaColName) == nil {
 44170  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73621), unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000), unsafe.Pointer(str(57332)))
 44171  			crt.X__builtin_abort(tls)
 44172  		}
 44173  	}()
 44174  	_pColName = elem25((*XMem)(_p.XaColName), uintptr(_idx+(_var*int32(_p.XnResColumn))))
 44175  	_rc = _sqlite3VdbeMemSetStr(tls, _pColName, _zName, int32(-1), uint8(1), _xDel)
 44176  	func() {
 44177  		if _rc == int32(0) && _zName != nil && (int32(_pColName.Xflags)&int32(512)) == int32(0) {
 44178  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73624), unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000), unsafe.Pointer(str(57347)))
 44179  			crt.X__builtin_abort(tls)
 44180  		}
 44181  	}()
 44182  	return _rc
 44183  }
 44184  
 44185  var _sqlite3VdbeSetColNameØ00__func__Ø000 [22]int8
 44186  
 44187  func init() {
 44188  	crt.Xstrncpy(nil, &_sqlite3VdbeSetColNameØ00__func__Ø000[0], str(57396), 22)
 44189  }
 44190  
 44191  var _sqlite3PrepareØ00azColNameØ001 [12]*int8
 44192  
 44193  func init() {
 44194  	_sqlite3PrepareØ00azColNameØ001 = [12]*int8{str(57418), str(57423), str(57430), str(57433), str(57436), str(57439), str(57442), str(57445), str(57453), str(57462), str(26325), str(57468)}
 44195  }
 44196  
 44197  // C comment
 44198  //  /*
 44199  //  ** Remember the SQL string for a prepared statement.
 44200  //  */
 44201  func _sqlite3VdbeSetSql(tls *crt.TLS, _p *TVdbe, _z *int8, _n int32, _isPrepareV2 int32) {
 44202  	func() {
 44203  		if _isPrepareV2 != int32(1) && _isPrepareV2 != int32(0) {
 44204  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71478), unsafe.Pointer(&_sqlite3VdbeSetSqlØ00__func__Ø000), unsafe.Pointer(str(57475)))
 44205  			crt.X__builtin_abort(tls)
 44206  		}
 44207  	}()
 44208  	if _p == nil {
 44209  		return
 44210  	}
 44211  	if _isPrepareV2 == 0 {
 44212  		_p.Xexpmask = 0
 44213  	}
 44214  	func() {
 44215  		if _p.XzSql != nil {
 44216  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71484), unsafe.Pointer(&_sqlite3VdbeSetSqlØ00__func__Ø000), unsafe.Pointer(str(57508)))
 44217  			crt.X__builtin_abort(tls)
 44218  		}
 44219  	}()
 44220  	_p.XzSql = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_p.Xdb), _z, uint64(_n))
 44221  	storebits26(&_p.Xexpired, int16(uint8(_isPrepareV2)), 512, 9)
 44222  }
 44223  
 44224  var _sqlite3VdbeSetSqlØ00__func__Ø000 [18]int8
 44225  
 44226  func init() {
 44227  	crt.Xstrncpy(nil, &_sqlite3VdbeSetSqlØ00__func__Ø000[0], str(57519), 18)
 44228  }
 44229  
 44230  // C comment
 44231  //  /*
 44232  //  ** Clean up and delete a VDBE after execution.  Return an integer which is
 44233  //  ** the result code.  Write any error message text into *pzErrMsg.
 44234  //  */
 44235  func _sqlite3VdbeFinalize(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 44236  	var _rc int32
 44237  	_rc = int32(0)
 44238  	if (_p.Xmagic == uint32(770837923)) || (_p.Xmagic == uint32(832317811)) {
 44239  		_rc = _sqlite3VdbeReset(tls, _p)
 44240  		func() {
 44241  			if (_rc & ((*Xsqlite3)(_p.Xdb).XerrMask)) != _rc {
 44242  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74365), unsafe.Pointer(&_sqlite3VdbeFinalizeØ00__func__Ø000), unsafe.Pointer(str(57537)))
 44243  				crt.X__builtin_abort(tls)
 44244  			}
 44245  		}()
 44246  	}
 44247  	_sqlite3VdbeDelete(tls, _p)
 44248  	return _rc
 44249  }
 44250  
 44251  // C comment
 44252  //  /*
 44253  //  ** Clean up a VDBE after execution but do not delete the VDBE just yet.
 44254  //  ** Write any error messages into *pzErrMsg.  Return the result code.
 44255  //  **
 44256  //  ** After this routine is run, the VDBE should be ready to be executed
 44257  //  ** again.
 44258  //  **
 44259  //  ** To look at it another way, this routine resets the state of the
 44260  //  ** virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to
 44261  //  ** VDBE_MAGIC_INIT.
 44262  //  */
 44263  func _sqlite3VdbeReset(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 44264  	var _db *Xsqlite3
 44265  	_db = (*Xsqlite3)(_p.Xdb)
 44266  	_sqlite3VdbeHalt(tls, _p)
 44267  	if _p.Xpc < int32(0) {
 44268  		goto _0
 44269  	}
 44270  	_sqlite3VdbeTransferError(tls, _p)
 44271  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzErrMsg))
 44272  	_p.XzErrMsg = nil
 44273  	if ((uint32(_p.Xexpired>>5) << 31) >> 31) != 0 {
 44274  		storebits26(&_p.Xexpired, int16(1), 1, 0)
 44275  	}
 44276  	goto _4
 44277  _0:
 44278  	if _p.Xrc != 0 && (((uint32(_p.Xexpired) << 31) >> 31) != 0) {
 44279  		_sqlite3ErrorWithMsg(tls, _db, _p.Xrc, func() *int8 {
 44280  			if _p.XzErrMsg != nil {
 44281  				return str(24531)
 44282  			}
 44283  			return nil
 44284  		}(), unsafe.Pointer(_p.XzErrMsg))
 44285  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzErrMsg))
 44286  		_p.XzErrMsg = nil
 44287  	}
 44288  _4:
 44289  	_Cleanup(tls, _p)
 44290  	_p.Xmagic = uint32(1224384374)
 44291  	return _p.Xrc & _db.XerrMask
 44292  }
 44293  
 44294  // C comment
 44295  //  /*
 44296  //  ** This routine is called the when a VDBE tries to halt.  If the VDBE
 44297  //  ** has made changes and is in autocommit mode, then commit those
 44298  //  ** changes.  If a rollback is needed, then do the rollback.
 44299  //  **
 44300  //  ** This routine is the only way to move the state of a VM from
 44301  //  ** SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT.  It is harmless to
 44302  //  ** call this on a VM that is in the SQLITE_MAGIC_HALT state.
 44303  //  **
 44304  //  ** Return an error code.  If the commit could not complete because of
 44305  //  ** lock contention, return SQLITE_BUSY.  If SQLITE_BUSY is returned, it
 44306  //  ** means the close did not happen and needs to be repeated.
 44307  //  */
 44308  func _sqlite3VdbeHalt(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 44309  	var _rc, _3_mrc, _3_eStatementOp, _3_isSpecialError int32
 44310  	var _db *Xsqlite3
 44311  	_db = (*Xsqlite3)(_p.Xdb)
 44312  	if _p.Xmagic != uint32(770837923) {
 44313  		return int32(0)
 44314  	}
 44315  	if _db.XmallocFailed != 0 {
 44316  		_p.Xrc = _sqlite3NomemError(tls, int32(74044))
 44317  	}
 44318  	_closeAllCursors(tls, _p)
 44319  	_checkActiveVdbeCnt(tls, _db)
 44320  	if _p.Xpc < int32(0) || ((uint32(_p.Xexpired>>8)<<31)>>31) == 0 {
 44321  		goto _3
 44322  	}
 44323  	_3_eStatementOp = int32(0)
 44324  	_sqlite3VdbeEnter(tls, _p)
 44325  	_3_mrc = _p.Xrc & int32(255)
 44326  	_3_isSpecialError = bool2int((((_3_mrc == int32(7)) || (_3_mrc == int32(10))) || (_3_mrc == int32(9))) || (_3_mrc == int32(13)))
 44327  	if _3_isSpecialError == 0 {
 44328  		goto _7
 44329  	}
 44330  	if ((uint32(_p.Xexpired>>7)<<31)>>31) != 0 && _3_mrc == int32(9) {
 44331  		goto _9
 44332  	}
 44333  	if ((_3_mrc == int32(7)) || (_3_mrc == int32(13))) && (((uint32(_p.Xexpired>>6) << 31) >> 31) != 0) {
 44334  		_3_eStatementOp = int32(2)
 44335  		goto _13
 44336  	}
 44337  	_sqlite3RollbackAll(tls, _db, int32(516))
 44338  	_sqlite3CloseSavepoints(tls, _db)
 44339  	_db.XautoCommit = uint8(1)
 44340  	_p.XnChange = int32(0)
 44341  _13:
 44342  _9:
 44343  _7:
 44344  	if _p.Xrc == int32(0) {
 44345  		_sqlite3VdbeCheckFk(tls, _p, int32(0))
 44346  	}
 44347  	if _db.XnVTrans > int32(0) && (**XVTable)(unsafe.Pointer(_db.XaVTrans)) == nil || _db.XautoCommit == 0 || _db.XnVdbeWrite != bool2int(int32((uint32(_p.Xexpired>>7)<<31)>>31) == int32(0)) {
 44348  		goto _18
 44349  	}
 44350  	if _p.Xrc != int32(0) && (int32(_p.XerrorAction) != int32(3) || _3_isSpecialError != 0) {
 44351  		goto _21
 44352  	}
 44353  	_rc = _sqlite3VdbeCheckFk(tls, _p, int32(1))
 44354  	if _rc == int32(0) {
 44355  		goto _22
 44356  	}
 44357  	if func() int32 {
 44358  		if ((uint32(_p.Xexpired>>7) << 31) >> 31) != 0 {
 44359  			return func() int32 {
 44360  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74109), unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000), unsafe.Pointer(str(4809)))
 44361  				crt.X__builtin_abort(tls)
 44362  				return int32(1)
 44363  			}()
 44364  		}
 44365  		return int32(0)
 44366  	}() != 0 {
 44367  		_sqlite3VdbeLeave(tls, _p)
 44368  		return int32(1)
 44369  	}
 44370  	_rc = int32(787)
 44371  	goto _26
 44372  _22:
 44373  	_rc = _vdbeCommit(tls, _db, _p)
 44374  _26:
 44375  	if (_rc == int32(5)) && (((uint32(_p.Xexpired>>7) << 31) >> 31) != 0) {
 44376  		_sqlite3VdbeLeave(tls, _p)
 44377  		return int32(5)
 44378  	}
 44379  	if _rc != int32(0) {
 44380  		_p.Xrc = _rc
 44381  		_sqlite3RollbackAll(tls, _db, int32(0))
 44382  		_p.XnChange = int32(0)
 44383  		goto _31
 44384  	}
 44385  	_db.XnDeferredCons = 0
 44386  	_db.XnDeferredImmCons = 0
 44387  	_db.Xflags &= int32(-33554433)
 44388  	_sqlite3CommitInternalChanges(tls, _db)
 44389  _31:
 44390  	goto _32
 44391  _21:
 44392  	_sqlite3RollbackAll(tls, _db, int32(0))
 44393  	_p.XnChange = int32(0)
 44394  _32:
 44395  	_db.XnStatement = int32(0)
 44396  	goto _34
 44397  _18:
 44398  	if _3_eStatementOp != int32(0) {
 44399  		goto _34
 44400  	}
 44401  	if (_p.Xrc == int32(0)) || (int32(_p.XerrorAction) == int32(3)) {
 44402  		_3_eStatementOp = int32(1)
 44403  		goto _39
 44404  	}
 44405  	if int32(_p.XerrorAction) == int32(2) {
 44406  		_3_eStatementOp = int32(2)
 44407  		goto _39
 44408  	}
 44409  	_sqlite3RollbackAll(tls, _db, int32(516))
 44410  	_sqlite3CloseSavepoints(tls, _db)
 44411  	_db.XautoCommit = uint8(1)
 44412  	_p.XnChange = int32(0)
 44413  _39:
 44414  _34:
 44415  	if _3_eStatementOp == 0 {
 44416  		goto _40
 44417  	}
 44418  	_rc = _sqlite3VdbeCloseStatement(tls, _p, _3_eStatementOp)
 44419  	if _rc == 0 {
 44420  		goto _41
 44421  	}
 44422  	if (_p.Xrc == int32(0)) || ((_p.Xrc & int32(255)) == int32(19)) {
 44423  		_p.Xrc = _rc
 44424  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzErrMsg))
 44425  		_p.XzErrMsg = nil
 44426  	}
 44427  	_sqlite3RollbackAll(tls, _db, int32(516))
 44428  	_sqlite3CloseSavepoints(tls, _db)
 44429  	_db.XautoCommit = uint8(1)
 44430  	_p.XnChange = int32(0)
 44431  _41:
 44432  _40:
 44433  	if ((uint32(_p.Xexpired>>4) << 31) >> 31) == 0 {
 44434  		goto _44
 44435  	}
 44436  	if _3_eStatementOp != int32(2) {
 44437  		_sqlite3VdbeSetChanges(tls, _db, _p.XnChange)
 44438  		goto _46
 44439  	}
 44440  	_sqlite3VdbeSetChanges(tls, _db, int32(0))
 44441  _46:
 44442  	_p.XnChange = int32(0)
 44443  _44:
 44444  	_sqlite3VdbeLeave(tls, _p)
 44445  _3:
 44446  	if _p.Xpc < int32(0) {
 44447  		goto _47
 44448  	}
 44449  	_db.XnVdbeActive -= 1
 44450  	if ((uint32(_p.Xexpired>>7) << 31) >> 31) == 0 {
 44451  		_db.XnVdbeWrite -= 1
 44452  	}
 44453  	if ((uint32(_p.Xexpired>>8) << 31) >> 31) != 0 {
 44454  		_db.XnVdbeRead -= 1
 44455  	}
 44456  	func() {
 44457  		if _db.XnVdbeActive < _db.XnVdbeRead {
 44458  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74194), unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000), unsafe.Pointer(str(57563)))
 44459  			crt.X__builtin_abort(tls)
 44460  		}
 44461  	}()
 44462  	func() {
 44463  		if _db.XnVdbeRead < _db.XnVdbeWrite {
 44464  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74195), unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000), unsafe.Pointer(str(57594)))
 44465  			crt.X__builtin_abort(tls)
 44466  		}
 44467  	}()
 44468  	func() {
 44469  		if _db.XnVdbeWrite < int32(0) {
 44470  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74196), unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000), unsafe.Pointer(str(57624)))
 44471  			crt.X__builtin_abort(tls)
 44472  		}
 44473  	}()
 44474  _47:
 44475  	_p.Xmagic = uint32(832317811)
 44476  	_checkActiveVdbeCnt(tls, _db)
 44477  	if _db.XmallocFailed != 0 {
 44478  		_p.Xrc = _sqlite3NomemError(tls, int32(74201))
 44479  	}
 44480  	if _db.XautoCommit != 0 {
 44481  	}
 44482  	func() {
 44483  		if _db.XnVdbeActive <= int32(0) && int32(_db.XautoCommit) != int32(0) && _db.XnStatement != int32(0) {
 44484  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74212), unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000), unsafe.Pointer(str(57642)))
 44485  			crt.X__builtin_abort(tls)
 44486  		}
 44487  	}()
 44488  	return func() int32 {
 44489  		if _p.Xrc == int32(5) {
 44490  			return int32(5)
 44491  		}
 44492  		return int32(0)
 44493  	}()
 44494  }
 44495  
 44496  // C comment
 44497  //  /*
 44498  //  ** Close all cursors.
 44499  //  **
 44500  //  ** Also release any dynamic memory held by the VM in the Vdbe.aMem memory
 44501  //  ** cell array. This is necessary as the memory cell array may contain
 44502  //  ** pointers to VdbeFrame objects, which may in turn contain pointers to
 44503  //  ** open cursors.
 44504  //  */
 44505  func _closeAllCursors(tls *crt.TLS, _p *TVdbe) {
 44506  	var _1_pFrame, _3_pDel *XVdbeFrame
 44507  	if _p.XpFrame == nil {
 44508  		goto _0
 44509  	}
 44510  	_1_pFrame = (*XVdbeFrame)(_p.XpFrame)
 44511  _1:
 44512  	if _1_pFrame.XpParent == nil {
 44513  		goto _4
 44514  	}
 44515  	_1_pFrame = (*XVdbeFrame)(_1_pFrame.XpParent)
 44516  	goto _1
 44517  _4:
 44518  	_sqlite3VdbeFrameRestore(tls, _1_pFrame)
 44519  	*(**XVdbeFrame)(unsafe.Pointer(&_p.XpFrame)) = nil
 44520  	_p.XnFrame = int32(0)
 44521  _0:
 44522  	func() {
 44523  		if _p.XnFrame != int32(0) {
 44524  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73539), unsafe.Pointer(&_closeAllCursorsØ00__func__Ø000), unsafe.Pointer(str(57702)))
 44525  			crt.X__builtin_abort(tls)
 44526  		}
 44527  	}()
 44528  	_closeCursorsInFrame(tls, _p)
 44529  	if _p.XaMem != nil {
 44530  		_releaseMemArray(tls, (*XMem)(_p.XaMem), _p.XnMem)
 44531  	}
 44532  _7:
 44533  	if _p.XpDelFrame != nil {
 44534  		_3_pDel = (*XVdbeFrame)(_p.XpDelFrame)
 44535  		*(**XVdbeFrame)(unsafe.Pointer(&_p.XpDelFrame)) = (*XVdbeFrame)(_3_pDel.XpParent)
 44536  		_sqlite3VdbeFrameDelete(tls, _3_pDel)
 44537  		goto _7
 44538  	}
 44539  	if _p.XpAuxData != nil {
 44540  		_sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)(_p.Xdb), (**XAuxData)(unsafe.Pointer(&_p.XpAuxData)), int32(-1), int32(0))
 44541  	}
 44542  	func() {
 44543  		if (*XAuxData)(_p.XpAuxData) != nil {
 44544  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73552), unsafe.Pointer(&_closeAllCursorsØ00__func__Ø000), unsafe.Pointer(str(57715)))
 44545  			crt.X__builtin_abort(tls)
 44546  		}
 44547  	}()
 44548  }
 44549  
 44550  // C comment
 44551  //  /*
 44552  //  ** Copy the values stored in the VdbeFrame structure to its Vdbe. This
 44553  //  ** is used, for example, when a trigger sub-program is halted to restore
 44554  //  ** control to the main program.
 44555  //  */
 44556  func _sqlite3VdbeFrameRestore(tls *crt.TLS, _pFrame *XVdbeFrame) (r0 int32) {
 44557  	var _v *TVdbe
 44558  	_v = (*TVdbe)(_pFrame.Xv)
 44559  	_closeCursorsInFrame(tls, _v)
 44560  	*(**XVdbeOp)(unsafe.Pointer(&_v.XaOp)) = (*XVdbeOp)(_pFrame.XaOp)
 44561  	_v.XnOp = _pFrame.XnOp
 44562  	*(**XMem)(unsafe.Pointer(&_v.XaMem)) = (*XMem)(_pFrame.XaMem)
 44563  	_v.XnMem = _pFrame.XnMem
 44564  	*(***XVdbeCursor)(unsafe.Pointer(&_v.XapCsr)) = (**XVdbeCursor)(unsafe.Pointer(_pFrame.XapCsr))
 44565  	_v.XnCursor = _pFrame.XnCursor
 44566  	(*Xsqlite3)(_v.Xdb).XlastRowid = _pFrame.XlastRowid
 44567  	_v.XnChange = _pFrame.XnChange
 44568  	(*Xsqlite3)(_v.Xdb).XnChange = _pFrame.XnDbChange
 44569  	_sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)(_v.Xdb), (**XAuxData)(unsafe.Pointer(&_v.XpAuxData)), int32(-1), int32(0))
 44570  	*(**XAuxData)(unsafe.Pointer(&_v.XpAuxData)) = (*XAuxData)(_pFrame.XpAuxData)
 44571  	*(**XAuxData)(unsafe.Pointer(&_pFrame.XpAuxData)) = nil
 44572  	return _pFrame.Xpc
 44573  }
 44574  
 44575  // C comment
 44576  //  /*
 44577  //  ** Close all cursors in the current frame.
 44578  //  */
 44579  func _closeCursorsInFrame(tls *crt.TLS, _p *TVdbe) {
 44580  	var _1_i int32
 44581  	var _2_pC *XVdbeCursor
 44582  	if _p.XapCsr == nil {
 44583  		goto _0
 44584  	}
 44585  	_1_i = int32(0)
 44586  _1:
 44587  	if _1_i >= _p.XnCursor {
 44588  		goto _4
 44589  	}
 44590  	_2_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_1_i))
 44591  	if _2_pC != nil {
 44592  		_sqlite3VdbeFreeCursor(tls, _p, _2_pC)
 44593  		*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_1_i)) = nil
 44594  	}
 44595  	_1_i += 1
 44596  	goto _1
 44597  _4:
 44598  _0:
 44599  }
 44600  
 44601  // C comment
 44602  //  /*
 44603  //  ** Close a VDBE cursor and release all the resources that cursor
 44604  //  ** happens to hold.
 44605  //  */
 44606  func _sqlite3VdbeFreeCursor(tls *crt.TLS, _p *TVdbe, _pCx *XVdbeCursor) {
 44607  	var _7_pVCur *Xsqlite3_vtab_cursor
 44608  	var _7_pModule *Xsqlite3_module
 44609  	if _pCx == nil {
 44610  		return
 44611  	}
 44612  	func() {
 44613  		if (*XBtree)(_pCx.XpBtx) != nil && int32(_pCx.XeCurType) != int32(0) {
 44614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73451), unsafe.Pointer(&_sqlite3VdbeFreeCursorØ00__func__Ø000), unsafe.Pointer(str(57730)))
 44615  			crt.X__builtin_abort(tls)
 44616  		}
 44617  	}()
 44618  	switch int32(_pCx.XeCurType) {
 44619  	case int32(0):
 44620  		goto _6
 44621  	case int32(1):
 44622  		goto _5
 44623  	case int32(2):
 44624  		goto _7
 44625  	default:
 44626  		goto _8
 44627  	}
 44628  
 44629  _5:
 44630  	_sqlite3VdbeSorterClose(tls, (*Xsqlite3)(_p.Xdb), _pCx)
 44631  	goto _8
 44632  _6:
 44633  	if ((uint32(_pCx.XisEphemeral) << 31) >> 31) == 0 {
 44634  		goto _9
 44635  	}
 44636  	if _pCx.XpBtx != nil {
 44637  		_sqlite3BtreeClose(tls, (*XBtree)(_pCx.XpBtx))
 44638  	}
 44639  	goto _11
 44640  _9:
 44641  	func() {
 44642  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc))) == nil {
 44643  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73463), unsafe.Pointer(&_sqlite3VdbeFreeCursorØ00__func__Ø000), unsafe.Pointer(str(57775)))
 44644  			crt.X__builtin_abort(tls)
 44645  		}
 44646  	}()
 44647  	_sqlite3BtreeCloseCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc))))
 44648  _11:
 44649  	goto _8
 44650  _7:
 44651  	_7_pVCur = (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc)))
 44652  	_7_pModule = (*Xsqlite3_module)((*Xsqlite3_vtab)(_7_pVCur.XpVtab).XpModule)
 44653  	func() {
 44654  		if ((*Xsqlite3_vtab)(_7_pVCur.XpVtab).XnRef) <= int32(0) {
 44655  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73472), unsafe.Pointer(&_sqlite3VdbeFreeCursorØ00__func__Ø000), unsafe.Pointer(str(57794)))
 44656  			crt.X__builtin_abort(tls)
 44657  		}
 44658  	}()
 44659  	(*Xsqlite3_vtab)(_7_pVCur.XpVtab).XnRef -= 1
 44660  	func() func(*crt.TLS, *Xsqlite3_vtab_cursor) int32 {
 44661  		v := _7_pModule.XxClose
 44662  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 44663  	}()(tls, _7_pVCur)
 44664  	goto _8
 44665  _8:
 44666  }
 44667  
 44668  var _sqlite3VdbeFreeCursorØ00__func__Ø000 [22]int8
 44669  
 44670  func init() {
 44671  	crt.Xstrncpy(nil, &_sqlite3VdbeFreeCursorØ00__func__Ø000[0], str(57815), 22)
 44672  }
 44673  
 44674  // C comment
 44675  //  /*
 44676  //  ** Free any cursor components allocated by sqlite3VdbeSorterXXX routines.
 44677  //  */
 44678  func _sqlite3VdbeSorterClose(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor) {
 44679  	var _pSorter *XVdbeSorter
 44680  	func() {
 44681  		if int32(_pCsr.XeCurType) != int32(1) {
 44682  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87275), unsafe.Pointer(&_sqlite3VdbeSorterCloseØ00__func__Ø000), unsafe.Pointer(str(57837)))
 44683  			crt.X__builtin_abort(tls)
 44684  		}
 44685  	}()
 44686  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 44687  	if _pSorter != nil {
 44688  		_sqlite3VdbeSorterReset(tls, _db, _pSorter)
 44689  		Xsqlite3_free(tls, unsafe.Pointer(_pSorter.Xlist.XaMemory))
 44690  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSorter))
 44691  		*(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))) = nil
 44692  	}
 44693  }
 44694  
 44695  var _sqlite3VdbeSorterCloseØ00__func__Ø000 [23]int8
 44696  
 44697  func init() {
 44698  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterCloseØ00__func__Ø000[0], str(57868), 23)
 44699  }
 44700  
 44701  // C comment
 44702  //  /*
 44703  //  ** Reset a sorting cursor back to its original empty state.
 44704  //  */
 44705  func _sqlite3VdbeSorterReset(tls *crt.TLS, _db *Xsqlite3, _pSorter *XVdbeSorter) {
 44706  	var _i int32
 44707  	var _2_pTask *XSortSubtask
 44708  	_vdbeSorterJoinAll(tls, _pSorter, int32(0))
 44709  	func() {
 44710  		if _pSorter.XbUseThreads == 0 && (*XPmaReader)(_pSorter.XpReader) != nil {
 44711  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87243), unsafe.Pointer(&_sqlite3VdbeSorterResetØ00__func__Ø000), unsafe.Pointer(str(57891)))
 44712  			crt.X__builtin_abort(tls)
 44713  		}
 44714  	}()
 44715  	if _pSorter.XpReader != nil {
 44716  		_vdbePmaReaderClear(tls, (*XPmaReader)(_pSorter.XpReader))
 44717  		_sqlite3DbFree(tls, _db, _pSorter.XpReader)
 44718  		*(**XPmaReader)(unsafe.Pointer(&_pSorter.XpReader)) = nil
 44719  	}
 44720  	_vdbeMergeEngineFree(tls, (*XMergeEngine)(_pSorter.XpMerger))
 44721  	*(**XMergeEngine)(unsafe.Pointer(&_pSorter.XpMerger)) = nil
 44722  	_i = int32(0)
 44723  _4:
 44724  	if _i >= int32(_pSorter.XnTask) {
 44725  		goto _7
 44726  	}
 44727  	_2_pTask = elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_i))
 44728  	_vdbeSortSubtaskCleanup(tls, _db, _2_pTask)
 44729  	*(**XVdbeSorter)(unsafe.Pointer(&_2_pTask.XpSorter)) = _pSorter
 44730  	_i += 1
 44731  	goto _4
 44732  _7:
 44733  	if (_pSorter.Xlist.XaMemory) == nil {
 44734  		_vdbeSorterRecordFree(tls, nil, (*XSorterRecord)(_pSorter.Xlist.XpList))
 44735  	}
 44736  	*(**XSorterRecord)(unsafe.Pointer(&(_pSorter.Xlist.XpList))) = nil
 44737  	_pSorter.Xlist.XszPMA = int32(0)
 44738  	_pSorter.XbUsePMA = 0
 44739  	_pSorter.XiMemory = int32(0)
 44740  	_pSorter.XmxKeysize = int32(0)
 44741  	_sqlite3DbFree(tls, _db, _pSorter.XpUnpacked)
 44742  	*(**XUnpackedRecord)(unsafe.Pointer(&_pSorter.XpUnpacked)) = nil
 44743  }
 44744  
 44745  // C comment
 44746  //  /*
 44747  //  ** Join all outstanding threads launched by SorterWrite() to create
 44748  //  ** level-0 PMAs.
 44749  //  */
 44750  func _vdbeSorterJoinAll(tls *crt.TLS, _pSorter *XVdbeSorter, _rcin int32) (r0 int32) {
 44751  	var _rc, _i, _1_rc2 int32
 44752  	var _1_pTask *XSortSubtask
 44753  	_rc = _rcin
 44754  	_i = int32(_pSorter.XnTask) - int32(1)
 44755  _0:
 44756  	if _i < int32(0) {
 44757  		goto _3
 44758  	}
 44759  	_1_pTask = elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_i))
 44760  	_1_rc2 = _vdbeSorterJoinThread(tls, _1_pTask)
 44761  	if _rc == int32(0) {
 44762  		_rc = _1_rc2
 44763  	}
 44764  	_i -= 1
 44765  	goto _0
 44766  _3:
 44767  	return _rc
 44768  }
 44769  
 44770  // C comment
 44771  //  /*
 44772  //  ** Join thread pTask->thread.
 44773  //  */
 44774  func _vdbeSorterJoinThread(tls *crt.TLS, _pTask *XSortSubtask) (r0 int32) {
 44775  	var _rc int32
 44776  	var _1_pRet unsafe.Pointer
 44777  	_rc = int32(0)
 44778  	if _pTask.XpThread != nil {
 44779  		_1_pRet = crt.U2P(1)
 44780  		_sqlite3ThreadJoin(tls, (*XSQLiteThread)(_pTask.XpThread), &_1_pRet)
 44781  		_rc = int32(int64(crt.P2U(_1_pRet)))
 44782  		func() {
 44783  			if _pTask.XbDone != int32(1) {
 44784  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87133), unsafe.Pointer(&_vdbeSorterJoinThreadØ00__func__Ø000), unsafe.Pointer(str(57935)))
 44785  				crt.X__builtin_abort(tls)
 44786  			}
 44787  		}()
 44788  		_pTask.XbDone = int32(0)
 44789  		*(**XSQLiteThread)(unsafe.Pointer(&_pTask.XpThread)) = nil
 44790  	}
 44791  	return _rc
 44792  }
 44793  
 44794  // C comment
 44795  //  /* Get the results of the thread */
 44796  func _sqlite3ThreadJoin(tls *crt.TLS, _p *XSQLiteThread, _ppOut *unsafe.Pointer) (r0 int32) {
 44797  	var _rc int32
 44798  	func() {
 44799  		if _ppOut == nil {
 44800  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26937), unsafe.Pointer(&_sqlite3ThreadJoinØ00__func__Ø000), unsafe.Pointer(str(57951)))
 44801  			crt.X__builtin_abort(tls)
 44802  		}
 44803  	}()
 44804  	if func() int32 {
 44805  		if _p == nil {
 44806  			return func() int32 {
 44807  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26938), unsafe.Pointer(&_sqlite3ThreadJoinØ00__func__Ø000), unsafe.Pointer(str(4809)))
 44808  				crt.X__builtin_abort(tls)
 44809  				return int32(1)
 44810  			}()
 44811  		}
 44812  		return int32(0)
 44813  	}() != 0 {
 44814  		return _sqlite3NomemError(tls, int32(26938))
 44815  	}
 44816  	if _p.Xdone != 0 {
 44817  		*_ppOut = _p.XpOut
 44818  		_rc = int32(0)
 44819  		goto _6
 44820  	}
 44821  	_rc = func() int32 {
 44822  		if crt.Xpthread_join(tls, _p.Xtid, _ppOut) != 0 {
 44823  			return int32(1)
 44824  		}
 44825  		return int32(0)
 44826  	}()
 44827  _6:
 44828  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 44829  	return _rc
 44830  }
 44831  
 44832  var _sqlite3ThreadJoinØ00__func__Ø000 [18]int8
 44833  
 44834  func init() {
 44835  	crt.Xstrncpy(nil, &_sqlite3ThreadJoinØ00__func__Ø000[0], str(57960), 18)
 44836  }
 44837  
 44838  var _vdbeSorterJoinThreadØ00__func__Ø000 [21]int8
 44839  
 44840  func init() {
 44841  	crt.Xstrncpy(nil, &_vdbeSorterJoinThreadØ00__func__Ø000[0], str(57978), 21)
 44842  }
 44843  
 44844  var _sqlite3VdbeSorterResetØ00__func__Ø000 [23]int8
 44845  
 44846  func init() {
 44847  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterResetØ00__func__Ø000[0], str(57999), 23)
 44848  }
 44849  
 44850  // C comment
 44851  //  /*
 44852  //  ** Free all memory belonging to the PmaReader object passed as the
 44853  //  ** argument. All structure fields are set to zero before returning.
 44854  //  */
 44855  func _vdbePmaReaderClear(tls *crt.TLS, _pReadr *XPmaReader) {
 44856  	Xsqlite3_free(tls, unsafe.Pointer(_pReadr.XaAlloc))
 44857  	Xsqlite3_free(tls, unsafe.Pointer(_pReadr.XaBuffer))
 44858  	if _pReadr.XaMap != nil {
 44859  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pReadr.XpFd), 0, unsafe.Pointer(_pReadr.XaMap))
 44860  	}
 44861  	_vdbeIncrFree(tls, (*XIncrMerger)(_pReadr.XpIncr))
 44862  	crt.Xmemset(tls, unsafe.Pointer(_pReadr), int32(0), uint64(80))
 44863  }
 44864  
 44865  // C comment
 44866  //  /*
 44867  //  ** Free all resources associated with the IncrMerger object indicated by
 44868  //  ** the first argument.
 44869  //  */
 44870  func _vdbeIncrFree(tls *crt.TLS, _pIncr *XIncrMerger) {
 44871  	if _pIncr == nil {
 44872  		goto _0
 44873  	}
 44874  	if _pIncr.XbUseThread == 0 {
 44875  		goto _1
 44876  	}
 44877  	_vdbeSorterJoinThread(tls, (*XSortSubtask)(_pIncr.XpTask))
 44878  	if (elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0).XpFd) != nil {
 44879  		_sqlite3OsCloseFree(tls, (*Xsqlite3_file)(elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0).XpFd))
 44880  	}
 44881  	if (elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1)).XpFd) != nil {
 44882  		_sqlite3OsCloseFree(tls, (*Xsqlite3_file)(elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1)).XpFd))
 44883  	}
 44884  _1:
 44885  	_vdbeMergeEngineFree(tls, (*XMergeEngine)(_pIncr.XpMerger))
 44886  	Xsqlite3_free(tls, unsafe.Pointer(_pIncr))
 44887  _0:
 44888  }
 44889  
 44890  func _sqlite3OsCloseFree(tls *crt.TLS, _pFile *Xsqlite3_file) {
 44891  	func() {
 44892  		if _pFile == nil {
 44893  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20383), unsafe.Pointer(&_sqlite3OsCloseFreeØ00__func__Ø000), unsafe.Pointer(str(58022)))
 44894  			crt.X__builtin_abort(tls)
 44895  		}
 44896  	}()
 44897  	_sqlite3OsClose(tls, _pFile)
 44898  	Xsqlite3_free(tls, unsafe.Pointer(_pFile))
 44899  }
 44900  
 44901  var _sqlite3OsCloseFreeØ00__func__Ø000 [19]int8
 44902  
 44903  func init() {
 44904  	crt.Xstrncpy(nil, &_sqlite3OsCloseFreeØ00__func__Ø000[0], str(58028), 19)
 44905  }
 44906  
 44907  // C comment
 44908  //  /*
 44909  //  ** Free the MergeEngine object passed as the only argument.
 44910  //  */
 44911  func _vdbeMergeEngineFree(tls *crt.TLS, _pMerger *XMergeEngine) {
 44912  	var _i int32
 44913  	if _pMerger == nil {
 44914  		goto _0
 44915  	}
 44916  	_i = int32(0)
 44917  _1:
 44918  	if _i >= _pMerger.XnTree {
 44919  		goto _4
 44920  	}
 44921  	_vdbePmaReaderClear(tls, elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(_i)))
 44922  	_i += 1
 44923  	goto _1
 44924  _4:
 44925  _0:
 44926  	Xsqlite3_free(tls, unsafe.Pointer(_pMerger))
 44927  }
 44928  
 44929  // C comment
 44930  //  /*
 44931  //  ** Free all resources owned by the object indicated by argument pTask. All
 44932  //  ** fields of *pTask are zeroed before returning.
 44933  //  */
 44934  func _vdbeSortSubtaskCleanup(tls *crt.TLS, _db *Xsqlite3, _pTask *XSortSubtask) {
 44935  	_sqlite3DbFree(tls, _db, _pTask.XpUnpacked)
 44936  	if (_pTask.Xlist.XaMemory) != nil {
 44937  		Xsqlite3_free(tls, unsafe.Pointer(_pTask.Xlist.XaMemory))
 44938  		goto _1
 44939  	}
 44940  	func() {
 44941  		if (_pTask.Xlist.XaMemory) != nil {
 44942  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87067), unsafe.Pointer(&_vdbeSortSubtaskCleanupØ00__func__Ø000), unsafe.Pointer(str(58047)))
 44943  			crt.X__builtin_abort(tls)
 44944  		}
 44945  	}()
 44946  	_vdbeSorterRecordFree(tls, nil, (*XSorterRecord)(_pTask.Xlist.XpList))
 44947  _1:
 44948  	if (_pTask.Xfile.XpFd) != nil {
 44949  		_sqlite3OsCloseFree(tls, (*Xsqlite3_file)(_pTask.Xfile.XpFd))
 44950  	}
 44951  	if (_pTask.Xfile2.XpFd) != nil {
 44952  		_sqlite3OsCloseFree(tls, (*Xsqlite3_file)(_pTask.Xfile2.XpFd))
 44953  	}
 44954  	crt.Xmemset(tls, unsafe.Pointer(_pTask), int32(0), uint64(104))
 44955  }
 44956  
 44957  var _vdbeSortSubtaskCleanupØ00__func__Ø000 [23]int8
 44958  
 44959  func init() {
 44960  	crt.Xstrncpy(nil, &_vdbeSortSubtaskCleanupØ00__func__Ø000[0], str(58070), 23)
 44961  }
 44962  
 44963  // C comment
 44964  //  /*
 44965  //  ** Free the list of sorted records starting at pRecord.
 44966  //  */
 44967  func _vdbeSorterRecordFree(tls *crt.TLS, _db *Xsqlite3, _pRecord *XSorterRecord) {
 44968  	var _p, _pNext *XSorterRecord
 44969  	_p = _pRecord
 44970  _0:
 44971  	if _p == nil {
 44972  		goto _3
 44973  	}
 44974  	_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
 44975  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p))
 44976  	_p = _pNext
 44977  	goto _0
 44978  _3:
 44979  }
 44980  
 44981  // C comment
 44982  //  /*
 44983  //  ** If parameter iOp is less than zero, then invoke the destructor for
 44984  //  ** all auxiliary data pointers currently cached by the VM passed as
 44985  //  ** the first argument.
 44986  //  **
 44987  //  ** Or, if iOp is greater than or equal to zero, then the destructor is
 44988  //  ** only invoked for those auxiliary data pointers created by the user
 44989  //  ** function invoked by the OP_Function opcode at instruction iOp of
 44990  //  ** VM pVdbe, and only then if:
 44991  //  **
 44992  //  **    * the associated function parameter is the 32nd or later (counting
 44993  //  **      from left to right), or
 44994  //  **
 44995  //  **    * the corresponding bit in argument mask is clear (where the first
 44996  //  **      function parameter corresponds to bit 0 etc.).
 44997  //  */
 44998  func _sqlite3VdbeDeleteAuxData(tls *crt.TLS, _db *Xsqlite3, _pp **XAuxData, _iOp int32, _mask int32) {
 44999  	var _1_pAux *XAuxData
 45000  _0:
 45001  	if (*_pp) == nil {
 45002  		goto _1
 45003  	}
 45004  	_1_pAux = *_pp
 45005  	if _iOp >= int32(0) && (_1_pAux.XiAuxOp != _iOp || _1_pAux.XiAuxArg < int32(0) || _1_pAux.XiAuxArg <= int32(31) && (uint32(_mask)&(uint32(1)<<uint(_1_pAux.XiAuxArg))) != 0) {
 45006  		goto _6
 45007  	}
 45008  	if _1_pAux.XxDeleteAux != nil {
 45009  		_1_pAux.XxDeleteAux(tls, _1_pAux.XpAux)
 45010  	}
 45011  	*_pp = (*XAuxData)(_1_pAux.XpNextAux)
 45012  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pAux))
 45013  	goto _8
 45014  _6:
 45015  	_pp = (**XAuxData)(unsafe.Pointer(&_1_pAux.XpNextAux))
 45016  _8:
 45017  	goto _0
 45018  _1:
 45019  }
 45020  
 45021  var _closeAllCursorsØ00__func__Ø000 [16]int8
 45022  
 45023  func init() {
 45024  	crt.Xstrncpy(nil, &_closeAllCursorsØ00__func__Ø000[0], str(58093), 16)
 45025  }
 45026  
 45027  // C comment
 45028  //  /*
 45029  //  ** Delete a VdbeFrame object and its contents. VdbeFrame objects are
 45030  //  ** allocated by the OP_Program opcode in sqlite3VdbeExec().
 45031  //  */
 45032  func _sqlite3VdbeFrameDelete(tls *crt.TLS, _p *XVdbeFrame) {
 45033  	var _i int32
 45034  	var _aMem *XMem
 45035  	var _apCsr **XVdbeCursor
 45036  	_aMem = (*XMem)(unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(_p)), uintptr(112))))
 45037  	_apCsr = (**XVdbeCursor)(unsafe.Pointer(elem25(_aMem, uintptr(_p.XnChildMem))))
 45038  	_i = int32(0)
 45039  _0:
 45040  	if _i >= _p.XnChildCsr {
 45041  		goto _3
 45042  	}
 45043  	_sqlite3VdbeFreeCursor(tls, (*TVdbe)(_p.Xv), *elem79(_apCsr, uintptr(_i)))
 45044  	_i += 1
 45045  	goto _0
 45046  _3:
 45047  	_releaseMemArray(tls, _aMem, _p.XnChildMem)
 45048  	_sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)((*TVdbe)(_p.Xv).Xdb), (**XAuxData)(unsafe.Pointer(&_p.XpAuxData)), int32(-1), int32(0))
 45049  	_sqlite3DbFree(tls, (*Xsqlite3)((*TVdbe)(_p.Xv).Xdb), unsafe.Pointer(_p))
 45050  }
 45051  
 45052  func _checkActiveVdbeCnt(tls *crt.TLS, _db *Xsqlite3) {
 45053  	var _cnt, _nWrite, _nRead int32
 45054  	var _p *TVdbe
 45055  	_cnt = int32(0)
 45056  	_nWrite = int32(0)
 45057  	_nRead = int32(0)
 45058  	_p = (*TVdbe)(_db.XpVdbe)
 45059  _0:
 45060  	if _p == nil {
 45061  		goto _1
 45062  	}
 45063  	if Xsqlite3_stmt_busy(tls, unsafe.Pointer(_p)) == 0 {
 45064  		goto _2
 45065  	}
 45066  	_cnt += 1
 45067  	if int32((uint32(_p.Xexpired>>7)<<31)>>31) == int32(0) {
 45068  		_nWrite += 1
 45069  	}
 45070  	if ((uint32(_p.Xexpired>>8) << 31) >> 31) != 0 {
 45071  		_nRead += 1
 45072  	}
 45073  _2:
 45074  	_p = (*TVdbe)(_p.XpNext)
 45075  	goto _0
 45076  _1:
 45077  	func() {
 45078  		if _cnt != _db.XnVdbeActive {
 45079  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73910), unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000), unsafe.Pointer(str(58109)))
 45080  			crt.X__builtin_abort(tls)
 45081  		}
 45082  	}()
 45083  	func() {
 45084  		if _nWrite != _db.XnVdbeWrite {
 45085  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73911), unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000), unsafe.Pointer(str(58130)))
 45086  			crt.X__builtin_abort(tls)
 45087  		}
 45088  	}()
 45089  	func() {
 45090  		if _nRead != _db.XnVdbeRead {
 45091  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73912), unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000), unsafe.Pointer(str(58153)))
 45092  			crt.X__builtin_abort(tls)
 45093  		}
 45094  	}()
 45095  }
 45096  
 45097  // C comment
 45098  //  /*
 45099  //  ** Return true if the prepared statement is in need of being reset.
 45100  //  */
 45101  func Xsqlite3_stmt_busy(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 45102  	var _v *TVdbe
 45103  	_v = (*TVdbe)(_pStmt)
 45104  	return bool2int(((_v != nil) && (_v.Xmagic == uint32(770837923))) && (_v.Xpc >= int32(0)))
 45105  }
 45106  
 45107  var _checkActiveVdbeCntØ00__func__Ø000 [19]int8
 45108  
 45109  func init() {
 45110  	crt.Xstrncpy(nil, &_checkActiveVdbeCntØ00__func__Ø000[0], str(58174), 19)
 45111  }
 45112  
 45113  // C comment
 45114  //  /*
 45115  //  ** If SQLite is compiled to support shared-cache mode and to be threadsafe,
 45116  //  ** this routine obtains the mutex associated with each BtShared structure
 45117  //  ** that may be accessed by the VM passed as an argument. In doing so it also
 45118  //  ** sets the BtShared.db member of each of the BtShared structures, ensuring
 45119  //  ** that the correct busy-handler callback is invoked if required.
 45120  //  **
 45121  //  ** If SQLite is not threadsafe but does support shared-cache mode, then
 45122  //  ** sqlite3BtreeEnter() is invoked to set the BtShared.db variables
 45123  //  ** of all of BtShared structures accessible via the database handle
 45124  //  ** associated with the VM.
 45125  //  **
 45126  //  ** If SQLite is not threadsafe and does not support shared-cache mode, this
 45127  //  ** function is a no-op.
 45128  //  **
 45129  //  ** The p->btreeMask field is a bitmask of all btrees that the prepared
 45130  //  ** statement p will ever use.  Let N be the number of bits in p->btreeMask
 45131  //  ** corresponding to btrees that use shared cache.  Then the runtime of
 45132  //  ** this routine is N*N.  But as N is rarely more than 1, this should not
 45133  //  ** be a problem.
 45134  //  */
 45135  func _sqlite3VdbeEnter(tls *crt.TLS, _p *TVdbe) {
 45136  	var _i, _nDb int32
 45137  	var _db *Xsqlite3
 45138  	var _aDb *XDb
 45139  	if _p.XlockMask == (0) {
 45140  		return
 45141  	}
 45142  	_db = (*Xsqlite3)(_p.Xdb)
 45143  	_aDb = (*XDb)(_db.XaDb)
 45144  	_nDb = _db.XnDb
 45145  	_i = int32(0)
 45146  _1:
 45147  	if _i >= _nDb {
 45148  		goto _4
 45149  	}
 45150  	if ((_i != int32(1)) && ((_p.XlockMask & (uint32(1) << uint(_i))) != (0))) && func() int32 {
 45151  		if (*XBtree)(elem27(_aDb, uintptr(_i)).XpBt) != nil {
 45152  			return int32(1)
 45153  		}
 45154  		return func() int32 {
 45155  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72873), unsafe.Pointer(&_sqlite3VdbeEnterØ00__func__Ø000), unsafe.Pointer(str(4809)))
 45156  			crt.X__builtin_abort(tls)
 45157  			return int32(0)
 45158  		}()
 45159  	}() != 0 {
 45160  		_sqlite3BtreeEnter(tls, (*XBtree)(elem27(_aDb, uintptr(_i)).XpBt))
 45161  	}
 45162  	_i += 1
 45163  	goto _1
 45164  _4:
 45165  }
 45166  
 45167  var _sqlite3VdbeEnterØ00__func__Ø000 [17]int8
 45168  
 45169  func init() {
 45170  	crt.Xstrncpy(nil, &_sqlite3VdbeEnterØ00__func__Ø000[0], str(58193), 17)
 45171  }
 45172  
 45173  func _sqlite3VdbeCheckFk(tls *crt.TLS, _p *TVdbe, _deferred int32) (r0 int32) {
 45174  	var _db *Xsqlite3
 45175  	_db = (*Xsqlite3)(_p.Xdb)
 45176  	if (_deferred != 0 && ((_db.XnDeferredCons + _db.XnDeferredImmCons) > (0))) || ((_deferred == 0) && (_p.XnFkConstraint > (0))) {
 45177  		_p.Xrc = int32(787)
 45178  		_p.XerrorAction = uint8(2)
 45179  		_sqlite3VdbeError(tls, _p, str(58210))
 45180  		return int32(1)
 45181  	}
 45182  	return int32(0)
 45183  }
 45184  
 45185  // C comment
 45186  //  /*
 45187  //  ** Change the error string stored in Vdbe.zErrMsg
 45188  //  */
 45189  func _sqlite3VdbeError(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interface{}) {
 45190  	var _ap []interface{}
 45191  	_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p.XzErrMsg))
 45192  	_ap = args
 45193  	_p.XzErrMsg = _sqlite3VMPrintf(tls, (*Xsqlite3)(_p.Xdb), _zFormat, _ap)
 45194  	_ap = nil
 45195  }
 45196  
 45197  var _sqlite3VdbeHaltØ00__func__Ø000 [16]int8
 45198  
 45199  func init() {
 45200  	crt.Xstrncpy(nil, &_sqlite3VdbeHaltØ00__func__Ø000[0], str(58240), 16)
 45201  }
 45202  
 45203  func _sqlite3VdbeLeave(tls *crt.TLS, _p *TVdbe) {
 45204  	if _p.XlockMask == (0) {
 45205  		return
 45206  	}
 45207  	_vdbeLeave(tls, _p)
 45208  }
 45209  
 45210  // C comment
 45211  //  /*
 45212  //  ** Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter().
 45213  //  */
 45214  func _vdbeLeave(tls *crt.TLS, _p *TVdbe) {
 45215  	var _i, _nDb int32
 45216  	var _db *Xsqlite3
 45217  	var _aDb *XDb
 45218  	_db = (*Xsqlite3)(_p.Xdb)
 45219  	_aDb = (*XDb)(_db.XaDb)
 45220  	_nDb = _db.XnDb
 45221  	_i = int32(0)
 45222  _0:
 45223  	if _i >= _nDb {
 45224  		goto _3
 45225  	}
 45226  	if ((_i != int32(1)) && ((_p.XlockMask & (uint32(1) << uint(_i))) != (0))) && func() int32 {
 45227  		if (*XBtree)(elem27(_aDb, uintptr(_i)).XpBt) != nil {
 45228  			return int32(1)
 45229  		}
 45230  		return func() int32 {
 45231  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72893), unsafe.Pointer(&_vdbeLeaveØ00__func__Ø000), unsafe.Pointer(str(4809)))
 45232  			crt.X__builtin_abort(tls)
 45233  			return int32(0)
 45234  		}()
 45235  	}() != 0 {
 45236  		_sqlite3BtreeLeave(tls, (*XBtree)(elem27(_aDb, uintptr(_i)).XpBt))
 45237  	}
 45238  	_i += 1
 45239  	goto _0
 45240  _3:
 45241  }
 45242  
 45243  var _vdbeLeaveØ00__func__Ø000 [10]int8
 45244  
 45245  func init() {
 45246  	crt.Xstrncpy(nil, &_vdbeLeaveØ00__func__Ø000[0], str(58256), 10)
 45247  }
 45248  
 45249  // C comment
 45250  //  /*
 45251  //  ** A read or write transaction may or may not be active on database handle
 45252  //  ** db. If a transaction is active, commit it. If there is a
 45253  //  ** write-transaction spanning more than one database file, this routine
 45254  //  ** takes care of the master journal trickery.
 45255  //  */
 45256  func _vdbeCommit(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) (r0 int32) {
 45257  	var _i, _nTrans, _rc, _needXcommit, _13_res, _13_retryCount, _13_nMainFile int32
 45258  	var _13_offset int64
 45259  	var _14_iRandom uint32
 45260  	var _13_zMaster, _13_zMainFile, _21_zFile *int8
 45261  	var _1_pBt, _8_pBt, _10_pBt, _20_pBt, _25_pBt, _29_pBt *XBtree
 45262  	var _2_pPager *XPager
 45263  	var _13_pMaster *Xsqlite3_file
 45264  	var _13_pVfs *Xsqlite3_vfs
 45265  	_nTrans = int32(0)
 45266  	_rc = int32(0)
 45267  	_needXcommit = int32(0)
 45268  	_rc = _sqlite3VtabSync(tls, _db, _p)
 45269  	_i = int32(0)
 45270  _0:
 45271  	if _rc != int32(0) || _i >= _db.XnDb {
 45272  		goto _4
 45273  	}
 45274  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45275  	if _sqlite3BtreeIsInTrans(tls, _1_pBt) == 0 {
 45276  		goto _5
 45277  	}
 45278  	_needXcommit = int32(1)
 45279  	_sqlite3BtreeEnter(tls, _1_pBt)
 45280  	_2_pPager = _sqlite3BtreePager(tls, _1_pBt)
 45281  	if (int32(elem27((*XDb)(_db.XaDb), uintptr(_i)).Xsafety_level) != int32(1)) && ((*elem15((*uint8)(unsafe.Pointer(&_vdbeCommitØ00aMJNeededØ001)), uintptr(_sqlite3PagerGetJournalMode(tls, _2_pPager)))) != 0) {
 45282  		func() {
 45283  			if _i == int32(1) {
 45284  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73684), unsafe.Pointer(&_vdbeCommitØ00__func__Ø000), unsafe.Pointer(str(58266)))
 45285  				crt.X__builtin_abort(tls)
 45286  			}
 45287  		}()
 45288  		_nTrans += 1
 45289  	}
 45290  	_rc = _sqlite3PagerExclusiveLock(tls, _2_pPager)
 45291  	_sqlite3BtreeLeave(tls, _1_pBt)
 45292  _5:
 45293  	_i += 1
 45294  	goto _0
 45295  _4:
 45296  	if _rc != int32(0) {
 45297  		return _rc
 45298  	}
 45299  	if _needXcommit == 0 || _db.XxCommitCallback == nil {
 45300  		goto _12
 45301  	}
 45302  	_rc = _db.XxCommitCallback(tls, _db.XpCommitArg)
 45303  	if _rc != 0 {
 45304  		return int32(531)
 45305  	}
 45306  _12:
 45307  	if int32(0) != _sqlite3Strlen30(tls, _sqlite3BtreeGetFilename(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt))) && _nTrans > int32(1) {
 45308  		goto _15
 45309  	}
 45310  	_i = int32(0)
 45311  _16:
 45312  	if _rc != int32(0) || _i >= _db.XnDb {
 45313  		goto _20
 45314  	}
 45315  	_8_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45316  	if _8_pBt != nil {
 45317  		_rc = _sqlite3BtreeCommitPhaseOne(tls, _8_pBt, nil)
 45318  	}
 45319  	_i += 1
 45320  	goto _16
 45321  _20:
 45322  	_i = int32(0)
 45323  _22:
 45324  	if _rc != int32(0) || _i >= _db.XnDb {
 45325  		goto _26
 45326  	}
 45327  	_10_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45328  	if _10_pBt != nil {
 45329  		_rc = _sqlite3BtreeCommitPhaseTwo(tls, _10_pBt, int32(0))
 45330  	}
 45331  	_i += 1
 45332  	goto _22
 45333  _26:
 45334  	if _rc == int32(0) {
 45335  		_sqlite3VtabCommit(tls, _db)
 45336  	}
 45337  	goto _29
 45338  _15:
 45339  	_13_pVfs = (*Xsqlite3_vfs)(_db.XpVfs)
 45340  	_13_zMaster = nil
 45341  	_13_zMainFile = _sqlite3BtreeGetFilename(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt))
 45342  	_13_pMaster = nil
 45343  	_13_offset = int64(0)
 45344  	_13_retryCount = int32(0)
 45345  	_13_nMainFile = _sqlite3Strlen30(tls, _13_zMainFile)
 45346  	_13_zMaster = _sqlite3MPrintf(tls, _db, str(58271), unsafe.Pointer(_13_zMainFile))
 45347  	if _13_zMaster == nil {
 45348  		return _sqlite3NomemError(tls, int32(73756))
 45349  	}
 45350  _30:
 45351  	if _13_retryCount == 0 {
 45352  		goto _32
 45353  	}
 45354  	if _13_retryCount > int32(100) {
 45355  		Xsqlite3_log(tls, int32(13), str(58287), unsafe.Pointer(_13_zMaster))
 45356  		_sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, int32(0))
 45357  		goto _34
 45358  	}
 45359  	if _13_retryCount == int32(1) {
 45360  		Xsqlite3_log(tls, int32(13), str(58301), unsafe.Pointer(_13_zMaster))
 45361  	}
 45362  _32:
 45363  	_13_retryCount += 1
 45364  	Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_14_iRandom))
 45365  	Xsqlite3_snprintf(tls, int32(13), elem1(_13_zMaster, uintptr(_13_nMainFile)), str(58316), (_14_iRandom>>8)&uint32(16777215), _14_iRandom&uint32(255))
 45366  	func() {
 45367  		if int32(*elem1(_13_zMaster, uintptr(_sqlite3Strlen30(tls, _13_zMaster)-int32(3)))) != int32(57) {
 45368  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73774), unsafe.Pointer(&_vdbeCommitØ00__func__Ø000), unsafe.Pointer(str(58329)))
 45369  			crt.X__builtin_abort(tls)
 45370  		}
 45371  	}()
 45372  	_rc = _sqlite3OsAccess(tls, _13_pVfs, _13_zMaster, int32(0), &_13_res)
 45373  	if (_rc == int32(0)) && _13_res != 0 {
 45374  		goto _30
 45375  	}
 45376  _34:
 45377  	if _rc == int32(0) {
 45378  		_rc = _sqlite3OsOpenMalloc(tls, _13_pVfs, _13_zMaster, &_13_pMaster, int32(16406), nil)
 45379  	}
 45380  	if _rc != int32(0) {
 45381  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster))
 45382  		return _rc
 45383  	}
 45384  	_i = int32(0)
 45385  _42:
 45386  	if _i >= _db.XnDb {
 45387  		goto _45
 45388  	}
 45389  	_20_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45390  	if _sqlite3BtreeIsInTrans(tls, _20_pBt) == 0 {
 45391  		goto _46
 45392  	}
 45393  	_21_zFile = _sqlite3BtreeGetJournalname(tls, _20_pBt)
 45394  	if _21_zFile == nil {
 45395  		goto _43
 45396  	}
 45397  	func() {
 45398  		if int32(*elem1(_21_zFile, 0)) == int32(0) {
 45399  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73803), unsafe.Pointer(&_vdbeCommitØ00__func__Ø000), unsafe.Pointer(str(58370)))
 45400  			crt.X__builtin_abort(tls)
 45401  		}
 45402  	}()
 45403  	_rc = _sqlite3OsWrite(tls, _13_pMaster, unsafe.Pointer(_21_zFile), _sqlite3Strlen30(tls, _21_zFile)+int32(1), _13_offset)
 45404  	_13_offset += int64(_sqlite3Strlen30(tls, _21_zFile) + int32(1))
 45405  	if _rc != int32(0) {
 45406  		_sqlite3OsCloseFree(tls, _13_pMaster)
 45407  		_sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, int32(0))
 45408  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster))
 45409  		return _rc
 45410  	}
 45411  _46:
 45412  _43:
 45413  	_i += 1
 45414  	goto _42
 45415  _45:
 45416  	if (int32(0) == (_sqlite3OsDeviceCharacteristics(tls, _13_pMaster) & int32(1024))) && (int32(0) != store2(&_rc, _sqlite3OsSync(tls, _13_pMaster, int32(2)))) {
 45417  		_sqlite3OsCloseFree(tls, _13_pMaster)
 45418  		_sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, int32(0))
 45419  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster))
 45420  		return _rc
 45421  	}
 45422  	_i = int32(0)
 45423  _53:
 45424  	if _rc != int32(0) || _i >= _db.XnDb {
 45425  		goto _57
 45426  	}
 45427  	_25_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45428  	if _25_pBt != nil {
 45429  		_rc = _sqlite3BtreeCommitPhaseOne(tls, _25_pBt, _13_zMaster)
 45430  	}
 45431  	_i += 1
 45432  	goto _53
 45433  _57:
 45434  	_sqlite3OsCloseFree(tls, _13_pMaster)
 45435  	func() {
 45436  		if _rc == int32(5) {
 45437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73844), unsafe.Pointer(&_vdbeCommitØ00__func__Ø000), unsafe.Pointer(str(58382)))
 45438  			crt.X__builtin_abort(tls)
 45439  		}
 45440  	}()
 45441  	if _rc != int32(0) {
 45442  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster))
 45443  		return _rc
 45444  	}
 45445  	_rc = _sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, int32(1))
 45446  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster))
 45447  	_13_zMaster = nil
 45448  	if _rc != 0 {
 45449  		return _rc
 45450  	}
 45451  	_sqlite3BeginBenignMalloc(tls)
 45452  	_i = int32(0)
 45453  _63:
 45454  	if _i >= _db.XnDb {
 45455  		goto _66
 45456  	}
 45457  	_29_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45458  	if _29_pBt != nil {
 45459  		_sqlite3BtreeCommitPhaseTwo(tls, _29_pBt, int32(1))
 45460  	}
 45461  	_i += 1
 45462  	goto _63
 45463  _66:
 45464  	_sqlite3EndBenignMalloc(tls)
 45465  	_sqlite3VtabCommit(tls, _db)
 45466  _29:
 45467  	return _rc
 45468  }
 45469  
 45470  // C comment
 45471  //  /*
 45472  //  ** Invoke the xSync method of all virtual tables in the sqlite3.aVTrans
 45473  //  ** array. Return the error code for the first error that occurs, or
 45474  //  ** SQLITE_OK if all xSync operations are successful.
 45475  //  **
 45476  //  ** If an error message is available, leave it in p->zErrMsg.
 45477  //  */
 45478  func _sqlite3VtabSync(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) (r0 int32) {
 45479  	var _i, _rc int32
 45480  	var _1_pVtab *Xsqlite3_vtab
 45481  	var _aVTrans **XVTable
 45482  	var _1_x func(*crt.TLS, *Xsqlite3_vtab) int32
 45483  	_rc = int32(0)
 45484  	_aVTrans = (**XVTable)(unsafe.Pointer(_db.XaVTrans))
 45485  	*(***XVTable)(unsafe.Pointer(&_db.XaVTrans)) = nil
 45486  	_i = int32(0)
 45487  _0:
 45488  	if _rc != int32(0) || _i >= _db.XnVTrans {
 45489  		goto _4
 45490  	}
 45491  	_1_pVtab = (*Xsqlite3_vtab)((*elem28(_aVTrans, uintptr(_i))).XpVtab)
 45492  	if (_1_pVtab != nil) && (store83(&_1_x, func() func(*crt.TLS, *Xsqlite3_vtab) int32 {
 45493  		v := (*Xsqlite3_module)(_1_pVtab.XpModule).XxSync
 45494  		return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v))
 45495  	}()) != nil) {
 45496  		_rc = _1_x(tls, _1_pVtab)
 45497  		_sqlite3VtabImportErrmsg(tls, _p, _1_pVtab)
 45498  	}
 45499  	_i += 1
 45500  	goto _0
 45501  _4:
 45502  	*(***XVTable)(unsafe.Pointer(&_db.XaVTrans)) = _aVTrans
 45503  	return _rc
 45504  }
 45505  
 45506  // C comment
 45507  //  /*
 45508  //  ** Transfer error message text from an sqlite3_vtab.zErrMsg (text stored
 45509  //  ** in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored
 45510  //  ** in memory obtained from sqlite3DbMalloc).
 45511  //  */
 45512  func _sqlite3VtabImportErrmsg(tls *crt.TLS, _p *TVdbe, _pVtab *Xsqlite3_vtab) {
 45513  	var _1_db *Xsqlite3
 45514  	if _pVtab.XzErrMsg != nil {
 45515  		_1_db = (*Xsqlite3)(_p.Xdb)
 45516  		_sqlite3DbFree(tls, _1_db, unsafe.Pointer(_p.XzErrMsg))
 45517  		_p.XzErrMsg = _sqlite3DbStrDup(tls, _1_db, _pVtab.XzErrMsg)
 45518  		Xsqlite3_free(tls, unsafe.Pointer(_pVtab.XzErrMsg))
 45519  		_pVtab.XzErrMsg = nil
 45520  	}
 45521  }
 45522  
 45523  var _vdbeCommitØ00aMJNeededØ001 [6]uint8
 45524  
 45525  func init() {
 45526  	_vdbeCommitØ00aMJNeededØ001 = [6]uint8{1, 1, 0, 1, 0, 0}
 45527  }
 45528  
 45529  // C comment
 45530  //  /*
 45531  //  ** Return the current journal mode.
 45532  //  */
 45533  func _sqlite3PagerGetJournalMode(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 45534  	return int32(_pPager.XjournalMode)
 45535  }
 45536  
 45537  var _vdbeCommitØ00__func__Ø000 [11]int8
 45538  
 45539  func init() {
 45540  	crt.Xstrncpy(nil, &_vdbeCommitØ00__func__Ø000[0], str(58398), 11)
 45541  }
 45542  
 45543  // C comment
 45544  //  /*
 45545  //  ** Return the full pathname of the underlying database file.  Return
 45546  //  ** an empty string if the database is in-memory or a TEMP database.
 45547  //  **
 45548  //  ** The pager filename is invariant as long as the pager is
 45549  //  ** open so it is safe to access without the BtShared mutex.
 45550  //  */
 45551  func _sqlite3BtreeGetFilename(tls *crt.TLS, _p *XBtree) (r0 *int8) {
 45552  	func() {
 45553  		if (*XPager)((*XBtShared)(_p.XpBt).XpPager) == nil {
 45554  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68620), unsafe.Pointer(&_sqlite3BtreeGetFilenameØ00__func__Ø000), unsafe.Pointer(str(58409)))
 45555  			crt.X__builtin_abort(tls)
 45556  		}
 45557  	}()
 45558  	return _sqlite3PagerFilename(tls, (*XPager)((*XBtShared)(_p.XpBt).XpPager), int32(1))
 45559  }
 45560  
 45561  var _sqlite3BtreeGetFilenameØ00__func__Ø000 [24]int8
 45562  
 45563  func init() {
 45564  	crt.Xstrncpy(nil, &_sqlite3BtreeGetFilenameØ00__func__Ø000[0], str(58427), 24)
 45565  }
 45566  
 45567  // C comment
 45568  //  /*
 45569  //  ** Return the full pathname of the database file.
 45570  //  **
 45571  //  ** Except, if the pager is in-memory only, then return an empty string if
 45572  //  ** nullIfMemDb is true.  This routine is called with nullIfMemDb==1 when
 45573  //  ** used to report the filename to the user, for compatibility with legacy
 45574  //  ** behavior.  But when the Btree needs to know the filename for matching to
 45575  //  ** shared cache, it uses nullIfMemDb==0 so that in-memory databases can
 45576  //  ** participate in shared-cache.
 45577  //  */
 45578  func _sqlite3PagerFilename(tls *crt.TLS, _pPager *XPager, _nullIfMemDb int32) (r0 *int8) {
 45579  	return func() *int8 {
 45580  		if _nullIfMemDb != 0 && (_pPager.XmemDb != 0) {
 45581  			return str(284)
 45582  		}
 45583  		return _pPager.XzFilename
 45584  	}()
 45585  }
 45586  
 45587  // C comment
 45588  //  /*
 45589  //  ** Invoke the xCommit method of all virtual tables in the
 45590  //  ** sqlite3.aVTrans array. Then clear the array itself.
 45591  //  */
 45592  func _sqlite3VtabCommit(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 45593  	_callFinaliser(tls, _db, int32(128))
 45594  	return int32(0)
 45595  }
 45596  
 45597  // C comment
 45598  //  /*
 45599  //  ** Convenience functions for opening and closing files using
 45600  //  ** sqlite3_malloc() to obtain space for the file-handle structure.
 45601  //  */
 45602  func _sqlite3OsOpenMalloc(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFile *int8, _ppFile **Xsqlite3_file, _flags int32, _pOutFlags *int32) (r0 int32) {
 45603  	var _rc int32
 45604  	var _pFile *Xsqlite3_file
 45605  	_pFile = (*Xsqlite3_file)(_sqlite3MallocZero(tls, uint64(_pVfs.XszOsFile)))
 45606  	if _pFile == nil {
 45607  		goto _0
 45608  	}
 45609  	_rc = _sqlite3OsOpen(tls, _pVfs, _zFile, _pFile, _flags, _pOutFlags)
 45610  	if _rc != int32(0) {
 45611  		Xsqlite3_free(tls, unsafe.Pointer(_pFile))
 45612  		goto _2
 45613  	}
 45614  	*_ppFile = _pFile
 45615  _2:
 45616  	goto _3
 45617  _0:
 45618  	_rc = _sqlite3NomemError(tls, int32(20378))
 45619  _3:
 45620  	return _rc
 45621  }
 45622  
 45623  // C comment
 45624  //  /*
 45625  //  ** Return the pathname of the journal file for this database. The return
 45626  //  ** value of this routine is the same regardless of whether the journal file
 45627  //  ** has been created or not.
 45628  //  **
 45629  //  ** The pager journal filename is invariant as long as the pager is
 45630  //  ** open so it is safe to access without the BtShared mutex.
 45631  //  */
 45632  func _sqlite3BtreeGetJournalname(tls *crt.TLS, _p *XBtree) (r0 *int8) {
 45633  	func() {
 45634  		if (*XPager)((*XBtShared)(_p.XpBt).XpPager) == nil {
 45635  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68633), unsafe.Pointer(&_sqlite3BtreeGetJournalnameØ00__func__Ø000), unsafe.Pointer(str(58409)))
 45636  			crt.X__builtin_abort(tls)
 45637  		}
 45638  	}()
 45639  	return _sqlite3PagerJournalname(tls, (*XPager)((*XBtShared)(_p.XpBt).XpPager))
 45640  }
 45641  
 45642  var _sqlite3BtreeGetJournalnameØ00__func__Ø000 [27]int8
 45643  
 45644  func init() {
 45645  	crt.Xstrncpy(nil, &_sqlite3BtreeGetJournalnameØ00__func__Ø000[0], str(58451), 27)
 45646  }
 45647  
 45648  // C comment
 45649  //  /*
 45650  //  ** Return the full pathname of the journal file.
 45651  //  */
 45652  func _sqlite3PagerJournalname(tls *crt.TLS, _pPager *XPager) (r0 *int8) {
 45653  	return _pPager.XzJournal
 45654  }
 45655  
 45656  // C comment
 45657  //  /*
 45658  //  ** This routine is called when a commit occurs.
 45659  //  */
 45660  func _sqlite3CommitInternalChanges(tls *crt.TLS, _db *Xsqlite3) {
 45661  	_db.Xflags &= int32(-3)
 45662  }
 45663  
 45664  func _sqlite3VdbeCloseStatement(tls *crt.TLS, _p *TVdbe, _eOp int32) (r0 int32) {
 45665  	if ((*Xsqlite3)(_p.Xdb).XnStatement) != 0 && _p.XiStatement != 0 {
 45666  		return _vdbeCloseStatement(tls, _p, _eOp)
 45667  	}
 45668  	return int32(0)
 45669  }
 45670  
 45671  // C comment
 45672  //  /*
 45673  //  ** If the Vdbe passed as the first argument opened a statement-transaction,
 45674  //  ** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or
 45675  //  ** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement
 45676  //  ** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the
 45677  //  ** statement transaction is committed.
 45678  //  **
 45679  //  ** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned.
 45680  //  ** Otherwise SQLITE_OK.
 45681  //  */
 45682  func _vdbeCloseStatement(tls *crt.TLS, _p *TVdbe, _eOp int32) (r0 int32) {
 45683  	var _rc, _i, _iSavepoint, _1_rc2 int32
 45684  	var _db *Xsqlite3
 45685  	var _1_pBt *XBtree
 45686  	_db = (*Xsqlite3)(_p.Xdb)
 45687  	_rc = int32(0)
 45688  	_iSavepoint = _p.XiStatement - int32(1)
 45689  	func() {
 45690  		if _eOp != int32(2) && _eOp != int32(1) {
 45691  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73934), unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000), unsafe.Pointer(str(58478)))
 45692  			crt.X__builtin_abort(tls)
 45693  		}
 45694  	}()
 45695  	func() {
 45696  		if _db.XnStatement <= int32(0) {
 45697  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73935), unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000), unsafe.Pointer(str(58528)))
 45698  			crt.X__builtin_abort(tls)
 45699  		}
 45700  	}()
 45701  	func() {
 45702  		if _p.XiStatement != (_db.XnStatement + _db.XnSavepoint) {
 45703  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73936), unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000), unsafe.Pointer(str(58545)))
 45704  			crt.X__builtin_abort(tls)
 45705  		}
 45706  	}()
 45707  	_i = int32(0)
 45708  _7:
 45709  	if _i >= _db.XnDb {
 45710  		goto _10
 45711  	}
 45712  	_1_rc2 = int32(0)
 45713  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45714  	if _1_pBt == nil {
 45715  		goto _11
 45716  	}
 45717  	if _eOp == int32(2) {
 45718  		_1_rc2 = _sqlite3BtreeSavepoint(tls, _1_pBt, int32(2), _iSavepoint)
 45719  	}
 45720  	if _1_rc2 == int32(0) {
 45721  		_1_rc2 = _sqlite3BtreeSavepoint(tls, _1_pBt, int32(1), _iSavepoint)
 45722  	}
 45723  	if _rc == int32(0) {
 45724  		_rc = _1_rc2
 45725  	}
 45726  _11:
 45727  	_i += 1
 45728  	goto _7
 45729  _10:
 45730  	_db.XnStatement -= 1
 45731  	_p.XiStatement = int32(0)
 45732  	if _rc != int32(0) {
 45733  		goto _15
 45734  	}
 45735  	if _eOp == int32(2) {
 45736  		_rc = _sqlite3VtabSavepoint(tls, _db, int32(2), _iSavepoint)
 45737  	}
 45738  	if _rc == int32(0) {
 45739  		_rc = _sqlite3VtabSavepoint(tls, _db, int32(1), _iSavepoint)
 45740  	}
 45741  _15:
 45742  	if _eOp == int32(2) {
 45743  		_db.XnDeferredCons = _p.XnStmtDefCons
 45744  		_db.XnDeferredImmCons = _p.XnStmtDefImmCons
 45745  	}
 45746  	return _rc
 45747  }
 45748  
 45749  var _vdbeCloseStatementØ00__func__Ø000 [19]int8
 45750  
 45751  func init() {
 45752  	crt.Xstrncpy(nil, &_vdbeCloseStatementØ00__func__Ø000[0], str(58592), 19)
 45753  }
 45754  
 45755  // C comment
 45756  //  /*
 45757  //  ** The second argument to this function, op, is always SAVEPOINT_ROLLBACK
 45758  //  ** or SAVEPOINT_RELEASE. This function either releases or rolls back the
 45759  //  ** savepoint identified by parameter iSavepoint, depending on the value
 45760  //  ** of op.
 45761  //  **
 45762  //  ** Normally, iSavepoint is greater than or equal to zero. However, if op is
 45763  //  ** SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the
 45764  //  ** contents of the entire transaction are rolled back. This is different
 45765  //  ** from a normal transaction rollback, as no locks are released and the
 45766  //  ** transaction remains open.
 45767  //  */
 45768  func _sqlite3BtreeSavepoint(tls *crt.TLS, _p *XBtree, _op int32, _iSavepoint int32) (r0 int32) {
 45769  	var _rc int32
 45770  	var _1_pBt *XBtShared
 45771  	_rc = int32(0)
 45772  	if _p == nil || int32(_p.XinTrans) != int32(2) {
 45773  		goto _1
 45774  	}
 45775  	_1_pBt = (*XBtShared)(_p.XpBt)
 45776  	func() {
 45777  		if _op != int32(1) && _op != int32(2) {
 45778  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63136), unsafe.Pointer(&_sqlite3BtreeSavepointØ00__func__Ø000), unsafe.Pointer(str(14879)))
 45779  			crt.X__builtin_abort(tls)
 45780  		}
 45781  	}()
 45782  	func() {
 45783  		if _iSavepoint < int32(0) && (_iSavepoint != int32(-1) || _op != int32(2)) {
 45784  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63137), unsafe.Pointer(&_sqlite3BtreeSavepointØ00__func__Ø000), unsafe.Pointer(str(58611)))
 45785  			crt.X__builtin_abort(tls)
 45786  		}
 45787  	}()
 45788  	_sqlite3BtreeEnter(tls, _p)
 45789  	if _op == int32(2) {
 45790  		_rc = _saveAllCursors(tls, _1_pBt, 0, nil)
 45791  	}
 45792  	if _rc == int32(0) {
 45793  		_rc = _sqlite3PagerSavepoint(tls, (*XPager)(_1_pBt.XpPager), _op, _iSavepoint)
 45794  	}
 45795  	if _rc != int32(0) {
 45796  		goto _11
 45797  	}
 45798  	if (_iSavepoint < int32(0)) && ((int32(_1_pBt.XbtsFlags) & int32(8)) != int32(0)) {
 45799  		_1_pBt.XnPage = 0
 45800  	}
 45801  	_rc = _newDatabase(tls, _1_pBt)
 45802  	_1_pBt.XnPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(int32(28))+uintptr(unsafe.Pointer((*XMemPage)(_1_pBt.XpPage1).XaData)))))
 45803  	func() {
 45804  		if _1_pBt.XnPage <= (0) {
 45805  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63155), unsafe.Pointer(&_sqlite3BtreeSavepointØ00__func__Ø000), unsafe.Pointer(str(58671)))
 45806  			crt.X__builtin_abort(tls)
 45807  		}
 45808  	}()
 45809  _11:
 45810  	_sqlite3BtreeLeave(tls, _p)
 45811  _1:
 45812  	return _rc
 45813  }
 45814  
 45815  var _sqlite3BtreeSavepointØ00__func__Ø000 [22]int8
 45816  
 45817  func init() {
 45818  	crt.Xstrncpy(nil, &_sqlite3BtreeSavepointØ00__func__Ø000[0], str(58684), 22)
 45819  }
 45820  
 45821  // C comment
 45822  //  /*
 45823  //  ** Invoke either the xSavepoint, xRollbackTo or xRelease method of all
 45824  //  ** virtual tables that currently have an open transaction. Pass iSavepoint
 45825  //  ** as the second argument to the virtual table method invoked.
 45826  //  **
 45827  //  ** If op is SAVEPOINT_BEGIN, the xSavepoint method is invoked. If it is
 45828  //  ** SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is
 45829  //  ** SAVEPOINT_RELEASE, then the xRelease method of each virtual table with
 45830  //  ** an open transaction is invoked.
 45831  //  **
 45832  //  ** If any virtual table method returns an error code other than SQLITE_OK,
 45833  //  ** processing is abandoned and the error returned to the caller of this
 45834  //  ** function immediately. If all calls to virtual table methods are successful,
 45835  //  ** SQLITE_OK is returned.
 45836  //  */
 45837  func _sqlite3VtabSavepoint(tls *crt.TLS, _db *Xsqlite3, _op int32, _iSavepoint int32) (r0 int32) {
 45838  	var _rc, _1_i int32
 45839  	var _2_pVTab *XVTable
 45840  	var _2_pMod *Xsqlite3_module
 45841  	var _3_xMethod func(*crt.TLS, *Xsqlite3_vtab, int32) int32
 45842  	_rc = int32(0)
 45843  	func() {
 45844  		if _op != int32(1) && _op != int32(2) && _op != int32(0) {
 45845  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125979), unsafe.Pointer(&_sqlite3VtabSavepointØ00__func__Ø000), unsafe.Pointer(str(58706)))
 45846  			crt.X__builtin_abort(tls)
 45847  		}
 45848  	}()
 45849  	func() {
 45850  		if _iSavepoint < int32(-1) {
 45851  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125980), unsafe.Pointer(&_sqlite3VtabSavepointØ00__func__Ø000), unsafe.Pointer(str(58773)))
 45852  			crt.X__builtin_abort(tls)
 45853  		}
 45854  	}()
 45855  	if _db.XaVTrans == nil {
 45856  		goto _6
 45857  	}
 45858  	_1_i = int32(0)
 45859  _7:
 45860  	if _rc != int32(0) || _1_i >= _db.XnVTrans {
 45861  		goto _11
 45862  	}
 45863  	_2_pVTab = *elem28((**XVTable)(unsafe.Pointer(_db.XaVTrans)), uintptr(_1_i))
 45864  	_2_pMod = (*Xsqlite3_module)((*XModule)(_2_pVTab.XpMod).XpModule)
 45865  	if _2_pVTab.XpVtab == nil || _2_pMod.XiVersion < int32(2) {
 45866  		goto _13
 45867  	}
 45868  	switch _op {
 45869  	case int32(0):
 45870  		goto _15
 45871  	case int32(2):
 45872  		goto _16
 45873  	default:
 45874  		goto _17
 45875  	}
 45876  
 45877  _15:
 45878  	_3_xMethod = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 {
 45879  		v := _2_pMod.XxSavepoint
 45880  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v))
 45881  	}()
 45882  	_2_pVTab.XiSavepoint = _iSavepoint + int32(1)
 45883  	goto _18
 45884  _16:
 45885  	_3_xMethod = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 {
 45886  		v := _2_pMod.XxRollbackTo
 45887  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v))
 45888  	}()
 45889  	goto _18
 45890  _17:
 45891  	_3_xMethod = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 {
 45892  		v := _2_pMod.XxRelease
 45893  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v))
 45894  	}()
 45895  	goto _18
 45896  _18:
 45897  	if (_3_xMethod != nil) && (_2_pVTab.XiSavepoint > _iSavepoint) {
 45898  		_rc = _3_xMethod(tls, (*Xsqlite3_vtab)(_2_pVTab.XpVtab), _iSavepoint)
 45899  	}
 45900  _13:
 45901  	_1_i += 1
 45902  	goto _7
 45903  _11:
 45904  _6:
 45905  	return _rc
 45906  }
 45907  
 45908  var _sqlite3VtabSavepointØ00__func__Ø000 [21]int8
 45909  
 45910  func init() {
 45911  	crt.Xstrncpy(nil, &_sqlite3VtabSavepointØ00__func__Ø000[0], str(58788), 21)
 45912  }
 45913  
 45914  // C comment
 45915  //  /*
 45916  //  ** This routine sets the value to be returned by subsequent calls to
 45917  //  ** sqlite3_changes() on the database handle 'db'.
 45918  //  */
 45919  func _sqlite3VdbeSetChanges(tls *crt.TLS, _db *Xsqlite3, _nChange int32) {
 45920  	func() {
 45921  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 45922  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75914), unsafe.Pointer(&_sqlite3VdbeSetChangesØ00__func__Ø000), unsafe.Pointer(str(881)))
 45923  			crt.X__builtin_abort(tls)
 45924  		}
 45925  	}()
 45926  	_db.XnChange = _nChange
 45927  	_db.XnTotalChange += _nChange
 45928  }
 45929  
 45930  var _sqlite3VdbeSetChangesØ00__func__Ø000 [22]int8
 45931  
 45932  func init() {
 45933  	crt.Xstrncpy(nil, &_sqlite3VdbeSetChangesØ00__func__Ø000[0], str(58809), 22)
 45934  }
 45935  
 45936  // C comment
 45937  //  /*
 45938  //  ** Copy the error code and error message belonging to the VDBE passed
 45939  //  ** as the first argument to its database handle (so that they will be
 45940  //  ** returned by calls to sqlite3_errcode() and sqlite3_errmsg()).
 45941  //  **
 45942  //  ** This function does not clear the VDBE error code or message, just
 45943  //  ** copies them to the database handle.
 45944  //  */
 45945  func _sqlite3VdbeTransferError(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 45946  	var _rc int32
 45947  	var _db *Xsqlite3
 45948  	_db = (*Xsqlite3)(_p.Xdb)
 45949  	_rc = _p.Xrc
 45950  	if _p.XzErrMsg == nil {
 45951  		goto _0
 45952  	}
 45953  	_db.XbBenignMalloc += 1
 45954  	_sqlite3BeginBenignMalloc(tls)
 45955  	if (*XMem)(_db.XpErr) == nil {
 45956  		*(**XMem)(unsafe.Pointer(&_db.XpErr)) = _sqlite3ValueNew(tls, _db)
 45957  	}
 45958  	_sqlite3ValueSetStr(tls, (*XMem)(_db.XpErr), int32(-1), unsafe.Pointer(_p.XzErrMsg), uint8(1), func() func(*crt.TLS, unsafe.Pointer) {
 45959  		v := uint64(18446744073709551615)
 45960  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 45961  	}())
 45962  	_sqlite3EndBenignMalloc(tls)
 45963  	_db.XbBenignMalloc -= 1
 45964  	_db.XerrCode = _rc
 45965  	goto _2
 45966  _0:
 45967  	_sqlite3Error(tls, _db, _rc)
 45968  _2:
 45969  	return _rc
 45970  }
 45971  
 45972  // C comment
 45973  //  /*
 45974  //  ** Clean up the VM after a single run.
 45975  //  */
 45976  func _Cleanup(tls *crt.TLS, _p *TVdbe) {
 45977  	var _i int32
 45978  	var _db *Xsqlite3
 45979  	_db = (*Xsqlite3)(_p.Xdb)
 45980  	if _p.XapCsr == nil {
 45981  		goto _4
 45982  	}
 45983  	_i = int32(0)
 45984  _1:
 45985  	if _i >= _p.XnCursor {
 45986  		goto _4
 45987  	}
 45988  	func() {
 45989  		if (*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_i))) != nil {
 45990  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73565), unsafe.Pointer(&_CleanupØ00__func__Ø000), unsafe.Pointer(str(58831)))
 45991  			crt.X__builtin_abort(tls)
 45992  		}
 45993  	}()
 45994  	_i += 1
 45995  	goto _1
 45996  _4:
 45997  	if _p.XaMem == nil {
 45998  		goto _7
 45999  	}
 46000  	_i = int32(0)
 46001  _8:
 46002  	if _i >= _p.XnMem {
 46003  		goto _11
 46004  	}
 46005  	func() {
 46006  		if int32(elem25((*XMem)(_p.XaMem), uintptr(_i)).Xflags) != int32(128) {
 46007  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73567), unsafe.Pointer(&_CleanupØ00__func__Ø000), unsafe.Pointer(str(58846)))
 46008  			crt.X__builtin_abort(tls)
 46009  		}
 46010  	}()
 46011  	_i += 1
 46012  	goto _8
 46013  _11:
 46014  _7:
 46015  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzErrMsg))
 46016  	_p.XzErrMsg = nil
 46017  	*(**XMem)(unsafe.Pointer(&_p.XpResultSet)) = nil
 46018  }
 46019  
 46020  var _CleanupØ00__func__Ø000 [8]int8
 46021  
 46022  func init() {
 46023  	crt.Xstrncpy(nil, &_CleanupØ00__func__Ø000[0], str(58878), 8)
 46024  }
 46025  
 46026  var _sqlite3VdbeFinalizeØ00__func__Ø000 [20]int8
 46027  
 46028  func init() {
 46029  	crt.Xstrncpy(nil, &_sqlite3VdbeFinalizeØ00__func__Ø000[0], str(58886), 20)
 46030  }
 46031  
 46032  // C comment
 46033  //  /*
 46034  //  ** Delete an entire VDBE.
 46035  //  */
 46036  func _sqlite3VdbeDelete(tls *crt.TLS, _p *TVdbe) {
 46037  	var _db *Xsqlite3
 46038  	if func() int32 {
 46039  		if _p == nil {
 46040  			return func() int32 {
 46041  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74449), unsafe.Pointer(&_sqlite3VdbeDeleteØ00__func__Ø000), unsafe.Pointer(str(4809)))
 46042  				crt.X__builtin_abort(tls)
 46043  				return int32(1)
 46044  			}()
 46045  		}
 46046  		return int32(0)
 46047  	}() != 0 {
 46048  		return
 46049  	}
 46050  	_db = (*Xsqlite3)(_p.Xdb)
 46051  	func() {
 46052  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 46053  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74451), unsafe.Pointer(&_sqlite3VdbeDeleteØ00__func__Ø000), unsafe.Pointer(str(881)))
 46054  			crt.X__builtin_abort(tls)
 46055  		}
 46056  	}()
 46057  	_sqlite3VdbeClearObject(tls, _db, _p)
 46058  	if _p.XpPrev != nil {
 46059  		*(**TVdbe)(unsafe.Pointer(&((*TVdbe)(_p.XpPrev).XpNext))) = (*TVdbe)(_p.XpNext)
 46060  		goto _6
 46061  	}
 46062  	func() {
 46063  		if (*TVdbe)(_db.XpVdbe) != _p {
 46064  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74456), unsafe.Pointer(&_sqlite3VdbeDeleteØ00__func__Ø000), unsafe.Pointer(str(58906)))
 46065  			crt.X__builtin_abort(tls)
 46066  		}
 46067  	}()
 46068  	*(**TVdbe)(unsafe.Pointer(&_db.XpVdbe)) = (*TVdbe)(_p.XpNext)
 46069  _6:
 46070  	if _p.XpNext != nil {
 46071  		*(**TVdbe)(unsafe.Pointer(&((*TVdbe)(_p.XpNext).XpPrev))) = (*TVdbe)(_p.XpPrev)
 46072  	}
 46073  	_p.Xmagic = uint32(1443283912)
 46074  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = nil
 46075  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 46076  }
 46077  
 46078  var _sqlite3VdbeDeleteØ00__func__Ø000 [18]int8
 46079  
 46080  func init() {
 46081  	crt.Xstrncpy(nil, &_sqlite3VdbeDeleteØ00__func__Ø000[0], str(58919), 18)
 46082  }
 46083  
 46084  // C comment
 46085  //  /*
 46086  //  ** Free all memory associated with the Vdbe passed as the second argument,
 46087  //  ** except for object itself, which is preserved.
 46088  //  **
 46089  //  ** The difference between this function and sqlite3VdbeDelete() is that
 46090  //  ** VdbeDelete() also unlinks the Vdbe from the list of VMs associated with
 46091  //  ** the database connection and frees the object itself.
 46092  //  */
 46093  func _sqlite3VdbeClearObject(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) {
 46094  	var _pSub, _pNext *XSubProgram
 46095  	func() {
 46096  		if (*Xsqlite3)(_p.Xdb) != nil && (*Xsqlite3)(_p.Xdb) != _db {
 46097  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74417), unsafe.Pointer(&_sqlite3VdbeClearObjectØ00__func__Ø000), unsafe.Pointer(str(58937)))
 46098  			crt.X__builtin_abort(tls)
 46099  		}
 46100  	}()
 46101  	_releaseMemArray(tls, (*XMem)(_p.XaColName), int32(_p.XnResColumn)*int32(2))
 46102  	_pSub = (*XSubProgram)(_p.XpProgram)
 46103  _3:
 46104  	if _pSub == nil {
 46105  		goto _6
 46106  	}
 46107  	_pNext = (*XSubProgram)(_pSub.XpNext)
 46108  	_vdbeFreeOpArray(tls, _db, (*XVdbeOp)(_pSub.XaOp), _pSub.XnOp)
 46109  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSub))
 46110  	_pSub = _pNext
 46111  	goto _3
 46112  _6:
 46113  	if _p.Xmagic != uint32(381479589) {
 46114  		_releaseMemArray(tls, (*XMem)(_p.XaVar), int32(_p.XnVar))
 46115  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XpVList))
 46116  		_sqlite3DbFree(tls, _db, _p.XpFree)
 46117  	}
 46118  	_vdbeFreeOpArray(tls, _db, (*XVdbeOp)(_p.XaOp), _p.XnOp)
 46119  	_sqlite3DbFree(tls, _db, _p.XaColName)
 46120  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzSql))
 46121  }
 46122  
 46123  var _sqlite3VdbeClearObjectØ00__func__Ø000 [23]int8
 46124  
 46125  func init() {
 46126  	crt.Xstrncpy(nil, &_sqlite3VdbeClearObjectØ00__func__Ø000[0], str(58959), 23)
 46127  }
 46128  
 46129  // C comment
 46130  //  /*
 46131  //  ** Free the space allocated for aOp and any p4 values allocated for the
 46132  //  ** opcodes contained within. If aOp is not NULL it is assumed to contain
 46133  //  ** nOp entries.
 46134  //  */
 46135  func _vdbeFreeOpArray(tls *crt.TLS, _db *Xsqlite3, _aOp *XVdbeOp, _nOp int32) {
 46136  	var _1_pOp *XVdbeOp
 46137  	if _aOp == nil {
 46138  		goto _0
 46139  	}
 46140  	_1_pOp = elem63(_aOp, uintptr(_nOp-int32(1)))
 46141  _1:
 46142  	if crt.P2U(unsafe.Pointer(_1_pOp)) < crt.P2U(unsafe.Pointer(_aOp)) {
 46143  		goto _4
 46144  	}
 46145  	if _1_pOp.Xp4type != 0 {
 46146  		_freeP4(tls, _db, int32(_1_pOp.Xp4type), *(*unsafe.Pointer)(unsafe.Pointer(&_1_pOp.Xp4)))
 46147  	}
 46148  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pOp.XzComment))
 46149  	*(*uintptr)(unsafe.Pointer(&_1_pOp)) += uintptr(18446744073709551584)
 46150  	goto _1
 46151  _4:
 46152  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_aOp))
 46153  _0:
 46154  }
 46155  
 46156  // C comment
 46157  //  /*
 46158  //  ** Free all memory allocations in the pParse object
 46159  //  */
 46160  func _sqlite3ParserReset(tls *crt.TLS, _pParse *XParse) {
 46161  	var _1_db *Xsqlite3
 46162  	if _pParse == nil {
 46163  		goto _0
 46164  	}
 46165  	_1_db = (*Xsqlite3)(_pParse.Xdb)
 46166  	_sqlite3DbFree(tls, _1_db, unsafe.Pointer(_pParse.XaLabel))
 46167  	_sqlite3ExprListDelete(tls, _1_db, (*XExprList)(_pParse.XpConstExpr))
 46168  	if _1_db != nil {
 46169  		func() {
 46170  			if (_1_db.Xlookaside.XbDisable) < uint32(_pParse.XdisableLookaside) {
 46171  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116168), unsafe.Pointer(&_sqlite3ParserResetØ00__func__Ø000), unsafe.Pointer(str(58982)))
 46172  				crt.X__builtin_abort(tls)
 46173  			}
 46174  		}()
 46175  		_1_db.Xlookaside.XbDisable -= uint32(_pParse.XdisableLookaside)
 46176  	}
 46177  	_pParse.XdisableLookaside = 0
 46178  _0:
 46179  }
 46180  
 46181  var _sqlite3ParserResetØ00__func__Ø000 [19]int8
 46182  
 46183  func init() {
 46184  	crt.Xstrncpy(nil, &_sqlite3ParserResetØ00__func__Ø000[0], str(59033), 19)
 46185  }
 46186  
 46187  // C comment
 46188  //  /*
 46189  //  ** The following routine destroys a virtual machine that is created by
 46190  //  ** the sqlite3_compile() routine. The integer returned is an SQLITE_
 46191  //  ** success/failure code that describes the result of executing the virtual
 46192  //  ** machine.
 46193  //  **
 46194  //  ** This routine sets the error code and string returned by
 46195  //  ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
 46196  //  */
 46197  func Xsqlite3_finalize(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 46198  	var _rc int32
 46199  	var _2_db *Xsqlite3
 46200  	var _2_v *TVdbe
 46201  	if _pStmt == nil {
 46202  		_rc = int32(0)
 46203  		goto _1
 46204  	}
 46205  	_2_v = (*TVdbe)(_pStmt)
 46206  	_2_db = (*Xsqlite3)(_2_v.Xdb)
 46207  	if _vdbeSafety(tls, _2_v) != 0 {
 46208  		return _sqlite3MisuseError(tls, int32(76202))
 46209  	}
 46210  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_2_db.Xmutex))
 46211  	if _2_v.XstartTime > (0) {
 46212  		_invokeProfileCallback(tls, _2_db, _2_v)
 46213  	}
 46214  	_rc = _sqlite3VdbeFinalize(tls, _2_v)
 46215  	_rc = _sqlite3ApiExit(tls, _2_db, _rc)
 46216  	_sqlite3LeaveMutexAndCloseZombie(tls, _2_db)
 46217  _1:
 46218  	return _rc
 46219  }
 46220  
 46221  // C comment
 46222  //  /*
 46223  //  ** Invoke the profile callback.  This routine is only called if we already
 46224  //  ** know that the profile callback is defined and needs to be invoked.
 46225  //  */
 46226  func _invokeProfileCallback(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) {
 46227  	var _iNow, _iElapse int64
 46228  	func() {
 46229  		if _p.XstartTime <= (0) {
 46230  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76160), unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000), unsafe.Pointer(str(59052)))
 46231  			crt.X__builtin_abort(tls)
 46232  		}
 46233  	}()
 46234  	func() {
 46235  		if _db.XxProfile == nil && (int32(_db.XmTrace)&int32(2)) == int32(0) {
 46236  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76161), unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000), unsafe.Pointer(str(59067)))
 46237  			crt.X__builtin_abort(tls)
 46238  		}
 46239  	}()
 46240  	func() {
 46241  		if int32(_db.Xinit.Xbusy) != int32(0) {
 46242  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76162), unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000), unsafe.Pointer(str(49851)))
 46243  			crt.X__builtin_abort(tls)
 46244  		}
 46245  	}()
 46246  	func() {
 46247  		if _p.XzSql == nil {
 46248  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76163), unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000), unsafe.Pointer(str(59125)))
 46249  			crt.X__builtin_abort(tls)
 46250  		}
 46251  	}()
 46252  	_sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)(_db.XpVfs), &_iNow)
 46253  	_iElapse = (_iNow - _p.XstartTime) * int64(1000000)
 46254  	if _db.XxProfile != nil {
 46255  		_db.XxProfile(tls, _db.XpProfileArg, _p.XzSql, uint64(_iElapse))
 46256  	}
 46257  	if (int32(_db.XmTrace) & int32(2)) != 0 {
 46258  		_db.XxTrace(tls, uint32(2), _db.XpTraceArg, unsafe.Pointer(_p), unsafe.Pointer(&_iElapse))
 46259  	}
 46260  	_p.XstartTime = 0
 46261  }
 46262  
 46263  var _invokeProfileCallbackØ00__func__Ø000 [22]int8
 46264  
 46265  func init() {
 46266  	crt.Xstrncpy(nil, &_invokeProfileCallbackØ00__func__Ø000[0], str(59136), 22)
 46267  }
 46268  
 46269  var _sqlite3LockAndPrepareØ00__func__Ø000 [22]int8
 46270  
 46271  func init() {
 46272  	crt.Xstrncpy(nil, &_sqlite3LockAndPrepareØ00__func__Ø000[0], str(59158), 22)
 46273  }
 46274  
 46275  var _sqlite3_prepareØ00__func__Ø000 [16]int8
 46276  
 46277  func init() {
 46278  	crt.Xstrncpy(nil, &_sqlite3_prepareØ00__func__Ø000[0], str(59180), 16)
 46279  }
 46280  
 46281  // C comment
 46282  //  /*
 46283  //  ** Return UTF-8 encoded English language explanation of the most recent
 46284  //  ** error.
 46285  //  */
 46286  func Xsqlite3_errmsg(tls *crt.TLS, _db *Xsqlite3) (r0 *int8) {
 46287  	var _z *int8
 46288  	if _db == nil {
 46289  		return _sqlite3ErrStr(tls, _sqlite3NomemError(tls, int32(142705)))
 46290  	}
 46291  	if _sqlite3SafetyCheckSickOrOk(tls, _db) == 0 {
 46292  		return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(142708)))
 46293  	}
 46294  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46295  	if _db.XmallocFailed != 0 {
 46296  		_z = _sqlite3ErrStr(tls, _sqlite3NomemError(tls, int32(142712)))
 46297  		goto _3
 46298  	}
 46299  	_z = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, (*XMem)(_db.XpErr))))
 46300  	func() {
 46301  		if _db.XmallocFailed != 0 {
 46302  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142716), unsafe.Pointer(&_sqlite3_errmsgØ00__func__Ø000), unsafe.Pointer(str(23824)))
 46303  			crt.X__builtin_abort(tls)
 46304  		}
 46305  	}()
 46306  	if _z == nil {
 46307  		_z = _sqlite3ErrStr(tls, _db.XerrCode)
 46308  	}
 46309  _3:
 46310  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46311  	return _z
 46312  }
 46313  
 46314  // C comment
 46315  //  /*
 46316  //  ** Return a static string that describes the kind of error specified in the
 46317  //  ** argument.
 46318  //  */
 46319  func _sqlite3ErrStr(tls *crt.TLS, _rc int32) (r0 *int8) {
 46320  	var _zErr *int8
 46321  	_zErr = str(59196)
 46322  	switch _rc {
 46323  	case int32(516):
 46324  		goto _1
 46325  	default:
 46326  		goto _2
 46327  	}
 46328  
 46329  _1:
 46330  	_zErr = str(59210)
 46331  	goto _3
 46332  _2:
 46333  	_rc &= int32(255)
 46334  	if (func() int32 {
 46335  		if _rc >= int32(0) {
 46336  			return int32(1)
 46337  		}
 46338  		return func() int32 {
 46339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141905), unsafe.Pointer(&_sqlite3ErrStrØ00__func__Ø000), unsafe.Pointer(str(4809)))
 46340  			crt.X__builtin_abort(tls)
 46341  			return int32(0)
 46342  		}()
 46343  	}() != 0 && (_rc < int32(27))) && ((*elem0((**int8)(unsafe.Pointer(&_sqlite3ErrStrØ00aMsgØ001)), uintptr(_rc))) != nil) {
 46344  		_zErr = *elem0((**int8)(unsafe.Pointer(&_sqlite3ErrStrØ00aMsgØ001)), uintptr(_rc))
 46345  	}
 46346  	goto _3
 46347  _3:
 46348  	return _zErr
 46349  }
 46350  
 46351  var _sqlite3ErrStrØ00__func__Ø000 [14]int8
 46352  
 46353  func init() {
 46354  	crt.Xstrncpy(nil, &_sqlite3ErrStrØ00__func__Ø000[0], str(59232), 14)
 46355  }
 46356  
 46357  var _sqlite3ErrStrØ00aMsgØ001 [27]*int8
 46358  
 46359  func init() {
 46360  	_sqlite3ErrStrØ00aMsgØ001 = [27]*int8{str(59246), str(59259), nil, str(59295), str(59320), str(59351), str(59370), str(59395), str(59409), str(59446), str(59458), str(59473), str(59506), str(59524), str(59549), str(59578), str(59595), str(59618), str(6711), str(59646), str(59664), str(59682), str(59721), str(59752), str(59773), str(59805), str(59839)}
 46361  }
 46362  
 46363  var _sqlite3_errmsgØ00__func__Ø000 [15]int8
 46364  
 46365  func init() {
 46366  	crt.Xstrncpy(nil, &_sqlite3_errmsgØ00__func__Ø000[0], str(59878), 15)
 46367  }
 46368  
 46369  // C comment
 46370  //  /*
 46371  //  ** Locate the in-memory structure that describes
 46372  //  ** a particular index given the name of that index
 46373  //  ** and the name of the database that contains the index.
 46374  //  ** Return NULL if not found.
 46375  //  **
 46376  //  ** If zDatabase is 0, all databases are searched for the
 46377  //  ** table and the first matching index is returned.  (No checking
 46378  //  ** for duplicate index names is done.)  The search order is
 46379  //  ** TEMP first, then MAIN, then any auxiliary databases added
 46380  //  ** using the ATTACH command.
 46381  //  */
 46382  func _sqlite3FindIndex(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _zDb *int8) (r0 *XIndex) {
 46383  	var _i, _1_j int32
 46384  	var _1_pSchema *XSchema
 46385  	var _p *XIndex
 46386  	_p = nil
 46387  	func() {
 46388  		if _zDb == nil && _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
 46389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100120), unsafe.Pointer(&_sqlite3FindIndexØ00__func__Ø000), unsafe.Pointer(str(59893)))
 46390  			crt.X__builtin_abort(tls)
 46391  		}
 46392  	}()
 46393  	_i = int32(0)
 46394  _3:
 46395  	if _i >= _db.XnDb {
 46396  		goto _6
 46397  	}
 46398  	_1_j = func() int32 {
 46399  		if _i < int32(2) {
 46400  			return (_i ^ int32(1))
 46401  		}
 46402  		return _i
 46403  	}()
 46404  	_1_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_1_j)).XpSchema)
 46405  	func() {
 46406  		if _1_pSchema == nil {
 46407  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100124), unsafe.Pointer(&_sqlite3FindIndexØ00__func__Ø000), unsafe.Pointer(str(59935)))
 46408  			crt.X__builtin_abort(tls)
 46409  		}
 46410  	}()
 46411  	if (_zDb != nil) && _sqlite3StrICmp(tls, _zDb, elem27((*XDb)(_db.XaDb), uintptr(_1_j)).XzDbSName) != 0 {
 46412  		goto _4
 46413  	}
 46414  	func() {
 46415  		if _sqlite3SchemaMutexHeld(tls, _db, _1_j, nil) == 0 {
 46416  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100126), unsafe.Pointer(&_sqlite3FindIndexØ00__func__Ø000), unsafe.Pointer(str(59943)))
 46417  			crt.X__builtin_abort(tls)
 46418  		}
 46419  	}()
 46420  	_p = (*XIndex)(_sqlite3HashFind(tls, &_1_pSchema.XidxHash, _zName))
 46421  	if _p != nil {
 46422  		goto _6
 46423  	}
 46424  _4:
 46425  	_i += 1
 46426  	goto _3
 46427  _6:
 46428  	return _p
 46429  }
 46430  
 46431  var _sqlite3FindIndexØ00__func__Ø000 [17]int8
 46432  
 46433  func init() {
 46434  	crt.Xstrncpy(nil, &_sqlite3FindIndexØ00__func__Ø000[0], str(59976), 17)
 46435  }
 46436  
 46437  // C comment
 46438  //  /*
 46439  //  ** Free any prior content in *pz and replace it with a copy of zNew.
 46440  //  */
 46441  func _sqlite3SetString(tls *crt.TLS, _pz **int8, _db *Xsqlite3, _zNew *int8) {
 46442  	_sqlite3DbFree(tls, _db, unsafe.Pointer(*_pz))
 46443  	*_pz = _sqlite3DbStrDup(tls, _db, _zNew)
 46444  }
 46445  
 46446  // C comment
 46447  //  /*
 46448  //  ** Change the "soft" limit on the number of pages in the cache.
 46449  //  ** Unused and unmodified pages will be recycled when the number of
 46450  //  ** pages in the cache exceeds this soft limit.  But the size of the
 46451  //  ** cache is allowed to grow larger than this limit if it contains
 46452  //  ** dirty pages or pages still in active use.
 46453  //  */
 46454  func _sqlite3BtreeSetCacheSize(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) {
 46455  	var _pBt *XBtShared
 46456  	_pBt = (*XBtShared)(_p.XpBt)
 46457  	func() {
 46458  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 46459  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61662), unsafe.Pointer(&_sqlite3BtreeSetCacheSizeØ00__func__Ø000), unsafe.Pointer(str(8939)))
 46460  			crt.X__builtin_abort(tls)
 46461  		}
 46462  	}()
 46463  	_sqlite3BtreeEnter(tls, _p)
 46464  	_sqlite3PagerSetCachesize(tls, (*XPager)(_pBt.XpPager), _mxPage)
 46465  	_sqlite3BtreeLeave(tls, _p)
 46466  	return int32(0)
 46467  }
 46468  
 46469  var _sqlite3BtreeSetCacheSizeØ00__func__Ø000 [25]int8
 46470  
 46471  func init() {
 46472  	crt.Xstrncpy(nil, &_sqlite3BtreeSetCacheSizeØ00__func__Ø000[0], str(59993), 25)
 46473  }
 46474  
 46475  // C comment
 46476  //  /*
 46477  //  ** Change the maximum number of in-memory pages that are allowed
 46478  //  ** before attempting to recycle clean and unused pages.
 46479  //  */
 46480  func _sqlite3PagerSetCachesize(tls *crt.TLS, _pPager *XPager, _mxPage int32) {
 46481  	_sqlite3PcacheSetCachesize(tls, (*XPCache)(_pPager.XpPCache), _mxPage)
 46482  }
 46483  
 46484  // C comment
 46485  //  /*
 46486  //  ** Set the suggested cache-size value.
 46487  //  */
 46488  func _sqlite3PcacheSetCachesize(tls *crt.TLS, _pCache *XPCache, _mxPage int32) {
 46489  	func() {
 46490  		if _pCache.XpCache == nil {
 46491  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44939), unsafe.Pointer(&_sqlite3PcacheSetCachesizeØ00__func__Ø000), unsafe.Pointer(str(15913)))
 46492  			crt.X__builtin_abort(tls)
 46493  		}
 46494  	}()
 46495  	_pCache.XszCache = _mxPage
 46496  	(_sqlite3Config.Xpcache2.XxCachesize)(tls, _pCache.XpCache, _numberOfCachePages(tls, _pCache))
 46497  }
 46498  
 46499  var _sqlite3PcacheSetCachesizeØ00__func__Ø000 [26]int8
 46500  
 46501  func init() {
 46502  	crt.Xstrncpy(nil, &_sqlite3PcacheSetCachesizeØ00__func__Ø000[0], str(60018), 26)
 46503  }
 46504  
 46505  // C comment
 46506  //  /*
 46507  //  ** Execute SQL code.  Return one of the SQLITE_ success/failure
 46508  //  ** codes.  Also write an error message into memory obtained from
 46509  //  ** malloc() and make *pzErrMsg point to that message.
 46510  //  **
 46511  //  ** If the SQL is a query, then for each row in the query result
 46512  //  ** the xCallback() function is called.  pArg becomes the first
 46513  //  ** argument to xCallback().  If xCallback=NULL then no callback
 46514  //  ** is invoked, even for queries.
 46515  //  */
 46516  func Xsqlite3_exec(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _xCallback func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, _pArg unsafe.Pointer, _pzErrMsg **int8) (r0 int32) {
 46517  	var _rc, _callbackIsInit, _1_nCol, _4_i, _14_nErrMsg int32
 46518  	var _zLeftover *int8
 46519  	var _pStmt unsafe.Pointer
 46520  	var _azCols, _1_azVals **int8
 46521  	_rc = int32(0)
 46522  	_pStmt = nil
 46523  	_azCols = nil
 46524  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 46525  		return _sqlite3MisuseError(tls, int32(111141))
 46526  	}
 46527  	if _zSql == nil {
 46528  		_zSql = str(284)
 46529  	}
 46530  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46531  	_sqlite3Error(tls, _db, int32(0))
 46532  _2:
 46533  	if _rc != int32(0) || (*elem1(_zSql, 0)) == 0 {
 46534  		goto _exec_out
 46535  	}
 46536  	_1_azVals = nil
 46537  	_pStmt = nil
 46538  	_rc = Xsqlite3_prepare_v2(tls, _db, _zSql, int32(-1), &_pStmt, &_zLeftover)
 46539  	func() {
 46540  		if _rc != int32(0) && _pStmt != nil {
 46541  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(111152), unsafe.Pointer(&_sqlite3_execØ00__func__Ø000), unsafe.Pointer(str(60044)))
 46542  			crt.X__builtin_abort(tls)
 46543  		}
 46544  	}()
 46545  	if _rc != int32(0) {
 46546  		goto _2
 46547  	}
 46548  	if _pStmt == nil {
 46549  		_zSql = _zLeftover
 46550  		goto _2
 46551  	}
 46552  	_callbackIsInit = int32(0)
 46553  	_1_nCol = Xsqlite3_column_count(tls, _pStmt)
 46554  _10:
 46555  	_rc = Xsqlite3_step(tls, _pStmt)
 46556  	if _xCallback == nil || int32(100) != _rc && (int32(101) != _rc || _callbackIsInit != 0 || (_db.Xflags&int32(256)) == 0) {
 46557  		goto _16
 46558  	}
 46559  	if _callbackIsInit != 0 {
 46560  		goto _17
 46561  	}
 46562  	_azCols = (**int8)(_sqlite3DbMallocRaw(tls, _db, uint64((int32(2)*_1_nCol)+int32(1))*uint64(8)))
 46563  	if _azCols == nil {
 46564  		goto _exec_out
 46565  	}
 46566  	_4_i = int32(0)
 46567  _19:
 46568  	if _4_i >= _1_nCol {
 46569  		goto _22
 46570  	}
 46571  	*elem0(_azCols, uintptr(_4_i)) = Xsqlite3_column_name(tls, _pStmt, _4_i)
 46572  	func() {
 46573  		if (*elem0(_azCols, uintptr(_4_i))) == nil {
 46574  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(111182), unsafe.Pointer(&_sqlite3_execØ00__func__Ø000), unsafe.Pointer(str(60070)))
 46575  			crt.X__builtin_abort(tls)
 46576  		}
 46577  	}()
 46578  	_4_i += 1
 46579  	goto _19
 46580  _22:
 46581  	_callbackIsInit = int32(1)
 46582  _17:
 46583  	if _rc != int32(100) {
 46584  		goto _25
 46585  	}
 46586  	_1_azVals = elem0(_azCols, uintptr(_1_nCol))
 46587  	_4_i = int32(0)
 46588  _26:
 46589  	if _4_i >= _1_nCol {
 46590  		goto _29
 46591  	}
 46592  	*elem0(_1_azVals, uintptr(_4_i)) = (*int8)(unsafe.Pointer(Xsqlite3_column_text(tls, _pStmt, _4_i)))
 46593  	if ((*elem0(_1_azVals, uintptr(_4_i))) == nil) && (Xsqlite3_column_type(tls, _pStmt, _4_i) != int32(5)) {
 46594  		_sqlite3OomFault(tls, _db)
 46595  		goto _exec_out
 46596  	}
 46597  	_4_i += 1
 46598  	goto _26
 46599  _29:
 46600  	*elem0(_1_azVals, uintptr(_4_i)) = nil
 46601  _25:
 46602  	if _xCallback(tls, _pArg, _1_nCol, _1_azVals, _azCols) != 0 {
 46603  		_rc = int32(4)
 46604  		_sqlite3VdbeFinalize(tls, (*TVdbe)(_pStmt))
 46605  		_pStmt = nil
 46606  		_sqlite3Error(tls, _db, int32(4))
 46607  		goto _exec_out
 46608  	}
 46609  _16:
 46610  	if _rc == int32(100) {
 46611  		goto _33
 46612  	}
 46613  	_rc = _sqlite3VdbeFinalize(tls, (*TVdbe)(_pStmt))
 46614  	_pStmt = nil
 46615  	_zSql = _zLeftover
 46616  _34:
 46617  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zSql, 0))))) & int32(1)) != 0 {
 46618  		*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 46619  		goto _34
 46620  	}
 46621  	goto _11
 46622  _33:
 46623  	goto _10
 46624  _11:
 46625  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_azCols))
 46626  	_azCols = nil
 46627  	goto _2
 46628  _exec_out:
 46629  	if _pStmt != nil {
 46630  		_sqlite3VdbeFinalize(tls, (*TVdbe)(_pStmt))
 46631  	}
 46632  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_azCols))
 46633  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 46634  	if _rc == int32(0) || _pzErrMsg == nil {
 46635  		goto _38
 46636  	}
 46637  	_14_nErrMsg = int32(1) + _sqlite3Strlen30(tls, Xsqlite3_errmsg(tls, _db))
 46638  	*_pzErrMsg = (*int8)(_sqlite3Malloc(tls, uint64(_14_nErrMsg)))
 46639  	if (*_pzErrMsg) != nil {
 46640  		crt.Xmemcpy(tls, unsafe.Pointer(*_pzErrMsg), unsafe.Pointer(Xsqlite3_errmsg(tls, _db)), uint64(_14_nErrMsg))
 46641  		goto _40
 46642  	}
 46643  	_rc = _sqlite3NomemError(tls, int32(111233))
 46644  	_sqlite3Error(tls, _db, int32(7))
 46645  _40:
 46646  	goto _42
 46647  _38:
 46648  	if _pzErrMsg != nil {
 46649  		*_pzErrMsg = nil
 46650  	}
 46651  _42:
 46652  	func() {
 46653  		if (_rc & _db.XerrMask) != _rc {
 46654  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(111240), unsafe.Pointer(&_sqlite3_execØ00__func__Ø000), unsafe.Pointer(str(50618)))
 46655  			crt.X__builtin_abort(tls)
 46656  		}
 46657  	}()
 46658  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46659  	return _rc
 46660  }
 46661  
 46662  func Xsqlite3_prepare_v2(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
 46663  	var _rc int32
 46664  	_rc = _sqlite3LockAndPrepare(tls, _db, _zSql, _nBytes, int32(1), nil, _ppStmt, _pzTail)
 46665  	func() {
 46666  		if _rc != int32(0) && _ppStmt != nil && (*_ppStmt) != nil {
 46667  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116426), unsafe.Pointer(&_sqlite3_prepare_v2Ø00__func__Ø000), unsafe.Pointer(str(50419)))
 46668  			crt.X__builtin_abort(tls)
 46669  		}
 46670  	}()
 46671  	return _rc
 46672  }
 46673  
 46674  var _sqlite3_prepare_v2Ø00__func__Ø000 [19]int8
 46675  
 46676  func init() {
 46677  	crt.Xstrncpy(nil, &_sqlite3_prepare_v2Ø00__func__Ø000[0], str(60083), 19)
 46678  }
 46679  
 46680  var _sqlite3_execØ00__func__Ø000 [13]int8
 46681  
 46682  func init() {
 46683  	crt.Xstrncpy(nil, &_sqlite3_execØ00__func__Ø000[0], str(60102), 13)
 46684  }
 46685  
 46686  // C comment
 46687  //  /*
 46688  //  ** This is the top-level implementation of sqlite3_step().  Call
 46689  //  ** sqlite3Step() to do most of the work.  If a schema error occurs,
 46690  //  ** call sqlite3Reprepare() and try again.
 46691  //  */
 46692  func Xsqlite3_step(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 46693  	var _rc, _rc2, _cnt, _2_savedPc int32
 46694  	var _3_zErr *int8
 46695  	var _db *Xsqlite3
 46696  	var _v *TVdbe
 46697  	_rc = int32(0)
 46698  	_rc2 = int32(0)
 46699  	_v = (*TVdbe)(_pStmt)
 46700  	_cnt = int32(0)
 46701  	if _vdbeSafetyNotNull(tls, _v) != 0 {
 46702  		return _sqlite3MisuseError(tls, int32(76755))
 46703  	}
 46704  	_db = (*Xsqlite3)(_v.Xdb)
 46705  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46706  	storebits26(&_v.Xexpired, 0, 2, 1)
 46707  _1:
 46708  	if store2(&_rc, _sqlite3Step(tls, _v)) != int32(17) || postInc2(&_cnt, 1) >= int32(50) {
 46709  		goto _2
 46710  	}
 46711  	_2_savedPc = _v.Xpc
 46712  	_rc2 = store2(&_rc, _sqlite3Reprepare(tls, _v))
 46713  	if _rc != int32(0) {
 46714  		goto _2
 46715  	}
 46716  	Xsqlite3_reset(tls, _pStmt)
 46717  	if _2_savedPc >= int32(0) {
 46718  		storebits26(&_v.Xexpired, int16(1), 2, 1)
 46719  	}
 46720  	func() {
 46721  		if int32((uint32(_v.Xexpired)<<31)>>31) != int32(0) {
 46722  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76767), unsafe.Pointer(&_sqlite3_stepØ00__func__Ø000), unsafe.Pointer(str(60115)))
 46723  			crt.X__builtin_abort(tls)
 46724  		}
 46725  	}()
 46726  	goto _1
 46727  _2:
 46728  	if _rc2 == int32(0) {
 46729  		goto _8
 46730  	}
 46731  	_3_zErr = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, (*XMem)(_db.XpErr))))
 46732  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_v.XzErrMsg))
 46733  	if _db.XmallocFailed == 0 {
 46734  		_v.XzErrMsg = _sqlite3DbStrDup(tls, _db, _3_zErr)
 46735  		_v.Xrc = _rc2
 46736  		goto _10
 46737  	}
 46738  	_v.XzErrMsg = nil
 46739  	_v.Xrc = store2(&_rc, _sqlite3NomemError(tls, int32(76785)))
 46740  _10:
 46741  _8:
 46742  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 46743  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46744  	return _rc
 46745  
 46746  	_ = _cnt
 46747  	panic(0)
 46748  }
 46749  
 46750  // C comment
 46751  //  /*
 46752  //  ** Execute the statement pStmt, either until a row of data is ready, the
 46753  //  ** statement is completely executed or an error occurs.
 46754  //  **
 46755  //  ** This routine implements the bulk of the logic behind the sqlite_step()
 46756  //  ** API.  The only thing omitted is the automatic recompile if a
 46757  //  ** schema change has occurred.  That detail is handled by the
 46758  //  ** outer sqlite3_step() wrapper procedure.
 46759  //  */
 46760  func _sqlite3Step(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 46761  	var _rc int32
 46762  	var _db *Xsqlite3
 46763  	func() {
 46764  		if _p == nil {
 46765  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76621), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(9615)))
 46766  			crt.X__builtin_abort(tls)
 46767  		}
 46768  	}()
 46769  	if _p.Xmagic != uint32(770837923) {
 46770  		Xsqlite3_reset(tls, unsafe.Pointer(_p))
 46771  	}
 46772  	_db = (*Xsqlite3)(_p.Xdb)
 46773  	if _db.XmallocFailed != 0 {
 46774  		_p.Xrc = int32(7)
 46775  		return _sqlite3NomemError(tls, int32(76654))
 46776  	}
 46777  	if (_p.Xpc <= int32(0)) && (((uint32(_p.Xexpired) << 31) >> 31) != 0) {
 46778  		_p.Xrc = int32(17)
 46779  		_rc = int32(1)
 46780  		goto _end_of_step
 46781  	}
 46782  	if _p.Xpc >= int32(0) {
 46783  		goto _6
 46784  	}
 46785  	if _db.XnVdbeActive == int32(0) {
 46786  		*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(0)
 46787  	}
 46788  	func() {
 46789  		if _db.XnVdbeWrite <= int32(0) && int32(_db.XautoCommit) != int32(0) && (_db.XnDeferredCons != (0) || _db.XnDeferredImmCons != (0)) {
 46790  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76671), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(60129)))
 46791  			crt.X__builtin_abort(tls)
 46792  		}
 46793  	}()
 46794  	if (((_db.XxProfile != nil) || ((int32(_db.XmTrace) & int32(2)) != int32(0))) && ((_db.Xinit.Xbusy) == 0)) && (_p.XzSql != nil) {
 46795  		_sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)(_db.XpVfs), &_p.XstartTime)
 46796  		goto _17
 46797  	}
 46798  	func() {
 46799  		if _p.XstartTime != (0) {
 46800  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76680), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(60220)))
 46801  			crt.X__builtin_abort(tls)
 46802  		}
 46803  	}()
 46804  _17:
 46805  	_db.XnVdbeActive += 1
 46806  	if int32((uint32(_p.Xexpired>>7)<<31)>>31) == int32(0) {
 46807  		_db.XnVdbeWrite += 1
 46808  	}
 46809  	if ((uint32(_p.Xexpired>>8) << 31) >> 31) != 0 {
 46810  		_db.XnVdbeRead += 1
 46811  	}
 46812  	_p.Xpc = int32(0)
 46813  _6:
 46814  	_p.XrcApp = int32(0)
 46815  	if ((uint32(_p.Xexpired>>2) << 30) >> 30) != 0 {
 46816  		_rc = _sqlite3VdbeList(tls, _p)
 46817  		goto _23
 46818  	}
 46819  	_db.XnVdbeExec += 1
 46820  	_rc = _sqlite3VdbeExec(tls, _p)
 46821  	_db.XnVdbeExec -= 1
 46822  _23:
 46823  	if _rc == int32(100) {
 46824  		goto _25
 46825  	}
 46826  	if _p.XstartTime > (0) {
 46827  		_invokeProfileCallback(tls, _db, _p)
 46828  	}
 46829  _25:
 46830  	if _rc != int32(101) {
 46831  		goto _26
 46832  	}
 46833  	func() {
 46834  		if _p.Xrc != int32(0) {
 46835  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76709), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(60236)))
 46836  			crt.X__builtin_abort(tls)
 46837  		}
 46838  	}()
 46839  	_p.Xrc = _doWalCallbacks(tls, _db)
 46840  	if _p.Xrc != int32(0) {
 46841  		_rc = int32(1)
 46842  	}
 46843  _26:
 46844  	_db.XerrCode = _rc
 46845  	if int32(7) == _sqlite3ApiExit(tls, (*Xsqlite3)(_p.Xdb), _p.Xrc) {
 46846  		_p.Xrc = _sqlite3NomemError(tls, int32(76718))
 46847  	}
 46848  _end_of_step:
 46849  	func() {
 46850  		if _rc != int32(100) && _rc != int32(101) && _rc != int32(1) && (_rc&int32(255)) != int32(5) && _rc != int32(21) {
 46851  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76728), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(60253)))
 46852  			crt.X__builtin_abort(tls)
 46853  		}
 46854  	}()
 46855  	func() {
 46856  		if (_p.Xrc == int32(100) || _p.Xrc == int32(101)) && _p.Xrc != _p.XrcApp {
 46857  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76731), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(60354)))
 46858  			crt.X__builtin_abort(tls)
 46859  		}
 46860  	}()
 46861  	if ((((uint32(_p.Xexpired>>9) << 31) >> 31) != 0) && (_rc != int32(100))) && (_rc != int32(101)) {
 46862  		_rc = _sqlite3VdbeTransferError(tls, _p)
 46863  	}
 46864  	return _rc & _db.XerrMask
 46865  }
 46866  
 46867  var _sqlite3StepØ00__func__Ø000 [12]int8
 46868  
 46869  func init() {
 46870  	crt.Xstrncpy(nil, &_sqlite3StepØ00__func__Ø000[0], str(60415), 12)
 46871  }
 46872  
 46873  // C comment
 46874  //  /*
 46875  //  ** Terminate the current execution of an SQL statement and reset it
 46876  //  ** back to its starting state so that it can be reused. A success code from
 46877  //  ** the prior execution is returned.
 46878  //  **
 46879  //  ** This routine sets the error code and string returned by
 46880  //  ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
 46881  //  */
 46882  func Xsqlite3_reset(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 46883  	var _rc int32
 46884  	var _2_db *Xsqlite3
 46885  	var _2_v *TVdbe
 46886  	if _pStmt == nil {
 46887  		_rc = int32(0)
 46888  		goto _1
 46889  	}
 46890  	_2_v = (*TVdbe)(_pStmt)
 46891  	_2_db = (*Xsqlite3)(_2_v.Xdb)
 46892  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_2_db.Xmutex))
 46893  	if _2_v.XstartTime > (0) {
 46894  		_invokeProfileCallback(tls, _2_db, _2_v)
 46895  	}
 46896  	_rc = _sqlite3VdbeReset(tls, _2_v)
 46897  	_sqlite3VdbeRewind(tls, _2_v)
 46898  	func() {
 46899  		if (_rc & _2_db.XerrMask) != _rc {
 46900  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76231), unsafe.Pointer(&_sqlite3_resetØ00__func__Ø000), unsafe.Pointer(str(60427)))
 46901  			crt.X__builtin_abort(tls)
 46902  		}
 46903  	}()
 46904  	_rc = _sqlite3ApiExit(tls, _2_db, _rc)
 46905  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_2_db.Xmutex))
 46906  _1:
 46907  	return _rc
 46908  }
 46909  
 46910  // C comment
 46911  //  /*
 46912  //  ** Rewind the VDBE back to the beginning in preparation for
 46913  //  ** running it.
 46914  //  */
 46915  func _sqlite3VdbeRewind(tls *crt.TLS, _p *TVdbe) {
 46916  	var _i int32
 46917  	func() {
 46918  		if _p == nil {
 46919  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73299), unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000), unsafe.Pointer(str(807)))
 46920  			crt.X__builtin_abort(tls)
 46921  		}
 46922  	}()
 46923  	func() {
 46924  		if _p.Xmagic != uint32(381479589) && _p.Xmagic != uint32(1224384374) {
 46925  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73300), unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000), unsafe.Pointer(str(60452)))
 46926  			crt.X__builtin_abort(tls)
 46927  		}
 46928  	}()
 46929  	func() {
 46930  		if _p.XnOp <= int32(0) {
 46931  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73304), unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000), unsafe.Pointer(str(41671)))
 46932  			crt.X__builtin_abort(tls)
 46933  		}
 46934  	}()
 46935  	_p.Xmagic = uint32(770837923)
 46936  	_i = int32(0)
 46937  _7:
 46938  	if _i >= _p.XnMem {
 46939  		goto _10
 46940  	}
 46941  	func() {
 46942  		if (*Xsqlite3)(elem25((*XMem)(_p.XaMem), uintptr(_i)).Xdb) != (*Xsqlite3)(_p.Xdb) {
 46943  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73311), unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000), unsafe.Pointer(str(60508)))
 46944  			crt.X__builtin_abort(tls)
 46945  		}
 46946  	}()
 46947  	_i += 1
 46948  	goto _7
 46949  _10:
 46950  	_p.Xpc = int32(-1)
 46951  	_p.Xrc = int32(0)
 46952  	_p.XerrorAction = uint8(2)
 46953  	_p.XnChange = int32(0)
 46954  	_p.XcacheCtr = uint32(1)
 46955  	_p.XminWriteFileFormat = uint8(255)
 46956  	_p.XiStatement = int32(0)
 46957  	_p.XnFkConstraint = 0
 46958  }
 46959  
 46960  var _sqlite3VdbeRewindØ00__func__Ø000 [18]int8
 46961  
 46962  func init() {
 46963  	crt.Xstrncpy(nil, &_sqlite3VdbeRewindØ00__func__Ø000[0], str(60529), 18)
 46964  }
 46965  
 46966  var _sqlite3_resetØ00__func__Ø000 [14]int8
 46967  
 46968  func init() {
 46969  	crt.Xstrncpy(nil, &_sqlite3_resetØ00__func__Ø000[0], str(60547), 14)
 46970  }
 46971  
 46972  // C comment
 46973  //  /*
 46974  //  ** Give a listing of the program in the virtual machine.
 46975  //  **
 46976  //  ** The interface is the same as sqlite3VdbeExec().  But instead of
 46977  //  ** running the code, it invokes the callback once for each instruction.
 46978  //  ** This feature is used to implement "EXPLAIN".
 46979  //  **
 46980  //  ** When p->explain==1, each instruction is listed.  When
 46981  //  ** p->explain==2, only OP_Explain instructions are listed and these
 46982  //  ** are shown in a different format.  p->explain==2 is used to implement
 46983  //  ** EXPLAIN QUERY PLAN.
 46984  //  **
 46985  //  ** When p->explain==1, first the main program is listed, then each of
 46986  //  ** the trigger subprograms are listed one by one.
 46987  //  */
 46988  func _sqlite3VdbeList(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 46989  	var _nRow, _nSub, _i, _rc, _10_j, _13_nByte, _13_j int32
 46990  	var _8_zP4 *int8
 46991  	var _db *Xsqlite3
 46992  	var _pSub, _pMem *XMem
 46993  	var _8_pOp *XVdbeOp
 46994  	var _apSub **XSubProgram
 46995  	_nSub = int32(0)
 46996  	_apSub = nil
 46997  	_pSub = nil
 46998  	_db = (*Xsqlite3)(_p.Xdb)
 46999  	_rc = int32(0)
 47000  	_pMem = elem25((*XMem)(_p.XaMem), uintptr(1))
 47001  	func() {
 47002  		if ((uint32(_p.Xexpired>>2) << 30) >> 30) == 0 {
 47003  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73035), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60561)))
 47004  			crt.X__builtin_abort(tls)
 47005  		}
 47006  	}()
 47007  	func() {
 47008  		if _p.Xmagic != uint32(770837923) {
 47009  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73036), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60572)))
 47010  			crt.X__builtin_abort(tls)
 47011  		}
 47012  	}()
 47013  	func() {
 47014  		if _p.Xrc != int32(0) && _p.Xrc != int32(5) && _p.Xrc != int32(7) {
 47015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73037), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60597)))
 47016  			crt.X__builtin_abort(tls)
 47017  		}
 47018  	}()
 47019  	_releaseMemArray(tls, _pMem, int32(8))
 47020  	*(**XMem)(unsafe.Pointer(&_p.XpResultSet)) = nil
 47021  	if _p.Xrc == _sqlite3NomemError(tls, int32(73046)) {
 47022  		_sqlite3OomFault(tls, _db)
 47023  		return int32(1)
 47024  	}
 47025  	_nRow = _p.XnOp
 47026  	if int32((uint32(_p.Xexpired>>2)<<30)>>30) != int32(1) {
 47027  		goto _9
 47028  	}
 47029  	func() {
 47030  		if _p.XnMem <= int32(9) {
 47031  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73066), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60659)))
 47032  			crt.X__builtin_abort(tls)
 47033  		}
 47034  	}()
 47035  	_pSub = elem25((*XMem)(_p.XaMem), uintptr(9))
 47036  	if (int32(_pSub.Xflags) & int32(16)) != 0 {
 47037  		_nSub = int32(uint64(_pSub.Xn) / uint64(8))
 47038  		_apSub = (**XSubProgram)(unsafe.Pointer(_pSub.Xz))
 47039  	}
 47040  	_i = int32(0)
 47041  _13:
 47042  	if _i >= _nSub {
 47043  		goto _16
 47044  	}
 47045  	_nRow += (*elem65(_apSub, uintptr(_i))).XnOp
 47046  	_i += 1
 47047  	goto _13
 47048  _16:
 47049  _9:
 47050  	_i = postInc2(&_p.Xpc, 1)
 47051  	if ((_i < _nRow) && (int32((uint32(_p.Xexpired>>2)<<30)>>30) == int32(2))) && (int32(elem63((*XVdbeOp)(_p.XaOp), uintptr(_i)).Xopcode) != int32(165)) {
 47052  		goto _9
 47053  	}
 47054  	if _i >= _nRow {
 47055  		_p.Xrc = int32(0)
 47056  		_rc = int32(101)
 47057  		goto _23
 47058  	}
 47059  	if (*(*int32)(unsafe.Pointer(&_db.Xu1))) != 0 {
 47060  		_p.Xrc = int32(9)
 47061  		_rc = int32(1)
 47062  		_sqlite3VdbeError(tls, _p, _sqlite3ErrStr(tls, _p.Xrc))
 47063  		goto _23
 47064  	}
 47065  	if _i < _p.XnOp {
 47066  		_8_pOp = elem63((*XVdbeOp)(_p.XaOp), uintptr(_i))
 47067  		goto _25
 47068  	}
 47069  	_i -= _p.XnOp
 47070  	_10_j = int32(0)
 47071  _26:
 47072  	if _i < ((*elem65(_apSub, uintptr(_10_j))).XnOp) {
 47073  		goto _29
 47074  	}
 47075  	_i -= (*elem65(_apSub, uintptr(_10_j))).XnOp
 47076  	_10_j += 1
 47077  	goto _26
 47078  _29:
 47079  	_8_pOp = elem63((*XVdbeOp)((*elem65(_apSub, uintptr(_10_j))).XaOp), uintptr(_i))
 47080  _25:
 47081  	if int32((uint32(_p.Xexpired>>2)<<30)>>30) != int32(1) {
 47082  		goto _30
 47083  	}
 47084  	_pMem.Xflags = uint16(4)
 47085  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(_i)
 47086  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72)
 47087  	_pMem.Xflags = uint16(2562)
 47088  	_pMem.Xz = _sqlite3OpcodeName(tls, int32(_8_pOp.Xopcode))
 47089  	func() {
 47090  		if _pMem.Xz == nil {
 47091  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73113), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60669)))
 47092  			crt.X__builtin_abort(tls)
 47093  		}
 47094  	}()
 47095  	_pMem.Xn = _sqlite3Strlen30(tls, _pMem.Xz)
 47096  	_pMem.Xenc = uint8(1)
 47097  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72)
 47098  	if int32(_8_pOp.Xp4type) != int32(-13) {
 47099  		goto _33
 47100  	}
 47101  	_13_nByte = int32(uint64(_nSub+int32(1)) * uint64(8))
 47102  	_13_j = int32(0)
 47103  _34:
 47104  	if _13_j >= _nSub {
 47105  		goto _37
 47106  	}
 47107  	if (*elem65(_apSub, uintptr(_13_j))) == (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer(&_8_pOp.Xp4))) {
 47108  		goto _37
 47109  	}
 47110  	_13_j += 1
 47111  	goto _34
 47112  _37:
 47113  	if (_13_j == _nSub) && (int32(0) == _sqlite3VdbeMemGrow(tls, _pSub, _13_nByte, bool2int(_nSub != int32(0)))) {
 47114  		_apSub = (**XSubProgram)(unsafe.Pointer(_pSub.Xz))
 47115  		*elem65(_apSub, uintptr(postInc2(&_nSub, 1))) = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer(&_8_pOp.Xp4)))
 47116  		{
 47117  			p := &_pSub.Xflags
 47118  			*p = uint16(int32(*p) | int32(16))
 47119  		}
 47120  		_pSub.Xn = int32(uint64(_nSub) * uint64(8))
 47121  	}
 47122  _33:
 47123  _30:
 47124  	_pMem.Xflags = uint16(4)
 47125  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(_8_pOp.Xp1)
 47126  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72)
 47127  	_pMem.Xflags = uint16(4)
 47128  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(_8_pOp.Xp2)
 47129  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72)
 47130  	_pMem.Xflags = uint16(4)
 47131  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(_8_pOp.Xp3)
 47132  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72)
 47133  	if _sqlite3VdbeMemClearAndResize(tls, _pMem, int32(100)) != 0 {
 47134  		func() {
 47135  			if ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 47136  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73151), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60680)))
 47137  				crt.X__builtin_abort(tls)
 47138  			}
 47139  		}()
 47140  		return int32(1)
 47141  	}
 47142  	_pMem.Xflags = uint16(514)
 47143  	_8_zP4 = _displayP4(tls, _8_pOp, _pMem.Xz, _pMem.XszMalloc)
 47144  	if _8_zP4 != _pMem.Xz {
 47145  		_pMem.Xn = int32(0)
 47146  		_sqlite3VdbeMemSetStr(tls, _pMem, _8_zP4, int32(-1), uint8(1), nil)
 47147  		goto _45
 47148  	}
 47149  	func() {
 47150  		if _pMem.Xz == nil {
 47151  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73160), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60669)))
 47152  			crt.X__builtin_abort(tls)
 47153  		}
 47154  	}()
 47155  	_pMem.Xn = _sqlite3Strlen30(tls, _pMem.Xz)
 47156  	_pMem.Xenc = uint8(1)
 47157  _45:
 47158  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72)
 47159  	if int32((uint32(_p.Xexpired>>2)<<30)>>30) != int32(1) {
 47160  		goto _48
 47161  	}
 47162  	if _sqlite3VdbeMemClearAndResize(tls, _pMem, int32(4)) != 0 {
 47163  		func() {
 47164  			if ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 47165  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73168), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60680)))
 47166  				crt.X__builtin_abort(tls)
 47167  			}
 47168  		}()
 47169  		return int32(1)
 47170  	}
 47171  	_pMem.Xflags = uint16(514)
 47172  	_pMem.Xn = int32(2)
 47173  	Xsqlite3_snprintf(tls, int32(3), _pMem.Xz, str(60700), int32(_8_pOp.Xp5))
 47174  	_pMem.Xenc = uint8(1)
 47175  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72)
 47176  	if _sqlite3VdbeMemClearAndResize(tls, _pMem, int32(500)) != 0 {
 47177  		func() {
 47178  			if ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 47179  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73179), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60680)))
 47180  				crt.X__builtin_abort(tls)
 47181  			}
 47182  		}()
 47183  		return int32(1)
 47184  	}
 47185  	_pMem.Xflags = uint16(514)
 47186  	_pMem.Xn = _displayComment(tls, _8_pOp, _8_zP4, _pMem.Xz, int32(500))
 47187  	_pMem.Xenc = uint8(1)
 47188  _48:
 47189  	_p.XnResColumn = uint16(int32(8) - (int32(4) * (int32((uint32(_p.Xexpired>>2)<<30)>>30) - int32(1))))
 47190  	*(**XMem)(unsafe.Pointer(&_p.XpResultSet)) = elem25((*XMem)(_p.XaMem), uintptr(1))
 47191  	_p.Xrc = int32(0)
 47192  	_rc = int32(100)
 47193  _23:
 47194  	return _rc
 47195  }
 47196  
 47197  var _sqlite3VdbeListØ00__func__Ø000 [16]int8
 47198  
 47199  func init() {
 47200  	crt.Xstrncpy(nil, &_sqlite3VdbeListØ00__func__Ø000[0], str(60705), 16)
 47201  }
 47202  
 47203  // C comment
 47204  //  /*
 47205  //  ** Execute as much of a VDBE program as we can.
 47206  //  ** This is the core of sqlite3_step().
 47207  //  */
 47208  func _sqlite3VdbeExec(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 47209  	var _nExtraDelete, _rc, _iCompare, _3_i, _3_once, _25_pcDest, _27_pcx, _45_cnt, _51_n, _51_p1, _51_p2, _55_n, _60_i, _87_n, _88_i, _113_res, _113_res2, _140_n, _140_i, _140_p1, _140_p2, _140_idx, _140_bRev, _143_k, _143_mx, _151_v1, _151_v2, _169_c, _179_p2, _179_len, _179_i, _215_nHdr, _215_nVarint, _215_nField, _215_file_format, _215_i, _215_j, _229_p1, _229_nName, _229_iSavepoint, _229_ii, _240_isTransaction, _244_isSchemaChange, _256_desiredAutoCommit, _256_iRollback, _266_iMeta, _266_iGen, _277_iMeta, _277_iDb, _277_iCookie, _282_nField, _282_p2, _282_iDb, _282_wrFlag, _295_pgno, _303_res, _303_oc, _303_nField, _303_eqOnly, _313_i, _324_alreadyExists, _324_takeJump, _324_ii, _324_res, _334_res, _340_res, _340_cnt, _356_seekResult, _356_op, _366_opflags, _377_res, _377_nKeyCol, _390_res, _394_res, _397_res, _400_res, _406_res, _414_res, _417_i, _420_iMoved, _420_iDb, _424_nChange, _430_pgno, _430_flags, _434_iDb, _445_nRoot, _445_nErr, _454_iSet, _454_exists, _458_nMem, _458_nByte, _485_n, _486_i, _496_i, _499_eNew, _499_eOld, _515_p1, _526_nArg, _526_iQuery, _526_res, _526_i, _532_res, _536_nArg, _536_i, _548_i int32
 47210  	var _66_nByte, _73_iA, _73_iB, _94_iA, _94_iB, _215_nByte, _215_nZero, _228_nEntry, _303_iKey, _340_v, _367_iKey, _382_v, _394_sz, _408_rowid, _451_val, _479_x, _536_rowid int64
 47211  	var _73_bIntint, _113_affinity int8
 47212  	var _nVmStep, _nProgressLimit, _2_iPrior, _164_iAddr, _179_offset, _179_avail, _179_t, _215_serial_type, _215_len, _379_n, _546_newMax uint32
 47213  	var _94_uA, _179_offset64, _215_nData, _334_iKey uint64
 47214  	var _140_aPermute, _445_aRoot *int32
 47215  	var _213_zAffinity, _215_zAffinity, _229_zName, _356_zDb, _366_zDb, _434_zMaster, _434_zSql, _445_z, _499_zFilename, _517_z, _519_zTab, _548_zTrace, _550_z, _551_z *int8
 47216  	var _458_t unsafe.Pointer
 47217  	var _73_rA, _73_rB float64
 47218  	var _45_nullFlag, _73_flags, _73_type1, _73_type2, _113_flags1, _113_flags3 uint16
 47219  	var _resetSchemaOnFault, _encoding, _11_opProperty, _94_op, _514_isWriteLock, _538_vtabOnConflict, _557_opProperty uint8
 47220  	var _179_zData, _179_zHdr, _179_zEndHdr, _215_zNewRecord *uint8
 47221  	var _496_aRes [3]int32
 47222  	var _db *Xsqlite3
 47223  	var _266_pBt, _282_pX, _499_pBt, _509_pBt, _546_pBt *XBtree
 47224  	var _278_pDb, _282_pDb, _430_pDb *XDb
 47225  	var _499_pPager *XPager
 47226  	var _356_pTab, _366_pTab *XTable
 47227  	var _528_sContext Xsqlite3_context
 47228  	var _87_pCtx, _88_pCtx, _485_pCtx, _486_pCtx *Xsqlite3_context
 47229  	var _179_sMem, _486_t, _519_sMem XMem
 47230  	var _aMem, _pIn1, _pIn2, _pIn3, _pOut, _49_pVar, _60_pMem, _179_pDest, _179_pReg, _215_pRec, _215_pData0, _215_pLast, _340_pMem, _356_pData, _356_pKey, _445_pnErr, _458_pRt, _458_pMem, _458_pEnd, _465_pIn, _486_pMem, _493_pMem, _496_pMem, _526_pQuery, _526_pArgc, _528_pDest, _535_pName, _536_pX *XMem
 47231  	var _526_apArg, _536_apArg **XMem
 47232  	var _179_aOffset *uint32
 47233  	var _179_pCrsr, _228_pCrsr, _334_pCrsr, _379_pCrsr, _390_pCrsr, _394_pCrsr, _397_pCrsr, _406_pCrsr *XBtCursor
 47234  	var _324_pFree, _324_pIdxKey *XUnpackedRecord
 47235  	var _303_r, _324_r, _406_r, _414_r XUnpackedRecord
 47236  	var _140_pKeyInfo, _282_pKeyInfo, _292_pKeyInfo *XKeyInfo
 47237  	var _356_x, _403_x XBtreePayload
 47238  	var _27_pFrame, _340_pFrame, _458_pFrame, _465_pFrame, _473_pFrame *XVdbeFrame
 47239  	var _aOp, _pOp, _pOrigOp, _24_pCaller *XVdbeOp
 47240  	var _458_pProgram *XSubProgram
 47241  	var _518_pVTab *XVTable
 47242  	var _140_pColl *XCollSeq
 47243  	var _382_pVtab, _522_pVtab, _526_pVtab, _528_pVtab, _532_pVtab, _535_pVtab, _536_pVtab *Xsqlite3_vtab
 47244  	var _179_pC, _282_pCur, _291_pOrig, _291_pCx, _292_pCx, _298_pCx, _299_pC, _301_pCx, _303_pC, _324_pC, _334_pC, _340_pC, _356_pC, _366_pC, _377_pC, _378_pC, _379_pC, _382_pC, _388_pC, _390_pC, _394_pC, _397_pC, _400_pC, _403_pC, _406_pC, _408_pC, _408_pTabCur, _414_pC, _427_pC, _522_pCur, _526_pCur, _528_pCur, _532_pCur *XVdbeCursor
 47245  	var _522_pVCur, _526_pVCur *Xsqlite3_vtab_cursor
 47246  	var _382_pModule, _522_pModule, _526_pModule, _528_pModule, _532_pModule, _536_pModule *Xsqlite3_module
 47247  	var _229_pNew, _229_pSavepoint, _229_pTmp *XSavepoint
 47248  	var _434_initData XInitData
 47249  	var _550_x func(*crt.TLS, unsafe.Pointer, *int8)
 47250  	_aOp = (*XVdbeOp)(_p.XaOp)
 47251  	_pOp = _aOp
 47252  	_nExtraDelete = int32(0)
 47253  	_rc = int32(0)
 47254  	_db = (*Xsqlite3)(_p.Xdb)
 47255  	_resetSchemaOnFault = uint8(0)
 47256  	_encoding = _db.Xenc
 47257  	_iCompare = int32(0)
 47258  	_nVmStep = uint32(0)
 47259  	_nProgressLimit = uint32(0)
 47260  	_aMem = (*XMem)(_p.XaMem)
 47261  	_pIn1 = nil
 47262  	_pIn2 = nil
 47263  	_pIn3 = nil
 47264  	_pOut = nil
 47265  	func() {
 47266  		if _p.Xmagic != uint32(770837923) {
 47267  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78878), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60572)))
 47268  			crt.X__builtin_abort(tls)
 47269  		}
 47270  	}()
 47271  	_sqlite3VdbeEnter(tls, _p)
 47272  	if _p.Xrc == int32(7) {
 47273  		goto _no_mem
 47274  	}
 47275  	func() {
 47276  		if _p.Xrc != int32(0) && (_p.Xrc&int32(255)) != int32(5) {
 47277  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78885), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60721)))
 47278  			crt.X__builtin_abort(tls)
 47279  		}
 47280  	}()
 47281  	func() {
 47282  		if ((uint32(_p.Xexpired>>8)<<31)>>31) == 0 && int32((uint32(_p.Xexpired>>7)<<31)>>31) == int32(0) {
 47283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78886), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60767)))
 47284  			crt.X__builtin_abort(tls)
 47285  		}
 47286  	}()
 47287  	_p.XiCurrentTime = 0
 47288  	func() {
 47289  		if int32((uint32(_p.Xexpired>>2)<<30)>>30) != int32(0) {
 47290  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78888), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60798)))
 47291  			crt.X__builtin_abort(tls)
 47292  		}
 47293  	}()
 47294  	*(**XMem)(unsafe.Pointer(&_p.XpResultSet)) = nil
 47295  	_db.XbusyHandler.XnBusy = int32(0)
 47296  	if (*(*int32)(unsafe.Pointer(&_db.Xu1))) != 0 {
 47297  		goto _abort_due_to_interrupt
 47298  	}
 47299  	if _db.XxProgress != nil {
 47300  		_2_iPrior = *elem31((*uint32)(unsafe.Pointer(&_p.XaCounter)), uintptr(4))
 47301  		func() {
 47302  			if (0) >= _db.XnProgressOps {
 47303  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78896), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60812)))
 47304  				crt.X__builtin_abort(tls)
 47305  			}
 47306  		}()
 47307  		_nProgressLimit = _db.XnProgressOps - (_2_iPrior % _db.XnProgressOps)
 47308  	}
 47309  	_sqlite3BeginBenignMalloc(tls)
 47310  	if _p.Xpc != int32(0) || (((*Xsqlite3)(_p.Xdb).Xflags)&int32(134218753)) == int32(0) {
 47311  		goto _16
 47312  	}
 47313  	_3_once = int32(1)
 47314  	_sqlite3VdbePrintSql(tls, _p)
 47315  	if (((*Xsqlite3)(_p.Xdb).Xflags) & int32(1024)) == 0 {
 47316  		goto _17
 47317  	}
 47318  	crt.Xprintf(tls, str(60833))
 47319  	_3_i = int32(0)
 47320  _18:
 47321  	if _3_i >= _p.XnOp {
 47322  		goto _21
 47323  	}
 47324  	_sqlite3VdbePrintOp(tls, (*crt.XFILE)(Xstdout), _3_i, elem63(_aOp, uintptr(_3_i)))
 47325  	_3_i += 1
 47326  	goto _18
 47327  _21:
 47328  _17:
 47329  	if (((*Xsqlite3)(_p.Xdb).Xflags) & int32(134217728)) == 0 {
 47330  		goto _22
 47331  	}
 47332  	_3_i = int32(0)
 47333  _23:
 47334  	if _3_i >= _p.XnOp {
 47335  		goto _26
 47336  	}
 47337  	if int32(elem63(_aOp, uintptr(_3_i)).Xopcode) != int32(165) {
 47338  		goto _27
 47339  	}
 47340  	if _3_once != 0 {
 47341  		crt.Xprintf(tls, str(60856))
 47342  	}
 47343  	crt.Xprintf(tls, str(60874), unsafe.Pointer(*(**int8)(unsafe.Pointer(&(elem63(_aOp, uintptr(_3_i)).Xp4)))))
 47344  	_3_once = int32(0)
 47345  _27:
 47346  	_3_i += 1
 47347  	goto _23
 47348  _26:
 47349  _22:
 47350  	if (((*Xsqlite3)(_p.Xdb).Xflags) & int32(1)) != 0 {
 47351  		crt.Xprintf(tls, str(60878))
 47352  	}
 47353  _16:
 47354  	_sqlite3EndBenignMalloc(tls)
 47355  	_pOp = elem63(_aOp, uintptr(_p.Xpc))
 47356  _30:
 47357  	func() {
 47358  		if _rc != int32(0) {
 47359  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78930), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 47360  			crt.X__builtin_abort(tls)
 47361  		}
 47362  	}()
 47363  	func() {
 47364  		if crt.P2U(unsafe.Pointer(_pOp)) < crt.P2U(unsafe.Pointer(_aOp)) || crt.P2U(unsafe.Pointer(_pOp)) >= crt.P2U(unsafe.Pointer(elem63(_aOp, uintptr(_p.XnOp)))) {
 47365  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78932), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60891)))
 47366  			crt.X__builtin_abort(tls)
 47367  		}
 47368  	}()
 47369  	_nVmStep += 1
 47370  	if (_db.Xflags & int32(1)) != 0 {
 47371  		_sqlite3VdbePrintOp(tls, (*crt.XFILE)(Xstdout), int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/32)), _pOp)
 47372  	}
 47373  	_11_opProperty = *elem15((*uint8)(unsafe.Pointer(&_sqlite3OpcodeProperty)), uintptr(_pOp.Xopcode))
 47374  	if (int32(_11_opProperty) & int32(2)) == int32(0) {
 47375  		goto _40
 47376  	}
 47377  	func() {
 47378  		if _pOp.Xp1 <= int32(0) {
 47379  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78967), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60920)))
 47380  			crt.X__builtin_abort(tls)
 47381  		}
 47382  	}()
 47383  	func() {
 47384  		if _pOp.Xp1 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 47385  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78968), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60930)))
 47386  			crt.X__builtin_abort(tls)
 47387  		}
 47388  	}()
 47389  	func() {
 47390  		if (int32(elem25(_aMem, uintptr(_pOp.Xp1)).Xflags) & int32(128)) != int32(0) {
 47391  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78969), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60964)))
 47392  			crt.X__builtin_abort(tls)
 47393  		}
 47394  	}()
 47395  	func() {
 47396  		if _sqlite3VdbeCheckMemInvariants(tls, elem25(_aMem, uintptr(_pOp.Xp1))) == 0 {
 47397  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78970), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60991)))
 47398  			crt.X__builtin_abort(tls)
 47399  		}
 47400  	}()
 47401  	if (_db.Xflags & int32(1)) != 0 {
 47402  		_registerTrace(tls, _pOp.Xp1, elem25(_aMem, uintptr(_pOp.Xp1)))
 47403  	}
 47404  _40:
 47405  	if (int32(_11_opProperty) & int32(4)) == int32(0) {
 47406  		goto _50
 47407  	}
 47408  	func() {
 47409  		if _pOp.Xp2 <= int32(0) {
 47410  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78974), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61037)))
 47411  			crt.X__builtin_abort(tls)
 47412  		}
 47413  	}()
 47414  	func() {
 47415  		if _pOp.Xp2 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 47416  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78975), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61047)))
 47417  			crt.X__builtin_abort(tls)
 47418  		}
 47419  	}()
 47420  	func() {
 47421  		if (int32(elem25(_aMem, uintptr(_pOp.Xp2)).Xflags) & int32(128)) != int32(0) {
 47422  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78976), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61081)))
 47423  			crt.X__builtin_abort(tls)
 47424  		}
 47425  	}()
 47426  	func() {
 47427  		if _sqlite3VdbeCheckMemInvariants(tls, elem25(_aMem, uintptr(_pOp.Xp2))) == 0 {
 47428  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78977), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61108)))
 47429  			crt.X__builtin_abort(tls)
 47430  		}
 47431  	}()
 47432  	if (_db.Xflags & int32(1)) != 0 {
 47433  		_registerTrace(tls, _pOp.Xp2, elem25(_aMem, uintptr(_pOp.Xp2)))
 47434  	}
 47435  _50:
 47436  	if (int32(_11_opProperty) & int32(8)) == int32(0) {
 47437  		goto _60
 47438  	}
 47439  	func() {
 47440  		if _pOp.Xp3 <= int32(0) {
 47441  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78981), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61154)))
 47442  			crt.X__builtin_abort(tls)
 47443  		}
 47444  	}()
 47445  	func() {
 47446  		if _pOp.Xp3 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 47447  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78982), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61164)))
 47448  			crt.X__builtin_abort(tls)
 47449  		}
 47450  	}()
 47451  	func() {
 47452  		if (int32(elem25(_aMem, uintptr(_pOp.Xp3)).Xflags) & int32(128)) != int32(0) {
 47453  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78983), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61198)))
 47454  			crt.X__builtin_abort(tls)
 47455  		}
 47456  	}()
 47457  	func() {
 47458  		if _sqlite3VdbeCheckMemInvariants(tls, elem25(_aMem, uintptr(_pOp.Xp3))) == 0 {
 47459  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78984), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61225)))
 47460  			crt.X__builtin_abort(tls)
 47461  		}
 47462  	}()
 47463  	if (_db.Xflags & int32(1)) != 0 {
 47464  		_registerTrace(tls, _pOp.Xp3, elem25(_aMem, uintptr(_pOp.Xp3)))
 47465  	}
 47466  _60:
 47467  	if (int32(_11_opProperty) & int32(16)) != int32(0) {
 47468  		func() {
 47469  			if _pOp.Xp2 <= int32(0) {
 47470  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78988), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61037)))
 47471  				crt.X__builtin_abort(tls)
 47472  			}
 47473  		}()
 47474  		func() {
 47475  			if _pOp.Xp2 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 47476  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78989), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61047)))
 47477  				crt.X__builtin_abort(tls)
 47478  			}
 47479  		}()
 47480  		_sqlite3VdbeMemAboutToChange(tls, _p, elem25(_aMem, uintptr(_pOp.Xp2)))
 47481  	}
 47482  	if (int32(_11_opProperty) & int32(32)) != int32(0) {
 47483  		func() {
 47484  			if _pOp.Xp3 <= int32(0) {
 47485  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78993), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61154)))
 47486  				crt.X__builtin_abort(tls)
 47487  			}
 47488  		}()
 47489  		func() {
 47490  			if _pOp.Xp3 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 47491  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78994), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61164)))
 47492  				crt.X__builtin_abort(tls)
 47493  			}
 47494  		}()
 47495  		_sqlite3VdbeMemAboutToChange(tls, _p, elem25(_aMem, uintptr(_pOp.Xp3)))
 47496  	}
 47497  	_pOrigOp = _pOp
 47498  	switch int32(_pOp.Xopcode) {
 47499  	case int32(0):
 47500  		goto _144
 47501  	case int32(1):
 47502  		goto _145
 47503  	case int32(2):
 47504  		goto _146
 47505  	case int32(3):
 47506  		goto _184
 47507  	case int32(4):
 47508  		goto _185
 47509  	case int32(5):
 47510  		goto _185
 47511  	case int32(6):
 47512  		goto _1549
 47513  	case int32(7):
 47514  		goto _1549
 47515  	case int32(8):
 47516  		goto _225
 47517  	case int32(9):
 47518  		goto _226
 47519  	case int32(10):
 47520  		goto _227
 47521  	case int32(11):
 47522  		goto _235
 47523  	case int32(12):
 47524  		goto _239
 47525  	case int32(13):
 47526  		goto _81
 47527  	case int32(14):
 47528  		goto _82
 47529  	case int32(15):
 47530  		goto _84
 47531  	case int32(16):
 47532  		goto _86
 47533  	case int32(17):
 47534  		goto _117
 47535  	case int32(18):
 47536  		goto _129
 47537  	case int32(19):
 47538  		goto _132
 47539  	case int32(20):
 47540  		goto _134
 47541  	case int32(21):
 47542  		goto _135
 47543  	case int32(22):
 47544  		goto _135
 47545  	case int32(23):
 47546  		goto _139
 47547  	case int32(24):
 47548  		goto _159
 47549  	case int32(25):
 47550  		goto _159
 47551  	case int32(26):
 47552  		goto _159
 47553  	case int32(27):
 47554  		goto _159
 47555  	case int32(28):
 47556  		goto _163
 47557  	case int32(29):
 47558  		goto _163
 47559  	case int32(30):
 47560  		goto _163
 47561  	case int32(31):
 47562  		goto _166
 47563  	case int32(32):
 47564  		goto _1258
 47565  	case int32(33):
 47566  		goto _179
 47567  	case int32(34):
 47568  		goto _180
 47569  	case int32(35):
 47570  		goto _181
 47571  	case int32(36):
 47572  		goto _181
 47573  	case int32(37):
 47574  		goto _183
 47575  	case int32(38):
 47576  		goto _194
 47577  	case int32(39):
 47578  		goto _194
 47579  	case int32(40):
 47580  		goto _194
 47581  	case int32(41):
 47582  		goto _194
 47583  	case int32(42):
 47584  		goto _211
 47585  	case int32(43):
 47586  		goto _212
 47587  	case int32(44):
 47588  		goto _213
 47589  	case int32(45):
 47590  		goto _216
 47591  	case int32(46):
 47592  		goto _218
 47593  	case int32(47):
 47594  		goto _220
 47595  	case int32(48):
 47596  		goto _221
 47597  	case int32(49):
 47598  		goto _228
 47599  	case int32(50):
 47600  		goto _237
 47601  	case int32(51):
 47602  		goto _242
 47603  	case int32(52):
 47604  		goto _83
 47605  	case int32(53):
 47606  		goto _85
 47607  	case int32(54):
 47608  		goto _87
 47609  	case int32(55):
 47610  		goto _88
 47611  	case int32(56):
 47612  		goto _89
 47613  	case int32(57):
 47614  		goto _90
 47615  	case int32(58):
 47616  		goto _93
 47617  	case int32(59):
 47618  		goto _94
 47619  	case int32(60):
 47620  		goto _95
 47621  	case int32(61):
 47622  		goto _96
 47623  	case int32(62):
 47624  		goto _97
 47625  	case int32(63):
 47626  		goto _98
 47627  	case int32(64):
 47628  		goto _99
 47629  	case int32(65):
 47630  		goto _100
 47631  	case int32(66):
 47632  		goto _101
 47633  	case int32(67):
 47634  		goto _102
 47635  	case int32(68):
 47636  		goto _109
 47637  	case int32(69):
 47638  		goto _110
 47639  	case int32(70):
 47640  		goto _130
 47641  	case int32(71):
 47642  		goto _130
 47643  	case int32(72):
 47644  		goto _111
 47645  	case int32(73):
 47646  		goto _116
 47647  	case int32(74):
 47648  		goto _118
 47649  	case int32(75):
 47650  		goto _137
 47651  	case int32(76):
 47652  		goto _138
 47653  	case int32(77):
 47654  		goto _120
 47655  	case int32(78):
 47656  		goto _120
 47657  	case int32(79):
 47658  		goto _120
 47659  	case int32(80):
 47660  		goto _120
 47661  	case int32(81):
 47662  		goto _120
 47663  	case int32(82):
 47664  		goto _120
 47665  	case int32(83):
 47666  		goto _126
 47667  	case int32(84):
 47668  		goto _112
 47669  	case int32(85):
 47670  		goto _112
 47671  	case int32(86):
 47672  		goto _112
 47673  	case int32(87):
 47674  		goto _112
 47675  	case int32(88):
 47676  		goto _104
 47677  	case int32(89):
 47678  		goto _104
 47679  	case int32(90):
 47680  		goto _104
 47681  	case int32(91):
 47682  		goto _104
 47683  	case int32(92):
 47684  		goto _104
 47685  	case int32(93):
 47686  		goto _103
 47687  	case int32(94):
 47688  		goto _119
 47689  	case int32(95):
 47690  		goto _133
 47691  	case int32(96):
 47692  		goto _127
 47693  	case int32(97):
 47694  		goto _92
 47695  	case int32(98):
 47696  		goto _128
 47697  	case int32(99):
 47698  		goto _140
 47699  	case int32(100):
 47700  		goto _141
 47701  	case int32(101):
 47702  		goto _142
 47703  	case int32(102):
 47704  		goto _143
 47705  	case int32(103):
 47706  		goto _147
 47707  	case int32(104):
 47708  		goto _148
 47709  	case int32(105):
 47710  		goto _149
 47711  	case int32(106):
 47712  		goto _1013
 47713  	case int32(107):
 47714  		goto _1013
 47715  	case int32(108):
 47716  		goto _152
 47717  	case int32(109):
 47718  		goto _153
 47719  	case int32(110):
 47720  		goto _153
 47721  	case int32(111):
 47722  		goto _155
 47723  	case int32(112):
 47724  		goto _156
 47725  	case int32(113):
 47726  		goto _157
 47727  	case int32(114):
 47728  		goto _158
 47729  	case int32(116):
 47730  		goto _168
 47731  	case int32(117):
 47732  		goto _169
 47733  	case int32(118):
 47734  		goto _170
 47735  	case int32(119):
 47736  		goto _170
 47737  	case int32(120):
 47738  		goto _172
 47739  	case int32(121):
 47740  		goto _173
 47741  	case int32(122):
 47742  		goto _174
 47743  	case int32(123):
 47744  		goto _175
 47745  	case int32(124):
 47746  		goto _176
 47747  	case int32(125):
 47748  		goto _177
 47749  	case int32(126):
 47750  		goto _178
 47751  	case int32(127):
 47752  		goto _189
 47753  	case int32(128):
 47754  		goto _189
 47755  	case int32(129):
 47756  		goto _191
 47757  	case int32(130):
 47758  		goto _192
 47759  	case int32(131):
 47760  		goto _192
 47761  	case int32(132):
 47762  		goto _91
 47763  	case int32(133):
 47764  		goto _198
 47765  	case int32(134):
 47766  		goto _199
 47767  	case int32(135):
 47768  		goto _200
 47769  	case int32(136):
 47770  		goto _201
 47771  	case int32(137):
 47772  		goto _201
 47773  	case int32(138):
 47774  		goto _203
 47775  	case int32(139):
 47776  		goto _204
 47777  	case int32(140):
 47778  		goto _205
 47779  	case int32(141):
 47780  		goto _206
 47781  	case int32(142):
 47782  		goto _207
 47783  	case int32(143):
 47784  		goto _208
 47785  	case int32(144):
 47786  		goto _209
 47787  	case int32(145):
 47788  		goto _210
 47789  	case int32(146):
 47790  		goto _214
 47791  	case int32(147):
 47792  		goto _215
 47793  	case int32(148):
 47794  		goto _217
 47795  	case int32(149):
 47796  		goto _219
 47797  	case int32(150):
 47798  		goto _222
 47799  	case int32(151):
 47800  		goto _223
 47801  	case int32(152):
 47802  		goto _224
 47803  	case int32(153):
 47804  		goto _229
 47805  	case int32(154):
 47806  		goto _230
 47807  	case int32(155):
 47808  		goto _231
 47809  	case int32(156):
 47810  		goto _232
 47811  	case int32(157):
 47812  		goto _233
 47813  	case int32(158):
 47814  		goto _234
 47815  	case int32(159):
 47816  		goto _236
 47817  	case int32(160):
 47818  		goto _238
 47819  	case int32(161):
 47820  		goto _240
 47821  	case int32(162):
 47822  		goto _241
 47823  	default:
 47824  		goto _243
 47825  	}
 47826  
 47827  _81:
 47828  _jump_to_p2_and_check_for_interrupt:
 47829  	_pOp = elem63(_aOp, uintptr(_pOp.Xp2-int32(1)))
 47830  _check_for_interrupt:
 47831  	if (*(*int32)(unsafe.Pointer(&_db.Xu1))) != 0 {
 47832  		goto _abort_due_to_interrupt
 47833  	}
 47834  	if _db.XxProgress == nil || _nVmStep < _nProgressLimit {
 47835  		goto _246
 47836  	}
 47837  	func() {
 47838  		if _db.XnProgressOps == (0) {
 47839  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79076), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61271)))
 47840  			crt.X__builtin_abort(tls)
 47841  		}
 47842  	}()
 47843  	_nProgressLimit = (_nVmStep + _db.XnProgressOps) - (_nVmStep % _db.XnProgressOps)
 47844  	if _db.XxProgress(tls, _db.XpProgressArg) != 0 {
 47845  		_rc = int32(9)
 47846  		goto _abort_due_to_error
 47847  	}
 47848  _246:
 47849  	goto _250
 47850  _82:
 47851  	func() {
 47852  		if _pOp.Xp1 <= int32(0) || _pOp.Xp1 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 47853  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79094), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61291)))
 47854  			crt.X__builtin_abort(tls)
 47855  		}
 47856  	}()
 47857  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 47858  	func() {
 47859  		if bool2int((int32(_pIn1.Xflags)&int32(9312)) != int32(0)) != int32(0) {
 47860  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79096), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61338)))
 47861  			crt.X__builtin_abort(tls)
 47862  		}
 47863  	}()
 47864  	_sqlite3VdbeMemAboutToChange(tls, _p, _pIn1)
 47865  	_pIn1.Xflags = uint16(4)
 47866  	*(*int64)(unsafe.Pointer(&_pIn1.Xu)) = int64(int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)))
 47867  	if (_db.Xflags & int32(1)) != 0 {
 47868  		_registerTrace(tls, _pOp.Xp1, _pIn1)
 47869  	}
 47870  _jump_to_p2:
 47871  	_pOp = elem63(_aOp, uintptr(_pOp.Xp2-int32(1)))
 47872  	goto _250
 47873  _83:
 47874  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 47875  	func() {
 47876  		if int32(_pIn1.Xflags) != int32(4) {
 47877  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79116), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61362)))
 47878  			crt.X__builtin_abort(tls)
 47879  		}
 47880  	}()
 47881  	_pOp = elem63(_aOp, uintptr(*(*int64)(unsafe.Pointer(&_pIn1.Xu))))
 47882  	_pIn1.Xflags = uint16(128)
 47883  	goto _250
 47884  _84:
 47885  	func() {
 47886  		if _pOp.Xp1 <= int32(0) || _pOp.Xp1 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 47887  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79134), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61291)))
 47888  			crt.X__builtin_abort(tls)
 47889  		}
 47890  	}()
 47891  	func() {
 47892  		if _pOp.Xp2 < int32(0) || _pOp.Xp2 >= _p.XnOp {
 47893  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79135), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61383)))
 47894  			crt.X__builtin_abort(tls)
 47895  		}
 47896  	}()
 47897  	func() {
 47898  		if _pOp.Xp3 < int32(0) || _pOp.Xp3 >= _p.XnOp {
 47899  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79136), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61412)))
 47900  			crt.X__builtin_abort(tls)
 47901  		}
 47902  	}()
 47903  	_pOut = elem25(_aMem, uintptr(_pOp.Xp1))
 47904  	func() {
 47905  		if (int32(_pOut.Xflags) & int32(9312)) != int32(0) {
 47906  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79138), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61441)))
 47907  			crt.X__builtin_abort(tls)
 47908  		}
 47909  	}()
 47910  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_pOp.Xp3 - int32(1))
 47911  	_pOut.Xflags = uint16(4)
 47912  	if _pOp.Xp2 != 0 {
 47913  		goto _jump_to_p2
 47914  	}
 47915  	goto _250
 47916  _85:
 47917  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 47918  	func() {
 47919  		if int32(_pIn1.Xflags) != int32(4) {
 47920  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79156), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61362)))
 47921  			crt.X__builtin_abort(tls)
 47922  		}
 47923  	}()
 47924  	func() {
 47925  		if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) < (0) || (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) >= int64(_p.XnOp) {
 47926  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79157), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61463)))
 47927  			crt.X__builtin_abort(tls)
 47928  		}
 47929  	}()
 47930  	_24_pCaller = elem63(_aOp, uintptr(*(*int64)(unsafe.Pointer(&_pIn1.Xu))))
 47931  	func() {
 47932  		if int32(_24_pCaller.Xopcode) != int32(16) {
 47933  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79159), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61496)))
 47934  			crt.X__builtin_abort(tls)
 47935  		}
 47936  	}()
 47937  	func() {
 47938  		if _24_pCaller.Xp2 < int32(0) || _24_pCaller.Xp2 >= _p.XnOp {
 47939  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79160), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61522)))
 47940  			crt.X__builtin_abort(tls)
 47941  		}
 47942  	}()
 47943  	_pOp = elem63(_aOp, uintptr(_24_pCaller.Xp2-int32(1)))
 47944  	_pIn1.Xflags = uint16(128)
 47945  	goto _250
 47946  _86:
 47947  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 47948  	func() {
 47949  		if bool2int((int32(_pIn1.Xflags)&int32(9312)) != int32(0)) != int32(0) {
 47950  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79182), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61338)))
 47951  			crt.X__builtin_abort(tls)
 47952  		}
 47953  	}()
 47954  	_pIn1.Xflags = uint16(4)
 47955  	_25_pcDest = int32(*(*int64)(unsafe.Pointer(&_pIn1.Xu)))
 47956  	*(*int64)(unsafe.Pointer(&_pIn1.Xu)) = int64(int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)))
 47957  	if (_db.Xflags & int32(1)) != 0 {
 47958  		_registerTrace(tls, _pOp.Xp1, _pIn1)
 47959  	}
 47960  	_pOp = elem63(_aOp, uintptr(_25_pcDest))
 47961  	goto _250
 47962  _87:
 47963  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 47964  	if (int32(_pIn3.Xflags) & int32(1)) == int32(0) {
 47965  		goto _250
 47966  	}
 47967  _88:
 47968  	_27_pcx = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))
 47969  	if _pOp.Xp1 != int32(0) || _p.XpFrame == nil {
 47970  		goto _286
 47971  	}
 47972  	_27_pFrame = (*XVdbeFrame)(_p.XpFrame)
 47973  	*(**XVdbeFrame)(unsafe.Pointer(&_p.XpFrame)) = (*XVdbeFrame)(_27_pFrame.XpParent)
 47974  	_p.XnFrame -= 1
 47975  	_sqlite3VdbeSetChanges(tls, _db, _p.XnChange)
 47976  	_27_pcx = _sqlite3VdbeFrameRestore(tls, _27_pFrame)
 47977  	if _pOp.Xp2 == int32(4) {
 47978  		_27_pcx = (elem63((*XVdbeOp)(_p.XaOp), uintptr(_27_pcx)).Xp2) - int32(1)
 47979  	}
 47980  	_aOp = (*XVdbeOp)(_p.XaOp)
 47981  	_aMem = (*XMem)(_p.XaMem)
 47982  	_pOp = elem63(_aOp, uintptr(_27_pcx))
 47983  	goto _250
 47984  _286:
 47985  	_p.Xrc = _pOp.Xp1
 47986  	_p.XerrorAction = uint8(_pOp.Xp2)
 47987  	_p.Xpc = _27_pcx
 47988  	func() {
 47989  		if int32(_pOp.Xp5) > int32(4) {
 47990  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79263), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61559)))
 47991  			crt.X__builtin_abort(tls)
 47992  		}
 47993  	}()
 47994  	if _p.Xrc == 0 {
 47995  		goto _290
 47996  	}
 47997  	if _pOp.Xp5 == 0 {
 47998  		goto _291
 47999  	}
 48000  	_sqlite3VdbeError(tls, _p, str(61570), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00azTypeØ001)), uintptr(int32(_pOp.Xp5)-int32(1)))))
 48001  	if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != nil {
 48002  		_p.XzErrMsg = _sqlite3MPrintf(tls, _db, str(61591), unsafe.Pointer(_p.XzErrMsg), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pOp.Xp4))))
 48003  	}
 48004  	goto _293
 48005  _291:
 48006  	_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pOp.Xp4))))
 48007  _293:
 48008  	Xsqlite3_log(tls, _pOp.Xp1, str(61598), _27_pcx, unsafe.Pointer(_p.XzSql), unsafe.Pointer(_p.XzErrMsg))
 48009  _290:
 48010  	_rc = _sqlite3VdbeHalt(tls, _p)
 48011  	func() {
 48012  		if _rc != int32(5) && _rc != int32(0) && _rc != int32(1) {
 48013  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79282), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61622)))
 48014  			crt.X__builtin_abort(tls)
 48015  		}
 48016  	}()
 48017  	if _rc == int32(5) {
 48018  		_p.Xrc = int32(5)
 48019  		goto _299
 48020  	}
 48021  	func() {
 48022  		if _rc != int32(0) && (_p.Xrc&int32(255)) != int32(19) {
 48023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79286), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61675)))
 48024  			crt.X__builtin_abort(tls)
 48025  		}
 48026  	}()
 48027  	func() {
 48028  		if _rc != int32(0) && _db.XnDeferredCons <= (0) && _db.XnDeferredImmCons <= (0) {
 48029  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79287), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61724)))
 48030  			crt.X__builtin_abort(tls)
 48031  		}
 48032  	}()
 48033  	_rc = func() int32 {
 48034  		if _p.Xrc != 0 {
 48035  			return int32(1)
 48036  		}
 48037  		return int32(101)
 48038  	}()
 48039  _299:
 48040  	goto _vdbe_return
 48041  _89:
 48042  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48043  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_pOp.Xp1)
 48044  	goto _250
 48045  _90:
 48046  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48047  	func() {
 48048  		if (*(**int64)(unsafe.Pointer(&_pOp.Xp4))) == nil {
 48049  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79312), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61787)))
 48050  			crt.X__builtin_abort(tls)
 48051  		}
 48052  	}()
 48053  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = *(*(**int64)(unsafe.Pointer(&_pOp.Xp4)))
 48054  	goto _250
 48055  _91:
 48056  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48057  	_pOut.Xflags = uint16(8)
 48058  	func() {
 48059  		if _sqlite3IsNaN(tls, *(*(**float64)(unsafe.Pointer(&_pOp.Xp4)))) != 0 {
 48060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79327), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61803)))
 48061  			crt.X__builtin_abort(tls)
 48062  		}
 48063  	}()
 48064  	*(*float64)(unsafe.Pointer(&_pOut.Xu)) = *(*(**float64)(unsafe.Pointer(&_pOp.Xp4)))
 48065  	goto _250
 48066  _92:
 48067  	func() {
 48068  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) == nil {
 48069  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79342), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61833)))
 48070  			crt.X__builtin_abort(tls)
 48071  		}
 48072  	}()
 48073  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48074  	_pOp.Xopcode = uint8(58)
 48075  	_pOp.Xp1 = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 48076  	if int32(_encoding) == int32(1) {
 48077  		goto _315
 48078  	}
 48079  	_rc = _sqlite3VdbeMemSetStr(tls, _pOut, *(**int8)(unsafe.Pointer(&_pOp.Xp4)), int32(-1), uint8(1), nil)
 48080  	func() {
 48081  		if _rc != int32(0) && _rc != int32(18) {
 48082  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79350), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61846)))
 48083  			crt.X__builtin_abort(tls)
 48084  		}
 48085  	}()
 48086  	if int32(0) != _sqlite3VdbeChangeEncoding(tls, _pOut, int32(_encoding)) {
 48087  		goto _no_mem
 48088  	}
 48089  	func() {
 48090  		if _pOut.XszMalloc <= int32(0) || _pOut.XzMalloc != _pOut.Xz {
 48091  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79352), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61881)))
 48092  			crt.X__builtin_abort(tls)
 48093  		}
 48094  	}()
 48095  	func() {
 48096  		if bool2int((int32(_pOut.Xflags)&int32(9312)) != int32(0)) != int32(0) {
 48097  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79353), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61924)))
 48098  			crt.X__builtin_abort(tls)
 48099  		}
 48100  	}()
 48101  	_pOut.XszMalloc = int32(0)
 48102  	{
 48103  		p := &_pOut.Xflags
 48104  		*p = uint16(int32(*p) | int32(2048))
 48105  	}
 48106  	if int32(_pOp.Xp4type) == int32(-1) {
 48107  		_sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pOp.Xp4))))
 48108  	}
 48109  	_pOp.Xp4type = int8(-1)
 48110  	*(**int8)(unsafe.Pointer(&_pOp.Xp4)) = _pOut.Xz
 48111  	_pOp.Xp1 = _pOut.Xn
 48112  _315:
 48113  	if _pOp.Xp1 > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
 48114  		goto _too_big
 48115  	}
 48116  	func() {
 48117  		if _rc != int32(0) {
 48118  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79368), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 48119  			crt.X__builtin_abort(tls)
 48120  		}
 48121  	}()
 48122  _93:
 48123  	func() {
 48124  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) == nil {
 48125  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79385), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61833)))
 48126  			crt.X__builtin_abort(tls)
 48127  		}
 48128  	}()
 48129  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48130  	_pOut.Xflags = uint16(2562)
 48131  	_pOut.Xz = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 48132  	_pOut.Xn = _pOp.Xp1
 48133  	_pOut.Xenc = _encoding
 48134  	if _pOp.Xp3 <= int32(0) {
 48135  		goto _331
 48136  	}
 48137  	func() {
 48138  		if _pOp.Xp3 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 48139  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79394), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61164)))
 48140  			crt.X__builtin_abort(tls)
 48141  		}
 48142  	}()
 48143  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 48144  	func() {
 48145  		if (int32(_pIn3.Xflags) & int32(4)) == 0 {
 48146  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79396), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61948)))
 48147  			crt.X__builtin_abort(tls)
 48148  		}
 48149  	}()
 48150  	if (*(*int64)(unsafe.Pointer(&_pIn3.Xu))) == int64(_pOp.Xp5) {
 48151  		_pOut.Xflags = uint16(2576)
 48152  	}
 48153  _331:
 48154  	goto _250
 48155  _94:
 48156  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48157  	_45_cnt = _pOp.Xp3 - _pOp.Xp2
 48158  	func() {
 48159  		if _pOp.Xp3 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 48160  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79420), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61164)))
 48161  			crt.X__builtin_abort(tls)
 48162  		}
 48163  	}()
 48164  	_pOut.Xflags = store78(&_45_nullFlag, uint16(func() int32 {
 48165  		if _pOp.Xp1 != 0 {
 48166  			return int32(257)
 48167  		}
 48168  		return int32(1)
 48169  	}()))
 48170  	_pOut.Xn = int32(0)
 48171  _341:
 48172  	if _45_cnt > int32(0) {
 48173  		*(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(72)
 48174  		_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 48175  		_sqlite3VdbeMemSetNull(tls, _pOut)
 48176  		_pOut.Xflags = _45_nullFlag
 48177  		_pOut.Xn = int32(0)
 48178  		_45_cnt -= 1
 48179  		goto _341
 48180  	}
 48181  	goto _250
 48182  _95:
 48183  	func() {
 48184  		if _pOp.Xp1 <= int32(0) || _pOp.Xp1 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 48185  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79443), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61291)))
 48186  			crt.X__builtin_abort(tls)
 48187  		}
 48188  	}()
 48189  	_pOut = elem25(_aMem, uintptr(_pOp.Xp1))
 48190  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-160)) | int32(1))
 48191  	goto _250
 48192  _96:
 48193  	func() {
 48194  		if _pOp.Xp1 > int32(1000000000) {
 48195  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79456), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61970)))
 48196  			crt.X__builtin_abort(tls)
 48197  		}
 48198  	}()
 48199  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48200  	_sqlite3VdbeMemSetStr(tls, _pOut, *(**int8)(unsafe.Pointer(&_pOp.Xp4)), _pOp.Xp1, 0, nil)
 48201  	_pOut.Xenc = _encoding
 48202  	goto _250
 48203  _97:
 48204  	func() {
 48205  		if _pOp.Xp1 <= int32(0) || _pOp.Xp1 > int32(_p.XnVar) {
 48206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79475), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61999)))
 48207  			crt.X__builtin_abort(tls)
 48208  		}
 48209  	}()
 48210  	func() {
 48211  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != nil && (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != _sqlite3VListNumToName(tls, _p.XpVList, _pOp.Xp1) {
 48212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79476), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62029)))
 48213  			crt.X__builtin_abort(tls)
 48214  		}
 48215  	}()
 48216  	_49_pVar = elem25((*XMem)(_p.XaVar), uintptr(_pOp.Xp1-int32(1)))
 48217  	if _sqlite3VdbeMemTooBig(tls, _49_pVar) != 0 {
 48218  		goto _too_big
 48219  	}
 48220  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48221  	_sqlite3VdbeMemShallowCopy(tls, _pOut, _49_pVar, int32(2048))
 48222  	goto _250
 48223  _98:
 48224  	_51_n = _pOp.Xp3
 48225  	_51_p1 = _pOp.Xp1
 48226  	_51_p2 = _pOp.Xp2
 48227  	func() {
 48228  		if _51_n <= int32(0) || _51_p1 <= int32(0) || _51_p2 <= int32(0) {
 48229  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79504), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62097)))
 48230  			crt.X__builtin_abort(tls)
 48231  		}
 48232  	}()
 48233  	func() {
 48234  		if (_51_p1+_51_n) > _51_p2 && (_51_p2+_51_n) > _51_p1 {
 48235  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79505), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62117)))
 48236  			crt.X__builtin_abort(tls)
 48237  		}
 48238  	}()
 48239  	_pIn1 = elem25(_aMem, uintptr(_51_p1))
 48240  	_pOut = elem25(_aMem, uintptr(_51_p2))
 48241  _362:
 48242  	func() {
 48243  		if crt.P2U(unsafe.Pointer(_pOut)) > crt.P2U(unsafe.Pointer(elem25(_aMem, uintptr((_p.XnMem+int32(1))-_p.XnCursor)))) {
 48244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79510), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62138)))
 48245  			crt.X__builtin_abort(tls)
 48246  		}
 48247  	}()
 48248  	func() {
 48249  		if crt.P2U(unsafe.Pointer(_pIn1)) > crt.P2U(unsafe.Pointer(elem25(_aMem, uintptr((_p.XnMem+int32(1))-_p.XnCursor)))) {
 48250  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79511), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62176)))
 48251  			crt.X__builtin_abort(tls)
 48252  		}
 48253  	}()
 48254  	func() {
 48255  		if (int32(_pIn1.Xflags) & int32(128)) != int32(0) {
 48256  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79512), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62214)))
 48257  			crt.X__builtin_abort(tls)
 48258  		}
 48259  	}()
 48260  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 48261  	_sqlite3VdbeMemMove(tls, _pOut, _pIn1)
 48262  	if (crt.P2U(_pOut.XpScopyFrom) >= crt.P2U(unsafe.Pointer(elem25(_aMem, uintptr(_51_p1))))) && (crt.P2U(_pOut.XpScopyFrom) < crt.P2U(unsafe.Pointer(_pOut))) {
 48263  		*(*uintptr)(unsafe.Pointer(&_pOut.XpScopyFrom)) += 72 * uintptr(_pOp.Xp2-_51_p1)
 48264  	}
 48265  	if ((int32(_pOut.Xflags) & int32(4096)) != int32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 {
 48266  		goto _no_mem
 48267  	}
 48268  	if (_db.Xflags & int32(1)) != 0 {
 48269  		_registerTrace(tls, postInc2(&_51_p2, 1), _pOut)
 48270  	}
 48271  	*(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(72)
 48272  	*(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(72)
 48273  	if preInc2(&_51_n, -1) != 0 {
 48274  		goto _362
 48275  	}
 48276  	goto _250
 48277  _99:
 48278  	_55_n = _pOp.Xp3
 48279  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48280  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48281  	func() {
 48282  		if _pOut == _pIn1 {
 48283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79542), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62231)))
 48284  			crt.X__builtin_abort(tls)
 48285  		}
 48286  	}()
 48287  _376:
 48288  	_sqlite3VdbeMemShallowCopy(tls, _pOut, _pIn1, int32(4096))
 48289  	if ((int32(_pOut.Xflags) & int32(4096)) != int32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 {
 48290  		goto _no_mem
 48291  	}
 48292  	*(**XMem)(unsafe.Pointer(&_pOut.XpScopyFrom)) = nil
 48293  	if (_db.Xflags & int32(1)) != 0 {
 48294  		_registerTrace(tls, (_pOp.Xp2+_pOp.Xp3)-_55_n, _pOut)
 48295  	}
 48296  	if postInc2(&_55_n, -1) == int32(0) {
 48297  		goto _377
 48298  	}
 48299  	*(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(72)
 48300  	*(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(72)
 48301  	goto _376
 48302  _377:
 48303  	goto _250
 48304  _100:
 48305  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48306  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48307  	func() {
 48308  		if _pOut == _pIn1 {
 48309  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79573), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62231)))
 48310  			crt.X__builtin_abort(tls)
 48311  		}
 48312  	}()
 48313  	_sqlite3VdbeMemShallowCopy(tls, _pOut, _pIn1, int32(4096))
 48314  	if (*XMem)(_pOut.XpScopyFrom) == nil {
 48315  		*(**XMem)(unsafe.Pointer(&_pOut.XpScopyFrom)) = _pIn1
 48316  	}
 48317  	goto _250
 48318  _101:
 48319  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48320  	func() {
 48321  		if (int32(_pIn1.Xflags) & int32(4)) == int32(0) {
 48322  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79591), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62242)))
 48323  			crt.X__builtin_abort(tls)
 48324  		}
 48325  	}()
 48326  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48327  	_sqlite3VdbeMemSetInt64(tls, _pOut, *(*int64)(unsafe.Pointer(&_pIn1.Xu)))
 48328  	goto _250
 48329  _102:
 48330  	func() {
 48331  		if int32(_p.XnResColumn) != _pOp.Xp2 {
 48332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79609), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62269)))
 48333  			crt.X__builtin_abort(tls)
 48334  		}
 48335  	}()
 48336  	func() {
 48337  		if _pOp.Xp1 <= int32(0) {
 48338  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79610), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60920)))
 48339  			crt.X__builtin_abort(tls)
 48340  		}
 48341  	}()
 48342  	func() {
 48343  		if (_pOp.Xp1 + _pOp.Xp2) > (((_p.XnMem + int32(1)) - _p.XnCursor) + int32(1)) {
 48344  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79611), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62292)))
 48345  			crt.X__builtin_abort(tls)
 48346  		}
 48347  	}()
 48348  	if ((_db.XxProgress != nil) && (_nVmStep >= _nProgressLimit)) && (_db.XxProgress(tls, _db.XpProgressArg) != int32(0)) {
 48349  		_rc = int32(9)
 48350  		goto _abort_due_to_error
 48351  	}
 48352  	if int32(0) != store2(&_rc, _sqlite3VdbeCheckFk(tls, _p, int32(0))) {
 48353  		func() {
 48354  			if (_db.Xflags & int32(128)) == 0 {
 48355  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79629), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62336)))
 48356  				crt.X__builtin_abort(tls)
 48357  			}
 48358  		}()
 48359  		func() {
 48360  			if ((uint32(_p.Xexpired>>6) << 31) >> 31) == 0 {
 48361  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79630), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62363)))
 48362  				crt.X__builtin_abort(tls)
 48363  			}
 48364  		}()
 48365  		goto _abort_due_to_error
 48366  	}
 48367  	func() {
 48368  		if _p.XiStatement != int32(0) && (_db.Xflags&int32(128)) == 0 {
 48369  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79649), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62382)))
 48370  			crt.X__builtin_abort(tls)
 48371  		}
 48372  	}()
 48373  	_rc = _sqlite3VdbeCloseStatement(tls, _p, int32(1))
 48374  	func() {
 48375  		if _rc != int32(0) {
 48376  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79651), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 48377  			crt.X__builtin_abort(tls)
 48378  		}
 48379  	}()
 48380  	_p.XcacheCtr = (_p.XcacheCtr + uint32(2)) | uint32(1)
 48381  	_60_pMem = store25((**XMem)(unsafe.Pointer(&_p.XpResultSet)), elem25(_aMem, uintptr(_pOp.Xp1)))
 48382  	_60_i = int32(0)
 48383  _406:
 48384  	if _60_i >= _pOp.Xp2 {
 48385  		goto _409
 48386  	}
 48387  	func() {
 48388  		if (int32(elem25(_60_pMem, uintptr(_60_i)).Xflags) & int32(128)) != int32(0) {
 48389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79662), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62429)))
 48390  			crt.X__builtin_abort(tls)
 48391  		}
 48392  	}()
 48393  	if ((int32(elem25(_60_pMem, uintptr(_60_i)).Xflags) & int32(4096)) != int32(0)) && _sqlite3VdbeMemMakeWriteable(tls, elem25(_60_pMem, uintptr(_60_i))) != 0 {
 48394  		goto _no_mem
 48395  	}
 48396  	func() {
 48397  		if (int32(elem25(_60_pMem, uintptr(_60_i)).Xflags)&int32(4096)) != int32(0) && (int32(elem25(_60_pMem, uintptr(_60_i)).Xflags)&int32(18)) != int32(0) {
 48398  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79664), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62450)))
 48399  			crt.X__builtin_abort(tls)
 48400  		}
 48401  	}()
 48402  	_sqlite3VdbeMemNulTerminate(tls, elem25(_60_pMem, uintptr(_60_i)))
 48403  	if (_db.Xflags & int32(1)) != 0 {
 48404  		_registerTrace(tls, _pOp.Xp1+_60_i, elem25(_60_pMem, uintptr(_60_i)))
 48405  	}
 48406  	_60_i += 1
 48407  	goto _406
 48408  _409:
 48409  	if _db.XmallocFailed != 0 {
 48410  		goto _no_mem
 48411  	}
 48412  	if (int32(_db.XmTrace) & int32(4)) != 0 {
 48413  		_db.XxTrace(tls, uint32(4), _db.XpTraceArg, unsafe.Pointer(_p), nil)
 48414  	}
 48415  	_p.Xpc = int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/32)) + int32(1)
 48416  	_rc = int32(100)
 48417  	goto _vdbe_return
 48418  _103:
 48419  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48420  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 48421  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 48422  	func() {
 48423  		if _pIn1 == _pOut {
 48424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79701), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62524)))
 48425  			crt.X__builtin_abort(tls)
 48426  		}
 48427  	}()
 48428  	if ((int32(_pIn1.Xflags) | int32(_pIn2.Xflags)) & int32(1)) != 0 {
 48429  		_sqlite3VdbeMemSetNull(tls, _pOut)
 48430  		goto _250
 48431  	}
 48432  	if func() int32 {
 48433  		if (int32(_pIn1.Xflags) & int32(16384)) != 0 {
 48434  			return _sqlite3VdbeMemExpandBlob(tls, _pIn1)
 48435  		}
 48436  		return int32(0)
 48437  	}() != 0 || func() int32 {
 48438  		if (int32(_pIn2.Xflags) & int32(16384)) != 0 {
 48439  			return _sqlite3VdbeMemExpandBlob(tls, _pIn2)
 48440  		}
 48441  		return int32(0)
 48442  	}() != 0 {
 48443  		goto _no_mem
 48444  	}
 48445  	if ((int32(_pIn1.Xflags) & int32(18)) == int32(0)) && _sqlite3VdbeMemStringify(tls, _pIn1, _encoding, 0) != 0 {
 48446  		goto _no_mem
 48447  	}
 48448  	if ((int32(_pIn2.Xflags) & int32(18)) == int32(0)) && _sqlite3VdbeMemStringify(tls, _pIn2, _encoding, 0) != 0 {
 48449  		goto _no_mem
 48450  	}
 48451  	_66_nByte = int64(_pIn1.Xn + _pIn2.Xn)
 48452  	if _66_nByte > int64(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
 48453  		goto _too_big
 48454  	}
 48455  	if _sqlite3VdbeMemGrow(tls, _pOut, int32(_66_nByte)+int32(2), bool2int(_pOut == _pIn2)) != 0 {
 48456  		goto _no_mem
 48457  	}
 48458  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(2))
 48459  	if _pOut != _pIn2 {
 48460  		crt.Xmemcpy(tls, unsafe.Pointer(_pOut.Xz), unsafe.Pointer(_pIn2.Xz), uint64(_pIn2.Xn))
 48461  	}
 48462  	crt.Xmemcpy(tls, unsafe.Pointer(elem1(_pOut.Xz, uintptr(_pIn2.Xn))), unsafe.Pointer(_pIn1.Xz), uint64(_pIn1.Xn))
 48463  	*elem1(_pOut.Xz, uintptr(_66_nByte)) = 0
 48464  	*elem1(_pOut.Xz, uintptr(_66_nByte+int64(1))) = 0
 48465  	{
 48466  		p := &_pOut.Xflags
 48467  		*p = uint16(int32(*p) | int32(512))
 48468  	}
 48469  	_pOut.Xn = int32(_66_nByte)
 48470  	_pOut.Xenc = _encoding
 48471  	goto _250
 48472  _104:
 48473  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48474  	_73_type1 = _numericType(tls, _pIn1)
 48475  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 48476  	_73_type2 = _numericType(tls, _pIn2)
 48477  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 48478  	_73_flags = uint16(int32(_pIn1.Xflags) | int32(_pIn2.Xflags))
 48479  	if ((int32(_73_type1) & int32(_73_type2)) & int32(4)) == int32(0) {
 48480  		goto _436
 48481  	}
 48482  	_73_iA = *(*int64)(unsafe.Pointer(&_pIn1.Xu))
 48483  	_73_iB = *(*int64)(unsafe.Pointer(&_pIn2.Xu))
 48484  	_73_bIntint = int8(1)
 48485  	switch int32(_pOp.Xopcode) {
 48486  	case int32(88):
 48487  		goto _438
 48488  	case int32(89):
 48489  		goto _439
 48490  	case int32(90):
 48491  		goto _440
 48492  	case int32(91):
 48493  		goto _441
 48494  	default:
 48495  		goto _442
 48496  	}
 48497  
 48498  _438:
 48499  	if _sqlite3AddInt64(tls, &_73_iB, _73_iA) != 0 {
 48500  		goto _fp_math
 48501  	}
 48502  	goto _444
 48503  _439:
 48504  	if _sqlite3SubInt64(tls, &_73_iB, _73_iA) != 0 {
 48505  		goto _fp_math
 48506  	}
 48507  	goto _444
 48508  _440:
 48509  	if _sqlite3MulInt64(tls, &_73_iB, _73_iA) != 0 {
 48510  		goto _fp_math
 48511  	}
 48512  	goto _444
 48513  _441:
 48514  	if _73_iA == (0) {
 48515  		goto _arithmetic_result_is_null
 48516  	}
 48517  	if (_73_iA == int64(-1)) && (_73_iB == int64(-9223372036854775808)) {
 48518  		goto _fp_math
 48519  	}
 48520  	_73_iB /= _73_iA
 48521  	goto _444
 48522  _442:
 48523  	if _73_iA == (0) {
 48524  		goto _arithmetic_result_is_null
 48525  	}
 48526  	if _73_iA == int64(-1) {
 48527  		_73_iA = int64(1)
 48528  	}
 48529  	_73_iB %= _73_iA
 48530  	goto _444
 48531  _444:
 48532  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _73_iB
 48533  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(4))
 48534  	goto _454
 48535  _436:
 48536  	if (int32(_73_flags) & int32(1)) != int32(0) {
 48537  		goto _arithmetic_result_is_null
 48538  	}
 48539  	_73_bIntint = 0
 48540  _fp_math:
 48541  	_73_rA = _sqlite3VdbeRealValue(tls, _pIn1)
 48542  	_73_rB = _sqlite3VdbeRealValue(tls, _pIn2)
 48543  	switch int32(_pOp.Xopcode) {
 48544  	case int32(88):
 48545  		goto _456
 48546  	case int32(89):
 48547  		goto _457
 48548  	case int32(90):
 48549  		goto _458
 48550  	case int32(91):
 48551  		goto _459
 48552  	default:
 48553  		goto _460
 48554  	}
 48555  
 48556  _456:
 48557  	_73_rB += _73_rA
 48558  	goto _461
 48559  _457:
 48560  	_73_rB -= _73_rA
 48561  	goto _461
 48562  _458:
 48563  	_73_rB *= _73_rA
 48564  	goto _461
 48565  _459:
 48566  	if _73_rA == float64(0) {
 48567  		goto _arithmetic_result_is_null
 48568  	}
 48569  	_73_rB /= _73_rA
 48570  	goto _461
 48571  _460:
 48572  	_73_iA = int64(_73_rA)
 48573  	_73_iB = int64(_73_rB)
 48574  	if _73_iA == (0) {
 48575  		goto _arithmetic_result_is_null
 48576  	}
 48577  	if _73_iA == int64(-1) {
 48578  		_73_iA = int64(1)
 48579  	}
 48580  	_73_rB = float64(_73_iB % _73_iA)
 48581  	goto _461
 48582  _461:
 48583  	if _sqlite3IsNaN(tls, _73_rB) != 0 {
 48584  		goto _arithmetic_result_is_null
 48585  	}
 48586  	*(*float64)(unsafe.Pointer(&_pOut.Xu)) = _73_rB
 48587  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(8))
 48588  	if (((int32(_73_type1) | int32(_73_type2)) & int32(8)) == int32(0)) && (_73_bIntint == 0) {
 48589  		_sqlite3VdbeIntegerAffinity(tls, _pOut)
 48590  	}
 48591  _454:
 48592  	goto _250
 48593  _arithmetic_result_is_null:
 48594  	_sqlite3VdbeMemSetNull(tls, _pOut)
 48595  	goto _250
 48596  _109:
 48597  	func() {
 48598  		if int32(_pOp.Xp4type) != int32(-3) {
 48599  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79874), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62535)))
 48600  			crt.X__builtin_abort(tls)
 48601  		}
 48602  	}()
 48603  	if _pOp.Xp1 != 0 {
 48604  		_sqlite3VdbeMemSetInt64(tls, elem25(_aMem, uintptr(_pOp.Xp1)), 0)
 48605  	}
 48606  	goto _250
 48607  _110:
 48608  	func() {
 48609  		if int32(_pOp.Xp4type) != int32(-4) {
 48610  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79926), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62559)))
 48611  			crt.X__builtin_abort(tls)
 48612  		}
 48613  	}()
 48614  	_87_n = int32(_pOp.Xp5)
 48615  	func() {
 48616  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 48617  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79928), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 48618  			crt.X__builtin_abort(tls)
 48619  		}
 48620  	}()
 48621  	func() {
 48622  		if _87_n != int32(0) && (_pOp.Xp2 <= int32(0) || (_pOp.Xp2+_87_n) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1))) {
 48623  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79929), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62630)))
 48624  			crt.X__builtin_abort(tls)
 48625  		}
 48626  	}()
 48627  	func() {
 48628  		if _pOp.Xp3 >= _pOp.Xp2 && _pOp.Xp3 < (_pOp.Xp2+_87_n) {
 48629  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79930), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62691)))
 48630  			crt.X__builtin_abort(tls)
 48631  		}
 48632  	}()
 48633  	_87_pCtx = (*Xsqlite3_context)(_sqlite3DbMallocRawNN(tls, _db, uint64(56)+(uint64(_87_n-int32(1))*uint64(8))))
 48634  	if _87_pCtx == nil {
 48635  		goto _no_mem
 48636  	}
 48637  	*(**XMem)(unsafe.Pointer(&_87_pCtx.XpOut)) = nil
 48638  	*(**XFuncDef)(unsafe.Pointer(&_87_pCtx.XpFunc)) = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 48639  	_87_pCtx.XiOp = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))
 48640  	*(**TVdbe)(unsafe.Pointer(&_87_pCtx.XpVdbe)) = _p
 48641  	_87_pCtx.Xargc = uint8(_87_n)
 48642  	_pOp.Xp4type = int8(-16)
 48643  	*(**Xsqlite3_context)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))) = _87_pCtx
 48644  	_pOp.Xopcode = uint8(72)
 48645  _111:
 48646  	func() {
 48647  		if int32(_pOp.Xp4type) != int32(-16) {
 48648  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79947), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62729)))
 48649  			crt.X__builtin_abort(tls)
 48650  		}
 48651  	}()
 48652  	_88_pCtx = (*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 48653  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 48654  	if (*XMem)(_88_pCtx.XpOut) == _pOut {
 48655  		goto _486
 48656  	}
 48657  	*(**XMem)(unsafe.Pointer(&_88_pCtx.XpOut)) = _pOut
 48658  	_88_i = int32(_88_pCtx.Xargc) - int32(1)
 48659  _487:
 48660  	if _88_i < int32(0) {
 48661  		goto _490
 48662  	}
 48663  	*elem19((**XMem)(unsafe.Pointer(&_88_pCtx.Xargv)), uintptr(_88_i)) = elem25(_aMem, uintptr(_pOp.Xp2+_88_i))
 48664  	_88_i -= 1
 48665  	goto _487
 48666  _490:
 48667  _486:
 48668  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 48669  	_88_i = int32(0)
 48670  _491:
 48671  	if _88_i >= int32(_88_pCtx.Xargc) {
 48672  		goto _494
 48673  	}
 48674  	func() {
 48675  		if (int32((*elem19((**XMem)(unsafe.Pointer(&_88_pCtx.Xargv)), uintptr(_88_i))).Xflags) & int32(128)) != int32(0) {
 48676  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79963), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62753)))
 48677  			crt.X__builtin_abort(tls)
 48678  		}
 48679  	}()
 48680  	if (_db.Xflags & int32(1)) != 0 {
 48681  		_registerTrace(tls, _pOp.Xp2+_88_i, *elem19((**XMem)(unsafe.Pointer(&_88_pCtx.Xargv)), uintptr(_88_i)))
 48682  	}
 48683  	_88_i += 1
 48684  	goto _491
 48685  _494:
 48686  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(1))
 48687  	_88_pCtx.XfErrorOrAux = 0
 48688  	func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) {
 48689  		v := (*XFuncDef)(_88_pCtx.XpFunc).XxSFunc
 48690  		return *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&v))
 48691  	}()(tls, _88_pCtx, int32(_88_pCtx.Xargc), (**XMem)(unsafe.Pointer(&_88_pCtx.Xargv)))
 48692  	if _88_pCtx.XfErrorOrAux == 0 {
 48693  		goto _498
 48694  	}
 48695  	if _88_pCtx.XisError != 0 {
 48696  		_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(Xsqlite3_value_text(tls, _pOut)))
 48697  		_rc = _88_pCtx.XisError
 48698  	}
 48699  	_sqlite3VdbeDeleteAuxData(tls, _db, (**XAuxData)(unsafe.Pointer(&_p.XpAuxData)), _88_pCtx.XiOp, _pOp.Xp1)
 48700  	if _rc != 0 {
 48701  		goto _abort_due_to_error
 48702  	}
 48703  _498:
 48704  	if (int32(_pOut.Xflags) & int32(18)) == 0 {
 48705  		goto _501
 48706  	}
 48707  	_sqlite3VdbeChangeEncoding(tls, _pOut, int32(_encoding))
 48708  	if _sqlite3VdbeMemTooBig(tls, _pOut) != 0 {
 48709  		goto _too_big
 48710  	}
 48711  _501:
 48712  	if (_db.Xflags & int32(1)) != 0 {
 48713  		_registerTrace(tls, _pOp.Xp3, _pOut)
 48714  	}
 48715  	goto _250
 48716  _112:
 48717  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48718  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 48719  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 48720  	if ((int32(_pIn1.Xflags) | int32(_pIn2.Xflags)) & int32(1)) != 0 {
 48721  		_sqlite3VdbeMemSetNull(tls, _pOut)
 48722  		goto _250
 48723  	}
 48724  	_94_iA = _sqlite3VdbeIntValue(tls, _pIn2)
 48725  	_94_iB = _sqlite3VdbeIntValue(tls, _pIn1)
 48726  	_94_op = _pOp.Xopcode
 48727  	if int32(_94_op) == int32(84) {
 48728  		_94_iA &= _94_iB
 48729  		goto _509
 48730  	}
 48731  	if int32(_94_op) == int32(85) {
 48732  		_94_iA |= _94_iB
 48733  		goto _509
 48734  	}
 48735  	if _94_iB == (0) {
 48736  		goto _509
 48737  	}
 48738  	func() {
 48739  		if int32(_94_op) != int32(87) && int32(_94_op) != int32(86) {
 48740  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80046), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62779)))
 48741  			crt.X__builtin_abort(tls)
 48742  		}
 48743  	}()
 48744  	if _94_iB < (0) {
 48745  		_94_op = uint8(int32(173) - int32(_94_op))
 48746  		_94_iB = func() int64 {
 48747  			if _94_iB > int64(-64) {
 48748  				return (-_94_iB)
 48749  			}
 48750  			return int64(64)
 48751  		}()
 48752  	}
 48753  	if _94_iB >= int64(64) {
 48754  		_94_iA = int64(func() int32 {
 48755  			if (_94_iA >= (0)) || (int32(_94_op) == int32(86)) {
 48756  				return int32(0)
 48757  			}
 48758  			return int32(-1)
 48759  		}())
 48760  		goto _520
 48761  	}
 48762  	crt.Xmemcpy(tls, unsafe.Pointer(&_94_uA), unsafe.Pointer(&_94_iA), uint64(8))
 48763  	if int32(_94_op) == int32(86) {
 48764  		_94_uA <<= uint(int32(_94_iB))
 48765  		goto _522
 48766  	}
 48767  	_94_uA >>= uint(int32(_94_iB))
 48768  	if _94_iA < (0) {
 48769  		_94_uA |= uint64(18446744073709551615) << uint(int32(int64(64)-_94_iB))
 48770  	}
 48771  _522:
 48772  	crt.Xmemcpy(tls, unsafe.Pointer(&_94_iA), unsafe.Pointer(&_94_uA), uint64(8))
 48773  _520:
 48774  _509:
 48775  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _94_iA
 48776  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(4))
 48777  	goto _250
 48778  _116:
 48779  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48780  	_sqlite3VdbeMemAboutToChange(tls, _p, _pIn1)
 48781  	_sqlite3VdbeMemIntegerify(tls, _pIn1)
 48782  	*(*int64)(unsafe.Pointer(&_pIn1.Xu)) += int64(_pOp.Xp2)
 48783  	goto _250
 48784  _117:
 48785  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48786  	if (int32(_pIn1.Xflags) & int32(4)) != int32(0) {
 48787  		goto _524
 48788  	}
 48789  	_applyAffinity(tls, _pIn1, int8(67), _encoding)
 48790  	if (int32(_pIn1.Xflags) & int32(4)) != int32(0) {
 48791  		goto _525
 48792  	}
 48793  	if _pOp.Xp2 == int32(0) {
 48794  		_rc = int32(20)
 48795  		goto _abort_due_to_error
 48796  	}
 48797  	goto _jump_to_p2
 48798  _525:
 48799  _524:
 48800  	_pIn1.Xflags = uint16((int32(_pIn1.Xflags) & int32(-49664)) | int32(4))
 48801  	goto _250
 48802  _118:
 48803  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48804  	if (int32(_pIn1.Xflags) & int32(4)) != 0 {
 48805  		_sqlite3VdbeMemRealify(tls, _pIn1)
 48806  	}
 48807  	goto _250
 48808  _119:
 48809  	func() {
 48810  		if _pOp.Xp2 < int32(65) || _pOp.Xp2 > int32(69) {
 48811  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80151), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62817)))
 48812  			crt.X__builtin_abort(tls)
 48813  		}
 48814  	}()
 48815  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48816  	_sqlite3VdbeMemAboutToChange(tls, _p, _pIn1)
 48817  	_rc = func() int32 {
 48818  		if (int32(_pIn1.Xflags) & int32(16384)) != 0 {
 48819  			return _sqlite3VdbeMemExpandBlob(tls, _pIn1)
 48820  		}
 48821  		return int32(0)
 48822  	}()
 48823  	_sqlite3VdbeMemCast(tls, _pIn1, uint8(_pOp.Xp2), _encoding)
 48824  	if _rc != 0 {
 48825  		goto _abort_due_to_error
 48826  	}
 48827  	goto _250
 48828  _120:
 48829  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48830  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 48831  	_113_flags1 = _pIn1.Xflags
 48832  	_113_flags3 = _pIn3.Xflags
 48833  	if ((int32(_113_flags1) | int32(_113_flags3)) & int32(1)) == 0 {
 48834  		goto _535
 48835  	}
 48836  	if (int32(_pOp.Xp5) & int32(128)) == 0 {
 48837  		goto _536
 48838  	}
 48839  	func() {
 48840  		if int32(_pOp.Xopcode) != int32(78) && int32(_pOp.Xopcode) != int32(77) {
 48841  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80285), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62870)))
 48842  			crt.X__builtin_abort(tls)
 48843  		}
 48844  	}()
 48845  	func() {
 48846  		if (int32(_113_flags1) & int32(256)) != int32(0) {
 48847  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80286), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62911)))
 48848  			crt.X__builtin_abort(tls)
 48849  		}
 48850  	}()
 48851  	func() {
 48852  		if (int32(_pOp.Xp5) & int32(16)) != int32(0) {
 48853  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80287), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62937)))
 48854  			crt.X__builtin_abort(tls)
 48855  		}
 48856  	}()
 48857  	if (((int32(_113_flags1) & int32(_113_flags3)) & int32(1)) != int32(0)) && ((int32(_113_flags3) & int32(256)) == int32(0)) {
 48858  		_113_res = int32(0)
 48859  		goto _546
 48860  	}
 48861  	_113_res = int32(1)
 48862  _546:
 48863  	goto _547
 48864  _536:
 48865  	if (int32(_pOp.Xp5) & int32(32)) == 0 {
 48866  		goto _548
 48867  	}
 48868  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48869  	_iCompare = int32(1)
 48870  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 48871  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(1))
 48872  	if (_db.Xflags & int32(1)) != 0 {
 48873  		_registerTrace(tls, _pOp.Xp2, _pOut)
 48874  	}
 48875  	goto _550
 48876  _548:
 48877  	if (int32(_pOp.Xp5) & int32(16)) != 0 {
 48878  		goto _jump_to_p2
 48879  	}
 48880  _550:
 48881  	goto _250
 48882  _547:
 48883  	goto _compare_op
 48884  _535:
 48885  	_113_affinity = int8(int32(_pOp.Xp5) & int32(71))
 48886  	if int32(_113_affinity) < int32(67) {
 48887  		goto _553
 48888  	}
 48889  	if ((int32(_113_flags1) | int32(_113_flags3)) & int32(2)) == 0 {
 48890  		goto _554
 48891  	}
 48892  	if (int32(_113_flags1) & int32(14)) == int32(2) {
 48893  		_applyNumericAffinity(tls, _pIn1, int32(0))
 48894  		_113_flags3 = _pIn3.Xflags
 48895  	}
 48896  	if (int32(_113_flags3) & int32(14)) == int32(2) {
 48897  		_applyNumericAffinity(tls, _pIn3, int32(0))
 48898  	}
 48899  _554:
 48900  	if ((int32(_pIn1.Xflags) & int32(_pIn3.Xflags)) & int32(4)) == int32(0) {
 48901  		goto _557
 48902  	}
 48903  	if (*(*int64)(unsafe.Pointer(&_pIn3.Xu))) > (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) {
 48904  		_113_res = int32(1)
 48905  		goto _compare_op
 48906  	}
 48907  	if (*(*int64)(unsafe.Pointer(&_pIn3.Xu))) < (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) {
 48908  		_113_res = int32(-1)
 48909  		goto _compare_op
 48910  	}
 48911  	_113_res = int32(0)
 48912  	goto _compare_op
 48913  _557:
 48914  	goto _561
 48915  _553:
 48916  	if int32(_113_affinity) != int32(66) {
 48917  		goto _561
 48918  	}
 48919  	if ((int32(_113_flags1) & int32(2)) == int32(0)) && ((int32(_113_flags1) & int32(12)) != int32(0)) {
 48920  		_sqlite3VdbeMemStringify(tls, _pIn1, _encoding, uint8(1))
 48921  		_113_flags1 = uint16((int32(_pIn1.Xflags) & int32(-33280)) | (int32(_113_flags1) & int32(33279)))
 48922  		func() {
 48923  			if _pIn1 == _pIn3 {
 48924  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80343), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62970)))
 48925  				crt.X__builtin_abort(tls)
 48926  			}
 48927  		}()
 48928  	}
 48929  	if ((int32(_113_flags3) & int32(2)) == int32(0)) && ((int32(_113_flags3) & int32(12)) != int32(0)) {
 48930  		_sqlite3VdbeMemStringify(tls, _pIn3, _encoding, uint8(1))
 48931  		_113_flags3 = uint16((int32(_pIn3.Xflags) & int32(-33280)) | (int32(_113_flags3) & int32(33279)))
 48932  	}
 48933  _561:
 48934  	func() {
 48935  		if int32(_pOp.Xp4type) != int32(-3) && (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))) != nil {
 48936  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80353), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62981)))
 48937  			crt.X__builtin_abort(tls)
 48938  		}
 48939  	}()
 48940  	_113_res = _sqlite3MemCompare(tls, _pIn3, _pIn1, (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))))
 48941  _compare_op:
 48942  	switch int32(_pOp.Xopcode) {
 48943  	case int32(77):
 48944  		goto _573
 48945  	case int32(78):
 48946  		goto _572
 48947  	case int32(79):
 48948  		goto _576
 48949  	case int32(80):
 48950  		goto _575
 48951  	case int32(81):
 48952  		goto _574
 48953  	default:
 48954  		goto _577
 48955  	}
 48956  
 48957  _572:
 48958  	_113_res2 = bool2int(_113_res == int32(0))
 48959  	goto _578
 48960  _573:
 48961  	_113_res2 = _113_res
 48962  	goto _578
 48963  _574:
 48964  	_113_res2 = bool2int(_113_res < int32(0))
 48965  	goto _578
 48966  _575:
 48967  	_113_res2 = bool2int(_113_res <= int32(0))
 48968  	goto _578
 48969  _576:
 48970  	_113_res2 = bool2int(_113_res > int32(0))
 48971  	goto _578
 48972  _577:
 48973  	_113_res2 = bool2int(_113_res >= int32(0))
 48974  	goto _578
 48975  _578:
 48976  	func() {
 48977  		if (int32(_pIn1.Xflags) & int32(1024)) != (int32(_113_flags1) & int32(1024)) {
 48978  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80367), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63025)))
 48979  			crt.X__builtin_abort(tls)
 48980  		}
 48981  	}()
 48982  	_pIn1.Xflags = _113_flags1
 48983  	func() {
 48984  		if (int32(_pIn3.Xflags) & int32(1024)) != (int32(_113_flags3) & int32(1024)) {
 48985  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80369), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63071)))
 48986  			crt.X__builtin_abort(tls)
 48987  		}
 48988  	}()
 48989  	_pIn3.Xflags = _113_flags3
 48990  	if (int32(_pOp.Xp5) & int32(32)) == 0 {
 48991  		goto _583
 48992  	}
 48993  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48994  	_iCompare = _113_res
 48995  	_113_res2 = bool2int(_113_res2 != int32(0))
 48996  	if (int32(_pOp.Xp5) & int32(8)) == int32(0) {
 48997  		goto _584
 48998  	}
 48999  	func() {
 49000  		if int32(_pOp.Xopcode) != int32(77) && int32(_pOp.Xopcode) != int32(78) {
 49001  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80384), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63117)))
 49002  			crt.X__builtin_abort(tls)
 49003  		}
 49004  	}()
 49005  	func() {
 49006  		if _113_res2 != int32(0) && _113_res2 != int32(1) {
 49007  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80385), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63158)))
 49008  			crt.X__builtin_abort(tls)
 49009  		}
 49010  	}()
 49011  	if bool2int(int32(_pOp.Xopcode) == int32(78)) == _113_res2 {
 49012  		goto _250
 49013  	}
 49014  _584:
 49015  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 49016  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(4))
 49017  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_113_res2)
 49018  	if (_db.Xflags & int32(1)) != 0 {
 49019  		_registerTrace(tls, _pOp.Xp2, _pOut)
 49020  	}
 49021  	goto _593
 49022  _583:
 49023  	if _113_res2 != 0 {
 49024  		goto _jump_to_p2
 49025  	}
 49026  _593:
 49027  	goto _250
 49028  _126:
 49029  	func() {
 49030  		if crt.P2U(unsafe.Pointer(_pOp)) <= crt.P2U(unsafe.Pointer(_aOp)) {
 49031  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80414), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63177)))
 49032  			crt.X__builtin_abort(tls)
 49033  		}
 49034  	}()
 49035  	func() {
 49036  		if int32(elem63(_pOp, uintptr(18446744073709551615)).Xopcode) != int32(81) && int32(elem63(_pOp, uintptr(18446744073709551615)).Xopcode) != int32(79) {
 49037  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80415), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63185)))
 49038  			crt.X__builtin_abort(tls)
 49039  		}
 49040  	}()
 49041  	func() {
 49042  		if (int32(elem63(_pOp, uintptr(18446744073709551615)).Xp5) & int32(32)) == 0 {
 49043  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80416), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63232)))
 49044  			crt.X__builtin_abort(tls)
 49045  		}
 49046  	}()
 49047  	if _iCompare != int32(0) {
 49048  		goto _jump_to_p2
 49049  	}
 49050  	goto _250
 49051  _127:
 49052  	func() {
 49053  		if int32(_pOp.Xp4type) != int32(-12) {
 49054  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80436), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63260)))
 49055  			crt.X__builtin_abort(tls)
 49056  		}
 49057  	}()
 49058  	func() {
 49059  		if (*(**int32)(unsafe.Pointer(&_pOp.Xp4))) == nil {
 49060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80437), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63285)))
 49061  			crt.X__builtin_abort(tls)
 49062  		}
 49063  	}()
 49064  	func() {
 49065  		if int32(elem63(_pOp, uintptr(1)).Xopcode) != int32(98) {
 49066  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80438), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63296)))
 49067  			crt.X__builtin_abort(tls)
 49068  		}
 49069  	}()
 49070  	func() {
 49071  		if (int32(elem63(_pOp, uintptr(1)).Xp5) & int32(1)) == 0 {
 49072  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80439), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63322)))
 49073  			crt.X__builtin_abort(tls)
 49074  		}
 49075  	}()
 49076  	goto _250
 49077  _128:
 49078  	if (int32(_pOp.Xp5) & int32(1)) == int32(0) {
 49079  		_140_aPermute = nil
 49080  		goto _612
 49081  	}
 49082  	func() {
 49083  		if crt.P2U(unsafe.Pointer(_pOp)) <= crt.P2U(unsafe.Pointer(_aOp)) {
 49084  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80477), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63177)))
 49085  			crt.X__builtin_abort(tls)
 49086  		}
 49087  	}()
 49088  	func() {
 49089  		if int32(elem63(_pOp, uintptr(18446744073709551615)).Xopcode) != int32(96) {
 49090  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80478), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63349)))
 49091  			crt.X__builtin_abort(tls)
 49092  		}
 49093  	}()
 49094  	func() {
 49095  		if int32(elem63(_pOp, uintptr(18446744073709551615)).Xp4type) != int32(-12) {
 49096  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80479), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63380)))
 49097  			crt.X__builtin_abort(tls)
 49098  		}
 49099  	}()
 49100  	_140_aPermute = (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int32)(unsafe.Pointer(&(elem63(_pOp, uintptr(18446744073709551615)).Xp4))))) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(int32(1))*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4)))))))))))
 49101  	func() {
 49102  		if _140_aPermute == nil {
 49103  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80481), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63408)))
 49104  			crt.X__builtin_abort(tls)
 49105  		}
 49106  	}()
 49107  _612:
 49108  	_140_n = _pOp.Xp3
 49109  	_140_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 49110  	func() {
 49111  		if _140_n <= int32(0) {
 49112  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80485), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(1376)))
 49113  			crt.X__builtin_abort(tls)
 49114  		}
 49115  	}()
 49116  	func() {
 49117  		if _140_pKeyInfo == nil {
 49118  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80486), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(44995)))
 49119  			crt.X__builtin_abort(tls)
 49120  		}
 49121  	}()
 49122  	_140_p1 = _pOp.Xp1
 49123  	_140_p2 = _pOp.Xp2
 49124  	if _140_aPermute == nil {
 49125  		goto _625
 49126  	}
 49127  	_143_mx = int32(0)
 49128  	_143_k = int32(0)
 49129  _626:
 49130  	if _143_k >= _140_n {
 49131  		goto _629
 49132  	}
 49133  	if (*elem8(_140_aPermute, uintptr(_143_k))) > _143_mx {
 49134  		_143_mx = *elem8(_140_aPermute, uintptr(_143_k))
 49135  	}
 49136  	_143_k += 1
 49137  	goto _626
 49138  _629:
 49139  	func() {
 49140  		if _140_p1 <= int32(0) || (_140_p1+_143_mx) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 49141  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80493), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63420)))
 49142  			crt.X__builtin_abort(tls)
 49143  		}
 49144  	}()
 49145  	func() {
 49146  		if _140_p2 <= int32(0) || (_140_p2+_143_mx) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 49147  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80494), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63462)))
 49148  			crt.X__builtin_abort(tls)
 49149  		}
 49150  	}()
 49151  	goto _637
 49152  _625:
 49153  	func() {
 49154  		if _140_p1 <= int32(0) || (_140_p1+_140_n) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 49155  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80496), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63504)))
 49156  			crt.X__builtin_abort(tls)
 49157  		}
 49158  	}()
 49159  	func() {
 49160  		if _140_p2 <= int32(0) || (_140_p2+_140_n) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 49161  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80497), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63545)))
 49162  			crt.X__builtin_abort(tls)
 49163  		}
 49164  	}()
 49165  _637:
 49166  	_140_i = int32(0)
 49167  _644:
 49168  	if _140_i >= _140_n {
 49169  		goto _647
 49170  	}
 49171  	_140_idx = func() int32 {
 49172  		if _140_aPermute != nil {
 49173  			return (*elem8(_140_aPermute, uintptr(_140_i)))
 49174  		}
 49175  		return _140_i
 49176  	}()
 49177  	func() {
 49178  		if (int32(elem25(_aMem, uintptr(_140_p1+_140_idx)).Xflags) & int32(128)) != int32(0) {
 49179  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80502), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63586)))
 49180  			crt.X__builtin_abort(tls)
 49181  		}
 49182  	}()
 49183  	func() {
 49184  		if (int32(elem25(_aMem, uintptr(_140_p2+_140_idx)).Xflags) & int32(128)) != int32(0) {
 49185  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80503), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63612)))
 49186  			crt.X__builtin_abort(tls)
 49187  		}
 49188  	}()
 49189  	if (_db.Xflags & int32(1)) != 0 {
 49190  		_registerTrace(tls, _140_p1+_140_idx, elem25(_aMem, uintptr(_140_p1+_140_idx)))
 49191  	}
 49192  	if (_db.Xflags & int32(1)) != 0 {
 49193  		_registerTrace(tls, _140_p2+_140_idx, elem25(_aMem, uintptr(_140_p2+_140_idx)))
 49194  	}
 49195  	func() {
 49196  		if _140_i >= int32(_140_pKeyInfo.XnField) {
 49197  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80506), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63638)))
 49198  			crt.X__builtin_abort(tls)
 49199  		}
 49200  	}()
 49201  	_140_pColl = *elem64((**XCollSeq)(unsafe.Pointer(&_140_pKeyInfo.XaColl)), uintptr(_140_i))
 49202  	_140_bRev = int32(*elem15(_140_pKeyInfo.XaSortOrder, uintptr(_140_i)))
 49203  	_iCompare = _sqlite3MemCompare(tls, elem25(_aMem, uintptr(_140_p1+_140_idx)), elem25(_aMem, uintptr(_140_p2+_140_idx)), _140_pColl)
 49204  	if _iCompare == 0 {
 49205  		goto _658
 49206  	}
 49207  	if _140_bRev != 0 {
 49208  		_iCompare = -_iCompare
 49209  	}
 49210  	goto _647
 49211  _658:
 49212  	_140_i += 1
 49213  	goto _644
 49214  _647:
 49215  	goto _250
 49216  _129:
 49217  	if _iCompare < int32(0) {
 49218  		_pOp = elem63(_aOp, uintptr(_pOp.Xp1-int32(1)))
 49219  		goto _663
 49220  	}
 49221  	if _iCompare == int32(0) {
 49222  		_pOp = elem63(_aOp, uintptr(_pOp.Xp2-int32(1)))
 49223  		goto _663
 49224  	}
 49225  	_pOp = elem63(_aOp, uintptr(_pOp.Xp3-int32(1)))
 49226  _663:
 49227  	goto _250
 49228  _130:
 49229  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49230  	if (int32(_pIn1.Xflags) & int32(1)) != 0 {
 49231  		_151_v1 = int32(2)
 49232  		goto _665
 49233  	}
 49234  	_151_v1 = bool2int(_sqlite3VdbeIntValue(tls, _pIn1) != (0))
 49235  _665:
 49236  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 49237  	if (int32(_pIn2.Xflags) & int32(1)) != 0 {
 49238  		_151_v2 = int32(2)
 49239  		goto _667
 49240  	}
 49241  	_151_v2 = bool2int(_sqlite3VdbeIntValue(tls, _pIn2) != (0))
 49242  _667:
 49243  	if int32(_pOp.Xopcode) == int32(71) {
 49244  		_151_v1 = int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3VdbeExecØ00and_logicØ002)), uintptr((_151_v1*int32(3))+_151_v2)))
 49245  		goto _669
 49246  	}
 49247  	_151_v1 = int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3VdbeExecØ00or_logicØ003)), uintptr((_151_v1*int32(3))+_151_v2)))
 49248  _669:
 49249  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 49250  	if _151_v1 == int32(2) {
 49251  		_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(1))
 49252  		goto _671
 49253  	}
 49254  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_151_v1)
 49255  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(4))
 49256  _671:
 49257  	goto _250
 49258  _132:
 49259  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49260  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 49261  	_sqlite3VdbeMemSetNull(tls, _pOut)
 49262  	if (int32(_pIn1.Xflags) & int32(1)) == int32(0) {
 49263  		_pOut.Xflags = uint16(4)
 49264  		*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(bool2int(_sqlite3VdbeIntValue(tls, _pIn1) == 0))
 49265  	}
 49266  	goto _250
 49267  _133:
 49268  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49269  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 49270  	_sqlite3VdbeMemSetNull(tls, _pOut)
 49271  	if (int32(_pIn1.Xflags) & int32(1)) == int32(0) {
 49272  		_pOut.Xflags = uint16(4)
 49273  		*(*int64)(unsafe.Pointer(&_pOut.Xu)) = ^_sqlite3VdbeIntValue(tls, _pIn1)
 49274  	}
 49275  	goto _250
 49276  _134:
 49277  	func() {
 49278  		if int32(elem63((*XVdbeOp)(_p.XaOp), 0).Xopcode) != int32(51) {
 49279  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80644), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63657)))
 49280  			crt.X__builtin_abort(tls)
 49281  		}
 49282  	}()
 49283  	if _p.XpFrame == nil {
 49284  		goto _676
 49285  	}
 49286  	_164_iAddr = uint32(int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(_p.XaOp)) / 32)))
 49287  	if (int32(*elem15((*XVdbeFrame)(_p.XpFrame).XaOnce, uintptr(_164_iAddr/uint32(8)))) & (int32(1) << uint(int32(_164_iAddr&uint32(7))))) != int32(0) {
 49288  		goto _jump_to_p2
 49289  	}
 49290  	{
 49291  		p := elem15((*XVdbeFrame)(_p.XpFrame).XaOnce, uintptr(_164_iAddr/uint32(8)))
 49292  		*p = uint8(int32(*p) | (int32(1) << uint(int32(_164_iAddr&uint32(7)))))
 49293  	}
 49294  	goto _678
 49295  _676:
 49296  	if (elem63((*XVdbeOp)(_p.XaOp), 0).Xp1) == _pOp.Xp1 {
 49297  		goto _jump_to_p2
 49298  	}
 49299  _678:
 49300  	_pOp.Xp1 = elem63((*XVdbeOp)(_p.XaOp), 0).Xp1
 49301  	goto _250
 49302  _135:
 49303  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49304  	if (int32(_pIn1.Xflags) & int32(1)) != 0 {
 49305  		_169_c = _pOp.Xp3
 49306  		goto _681
 49307  	}
 49308  	_169_c = bool2int(_sqlite3VdbeRealValue(tls, _pIn1) != float64(0))
 49309  	if int32(_pOp.Xopcode) == int32(22) {
 49310  		_169_c = bool2int(_169_c == 0)
 49311  	}
 49312  _681:
 49313  	if _169_c != 0 {
 49314  		goto _jump_to_p2
 49315  	}
 49316  	goto _250
 49317  _137:
 49318  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49319  	if (int32(_pIn1.Xflags) & int32(1)) != int32(0) {
 49320  		goto _jump_to_p2
 49321  	}
 49322  	goto _250
 49323  _138:
 49324  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49325  	if (int32(_pIn1.Xflags) & int32(1)) == int32(0) {
 49326  		goto _jump_to_p2
 49327  	}
 49328  	goto _250
 49329  _139:
 49330  	func() {
 49331  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 49332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80733), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 49333  			crt.X__builtin_abort(tls)
 49334  		}
 49335  	}()
 49336  	func() {
 49337  		if (*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))) == nil {
 49338  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80734), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63716)))
 49339  			crt.X__builtin_abort(tls)
 49340  		}
 49341  	}()
 49342  	if ((*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))).XnullRow) != 0 {
 49343  		_sqlite3VdbeMemSetNull(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_pOp.Xp3)*uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(72))))))))))))
 49344  		goto _jump_to_p2
 49345  	}
 49346  	goto _250
 49347  _140:
 49348  	_179_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 49349  	_179_p2 = _pOp.Xp2
 49350  	_rc = _sqlite3VdbeCursorMoveto(tls, &_179_pC, &_179_p2)
 49351  	if _rc != 0 {
 49352  		goto _abort_due_to_error
 49353  	}
 49354  	func() {
 49355  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 49356  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80792), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 49357  			crt.X__builtin_abort(tls)
 49358  		}
 49359  	}()
 49360  	_179_pDest = elem25(_aMem, uintptr(_pOp.Xp3))
 49361  	_sqlite3VdbeMemAboutToChange(tls, _p, _179_pDest)
 49362  	func() {
 49363  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 49364  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80795), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 49365  			crt.X__builtin_abort(tls)
 49366  		}
 49367  	}()
 49368  	func() {
 49369  		if _179_pC == nil {
 49370  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80796), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 49371  			crt.X__builtin_abort(tls)
 49372  		}
 49373  	}()
 49374  	func() {
 49375  		if _179_p2 >= int32(_179_pC.XnField) {
 49376  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80797), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63743)))
 49377  			crt.X__builtin_abort(tls)
 49378  		}
 49379  	}()
 49380  	_179_aOffset = _179_pC.XaOffset
 49381  	func() {
 49382  		if int32(_179_pC.XeCurType) == int32(2) {
 49383  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80799), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63757)))
 49384  			crt.X__builtin_abort(tls)
 49385  		}
 49386  	}()
 49387  	func() {
 49388  		if int32(_179_pC.XeCurType) == int32(3) && _179_pC.XnullRow == 0 {
 49389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80800), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63784)))
 49390  			crt.X__builtin_abort(tls)
 49391  		}
 49392  	}()
 49393  	func() {
 49394  		if int32(_179_pC.XeCurType) == int32(1) {
 49395  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80801), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63828)))
 49396  			crt.X__builtin_abort(tls)
 49397  		}
 49398  	}()
 49399  	if _179_pC.XcacheStatus == _p.XcacheCtr {
 49400  		goto _710
 49401  	}
 49402  	if _179_pC.XnullRow == 0 {
 49403  		goto _711
 49404  	}
 49405  	if int32(_179_pC.XeCurType) == int32(3) {
 49406  		func() {
 49407  			if (*(*int32)(unsafe.Pointer(&_179_pC.Xuc))) <= int32(0) {
 49408  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80806), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63857)))
 49409  				crt.X__builtin_abort(tls)
 49410  			}
 49411  		}()
 49412  		_179_pReg = elem25(_aMem, uintptr(*(*int32)(unsafe.Pointer(&_179_pC.Xuc))))
 49413  		func() {
 49414  			if (int32(_179_pReg.Xflags) & int32(16)) == 0 {
 49415  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80808), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63881)))
 49416  				crt.X__builtin_abort(tls)
 49417  			}
 49418  		}()
 49419  		func() {
 49420  			if (int32(_179_pReg.Xflags) & int32(128)) != int32(0) {
 49421  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80809), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63904)))
 49422  				crt.X__builtin_abort(tls)
 49423  			}
 49424  		}()
 49425  		_179_pC.XpayloadSize = store34(&_179_pC.XszRow, store34(&_179_avail, uint32(_179_pReg.Xn)))
 49426  		_179_pC.XaRow = (*uint8)(unsafe.Pointer(_179_pReg.Xz))
 49427  		goto _719
 49428  	}
 49429  	_sqlite3VdbeMemSetNull(tls, _179_pDest)
 49430  	goto _op_column_out
 49431  _719:
 49432  	goto _720
 49433  _711:
 49434  	_179_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_179_pC.Xuc)))
 49435  	func() {
 49436  		if int32(_179_pC.XeCurType) != int32(0) {
 49437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80818), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 49438  			crt.X__builtin_abort(tls)
 49439  		}
 49440  	}()
 49441  	func() {
 49442  		if _179_pCrsr == nil {
 49443  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80819), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63949)))
 49444  			crt.X__builtin_abort(tls)
 49445  		}
 49446  	}()
 49447  	func() {
 49448  		if _sqlite3BtreeCursorIsValid(tls, _179_pCrsr) == 0 {
 49449  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80820), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63955)))
 49450  			crt.X__builtin_abort(tls)
 49451  		}
 49452  	}()
 49453  	_179_pC.XpayloadSize = _sqlite3BtreePayloadSize(tls, _179_pCrsr)
 49454  	_179_pC.XaRow = (*uint8)(_sqlite3BtreePayloadFetch(tls, _179_pCrsr, &_179_avail))
 49455  	func() {
 49456  		if _179_avail > uint32(65536) {
 49457  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80823), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63988)))
 49458  			crt.X__builtin_abort(tls)
 49459  		}
 49460  	}()
 49461  	if _179_pC.XpayloadSize <= _179_avail {
 49462  		_179_pC.XszRow = _179_pC.XpayloadSize
 49463  		goto _732
 49464  	}
 49465  	if _179_pC.XpayloadSize > uint32(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
 49466  		goto _too_big
 49467  	}
 49468  	_179_pC.XszRow = _179_avail
 49469  _732:
 49470  _720:
 49471  	_179_pC.XcacheStatus = _p.XcacheCtr
 49472  	_179_pC.XiHdrOffset = uint32(uint8(func() int32 {
 49473  		if int32(*_179_pC.XaRow) < int32(128) {
 49474  			return func() int32 { _179_offset = uint32(*_179_pC.XaRow); return int32(1) }()
 49475  		}
 49476  		return int32(_sqlite3GetVarint32(tls, _179_pC.XaRow, &_179_offset))
 49477  	}()))
 49478  	_179_pC.XnHdrParsed = 0
 49479  	*elem31(_179_aOffset, 0) = _179_offset
 49480  	if _179_avail >= _179_offset {
 49481  		goto _735
 49482  	}
 49483  	_179_pC.XaRow = nil
 49484  	_179_pC.XszRow = 0
 49485  	if (_179_offset > uint32(98307)) || (_179_offset > _179_pC.XpayloadSize) {
 49486  		_rc = _sqlite3CorruptError(tls, int32(80856))
 49487  		goto _abort_due_to_error
 49488  	}
 49489  	goto _739
 49490  _735:
 49491  	if _179_offset > (0) {
 49492  		_179_zData = _179_pC.XaRow
 49493  		func() {
 49494  			if int32(_179_pC.XnHdrParsed) > _179_p2 {
 49495  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80865), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64001)))
 49496  				crt.X__builtin_abort(tls)
 49497  			}
 49498  		}()
 49499  		goto _op_column_read_header
 49500  	}
 49501  _739:
 49502  _710:
 49503  	if int32(_179_pC.XnHdrParsed) > _179_p2 {
 49504  		goto _742
 49505  	}
 49506  	if _179_pC.XiHdrOffset >= (*elem31(_179_aOffset, 0)) {
 49507  		goto _743
 49508  	}
 49509  	if _179_pC.XaRow != nil {
 49510  		goto _744
 49511  	}
 49512  	crt.Xmemset(tls, unsafe.Pointer(&_179_sMem), int32(0), uint64(72))
 49513  	_rc = _sqlite3VdbeMemFromBtree(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_179_pC.Xuc))), 0, *elem31(_179_aOffset, 0), &_179_sMem)
 49514  	if _rc != int32(0) {
 49515  		goto _abort_due_to_error
 49516  	}
 49517  	_179_zData = (*uint8)(unsafe.Pointer(_179_sMem.Xz))
 49518  	goto _op_column_read_header
 49519  _744:
 49520  	_179_zData = _179_pC.XaRow
 49521  _op_column_read_header:
 49522  	_179_i = int32(_179_pC.XnHdrParsed)
 49523  	_179_offset64 = uint64(*elem31(_179_aOffset, uintptr(_179_i)))
 49524  	_179_zHdr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_zData)) + uintptr(_179_pC.XiHdrOffset)))
 49525  	_179_zEndHdr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_zData)) + uintptr(*elem31(_179_aOffset, 0))))
 49526  _747:
 49527  	if store34(&_179_t, uint32(*elem15(_179_zHdr, 0))) < uint32(128) {
 49528  		*(*uintptr)(unsafe.Pointer(&_179_zHdr)) += uintptr(1)
 49529  		_179_offset64 += uint64(_sqlite3VdbeOneByteSerialTypeLen(tls, uint8(_179_t)))
 49530  		goto _749
 49531  	}
 49532  	*(*uintptr)(unsafe.Pointer(&_179_zHdr)) += uintptr(_sqlite3GetVarint32(tls, _179_zHdr, &_179_t))
 49533  	_179_offset64 += uint64(_sqlite3VdbeSerialTypeLen(tls, _179_t))
 49534  _749:
 49535  	*elem31((*uint32)(unsafe.Pointer(&_179_pC.XaType)), uintptr(postInc2(&_179_i, 1))) = _179_t
 49536  	*elem31(_179_aOffset, uintptr(_179_i)) = uint32(_179_offset64 & uint64(4294967295))
 49537  	if (_179_i <= _179_p2) && (crt.P2U(unsafe.Pointer(_179_zHdr)) < crt.P2U(unsafe.Pointer(_179_zEndHdr))) {
 49538  		goto _747
 49539  	}
 49540  	if (crt.P2U(unsafe.Pointer(_179_zHdr)) < crt.P2U(unsafe.Pointer(_179_zEndHdr)) || crt.P2U(unsafe.Pointer(_179_zHdr)) <= crt.P2U(unsafe.Pointer(_179_zEndHdr)) && _179_offset64 == uint64(_179_pC.XpayloadSize)) && _179_offset64 <= uint64(_179_pC.XpayloadSize) {
 49541  		goto _754
 49542  	}
 49543  	if _179_pC.XaRow == nil {
 49544  		_sqlite3VdbeMemRelease(tls, &_179_sMem)
 49545  	}
 49546  	_rc = _sqlite3CorruptError(tls, int32(80915))
 49547  	goto _abort_due_to_error
 49548  _754:
 49549  	_179_pC.XnHdrParsed = uint16(_179_i)
 49550  	_179_pC.XiHdrOffset = uint32(int64(uintptr(unsafe.Pointer(_179_zHdr)) - uintptr(unsafe.Pointer(_179_zData))))
 49551  	if _179_pC.XaRow == nil {
 49552  		_sqlite3VdbeMemRelease(tls, &_179_sMem)
 49553  	}
 49554  	goto _757
 49555  _743:
 49556  	_179_t = 0
 49557  _757:
 49558  	if int32(_179_pC.XnHdrParsed) > _179_p2 {
 49559  		goto _758
 49560  	}
 49561  	if int32(_pOp.Xp4type) == int32(-7) {
 49562  		_sqlite3VdbeMemShallowCopy(tls, _179_pDest, (*XMem)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))), int32(2048))
 49563  		goto _760
 49564  	}
 49565  	_sqlite3VdbeMemSetNull(tls, _179_pDest)
 49566  _760:
 49567  	goto _op_column_out
 49568  _758:
 49569  	goto _761
 49570  _742:
 49571  	_179_t = *elem31((*uint32)(unsafe.Pointer(&_179_pC.XaType)), uintptr(_179_p2))
 49572  _761:
 49573  	func() {
 49574  		if _179_p2 >= int32(_179_pC.XnHdrParsed) {
 49575  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80946), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64020)))
 49576  			crt.X__builtin_abort(tls)
 49577  		}
 49578  	}()
 49579  	func() {
 49580  		if _rc != int32(0) {
 49581  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80947), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 49582  			crt.X__builtin_abort(tls)
 49583  		}
 49584  	}()
 49585  	func() {
 49586  		if _sqlite3VdbeCheckMemInvariants(tls, _179_pDest) == 0 {
 49587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80948), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64038)))
 49588  			crt.X__builtin_abort(tls)
 49589  		}
 49590  	}()
 49591  	if (int32(_179_pDest.Xflags) & int32(9312)) != int32(0) {
 49592  		_sqlite3VdbeMemSetNull(tls, _179_pDest)
 49593  	}
 49594  	func() {
 49595  		if _179_t != (*elem31((*uint32)(unsafe.Pointer(&_179_pC.XaType)), uintptr(_179_p2))) {
 49596  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80952), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64075)))
 49597  			crt.X__builtin_abort(tls)
 49598  		}
 49599  	}()
 49600  	if _179_pC.XszRow < (*elem31(_179_aOffset, uintptr(_179_p2+int32(1)))) {
 49601  		goto _771
 49602  	}
 49603  	_179_zData = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_pC.XaRow)) + uintptr(*elem31(_179_aOffset, uintptr(_179_p2)))))
 49604  	if _179_t < uint32(12) {
 49605  		_sqlite3VdbeSerialGet(tls, _179_zData, _179_t, _179_pDest)
 49606  		goto _773
 49607  	}
 49608  	_179_pDest.Xn = store2(&_179_len, int32((_179_t-uint32(12))/uint32(2)))
 49609  	_179_pDest.Xenc = _encoding
 49610  	if _179_pDest.XszMalloc >= (_179_len + int32(2)) {
 49611  		goto _774
 49612  	}
 49613  	_179_pDest.Xflags = uint16(1)
 49614  	if _sqlite3VdbeMemGrow(tls, _179_pDest, _179_len+int32(2), int32(0)) != 0 {
 49615  		goto _no_mem
 49616  	}
 49617  	goto _776
 49618  _774:
 49619  	_179_pDest.Xz = _179_pDest.XzMalloc
 49620  _776:
 49621  	crt.Xmemcpy(tls, unsafe.Pointer(_179_pDest.Xz), unsafe.Pointer(_179_zData), uint64(_179_len))
 49622  	*elem1(_179_pDest.Xz, uintptr(_179_len)) = 0
 49623  	*elem1(_179_pDest.Xz, uintptr(_179_len+int32(1))) = 0
 49624  	_179_pDest.Xflags = *elem20((*uint16)(unsafe.Pointer(&_sqlite3VdbeExecØ00aFlagØ004)), uintptr(_179_t&uint32(1)))
 49625  _773:
 49626  	goto _op_column_out
 49627  _771:
 49628  	_179_pDest.Xenc = _encoding
 49629  	if (((int32(_pOp.Xp5) & int32(192)) != int32(0)) && (((_179_t >= uint32(12)) && ((_179_t & uint32(1)) == (0))) || ((int32(_pOp.Xp5) & int32(128)) != int32(0)))) || (store2(&_179_len, int32(_sqlite3VdbeSerialTypeLen(tls, _179_t))) == int32(0)) {
 49630  		_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(&_sqlite3VdbeExecØ00aZeroØ005)), _179_t, _179_pDest)
 49631  		goto _783
 49632  	}
 49633  	_rc = _sqlite3VdbeMemFromBtree(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_179_pC.Xuc))), *elem31(_179_aOffset, uintptr(_179_p2)), uint32(_179_len), _179_pDest)
 49634  	if _rc != int32(0) {
 49635  		goto _abort_due_to_error
 49636  	}
 49637  	_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(_179_pDest.Xz)), _179_t, _179_pDest)
 49638  	{
 49639  		p := &_179_pDest.Xflags
 49640  		*p = uint16(int32(*p) & int32(-4097))
 49641  	}
 49642  _783:
 49643  _op_column_out:
 49644  	if (_db.Xflags & int32(1)) != 0 {
 49645  		_registerTrace(tls, _pOp.Xp3, _179_pDest)
 49646  	}
 49647  	goto _250
 49648  _141:
 49649  	_213_zAffinity = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 49650  	func() {
 49651  		if _213_zAffinity == nil {
 49652  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81025), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64092)))
 49653  			crt.X__builtin_abort(tls)
 49654  		}
 49655  	}()
 49656  	func() {
 49657  		if _pOp.Xp2 <= int32(0) {
 49658  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81026), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61037)))
 49659  			crt.X__builtin_abort(tls)
 49660  		}
 49661  	}()
 49662  	func() {
 49663  		if int32(*elem1(_213_zAffinity, uintptr(_pOp.Xp2))) != int32(0) {
 49664  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81027), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64105)))
 49665  			crt.X__builtin_abort(tls)
 49666  		}
 49667  	}()
 49668  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49669  _792:
 49670  	func() {
 49671  		if crt.P2U(unsafe.Pointer(_pIn1)) > crt.P2U(unsafe.Pointer(elem25((*XMem)(_p.XaMem), uintptr((_p.XnMem+int32(1))-_p.XnCursor)))) {
 49672  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81030), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64127)))
 49673  			crt.X__builtin_abort(tls)
 49674  		}
 49675  	}()
 49676  	func() {
 49677  		if (int32(_pIn1.Xflags) & int32(128)) != int32(0) {
 49678  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81031), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62214)))
 49679  			crt.X__builtin_abort(tls)
 49680  		}
 49681  	}()
 49682  	_applyAffinity(tls, _pIn1, *postInc1(&_213_zAffinity, 1), _encoding)
 49683  	*(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(72)
 49684  	if (*elem1(_213_zAffinity, 0)) != 0 {
 49685  		goto _792
 49686  	}
 49687  	goto _250
 49688  _142:
 49689  	_215_nData = 0
 49690  	_215_nHdr = int32(0)
 49691  	_215_nZero = 0
 49692  	_215_nField = _pOp.Xp1
 49693  	_215_zAffinity = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 49694  	func() {
 49695  		if _215_nField <= int32(0) || _pOp.Xp2 <= int32(0) || (_pOp.Xp2+_215_nField) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 49696  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81092), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64170)))
 49697  			crt.X__builtin_abort(tls)
 49698  		}
 49699  	}()
 49700  	_215_pData0 = elem25(_aMem, uintptr(_215_nField))
 49701  	_215_nField = _pOp.Xp2
 49702  	_215_pLast = elem25(_215_pData0, uintptr(_215_nField-int32(1)))
 49703  	_215_file_format = int32(_p.XminWriteFileFormat)
 49704  	func() {
 49705  		if _pOp.Xp3 >= _pOp.Xp1 && _pOp.Xp3 < (_pOp.Xp1+_pOp.Xp2) {
 49706  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81099), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64238)))
 49707  			crt.X__builtin_abort(tls)
 49708  		}
 49709  	}()
 49710  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 49711  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 49712  	func() {
 49713  		if crt.P2U(unsafe.Pointer(_215_pData0)) > crt.P2U(unsafe.Pointer(_215_pLast)) {
 49714  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81105), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64282)))
 49715  			crt.X__builtin_abort(tls)
 49716  		}
 49717  	}()
 49718  	if _215_zAffinity == nil {
 49719  		goto _806
 49720  	}
 49721  	_215_pRec = _215_pData0
 49722  _807:
 49723  	_applyAffinity(tls, postInc25(&_215_pRec, 72), *postInc1(&_215_zAffinity, 1), _encoding)
 49724  	func() {
 49725  		if int32(*elem1(_215_zAffinity, 0)) != int32(0) && crt.P2U(unsafe.Pointer(_215_pRec)) > crt.P2U(unsafe.Pointer(_215_pLast)) {
 49726  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81110), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64296)))
 49727  			crt.X__builtin_abort(tls)
 49728  		}
 49729  	}()
 49730  	if (*elem1(_215_zAffinity, 0)) != 0 {
 49731  		goto _807
 49732  	}
 49733  _806:
 49734  	_215_pRec = _215_pLast
 49735  _811:
 49736  	func() {
 49737  		if (int32(_215_pRec.Xflags) & int32(128)) != int32(0) {
 49738  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81133), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64327)))
 49739  			crt.X__builtin_abort(tls)
 49740  		}
 49741  	}()
 49742  	_215_pRec.XuTemp = store34(&_215_serial_type, _sqlite3VdbeSerialType(tls, _215_pRec, _215_file_format, &_215_len))
 49743  	if (int32(_215_pRec.Xflags) & int32(16384)) == 0 {
 49744  		goto _814
 49745  	}
 49746  	if _215_nData == 0 {
 49747  		goto _815
 49748  	}
 49749  	if _sqlite3VdbeMemExpandBlob(tls, _215_pRec) != 0 {
 49750  		goto _no_mem
 49751  	}
 49752  	goto _817
 49753  _815:
 49754  	_215_nZero += int64(*(*int32)(unsafe.Pointer(&_215_pRec.Xu)))
 49755  	_215_len -= uint32(*(*int32)(unsafe.Pointer(&_215_pRec.Xu)))
 49756  _817:
 49757  _814:
 49758  	_215_nData += uint64(_215_len)
 49759  	_215_nHdr += func() int32 {
 49760  		if _215_serial_type <= uint32(127) {
 49761  			return int32(1)
 49762  		}
 49763  		return _sqlite3VarintLen(tls, uint64(_215_serial_type))
 49764  	}()
 49765  	if _215_pRec == _215_pData0 {
 49766  		goto _821
 49767  	}
 49768  	*(*uintptr)(unsafe.Pointer(&_215_pRec)) += uintptr(18446744073709551544)
 49769  	goto _811
 49770  _821:
 49771  	if _215_nHdr <= int32(126) {
 49772  		_215_nHdr += int32(1)
 49773  		goto _823
 49774  	}
 49775  	_215_nVarint = _sqlite3VarintLen(tls, uint64(_215_nHdr))
 49776  	_215_nHdr += _215_nVarint
 49777  	if _215_nVarint < _sqlite3VarintLen(tls, uint64(_215_nHdr)) {
 49778  		_215_nHdr += 1
 49779  	}
 49780  _823:
 49781  	_215_nByte = int64(uint64(_215_nHdr) + _215_nData)
 49782  	if (_215_nByte + _215_nZero) > int64(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
 49783  		goto _too_big
 49784  	}
 49785  	if _sqlite3VdbeMemClearAndResize(tls, _pOut, int32(_215_nByte)) != 0 {
 49786  		goto _no_mem
 49787  	}
 49788  	_215_zNewRecord = (*uint8)(unsafe.Pointer(_pOut.Xz))
 49789  	_215_i = int32(uint8(func() int32 {
 49790  		if uint32(_215_nHdr) < uint32(128) {
 49791  			return func() int32 { *_215_zNewRecord = uint8(_215_nHdr); return int32(1) }()
 49792  		}
 49793  		return _sqlite3PutVarint(tls, _215_zNewRecord, uint64(_215_nHdr))
 49794  	}()))
 49795  	_215_j = _215_nHdr
 49796  	func() {
 49797  		if crt.P2U(unsafe.Pointer(_215_pData0)) > crt.P2U(unsafe.Pointer(_215_pLast)) {
 49798  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81184), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64282)))
 49799  			crt.X__builtin_abort(tls)
 49800  		}
 49801  	}()
 49802  	_215_pRec = _215_pData0
 49803  _831:
 49804  	_215_serial_type = _215_pRec.XuTemp
 49805  	_215_i += int32(uint8(func() int32 {
 49806  		if _215_serial_type < uint32(128) {
 49807  			return func() int32 { *elem15(_215_zNewRecord, uintptr(_215_i)) = uint8(_215_serial_type); return int32(1) }()
 49808  		}
 49809  		return _sqlite3PutVarint(tls, elem15(_215_zNewRecord, uintptr(_215_i)), uint64(_215_serial_type))
 49810  	}()))
 49811  	{
 49812  		p := &_215_j
 49813  		*p = int32(uint32(*p) + _sqlite3VdbeSerialPut(tls, elem15(_215_zNewRecord, uintptr(_215_j)), _215_pRec, _215_serial_type))
 49814  	}
 49815  	if crt.P2U(unsafe.Pointer(preInc25(&_215_pRec, 72))) <= crt.P2U(unsafe.Pointer(_215_pLast)) {
 49816  		goto _831
 49817  	}
 49818  	func() {
 49819  		if _215_i != _215_nHdr {
 49820  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81195), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64344)))
 49821  			crt.X__builtin_abort(tls)
 49822  		}
 49823  	}()
 49824  	func() {
 49825  		if int64(_215_j) != _215_nByte {
 49826  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81196), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64352)))
 49827  			crt.X__builtin_abort(tls)
 49828  		}
 49829  	}()
 49830  	func() {
 49831  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 49832  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81198), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 49833  			crt.X__builtin_abort(tls)
 49834  		}
 49835  	}()
 49836  	_pOut.Xn = int32(_215_nByte)
 49837  	_pOut.Xflags = uint16(16)
 49838  	if _215_nZero != 0 {
 49839  		*(*int32)(unsafe.Pointer(&_pOut.Xu)) = int32(_215_nZero)
 49840  		{
 49841  			p := &_pOut.Xflags
 49842  			*p = uint16(int32(*p) | int32(16384))
 49843  		}
 49844  	}
 49845  	if (_db.Xflags & int32(1)) != 0 {
 49846  		_registerTrace(tls, _pOp.Xp3, _pOut)
 49847  	}
 49848  	goto _250
 49849  _143:
 49850  	func() {
 49851  		if int32((*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))).XeCurType) != int32(0) {
 49852  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81221), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64361)))
 49853  			crt.X__builtin_abort(tls)
 49854  		}
 49855  	}()
 49856  	_228_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&((*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))).Xuc))))
 49857  	func() {
 49858  		if _228_pCrsr == nil {
 49859  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81223), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63949)))
 49860  			crt.X__builtin_abort(tls)
 49861  		}
 49862  	}()
 49863  	_228_nEntry = 0
 49864  	_rc = _sqlite3BtreeCount(tls, _228_pCrsr, &_228_nEntry)
 49865  	if _rc != 0 {
 49866  		goto _abort_due_to_error
 49867  	}
 49868  	_pOut = _out2Prerelease(tls, _p, _pOp)
 49869  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _228_nEntry
 49870  	goto _250
 49871  _144:
 49872  	_229_p1 = _pOp.Xp1
 49873  	_229_zName = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 49874  	func() {
 49875  		if (*XSavepoint)(_db.XpSavepoint) != nil && int32(_db.XautoCommit) != int32(0) {
 49876  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81255), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64404)))
 49877  			crt.X__builtin_abort(tls)
 49878  		}
 49879  	}()
 49880  	func() {
 49881  		if _229_p1 != int32(0) && _229_p1 != int32(1) && _229_p1 != int32(2) {
 49882  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81256), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64443)))
 49883  			crt.X__builtin_abort(tls)
 49884  		}
 49885  	}()
 49886  	func() {
 49887  		if _db.XpSavepoint == nil && int32(_db.XisTransactionSavepoint) != int32(0) {
 49888  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81257), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64510)))
 49889  			crt.X__builtin_abort(tls)
 49890  		}
 49891  	}()
 49892  	func() {
 49893  		if _checkSavepointCount(tls, _db) == 0 {
 49894  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81258), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64558)))
 49895  			crt.X__builtin_abort(tls)
 49896  		}
 49897  	}()
 49898  	func() {
 49899  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 49900  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81259), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 49901  			crt.X__builtin_abort(tls)
 49902  		}
 49903  	}()
 49904  	if _229_p1 != int32(0) {
 49905  		goto _862
 49906  	}
 49907  	if _db.XnVdbeWrite > int32(0) {
 49908  		_sqlite3VdbeError(tls, _p, str(64595))
 49909  		_rc = int32(5)
 49910  		goto _864
 49911  	}
 49912  	_229_nName = _sqlite3Strlen30(tls, _229_zName)
 49913  	func() {
 49914  		if int32(_db.XautoCommit) != int32(0) && _db.XnVTrans != int32(0) {
 49915  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81276), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64646)))
 49916  			crt.X__builtin_abort(tls)
 49917  		}
 49918  	}()
 49919  	_rc = _sqlite3VtabSavepoint(tls, _db, int32(0), _db.XnStatement+_db.XnSavepoint)
 49920  	if _rc != int32(0) {
 49921  		goto _abort_due_to_error
 49922  	}
 49923  	_229_pNew = (*XSavepoint)(_sqlite3DbMallocRawNN(tls, _db, (uint64(32)+uint64(_229_nName))+uint64(1)))
 49924  	if _229_pNew == nil {
 49925  		goto _869
 49926  	}
 49927  	_229_pNew.XzName = (*int8)(unsafe.Pointer(elem84(_229_pNew, uintptr(1))))
 49928  	crt.Xmemcpy(tls, unsafe.Pointer(_229_pNew.XzName), unsafe.Pointer(_229_zName), uint64(_229_nName+int32(1)))
 49929  	if _db.XautoCommit != 0 {
 49930  		_db.XautoCommit = 0
 49931  		_db.XisTransactionSavepoint = uint8(1)
 49932  		goto _871
 49933  	}
 49934  	_db.XnSavepoint += 1
 49935  _871:
 49936  	*(**XSavepoint)(unsafe.Pointer(&_229_pNew.XpNext)) = (*XSavepoint)(_db.XpSavepoint)
 49937  	*(**XSavepoint)(unsafe.Pointer(&_db.XpSavepoint)) = _229_pNew
 49938  	_229_pNew.XnDeferredCons = _db.XnDeferredCons
 49939  	_229_pNew.XnDeferredImmCons = _db.XnDeferredImmCons
 49940  _869:
 49941  _864:
 49942  	goto _872
 49943  _862:
 49944  	_229_iSavepoint = int32(0)
 49945  	_229_pSavepoint = (*XSavepoint)(_db.XpSavepoint)
 49946  _873:
 49947  	if _229_pSavepoint == nil || _sqlite3StrICmp(tls, _229_pSavepoint.XzName, _229_zName) == 0 {
 49948  		goto _877
 49949  	}
 49950  	_229_iSavepoint += 1
 49951  	_229_pSavepoint = (*XSavepoint)(_229_pSavepoint.XpNext)
 49952  	goto _873
 49953  _877:
 49954  	if _229_pSavepoint == nil {
 49955  		_sqlite3VdbeError(tls, _p, str(64682), unsafe.Pointer(_229_zName))
 49956  		_rc = int32(1)
 49957  		goto _882
 49958  	}
 49959  	if (_db.XnVdbeWrite > int32(0)) && (_229_p1 == int32(1)) {
 49960  		_sqlite3VdbeError(tls, _p, str(64704))
 49961  		_rc = int32(5)
 49962  		goto _882
 49963  	}
 49964  	_240_isTransaction = bool2int(((*XSavepoint)(_229_pSavepoint.XpNext) == nil) && (_db.XisTransactionSavepoint != 0))
 49965  	if _240_isTransaction == 0 || _229_p1 != int32(1) {
 49966  		goto _885
 49967  	}
 49968  	if store2(&_rc, _sqlite3VdbeCheckFk(tls, _p, int32(1))) != int32(0) {
 49969  		goto _vdbe_return
 49970  	}
 49971  	_db.XautoCommit = uint8(1)
 49972  	if _sqlite3VdbeHalt(tls, _p) == int32(5) {
 49973  		_p.Xpc = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))
 49974  		_db.XautoCommit = 0
 49975  		_p.Xrc = store2(&_rc, int32(5))
 49976  		goto _vdbe_return
 49977  	}
 49978  	_db.XisTransactionSavepoint = 0
 49979  	_rc = _p.Xrc
 49980  	goto _888
 49981  _885:
 49982  	_229_iSavepoint = (_db.XnSavepoint - _229_iSavepoint) - int32(1)
 49983  	if _229_p1 != int32(2) {
 49984  		goto _889
 49985  	}
 49986  	_244_isSchemaChange = bool2int((_db.Xflags & int32(2)) != int32(0))
 49987  	_229_ii = int32(0)
 49988  _890:
 49989  	if _229_ii >= _db.XnDb {
 49990  		goto _893
 49991  	}
 49992  	_rc = _sqlite3BtreeTripAllCursors(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_229_ii)).XpBt), int32(516), bool2int(_244_isSchemaChange == int32(0)))
 49993  	if _rc != int32(0) {
 49994  		goto _abort_due_to_error
 49995  	}
 49996  	_229_ii += 1
 49997  	goto _890
 49998  _893:
 49999  	goto _895
 50000  _889:
 50001  	_244_isSchemaChange = int32(0)
 50002  _895:
 50003  	_229_ii = int32(0)
 50004  _896:
 50005  	if _229_ii >= _db.XnDb {
 50006  		goto _899
 50007  	}
 50008  	_rc = _sqlite3BtreeSavepoint(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_229_ii)).XpBt), _229_p1, _229_iSavepoint)
 50009  	if _rc != int32(0) {
 50010  		goto _abort_due_to_error
 50011  	}
 50012  	_229_ii += 1
 50013  	goto _896
 50014  _899:
 50015  	if _244_isSchemaChange != 0 {
 50016  		_sqlite3ExpirePreparedStatements(tls, _db)
 50017  		_sqlite3ResetAllSchemasOfConnection(tls, _db)
 50018  		_db.Xflags = _db.Xflags | int32(2)
 50019  	}
 50020  _888:
 50021  	if (*XSavepoint)(_db.XpSavepoint) != _229_pSavepoint {
 50022  		_229_pTmp = (*XSavepoint)(_db.XpSavepoint)
 50023  		*(**XSavepoint)(unsafe.Pointer(&_db.XpSavepoint)) = (*XSavepoint)(_229_pTmp.XpNext)
 50024  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_229_pTmp))
 50025  		_db.XnSavepoint -= 1
 50026  		goto _888
 50027  	}
 50028  	if _229_p1 != int32(1) {
 50029  		goto _904
 50030  	}
 50031  	func() {
 50032  		if _229_pSavepoint != (*XSavepoint)(_db.XpSavepoint) {
 50033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81387), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64758)))
 50034  			crt.X__builtin_abort(tls)
 50035  		}
 50036  	}()
 50037  	*(**XSavepoint)(unsafe.Pointer(&_db.XpSavepoint)) = (*XSavepoint)(_229_pSavepoint.XpNext)
 50038  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_229_pSavepoint))
 50039  	if _240_isTransaction == 0 {
 50040  		_db.XnSavepoint -= 1
 50041  	}
 50042  	goto _908
 50043  _904:
 50044  	_db.XnDeferredCons = _229_pSavepoint.XnDeferredCons
 50045  	_db.XnDeferredImmCons = _229_pSavepoint.XnDeferredImmCons
 50046  _908:
 50047  	if _240_isTransaction != 0 && _229_p1 != int32(2) {
 50048  		goto _910
 50049  	}
 50050  	_rc = _sqlite3VtabSavepoint(tls, _db, _229_p1, _229_iSavepoint)
 50051  	if _rc != int32(0) {
 50052  		goto _abort_due_to_error
 50053  	}
 50054  _910:
 50055  _882:
 50056  _872:
 50057  	if _rc != 0 {
 50058  		goto _abort_due_to_error
 50059  	}
 50060  	goto _250
 50061  _145:
 50062  	_256_desiredAutoCommit = _pOp.Xp1
 50063  	_256_iRollback = _pOp.Xp2
 50064  	func() {
 50065  		if _256_desiredAutoCommit != int32(1) && _256_desiredAutoCommit != int32(0) {
 50066  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81424), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64785)))
 50067  			crt.X__builtin_abort(tls)
 50068  		}
 50069  	}()
 50070  	func() {
 50071  		if _256_desiredAutoCommit != int32(1) && _256_iRollback != int32(0) {
 50072  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81425), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64830)))
 50073  			crt.X__builtin_abort(tls)
 50074  		}
 50075  	}()
 50076  	func() {
 50077  		if _db.XnVdbeActive <= int32(0) {
 50078  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81426), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64867)))
 50079  			crt.X__builtin_abort(tls)
 50080  		}
 50081  	}()
 50082  	func() {
 50083  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 50084  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81427), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 50085  			crt.X__builtin_abort(tls)
 50086  		}
 50087  	}()
 50088  	if _256_desiredAutoCommit == int32(_db.XautoCommit) {
 50089  		goto _923
 50090  	}
 50091  	if _256_iRollback != 0 {
 50092  		func() {
 50093  			if _256_desiredAutoCommit != int32(1) {
 50094  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81431), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64885)))
 50095  				crt.X__builtin_abort(tls)
 50096  			}
 50097  		}()
 50098  		_sqlite3RollbackAll(tls, _db, int32(516))
 50099  		_db.XautoCommit = uint8(1)
 50100  		goto _932
 50101  	}
 50102  	if _256_desiredAutoCommit != 0 && (_db.XnVdbeWrite > int32(0)) {
 50103  		_sqlite3VdbeError(tls, _p, str(64906))
 50104  		_rc = int32(5)
 50105  		goto _abort_due_to_error
 50106  	}
 50107  	if store2(&_rc, _sqlite3VdbeCheckFk(tls, _p, int32(1))) != int32(0) {
 50108  		goto _vdbe_return
 50109  	}
 50110  	_db.XautoCommit = uint8(_256_desiredAutoCommit)
 50111  _932:
 50112  	if _sqlite3VdbeHalt(tls, _p) == int32(5) {
 50113  		_p.Xpc = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))
 50114  		_db.XautoCommit = uint8(int32(1) - _256_desiredAutoCommit)
 50115  		_p.Xrc = store2(&_rc, int32(5))
 50116  		goto _vdbe_return
 50117  	}
 50118  	func() {
 50119  		if _db.XnStatement != int32(0) {
 50120  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81453), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64961)))
 50121  			crt.X__builtin_abort(tls)
 50122  		}
 50123  	}()
 50124  	_sqlite3CloseSavepoints(tls, _db)
 50125  	if _p.Xrc == int32(0) {
 50126  		_rc = int32(101)
 50127  		goto _937
 50128  	}
 50129  	_rc = int32(1)
 50130  _937:
 50131  	goto _vdbe_return
 50132  _923:
 50133  	_sqlite3VdbeError(tls, _p, func() *int8 {
 50134  		if _256_desiredAutoCommit == 0 {
 50135  			return str(64979)
 50136  		}
 50137  		return func() *int8 {
 50138  			if _256_iRollback != 0 {
 50139  				return str(65027)
 50140  			}
 50141  			return str(65070)
 50142  		}()
 50143  	}())
 50144  	_rc = int32(1)
 50145  	goto _abort_due_to_error
 50146  _146:
 50147  	func() {
 50148  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 50149  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81512), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 50150  			crt.X__builtin_abort(tls)
 50151  		}
 50152  	}()
 50153  	func() {
 50154  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) && _pOp.Xp2 != int32(0) {
 50155  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81513), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65111)))
 50156  			crt.X__builtin_abort(tls)
 50157  		}
 50158  	}()
 50159  	func() {
 50160  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 50161  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81514), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 50162  			crt.X__builtin_abort(tls)
 50163  		}
 50164  	}()
 50165  	func() {
 50166  		if (_p.XbtreeMask & (uint32(1) << uint(_pOp.Xp1))) == (0) {
 50167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81515), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65170)))
 50168  			crt.X__builtin_abort(tls)
 50169  		}
 50170  	}()
 50171  	if _pOp.Xp2 != 0 && ((_db.Xflags & int32(67108864)) != int32(0)) {
 50172  		_rc = int32(8)
 50173  		goto _abort_due_to_error
 50174  	}
 50175  	_266_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpBt)
 50176  	if _266_pBt == nil {
 50177  		goto _955
 50178  	}
 50179  	_rc = _sqlite3BtreeBeginTrans(tls, _266_pBt, _pOp.Xp2)
 50180  	if _rc == int32(0) {
 50181  		goto _956
 50182  	}
 50183  	if (_rc & int32(255)) == int32(5) {
 50184  		_p.Xpc = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))
 50185  		_p.Xrc = _rc
 50186  		goto _vdbe_return
 50187  	}
 50188  	goto _abort_due_to_error
 50189  _956:
 50190  	if _pOp.Xp2 == 0 || ((uint32(_p.Xexpired>>6)<<31)>>31) == 0 || int32(_db.XautoCommit) != int32(0) && _db.XnVdbeRead <= int32(1) {
 50191  		goto _961
 50192  	}
 50193  	func() {
 50194  		if _sqlite3BtreeIsInTrans(tls, _266_pBt) == 0 {
 50195  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81538), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65204)))
 50196  			crt.X__builtin_abort(tls)
 50197  		}
 50198  	}()
 50199  	if _p.XiStatement == int32(0) {
 50200  		func() {
 50201  			if _db.XnStatement < int32(0) || _db.XnSavepoint < int32(0) {
 50202  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81540), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65231)))
 50203  				crt.X__builtin_abort(tls)
 50204  			}
 50205  		}()
 50206  		_db.XnStatement += 1
 50207  		_p.XiStatement = _db.XnSavepoint + _db.XnStatement
 50208  	}
 50209  	_rc = _sqlite3VtabSavepoint(tls, _db, int32(0), _p.XiStatement-int32(1))
 50210  	if _rc == int32(0) {
 50211  		_rc = _sqlite3BtreeBeginStmt(tls, _266_pBt, _p.XiStatement)
 50212  	}
 50213  	_p.XnStmtDefCons = _db.XnDeferredCons
 50214  	_p.XnStmtDefImmCons = _db.XnDeferredImmCons
 50215  _961:
 50216  	_sqlite3BtreeGetMeta(tls, _266_pBt, int32(1), (*uint32)(unsafe.Pointer(&_266_iMeta)))
 50217  	_266_iGen = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpSchema).XiGeneration
 50218  	goto _969
 50219  _955:
 50220  	_266_iGen = store2(&_266_iMeta, int32(0))
 50221  _969:
 50222  	func() {
 50223  		if int32(_pOp.Xp5) != int32(0) && int32(_pOp.Xp4type) != int32(-11) {
 50224  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81567), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65270)))
 50225  			crt.X__builtin_abort(tls)
 50226  		}
 50227  	}()
 50228  	if _pOp.Xp5 == 0 || _266_iMeta == _pOp.Xp3 && _266_iGen == (*(*int32)(unsafe.Pointer(&_pOp.Xp4))) {
 50229  		goto _975
 50230  	}
 50231  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzErrMsg))
 50232  	_p.XzErrMsg = _sqlite3DbStrDup(tls, _db, str(59618))
 50233  	if ((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpSchema).Xschema_cookie) != _266_iMeta {
 50234  		_sqlite3ResetOneSchema(tls, _db, _pOp.Xp1)
 50235  	}
 50236  	storebits26(&_p.Xexpired, int16(1), 1, 0)
 50237  	_rc = int32(17)
 50238  _975:
 50239  	if _rc != 0 {
 50240  		goto _abort_due_to_error
 50241  	}
 50242  	goto _250
 50243  _147:
 50244  	func() {
 50245  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 50246  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81611), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 50247  			crt.X__builtin_abort(tls)
 50248  		}
 50249  	}()
 50250  	_277_iDb = _pOp.Xp1
 50251  	_277_iCookie = _pOp.Xp3
 50252  	func() {
 50253  		if _pOp.Xp3 >= int32(16) {
 50254  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81614), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65306)))
 50255  			crt.X__builtin_abort(tls)
 50256  		}
 50257  	}()
 50258  	func() {
 50259  		if _277_iDb < int32(0) || _277_iDb >= _db.XnDb {
 50260  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81615), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(21693)))
 50261  			crt.X__builtin_abort(tls)
 50262  		}
 50263  	}()
 50264  	func() {
 50265  		if (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_277_iDb)).XpBt) == nil {
 50266  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81616), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65334)))
 50267  			crt.X__builtin_abort(tls)
 50268  		}
 50269  	}()
 50270  	func() {
 50271  		if (_p.XbtreeMask & (uint32(1) << uint(_277_iDb))) == (0) {
 50272  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81617), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65354)))
 50273  			crt.X__builtin_abort(tls)
 50274  		}
 50275  	}()
 50276  	_sqlite3BtreeGetMeta(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_277_iDb)).XpBt), _277_iCookie, (*uint32)(unsafe.Pointer(&_277_iMeta)))
 50277  	_pOut = _out2Prerelease(tls, _p, _pOp)
 50278  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_277_iMeta)
 50279  	goto _250
 50280  _148:
 50281  	func() {
 50282  		if _pOp.Xp2 >= int32(16) {
 50283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81637), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65384)))
 50284  			crt.X__builtin_abort(tls)
 50285  		}
 50286  	}()
 50287  	func() {
 50288  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 50289  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81638), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 50290  			crt.X__builtin_abort(tls)
 50291  		}
 50292  	}()
 50293  	func() {
 50294  		if (_p.XbtreeMask & (uint32(1) << uint(_pOp.Xp1))) == (0) {
 50295  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81639), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65170)))
 50296  			crt.X__builtin_abort(tls)
 50297  		}
 50298  	}()
 50299  	func() {
 50300  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 50301  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81640), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 50302  			crt.X__builtin_abort(tls)
 50303  		}
 50304  	}()
 50305  	_278_pDb = elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1))
 50306  	func() {
 50307  		if (*XBtree)(_278_pDb.XpBt) == nil {
 50308  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81642), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65427)))
 50309  			crt.X__builtin_abort(tls)
 50310  		}
 50311  	}()
 50312  	func() {
 50313  		if _sqlite3SchemaMutexHeld(tls, _db, _pOp.Xp1, nil) == 0 {
 50314  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81643), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65439)))
 50315  			crt.X__builtin_abort(tls)
 50316  		}
 50317  	}()
 50318  	_rc = _sqlite3BtreeUpdateMeta(tls, (*XBtree)(_278_pDb.XpBt), _pOp.Xp2, uint32(_pOp.Xp3))
 50319  	if _pOp.Xp2 == int32(1) {
 50320  		(*XSchema)(_278_pDb.XpSchema).Xschema_cookie = _pOp.Xp3
 50321  		_db.Xflags |= int32(2)
 50322  		goto _1004
 50323  	}
 50324  	if _pOp.Xp2 == int32(2) {
 50325  		(*XSchema)(_278_pDb.XpSchema).Xfile_format = uint8(_pOp.Xp3)
 50326  	}
 50327  _1004:
 50328  	if _pOp.Xp1 == int32(1) {
 50329  		_sqlite3ExpirePreparedStatements(tls, _db)
 50330  		storebits26(&_p.Xexpired, 0, 1, 0)
 50331  	}
 50332  	if _rc != 0 {
 50333  		goto _abort_due_to_error
 50334  	}
 50335  	goto _250
 50336  _149:
 50337  	func() {
 50338  		if int32(_pOp.Xp5) != int32(0) && int32(_pOp.Xp5) != int32(2) {
 50339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81739), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65478)))
 50340  			crt.X__builtin_abort(tls)
 50341  		}
 50342  	}()
 50343  	func() {
 50344  		if int32(_pOp.Xp4type) != int32(-5) {
 50345  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81740), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65515)))
 50346  			crt.X__builtin_abort(tls)
 50347  		}
 50348  	}()
 50349  	_282_pCur = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 50350  	if (_282_pCur != nil) && (_282_pCur.XpgnoRoot == uint32(_pOp.Xp2)) {
 50351  		func() {
 50352  			if int32(_282_pCur.XiDb) != _pOp.Xp3 {
 50353  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81743), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65539)))
 50354  				crt.X__builtin_abort(tls)
 50355  			}
 50356  		}()
 50357  		goto _open_cursor_set_hints
 50358  	}
 50359  _1013:
 50360  	func() {
 50361  		if int32(_pOp.Xopcode) != int32(107) && int32(_pOp.Xp5) != int32(0) && int32(_pOp.Xp5) != int32(2) {
 50362  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81751), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65558)))
 50363  			crt.X__builtin_abort(tls)
 50364  		}
 50365  	}()
 50366  	func() {
 50367  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 50368  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81752), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 50369  			crt.X__builtin_abort(tls)
 50370  		}
 50371  	}()
 50372  	func() {
 50373  		if int32(_pOp.Xopcode) != int32(106) && int32(_pOp.Xopcode) != int32(105) && int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 50374  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81753), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65624)))
 50375  			crt.X__builtin_abort(tls)
 50376  		}
 50377  	}()
 50378  	if ((uint32(_p.Xexpired) << 31) >> 31) != 0 {
 50379  		_rc = int32(516)
 50380  		goto _abort_due_to_error
 50381  	}
 50382  	_282_nField = int32(0)
 50383  	_282_pKeyInfo = nil
 50384  	_282_p2 = _pOp.Xp2
 50385  	_282_iDb = _pOp.Xp3
 50386  	func() {
 50387  		if _282_iDb < int32(0) || _282_iDb >= _db.XnDb {
 50388  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81765), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(21693)))
 50389  			crt.X__builtin_abort(tls)
 50390  		}
 50391  	}()
 50392  	func() {
 50393  		if (_p.XbtreeMask & (uint32(1) << uint(_282_iDb))) == (0) {
 50394  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81766), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65354)))
 50395  			crt.X__builtin_abort(tls)
 50396  		}
 50397  	}()
 50398  	_282_pDb = elem27((*XDb)(_db.XaDb), uintptr(_282_iDb))
 50399  	_282_pX = (*XBtree)(_282_pDb.XpBt)
 50400  	func() {
 50401  		if _282_pX == nil {
 50402  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81769), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65696)))
 50403  			crt.X__builtin_abort(tls)
 50404  		}
 50405  	}()
 50406  	if int32(_pOp.Xopcode) != int32(107) {
 50407  		goto _1034
 50408  	}
 50409  
 50410  	_282_wrFlag = int32(4) | (int32(_pOp.Xp5) & int32(8))
 50411  	func() {
 50412  		if _sqlite3SchemaMutexHeld(tls, _db, _282_iDb, nil) == 0 {
 50413  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81773), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(51126)))
 50414  			crt.X__builtin_abort(tls)
 50415  		}
 50416  	}()
 50417  	if int32((*XSchema)(_282_pDb.XpSchema).Xfile_format) < int32(_p.XminWriteFileFormat) {
 50418  		_p.XminWriteFileFormat = (*XSchema)(_282_pDb.XpSchema).Xfile_format
 50419  	}
 50420  	goto _1038
 50421  _1034:
 50422  	_282_wrFlag = int32(0)
 50423  _1038:
 50424  	if (int32(_pOp.Xp5) & int32(16)) != 0 {
 50425  		func() {
 50426  			if _282_p2 <= int32(0) {
 50427  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81781), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65702)))
 50428  				crt.X__builtin_abort(tls)
 50429  			}
 50430  		}()
 50431  		func() {
 50432  			if _282_p2 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 50433  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81782), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65707)))
 50434  				crt.X__builtin_abort(tls)
 50435  			}
 50436  		}()
 50437  		_pIn2 = elem25(_aMem, uintptr(_282_p2))
 50438  		func() {
 50439  			if (int32(_pIn2.Xflags) & int32(128)) != int32(0) {
 50440  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81784), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65736)))
 50441  				crt.X__builtin_abort(tls)
 50442  			}
 50443  		}()
 50444  		func() {
 50445  			if (int32(_pIn2.Xflags) & int32(4)) == int32(0) {
 50446  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81785), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65753)))
 50447  				crt.X__builtin_abort(tls)
 50448  			}
 50449  		}()
 50450  		_sqlite3VdbeMemIntegerify(tls, _pIn2)
 50451  		_282_p2 = int32(*(*int64)(unsafe.Pointer(&_pIn2.Xu)))
 50452  		func() {
 50453  			if _282_p2 < int32(2) {
 50454  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81792), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65780)))
 50455  				crt.X__builtin_abort(tls)
 50456  			}
 50457  		}()
 50458  	}
 50459  	if int32(_pOp.Xp4type) == int32(-5) {
 50460  		_282_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 50461  		func() {
 50462  			if int32(_282_pKeyInfo.Xenc) != int32(_db.Xenc) {
 50463  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81796), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65786)))
 50464  				crt.X__builtin_abort(tls)
 50465  			}
 50466  		}()
 50467  		func() {
 50468  			if (*Xsqlite3)(_282_pKeyInfo.Xdb) != _db {
 50469  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81797), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65809)))
 50470  				crt.X__builtin_abort(tls)
 50471  			}
 50472  		}()
 50473  		_282_nField = int32(_282_pKeyInfo.XnField) + int32(_282_pKeyInfo.XnXField)
 50474  		goto _1056
 50475  	}
 50476  	if int32(_pOp.Xp4type) == int32(-11) {
 50477  		_282_nField = *(*int32)(unsafe.Pointer(&_pOp.Xp4))
 50478  	}
 50479  _1056:
 50480  	func() {
 50481  		if _pOp.Xp1 < int32(0) {
 50482  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81802), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65826)))
 50483  			crt.X__builtin_abort(tls)
 50484  		}
 50485  	}()
 50486  	func() {
 50487  		if _282_nField < int32(0) {
 50488  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81803), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65837)))
 50489  			crt.X__builtin_abort(tls)
 50490  		}
 50491  	}()
 50492  	_282_pCur = _allocateCursor(tls, _p, _pOp.Xp1, _282_nField, _282_iDb, 0)
 50493  	if _282_pCur == nil {
 50494  		goto _no_mem
 50495  	}
 50496  	_282_pCur.XnullRow = uint8(1)
 50497  	storebits5(&_282_pCur.XisEphemeral, int8(1), 4, 2)
 50498  	_282_pCur.XpgnoRoot = uint32(_282_p2)
 50499  	_282_pCur.XwrFlag = uint8(_282_wrFlag)
 50500  	_rc = _sqlite3BtreeCursor(tls, _282_pX, _282_p2, _282_wrFlag, _282_pKeyInfo, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_282_pCur.Xuc))))
 50501  	*(**XKeyInfo)(unsafe.Pointer(&_282_pCur.XpKeyInfo)) = _282_pKeyInfo
 50502  	_282_pCur.XisTable = uint8(bool2int(int32(_pOp.Xp4type) != int32(-5)))
 50503  _open_cursor_set_hints:
 50504  
 50505  	_sqlite3BtreeCursorHintFlags(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_282_pCur.Xuc))), uint32(int32(_pOp.Xp5)&int32(3)))
 50506  	if _rc != 0 {
 50507  		goto _abort_due_to_error
 50508  	}
 50509  	goto _250
 50510  _152:
 50511  	_291_pOrig = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp2))
 50512  	func() {
 50513  		if (*XBtree)(_291_pOrig.XpBtx) == nil {
 50514  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81847), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65847)))
 50515  			crt.X__builtin_abort(tls)
 50516  		}
 50517  	}()
 50518  	_291_pCx = _allocateCursor(tls, _p, _pOp.Xp1, int32(_291_pOrig.XnField), int32(-1), 0)
 50519  	if _291_pCx == nil {
 50520  		goto _no_mem
 50521  	}
 50522  	_291_pCx.XnullRow = uint8(1)
 50523  	storebits5(&_291_pCx.XisEphemeral, int8(1), 1, 0)
 50524  	*(**XKeyInfo)(unsafe.Pointer(&_291_pCx.XpKeyInfo)) = (*XKeyInfo)(_291_pOrig.XpKeyInfo)
 50525  	_291_pCx.XisTable = _291_pOrig.XisTable
 50526  	_rc = _sqlite3BtreeCursor(tls, (*XBtree)(_291_pOrig.XpBtx), int32(1), int32(4), (*XKeyInfo)(_291_pCx.XpKeyInfo), (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_291_pCx.Xuc))))
 50527  	func() {
 50528  		if _rc != int32(0) {
 50529  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81860), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 50530  			crt.X__builtin_abort(tls)
 50531  		}
 50532  	}()
 50533  	goto _250
 50534  _153:
 50535  	func() {
 50536  		if _pOp.Xp1 < int32(0) {
 50537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81902), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65826)))
 50538  			crt.X__builtin_abort(tls)
 50539  		}
 50540  	}()
 50541  	func() {
 50542  		if _pOp.Xp2 < int32(0) {
 50543  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81903), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65862)))
 50544  			crt.X__builtin_abort(tls)
 50545  		}
 50546  	}()
 50547  	_292_pCx = _allocateCursor(tls, _p, _pOp.Xp1, _pOp.Xp2, int32(-1), 0)
 50548  	if _292_pCx == nil {
 50549  		goto _no_mem
 50550  	}
 50551  	_292_pCx.XnullRow = uint8(1)
 50552  	storebits5(&_292_pCx.XisEphemeral, int8(1), 1, 0)
 50553  	_rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.XpVfs), nil, _db, (**XBtree)(unsafe.Pointer(&_292_pCx.XpBtx)), int32(5)|int32(_pOp.Xp5), _sqlite3VdbeExecØ00vfsFlagsØ006)
 50554  	if _rc == int32(0) {
 50555  		_rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_292_pCx.XpBtx), int32(1))
 50556  	}
 50557  	if _rc != int32(0) {
 50558  		goto _1074
 50559  	}
 50560  	if store67((**XKeyInfo)(unsafe.Pointer(&_292_pCx.XpKeyInfo)), store67(&_292_pKeyInfo, (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))))) == nil {
 50561  		goto _1075
 50562  	}
 50563  	func() {
 50564  		if int32(_pOp.Xp4type) != int32(-5) {
 50565  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81921), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65515)))
 50566  			crt.X__builtin_abort(tls)
 50567  		}
 50568  	}()
 50569  	_rc = _sqlite3BtreeCreateTable(tls, (*XBtree)(_292_pCx.XpBtx), &_295_pgno, int32(2)|int32(_pOp.Xp5))
 50570  	if _rc == int32(0) {
 50571  		func() {
 50572  			if _295_pgno != int32(2) {
 50573  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81924), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65873)))
 50574  				crt.X__builtin_abort(tls)
 50575  			}
 50576  		}()
 50577  		func() {
 50578  			if (*Xsqlite3)(_292_pKeyInfo.Xdb) != _db {
 50579  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81925), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65809)))
 50580  				crt.X__builtin_abort(tls)
 50581  			}
 50582  		}()
 50583  		func() {
 50584  			if int32(_292_pKeyInfo.Xenc) != int32(_db.Xenc) {
 50585  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81926), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65786)))
 50586  				crt.X__builtin_abort(tls)
 50587  			}
 50588  		}()
 50589  		_rc = _sqlite3BtreeCursor(tls, (*XBtree)(_292_pCx.XpBtx), _295_pgno, int32(4), _292_pKeyInfo, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_292_pCx.Xuc))))
 50590  	}
 50591  	_292_pCx.XisTable = 0
 50592  	goto _1085
 50593  _1075:
 50594  	_rc = _sqlite3BtreeCursor(tls, (*XBtree)(_292_pCx.XpBtx), int32(1), int32(4), nil, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_292_pCx.Xuc))))
 50595  	_292_pCx.XisTable = uint8(1)
 50596  _1085:
 50597  _1074:
 50598  	if _rc != 0 {
 50599  		goto _abort_due_to_error
 50600  	}
 50601  	storebits5(&_292_pCx.XisEphemeral, int8(bool2int(int32(_pOp.Xp5) != int32(8))), 4, 2)
 50602  	goto _250
 50603  _155:
 50604  	func() {
 50605  		if _pOp.Xp1 < int32(0) {
 50606  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81955), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65826)))
 50607  			crt.X__builtin_abort(tls)
 50608  		}
 50609  	}()
 50610  	func() {
 50611  		if _pOp.Xp2 < int32(0) {
 50612  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81956), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65862)))
 50613  			crt.X__builtin_abort(tls)
 50614  		}
 50615  	}()
 50616  	_298_pCx = _allocateCursor(tls, _p, _pOp.Xp1, _pOp.Xp2, int32(-1), uint8(1))
 50617  	if _298_pCx == nil {
 50618  		goto _no_mem
 50619  	}
 50620  	*(**XKeyInfo)(unsafe.Pointer(&_298_pCx.XpKeyInfo)) = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 50621  	func() {
 50622  		if (*Xsqlite3)((*XKeyInfo)(_298_pCx.XpKeyInfo).Xdb) != _db {
 50623  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81960), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65893)))
 50624  			crt.X__builtin_abort(tls)
 50625  		}
 50626  	}()
 50627  	func() {
 50628  		if int32((*XKeyInfo)(_298_pCx.XpKeyInfo).Xenc) != int32(_db.Xenc) {
 50629  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81961), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65915)))
 50630  			crt.X__builtin_abort(tls)
 50631  		}
 50632  	}()
 50633  	_rc = _sqlite3VdbeSorterInit(tls, _db, _pOp.Xp3, _298_pCx)
 50634  	if _rc != 0 {
 50635  		goto _abort_due_to_error
 50636  	}
 50637  	goto _250
 50638  _156:
 50639  	func() {
 50640  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 50641  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81976), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 50642  			crt.X__builtin_abort(tls)
 50643  		}
 50644  	}()
 50645  	_299_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 50646  	func() {
 50647  		if int32(_299_pC.XeCurType) != int32(1) {
 50648  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81978), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65943)))
 50649  			crt.X__builtin_abort(tls)
 50650  		}
 50651  	}()
 50652  	if postInc37(&_299_pC.XseqCount, 1) == (0) {
 50653  		goto _jump_to_p2
 50654  	}
 50655  	goto _250
 50656  _157:
 50657  	func() {
 50658  		if _pOp.Xp1 < int32(0) {
 50659  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82004), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65826)))
 50660  			crt.X__builtin_abort(tls)
 50661  		}
 50662  	}()
 50663  	func() {
 50664  		if _pOp.Xp3 < int32(0) {
 50665  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82005), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65956)))
 50666  			crt.X__builtin_abort(tls)
 50667  		}
 50668  	}()
 50669  	_301_pCx = _allocateCursor(tls, _p, _pOp.Xp1, _pOp.Xp3, int32(-1), uint8(3))
 50670  	if _301_pCx == nil {
 50671  		goto _no_mem
 50672  	}
 50673  	_301_pCx.XnullRow = uint8(1)
 50674  	*(*int32)(unsafe.Pointer(&_301_pCx.Xuc)) = _pOp.Xp2
 50675  	_301_pCx.XisTable = uint8(1)
 50676  	func() {
 50677  		if int32(_pOp.Xp5) != int32(0) {
 50678  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82011), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65967)))
 50679  			crt.X__builtin_abort(tls)
 50680  		}
 50681  	}()
 50682  	goto _250
 50683  _158:
 50684  	func() {
 50685  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 50686  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82021), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 50687  			crt.X__builtin_abort(tls)
 50688  		}
 50689  	}()
 50690  	_sqlite3VdbeFreeCursor(tls, _p, *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1)))
 50691  	*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1)) = nil
 50692  	goto _250
 50693  _159:
 50694  	func() {
 50695  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 50696  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82145), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 50697  			crt.X__builtin_abort(tls)
 50698  		}
 50699  	}()
 50700  	func() {
 50701  		if _pOp.Xp2 == int32(0) {
 50702  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82146), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65978)))
 50703  			crt.X__builtin_abort(tls)
 50704  		}
 50705  	}()
 50706  	_303_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 50707  	func() {
 50708  		if _303_pC == nil {
 50709  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82148), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 50710  			crt.X__builtin_abort(tls)
 50711  		}
 50712  	}()
 50713  	func() {
 50714  		if int32(_303_pC.XeCurType) != int32(0) {
 50715  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82149), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 50716  			crt.X__builtin_abort(tls)
 50717  		}
 50718  	}()
 50719  
 50720  	func() {
 50721  		if ((uint32(_303_pC.XisEphemeral>>2) << 31) >> 31) == 0 {
 50722  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82153), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65989)))
 50723  			crt.X__builtin_abort(tls)
 50724  		}
 50725  	}()
 50726  	func() {
 50727  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))) == nil {
 50728  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82154), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 50729  			crt.X__builtin_abort(tls)
 50730  		}
 50731  	}()
 50732  	_303_oc = int32(_pOp.Xopcode)
 50733  	_303_eqOnly = int32(0)
 50734  	_303_pC.XnullRow = 0
 50735  	_303_pC.XseekOp = _pOp.Xopcode
 50736  	if _303_pC.XisTable == 0 {
 50737  		goto _1126
 50738  	}
 50739  	func() {
 50740  		if _sqlite3BtreeCursorHasHint(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), uint32(2)) != int32(0) && _sqlite3Config.XneverCorrupt != int32(0) {
 50741  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82164), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66021)))
 50742  			crt.X__builtin_abort(tls)
 50743  		}
 50744  	}()
 50745  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 50746  	if (int32(_pIn3.Xflags) & int32(14)) == int32(2) {
 50747  		_applyNumericAffinity(tls, _pIn3, int32(0))
 50748  	}
 50749  	_303_iKey = _sqlite3VdbeIntValue(tls, _pIn3)
 50750  	if (int32(_pIn3.Xflags) & int32(4)) != int32(0) {
 50751  		goto _1131
 50752  	}
 50753  	if (int32(_pIn3.Xflags) & int32(8)) == int32(0) {
 50754  		goto _jump_to_p2
 50755  	}
 50756  	if (*(*float64)(unsafe.Pointer(&_pIn3.Xu))) >= float64(_303_iKey) {
 50757  		goto _1133
 50758  	}
 50759  
 50760  	if (_303_oc & int32(1)) == int32(1) {
 50761  		_303_oc -= 1
 50762  	}
 50763  	goto _1136
 50764  _1133:
 50765  	if (*(*float64)(unsafe.Pointer(&_pIn3.Xu))) <= float64(_303_iKey) {
 50766  		goto _1136
 50767  	}
 50768  
 50769  	if (_303_oc & int32(1)) == int32(0) {
 50770  		_303_oc += 1
 50771  	}
 50772  _1136:
 50773  _1131:
 50774  	_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), nil, int64(uint64(_303_iKey)), int32(0), &_303_res)
 50775  	_303_pC.XmovetoTarget = _303_iKey
 50776  	if _rc != int32(0) {
 50777  		goto _abort_due_to_error
 50778  	}
 50779  	goto _1139
 50780  _1126:
 50781  	if _sqlite3BtreeCursorHasHint(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), uint32(2)) != 0 {
 50782  		_303_eqOnly = int32(1)
 50783  		func() {
 50784  			if int32(_pOp.Xopcode) != int32(26) && int32(_pOp.Xopcode) != int32(25) {
 50785  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82221), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66095)))
 50786  				crt.X__builtin_abort(tls)
 50787  			}
 50788  		}()
 50789  		func() {
 50790  			if int32(elem63(_pOp, uintptr(1)).Xopcode) != int32(40) && int32(elem63(_pOp, uintptr(1)).Xopcode) != int32(39) {
 50791  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82222), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66144)))
 50792  				crt.X__builtin_abort(tls)
 50793  			}
 50794  		}()
 50795  		func() {
 50796  			if (elem63(_pOp, uintptr(1)).Xp1) != (elem63(_pOp, 0).Xp1) {
 50797  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82223), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66195)))
 50798  				crt.X__builtin_abort(tls)
 50799  			}
 50800  		}()
 50801  		func() {
 50802  			if (elem63(_pOp, uintptr(1)).Xp2) != (elem63(_pOp, 0).Xp2) {
 50803  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82224), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66216)))
 50804  				crt.X__builtin_abort(tls)
 50805  			}
 50806  		}()
 50807  		func() {
 50808  			if (elem63(_pOp, uintptr(1)).Xp3) != (elem63(_pOp, 0).Xp3) {
 50809  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82225), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66237)))
 50810  				crt.X__builtin_abort(tls)
 50811  			}
 50812  		}()
 50813  		func() {
 50814  			if (*(*int32)(unsafe.Pointer(&(elem63(_pOp, uintptr(1)).Xp4)))) != (*(*int32)(unsafe.Pointer(&(elem63(_pOp, 0).Xp4)))) {
 50815  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82226), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66258)))
 50816  				crt.X__builtin_abort(tls)
 50817  			}
 50818  		}()
 50819  	}
 50820  	_303_nField = *(*int32)(unsafe.Pointer(&_pOp.Xp4))
 50821  	func() {
 50822  		if int32(_pOp.Xp4type) != int32(-11) {
 50823  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82230), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66283)))
 50824  			crt.X__builtin_abort(tls)
 50825  		}
 50826  	}()
 50827  	func() {
 50828  		if _303_nField <= int32(0) {
 50829  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82231), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66305)))
 50830  			crt.X__builtin_abort(tls)
 50831  		}
 50832  	}()
 50833  	*(**XKeyInfo)(unsafe.Pointer(&_303_r.XpKeyInfo)) = (*XKeyInfo)(_303_pC.XpKeyInfo)
 50834  	_303_r.XnField = uint16(_303_nField)
 50835  	_303_r.Xdefault_rc = int8(func() int32 {
 50836  		if (int32(1) & (_303_oc - int32(24))) != 0 {
 50837  			return int32(-1)
 50838  		}
 50839  		return int32(1)
 50840  	}())
 50841  	func() {
 50842  		if _303_oc == int32(27) && int32(_303_r.Xdefault_rc) != int32(-1) {
 50843  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82243), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66314)))
 50844  			crt.X__builtin_abort(tls)
 50845  		}
 50846  	}()
 50847  	func() {
 50848  		if _303_oc == int32(25) && int32(_303_r.Xdefault_rc) != int32(-1) {
 50849  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82244), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66348)))
 50850  			crt.X__builtin_abort(tls)
 50851  		}
 50852  	}()
 50853  	func() {
 50854  		if _303_oc == int32(26) && int32(_303_r.Xdefault_rc) != int32(1) {
 50855  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82245), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66382)))
 50856  			crt.X__builtin_abort(tls)
 50857  		}
 50858  	}()
 50859  	func() {
 50860  		if _303_oc == int32(24) && int32(_303_r.Xdefault_rc) != int32(1) {
 50861  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82246), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66416)))
 50862  			crt.X__builtin_abort(tls)
 50863  		}
 50864  	}()
 50865  	*(**XMem)(unsafe.Pointer(&_303_r.XaMem)) = elem25(_aMem, uintptr(_pOp.Xp3))
 50866  	_313_i = int32(0)
 50867  _1173:
 50868  	if _313_i >= int32(_303_r.XnField) {
 50869  		goto _1176
 50870  	}
 50871  	func() {
 50872  		if (int32(elem25((*XMem)(_303_r.XaMem), uintptr(_313_i)).Xflags) & int32(128)) != int32(0) {
 50873  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82250), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66450)))
 50874  			crt.X__builtin_abort(tls)
 50875  		}
 50876  	}()
 50877  	_313_i += 1
 50878  	goto _1173
 50879  _1176:
 50880  	_303_r.XeqSeen = 0
 50881  	_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), &_303_r, 0, int32(0), &_303_res)
 50882  	if _rc != int32(0) {
 50883  		goto _abort_due_to_error
 50884  	}
 50885  	if _303_eqOnly != 0 && (int32(_303_r.XeqSeen) == int32(0)) {
 50886  		func() {
 50887  			if _303_res == int32(0) {
 50888  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82258), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66473)))
 50889  				crt.X__builtin_abort(tls)
 50890  			}
 50891  		}()
 50892  		goto _seek_not_found
 50893  	}
 50894  _1139:
 50895  	_303_pC.XdeferredMoveto = 0
 50896  	_303_pC.XcacheStatus = 0
 50897  	if _303_oc < int32(26) {
 50898  		goto _1184
 50899  	}
 50900  	func() {
 50901  		if _303_oc != int32(26) && _303_oc != int32(27) {
 50902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82267), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66480)))
 50903  			crt.X__builtin_abort(tls)
 50904  		}
 50905  	}()
 50906  	if _303_res >= int32(0) && (_303_res != int32(0) || _303_oc != int32(27)) {
 50907  		goto _1190
 50908  	}
 50909  	_303_res = int32(0)
 50910  	_rc = _sqlite3BtreeNext(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), &_303_res)
 50911  	if _rc != int32(0) {
 50912  		goto _abort_due_to_error
 50913  	}
 50914  	goto _1192
 50915  _1190:
 50916  	_303_res = int32(0)
 50917  _1192:
 50918  	goto _seek_not_found
 50919  _1184:
 50920  	func() {
 50921  		if _303_oc != int32(24) && _303_oc != int32(25) {
 50922  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82276), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66511)))
 50923  			crt.X__builtin_abort(tls)
 50924  		}
 50925  	}()
 50926  	if _303_res <= int32(0) && (_303_res != int32(0) || _303_oc != int32(24)) {
 50927  		goto _1199
 50928  	}
 50929  	_303_res = int32(0)
 50930  	_rc = _sqlite3BtreePrevious(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), &_303_res)
 50931  	if _rc != int32(0) {
 50932  		goto _abort_due_to_error
 50933  	}
 50934  	goto _1201
 50935  _1199:
 50936  	_303_res = _sqlite3BtreeEof(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))))
 50937  _1201:
 50938  _seek_not_found:
 50939  	func() {
 50940  		if _pOp.Xp2 <= int32(0) {
 50941  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82289), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61037)))
 50942  			crt.X__builtin_abort(tls)
 50943  		}
 50944  	}()
 50945  	if _303_res != 0 {
 50946  		goto _jump_to_p2
 50947  	}
 50948  	if _303_eqOnly != 0 {
 50949  		func() {
 50950  			if int32(elem63(_pOp, uintptr(1)).Xopcode) != int32(40) && int32(elem63(_pOp, uintptr(1)).Xopcode) != int32(39) {
 50951  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82294), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66144)))
 50952  				crt.X__builtin_abort(tls)
 50953  			}
 50954  		}()
 50955  		*(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(32)
 50956  	}
 50957  	goto _250
 50958  _163:
 50959  	func() {
 50960  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 50961  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82375), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 50962  			crt.X__builtin_abort(tls)
 50963  		}
 50964  	}()
 50965  	func() {
 50966  		if int32(_pOp.Xp4type) != int32(-11) {
 50967  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82376), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66283)))
 50968  			crt.X__builtin_abort(tls)
 50969  		}
 50970  	}()
 50971  	_324_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 50972  	func() {
 50973  		if _324_pC == nil {
 50974  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82378), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 50975  			crt.X__builtin_abort(tls)
 50976  		}
 50977  	}()
 50978  	_324_pC.XseekOp = _pOp.Xopcode
 50979  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 50980  	func() {
 50981  		if int32(_324_pC.XeCurType) != int32(0) {
 50982  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82383), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 50983  			crt.X__builtin_abort(tls)
 50984  		}
 50985  	}()
 50986  	func() {
 50987  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_324_pC.Xuc))) == nil {
 50988  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82384), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 50989  			crt.X__builtin_abort(tls)
 50990  		}
 50991  	}()
 50992  	func() {
 50993  		if int32(_324_pC.XisTable) != int32(0) {
 50994  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82385), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66542)))
 50995  			crt.X__builtin_abort(tls)
 50996  		}
 50997  	}()
 50998  	if (*(*int32)(unsafe.Pointer(&_pOp.Xp4))) <= int32(0) {
 50999  		goto _1223
 51000  	}
 51001  	*(**XKeyInfo)(unsafe.Pointer(&_324_r.XpKeyInfo)) = (*XKeyInfo)(_324_pC.XpKeyInfo)
 51002  	_324_r.XnField = uint16(*(*int32)(unsafe.Pointer(&_pOp.Xp4)))
 51003  	*(**XMem)(unsafe.Pointer(&_324_r.XaMem)) = _pIn3
 51004  	_324_ii = int32(0)
 51005  _1224:
 51006  	if _324_ii >= int32(_324_r.XnField) {
 51007  		goto _1227
 51008  	}
 51009  	func() {
 51010  		if (int32(elem25((*XMem)(_324_r.XaMem), uintptr(_324_ii)).Xflags) & int32(128)) != int32(0) {
 51011  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82392), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66557)))
 51012  			crt.X__builtin_abort(tls)
 51013  		}
 51014  	}()
 51015  	func() {
 51016  		if (int32(elem25((*XMem)(_324_r.XaMem), uintptr(_324_ii)).Xflags)&int32(16384)) != int32(0) && (elem25((*XMem)(_324_r.XaMem), uintptr(_324_ii)).Xn) != int32(0) {
 51017  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82393), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66581)))
 51018  			crt.X__builtin_abort(tls)
 51019  		}
 51020  	}()
 51021  	if _324_ii == 0 {
 51022  		goto _1234
 51023  	}
 51024  	if (_db.Xflags & int32(1)) != 0 {
 51025  		_registerTrace(tls, _pOp.Xp3+_324_ii, elem25((*XMem)(_324_r.XaMem), uintptr(_324_ii)))
 51026  	}
 51027  _1234:
 51028  	_324_ii += 1
 51029  	goto _1224
 51030  _1227:
 51031  	_324_pIdxKey = &_324_r
 51032  	_324_pFree = nil
 51033  	goto _1235
 51034  _1223:
 51035  	func() {
 51036  		if (int32(_pIn3.Xflags) & int32(16)) == 0 {
 51037  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82400), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66633)))
 51038  			crt.X__builtin_abort(tls)
 51039  		}
 51040  	}()
 51041  	_rc = func() int32 {
 51042  		if (int32(_pIn3.Xflags) & int32(16384)) != 0 {
 51043  			return _sqlite3VdbeMemExpandBlob(tls, _pIn3)
 51044  		}
 51045  		return int32(0)
 51046  	}()
 51047  	func() {
 51048  		if _rc != int32(0) && _rc != int32(7) {
 51049  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82402), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(5706)))
 51050  			crt.X__builtin_abort(tls)
 51051  		}
 51052  	}()
 51053  	if _rc != 0 {
 51054  		goto _no_mem
 51055  	}
 51056  	_324_pFree = store85(&_324_pIdxKey, _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)(_324_pC.XpKeyInfo)))
 51057  	if _324_pIdxKey == nil {
 51058  		goto _no_mem
 51059  	}
 51060  	_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)(_324_pC.XpKeyInfo), _pIn3.Xn, unsafe.Pointer(_pIn3.Xz), _324_pIdxKey)
 51061  _1235:
 51062  	_324_pIdxKey.Xdefault_rc = 0
 51063  	_324_takeJump = int32(0)
 51064  	if int32(_pOp.Xopcode) != int32(28) {
 51065  		goto _1245
 51066  	}
 51067  	_324_ii = int32(0)
 51068  _1246:
 51069  	if _324_ii >= int32(_324_pIdxKey.XnField) {
 51070  		goto _1249
 51071  	}
 51072  	if (int32(elem25((*XMem)(_324_pIdxKey.XaMem), uintptr(_324_ii)).Xflags) & int32(1)) != 0 {
 51073  		_324_takeJump = int32(1)
 51074  		goto _1249
 51075  	}
 51076  	_324_ii += 1
 51077  	goto _1246
 51078  _1249:
 51079  _1245:
 51080  	_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_324_pC.Xuc))), _324_pIdxKey, 0, int32(0), &_324_res)
 51081  	if _324_pFree != nil {
 51082  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_324_pFree))
 51083  	}
 51084  	if _rc != int32(0) {
 51085  		goto _abort_due_to_error
 51086  	}
 51087  	_324_pC.XseekResult = _324_res
 51088  	_324_alreadyExists = bool2int(_324_res == int32(0))
 51089  	_324_pC.XnullRow = uint8(int32(1) - _324_alreadyExists)
 51090  	_324_pC.XdeferredMoveto = 0
 51091  	_324_pC.XcacheStatus = 0
 51092  	if int32(_pOp.Xopcode) != int32(30) {
 51093  		goto _1253
 51094  	}
 51095  	if _324_alreadyExists != 0 {
 51096  		goto _jump_to_p2
 51097  	}
 51098  	goto _1255
 51099  _1253:
 51100  	if _324_takeJump != 0 || (_324_alreadyExists == 0) {
 51101  		goto _jump_to_p2
 51102  	}
 51103  _1255:
 51104  	goto _250
 51105  _166:
 51106  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 51107  	if (int32(_pIn3.Xflags) & int32(4)) != int32(0) {
 51108  		goto _1258
 51109  	}
 51110  	_applyAffinity(tls, _pIn3, int8(67), _encoding)
 51111  	if (int32(_pIn3.Xflags) & int32(4)) == int32(0) {
 51112  		goto _jump_to_p2
 51113  	}
 51114  _1258:
 51115  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 51116  	func() {
 51117  		if (int32(_pIn3.Xflags) & int32(4)) == 0 {
 51118  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82502), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61948)))
 51119  			crt.X__builtin_abort(tls)
 51120  		}
 51121  	}()
 51122  	func() {
 51123  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51124  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82503), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51125  			crt.X__builtin_abort(tls)
 51126  		}
 51127  	}()
 51128  	_334_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51129  	func() {
 51130  		if _334_pC == nil {
 51131  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82505), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51132  			crt.X__builtin_abort(tls)
 51133  		}
 51134  	}()
 51135  	_334_pC.XseekOp = 0
 51136  	func() {
 51137  		if _334_pC.XisTable == 0 {
 51138  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82509), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66656)))
 51139  			crt.X__builtin_abort(tls)
 51140  		}
 51141  	}()
 51142  	func() {
 51143  		if int32(_334_pC.XeCurType) != int32(0) {
 51144  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82510), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51145  			crt.X__builtin_abort(tls)
 51146  		}
 51147  	}()
 51148  	_334_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_334_pC.Xuc)))
 51149  	func() {
 51150  		if _334_pCrsr == nil {
 51151  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82512), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66668)))
 51152  			crt.X__builtin_abort(tls)
 51153  		}
 51154  	}()
 51155  	_334_res = int32(0)
 51156  	_334_iKey = uint64(*(*int64)(unsafe.Pointer(&_pIn3.Xu)))
 51157  	_rc = _sqlite3BtreeMovetoUnpacked(tls, _334_pCrsr, nil, int64(_334_iKey), int32(0), &_334_res)
 51158  	func() {
 51159  		if _rc != int32(0) && _334_res != int32(0) {
 51160  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82516), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66677)))
 51161  			crt.X__builtin_abort(tls)
 51162  		}
 51163  	}()
 51164  	_334_pC.XmovetoTarget = int64(_334_iKey)
 51165  	_334_pC.XnullRow = 0
 51166  	_334_pC.XcacheStatus = 0
 51167  	_334_pC.XdeferredMoveto = 0
 51168  	_334_pC.XseekResult = _334_res
 51169  	if _334_res == int32(0) {
 51170  		goto _1276
 51171  	}
 51172  	func() {
 51173  		if _rc != int32(0) {
 51174  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82524), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 51175  			crt.X__builtin_abort(tls)
 51176  		}
 51177  	}()
 51178  	if _pOp.Xp2 == int32(0) {
 51179  		_rc = _sqlite3CorruptError(tls, int32(82526))
 51180  		goto _1280
 51181  	}
 51182  	goto _jump_to_p2
 51183  _1280:
 51184  _1276:
 51185  	if _rc != 0 {
 51186  		goto _abort_due_to_error
 51187  	}
 51188  	goto _250
 51189  _168:
 51190  	func() {
 51191  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51192  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82544), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51193  			crt.X__builtin_abort(tls)
 51194  		}
 51195  	}()
 51196  	func() {
 51197  		if (*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))) == nil {
 51198  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82545), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63716)))
 51199  			crt.X__builtin_abort(tls)
 51200  		}
 51201  	}()
 51202  	func() {
 51203  		if int32((*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))).XeCurType) == int32(2) {
 51204  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82546), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66701)))
 51205  			crt.X__builtin_abort(tls)
 51206  		}
 51207  	}()
 51208  	_pOut = _out2Prerelease(tls, _p, _pOp)
 51209  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = postInc37(&((*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))).XseqCount), 1)
 51210  	goto _250
 51211  _169:
 51212  	_340_v = 0
 51213  	_340_res = int32(0)
 51214  	_pOut = _out2Prerelease(tls, _p, _pOp)
 51215  	func() {
 51216  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51217  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82579), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51218  			crt.X__builtin_abort(tls)
 51219  		}
 51220  	}()
 51221  	_340_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51222  	func() {
 51223  		if _340_pC == nil {
 51224  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82581), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51225  			crt.X__builtin_abort(tls)
 51226  		}
 51227  	}()
 51228  	func() {
 51229  		if int32(_340_pC.XeCurType) != int32(0) {
 51230  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82582), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51231  			crt.X__builtin_abort(tls)
 51232  		}
 51233  	}()
 51234  	func() {
 51235  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_340_pC.Xuc))) == nil {
 51236  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82583), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51237  			crt.X__builtin_abort(tls)
 51238  		}
 51239  	}()
 51240  	func() {
 51241  		if _340_pC.XisTable == 0 {
 51242  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82598), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66656)))
 51243  			crt.X__builtin_abort(tls)
 51244  		}
 51245  	}()
 51246  	if ((uint32(_340_pC.XisEphemeral>>1) << 31) >> 31) != 0 {
 51247  		goto _1300
 51248  	}
 51249  	_rc = _sqlite3BtreeLast(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_340_pC.Xuc))), &_340_res)
 51250  	if _rc != int32(0) {
 51251  		goto _abort_due_to_error
 51252  	}
 51253  	if _340_res != 0 {
 51254  		_340_v = int64(1)
 51255  		goto _1303
 51256  	}
 51257  	func() {
 51258  		if _sqlite3BtreeCursorIsValid(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_340_pC.Xuc)))) == 0 {
 51259  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82618), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66743)))
 51260  			crt.X__builtin_abort(tls)
 51261  		}
 51262  	}()
 51263  	_340_v = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_340_pC.Xuc))))
 51264  	if _340_v >= int64(9223372036854775807) {
 51265  		storebits5(&_340_pC.XisEphemeral, int8(1), 2, 1)
 51266  		goto _1307
 51267  	}
 51268  	_340_v += 1
 51269  _1307:
 51270  _1303:
 51271  _1300:
 51272  	if _pOp.Xp3 == 0 {
 51273  		goto _1308
 51274  	}
 51275  	func() {
 51276  		if _pOp.Xp3 <= int32(0) {
 51277  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82631), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61154)))
 51278  			crt.X__builtin_abort(tls)
 51279  		}
 51280  	}()
 51281  	if _p.XpFrame == nil {
 51282  		goto _1311
 51283  	}
 51284  	_340_pFrame = (*XVdbeFrame)(_p.XpFrame)
 51285  _1312:
 51286  	if _340_pFrame.XpParent == nil {
 51287  		goto _1315
 51288  	}
 51289  	_340_pFrame = (*XVdbeFrame)(_340_pFrame.XpParent)
 51290  	goto _1312
 51291  _1315:
 51292  	func() {
 51293  		if _pOp.Xp3 > _340_pFrame.XnMem {
 51294  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82635), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66785)))
 51295  			crt.X__builtin_abort(tls)
 51296  		}
 51297  	}()
 51298  	_340_pMem = elem25((*XMem)(_340_pFrame.XaMem), uintptr(_pOp.Xp3))
 51299  	goto _1318
 51300  _1311:
 51301  	func() {
 51302  		if _pOp.Xp3 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 51303  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82639), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61164)))
 51304  			crt.X__builtin_abort(tls)
 51305  		}
 51306  	}()
 51307  	_340_pMem = elem25(_aMem, uintptr(_pOp.Xp3))
 51308  	_sqlite3VdbeMemAboutToChange(tls, _p, _340_pMem)
 51309  _1318:
 51310  	func() {
 51311  		if (int32(_340_pMem.Xflags) & int32(128)) != int32(0) {
 51312  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82643), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66807)))
 51313  			crt.X__builtin_abort(tls)
 51314  		}
 51315  	}()
 51316  	if (_db.Xflags & int32(1)) != 0 {
 51317  		_registerTrace(tls, _pOp.Xp3, _340_pMem)
 51318  	}
 51319  	_sqlite3VdbeMemIntegerify(tls, _340_pMem)
 51320  	func() {
 51321  		if (int32(_340_pMem.Xflags) & int32(4)) == int32(0) {
 51322  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82647), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66824)))
 51323  			crt.X__builtin_abort(tls)
 51324  		}
 51325  	}()
 51326  	if ((*(*int64)(unsafe.Pointer(&_340_pMem.Xu))) == int64(9223372036854775807)) || (((uint32(_340_pC.XisEphemeral>>1) << 31) >> 31) != 0) {
 51327  		_rc = int32(13)
 51328  		goto _abort_due_to_error
 51329  	}
 51330  	if _340_v < ((*(*int64)(unsafe.Pointer(&_340_pMem.Xu))) + int64(1)) {
 51331  		_340_v = (*(*int64)(unsafe.Pointer(&_340_pMem.Xu))) + int64(1)
 51332  	}
 51333  	*(*int64)(unsafe.Pointer(&_340_pMem.Xu)) = _340_v
 51334  _1308:
 51335  	if ((uint32(_340_pC.XisEphemeral>>1) << 31) >> 31) == 0 {
 51336  		goto _1329
 51337  	}
 51338  	func() {
 51339  		if _pOp.Xp3 != int32(0) {
 51340  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82663), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66851)))
 51341  			crt.X__builtin_abort(tls)
 51342  		}
 51343  	}()
 51344  	_340_cnt = int32(0)
 51345  _1332:
 51346  	Xsqlite3_randomness(tls, int32(8), unsafe.Pointer(&_340_v))
 51347  	_340_v &= int64(4611686018427387903)
 51348  	_340_v += 1
 51349  	if ((store2(&_rc, _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_340_pC.Xuc))), nil, int64(uint64(_340_v)), int32(0), &_340_res)) == int32(0)) && (_340_res == int32(0))) && (preInc2(&_340_cnt, 1) < int32(100)) {
 51350  		goto _1332
 51351  	}
 51352  	if _rc != 0 {
 51353  		goto _abort_due_to_error
 51354  	}
 51355  	if _340_res == int32(0) {
 51356  		_rc = int32(13)
 51357  		goto _abort_due_to_error
 51358  	}
 51359  	func() {
 51360  		if _340_v <= (0) {
 51361  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82678), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66862)))
 51362  			crt.X__builtin_abort(tls)
 51363  		}
 51364  	}()
 51365  _1329:
 51366  	_340_pC.XdeferredMoveto = 0
 51367  	_340_pC.XcacheStatus = 0
 51368  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _340_v
 51369  	goto _250
 51370  _170:
 51371  	_356_op = int32(0)
 51372  	_356_pData = elem25(_aMem, uintptr(_pOp.Xp2))
 51373  	func() {
 51374  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51375  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82743), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51376  			crt.X__builtin_abort(tls)
 51377  		}
 51378  	}()
 51379  	func() {
 51380  		if (int32(_356_pData.Xflags) & int32(128)) != int32(0) {
 51381  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82744), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66866)))
 51382  			crt.X__builtin_abort(tls)
 51383  		}
 51384  	}()
 51385  	_356_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51386  	func() {
 51387  		if _356_pC == nil {
 51388  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82746), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51389  			crt.X__builtin_abort(tls)
 51390  		}
 51391  	}()
 51392  	func() {
 51393  		if int32(_356_pC.XeCurType) != int32(0) {
 51394  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82747), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51395  			crt.X__builtin_abort(tls)
 51396  		}
 51397  	}()
 51398  	func() {
 51399  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_356_pC.Xuc))) == nil {
 51400  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82748), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51401  			crt.X__builtin_abort(tls)
 51402  		}
 51403  	}()
 51404  	func() {
 51405  		if (int32(_pOp.Xp5)&int32(64)) == 0 && _356_pC.XisTable == 0 {
 51406  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82749), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66884)))
 51407  			crt.X__builtin_abort(tls)
 51408  		}
 51409  	}()
 51410  	func() {
 51411  		if int32(_pOp.Xp4type) != int32(-15) && int32(_pOp.Xp4type) < int32(-2) {
 51412  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82750), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66925)))
 51413  			crt.X__builtin_abort(tls)
 51414  		}
 51415  	}()
 51416  	if (_db.Xflags & int32(1)) != 0 {
 51417  		_registerTrace(tls, _pOp.Xp2, _356_pData)
 51418  	}
 51419  	if int32(_pOp.Xopcode) != int32(118) {
 51420  		goto _1357
 51421  	}
 51422  	_356_pKey = elem25(_aMem, uintptr(_pOp.Xp3))
 51423  	func() {
 51424  		if (int32(_356_pKey.Xflags) & int32(4)) == 0 {
 51425  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82755), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66973)))
 51426  			crt.X__builtin_abort(tls)
 51427  		}
 51428  	}()
 51429  	func() {
 51430  		if (int32(_356_pKey.Xflags) & int32(128)) != int32(0) {
 51431  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82756), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66995)))
 51432  			crt.X__builtin_abort(tls)
 51433  		}
 51434  	}()
 51435  	if (_db.Xflags & int32(1)) != 0 {
 51436  		_registerTrace(tls, _pOp.Xp3, _356_pKey)
 51437  	}
 51438  	_356_x.XnKey = *(*int64)(unsafe.Pointer(&_356_pKey.Xu))
 51439  	goto _1363
 51440  _1357:
 51441  	func() {
 51442  		if int32(_pOp.Xopcode) != int32(119) {
 51443  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82760), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67012)))
 51444  			crt.X__builtin_abort(tls)
 51445  		}
 51446  	}()
 51447  	_356_x.XnKey = int64(_pOp.Xp3)
 51448  _1363:
 51449  	if (int32(_pOp.Xp4type) == int32(-15)) && (_db.XxUpdateCallback != nil) {
 51450  		func() {
 51451  			if int32(_356_pC.XiDb) < int32(0) {
 51452  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82765), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67038)))
 51453  				crt.X__builtin_abort(tls)
 51454  			}
 51455  		}()
 51456  		_356_zDb = elem27((*XDb)(_db.XaDb), uintptr(_356_pC.XiDb)).XzDbSName
 51457  		_356_pTab = (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 51458  		func() {
 51459  			if (int32(_pOp.Xp5)&int32(64)) == 0 && (_356_pTab.XtabFlags&uint32(32)) != (0) {
 51460  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82768), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67049)))
 51461  				crt.X__builtin_abort(tls)
 51462  			}
 51463  		}()
 51464  		_356_op = func() int32 {
 51465  			if (int32(_pOp.Xp5) & int32(4)) != 0 {
 51466  				return int32(23)
 51467  			}
 51468  			return int32(18)
 51469  		}()
 51470  		goto _1375
 51471  	}
 51472  	_356_pTab = nil
 51473  	_356_zDb = nil
 51474  _1375:
 51475  	if (int32(_pOp.Xp5) & int32(1)) != 0 {
 51476  		_p.XnChange += 1
 51477  	}
 51478  	if (int32(_pOp.Xp5) & int32(32)) != 0 {
 51479  		_db.XlastRowid = _356_x.XnKey
 51480  	}
 51481  	if (int32(_356_pData.Xflags) & int32(1)) != 0 {
 51482  		_356_x.XpData = nil
 51483  		_356_x.XnData = int32(0)
 51484  		goto _1379
 51485  	}
 51486  	func() {
 51487  		if (int32(_356_pData.Xflags) & int32(18)) == 0 {
 51488  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82792), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67093)))
 51489  			crt.X__builtin_abort(tls)
 51490  		}
 51491  	}()
 51492  	_356_x.XpData = unsafe.Pointer(_356_pData.Xz)
 51493  	_356_x.XnData = _356_pData.Xn
 51494  _1379:
 51495  	_356_seekResult = func() int32 {
 51496  		if (int32(_pOp.Xp5) & int32(16)) != 0 {
 51497  			return _356_pC.XseekResult
 51498  		}
 51499  		return int32(0)
 51500  	}()
 51501  	if (int32(_356_pData.Xflags) & int32(16384)) != 0 {
 51502  		_356_x.XnZero = *(*int32)(unsafe.Pointer(&_356_pData.Xu))
 51503  		goto _1385
 51504  	}
 51505  	_356_x.XnZero = int32(0)
 51506  _1385:
 51507  	_356_x.XpKey = nil
 51508  	_rc = _sqlite3BtreeInsert(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_356_pC.Xuc))), &_356_x, int32(_pOp.Xp5)&int32(10), _356_seekResult)
 51509  	_356_pC.XdeferredMoveto = 0
 51510  	_356_pC.XcacheStatus = 0
 51511  	if _rc != 0 {
 51512  		goto _abort_due_to_error
 51513  	}
 51514  	if (_db.XxUpdateCallback != nil) && _356_op != 0 {
 51515  		_db.XxUpdateCallback(tls, _db.XpUpdateArg, _356_op, _356_zDb, _356_pTab.XzName, _356_x.XnKey)
 51516  	}
 51517  	goto _250
 51518  _172:
 51519  	_366_opflags = _pOp.Xp2
 51520  	func() {
 51521  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51522  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82859), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51523  			crt.X__builtin_abort(tls)
 51524  		}
 51525  	}()
 51526  	_366_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51527  	func() {
 51528  		if _366_pC == nil {
 51529  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82861), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51530  			crt.X__builtin_abort(tls)
 51531  		}
 51532  	}()
 51533  	func() {
 51534  		if int32(_366_pC.XeCurType) != int32(0) {
 51535  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82862), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51536  			crt.X__builtin_abort(tls)
 51537  		}
 51538  	}()
 51539  	func() {
 51540  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_366_pC.Xuc))) == nil {
 51541  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82863), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51542  			crt.X__builtin_abort(tls)
 51543  		}
 51544  	}()
 51545  	func() {
 51546  		if int32(_366_pC.XdeferredMoveto) != int32(0) {
 51547  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82864), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 51548  			crt.X__builtin_abort(tls)
 51549  		}
 51550  	}()
 51551  	if ((int32(_pOp.Xp4type) == int32(-15)) && ((((*XTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XtabFlags) & uint32(32)) == (0))) && (int32(_pOp.Xp5) == int32(0)) {
 51552  		_367_iKey = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_366_pC.Xuc))))
 51553  		func() {
 51554  			if _366_pC.XmovetoTarget != _367_iKey {
 51555  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82872), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67149)))
 51556  				crt.X__builtin_abort(tls)
 51557  			}
 51558  		}()
 51559  	}
 51560  	if int32(_pOp.Xp4type) != int32(-15) || _db.XxUpdateCallback == nil {
 51561  		goto _1406
 51562  	}
 51563  	func() {
 51564  		if int32(_366_pC.XiDb) < int32(0) {
 51565  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82882), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67038)))
 51566  			crt.X__builtin_abort(tls)
 51567  		}
 51568  	}()
 51569  	func() {
 51570  		if (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))) == nil {
 51571  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82883), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67172)))
 51572  			crt.X__builtin_abort(tls)
 51573  		}
 51574  	}()
 51575  	_366_zDb = elem27((*XDb)(_db.XaDb), uintptr(_366_pC.XiDb)).XzDbSName
 51576  	_366_pTab = (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 51577  	if ((int32(_pOp.Xp5) & int32(2)) != int32(0)) && (_366_pC.XisTable != 0) {
 51578  		_366_pC.XmovetoTarget = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_366_pC.Xuc))))
 51579  	}
 51580  	goto _1413
 51581  _1406:
 51582  	_366_zDb = nil
 51583  	_366_pTab = nil
 51584  _1413:
 51585  	func() {
 51586  		if (int32(_pOp.Xp5) & int32(-7)) != int32(0) {
 51587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82911), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67188)))
 51588  			crt.X__builtin_abort(tls)
 51589  		}
 51590  	}()
 51591  
 51592  	if (*XVdbeFrame)(_p.XpFrame) != nil {
 51593  		goto _1416
 51594  	}
 51595  	if ((int32((uint32(_366_pC.XisEphemeral)<<31)>>31) == int32(0)) && ((int32(_pOp.Xp5) & int32(4)) == int32(0))) && ((int32(_366_pC.XwrFlag) & int32(8)) == int32(0)) {
 51596  		_nExtraDelete += 1
 51597  	}
 51598  	if (_pOp.Xp2 & int32(1)) != 0 {
 51599  		_nExtraDelete -= 1
 51600  	}
 51601  _1416:
 51602  	_rc = _sqlite3BtreeDelete(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_366_pC.Xuc))), uint8(_pOp.Xp5))
 51603  	_366_pC.XcacheStatus = 0
 51604  	_366_pC.XseekResult = int32(0)
 51605  	if _rc != 0 {
 51606  		goto _abort_due_to_error
 51607  	}
 51608  	if (_366_opflags & int32(1)) == 0 {
 51609  		goto _1422
 51610  	}
 51611  	_p.XnChange += 1
 51612  	if (_db.XxUpdateCallback != nil) && ((_366_pTab.XtabFlags & uint32(32)) == (0)) {
 51613  		_db.XxUpdateCallback(tls, _db.XpUpdateArg, int32(9), _366_zDb, _366_pTab.XzName, _366_pC.XmovetoTarget)
 51614  		func() {
 51615  			if int32(_366_pC.XiDb) < int32(0) {
 51616  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82940), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67038)))
 51617  				crt.X__builtin_abort(tls)
 51618  			}
 51619  		}()
 51620  	}
 51621  _1422:
 51622  	goto _250
 51623  _173:
 51624  	_sqlite3VdbeSetChanges(tls, _db, _p.XnChange)
 51625  	_p.XnChange = int32(0)
 51626  	goto _250
 51627  _174:
 51628  	_377_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51629  	func() {
 51630  		if int32(_377_pC.XeCurType) != int32(1) {
 51631  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82980), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65943)))
 51632  			crt.X__builtin_abort(tls)
 51633  		}
 51634  	}()
 51635  	func() {
 51636  		if int32(_pOp.Xp4type) != int32(-11) {
 51637  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82981), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66283)))
 51638  			crt.X__builtin_abort(tls)
 51639  		}
 51640  	}()
 51641  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 51642  	_377_nKeyCol = *(*int32)(unsafe.Pointer(&_pOp.Xp4))
 51643  	_377_res = int32(0)
 51644  	_rc = _sqlite3VdbeSorterCompare(tls, _377_pC, _pIn3, _377_nKeyCol, &_377_res)
 51645  	if _rc != 0 {
 51646  		goto _abort_due_to_error
 51647  	}
 51648  	if _377_res != 0 {
 51649  		goto _jump_to_p2
 51650  	}
 51651  	goto _250
 51652  _175:
 51653  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 51654  	_378_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51655  	func() {
 51656  		if int32(_378_pC.XeCurType) != int32(1) {
 51657  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83009), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65943)))
 51658  			crt.X__builtin_abort(tls)
 51659  		}
 51660  	}()
 51661  	_rc = _sqlite3VdbeSorterRowkey(tls, _378_pC, _pOut)
 51662  	func() {
 51663  		if _rc == int32(0) && (int32(_pOut.Xflags)&int32(16)) == 0 {
 51664  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83011), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67243)))
 51665  			crt.X__builtin_abort(tls)
 51666  		}
 51667  	}()
 51668  	func() {
 51669  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51670  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83012), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51671  			crt.X__builtin_abort(tls)
 51672  		}
 51673  	}()
 51674  	if _rc != 0 {
 51675  		goto _abort_due_to_error
 51676  	}
 51677  	(*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp3))).XcacheStatus = 0
 51678  	goto _250
 51679  _176:
 51680  	_pOut = _out2Prerelease(tls, _p, _pOp)
 51681  	func() {
 51682  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51683  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83053), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51684  			crt.X__builtin_abort(tls)
 51685  		}
 51686  	}()
 51687  	_379_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51688  	func() {
 51689  		if _379_pC == nil {
 51690  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83055), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51691  			crt.X__builtin_abort(tls)
 51692  		}
 51693  	}()
 51694  	func() {
 51695  		if int32(_379_pC.XeCurType) != int32(0) {
 51696  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83056), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51697  			crt.X__builtin_abort(tls)
 51698  		}
 51699  	}()
 51700  	func() {
 51701  		if bool2int(int32(_379_pC.XeCurType) == int32(1)) != int32(0) {
 51702  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83057), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67285)))
 51703  			crt.X__builtin_abort(tls)
 51704  		}
 51705  	}()
 51706  	func() {
 51707  		if int32(_379_pC.XnullRow) != int32(0) {
 51708  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83058), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67301)))
 51709  			crt.X__builtin_abort(tls)
 51710  		}
 51711  	}()
 51712  	func() {
 51713  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_379_pC.Xuc))) == nil {
 51714  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83059), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51715  			crt.X__builtin_abort(tls)
 51716  		}
 51717  	}()
 51718  	_379_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_379_pC.Xuc)))
 51719  	func() {
 51720  		if int32(_379_pC.XdeferredMoveto) != int32(0) {
 51721  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83070), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 51722  			crt.X__builtin_abort(tls)
 51723  		}
 51724  	}()
 51725  	func() {
 51726  		if _sqlite3BtreeCursorIsValid(tls, _379_pCrsr) == 0 {
 51727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83071), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63955)))
 51728  			crt.X__builtin_abort(tls)
 51729  		}
 51730  	}()
 51731  	_379_n = _sqlite3BtreePayloadSize(tls, _379_pCrsr)
 51732  	if _379_n > uint32(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
 51733  		goto _too_big
 51734  	}
 51735  	_rc = _sqlite3VdbeMemFromBtree(tls, _379_pCrsr, 0, _379_n, _pOut)
 51736  	if _rc != 0 {
 51737  		goto _abort_due_to_error
 51738  	}
 51739  	if _pOp.Xp3 != 0 {
 51740  		goto _1463
 51741  	}
 51742  	if ((int32(_pOut.Xflags) & int32(4096)) != int32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 {
 51743  		goto _no_mem
 51744  	}
 51745  _1463:
 51746  	if (_db.Xflags & int32(1)) != 0 {
 51747  		_registerTrace(tls, _pOp.Xp2, _pOut)
 51748  	}
 51749  	goto _250
 51750  _177:
 51751  	_pOut = _out2Prerelease(tls, _p, _pOp)
 51752  	func() {
 51753  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51754  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83107), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51755  			crt.X__builtin_abort(tls)
 51756  		}
 51757  	}()
 51758  	_382_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51759  	func() {
 51760  		if _382_pC == nil {
 51761  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83109), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51762  			crt.X__builtin_abort(tls)
 51763  		}
 51764  	}()
 51765  	func() {
 51766  		if int32(_382_pC.XeCurType) == int32(3) && _382_pC.XnullRow == 0 {
 51767  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83110), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63784)))
 51768  			crt.X__builtin_abort(tls)
 51769  		}
 51770  	}()
 51771  	if _382_pC.XnullRow != 0 {
 51772  		_pOut.Xflags = uint16(1)
 51773  		goto _250
 51774  	}
 51775  	if _382_pC.XdeferredMoveto != 0 {
 51776  		_382_v = _382_pC.XmovetoTarget
 51777  		goto _1483
 51778  	}
 51779  	if int32(_382_pC.XeCurType) != int32(2) {
 51780  		goto _1477
 51781  	}
 51782  	func() {
 51783  		if (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_382_pC.Xuc))) == nil {
 51784  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83118), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67316)))
 51785  			crt.X__builtin_abort(tls)
 51786  		}
 51787  	}()
 51788  	_382_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_382_pC.Xuc))).XpVtab)
 51789  	_382_pModule = (*Xsqlite3_module)(_382_pVtab.XpModule)
 51790  	func() {
 51791  		if _382_pModule.XxRowid == nil {
 51792  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83121), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67332)))
 51793  			crt.X__builtin_abort(tls)
 51794  		}
 51795  	}()
 51796  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab_cursor, *int64) int32 {
 51797  		v := _382_pModule.XxRowid
 51798  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor, *int64) int32)(unsafe.Pointer(&v))
 51799  	}()(tls, (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_382_pC.Xuc))), &_382_v)
 51800  	_sqlite3VtabImportErrmsg(tls, _p, _382_pVtab)
 51801  	if _rc != 0 {
 51802  		goto _abort_due_to_error
 51803  	}
 51804  	goto _1483
 51805  _1477:
 51806  	func() {
 51807  		if int32(_382_pC.XeCurType) != int32(0) {
 51808  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83127), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51809  			crt.X__builtin_abort(tls)
 51810  		}
 51811  	}()
 51812  	func() {
 51813  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_382_pC.Xuc))) == nil {
 51814  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83128), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51815  			crt.X__builtin_abort(tls)
 51816  		}
 51817  	}()
 51818  	_rc = _sqlite3VdbeCursorRestore(tls, _382_pC)
 51819  	if _rc != 0 {
 51820  		goto _abort_due_to_error
 51821  	}
 51822  	if _382_pC.XnullRow != 0 {
 51823  		_pOut.Xflags = uint16(1)
 51824  		goto _250
 51825  	}
 51826  	_382_v = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_382_pC.Xuc))))
 51827  _1483:
 51828  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _382_v
 51829  	goto _250
 51830  _178:
 51831  	func() {
 51832  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51833  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83150), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51834  			crt.X__builtin_abort(tls)
 51835  		}
 51836  	}()
 51837  	_388_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51838  	func() {
 51839  		if _388_pC == nil {
 51840  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83152), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51841  			crt.X__builtin_abort(tls)
 51842  		}
 51843  	}()
 51844  	_388_pC.XnullRow = uint8(1)
 51845  	_388_pC.XcacheStatus = 0
 51846  	if int32(_388_pC.XeCurType) == int32(0) {
 51847  		func() {
 51848  			if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_388_pC.Xuc))) == nil {
 51849  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83156), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51850  				crt.X__builtin_abort(tls)
 51851  			}
 51852  		}()
 51853  		_sqlite3BtreeClearCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_388_pC.Xuc))))
 51854  	}
 51855  	goto _250
 51856  _179:
 51857  	func() {
 51858  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51859  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83186), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51860  			crt.X__builtin_abort(tls)
 51861  		}
 51862  	}()
 51863  	_390_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51864  	func() {
 51865  		if _390_pC == nil {
 51866  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83188), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51867  			crt.X__builtin_abort(tls)
 51868  		}
 51869  	}()
 51870  	func() {
 51871  		if int32(_390_pC.XeCurType) != int32(0) {
 51872  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83189), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51873  			crt.X__builtin_abort(tls)
 51874  		}
 51875  	}()
 51876  	_390_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_390_pC.Xuc)))
 51877  	_390_res = int32(0)
 51878  	func() {
 51879  		if _390_pCrsr == nil {
 51880  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83192), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66668)))
 51881  			crt.X__builtin_abort(tls)
 51882  		}
 51883  	}()
 51884  	_390_pC.XseekResult = _pOp.Xp3
 51885  	_390_pC.XseekOp = uint8(33)
 51886  	if _pOp.Xp3 != int32(0) && _sqlite3BtreeCursorIsValidNN(tls, _390_pCrsr) != 0 {
 51887  		goto _1508
 51888  	}
 51889  	_rc = _sqlite3BtreeLast(tls, _390_pCrsr, &_390_res)
 51890  	_390_pC.XnullRow = uint8(_390_res)
 51891  	_390_pC.XdeferredMoveto = 0
 51892  	_390_pC.XcacheStatus = 0
 51893  	if _rc != 0 {
 51894  		goto _abort_due_to_error
 51895  	}
 51896  	if _pOp.Xp2 <= int32(0) {
 51897  		goto _1510
 51898  	}
 51899  	if _390_res != 0 {
 51900  		goto _jump_to_p2
 51901  	}
 51902  _1510:
 51903  	goto _1512
 51904  _1508:
 51905  	func() {
 51906  		if _pOp.Xp2 != int32(0) {
 51907  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83208), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67348)))
 51908  			crt.X__builtin_abort(tls)
 51909  		}
 51910  	}()
 51911  _1512:
 51912  	goto _250
 51913  _180:
 51914  	func() {
 51915  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83224), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51917  			crt.X__builtin_abort(tls)
 51918  		}
 51919  	}()
 51920  	_394_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51921  	func() {
 51922  		if _394_pC == nil {
 51923  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83226), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51924  			crt.X__builtin_abort(tls)
 51925  		}
 51926  	}()
 51927  	_394_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_394_pC.Xuc)))
 51928  	func() {
 51929  		if _394_pCrsr == nil {
 51930  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83228), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63949)))
 51931  			crt.X__builtin_abort(tls)
 51932  		}
 51933  	}()
 51934  	_rc = _sqlite3BtreeFirst(tls, _394_pCrsr, &_394_res)
 51935  	if _rc != 0 {
 51936  		goto _abort_due_to_error
 51937  	}
 51938  	if _394_res != int32(0) {
 51939  		goto _1523
 51940  	}
 51941  	_394_sz = _sqlite3BtreeRowCountEst(tls, _394_pCrsr)
 51942  	if func() int32 {
 51943  		if _394_sz >= (0) {
 51944  			return int32(1)
 51945  		}
 51946  		return func() int32 {
 51947  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83233), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(4809)))
 51948  			crt.X__builtin_abort(tls)
 51949  			return int32(0)
 51950  		}()
 51951  	}() != 0 && (int32(_sqlite3LogEst(tls, uint64(_394_sz))) < _pOp.Xp3) {
 51952  		_394_res = int32(1)
 51953  	}
 51954  _1523:
 51955  	if _394_res != 0 {
 51956  		goto _jump_to_p2
 51957  	}
 51958  	goto _250
 51959  _181:
 51960  	*elem31((*uint32)(unsafe.Pointer(&_p.XaCounter)), uintptr(2)) += 1
 51961  _183:
 51962  	func() {
 51963  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51964  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83288), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51965  			crt.X__builtin_abort(tls)
 51966  		}
 51967  	}()
 51968  	_397_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51969  	func() {
 51970  		if _397_pC == nil {
 51971  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83290), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51972  			crt.X__builtin_abort(tls)
 51973  		}
 51974  	}()
 51975  	func() {
 51976  		if (int32(_397_pC.XeCurType) == int32(1)) != (int32(_pOp.Xopcode) == int32(35)) {
 51977  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83291), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67359)))
 51978  			crt.X__builtin_abort(tls)
 51979  		}
 51980  	}()
 51981  	_397_res = int32(1)
 51982  	_397_pC.XseekOp = uint8(37)
 51983  	if int32(_397_pC.XeCurType) == int32(1) {
 51984  		_rc = _sqlite3VdbeSorterRewind(tls, _397_pC, &_397_res)
 51985  		goto _1537
 51986  	}
 51987  	func() {
 51988  		if int32(_397_pC.XeCurType) != int32(0) {
 51989  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83299), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51990  			crt.X__builtin_abort(tls)
 51991  		}
 51992  	}()
 51993  	_397_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_397_pC.Xuc)))
 51994  	func() {
 51995  		if _397_pCrsr == nil {
 51996  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83301), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63949)))
 51997  			crt.X__builtin_abort(tls)
 51998  		}
 51999  	}()
 52000  	_rc = _sqlite3BtreeFirst(tls, _397_pCrsr, &_397_res)
 52001  	_397_pC.XdeferredMoveto = 0
 52002  	_397_pC.XcacheStatus = 0
 52003  _1537:
 52004  	if _rc != 0 {
 52005  		goto _abort_due_to_error
 52006  	}
 52007  	_397_pC.XnullRow = uint8(_397_res)
 52008  	func() {
 52009  		if _pOp.Xp2 <= int32(0) || _pOp.Xp2 >= _p.XnOp {
 52010  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83308), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67402)))
 52011  			crt.X__builtin_abort(tls)
 52012  		}
 52013  	}()
 52014  	if _397_res != 0 {
 52015  		goto _jump_to_p2
 52016  	}
 52017  	goto _250
 52018  _184:
 52019  	_400_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52020  	func() {
 52021  		if int32(_400_pC.XeCurType) != int32(1) {
 52022  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83389), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65943)))
 52023  			crt.X__builtin_abort(tls)
 52024  		}
 52025  	}()
 52026  	_400_res = int32(0)
 52027  	_rc = _sqlite3VdbeSorterNext(tls, _db, _400_pC, &_400_res)
 52028  	goto _next_tail
 52029  _185:
 52030  	if (*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))) == nil {
 52031  		goto _250
 52032  	}
 52033  _1549:
 52034  	func() {
 52035  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52036  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83399), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52037  			crt.X__builtin_abort(tls)
 52038  		}
 52039  	}()
 52040  	func() {
 52041  		if int32(_pOp.Xp5) >= int32(5) {
 52042  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83400), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67430)))
 52043  			crt.X__builtin_abort(tls)
 52044  		}
 52045  	}()
 52046  	_400_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52047  	_400_res = _pOp.Xp3
 52048  	func() {
 52049  		if _400_pC == nil {
 52050  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83403), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52051  			crt.X__builtin_abort(tls)
 52052  		}
 52053  	}()
 52054  	func() {
 52055  		if int32(_400_pC.XdeferredMoveto) != int32(0) {
 52056  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83404), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 52057  			crt.X__builtin_abort(tls)
 52058  		}
 52059  	}()
 52060  	func() {
 52061  		if int32(_400_pC.XeCurType) != int32(0) {
 52062  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83405), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 52063  			crt.X__builtin_abort(tls)
 52064  		}
 52065  	}()
 52066  	func() {
 52067  		if _400_res != int32(0) && (_400_res != int32(1) || int32(_400_pC.XisTable) != int32(0)) {
 52068  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83406), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67461)))
 52069  			crt.X__builtin_abort(tls)
 52070  		}
 52071  	}()
 52072  	func() {
 52073  		if int32(_pOp.Xopcode) == int32(7) && *(*uintptr)(unsafe.Pointer(&struct {
 52074  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52075  		}{func() func(*crt.TLS, *XBtCursor, *int32) int32 {
 52076  			v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4))
 52077  			return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v))
 52078  		}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 52079  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52080  		}{_sqlite3BtreeNext})) {
 52081  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83408), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67498)))
 52082  			crt.X__builtin_abort(tls)
 52083  		}
 52084  	}()
 52085  	func() {
 52086  		if int32(_pOp.Xopcode) == int32(6) && *(*uintptr)(unsafe.Pointer(&struct {
 52087  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52088  		}{func() func(*crt.TLS, *XBtCursor, *int32) int32 {
 52089  			v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4))
 52090  			return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v))
 52091  		}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 52092  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52093  		}{_sqlite3BtreePrevious})) {
 52094  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83409), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67557)))
 52095  			crt.X__builtin_abort(tls)
 52096  		}
 52097  	}()
 52098  	func() {
 52099  		if int32(_pOp.Xopcode) == int32(5) && *(*uintptr)(unsafe.Pointer(&struct {
 52100  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52101  		}{func() func(*crt.TLS, *XBtCursor, *int32) int32 {
 52102  			v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4))
 52103  			return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v))
 52104  		}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 52105  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52106  		}{_sqlite3BtreeNext})) {
 52107  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83410), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67620)))
 52108  			crt.X__builtin_abort(tls)
 52109  		}
 52110  	}()
 52111  	func() {
 52112  		if int32(_pOp.Xopcode) == int32(4) && *(*uintptr)(unsafe.Pointer(&struct {
 52113  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52114  		}{func() func(*crt.TLS, *XBtCursor, *int32) int32 {
 52115  			v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4))
 52116  			return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v))
 52117  		}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 52118  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52119  		}{_sqlite3BtreePrevious})) {
 52120  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83411), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67685)))
 52121  			crt.X__builtin_abort(tls)
 52122  		}
 52123  	}()
 52124  	func() {
 52125  		if int32(_pOp.Xopcode) == int32(7) && int32(_pOp.Xopcode) == int32(5) && int32(_400_pC.XseekOp) != int32(27) && int32(_400_pC.XseekOp) != int32(26) && int32(_400_pC.XseekOp) != int32(37) && int32(_400_pC.XseekOp) != int32(30) {
 52126  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83415), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67754)))
 52127  			crt.X__builtin_abort(tls)
 52128  		}
 52129  	}()
 52130  	func() {
 52131  		if int32(_pOp.Xopcode) == int32(6) && int32(_pOp.Xopcode) == int32(4) && int32(_400_pC.XseekOp) != int32(24) && int32(_400_pC.XseekOp) != int32(25) && int32(_400_pC.XseekOp) != int32(33) {
 52132  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83418), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67904)))
 52133  			crt.X__builtin_abort(tls)
 52134  		}
 52135  	}()
 52136  	_rc = func() func(*crt.TLS, *XBtCursor, *int32) int32 {
 52137  		v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4))
 52138  		return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v))
 52139  	}()(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_400_pC.Xuc))), &_400_res)
 52140  _next_tail:
 52141  	_400_pC.XcacheStatus = 0
 52142  	if _rc != 0 {
 52143  		goto _abort_due_to_error
 52144  	}
 52145  	if _400_res == int32(0) {
 52146  		_400_pC.XnullRow = 0
 52147  		*elem31((*uint32)(unsafe.Pointer(&_p.XaCounter)), uintptr(_pOp.Xp5)) += 1
 52148  		goto _jump_to_p2_and_check_for_interrupt
 52149  	}
 52150  	_400_pC.XnullRow = uint8(1)
 52151  	goto _check_for_interrupt
 52152  _189:
 52153  	func() {
 52154  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52155  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83480), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52156  			crt.X__builtin_abort(tls)
 52157  		}
 52158  	}()
 52159  	_403_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52160  	func() {
 52161  		if _403_pC == nil {
 52162  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83482), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52163  			crt.X__builtin_abort(tls)
 52164  		}
 52165  	}()
 52166  	func() {
 52167  		if (int32(_403_pC.XeCurType) == int32(1)) != (int32(_pOp.Xopcode) == int32(127)) {
 52168  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83483), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68028)))
 52169  			crt.X__builtin_abort(tls)
 52170  		}
 52171  	}()
 52172  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 52173  	func() {
 52174  		if (int32(_pIn2.Xflags) & int32(16)) == 0 {
 52175  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83485), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68073)))
 52176  			crt.X__builtin_abort(tls)
 52177  		}
 52178  	}()
 52179  	if (int32(_pOp.Xp5) & int32(1)) != 0 {
 52180  		_p.XnChange += 1
 52181  	}
 52182  	func() {
 52183  		if int32(_403_pC.XeCurType) != int32(0) && int32(_pOp.Xopcode) != int32(127) {
 52184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83487), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68096)))
 52185  			crt.X__builtin_abort(tls)
 52186  		}
 52187  	}()
 52188  	func() {
 52189  		if int32(_403_pC.XisTable) != int32(0) {
 52190  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83488), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66542)))
 52191  			crt.X__builtin_abort(tls)
 52192  		}
 52193  	}()
 52194  	_rc = func() int32 {
 52195  		if (int32(_pIn2.Xflags) & int32(16384)) != 0 {
 52196  			return _sqlite3VdbeMemExpandBlob(tls, _pIn2)
 52197  		}
 52198  		return int32(0)
 52199  	}()
 52200  	if _rc != 0 {
 52201  		goto _abort_due_to_error
 52202  	}
 52203  	if int32(_pOp.Xopcode) == int32(127) {
 52204  		_rc = _sqlite3VdbeSorterWrite(tls, _403_pC, _pIn2)
 52205  		goto _1612
 52206  	}
 52207  	_403_x.XnKey = int64(_pIn2.Xn)
 52208  	_403_x.XpKey = unsafe.Pointer(_pIn2.Xz)
 52209  	*(**XMem)(unsafe.Pointer(&_403_x.XaMem)) = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_pOp.Xp3)*uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(72)))))))))))
 52210  	_403_x.XnMem = uint16(*(*int32)(unsafe.Pointer(&_pOp.Xp4)))
 52211  	_rc = _sqlite3BtreeInsert(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_403_pC.Xuc))), &_403_x, int32(_pOp.Xp5)&int32(10), func() int32 {
 52212  		if (int32(_pOp.Xp5) & int32(16)) != 0 {
 52213  			return _403_pC.XseekResult
 52214  		}
 52215  		return int32(0)
 52216  	}())
 52217  	func() {
 52218  		if int32(_403_pC.XdeferredMoveto) != int32(0) {
 52219  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83502), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 52220  			crt.X__builtin_abort(tls)
 52221  		}
 52222  	}()
 52223  	_403_pC.XcacheStatus = 0
 52224  _1612:
 52225  	if _rc != 0 {
 52226  		goto _abort_due_to_error
 52227  	}
 52228  	goto _250
 52229  _191:
 52230  	func() {
 52231  		if _pOp.Xp3 <= int32(0) {
 52232  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83522), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61154)))
 52233  			crt.X__builtin_abort(tls)
 52234  		}
 52235  	}()
 52236  	func() {
 52237  		if _pOp.Xp2 <= int32(0) || (_pOp.Xp2+_pOp.Xp3) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 52238  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83523), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68156)))
 52239  			crt.X__builtin_abort(tls)
 52240  		}
 52241  	}()
 52242  	func() {
 52243  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83524), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52245  			crt.X__builtin_abort(tls)
 52246  		}
 52247  	}()
 52248  	_406_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52249  	func() {
 52250  		if _406_pC == nil {
 52251  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83526), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52252  			crt.X__builtin_abort(tls)
 52253  		}
 52254  	}()
 52255  	func() {
 52256  		if int32(_406_pC.XeCurType) != int32(0) {
 52257  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83527), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 52258  			crt.X__builtin_abort(tls)
 52259  		}
 52260  	}()
 52261  	_406_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_406_pC.Xuc)))
 52262  	func() {
 52263  		if _406_pCrsr == nil {
 52264  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83529), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66668)))
 52265  			crt.X__builtin_abort(tls)
 52266  		}
 52267  	}()
 52268  	func() {
 52269  		if int32(_pOp.Xp5) != int32(0) {
 52270  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83530), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65967)))
 52271  			crt.X__builtin_abort(tls)
 52272  		}
 52273  	}()
 52274  	*(**XKeyInfo)(unsafe.Pointer(&_406_r.XpKeyInfo)) = (*XKeyInfo)(_406_pC.XpKeyInfo)
 52275  	_406_r.XnField = uint16(_pOp.Xp3)
 52276  	_406_r.Xdefault_rc = 0
 52277  	*(**XMem)(unsafe.Pointer(&_406_r.XaMem)) = elem25(_aMem, uintptr(_pOp.Xp2))
 52278  	_rc = _sqlite3BtreeMovetoUnpacked(tls, _406_pCrsr, &_406_r, 0, int32(0), &_406_res)
 52279  	if _rc != 0 {
 52280  		goto _abort_due_to_error
 52281  	}
 52282  	if _406_res != int32(0) {
 52283  		goto _1635
 52284  	}
 52285  	_rc = _sqlite3BtreeDelete(tls, _406_pCrsr, uint8(4))
 52286  	if _rc != 0 {
 52287  		goto _abort_due_to_error
 52288  	}
 52289  _1635:
 52290  	func() {
 52291  		if int32(_406_pC.XdeferredMoveto) != int32(0) {
 52292  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83541), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 52293  			crt.X__builtin_abort(tls)
 52294  		}
 52295  	}()
 52296  	_406_pC.XcacheStatus = 0
 52297  	_406_pC.XseekResult = int32(0)
 52298  	goto _250
 52299  _192:
 52300  	func() {
 52301  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52302  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83581), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52303  			crt.X__builtin_abort(tls)
 52304  		}
 52305  	}()
 52306  	_408_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52307  	func() {
 52308  		if _408_pC == nil {
 52309  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83583), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52310  			crt.X__builtin_abort(tls)
 52311  		}
 52312  	}()
 52313  	func() {
 52314  		if int32(_408_pC.XeCurType) != int32(0) {
 52315  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83584), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 52316  			crt.X__builtin_abort(tls)
 52317  		}
 52318  	}()
 52319  	func() {
 52320  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_408_pC.Xuc))) == nil {
 52321  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83585), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 52322  			crt.X__builtin_abort(tls)
 52323  		}
 52324  	}()
 52325  	func() {
 52326  		if int32(_408_pC.XisTable) != int32(0) {
 52327  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83586), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66542)))
 52328  			crt.X__builtin_abort(tls)
 52329  		}
 52330  	}()
 52331  	func() {
 52332  		if int32(_408_pC.XdeferredMoveto) != int32(0) {
 52333  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83587), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 52334  			crt.X__builtin_abort(tls)
 52335  		}
 52336  	}()
 52337  	func() {
 52338  		if _408_pC.XnullRow != 0 && int32(_pOp.Xopcode) != int32(131) {
 52339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83588), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68213)))
 52340  			crt.X__builtin_abort(tls)
 52341  		}
 52342  	}()
 52343  	_rc = _sqlite3VdbeCursorRestore(tls, _408_pC)
 52344  	if func() int32 {
 52345  		if _rc != int32(0) {
 52346  			return func() int32 {
 52347  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83597), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(4809)))
 52348  				crt.X__builtin_abort(tls)
 52349  				return int32(1)
 52350  			}()
 52351  		}
 52352  		return int32(0)
 52353  	}() != 0 {
 52354  		goto _abort_due_to_error
 52355  	}
 52356  	if _408_pC.XnullRow != 0 {
 52357  		goto _1658
 52358  	}
 52359  	_408_rowid = 0
 52360  	_rc = _sqlite3VdbeIdxRowid(tls, _db, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_408_pC.Xuc))), &_408_rowid)
 52361  	if _rc != int32(0) {
 52362  		goto _abort_due_to_error
 52363  	}
 52364  	if int32(_pOp.Xopcode) == int32(130) {
 52365  		func() {
 52366  			if _pOp.Xp3 < int32(0) || _pOp.Xp3 >= _p.XnCursor {
 52367  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83606), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68254)))
 52368  				crt.X__builtin_abort(tls)
 52369  			}
 52370  		}()
 52371  		_408_pTabCur = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp3))
 52372  		func() {
 52373  			if _408_pTabCur == nil {
 52374  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83608), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68287)))
 52375  				crt.X__builtin_abort(tls)
 52376  			}
 52377  		}()
 52378  		func() {
 52379  			if int32(_408_pTabCur.XeCurType) != int32(0) {
 52380  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83609), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68298)))
 52381  				crt.X__builtin_abort(tls)
 52382  			}
 52383  		}()
 52384  		func() {
 52385  			if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_408_pTabCur.Xuc))) == nil {
 52386  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83610), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68331)))
 52387  				crt.X__builtin_abort(tls)
 52388  			}
 52389  		}()
 52390  		func() {
 52391  			if _408_pTabCur.XisTable == 0 {
 52392  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83611), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68354)))
 52393  				crt.X__builtin_abort(tls)
 52394  			}
 52395  		}()
 52396  		_408_pTabCur.XnullRow = 0
 52397  		_408_pTabCur.XmovetoTarget = _408_rowid
 52398  		_408_pTabCur.XdeferredMoveto = uint8(1)
 52399  		func() {
 52400  			if int32(_pOp.Xp4type) != int32(-12) && (*(**int32)(unsafe.Pointer(&_pOp.Xp4))) != nil {
 52401  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83615), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68371)))
 52402  				crt.X__builtin_abort(tls)
 52403  			}
 52404  		}()
 52405  		_408_pTabCur.XaAltMap = *(**int32)(unsafe.Pointer(&_pOp.Xp4))
 52406  		*(**XVdbeCursor)(unsafe.Pointer(&_408_pTabCur.XpAltCursor)) = _408_pC
 52407  		goto _1675
 52408  	}
 52409  	_pOut = _out2Prerelease(tls, _p, _pOp)
 52410  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _408_rowid
 52411  _1675:
 52412  	goto _1676
 52413  _1658:
 52414  	func() {
 52415  		if int32(_pOp.Xopcode) != int32(131) {
 52416  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83623), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68413)))
 52417  			crt.X__builtin_abort(tls)
 52418  		}
 52419  	}()
 52420  	_sqlite3VdbeMemSetNull(tls, elem25(_aMem, uintptr(_pOp.Xp2)))
 52421  _1676:
 52422  	goto _250
 52423  _194:
 52424  	func() {
 52425  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52426  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83681), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52427  			crt.X__builtin_abort(tls)
 52428  		}
 52429  	}()
 52430  	_414_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52431  	func() {
 52432  		if _414_pC == nil {
 52433  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83683), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52434  			crt.X__builtin_abort(tls)
 52435  		}
 52436  	}()
 52437  	func() {
 52438  		if ((uint32(_414_pC.XisEphemeral>>2) << 31) >> 31) == 0 {
 52439  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83684), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65989)))
 52440  			crt.X__builtin_abort(tls)
 52441  		}
 52442  	}()
 52443  	func() {
 52444  		if int32(_414_pC.XeCurType) != int32(0) {
 52445  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83685), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 52446  			crt.X__builtin_abort(tls)
 52447  		}
 52448  	}()
 52449  	func() {
 52450  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_414_pC.Xuc))) == nil {
 52451  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83686), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 52452  			crt.X__builtin_abort(tls)
 52453  		}
 52454  	}()
 52455  	func() {
 52456  		if int32(_414_pC.XdeferredMoveto) != int32(0) {
 52457  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83687), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 52458  			crt.X__builtin_abort(tls)
 52459  		}
 52460  	}()
 52461  	func() {
 52462  		if int32(_pOp.Xp5) != int32(0) && int32(_pOp.Xp5) != int32(1) {
 52463  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83688), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68438)))
 52464  			crt.X__builtin_abort(tls)
 52465  		}
 52466  	}()
 52467  	func() {
 52468  		if int32(_pOp.Xp4type) != int32(-11) {
 52469  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83689), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66283)))
 52470  			crt.X__builtin_abort(tls)
 52471  		}
 52472  	}()
 52473  	*(**XKeyInfo)(unsafe.Pointer(&_414_r.XpKeyInfo)) = (*XKeyInfo)(_414_pC.XpKeyInfo)
 52474  	_414_r.XnField = uint16(*(*int32)(unsafe.Pointer(&_pOp.Xp4)))
 52475  	if int32(_pOp.Xopcode) < int32(40) {
 52476  		func() {
 52477  			if int32(_pOp.Xopcode) != int32(38) && int32(_pOp.Xopcode) != int32(39) {
 52478  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83693), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68463)))
 52479  				crt.X__builtin_abort(tls)
 52480  			}
 52481  		}()
 52482  		_414_r.Xdefault_rc = int8(-1)
 52483  		goto _1701
 52484  	}
 52485  	func() {
 52486  		if int32(_pOp.Xopcode) != int32(41) && int32(_pOp.Xopcode) != int32(40) {
 52487  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83696), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68510)))
 52488  			crt.X__builtin_abort(tls)
 52489  		}
 52490  	}()
 52491  	_414_r.Xdefault_rc = 0
 52492  _1701:
 52493  	*(**XMem)(unsafe.Pointer(&_414_r.XaMem)) = elem25(_aMem, uintptr(_pOp.Xp3))
 52494  	_417_i = int32(0)
 52495  _1705:
 52496  	if _417_i >= int32(_414_r.XnField) {
 52497  		goto _1708
 52498  	}
 52499  	func() {
 52500  		if (int32(elem25((*XMem)(_414_r.XaMem), uintptr(_417_i)).Xflags) & int32(128)) != int32(0) {
 52501  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83701), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66450)))
 52502  			crt.X__builtin_abort(tls)
 52503  		}
 52504  	}()
 52505  	_417_i += 1
 52506  	goto _1705
 52507  _1708:
 52508  	_414_res = int32(0)
 52509  	_rc = _sqlite3VdbeIdxKeyCompare(tls, _db, _414_pC, &_414_r, &_414_res)
 52510  
 52511  	if (int32(_pOp.Xopcode) & int32(1)) == int32(0) {
 52512  		func() {
 52513  			if int32(_pOp.Xopcode) != int32(38) && int32(_pOp.Xopcode) != int32(40) {
 52514  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83707), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68557)))
 52515  				crt.X__builtin_abort(tls)
 52516  			}
 52517  		}()
 52518  		_414_res = -_414_res
 52519  		goto _1715
 52520  	}
 52521  	func() {
 52522  		if int32(_pOp.Xopcode) != int32(41) && int32(_pOp.Xopcode) != int32(39) {
 52523  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83710), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68604)))
 52524  			crt.X__builtin_abort(tls)
 52525  		}
 52526  	}()
 52527  	_414_res += 1
 52528  _1715:
 52529  	if _rc != 0 {
 52530  		goto _abort_due_to_error
 52531  	}
 52532  	if _414_res > int32(0) {
 52533  		goto _jump_to_p2
 52534  	}
 52535  	goto _250
 52536  _198:
 52537  	func() {
 52538  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 52539  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83750), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 52540  			crt.X__builtin_abort(tls)
 52541  		}
 52542  	}()
 52543  	func() {
 52544  		if _pOp.Xp1 <= int32(1) {
 52545  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83751), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68651)))
 52546  			crt.X__builtin_abort(tls)
 52547  		}
 52548  	}()
 52549  	_pOut = _out2Prerelease(tls, _p, _pOp)
 52550  	_pOut.Xflags = uint16(1)
 52551  	if _db.XnVdbeRead > (_db.XnVDestroy + int32(1)) {
 52552  		_rc = int32(6)
 52553  		_p.XerrorAction = uint8(2)
 52554  		goto _abort_due_to_error
 52555  	}
 52556  	_420_iDb = _pOp.Xp3
 52557  	func() {
 52558  		if (_p.XbtreeMask & (uint32(1) << uint(_420_iDb))) == (0) {
 52559  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83760), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65354)))
 52560  			crt.X__builtin_abort(tls)
 52561  		}
 52562  	}()
 52563  	_420_iMoved = int32(0)
 52564  	_rc = _sqlite3BtreeDropTable(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_420_iDb)).XpBt), _pOp.Xp1, &_420_iMoved)
 52565  	_pOut.Xflags = uint16(4)
 52566  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_420_iMoved)
 52567  	if _rc != 0 {
 52568  		goto _abort_due_to_error
 52569  	}
 52570  	if _420_iMoved != int32(0) {
 52571  		_sqlite3RootPageMoved(tls, _db, _420_iDb, _420_iMoved, _pOp.Xp1)
 52572  		func() {
 52573  			if int32(_resetSchemaOnFault) != int32(0) && int32(_resetSchemaOnFault) != (_420_iDb+int32(1)) {
 52574  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83770), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68661)))
 52575  				crt.X__builtin_abort(tls)
 52576  			}
 52577  		}()
 52578  		_resetSchemaOnFault = uint8(_420_iDb + int32(1))
 52579  	}
 52580  	goto _250
 52581  _199:
 52582  	_424_nChange = int32(0)
 52583  	func() {
 52584  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 52585  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83800), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 52586  			crt.X__builtin_abort(tls)
 52587  		}
 52588  	}()
 52589  	func() {
 52590  		if (_p.XbtreeMask & (uint32(1) << uint(_pOp.Xp2))) == (0) {
 52591  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83801), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68712)))
 52592  			crt.X__builtin_abort(tls)
 52593  		}
 52594  	}()
 52595  	_rc = _sqlite3BtreeClearTable(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp2)).XpBt), _pOp.Xp1, func() *int32 {
 52596  		if _pOp.Xp3 != 0 {
 52597  			return &_424_nChange
 52598  		}
 52599  		return nil
 52600  	}())
 52601  	if _pOp.Xp3 == 0 {
 52602  		goto _1740
 52603  	}
 52604  	_p.XnChange += _424_nChange
 52605  	if _pOp.Xp3 > int32(0) {
 52606  		func() {
 52607  			if (int32(elem25(_aMem, uintptr(_pOp.Xp3)).Xflags) & int32(128)) != int32(0) {
 52608  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83808), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61198)))
 52609  				crt.X__builtin_abort(tls)
 52610  			}
 52611  		}()
 52612  		_sqlite3VdbeMemAboutToChange(tls, _p, elem25(_aMem, uintptr(_pOp.Xp3)))
 52613  		*(*int64)(unsafe.Pointer(&(elem25(_aMem, uintptr(_pOp.Xp3)).Xu))) += int64(_424_nChange)
 52614  	}
 52615  _1740:
 52616  	if _rc != 0 {
 52617  		goto _abort_due_to_error
 52618  	}
 52619  	goto _250
 52620  _200:
 52621  	func() {
 52622  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52623  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83828), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52624  			crt.X__builtin_abort(tls)
 52625  		}
 52626  	}()
 52627  	_427_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52628  	func() {
 52629  		if _427_pC == nil {
 52630  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83830), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52631  			crt.X__builtin_abort(tls)
 52632  		}
 52633  	}()
 52634  	if int32(_427_pC.XeCurType) == int32(1) {
 52635  		_sqlite3VdbeSorterReset(tls, _db, (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_427_pC.Xuc))))
 52636  		goto _1751
 52637  	}
 52638  	func() {
 52639  		if int32(_427_pC.XeCurType) != int32(0) {
 52640  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83834), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 52641  			crt.X__builtin_abort(tls)
 52642  		}
 52643  	}()
 52644  	func() {
 52645  		if ((uint32(_427_pC.XisEphemeral) << 31) >> 31) == 0 {
 52646  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83835), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68746)))
 52647  			crt.X__builtin_abort(tls)
 52648  		}
 52649  	}()
 52650  	_rc = _sqlite3BtreeClearTableOfCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_427_pC.Xuc))))
 52651  	if _rc != 0 {
 52652  		goto _abort_due_to_error
 52653  	}
 52654  _1751:
 52655  	goto _250
 52656  _201:
 52657  	_pOut = _out2Prerelease(tls, _p, _pOp)
 52658  	_430_pgno = int32(0)
 52659  	func() {
 52660  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 52661  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83874), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 52662  			crt.X__builtin_abort(tls)
 52663  		}
 52664  	}()
 52665  	func() {
 52666  		if (_p.XbtreeMask & (uint32(1) << uint(_pOp.Xp1))) == (0) {
 52667  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83875), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65170)))
 52668  			crt.X__builtin_abort(tls)
 52669  		}
 52670  	}()
 52671  	func() {
 52672  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 52673  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83876), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 52674  			crt.X__builtin_abort(tls)
 52675  		}
 52676  	}()
 52677  	_430_pDb = elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1))
 52678  	func() {
 52679  		if (*XBtree)(_430_pDb.XpBt) == nil {
 52680  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83878), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65427)))
 52681  			crt.X__builtin_abort(tls)
 52682  		}
 52683  	}()
 52684  	if int32(_pOp.Xopcode) == int32(137) {
 52685  		_430_flags = int32(1)
 52686  		goto _1767
 52687  	}
 52688  	_430_flags = int32(2)
 52689  _1767:
 52690  	_rc = _sqlite3BtreeCreateTable(tls, (*XBtree)(_430_pDb.XpBt), &_430_pgno, _430_flags)
 52691  	if _rc != 0 {
 52692  		goto _abort_due_to_error
 52693  	}
 52694  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_430_pgno)
 52695  	goto _250
 52696  _203:
 52697  	_db.XnSqlExec += 1
 52698  	_rc = Xsqlite3_exec(tls, _db, *(**int8)(unsafe.Pointer(&_pOp.Xp4)), nil, nil, nil)
 52699  	_db.XnSqlExec -= 1
 52700  	if _rc != 0 {
 52701  		goto _abort_due_to_error
 52702  	}
 52703  	goto _250
 52704  _204:
 52705  	_434_iDb = int32(0)
 52706  _1770:
 52707  	if _434_iDb >= _db.XnDb {
 52708  		goto _1773
 52709  	}
 52710  	func() {
 52711  		if _434_iDb != int32(1) && _sqlite3BtreeHoldsMutex(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_434_iDb)).XpBt)) == 0 {
 52712  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83923), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(49911)))
 52713  			crt.X__builtin_abort(tls)
 52714  		}
 52715  	}()
 52716  	_434_iDb += 1
 52717  	goto _1770
 52718  _1773:
 52719  	_434_iDb = _pOp.Xp1
 52720  	func() {
 52721  		if _434_iDb < int32(0) || _434_iDb >= _db.XnDb {
 52722  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83928), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(21693)))
 52723  			crt.X__builtin_abort(tls)
 52724  		}
 52725  	}()
 52726  	func() {
 52727  		if (int32((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_434_iDb)).XpSchema).XschemaFlags) & int32(1)) != int32(1) {
 52728  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83929), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68762)))
 52729  			crt.X__builtin_abort(tls)
 52730  		}
 52731  	}()
 52732  	_434_zMaster = str(49981)
 52733  	*(**Xsqlite3)(unsafe.Pointer(&_434_initData.Xdb)) = _db
 52734  	_434_initData.XiDb = _pOp.Xp1
 52735  	_434_initData.XpzErrMsg = &_p.XzErrMsg
 52736  	_434_zSql = _sqlite3MPrintf(tls, _db, str(68802), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_434_iDb)).XzDbSName), unsafe.Pointer(_434_zMaster), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pOp.Xp4))))
 52737  	if _434_zSql == nil {
 52738  		_rc = _sqlite3NomemError(tls, int32(83939))
 52739  		goto _1783
 52740  	}
 52741  	func() {
 52742  		if int32(_db.Xinit.Xbusy) != int32(0) {
 52743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83941), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(49851)))
 52744  			crt.X__builtin_abort(tls)
 52745  		}
 52746  	}()
 52747  	_db.Xinit.Xbusy = uint8(1)
 52748  	_434_initData.Xrc = int32(0)
 52749  	func() {
 52750  		if _db.XmallocFailed != 0 {
 52751  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83944), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(23824)))
 52752  			crt.X__builtin_abort(tls)
 52753  		}
 52754  	}()
 52755  	_rc = Xsqlite3_exec(tls, _db, _434_zSql, _sqlite3InitCallback, unsafe.Pointer(&_434_initData), nil)
 52756  	if _rc == int32(0) {
 52757  		_rc = _434_initData.Xrc
 52758  	}
 52759  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_434_zSql))
 52760  	_db.Xinit.Xbusy = 0
 52761  _1783:
 52762  	if _rc == 0 {
 52763  		goto _1789
 52764  	}
 52765  	_sqlite3ResetAllSchemasOfConnection(tls, _db)
 52766  	if _rc == int32(7) {
 52767  		goto _no_mem
 52768  	}
 52769  	goto _abort_due_to_error
 52770  _1789:
 52771  	goto _250
 52772  _205:
 52773  	func() {
 52774  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 52775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83969), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 52776  			crt.X__builtin_abort(tls)
 52777  		}
 52778  	}()
 52779  	_rc = _sqlite3AnalysisLoad(tls, _db, _pOp.Xp1)
 52780  	if _rc != 0 {
 52781  		goto _abort_due_to_error
 52782  	}
 52783  	goto _250
 52784  _206:
 52785  	_sqlite3UnlinkAndDeleteTable(tls, _db, _pOp.Xp1, *(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 52786  	goto _250
 52787  _207:
 52788  	_sqlite3UnlinkAndDeleteIndex(tls, _db, _pOp.Xp1, *(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 52789  	goto _250
 52790  _208:
 52791  	_sqlite3UnlinkAndDeleteTrigger(tls, _db, _pOp.Xp1, *(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 52792  	goto _250
 52793  _209:
 52794  	func() {
 52795  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 52796  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84043), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 52797  			crt.X__builtin_abort(tls)
 52798  		}
 52799  	}()
 52800  	_445_nRoot = _pOp.Xp2
 52801  	_445_aRoot = *(**int32)(unsafe.Pointer(&_pOp.Xp4))
 52802  	func() {
 52803  		if _445_nRoot <= int32(0) {
 52804  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84046), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68866)))
 52805  			crt.X__builtin_abort(tls)
 52806  		}
 52807  	}()
 52808  	func() {
 52809  		if (*elem8(_445_aRoot, uintptr(_445_nRoot))) != int32(0) {
 52810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84047), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68874)))
 52811  			crt.X__builtin_abort(tls)
 52812  		}
 52813  	}()
 52814  	func() {
 52815  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 52816  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84048), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 52817  			crt.X__builtin_abort(tls)
 52818  		}
 52819  	}()
 52820  	_445_pnErr = elem25(_aMem, uintptr(_pOp.Xp3))
 52821  	func() {
 52822  		if (int32(_445_pnErr.Xflags) & int32(4)) == int32(0) {
 52823  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84050), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68890)))
 52824  			crt.X__builtin_abort(tls)
 52825  		}
 52826  	}()
 52827  	func() {
 52828  		if (int32(_445_pnErr.Xflags) & int32(18)) != int32(0) {
 52829  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84051), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68918)))
 52830  			crt.X__builtin_abort(tls)
 52831  		}
 52832  	}()
 52833  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 52834  	func() {
 52835  		if int32(_pOp.Xp5) >= _db.XnDb {
 52836  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84053), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68957)))
 52837  			crt.X__builtin_abort(tls)
 52838  		}
 52839  	}()
 52840  	func() {
 52841  		if (_p.XbtreeMask & (uint32(1) << uint(int32(_pOp.Xp5)))) == (0) {
 52842  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84054), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68973)))
 52843  			crt.X__builtin_abort(tls)
 52844  		}
 52845  	}()
 52846  	_445_z = _sqlite3BtreeIntegrityCheck(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp5)).XpBt), _445_aRoot, _445_nRoot, int32(*(*int64)(unsafe.Pointer(&_445_pnErr.Xu)))+int32(1), &_445_nErr)
 52847  	_sqlite3VdbeMemSetNull(tls, _pIn1)
 52848  	if _445_nErr == int32(0) {
 52849  		func() {
 52850  			if _445_z != nil {
 52851  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84059), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69007)))
 52852  				crt.X__builtin_abort(tls)
 52853  			}
 52854  		}()
 52855  		goto _1817
 52856  	}
 52857  	if _445_z == nil {
 52858  		goto _no_mem
 52859  	}
 52860  	*(*int64)(unsafe.Pointer(&_445_pnErr.Xu)) -= int64(_445_nErr - int32(1))
 52861  	_sqlite3VdbeMemSetStr(tls, _pIn1, _445_z, int32(-1), uint8(1), Xsqlite3_free)
 52862  _1817:
 52863  	_sqlite3VdbeChangeEncoding(tls, _pIn1, int32(_encoding))
 52864  	goto _250
 52865  _210:
 52866  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 52867  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 52868  	func() {
 52869  		if (int32(_pIn2.Xflags) & int32(4)) == int32(0) {
 52870  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84083), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65753)))
 52871  			crt.X__builtin_abort(tls)
 52872  		}
 52873  	}()
 52874  	if (int32(_pIn1.Xflags) & int32(32)) != int32(0) {
 52875  		goto _1820
 52876  	}
 52877  	_sqlite3VdbeMemSetRowSet(tls, _pIn1)
 52878  	if (int32(_pIn1.Xflags) & int32(32)) == int32(0) {
 52879  		goto _no_mem
 52880  	}
 52881  _1820:
 52882  	_sqlite3RowSetInsert(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn1.Xu))), *(*int64)(unsafe.Pointer(&_pIn2.Xu)))
 52883  	goto _250
 52884  _211:
 52885  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 52886  	if ((int32(_pIn1.Xflags) & int32(32)) == int32(0)) || (_sqlite3RowSetNext(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn1.Xu))), &_451_val) == int32(0)) {
 52887  		_sqlite3VdbeMemSetNull(tls, _pIn1)
 52888  		goto _jump_to_p2_and_check_for_interrupt
 52889  	}
 52890  	_sqlite3VdbeMemSetInt64(tls, elem25(_aMem, uintptr(_pOp.Xp3)), _451_val)
 52891  	goto _check_for_interrupt
 52892  _212:
 52893  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 52894  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 52895  	_454_iSet = *(*int32)(unsafe.Pointer(&_pOp.Xp4))
 52896  	func() {
 52897  		if (int32(_pIn3.Xflags) & int32(4)) == 0 {
 52898  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84149), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69012)))
 52899  			crt.X__builtin_abort(tls)
 52900  		}
 52901  	}()
 52902  	if (int32(_pIn1.Xflags) & int32(32)) != int32(0) {
 52903  		goto _1827
 52904  	}
 52905  	_sqlite3VdbeMemSetRowSet(tls, _pIn1)
 52906  	if (int32(_pIn1.Xflags) & int32(32)) == int32(0) {
 52907  		goto _no_mem
 52908  	}
 52909  _1827:
 52910  	func() {
 52911  		if int32(_pOp.Xp4type) != int32(-11) {
 52912  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84159), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66283)))
 52913  			crt.X__builtin_abort(tls)
 52914  		}
 52915  	}()
 52916  	func() {
 52917  		if _454_iSet != int32(-1) && _454_iSet < int32(0) {
 52918  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84160), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69032)))
 52919  			crt.X__builtin_abort(tls)
 52920  		}
 52921  	}()
 52922  	if _454_iSet == 0 {
 52923  		goto _1834
 52924  	}
 52925  	_454_exists = _sqlite3RowSetTest(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn1.Xu))), _454_iSet, *(*int64)(unsafe.Pointer(&_pIn3.Xu)))
 52926  	if _454_exists != 0 {
 52927  		goto _jump_to_p2
 52928  	}
 52929  _1834:
 52930  	if _454_iSet >= int32(0) {
 52931  		_sqlite3RowSetInsert(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn1.Xu))), *(*int64)(unsafe.Pointer(&_pIn3.Xu)))
 52932  	}
 52933  	goto _250
 52934  _213:
 52935  	_458_pProgram = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 52936  	_458_pRt = elem25(_aMem, uintptr(_pOp.Xp3))
 52937  	func() {
 52938  		if _458_pProgram.XnOp <= int32(0) {
 52939  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84202), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69052)))
 52940  			crt.X__builtin_abort(tls)
 52941  		}
 52942  	}()
 52943  	if _pOp.Xp5 == 0 {
 52944  		goto _1839
 52945  	}
 52946  	_458_t = _458_pProgram.Xtoken
 52947  	_458_pFrame = (*XVdbeFrame)(_p.XpFrame)
 52948  _1840:
 52949  	if _458_pFrame == nil || _458_pFrame.Xtoken == _458_t {
 52950  		goto _1844
 52951  	}
 52952  	_458_pFrame = (*XVdbeFrame)(_458_pFrame.XpParent)
 52953  	goto _1840
 52954  _1844:
 52955  	if _458_pFrame != nil {
 52956  		goto _250
 52957  	}
 52958  _1839:
 52959  	if _p.XnFrame >= (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(10))) {
 52960  		_rc = int32(1)
 52961  		_sqlite3VdbeError(tls, _p, str(69068))
 52962  		goto _abort_due_to_error
 52963  	}
 52964  	if (int32(_458_pRt.Xflags) & int32(64)) != int32(0) {
 52965  		goto _1847
 52966  	}
 52967  	_458_nMem = _458_pProgram.XnMem + _458_pProgram.XnCsr
 52968  	func() {
 52969  		if _458_nMem <= int32(0) {
 52970  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84238), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69105)))
 52971  			crt.X__builtin_abort(tls)
 52972  		}
 52973  	}()
 52974  	if _458_pProgram.XnCsr == int32(0) {
 52975  		_458_nMem += 1
 52976  	}
 52977  	_458_nByte = int32(((uint64(112) + (uint64(_458_nMem) * uint64(72))) + (uint64(_458_pProgram.XnCsr) * uint64(8))) + uint64((_458_pProgram.XnOp+int32(7))/int32(8)))
 52978  	_458_pFrame = (*XVdbeFrame)(_sqlite3DbMallocZero(tls, _db, uint64(_458_nByte)))
 52979  	if _458_pFrame == nil {
 52980  		goto _no_mem
 52981  	}
 52982  	_sqlite3VdbeMemRelease(tls, _458_pRt)
 52983  	_458_pRt.Xflags = uint16(64)
 52984  	*(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_458_pRt.Xu)))) = _458_pFrame
 52985  	*(**TVdbe)(unsafe.Pointer(&_458_pFrame.Xv)) = _p
 52986  	_458_pFrame.XnChildMem = _458_nMem
 52987  	_458_pFrame.XnChildCsr = _458_pProgram.XnCsr
 52988  	_458_pFrame.Xpc = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))
 52989  	*(**XMem)(unsafe.Pointer(&_458_pFrame.XaMem)) = (*XMem)(_p.XaMem)
 52990  	_458_pFrame.XnMem = _p.XnMem
 52991  	*(***XVdbeCursor)(unsafe.Pointer(&_458_pFrame.XapCsr)) = (**XVdbeCursor)(unsafe.Pointer(_p.XapCsr))
 52992  	_458_pFrame.XnCursor = _p.XnCursor
 52993  	*(**XVdbeOp)(unsafe.Pointer(&_458_pFrame.XaOp)) = (*XVdbeOp)(_p.XaOp)
 52994  	_458_pFrame.XnOp = _p.XnOp
 52995  	_458_pFrame.Xtoken = _458_pProgram.Xtoken
 52996  	_458_pEnd = elem25((*XMem)(unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(_458_pFrame)), uintptr(112)))), uintptr(_458_pFrame.XnChildMem))
 52997  	_458_pMem = (*XMem)(unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(_458_pFrame)), uintptr(112))))
 52998  _1852:
 52999  	if _458_pMem == _458_pEnd {
 53000  		goto _1855
 53001  	}
 53002  	_458_pMem.Xflags = uint16(128)
 53003  	*(**Xsqlite3)(unsafe.Pointer(&_458_pMem.Xdb)) = _db
 53004  	*(*uintptr)(unsafe.Pointer(&_458_pMem)) += uintptr(72)
 53005  	goto _1852
 53006  _1855:
 53007  	goto _1856
 53008  _1847:
 53009  	_458_pFrame = (*XVdbeFrame)(*(*unsafe.Pointer)(unsafe.Pointer(&_458_pRt.Xu)))
 53010  	func() {
 53011  		if (_458_pProgram.XnMem+_458_pProgram.XnCsr) != _458_pFrame.XnChildMem && (_458_pProgram.XnCsr != int32(0) || (_458_pProgram.XnMem+int32(1)) != _458_pFrame.XnChildMem) {
 53012  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84274), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69112)))
 53013  			crt.X__builtin_abort(tls)
 53014  		}
 53015  	}()
 53016  	func() {
 53017  		if _458_pProgram.XnCsr != _458_pFrame.XnChildCsr {
 53018  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84276), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69223)))
 53019  			crt.X__builtin_abort(tls)
 53020  		}
 53021  	}()
 53022  	func() {
 53023  		if int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/32)) != _458_pFrame.Xpc {
 53024  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84277), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69257)))
 53025  			crt.X__builtin_abort(tls)
 53026  		}
 53027  	}()
 53028  _1856:
 53029  	_p.XnFrame += 1
 53030  	*(**XVdbeFrame)(unsafe.Pointer(&_458_pFrame.XpParent)) = (*XVdbeFrame)(_p.XpFrame)
 53031  	_458_pFrame.XlastRowid = _db.XlastRowid
 53032  	_458_pFrame.XnChange = _p.XnChange
 53033  	_458_pFrame.XnDbChange = (*Xsqlite3)(_p.Xdb).XnChange
 53034  	func() {
 53035  		if (*XAuxData)(_458_pFrame.XpAuxData) != nil {
 53036  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84285), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69286)))
 53037  			crt.X__builtin_abort(tls)
 53038  		}
 53039  	}()
 53040  	*(**XAuxData)(unsafe.Pointer(&_458_pFrame.XpAuxData)) = (*XAuxData)(_p.XpAuxData)
 53041  	*(**XAuxData)(unsafe.Pointer(&_p.XpAuxData)) = nil
 53042  	_p.XnChange = int32(0)
 53043  	*(**XVdbeFrame)(unsafe.Pointer(&_p.XpFrame)) = _458_pFrame
 53044  	*(**XMem)(unsafe.Pointer(&_p.XaMem)) = store25(&_aMem, (*XMem)(unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(_458_pFrame)), uintptr(112)))))
 53045  	_p.XnMem = _458_pFrame.XnChildMem
 53046  	_p.XnCursor = int32(uint16(_458_pFrame.XnChildCsr))
 53047  	*(***XVdbeCursor)(unsafe.Pointer(&_p.XapCsr)) = (**XVdbeCursor)(unsafe.Pointer(elem25(_aMem, uintptr(_p.XnMem))))
 53048  	_458_pFrame.XaOnce = (*uint8)(unsafe.Pointer(elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_458_pProgram.XnCsr))))
 53049  	crt.Xmemset(tls, unsafe.Pointer(_458_pFrame.XaOnce), int32(0), uint64((_458_pProgram.XnOp+int32(7))/int32(8)))
 53050  	*(**XVdbeOp)(unsafe.Pointer(&_p.XaOp)) = store63(&_aOp, (*XVdbeOp)(_458_pProgram.XaOp))
 53051  	_p.XnOp = _458_pProgram.XnOp
 53052  	_pOp = elem63(_aOp, uintptr(18446744073709551615))
 53053  	goto _250
 53054  _214:
 53055  	_pOut = _out2Prerelease(tls, _p, _pOp)
 53056  	_465_pFrame = (*XVdbeFrame)(_p.XpFrame)
 53057  	_465_pIn = elem25((*XMem)(_465_pFrame.XaMem), uintptr(_pOp.Xp1+(elem63((*XVdbeOp)(_465_pFrame.XaOp), uintptr(_465_pFrame.Xpc)).Xp1)))
 53058  	_sqlite3VdbeMemShallowCopy(tls, _pOut, _465_pIn, int32(4096))
 53059  	goto _250
 53060  _215:
 53061  	if (_db.Xflags & int32(33554432)) != 0 {
 53062  		_db.XnDeferredImmCons += int64(_pOp.Xp2)
 53063  		goto _1870
 53064  	}
 53065  	if _pOp.Xp1 != 0 {
 53066  		_db.XnDeferredCons += int64(_pOp.Xp2)
 53067  		goto _1870
 53068  	}
 53069  	_p.XnFkConstraint += int64(_pOp.Xp2)
 53070  _1870:
 53071  	goto _250
 53072  _216:
 53073  	if _pOp.Xp1 == 0 {
 53074  		goto _1871
 53075  	}
 53076  	if (_db.XnDeferredCons == (0)) && (_db.XnDeferredImmCons == (0)) {
 53077  		goto _jump_to_p2
 53078  	}
 53079  	goto _1874
 53080  _1871:
 53081  	if (_p.XnFkConstraint == (0)) && (_db.XnDeferredImmCons == (0)) {
 53082  		goto _jump_to_p2
 53083  	}
 53084  _1874:
 53085  	goto _250
 53086  _217:
 53087  	if _p.XpFrame == nil {
 53088  		goto _1877
 53089  	}
 53090  	_473_pFrame = (*XVdbeFrame)(_p.XpFrame)
 53091  _1878:
 53092  	if _473_pFrame.XpParent == nil {
 53093  		goto _1881
 53094  	}
 53095  	_473_pFrame = (*XVdbeFrame)(_473_pFrame.XpParent)
 53096  	goto _1878
 53097  _1881:
 53098  	_pIn1 = elem25((*XMem)(_473_pFrame.XaMem), uintptr(_pOp.Xp1))
 53099  	goto _1882
 53100  _1877:
 53101  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 53102  _1882:
 53103  	func() {
 53104  		if (int32(_pIn1.Xflags) & int32(128)) != int32(0) {
 53105  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84394), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62214)))
 53106  			crt.X__builtin_abort(tls)
 53107  		}
 53108  	}()
 53109  	_sqlite3VdbeMemIntegerify(tls, _pIn1)
 53110  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 53111  	_sqlite3VdbeMemIntegerify(tls, _pIn2)
 53112  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) < (*(*int64)(unsafe.Pointer(&_pIn2.Xu))) {
 53113  		*(*int64)(unsafe.Pointer(&_pIn1.Xu)) = *(*int64)(unsafe.Pointer(&_pIn2.Xu))
 53114  	}
 53115  	goto _250
 53116  _218:
 53117  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 53118  	func() {
 53119  		if (int32(_pIn1.Xflags) & int32(4)) == 0 {
 53120  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84417), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69306)))
 53121  			crt.X__builtin_abort(tls)
 53122  		}
 53123  	}()
 53124  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) > (0) {
 53125  		*(*int64)(unsafe.Pointer(&_pIn1.Xu)) -= int64(_pOp.Xp3)
 53126  		goto _jump_to_p2
 53127  	}
 53128  	goto _250
 53129  _219:
 53130  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 53131  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 53132  	_pOut = _out2Prerelease(tls, _p, _pOp)
 53133  	func() {
 53134  		if (int32(_pIn1.Xflags) & int32(4)) == 0 {
 53135  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84449), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69326)))
 53136  			crt.X__builtin_abort(tls)
 53137  		}
 53138  	}()
 53139  	func() {
 53140  		if (int32(_pIn3.Xflags) & int32(4)) == 0 {
 53141  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84450), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61948)))
 53142  			crt.X__builtin_abort(tls)
 53143  		}
 53144  	}()
 53145  	_479_x = *(*int64)(unsafe.Pointer(&_pIn1.Xu))
 53146  	if (_479_x <= (0)) || _sqlite3AddInt64(tls, &_479_x, func() int64 {
 53147  		if (*(*int64)(unsafe.Pointer(&_pIn3.Xu))) > (0) {
 53148  			return (*(*int64)(unsafe.Pointer(&_pIn3.Xu)))
 53149  		}
 53150  		return (0)
 53151  	}()) != 0 {
 53152  		*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(-1)
 53153  		goto _1897
 53154  	}
 53155  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _479_x
 53156  _1897:
 53157  	goto _250
 53158  _220:
 53159  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 53160  	func() {
 53161  		if (int32(_pIn1.Xflags) & int32(4)) == 0 {
 53162  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84477), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69306)))
 53163  			crt.X__builtin_abort(tls)
 53164  		}
 53165  	}()
 53166  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) == 0 {
 53167  		goto _1900
 53168  	}
 53169  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) > (0) {
 53170  		*(*int64)(unsafe.Pointer(&_pIn1.Xu)) -= 1
 53171  	}
 53172  	goto _jump_to_p2
 53173  _1900:
 53174  	goto _250
 53175  _221:
 53176  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 53177  	func() {
 53178  		if (int32(_pIn1.Xflags) & int32(4)) == 0 {
 53179  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84494), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69306)))
 53180  			crt.X__builtin_abort(tls)
 53181  		}
 53182  	}()
 53183  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) > int64(-9223372036854775808) {
 53184  		*(*int64)(unsafe.Pointer(&_pIn1.Xu)) -= 1
 53185  	}
 53186  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) == (0) {
 53187  		goto _jump_to_p2
 53188  	}
 53189  	goto _250
 53190  _222:
 53191  	func() {
 53192  		if int32(_pOp.Xp4type) != int32(-4) {
 53193  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84534), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62559)))
 53194  			crt.X__builtin_abort(tls)
 53195  		}
 53196  	}()
 53197  	_485_n = int32(_pOp.Xp5)
 53198  	func() {
 53199  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 53200  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84536), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 53201  			crt.X__builtin_abort(tls)
 53202  		}
 53203  	}()
 53204  	func() {
 53205  		if _485_n != int32(0) && (_pOp.Xp2 <= int32(0) || (_pOp.Xp2+_485_n) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1))) {
 53206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84537), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62630)))
 53207  			crt.X__builtin_abort(tls)
 53208  		}
 53209  	}()
 53210  	func() {
 53211  		if _pOp.Xp3 >= _pOp.Xp2 && _pOp.Xp3 < (_pOp.Xp2+_485_n) {
 53212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84538), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62691)))
 53213  			crt.X__builtin_abort(tls)
 53214  		}
 53215  	}()
 53216  	_485_pCtx = (*Xsqlite3_context)(_sqlite3DbMallocRawNN(tls, _db, uint64(56)+(uint64(_485_n-int32(1))*uint64(8))))
 53217  	if _485_pCtx == nil {
 53218  		goto _no_mem
 53219  	}
 53220  	*(**XMem)(unsafe.Pointer(&_485_pCtx.XpMem)) = nil
 53221  	*(**XFuncDef)(unsafe.Pointer(&_485_pCtx.XpFunc)) = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 53222  	_485_pCtx.XiOp = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))
 53223  	*(**TVdbe)(unsafe.Pointer(&_485_pCtx.XpVdbe)) = _p
 53224  	_485_pCtx.Xargc = uint8(_485_n)
 53225  	_pOp.Xp4type = int8(-16)
 53226  	*(**Xsqlite3_context)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))) = _485_pCtx
 53227  	_pOp.Xopcode = uint8(151)
 53228  _223:
 53229  	func() {
 53230  		if int32(_pOp.Xp4type) != int32(-16) {
 53231  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84557), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62729)))
 53232  			crt.X__builtin_abort(tls)
 53233  		}
 53234  	}()
 53235  	_486_pCtx = (*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 53236  	_486_pMem = elem25(_aMem, uintptr(_pOp.Xp3))
 53237  	if (*XMem)(_486_pCtx.XpMem) == _486_pMem {
 53238  		goto _1921
 53239  	}
 53240  	*(**XMem)(unsafe.Pointer(&_486_pCtx.XpMem)) = _486_pMem
 53241  	_486_i = int32(_486_pCtx.Xargc) - int32(1)
 53242  _1922:
 53243  	if _486_i < int32(0) {
 53244  		goto _1925
 53245  	}
 53246  	*elem19((**XMem)(unsafe.Pointer(&_486_pCtx.Xargv)), uintptr(_486_i)) = elem25(_aMem, uintptr(_pOp.Xp2+_486_i))
 53247  	_486_i -= 1
 53248  	goto _1922
 53249  _1925:
 53250  _1921:
 53251  	_486_i = int32(0)
 53252  _1926:
 53253  	if _486_i >= int32(_486_pCtx.Xargc) {
 53254  		goto _1929
 53255  	}
 53256  	func() {
 53257  		if (int32((*elem19((**XMem)(unsafe.Pointer(&_486_pCtx.Xargv)), uintptr(_486_i))).Xflags) & int32(128)) != int32(0) {
 53258  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84572), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62753)))
 53259  			crt.X__builtin_abort(tls)
 53260  		}
 53261  	}()
 53262  	if (_db.Xflags & int32(1)) != 0 {
 53263  		_registerTrace(tls, _pOp.Xp2+_486_i, *elem19((**XMem)(unsafe.Pointer(&_486_pCtx.Xargv)), uintptr(_486_i)))
 53264  	}
 53265  	_486_i += 1
 53266  	goto _1926
 53267  _1929:
 53268  	_486_pMem.Xn += 1
 53269  	_sqlite3VdbeMemInit(tls, &_486_t, _db, uint16(1))
 53270  	*(**XMem)(unsafe.Pointer(&_486_pCtx.XpOut)) = &_486_t
 53271  	_486_pCtx.XfErrorOrAux = 0
 53272  	_486_pCtx.XskipFlag = 0
 53273  	func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) {
 53274  		v := (*XFuncDef)(_486_pCtx.XpFunc).XxSFunc
 53275  		return *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&v))
 53276  	}()(tls, _486_pCtx, int32(_486_pCtx.Xargc), (**XMem)(unsafe.Pointer(&_486_pCtx.Xargv)))
 53277  	if _486_pCtx.XfErrorOrAux == 0 {
 53278  		goto _1933
 53279  	}
 53280  	if _486_pCtx.XisError != 0 {
 53281  		_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(Xsqlite3_value_text(tls, &_486_t)))
 53282  		_rc = _486_pCtx.XisError
 53283  	}
 53284  	_sqlite3VdbeMemRelease(tls, &_486_t)
 53285  	if _rc != 0 {
 53286  		goto _abort_due_to_error
 53287  	}
 53288  	goto _1936
 53289  _1933:
 53290  	func() {
 53291  		if int32(_486_t.Xflags) != int32(1) {
 53292  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84591), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69348)))
 53293  			crt.X__builtin_abort(tls)
 53294  		}
 53295  	}()
 53296  _1936:
 53297  	if _486_pCtx.XskipFlag == 0 {
 53298  		goto _1939
 53299  	}
 53300  	func() {
 53301  		if int32(elem63(_pOp, uintptr(18446744073709551615)).Xopcode) != int32(68) {
 53302  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84594), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69366)))
 53303  			crt.X__builtin_abort(tls)
 53304  		}
 53305  	}()
 53306  	_486_i = elem63(_pOp, uintptr(18446744073709551615)).Xp1
 53307  	if _486_i != 0 {
 53308  		_sqlite3VdbeMemSetInt64(tls, elem25(_aMem, uintptr(_486_i)), int64(1))
 53309  	}
 53310  _1939:
 53311  	goto _250
 53312  _224:
 53313  	func() {
 53314  		if _pOp.Xp1 <= int32(0) || _pOp.Xp1 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 53315  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84616), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61291)))
 53316  			crt.X__builtin_abort(tls)
 53317  		}
 53318  	}()
 53319  	_493_pMem = elem25(_aMem, uintptr(_pOp.Xp1))
 53320  	func() {
 53321  		if (int32(_493_pMem.Xflags) & int32(-8194)) != int32(0) {
 53322  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84618), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69393)))
 53323  			crt.X__builtin_abort(tls)
 53324  		}
 53325  	}()
 53326  	_rc = _sqlite3VdbeMemFinalize(tls, _493_pMem, (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))))
 53327  	if _rc != 0 {
 53328  		_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(Xsqlite3_value_text(tls, _493_pMem)))
 53329  		goto _abort_due_to_error
 53330  	}
 53331  	_sqlite3VdbeChangeEncoding(tls, _493_pMem, int32(_encoding))
 53332  	if _sqlite3VdbeMemTooBig(tls, _493_pMem) != 0 {
 53333  		goto _too_big
 53334  	}
 53335  	goto _250
 53336  _225:
 53337  	func() {
 53338  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84649), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53340  			crt.X__builtin_abort(tls)
 53341  		}
 53342  	}()
 53343  	*elem8((*int32)(unsafe.Pointer(&_496_aRes)), 0) = int32(0)
 53344  	*elem8((*int32)(unsafe.Pointer(&_496_aRes)), uintptr(1)) = store2(elem8((*int32)(unsafe.Pointer(&_496_aRes)), uintptr(2)), int32(-1))
 53345  	func() {
 53346  		if _pOp.Xp2 != int32(0) && _pOp.Xp2 != int32(1) && _pOp.Xp2 != int32(2) && _pOp.Xp2 != int32(3) {
 53347  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84652), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69432)))
 53348  			crt.X__builtin_abort(tls)
 53349  		}
 53350  	}()
 53351  	_rc = _sqlite3Checkpoint(tls, _db, _pOp.Xp1, _pOp.Xp2, elem8((*int32)(unsafe.Pointer(&_496_aRes)), uintptr(1)), elem8((*int32)(unsafe.Pointer(&_496_aRes)), uintptr(2)))
 53352  	if _rc == 0 {
 53353  		goto _1957
 53354  	}
 53355  	if _rc != int32(5) {
 53356  		goto _abort_due_to_error
 53357  	}
 53358  	_rc = int32(0)
 53359  	*elem8((*int32)(unsafe.Pointer(&_496_aRes)), 0) = int32(1)
 53360  _1957:
 53361  	*func() **XMem { _496_i = int32(0); return &_496_pMem }() = elem25(_aMem, uintptr(_pOp.Xp3))
 53362  _1959:
 53363  	if _496_i >= int32(3) {
 53364  		goto _1962
 53365  	}
 53366  	_sqlite3VdbeMemSetInt64(tls, _496_pMem, int64(*elem8((*int32)(unsafe.Pointer(&_496_aRes)), uintptr(_496_i))))
 53367  	*(*uintptr)(unsafe.Pointer(func() **XMem { _496_i += 1; return &_496_pMem }())) += uintptr(72)
 53368  	goto _1959
 53369  _1962:
 53370  	goto _250
 53371  _226:
 53372  	_pOut = _out2Prerelease(tls, _p, _pOp)
 53373  	_499_eNew = _pOp.Xp3
 53374  	func() {
 53375  		if _499_eNew != int32(0) && _499_eNew != int32(3) && _499_eNew != int32(1) && _499_eNew != int32(2) && _499_eNew != int32(4) && _499_eNew != int32(5) && _499_eNew != int32(-1) {
 53376  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84693), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69579)))
 53377  			crt.X__builtin_abort(tls)
 53378  		}
 53379  	}()
 53380  	func() {
 53381  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 53382  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84701), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 53383  			crt.X__builtin_abort(tls)
 53384  		}
 53385  	}()
 53386  	func() {
 53387  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53388  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84702), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53389  			crt.X__builtin_abort(tls)
 53390  		}
 53391  	}()
 53392  	_499_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpBt)
 53393  	_499_pPager = _sqlite3BtreePager(tls, _499_pBt)
 53394  	_499_eOld = _sqlite3PagerGetJournalMode(tls, _499_pPager)
 53395  	if _499_eNew == int32(-1) {
 53396  		_499_eNew = _499_eOld
 53397  	}
 53398  	if _sqlite3PagerOkToChangeJournalMode(tls, _499_pPager) == 0 {
 53399  		_499_eNew = _499_eOld
 53400  	}
 53401  	_499_zFilename = _sqlite3PagerFilename(tls, _499_pPager, int32(1))
 53402  	if (_499_eNew == int32(5)) && ((_sqlite3Strlen30(tls, _499_zFilename) == int32(0)) || (_sqlite3PagerWalSupported(tls, _499_pPager) == 0)) {
 53403  		_499_eNew = _499_eOld
 53404  	}
 53405  	if _499_eNew == _499_eOld || _499_eOld != int32(5) && _499_eNew != int32(5) {
 53406  		goto _1983
 53407  	}
 53408  	if (_db.XautoCommit == 0) || (_db.XnVdbeRead > int32(1)) {
 53409  		_rc = int32(1)
 53410  		_sqlite3VdbeError(tls, _p, str(69810), unsafe.Pointer(func() *int8 {
 53411  			if _499_eNew == int32(5) {
 53412  				return str(69862)
 53413  			}
 53414  			return str(69867)
 53415  		}()))
 53416  		goto _abort_due_to_error
 53417  	}
 53418  	if _499_eOld != int32(5) {
 53419  		goto _1989
 53420  	}
 53421  	_rc = _sqlite3PagerCloseWal(tls, _499_pPager, _db)
 53422  	if _rc == int32(0) {
 53423  		_sqlite3PagerSetJournalMode(tls, _499_pPager, _499_eNew)
 53424  	}
 53425  	goto _1992
 53426  _1989:
 53427  	if _499_eOld == int32(4) {
 53428  		_sqlite3PagerSetJournalMode(tls, _499_pPager, int32(2))
 53429  	}
 53430  _1992:
 53431  	func() {
 53432  		if _sqlite3BtreeIsInTrans(tls, _499_pBt) != int32(0) {
 53433  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84754), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69874)))
 53434  			crt.X__builtin_abort(tls)
 53435  		}
 53436  	}()
 53437  	if _rc == int32(0) {
 53438  		_rc = _sqlite3BtreeSetVersion(tls, _499_pBt, func() int32 {
 53439  			if _499_eNew == int32(5) {
 53440  				return int32(2)
 53441  			}
 53442  			return int32(1)
 53443  		}())
 53444  	}
 53445  _1983:
 53446  	if _rc != 0 {
 53447  		_499_eNew = _499_eOld
 53448  	}
 53449  	_499_eNew = _sqlite3PagerSetJournalMode(tls, _499_pPager, _499_eNew)
 53450  	_pOut.Xflags = uint16(2562)
 53451  	_pOut.Xz = _sqlite3JournalModename(tls, _499_eNew)
 53452  	_pOut.Xn = _sqlite3Strlen30(tls, _pOut.Xz)
 53453  	_pOut.Xenc = uint8(1)
 53454  	_sqlite3VdbeChangeEncoding(tls, _pOut, int32(_encoding))
 53455  	if _rc != 0 {
 53456  		goto _abort_due_to_error
 53457  	}
 53458  	goto _250
 53459  _227:
 53460  	func() {
 53461  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53462  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84782), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53463  			crt.X__builtin_abort(tls)
 53464  		}
 53465  	}()
 53466  	_rc = _sqlite3RunVacuum(tls, &_p.XzErrMsg, _db, _pOp.Xp1)
 53467  	if _rc != 0 {
 53468  		goto _abort_due_to_error
 53469  	}
 53470  	goto _250
 53471  _228:
 53472  	func() {
 53473  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 53474  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84799), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 53475  			crt.X__builtin_abort(tls)
 53476  		}
 53477  	}()
 53478  	func() {
 53479  		if (_p.XbtreeMask & (uint32(1) << uint(_pOp.Xp1))) == (0) {
 53480  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84800), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65170)))
 53481  			crt.X__builtin_abort(tls)
 53482  		}
 53483  	}()
 53484  	func() {
 53485  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53486  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84801), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53487  			crt.X__builtin_abort(tls)
 53488  		}
 53489  	}()
 53490  	_509_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpBt)
 53491  	_rc = _sqlite3BtreeIncrVacuum(tls, _509_pBt)
 53492  	if _rc == 0 {
 53493  		goto _2010
 53494  	}
 53495  	if _rc != int32(101) {
 53496  		goto _abort_due_to_error
 53497  	}
 53498  	_rc = int32(0)
 53499  	goto _jump_to_p2
 53500  _2010:
 53501  	goto _250
 53502  _229:
 53503  	if _pOp.Xp1 == 0 {
 53504  		_sqlite3ExpirePreparedStatements(tls, _db)
 53505  		goto _2013
 53506  	}
 53507  	storebits26(&_p.Xexpired, int16(1), 1, 0)
 53508  _2013:
 53509  	goto _250
 53510  _230:
 53511  	_514_isWriteLock = uint8(_pOp.Xp3)
 53512  	if _514_isWriteLock == 0 && int32(0) != (_db.Xflags&int32(16384)) {
 53513  		goto _2015
 53514  	}
 53515  	_515_p1 = _pOp.Xp1
 53516  	func() {
 53517  		if _515_p1 < int32(0) || _515_p1 >= _db.XnDb {
 53518  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84853), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69904)))
 53519  			crt.X__builtin_abort(tls)
 53520  		}
 53521  	}()
 53522  	func() {
 53523  		if (_p.XbtreeMask & (uint32(1) << uint(_515_p1))) == (0) {
 53524  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84854), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69924)))
 53525  			crt.X__builtin_abort(tls)
 53526  		}
 53527  	}()
 53528  	func() {
 53529  		if int32(_514_isWriteLock) != int32(0) && int32(_514_isWriteLock) != int32(1) {
 53530  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84855), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69953)))
 53531  			crt.X__builtin_abort(tls)
 53532  		}
 53533  	}()
 53534  	_rc = _sqlite3BtreeLockTable(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_515_p1)).XpBt), _pOp.Xp2, _514_isWriteLock)
 53535  	if _rc == 0 {
 53536  		goto _2024
 53537  	}
 53538  	if (_rc & int32(255)) == int32(6) {
 53539  		_517_z = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 53540  		_sqlite3VdbeError(tls, _p, str(69986), unsafe.Pointer(_517_z))
 53541  	}
 53542  	goto _abort_due_to_error
 53543  _2024:
 53544  _2015:
 53545  	goto _250
 53546  _231:
 53547  	_518_pVTab = (*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 53548  	_rc = _sqlite3VtabBegin(tls, _db, _518_pVTab)
 53549  	if _518_pVTab != nil {
 53550  		_sqlite3VtabImportErrmsg(tls, _p, (*Xsqlite3_vtab)(_518_pVTab.XpVtab))
 53551  	}
 53552  	if _rc != 0 {
 53553  		goto _abort_due_to_error
 53554  	}
 53555  	goto _250
 53556  _232:
 53557  	crt.Xmemset(tls, unsafe.Pointer(&_519_sMem), int32(0), uint64(72))
 53558  	*(**Xsqlite3)(unsafe.Pointer(&_519_sMem.Xdb)) = _db
 53559  	func() {
 53560  		if (int32(elem25(_aMem, uintptr(_pOp.Xp2)).Xflags) & int32(2)) == int32(0) {
 53561  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84903), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70015)))
 53562  			crt.X__builtin_abort(tls)
 53563  		}
 53564  	}()
 53565  	func() {
 53566  		if (int32(elem25(_aMem, uintptr(_pOp.Xp2)).Xflags) & int32(2048)) == int32(0) {
 53567  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84904), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70050)))
 53568  			crt.X__builtin_abort(tls)
 53569  		}
 53570  	}()
 53571  	_rc = _sqlite3VdbeMemCopy(tls, &_519_sMem, elem25(_aMem, uintptr(_pOp.Xp2)))
 53572  	func() {
 53573  		if _rc != int32(0) {
 53574  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84906), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 53575  			crt.X__builtin_abort(tls)
 53576  		}
 53577  	}()
 53578  	_519_zTab = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, &_519_sMem)))
 53579  	func() {
 53580  		if _519_zTab == nil && _db.XmallocFailed == 0 {
 53581  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84908), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70088)))
 53582  			crt.X__builtin_abort(tls)
 53583  		}
 53584  	}()
 53585  	if _519_zTab != nil {
 53586  		_rc = _sqlite3VtabCallCreate(tls, _db, _pOp.Xp1, _519_zTab, &_p.XzErrMsg)
 53587  	}
 53588  	_sqlite3VdbeMemRelease(tls, &_519_sMem)
 53589  	if _rc != 0 {
 53590  		goto _abort_due_to_error
 53591  	}
 53592  	goto _250
 53593  _233:
 53594  	_db.XnVDestroy += 1
 53595  	_rc = _sqlite3VtabCallDestroy(tls, _db, _pOp.Xp1, *(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 53596  	_db.XnVDestroy -= 1
 53597  	if _rc != 0 {
 53598  		goto _abort_due_to_error
 53599  	}
 53600  	goto _250
 53601  _234:
 53602  	func() {
 53603  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 53604  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84946), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 53605  			crt.X__builtin_abort(tls)
 53606  		}
 53607  	}()
 53608  	_522_pCur = nil
 53609  	_522_pVCur = nil
 53610  	_522_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XpVtab)
 53611  	if (_522_pVtab == nil) || func() int32 {
 53612  		if (*Xsqlite3_module)(_522_pVtab.XpModule) == nil {
 53613  			return func() int32 {
 53614  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84950), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(4809)))
 53615  				crt.X__builtin_abort(tls)
 53616  				return int32(1)
 53617  			}()
 53618  		}
 53619  		return int32(0)
 53620  	}() != 0 {
 53621  		_rc = int32(6)
 53622  		goto _abort_due_to_error
 53623  	}
 53624  	_522_pModule = (*Xsqlite3_module)(_522_pVtab.XpModule)
 53625  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_vtab_cursor) int32 {
 53626  		v := _522_pModule.XxOpen
 53627  		return *(*func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 53628  	}()(tls, _522_pVtab, &_522_pVCur)
 53629  	_sqlite3VtabImportErrmsg(tls, _p, _522_pVtab)
 53630  	if _rc != 0 {
 53631  		goto _abort_due_to_error
 53632  	}
 53633  	*(**Xsqlite3_vtab)(unsafe.Pointer(&_522_pVCur.XpVtab)) = _522_pVtab
 53634  	_522_pCur = _allocateCursor(tls, _p, _pOp.Xp1, int32(0), int32(-1), uint8(2))
 53635  	if _522_pCur != nil {
 53636  		*(**Xsqlite3_vtab_cursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_522_pCur.Xuc)))) = _522_pVCur
 53637  		_522_pVtab.XnRef += 1
 53638  		goto _2048
 53639  	}
 53640  	func() {
 53641  		if _db.XmallocFailed == 0 {
 53642  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84968), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(47803)))
 53643  			crt.X__builtin_abort(tls)
 53644  		}
 53645  	}()
 53646  	func() func(*crt.TLS, *Xsqlite3_vtab_cursor) int32 {
 53647  		v := _522_pModule.XxClose
 53648  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 53649  	}()(tls, _522_pVCur)
 53650  	goto _no_mem
 53651  _2048:
 53652  	goto _250
 53653  _235:
 53654  	_526_pQuery = elem25(_aMem, uintptr(_pOp.Xp3))
 53655  	_526_pArgc = elem25(_526_pQuery, uintptr(1))
 53656  	_526_pCur = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 53657  	func() {
 53658  		if (int32(_526_pQuery.Xflags) & int32(128)) != int32(0) {
 53659  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85012), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70113)))
 53660  			crt.X__builtin_abort(tls)
 53661  		}
 53662  	}()
 53663  	if (_db.Xflags & int32(1)) != 0 {
 53664  		_registerTrace(tls, _pOp.Xp3, _526_pQuery)
 53665  	}
 53666  	func() {
 53667  		if int32(_526_pCur.XeCurType) != int32(2) {
 53668  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85014), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70132)))
 53669  			crt.X__builtin_abort(tls)
 53670  		}
 53671  	}()
 53672  	_526_pVCur = (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_526_pCur.Xuc)))
 53673  	_526_pVtab = (*Xsqlite3_vtab)(_526_pVCur.XpVtab)
 53674  	_526_pModule = (*Xsqlite3_module)(_526_pVtab.XpModule)
 53675  	func() {
 53676  		if (int32(_526_pQuery.Xflags)&int32(4)) == int32(0) || int32(_526_pArgc.Xflags) != int32(4) {
 53677  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85020), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70161)))
 53678  			crt.X__builtin_abort(tls)
 53679  		}
 53680  	}()
 53681  	_526_nArg = int32(*(*int64)(unsafe.Pointer(&_526_pArgc.Xu)))
 53682  	_526_iQuery = int32(*(*int64)(unsafe.Pointer(&_526_pQuery.Xu)))
 53683  	_526_res = int32(0)
 53684  	_526_apArg = (**XMem)(unsafe.Pointer(_p.XapArg))
 53685  	_526_i = int32(0)
 53686  _2059:
 53687  	if _526_i >= _526_nArg {
 53688  		goto _2062
 53689  	}
 53690  	*elem19(_526_apArg, uintptr(_526_i)) = elem25(_526_pArgc, uintptr(_526_i+int32(1)))
 53691  	_526_i += 1
 53692  	goto _2059
 53693  _2062:
 53694  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab_cursor, int32, *int8, int32, **XMem) int32 {
 53695  		v := _526_pModule.XxFilter
 53696  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor, int32, *int8, int32, **XMem) int32)(unsafe.Pointer(&v))
 53697  	}()(tls, _526_pVCur, _526_iQuery, *(**int8)(unsafe.Pointer(&_pOp.Xp4)), _526_nArg, _526_apArg)
 53698  	_sqlite3VtabImportErrmsg(tls, _p, _526_pVtab)
 53699  	if _rc != 0 {
 53700  		goto _abort_due_to_error
 53701  	}
 53702  	_526_res = func() func(*crt.TLS, *Xsqlite3_vtab_cursor) int32 {
 53703  		v := _526_pModule.XxEof
 53704  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 53705  	}()(tls, _526_pVCur)
 53706  	_526_pCur.XnullRow = 0
 53707  	if _526_res != 0 {
 53708  		goto _jump_to_p2
 53709  	}
 53710  	goto _250
 53711  _236:
 53712  	_528_pCur = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 53713  	func() {
 53714  		if int32(_528_pCur.XeCurType) != int32(2) {
 53715  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85056), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70132)))
 53716  			crt.X__builtin_abort(tls)
 53717  		}
 53718  	}()
 53719  	func() {
 53720  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 53721  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85057), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 53722  			crt.X__builtin_abort(tls)
 53723  		}
 53724  	}()
 53725  	_528_pDest = elem25(_aMem, uintptr(_pOp.Xp3))
 53726  	_sqlite3VdbeMemAboutToChange(tls, _p, _528_pDest)
 53727  	if _528_pCur.XnullRow != 0 {
 53728  		_sqlite3VdbeMemSetNull(tls, _528_pDest)
 53729  		goto _250
 53730  	}
 53731  	_528_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_528_pCur.Xuc))).XpVtab)
 53732  	_528_pModule = (*Xsqlite3_module)(_528_pVtab.XpModule)
 53733  	func() {
 53734  		if _528_pModule.XxColumn == nil {
 53735  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85066), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70213)))
 53736  			crt.X__builtin_abort(tls)
 53737  		}
 53738  	}()
 53739  	crt.Xmemset(tls, unsafe.Pointer(&_528_sContext), int32(0), uint64(56))
 53740  	*(**XMem)(unsafe.Pointer(&_528_sContext.XpOut)) = _528_pDest
 53741  	_528_pDest.Xflags = uint16((int32(_528_pDest.Xflags) & int32(-49664)) | int32(1))
 53742  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab_cursor, *Xsqlite3_context, int32) int32 {
 53743  		v := _528_pModule.XxColumn
 53744  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor, *Xsqlite3_context, int32) int32)(unsafe.Pointer(&v))
 53745  	}()(tls, (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_528_pCur.Xuc))), &_528_sContext, _pOp.Xp2)
 53746  	_sqlite3VtabImportErrmsg(tls, _p, _528_pVtab)
 53747  	if _528_sContext.XisError != 0 {
 53748  		_rc = _528_sContext.XisError
 53749  	}
 53750  	_sqlite3VdbeChangeEncoding(tls, _528_pDest, int32(_encoding))
 53751  	if (_db.Xflags & int32(1)) != 0 {
 53752  		_registerTrace(tls, _pOp.Xp3, _528_pDest)
 53753  	}
 53754  	if _sqlite3VdbeMemTooBig(tls, _528_pDest) != 0 {
 53755  		goto _too_big
 53756  	}
 53757  	if _rc != 0 {
 53758  		goto _abort_due_to_error
 53759  	}
 53760  	goto _250
 53761  _237:
 53762  	_532_res = int32(0)
 53763  	_532_pCur = *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 53764  	func() {
 53765  		if int32(_532_pCur.XeCurType) != int32(2) {
 53766  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85102), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70132)))
 53767  			crt.X__builtin_abort(tls)
 53768  		}
 53769  	}()
 53770  	if _532_pCur.XnullRow != 0 {
 53771  		goto _250
 53772  	}
 53773  	_532_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_532_pCur.Xuc))).XpVtab)
 53774  	_532_pModule = (*Xsqlite3_module)(_532_pVtab.XpModule)
 53775  	func() {
 53776  		if _532_pModule.XxNext == nil {
 53777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85108), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70230)))
 53778  			crt.X__builtin_abort(tls)
 53779  		}
 53780  	}()
 53781  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab_cursor) int32 {
 53782  		v := _532_pModule.XxNext
 53783  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 53784  	}()(tls, (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_532_pCur.Xuc))))
 53785  	_sqlite3VtabImportErrmsg(tls, _p, _532_pVtab)
 53786  	if _rc != 0 {
 53787  		goto _abort_due_to_error
 53788  	}
 53789  	_532_res = func() func(*crt.TLS, *Xsqlite3_vtab_cursor) int32 {
 53790  		v := _532_pModule.XxEof
 53791  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 53792  	}()(tls, (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_532_pCur.Xuc))))
 53793  	if _532_res == 0 {
 53794  		goto _jump_to_p2_and_check_for_interrupt
 53795  	}
 53796  	goto _check_for_interrupt
 53797  _238:
 53798  	_535_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XpVtab)
 53799  	_535_pName = elem25(_aMem, uintptr(_pOp.Xp1))
 53800  	func() {
 53801  		if ((*Xsqlite3_module)(_535_pVtab.XpModule).XxRename) == nil {
 53802  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85142), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70245)))
 53803  			crt.X__builtin_abort(tls)
 53804  		}
 53805  	}()
 53806  	func() {
 53807  		if (int32(_535_pName.Xflags) & int32(128)) != int32(0) {
 53808  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85143), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70269)))
 53809  			crt.X__builtin_abort(tls)
 53810  		}
 53811  	}()
 53812  	func() {
 53813  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53814  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85144), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53815  			crt.X__builtin_abort(tls)
 53816  		}
 53817  	}()
 53818  	if (_db.Xflags & int32(1)) != 0 {
 53819  		_registerTrace(tls, _pOp.Xp1, _535_pName)
 53820  	}
 53821  	func() {
 53822  		if (int32(_535_pName.Xflags) & int32(2)) == 0 {
 53823  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85146), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70287)))
 53824  			crt.X__builtin_abort(tls)
 53825  		}
 53826  	}()
 53827  	_rc = _sqlite3VdbeChangeEncoding(tls, _535_pName, int32(1))
 53828  	if _rc != 0 {
 53829  		goto _abort_due_to_error
 53830  	}
 53831  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab, *int8) int32 {
 53832  		v := (*Xsqlite3_module)(_535_pVtab.XpModule).XxRename
 53833  		return *(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&v))
 53834  	}()(tls, _535_pVtab, _535_pName.Xz)
 53835  	_sqlite3VtabImportErrmsg(tls, _p, _535_pVtab)
 53836  	storebits26(&_p.Xexpired, 0, 1, 0)
 53837  	if _rc != 0 {
 53838  		goto _abort_due_to_error
 53839  	}
 53840  	goto _250
 53841  _239:
 53842  	func() {
 53843  		if _pOp.Xp2 != int32(1) && int32(_pOp.Xp5) != int32(3) && int32(_pOp.Xp5) != int32(1) && int32(_pOp.Xp5) != int32(2) && int32(_pOp.Xp5) != int32(4) && int32(_pOp.Xp5) != int32(5) {
 53844  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85197), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70310)))
 53845  			crt.X__builtin_abort(tls)
 53846  		}
 53847  	}()
 53848  	func() {
 53849  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53850  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85200), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53851  			crt.X__builtin_abort(tls)
 53852  		}
 53853  	}()
 53854  	_536_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XpVtab)
 53855  	if (_536_pVtab == nil) || func() int32 {
 53856  		if (*Xsqlite3_module)(_536_pVtab.XpModule) == nil {
 53857  			return func() int32 {
 53858  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85202), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(4809)))
 53859  				crt.X__builtin_abort(tls)
 53860  				return int32(1)
 53861  			}()
 53862  		}
 53863  		return int32(0)
 53864  	}() != 0 {
 53865  		_rc = int32(6)
 53866  		goto _abort_due_to_error
 53867  	}
 53868  	_536_pModule = (*Xsqlite3_module)(_536_pVtab.XpModule)
 53869  	_536_nArg = _pOp.Xp2
 53870  	func() {
 53871  		if int32(_pOp.Xp4type) != int32(-8) {
 53872  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85208), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70431)))
 53873  			crt.X__builtin_abort(tls)
 53874  		}
 53875  	}()
 53876  	if func() int32 {
 53877  		if _536_pModule.XxUpdate != nil {
 53878  			return int32(1)
 53879  		}
 53880  		return func() int32 {
 53881  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85209), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(4809)))
 53882  			crt.X__builtin_abort(tls)
 53883  			return int32(0)
 53884  		}()
 53885  	}() == 0 {
 53886  		goto _2112
 53887  	}
 53888  	_538_vtabOnConflict = _db.XvtabOnConflict
 53889  	_536_apArg = (**XMem)(unsafe.Pointer(_p.XapArg))
 53890  	_536_pX = elem25(_aMem, uintptr(_pOp.Xp3))
 53891  	_536_i = int32(0)
 53892  _2113:
 53893  	if _536_i >= _536_nArg {
 53894  		goto _2116
 53895  	}
 53896  	func() {
 53897  		if (int32(_536_pX.Xflags) & int32(128)) != int32(0) {
 53898  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85214), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70452)))
 53899  			crt.X__builtin_abort(tls)
 53900  		}
 53901  	}()
 53902  	_sqlite3VdbeMemAboutToChange(tls, _p, _536_pX)
 53903  	*elem19(_536_apArg, uintptr(_536_i)) = _536_pX
 53904  	*(*uintptr)(unsafe.Pointer(&_536_pX)) += uintptr(72)
 53905  	_536_i += 1
 53906  	goto _2113
 53907  _2116:
 53908  	_db.XvtabOnConflict = uint8(_pOp.Xp5)
 53909  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 {
 53910  		v := _536_pModule.XxUpdate
 53911  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&v))
 53912  	}()(tls, _536_pVtab, _536_nArg, _536_apArg, &_536_rowid)
 53913  	_db.XvtabOnConflict = _538_vtabOnConflict
 53914  	_sqlite3VtabImportErrmsg(tls, _p, _536_pVtab)
 53915  	if (_rc == int32(0)) && _pOp.Xp1 != 0 {
 53916  		func() {
 53917  			if _536_nArg <= int32(1) || (*elem19(_536_apArg, 0)) == nil || (int32((*elem19(_536_apArg, 0)).Xflags)&int32(1)) == 0 {
 53918  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85224), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70467)))
 53919  				crt.X__builtin_abort(tls)
 53920  			}
 53921  		}()
 53922  		_db.XlastRowid = _536_rowid
 53923  	}
 53924  	if (_rc&int32(255)) != int32(19) || ((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XbConstraint) == 0 {
 53925  		goto _2126
 53926  	}
 53927  	if int32(_pOp.Xp5) == int32(4) {
 53928  		_rc = int32(0)
 53929  		goto _2128
 53930  	}
 53931  	_p.XerrorAction = uint8(func() int32 {
 53932  		if int32(_pOp.Xp5) == int32(5) {
 53933  			return int32(2)
 53934  		}
 53935  		return int32(_pOp.Xp5)
 53936  	}())
 53937  _2128:
 53938  	goto _2131
 53939  _2126:
 53940  	_p.XnChange += 1
 53941  _2131:
 53942  	if _rc != 0 {
 53943  		goto _abort_due_to_error
 53944  	}
 53945  _2112:
 53946  	goto _250
 53947  _240:
 53948  	_pOut = _out2Prerelease(tls, _p, _pOp)
 53949  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_sqlite3BtreeLastPage(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpBt)))
 53950  	goto _250
 53951  _241:
 53952  	_pOut = _out2Prerelease(tls, _p, _pOp)
 53953  	_546_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpBt)
 53954  	_546_newMax = 0
 53955  	if _pOp.Xp3 == 0 {
 53956  		goto _2133
 53957  	}
 53958  	_546_newMax = _sqlite3BtreeLastPage(tls, _546_pBt)
 53959  	if _546_newMax < uint32(_pOp.Xp3) {
 53960  		_546_newMax = uint32(_pOp.Xp3)
 53961  	}
 53962  _2133:
 53963  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_sqlite3BtreeMaxPageCount(tls, _546_pBt, int32(_546_newMax)))
 53964  	goto _250
 53965  _242:
 53966  	func() {
 53967  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != nil && crt.Xstrncmp(tls, *(**int8)(unsafe.Pointer(&_pOp.Xp4)), str(70516), uint64(3)) != int32(0) {
 53968  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85309), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70520)))
 53969  			crt.X__builtin_abort(tls)
 53970  		}
 53971  	}()
 53972  	func() {
 53973  		if _pOp != (*XVdbeOp)(_p.XaOp) {
 53974  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85310), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70571)))
 53975  			crt.X__builtin_abort(tls)
 53976  		}
 53977  	}()
 53978  	if (int32(_db.XmTrace)&int32(129)) == int32(0) || ((uint32(_p.Xexpired>>1)<<31)>>31) != 0 || store1(&_548_zTrace, func() *int8 {
 53979  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != nil {
 53980  			return (*(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 53981  		}
 53982  		return _p.XzSql
 53983  	}()) == nil {
 53984  		goto _2144
 53985  	}
 53986  	if (int32(_db.XmTrace) & int32(128)) != 0 {
 53987  		_550_x = func() func(*crt.TLS, unsafe.Pointer, *int8) {
 53988  			v := _db.XxTrace
 53989  			return *(*func(*crt.TLS, unsafe.Pointer, *int8))(unsafe.Pointer(&v))
 53990  		}()
 53991  		_550_z = _sqlite3VdbeExpandSql(tls, _p, _548_zTrace)
 53992  		_550_x(tls, _db.XpTraceArg, _550_z)
 53993  		Xsqlite3_free(tls, unsafe.Pointer(_550_z))
 53994  		goto _2148
 53995  	}
 53996  	if _db.XnVdbeExec > int32(1) {
 53997  		_551_z = _sqlite3MPrintf(tls, _db, str(70583), unsafe.Pointer(_548_zTrace))
 53998  		_db.XxTrace(tls, uint32(1), _db.XpTraceArg, unsafe.Pointer(_p), unsafe.Pointer(_551_z))
 53999  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_551_z))
 54000  		goto _2148
 54001  	}
 54002  	_db.XxTrace(tls, uint32(1), _db.XpTraceArg, unsafe.Pointer(_p), unsafe.Pointer(_548_zTrace))
 54003  _2148:
 54004  _2144:
 54005  	if ((_db.Xflags & int32(512)) != int32(0)) && (store1(&_548_zTrace, func() *int8 {
 54006  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != nil {
 54007  			return (*(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 54008  		}
 54009  		return _p.XzSql
 54010  	}()) != nil) {
 54011  		_sqlite3DebugPrintf(tls, str(70589), unsafe.Pointer(_548_zTrace))
 54012  	}
 54013  	func() {
 54014  		if _pOp.Xp2 <= int32(0) {
 54015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85351), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61037)))
 54016  			crt.X__builtin_abort(tls)
 54017  		}
 54018  	}()
 54019  	if _pOp.Xp1 < _sqlite3Config.XiOnceResetThreshold {
 54020  		goto _2155
 54021  	}
 54022  	_548_i = int32(1)
 54023  _2156:
 54024  	if _548_i >= _p.XnOp {
 54025  		goto _2159
 54026  	}
 54027  	if int32(elem63((*XVdbeOp)(_p.XaOp), uintptr(_548_i)).Xopcode) == int32(20) {
 54028  		elem63((*XVdbeOp)(_p.XaOp), uintptr(_548_i)).Xp1 = int32(0)
 54029  	}
 54030  	_548_i += 1
 54031  	goto _2156
 54032  _2159:
 54033  	_pOp.Xp1 = int32(0)
 54034  _2155:
 54035  	_pOp.Xp1 += 1
 54036  	goto _jump_to_p2
 54037  _243:
 54038  	func() {
 54039  		if int32(_pOp.Xopcode) != int32(164) && int32(_pOp.Xopcode) != int32(165) {
 54040  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85397), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70604)))
 54041  			crt.X__builtin_abort(tls)
 54042  		}
 54043  	}()
 54044  	goto _250
 54045  _250:
 54046  	func() {
 54047  		if crt.P2U(unsafe.Pointer(_pOp)) < crt.P2U(unsafe.Pointer(elem63(_aOp, uintptr(18446744073709551615)))) || crt.P2U(unsafe.Pointer(_pOp)) >= crt.P2U(unsafe.Pointer(elem63(_aOp, uintptr(_p.XnOp-int32(1))))) {
 54048  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85423), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70652)))
 54049  			crt.X__builtin_abort(tls)
 54050  		}
 54051  	}()
 54052  	if (_db.Xflags & int32(1)) == 0 {
 54053  		goto _2167
 54054  	}
 54055  	_557_opProperty = *elem15((*uint8)(unsafe.Pointer(&_sqlite3OpcodeProperty)), uintptr(_pOrigOp.Xopcode))
 54056  	if _rc != int32(0) {
 54057  		crt.Xprintf(tls, str(70688), _rc)
 54058  	}
 54059  	if (int32(_557_opProperty) & int32(16)) != 0 {
 54060  		_registerTrace(tls, _pOrigOp.Xp2, elem25(_aMem, uintptr(_pOrigOp.Xp2)))
 54061  	}
 54062  	if (int32(_557_opProperty) & int32(32)) != 0 {
 54063  		_registerTrace(tls, _pOrigOp.Xp3, elem25(_aMem, uintptr(_pOrigOp.Xp3)))
 54064  	}
 54065  _2167:
 54066  	*(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(32)
 54067  	goto _30
 54068  _abort_due_to_error:
 54069  	if _db.XmallocFailed != 0 {
 54070  		_rc = _sqlite3NomemError(tls, int32(85444))
 54071  	}
 54072  	func() {
 54073  		if _rc == 0 {
 54074  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85445), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70695)))
 54075  			crt.X__builtin_abort(tls)
 54076  		}
 54077  	}()
 54078  	if (_p.XzErrMsg == nil) && (_rc != int32(3082)) {
 54079  		_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(_sqlite3ErrStr(tls, _rc)))
 54080  	}
 54081  	_p.Xrc = _rc
 54082  	_sqlite3SystemError(tls, _db, _rc)
 54083  	Xsqlite3_log(tls, _rc, str(70698), int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/32)), unsafe.Pointer(_p.XzSql), unsafe.Pointer(_p.XzErrMsg))
 54084  	_sqlite3VdbeHalt(tls, _p)
 54085  	if _rc == int32(3082) {
 54086  		_sqlite3OomFault(tls, _db)
 54087  	}
 54088  	_rc = int32(1)
 54089  	if int32(_resetSchemaOnFault) > int32(0) {
 54090  		_sqlite3ResetOneSchema(tls, _db, int32(_resetSchemaOnFault)-int32(1))
 54091  	}
 54092  _vdbe_return:
 54093  	*elem31((*uint32)(unsafe.Pointer(&_p.XaCounter)), uintptr(4)) += uint32(int32(_nVmStep))
 54094  	_sqlite3VdbeLeave(tls, _p)
 54095  	func() {
 54096  		if _rc == int32(0) && _nExtraDelete != int32(0) && Xsqlite3_strlike(tls, str(70730), _p.XzSql, 0) == int32(0) {
 54097  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85468), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70738)))
 54098  			crt.X__builtin_abort(tls)
 54099  		}
 54100  	}()
 54101  	return _rc
 54102  
 54103  _too_big:
 54104  	_sqlite3VdbeError(tls, _p, str(6711))
 54105  	_rc = int32(18)
 54106  	goto _abort_due_to_error
 54107  _no_mem:
 54108  	_sqlite3OomFault(tls, _db)
 54109  	_sqlite3VdbeError(tls, _p, str(59395))
 54110  	_rc = _sqlite3NomemError(tls, int32(85486))
 54111  	goto _abort_due_to_error
 54112  _abort_due_to_interrupt:
 54113  	func() {
 54114  		if (*(*int32)(unsafe.Pointer(&_db.Xu1))) == 0 {
 54115  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85493), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70814)))
 54116  			crt.X__builtin_abort(tls)
 54117  		}
 54118  	}()
 54119  	_rc = func() int32 {
 54120  		if _db.XmallocFailed != 0 {
 54121  			return _sqlite3NomemError(tls, int32(85494))
 54122  		}
 54123  		return int32(9)
 54124  	}()
 54125  	_p.Xrc = _rc
 54126  	_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(_sqlite3ErrStr(tls, _rc)))
 54127  	goto _abort_due_to_error
 54128  	_ = _94_uA
 54129  	_ = _340_cnt
 54130  	_ = _496_aRes
 54131  	panic(0)
 54132  }
 54133  
 54134  var _sqlite3VdbeExecØ00__func__Ø000 [16]int8
 54135  
 54136  func init() {
 54137  	crt.Xstrncpy(nil, &_sqlite3VdbeExecØ00__func__Ø000[0], str(70835), 16)
 54138  }
 54139  
 54140  // C comment
 54141  //  /*
 54142  //  ** Print the SQL that was used to generate a VDBE program.
 54143  //  */
 54144  func _sqlite3VdbePrintSql(tls *crt.TLS, _p *TVdbe) {
 54145  	var _z *int8
 54146  	var _2_pOp *XVdbeOp
 54147  	_z = nil
 54148  	if _p.XzSql != nil {
 54149  		_z = _p.XzSql
 54150  		goto _2
 54151  	}
 54152  	if _p.XnOp < int32(1) {
 54153  		goto _2
 54154  	}
 54155  	_2_pOp = elem63((*XVdbeOp)(_p.XaOp), 0)
 54156  	if int32(_2_pOp.Xopcode) != int32(51) || (*(**int8)(unsafe.Pointer(&_2_pOp.Xp4))) == nil {
 54157  		goto _4
 54158  	}
 54159  	_z = *(**int8)(unsafe.Pointer(&_2_pOp.Xp4))
 54160  _5:
 54161  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z)))) & int32(1)) != 0 {
 54162  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 54163  		goto _5
 54164  	}
 54165  _4:
 54166  _2:
 54167  	if _z != nil {
 54168  		crt.Xprintf(tls, str(70851), unsafe.Pointer(_z))
 54169  	}
 54170  }
 54171  
 54172  func _registerTrace(tls *crt.TLS, _iReg int32, _p *XMem) {
 54173  	crt.Xprintf(tls, str(70862), _iReg)
 54174  	_memTracePrint(tls, _p)
 54175  	crt.Xprintf(tls, str(37655))
 54176  	_sqlite3VdbeCheckMemInvariants(tls, _p)
 54177  }
 54178  
 54179  // C comment
 54180  //  /*
 54181  //  ** Print the value of a register for tracing purposes:
 54182  //  */
 54183  func _memTracePrint(tls *crt.TLS, _p *XMem) {
 54184  	var _7_zBuf [200]int8
 54185  	if (int32(_p.Xflags) & int32(128)) != 0 {
 54186  		crt.Xprintf(tls, str(70873))
 54187  		goto _11
 54188  	}
 54189  	if (int32(_p.Xflags) & int32(1)) != 0 {
 54190  		crt.Xprintf(tls, str(70884))
 54191  		goto _11
 54192  	}
 54193  	if (int32(_p.Xflags) & int32(6)) == int32(6) {
 54194  		crt.Xprintf(tls, str(70890), *(*int64)(unsafe.Pointer(&_p.Xu)))
 54195  		goto _11
 54196  	}
 54197  	if (int32(_p.Xflags) & int32(4)) != 0 {
 54198  		crt.Xprintf(tls, str(70899), *(*int64)(unsafe.Pointer(&_p.Xu)))
 54199  		goto _11
 54200  	}
 54201  	if (int32(_p.Xflags) & int32(8)) != 0 {
 54202  		crt.Xprintf(tls, str(70907), *(*float64)(unsafe.Pointer(&_p.Xu)))
 54203  		goto _11
 54204  	}
 54205  	if (int32(_p.Xflags) & int32(32)) != 0 {
 54206  		crt.Xprintf(tls, str(70913))
 54207  		goto _11
 54208  	}
 54209  	_sqlite3VdbeMemPrettyPrint(tls, _p, (*int8)(unsafe.Pointer(&_7_zBuf)))
 54210  	crt.Xprintf(tls, str(46992), unsafe.Pointer(&_7_zBuf))
 54211  _11:
 54212  	if (int32(_p.Xflags) & int32(32768)) != 0 {
 54213  		crt.Xprintf(tls, str(70923), int32(_p.XeSubtype))
 54214  	}
 54215  	_ = _7_zBuf
 54216  }
 54217  
 54218  // C comment
 54219  //  /*
 54220  //  ** Write a nice string representation of the contents of cell pMem
 54221  //  ** into buffer zBuf, length nBuf.
 54222  //  */
 54223  func _sqlite3VdbeMemPrettyPrint(tls *crt.TLS, _pMem *XMem, _zBuf *int8) {
 54224  	var _f, _1_i, _9_j, _9_k int32
 54225  	var _1_c, _7_z int8
 54226  	var _zCsr *int8
 54227  	var _14_c uint8
 54228  	_zCsr = _zBuf
 54229  	_f = int32(_pMem.Xflags)
 54230  	if (_f & int32(16)) == 0 {
 54231  		goto _0
 54232  	}
 54233  	if (_f & int32(1024)) != 0 {
 54234  		_1_c = int8(122)
 54235  		func() {
 54236  			if (_f & int32(6144)) != int32(0) {
 54237  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78597), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(70939)))
 54238  				crt.X__builtin_abort(tls)
 54239  			}
 54240  		}()
 54241  		goto _12
 54242  	}
 54243  	if (_f & int32(2048)) != 0 {
 54244  		_1_c = int8(116)
 54245  		func() {
 54246  			if (_f & int32(5120)) != int32(0) {
 54247  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78600), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(70971)))
 54248  				crt.X__builtin_abort(tls)
 54249  			}
 54250  		}()
 54251  		goto _12
 54252  	}
 54253  	if (_f & int32(4096)) != 0 {
 54254  		_1_c = int8(101)
 54255  		func() {
 54256  			if (_f & int32(3072)) != int32(0) {
 54257  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78603), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(71000)))
 54258  				crt.X__builtin_abort(tls)
 54259  			}
 54260  		}()
 54261  		goto _12
 54262  	}
 54263  	_1_c = int8(115)
 54264  _12:
 54265  	*postInc1(&_zCsr, 1) = _1_c
 54266  	Xsqlite3_snprintf(tls, int32(100), _zCsr, str(71030), _pMem.Xn)
 54267  	*(*uintptr)(unsafe.Pointer(&_zCsr)) += uintptr(_sqlite3Strlen30(tls, _zCsr))
 54268  	_1_i = int32(0)
 54269  _13:
 54270  	if _1_i >= int32(16) || _1_i >= _pMem.Xn {
 54271  		goto _17
 54272  	}
 54273  	Xsqlite3_snprintf(tls, int32(100), _zCsr, str(71034), int32(*elem1(_pMem.Xz, uintptr(_1_i)))&int32(255))
 54274  	*(*uintptr)(unsafe.Pointer(&_zCsr)) += uintptr(_sqlite3Strlen30(tls, _zCsr))
 54275  	_1_i += 1
 54276  	goto _13
 54277  _17:
 54278  	_1_i = int32(0)
 54279  _18:
 54280  	if _1_i >= int32(16) || _1_i >= _pMem.Xn {
 54281  		goto _22
 54282  	}
 54283  	_7_z = *elem1(_pMem.Xz, uintptr(_1_i))
 54284  	if (int32(_7_z) < int32(32)) || (int32(_7_z) > int32(126)) {
 54285  		*postInc1(&_zCsr, 1) = int8(46)
 54286  		goto _25
 54287  	}
 54288  	*postInc1(&_zCsr, 1) = _7_z
 54289  _25:
 54290  	_1_i += 1
 54291  	goto _18
 54292  _22:
 54293  	*postInc1(&_zCsr, 1) = int8(93)
 54294  	if (_f & int32(16384)) != 0 {
 54295  		Xsqlite3_snprintf(tls, int32(100), _zCsr, str(71039), *(*int32)(unsafe.Pointer(&_pMem.Xu)))
 54296  		*(*uintptr)(unsafe.Pointer(&_zCsr)) += uintptr(_sqlite3Strlen30(tls, _zCsr))
 54297  	}
 54298  	*_zCsr = 0
 54299  	goto _28
 54300  _0:
 54301  	if (_f & int32(2)) == 0 {
 54302  		goto _28
 54303  	}
 54304  	*elem1(_zBuf, 0) = int8(32)
 54305  	if (_f & int32(1024)) != 0 {
 54306  		*elem1(_zBuf, uintptr(1)) = int8(122)
 54307  		func() {
 54308  			if (_f & int32(6144)) != int32(0) {
 54309  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78630), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(70939)))
 54310  				crt.X__builtin_abort(tls)
 54311  			}
 54312  		}()
 54313  		goto _40
 54314  	}
 54315  	if (_f & int32(2048)) != 0 {
 54316  		*elem1(_zBuf, uintptr(1)) = int8(116)
 54317  		func() {
 54318  			if (_f & int32(5120)) != int32(0) {
 54319  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78633), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(70971)))
 54320  				crt.X__builtin_abort(tls)
 54321  			}
 54322  		}()
 54323  		goto _40
 54324  	}
 54325  	if (_f & int32(4096)) != 0 {
 54326  		*elem1(_zBuf, uintptr(1)) = int8(101)
 54327  		func() {
 54328  			if (_f & int32(3072)) != int32(0) {
 54329  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78636), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(71000)))
 54330  				crt.X__builtin_abort(tls)
 54331  			}
 54332  		}()
 54333  		goto _40
 54334  	}
 54335  	*elem1(_zBuf, uintptr(1)) = int8(115)
 54336  _40:
 54337  	_9_k = int32(2)
 54338  	Xsqlite3_snprintf(tls, int32(100), elem1(_zBuf, uintptr(_9_k)), str(37870), _pMem.Xn)
 54339  	_9_k += _sqlite3Strlen30(tls, elem1(_zBuf, uintptr(_9_k)))
 54340  	*elem1(_zBuf, uintptr(postInc2(&_9_k, 1))) = int8(91)
 54341  	_9_j = int32(0)
 54342  _41:
 54343  	if _9_j >= int32(15) || _9_j >= _pMem.Xn {
 54344  		goto _45
 54345  	}
 54346  	_14_c = uint8(*elem1(_pMem.Xz, uintptr(_9_j)))
 54347  	if (int32(_14_c) >= int32(32)) && (int32(_14_c) < int32(127)) {
 54348  		*elem1(_zBuf, uintptr(postInc2(&_9_k, 1))) = int8(_14_c)
 54349  		goto _48
 54350  	}
 54351  	*elem1(_zBuf, uintptr(postInc2(&_9_k, 1))) = int8(46)
 54352  _48:
 54353  	_9_j += 1
 54354  	goto _41
 54355  _45:
 54356  	*elem1(_zBuf, uintptr(postInc2(&_9_k, 1))) = int8(93)
 54357  	Xsqlite3_snprintf(tls, int32(100), elem1(_zBuf, uintptr(_9_k)), *elem0((**int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00encnamesØ001)), uintptr(_pMem.Xenc)))
 54358  	_9_k += _sqlite3Strlen30(tls, elem1(_zBuf, uintptr(_9_k)))
 54359  	*elem1(_zBuf, uintptr(postInc2(&_9_k, 1))) = 0
 54360  _28:
 54361  }
 54362  
 54363  var _sqlite3VdbeMemPrettyPrintØ00__func__Ø000 [26]int8
 54364  
 54365  func init() {
 54366  	crt.Xstrncpy(nil, &_sqlite3VdbeMemPrettyPrintØ00__func__Ø000[0], str(71044), 26)
 54367  }
 54368  
 54369  var _sqlite3VdbeMemPrettyPrintØ00encnamesØ001 [4]*int8
 54370  
 54371  func init() {
 54372  	_sqlite3VdbeMemPrettyPrintØ00encnamesØ001 = [4]*int8{str(71070), str(71074), str(71078), str(71085)}
 54373  }
 54374  
 54375  // C comment
 54376  //  /*
 54377  //  ** This routine prepares a memory cell for modification by breaking
 54378  //  ** its link to a shallow copy and by marking any current shallow
 54379  //  ** copies of this cell as invalid.
 54380  //  **
 54381  //  ** This is used for testing and debugging only - to make sure shallow
 54382  //  ** copies are not misused.
 54383  //  */
 54384  func _sqlite3VdbeMemAboutToChange(tls *crt.TLS, _pVdbe *TVdbe, _pMem *XMem) {
 54385  	var _i int32
 54386  	var _pX *XMem
 54387  	*func() **XMem { _i = int32(0); return &_pX }() = (*XMem)(_pVdbe.XaMem)
 54388  _0:
 54389  	if _i >= _pVdbe.XnMem {
 54390  		goto _3
 54391  	}
 54392  	if (*XMem)(_pX.XpScopyFrom) == _pMem {
 54393  		{
 54394  			p := &_pX.Xflags
 54395  			*p = uint16(int32(*p) | int32(128))
 54396  		}
 54397  		*(**XMem)(unsafe.Pointer(&_pX.XpScopyFrom)) = nil
 54398  	}
 54399  	*(*uintptr)(unsafe.Pointer(func() **XMem { _i += 1; return &_pX }())) += uintptr(72)
 54400  	goto _0
 54401  _3:
 54402  	*(**XMem)(unsafe.Pointer(&_pMem.XpScopyFrom)) = nil
 54403  }
 54404  
 54405  var _sqlite3VdbeExecØ00azTypeØ001 [4]*int8
 54406  
 54407  func init() {
 54408  	_sqlite3VdbeExecØ00azTypeØ001 = [4]*int8{str(71092), str(25545), str(25552), str(71101)}
 54409  }
 54410  
 54411  func _out2Prerelease(tls *crt.TLS, _p *TVdbe, _pOp *XVdbeOp) (r0 *XMem) {
 54412  	var _pOut *XMem
 54413  	func() {
 54414  		if _pOp.Xp2 <= int32(0) {
 54415  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78831), unsafe.Pointer(&_out2PrereleaseØ00__func__Ø000), unsafe.Pointer(str(61037)))
 54416  			crt.X__builtin_abort(tls)
 54417  		}
 54418  	}()
 54419  	func() {
 54420  		if _pOp.Xp2 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 54421  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78832), unsafe.Pointer(&_out2PrereleaseØ00__func__Ø000), unsafe.Pointer(str(61047)))
 54422  			crt.X__builtin_abort(tls)
 54423  		}
 54424  	}()
 54425  	_pOut = elem25((*XMem)(_p.XaMem), uintptr(_pOp.Xp2))
 54426  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 54427  	if (int32(_pOut.Xflags) & int32(9312)) != int32(0) {
 54428  		return _out2PrereleaseWithClear(tls, _pOut)
 54429  	}
 54430  	_pOut.Xflags = uint16(4)
 54431  	return _pOut
 54432  }
 54433  
 54434  var _out2PrereleaseØ00__func__Ø000 [15]int8
 54435  
 54436  func init() {
 54437  	crt.Xstrncpy(nil, &_out2PrereleaseØ00__func__Ø000[0], str(71113), 15)
 54438  }
 54439  
 54440  // C comment
 54441  //  /*
 54442  //  ** Return the register of pOp->p2 after first preparing it to be
 54443  //  ** overwritten with an integer value.
 54444  //  */
 54445  func _out2PrereleaseWithClear(tls *crt.TLS, _pOut *XMem) (r0 *XMem) {
 54446  	_sqlite3VdbeMemSetNull(tls, _pOut)
 54447  	_pOut.Xflags = uint16(4)
 54448  	return _pOut
 54449  }
 54450  
 54451  // C comment
 54452  //  /*
 54453  //  ** Return true if the Mem object contains a TEXT or BLOB that is
 54454  //  ** too large - whose size exceeds SQLITE_MAX_LENGTH.
 54455  //  */
 54456  func _sqlite3VdbeMemTooBig(tls *crt.TLS, _p *XMem) (r0 int32) {
 54457  	var _1_n int32
 54458  	func() {
 54459  		if (*Xsqlite3)(_p.Xdb) == nil {
 54460  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70450), unsafe.Pointer(&_sqlite3VdbeMemTooBigØ00__func__Ø000), unsafe.Pointer(str(23631)))
 54461  			crt.X__builtin_abort(tls)
 54462  		}
 54463  	}()
 54464  	if (int32(_p.Xflags) & int32(18)) == 0 {
 54465  		goto _2
 54466  	}
 54467  	_1_n = _p.Xn
 54468  	if (int32(_p.Xflags) & int32(16384)) != 0 {
 54469  		_1_n += *(*int32)(unsafe.Pointer(&_p.Xu))
 54470  	}
 54471  	return bool2int(_1_n > (*elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_p.Xdb).XaLimit))), 0)))
 54472  
 54473  _2:
 54474  	return int32(0)
 54475  }
 54476  
 54477  var _sqlite3VdbeMemTooBigØ00__func__Ø000 [21]int8
 54478  
 54479  func init() {
 54480  	crt.Xstrncpy(nil, &_sqlite3VdbeMemTooBigØ00__func__Ø000[0], str(71128), 21)
 54481  }
 54482  
 54483  func _sqlite3VdbeMemShallowCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem, _srcType int32) {
 54484  	func() {
 54485  		if (int32(_pFrom.Xflags) & int32(32)) != int32(0) {
 54486  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70496), unsafe.Pointer(&_sqlite3VdbeMemShallowCopyØ00__func__Ø000), unsafe.Pointer(str(71149)))
 54487  			crt.X__builtin_abort(tls)
 54488  		}
 54489  	}()
 54490  	func() {
 54491  		if (*Xsqlite3)(_pTo.Xdb) != (*Xsqlite3)(_pFrom.Xdb) {
 54492  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70497), unsafe.Pointer(&_sqlite3VdbeMemShallowCopyØ00__func__Ø000), unsafe.Pointer(str(71180)))
 54493  			crt.X__builtin_abort(tls)
 54494  		}
 54495  	}()
 54496  	if (int32(_pTo.Xflags) & int32(9312)) != int32(0) {
 54497  		_vdbeClrCopy(tls, _pTo, _pFrom, _srcType)
 54498  		return
 54499  	}
 54500  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), uint64(24))
 54501  	if (int32(_pFrom.Xflags) & int32(2048)) == int32(0) {
 54502  		{
 54503  			p := &_pTo.Xflags
 54504  			*p = uint16(int32(*p) & int32(-7169))
 54505  		}
 54506  		func() {
 54507  			if _srcType != int32(4096) && _srcType != int32(2048) {
 54508  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70502), unsafe.Pointer(&_sqlite3VdbeMemShallowCopyØ00__func__Ø000), unsafe.Pointer(str(71199)))
 54509  				crt.X__builtin_abort(tls)
 54510  			}
 54511  		}()
 54512  		{
 54513  			p := &_pTo.Xflags
 54514  			*p = uint16(int32(*p) | _srcType)
 54515  		}
 54516  	}
 54517  }
 54518  
 54519  var _sqlite3VdbeMemShallowCopyØ00__func__Ø000 [26]int8
 54520  
 54521  func init() {
 54522  	crt.Xstrncpy(nil, &_sqlite3VdbeMemShallowCopyØ00__func__Ø000[0], str(71241), 26)
 54523  }
 54524  
 54525  // C comment
 54526  //  /*
 54527  //  ** Make an shallow copy of pFrom into pTo.  Prior contents of
 54528  //  ** pTo are freed.  The pFrom->z field is not duplicated.  If
 54529  //  ** pFrom->z is used, then pTo->z points to the same thing as pFrom->z
 54530  //  ** and flags gets srcType (either MEM_Ephem or MEM_Static).
 54531  //  */
 54532  func _vdbeClrCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem, _eType int32) {
 54533  	_vdbeMemClearExternAndSetNull(tls, _pTo)
 54534  	func() {
 54535  		if (int32(_pTo.Xflags) & int32(9312)) != int32(0) {
 54536  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70492), unsafe.Pointer(&_vdbeClrCopyØ00__func__Ø000), unsafe.Pointer(str(71267)))
 54537  			crt.X__builtin_abort(tls)
 54538  		}
 54539  	}()
 54540  	_sqlite3VdbeMemShallowCopy(tls, _pTo, _pFrom, _eType)
 54541  }
 54542  
 54543  var _vdbeClrCopyØ00__func__Ø000 [12]int8
 54544  
 54545  func init() {
 54546  	crt.Xstrncpy(nil, &_vdbeClrCopyØ00__func__Ø000[0], str(71288), 12)
 54547  }
 54548  
 54549  // C comment
 54550  //  /*
 54551  //  ** Transfer the contents of pFrom to pTo. Any existing value in pTo is
 54552  //  ** freed. If pFrom contains ephemeral data, a copy is made.
 54553  //  **
 54554  //  ** pFrom contains an SQL NULL when this routine returns.
 54555  //  */
 54556  func _sqlite3VdbeMemMove(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) {
 54557  	func() {
 54558  		if (*Xsqlite3)(_pFrom.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pFrom.Xdb).Xmutex)) == 0 {
 54559  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70535), unsafe.Pointer(&_sqlite3VdbeMemMoveØ00__func__Ø000), unsafe.Pointer(str(71300)))
 54560  			crt.X__builtin_abort(tls)
 54561  		}
 54562  	}()
 54563  	func() {
 54564  		if (*Xsqlite3)(_pTo.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pTo.Xdb).Xmutex)) == 0 {
 54565  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70536), unsafe.Pointer(&_sqlite3VdbeMemMoveØ00__func__Ø000), unsafe.Pointer(str(71353)))
 54566  			crt.X__builtin_abort(tls)
 54567  		}
 54568  	}()
 54569  	func() {
 54570  		if (*Xsqlite3)(_pFrom.Xdb) != nil && (*Xsqlite3)(_pTo.Xdb) != nil && (*Xsqlite3)(_pFrom.Xdb) != (*Xsqlite3)(_pTo.Xdb) {
 54571  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70537), unsafe.Pointer(&_sqlite3VdbeMemMoveØ00__func__Ø000), unsafe.Pointer(str(71402)))
 54572  			crt.X__builtin_abort(tls)
 54573  		}
 54574  	}()
 54575  	_sqlite3VdbeMemRelease(tls, _pTo)
 54576  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), uint64(72))
 54577  	_pFrom.Xflags = uint16(1)
 54578  	_pFrom.XszMalloc = int32(0)
 54579  }
 54580  
 54581  var _sqlite3VdbeMemMoveØ00__func__Ø000 [19]int8
 54582  
 54583  func init() {
 54584  	crt.Xstrncpy(nil, &_sqlite3VdbeMemMoveØ00__func__Ø000[0], str(71451), 19)
 54585  }
 54586  
 54587  // C comment
 54588  //  /*
 54589  //  ** Return the numeric type for pMem, either MEM_Int or MEM_Real or both or
 54590  //  ** none.
 54591  //  **
 54592  //  ** Unlike applyNumericAffinity(), this routine does not modify pMem->flags.
 54593  //  ** But it does set pMem->u.r and pMem->u.i appropriately.
 54594  //  */
 54595  func _numericType(tls *crt.TLS, _pMem *XMem) (r0 uint16) {
 54596  	if (int32(_pMem.Xflags) & int32(12)) != 0 {
 54597  		return uint16(int32(_pMem.Xflags) & int32(12))
 54598  	}
 54599  	if (int32(_pMem.Xflags) & int32(18)) != 0 {
 54600  		return _computeNumericType(tls, _pMem)
 54601  	}
 54602  	return 0
 54603  }
 54604  
 54605  // C comment
 54606  //  /*
 54607  //  ** pMem currently only holds a string type (or maybe a BLOB that we can
 54608  //  ** interpret as a string if we want to).  Compute its corresponding
 54609  //  ** numeric type, if has one.  Set the pMem->u.r and pMem->u.i fields
 54610  //  ** accordingly.
 54611  //  */
 54612  func _computeNumericType(tls *crt.TLS, _pMem *XMem) (r0 uint16) {
 54613  	func() {
 54614  		if (int32(_pMem.Xflags) & int32(12)) != int32(0) {
 54615  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78553), unsafe.Pointer(&_computeNumericTypeØ00__func__Ø000), unsafe.Pointer(str(71470)))
 54616  			crt.X__builtin_abort(tls)
 54617  		}
 54618  	}()
 54619  	func() {
 54620  		if (int32(_pMem.Xflags) & int32(18)) == int32(0) {
 54621  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78554), unsafe.Pointer(&_computeNumericTypeØ00__func__Ø000), unsafe.Pointer(str(71508)))
 54622  			crt.X__builtin_abort(tls)
 54623  		}
 54624  	}()
 54625  	if _sqlite3AtoF(tls, _pMem.Xz, (*float64)(unsafe.Pointer(&_pMem.Xu)), _pMem.Xn, _pMem.Xenc) == int32(0) {
 54626  		return 0
 54627  	}
 54628  	if _sqlite3Atoi64(tls, _pMem.Xz, (*int64)(unsafe.Pointer(&_pMem.Xu)), _pMem.Xn, _pMem.Xenc) == int32(0) {
 54629  		return uint16(4)
 54630  	}
 54631  	return uint16(8)
 54632  }
 54633  
 54634  var _computeNumericTypeØ00__func__Ø000 [19]int8
 54635  
 54636  func init() {
 54637  	crt.Xstrncpy(nil, &_computeNumericTypeØ00__func__Ø000[0], str(71546), 19)
 54638  }
 54639  
 54640  // C comment
 54641  //  /*
 54642  //  ** Attempt to add, substract, or multiply the 64-bit signed value iB against
 54643  //  ** the other 64-bit signed integer at *pA and store the result in *pA.
 54644  //  ** Return 0 on success.  Or if the operation would have resulted in an
 54645  //  ** overflow, leave *pA unchanged and return 1.
 54646  //  */
 54647  func _sqlite3AddInt64(tls *crt.TLS, _pA *int64, _iB int64) (r0 int32) {
 54648  	var _iA int64
 54649  	_iA = *_pA
 54650  	if _iB < (0) {
 54651  		goto _0
 54652  	}
 54653  	if (_iA > (0)) && ((int64(9223372036854775807) - _iA) < _iB) {
 54654  		return int32(1)
 54655  	}
 54656  	goto _3
 54657  _0:
 54658  	if (_iA < (0)) && ((-(_iA + int64(9223372036854775807))) > (_iB + int64(1))) {
 54659  		return int32(1)
 54660  	}
 54661  _3:
 54662  	*_pA += _iB
 54663  	return int32(0)
 54664  }
 54665  
 54666  func _sqlite3SubInt64(tls *crt.TLS, _pA *int64, _iB int64) (r0 int32) {
 54667  	if _iB != int64(-9223372036854775808) {
 54668  		goto _0
 54669  	}
 54670  	if (*_pA) >= (0) {
 54671  		return int32(1)
 54672  	}
 54673  	*_pA -= _iB
 54674  	return int32(0)
 54675  
 54676  _0:
 54677  	return _sqlite3AddInt64(tls, _pA, -_iB)
 54678  }
 54679  
 54680  func _sqlite3MulInt64(tls *crt.TLS, _pA *int64, _iB int64) (r0 int32) {
 54681  	var _iA int64
 54682  	_iA = *_pA
 54683  	if _iB <= (0) {
 54684  		goto _0
 54685  	}
 54686  	if _iA > (int64(9223372036854775807) / _iB) {
 54687  		return int32(1)
 54688  	}
 54689  	if _iA < (int64(-9223372036854775808) / _iB) {
 54690  		return int32(1)
 54691  	}
 54692  	goto _4
 54693  _0:
 54694  	if _iB >= (0) {
 54695  		goto _4
 54696  	}
 54697  	if _iA <= (0) {
 54698  		goto _5
 54699  	}
 54700  	if _iB < (int64(-9223372036854775808) / _iA) {
 54701  		return int32(1)
 54702  	}
 54703  	goto _8
 54704  _5:
 54705  	if _iA >= (0) {
 54706  		goto _8
 54707  	}
 54708  	if _iB == int64(-9223372036854775808) {
 54709  		return int32(1)
 54710  	}
 54711  	if _iA == int64(-9223372036854775808) {
 54712  		return int32(1)
 54713  	}
 54714  	if (-_iA) > (int64(9223372036854775807) / (-_iB)) {
 54715  		return int32(1)
 54716  	}
 54717  _8:
 54718  _4:
 54719  	*_pA = _iA * _iB
 54720  	return int32(0)
 54721  }
 54722  
 54723  // C comment
 54724  //  /*
 54725  //  ** Compare the values contained by the two memory cells, returning
 54726  //  ** negative, zero or positive if pMem1 is less than, equal to, or greater
 54727  //  ** than pMem2. Sorting order is NULL's first, followed by numbers (integers
 54728  //  ** and reals) sorted numerically, followed by text ordered by the collating
 54729  //  ** sequence pColl and finally blob's ordered by memcmp().
 54730  //  **
 54731  //  ** Two NULL values are considered equal by this function.
 54732  //  */
 54733  func _sqlite3MemCompare(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCollSeq) (r0 int32) {
 54734  	var _f1, _f2, _combined_flags int32
 54735  	_f1 = int32(_pMem1.Xflags)
 54736  	_f2 = int32(_pMem2.Xflags)
 54737  	_combined_flags = _f1 | _f2
 54738  	func() {
 54739  		if (_combined_flags & int32(32)) != int32(0) {
 54740  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75263), unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000), unsafe.Pointer(str(71565)))
 54741  			crt.X__builtin_abort(tls)
 54742  		}
 54743  	}()
 54744  	if (_combined_flags & int32(1)) != 0 {
 54745  		return (_f2 & int32(1)) - (_f1 & int32(1))
 54746  	}
 54747  	if (_combined_flags & int32(12)) == 0 {
 54748  		goto _3
 54749  	}
 54750  	if ((_f1 & _f2) & int32(4)) == int32(0) {
 54751  		goto _4
 54752  	}
 54753  	if (*(*int64)(unsafe.Pointer(&_pMem1.Xu))) < (*(*int64)(unsafe.Pointer(&_pMem2.Xu))) {
 54754  		return int32(-1)
 54755  	}
 54756  	if (*(*int64)(unsafe.Pointer(&_pMem1.Xu))) > (*(*int64)(unsafe.Pointer(&_pMem2.Xu))) {
 54757  		return int32(1)
 54758  	}
 54759  	return int32(0)
 54760  
 54761  _4:
 54762  	if ((_f1 & _f2) & int32(8)) == int32(0) {
 54763  		goto _7
 54764  	}
 54765  	if (*(*float64)(unsafe.Pointer(&_pMem1.Xu))) < (*(*float64)(unsafe.Pointer(&_pMem2.Xu))) {
 54766  		return int32(-1)
 54767  	}
 54768  	if (*(*float64)(unsafe.Pointer(&_pMem1.Xu))) > (*(*float64)(unsafe.Pointer(&_pMem2.Xu))) {
 54769  		return int32(1)
 54770  	}
 54771  	return int32(0)
 54772  
 54773  _7:
 54774  	if (_f1 & int32(4)) == int32(0) {
 54775  		goto _10
 54776  	}
 54777  	if (_f2 & int32(8)) != int32(0) {
 54778  		return _sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer(&_pMem1.Xu)), *(*float64)(unsafe.Pointer(&_pMem2.Xu)))
 54779  	}
 54780  	return int32(-1)
 54781  
 54782  _10:
 54783  	if (_f1 & int32(8)) == int32(0) {
 54784  		goto _13
 54785  	}
 54786  	if (_f2 & int32(4)) != int32(0) {
 54787  		return -_sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer(&_pMem2.Xu)), *(*float64)(unsafe.Pointer(&_pMem1.Xu)))
 54788  	}
 54789  	return int32(-1)
 54790  
 54791  _13:
 54792  	return int32(1)
 54793  
 54794  _3:
 54795  	if (_combined_flags & int32(2)) == 0 {
 54796  		goto _16
 54797  	}
 54798  	if (_f1 & int32(2)) == int32(0) {
 54799  		return int32(1)
 54800  	}
 54801  	if (_f2 & int32(2)) == int32(0) {
 54802  		return int32(-1)
 54803  	}
 54804  	func() {
 54805  		if int32(_pMem1.Xenc) != int32(_pMem2.Xenc) && ((*Xsqlite3)(_pMem1.Xdb).XmallocFailed) == 0 {
 54806  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75313), unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000), unsafe.Pointer(str(71598)))
 54807  			crt.X__builtin_abort(tls)
 54808  		}
 54809  	}()
 54810  	func() {
 54811  		if int32(_pMem1.Xenc) != int32(1) && int32(_pMem1.Xenc) != int32(2) && int32(_pMem1.Xenc) != int32(3) {
 54812  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75314), unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000), unsafe.Pointer(str(71648)))
 54813  			crt.X__builtin_abort(tls)
 54814  		}
 54815  	}()
 54816  	func() {
 54817  		if _pColl != nil && _pColl.XxCmp == nil {
 54818  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75321), unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000), unsafe.Pointer(str(71732)))
 54819  			crt.X__builtin_abort(tls)
 54820  		}
 54821  	}()
 54822  	if _pColl != nil {
 54823  		return _vdbeCompareMemString(tls, _pMem1, _pMem2, _pColl, nil)
 54824  	}
 54825  _16:
 54826  	return _sqlite3BlobCompare(tls, _pMem1, _pMem2)
 54827  }
 54828  
 54829  var _sqlite3MemCompareØ00__func__Ø000 [18]int8
 54830  
 54831  func init() {
 54832  	crt.Xstrncpy(nil, &_sqlite3MemCompareØ00__func__Ø000[0], str(71754), 18)
 54833  }
 54834  
 54835  // C comment
 54836  //  /*
 54837  //  ** Do a comparison between a 64-bit signed integer and a 64-bit floating-point
 54838  //  ** number.  Return negative, zero, or positive if the first (i64) is less than,
 54839  //  ** equal to, or greater than the second (double).
 54840  //  */
 54841  func _sqlite3IntFloatCompare(tls *crt.TLS, _i int64, _r float64) (r0 int32) {
 54842  	var _2_y int64
 54843  	var _1_x, _2_s float64
 54844  	goto _0
 54845  _0:
 54846  	if _r < (-9.223372036854776e+18) {
 54847  		return int32(1)
 54848  	}
 54849  	if _r > (9.223372036854776e+18) {
 54850  		return int32(-1)
 54851  	}
 54852  	_2_y = int64(_r)
 54853  	if _i < _2_y {
 54854  		return int32(-1)
 54855  	}
 54856  	if _i <= _2_y {
 54857  		goto _7
 54858  	}
 54859  	if (_2_y == int64(-9223372036854775808)) && (_r > float64(0)) {
 54860  		return int32(-1)
 54861  	}
 54862  	return int32(1)
 54863  
 54864  _7:
 54865  	_2_s = float64(_i)
 54866  	if _2_s < _r {
 54867  		return int32(-1)
 54868  	}
 54869  	if _2_s > _r {
 54870  		return int32(1)
 54871  	}
 54872  	return int32(0)
 54873  
 54874  	_ = _1_x
 54875  	panic(0)
 54876  }
 54877  
 54878  // C comment
 54879  //  /*
 54880  //  ** Both *pMem1 and *pMem2 contain string values. Compare the two values
 54881  //  ** using the collation sequence pColl. As usual, return a negative , zero
 54882  //  ** or positive value if *pMem1 is less than, equal to or greater than
 54883  //  ** *pMem2, respectively. Similar in spirit to "rc = (*pMem1) - (*pMem2);".
 54884  //  */
 54885  func _vdbeCompareMemString(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCollSeq, _prcErr *uint8) (r0 int32) {
 54886  	var _2_rc, _2_n1, _2_n2 int32
 54887  	var _2_v1, _2_v2 unsafe.Pointer
 54888  	var _2_c1, _2_c2 XMem
 54889  	if int32(_pMem1.Xenc) == int32(_pColl.Xenc) {
 54890  		return _pColl.XxCmp(tls, _pColl.XpUser, _pMem1.Xn, unsafe.Pointer(_pMem1.Xz), _pMem2.Xn, unsafe.Pointer(_pMem2.Xz))
 54891  	}
 54892  	_sqlite3VdbeMemInit(tls, &_2_c1, (*Xsqlite3)(_pMem1.Xdb), uint16(1))
 54893  	_sqlite3VdbeMemInit(tls, &_2_c2, (*Xsqlite3)(_pMem1.Xdb), uint16(1))
 54894  	_sqlite3VdbeMemShallowCopy(tls, &_2_c1, _pMem1, int32(4096))
 54895  	_sqlite3VdbeMemShallowCopy(tls, &_2_c2, _pMem2, int32(4096))
 54896  	_2_v1 = _sqlite3ValueText(tls, &_2_c1, _pColl.Xenc)
 54897  	_2_n1 = func() int32 {
 54898  		if _2_v1 == nil {
 54899  			return int32(0)
 54900  		}
 54901  		return _2_c1.Xn
 54902  	}()
 54903  	_2_v2 = _sqlite3ValueText(tls, &_2_c2, _pColl.Xenc)
 54904  	_2_n2 = func() int32 {
 54905  		if _2_v2 == nil {
 54906  			return int32(0)
 54907  		}
 54908  		return _2_c2.Xn
 54909  	}()
 54910  	_2_rc = _pColl.XxCmp(tls, _pColl.XpUser, _2_n1, _2_v1, _2_n2, _2_v2)
 54911  	if ((_2_v1 == nil) || (_2_v2 == nil)) && (_prcErr != nil) {
 54912  		*_prcErr = uint8(_sqlite3NomemError(tls, int32(75166)))
 54913  	}
 54914  	_sqlite3VdbeMemRelease(tls, &_2_c1)
 54915  	_sqlite3VdbeMemRelease(tls, &_2_c2)
 54916  	return _2_rc
 54917  }
 54918  
 54919  // C comment
 54920  //  /*
 54921  //  ** Initialize bulk memory to be a consistent Mem object.
 54922  //  **
 54923  //  ** The minimum amount of initialization feasible is performed.
 54924  //  */
 54925  func _sqlite3VdbeMemInit(tls *crt.TLS, _pMem *XMem, _db *Xsqlite3, _flags uint16) {
 54926  	func() {
 54927  		if (int32(_flags) & int32(-33280)) != int32(0) {
 54928  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70341), unsafe.Pointer(&_sqlite3VdbeMemInitØ00__func__Ø000), unsafe.Pointer(str(71772)))
 54929  			crt.X__builtin_abort(tls)
 54930  		}
 54931  	}()
 54932  	_pMem.Xflags = _flags
 54933  	*(**Xsqlite3)(unsafe.Pointer(&_pMem.Xdb)) = _db
 54934  	_pMem.XszMalloc = int32(0)
 54935  }
 54936  
 54937  var _sqlite3VdbeMemInitØ00__func__Ø000 [19]int8
 54938  
 54939  func init() {
 54940  	crt.Xstrncpy(nil, &_sqlite3VdbeMemInitØ00__func__Ø000[0], str(71799), 19)
 54941  }
 54942  
 54943  // C comment
 54944  //  /*
 54945  //  ** Compare two blobs.  Return negative, zero, or positive if the first
 54946  //  ** is less than, equal to, or greater than the second, respectively.
 54947  //  ** If one blob is a prefix of the other, then the shorter is the lessor.
 54948  //  */
 54949  func _sqlite3BlobCompare(tls *crt.TLS, _pB1 *XMem, _pB2 *XMem) (r0 int32) {
 54950  	var _c, _n1, _n2 int32
 54951  	_n1 = _pB1.Xn
 54952  	_n2 = _pB2.Xn
 54953  	func() {
 54954  		if (int32(_pB1.Xflags)&int32(16384)) != int32(0) && _n1 != int32(0) {
 54955  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75199), unsafe.Pointer(&_sqlite3BlobCompareØ00__func__Ø000), unsafe.Pointer(str(71818)))
 54956  			crt.X__builtin_abort(tls)
 54957  		}
 54958  	}()
 54959  	func() {
 54960  		if (int32(_pB2.Xflags)&int32(16384)) != int32(0) && _n2 != int32(0) {
 54961  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75200), unsafe.Pointer(&_sqlite3BlobCompareØ00__func__Ø000), unsafe.Pointer(str(71854)))
 54962  			crt.X__builtin_abort(tls)
 54963  		}
 54964  	}()
 54965  	if ((int32(_pB1.Xflags) | int32(_pB2.Xflags)) & int32(16384)) == 0 {
 54966  		goto _6
 54967  	}
 54968  	if ((int32(_pB1.Xflags) & int32(_pB2.Xflags)) & int32(16384)) != 0 {
 54969  		return (*(*int32)(unsafe.Pointer(&_pB1.Xu))) - (*(*int32)(unsafe.Pointer(&_pB2.Xu)))
 54970  	}
 54971  	if (int32(_pB1.Xflags) & int32(16384)) == 0 {
 54972  		goto _9
 54973  	}
 54974  	if _isAllZero(tls, _pB2.Xz, _pB2.Xn) == 0 {
 54975  		return int32(-1)
 54976  	}
 54977  	return (*(*int32)(unsafe.Pointer(&_pB1.Xu))) - _n2
 54978  
 54979  _9:
 54980  	if _isAllZero(tls, _pB1.Xz, _pB1.Xn) == 0 {
 54981  		return int32(1)
 54982  	}
 54983  	return _n1 - (*(*int32)(unsafe.Pointer(&_pB2.Xu)))
 54984  
 54985  _6:
 54986  	_c = crt.Xmemcmp(tls, unsafe.Pointer(_pB1.Xz), unsafe.Pointer(_pB2.Xz), uint64(func() int32 {
 54987  		if _n1 > _n2 {
 54988  			return _n2
 54989  		}
 54990  		return _n1
 54991  	}()))
 54992  	if _c != 0 {
 54993  		return _c
 54994  	}
 54995  	return _n1 - _n2
 54996  }
 54997  
 54998  var _sqlite3BlobCompareØ00__func__Ø000 [19]int8
 54999  
 55000  func init() {
 55001  	crt.Xstrncpy(nil, &_sqlite3BlobCompareØ00__func__Ø000[0], str(71890), 19)
 55002  }
 55003  
 55004  // C comment
 55005  //  /*
 55006  //  ** The input pBlob is guaranteed to be a Blob that is not marked
 55007  //  ** with MEM_Zero.  Return true if it could be a zero-blob.
 55008  //  */
 55009  func _isAllZero(tls *crt.TLS, _z *int8, _n int32) (r0 int32) {
 55010  	var _i int32
 55011  	_i = int32(0)
 55012  _0:
 55013  	if _i >= _n {
 55014  		goto _3
 55015  	}
 55016  	if (*elem1(_z, uintptr(_i))) != 0 {
 55017  		return int32(0)
 55018  	}
 55019  	_i += 1
 55020  	goto _0
 55021  _3:
 55022  	return int32(1)
 55023  }
 55024  
 55025  var _sqlite3VdbeExecØ00and_logicØ002 [9]uint8
 55026  
 55027  func init() {
 55028  	_sqlite3VdbeExecØ00and_logicØ002 = [9]uint8{0, 0, 0, 0, 1, 2, 0, 2, 2}
 55029  }
 55030  
 55031  var _sqlite3VdbeExecØ00or_logicØ003 [9]uint8
 55032  
 55033  func init() {
 55034  	_sqlite3VdbeExecØ00or_logicØ003 = [9]uint8{0, 1, 2, 1, 1, 1, 2, 1, 2}
 55035  }
 55036  
 55037  // C comment
 55038  //  /*
 55039  //  ** Make sure the cursor p is ready to read or write the row to which it
 55040  //  ** was last positioned.  Return an error code if an OOM fault or I/O error
 55041  //  ** prevents us from positioning the cursor to its correct position.
 55042  //  **
 55043  //  ** If a MoveTo operation is pending on the given cursor, then do that
 55044  //  ** MoveTo now.  If no move is pending, check to see if the row has been
 55045  //  ** deleted out from under the cursor and if it has, mark the row as
 55046  //  ** a NULL row.
 55047  //  **
 55048  //  ** If the cursor is already pointing to the correct row and that row has
 55049  //  ** not been deleted out from under the cursor, then this routine is a no-op.
 55050  //  */
 55051  func _sqlite3VdbeCursorMoveto(tls *crt.TLS, _pp **XVdbeCursor, _piCol *int32) (r0 int32) {
 55052  	var _2_iMap int32
 55053  	var _p *XVdbeCursor
 55054  	_p = *_pp
 55055  	if int32(_p.XeCurType) != int32(0) {
 55056  		goto _0
 55057  	}
 55058  	if _p.XdeferredMoveto == 0 {
 55059  		goto _1
 55060  	}
 55061  	if (_p.XaAltMap != nil) && (store2(&_2_iMap, *elem8(_p.XaAltMap, uintptr(int32(1)+(*_piCol)))) > int32(0)) {
 55062  		*_pp = (*XVdbeCursor)(_p.XpAltCursor)
 55063  		*_piCol = _2_iMap - int32(1)
 55064  		return int32(0)
 55065  	}
 55066  	return _handleDeferredMoveto(tls, _p)
 55067  
 55068  _1:
 55069  	if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc)))) != 0 {
 55070  		return _handleMovedCursor(tls, _p)
 55071  	}
 55072  _0:
 55073  	return int32(0)
 55074  }
 55075  
 55076  // C comment
 55077  //  /*
 55078  //  ** The cursor "p" has a pending seek operation that has not yet been
 55079  //  ** carried out.  Seek the cursor now.  If an error occurs, return
 55080  //  ** the appropriate error code.
 55081  //  */
 55082  func _handleDeferredMoveto(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) {
 55083  	var _res, _rc int32
 55084  	func() {
 55085  		if _p.XdeferredMoveto == 0 {
 55086  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74477), unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000), unsafe.Pointer(str(71909)))
 55087  			crt.X__builtin_abort(tls)
 55088  		}
 55089  	}()
 55090  	func() {
 55091  		if _p.XisTable == 0 {
 55092  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74478), unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000), unsafe.Pointer(str(71927)))
 55093  			crt.X__builtin_abort(tls)
 55094  		}
 55095  	}()
 55096  	func() {
 55097  		if int32(_p.XeCurType) != int32(0) {
 55098  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74479), unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000), unsafe.Pointer(str(71938)))
 55099  			crt.X__builtin_abort(tls)
 55100  		}
 55101  	}()
 55102  	_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc))), nil, _p.XmovetoTarget, int32(0), &_res)
 55103  	if _rc != 0 {
 55104  		return _rc
 55105  	}
 55106  	if _res != int32(0) {
 55107  		return _sqlite3CorruptError(tls, int32(74482))
 55108  	}
 55109  	_p.XdeferredMoveto = 0
 55110  	_p.XcacheStatus = 0
 55111  	return int32(0)
 55112  }
 55113  
 55114  var _handleDeferredMovetoØ00__func__Ø000 [21]int8
 55115  
 55116  func init() {
 55117  	crt.Xstrncpy(nil, &_handleDeferredMovetoØ00__func__Ø000[0], str(71965), 21)
 55118  }
 55119  
 55120  // C comment
 55121  //  /* Move the cursor so that it points to an entry near the key
 55122  //  ** specified by pIdxKey or intKey.   Return a success code.
 55123  //  **
 55124  //  ** For INTKEY tables, the intKey parameter is used.  pIdxKey
 55125  //  ** must be NULL.  For index tables, pIdxKey is used and intKey
 55126  //  ** is ignored.
 55127  //  **
 55128  //  ** If an exact match is not found, then the cursor is always
 55129  //  ** left pointing at a leaf page which would hold the entry if it
 55130  //  ** were present.  The cursor might point to an entry that comes
 55131  //  ** before or after the key.
 55132  //  **
 55133  //  ** An integer is written into *pRes which is the result of
 55134  //  ** comparing the key with the entry to which the cursor is
 55135  //  ** pointing.  The meaning of the integer written into
 55136  //  ** *pRes is as follows:
 55137  //  **
 55138  //  **     *pRes<0      The cursor is left pointing at an entry that
 55139  //  **                  is smaller than intKey/pIdxKey or if the table is empty
 55140  //  **                  and the cursor is therefore left point to nothing.
 55141  //  **
 55142  //  **     *pRes==0     The cursor is left pointing at an entry that
 55143  //  **                  exactly matches intKey/pIdxKey.
 55144  //  **
 55145  //  **     *pRes>0      The cursor is left pointing at an entry that
 55146  //  **                  is larger than intKey/pIdxKey.
 55147  //  **
 55148  //  ** For index tables, the pIdxKey->eqSeen field is set to 1 if there
 55149  //  ** exists an entry in the table that exactly matches pIdxKey.
 55150  //  */
 55151  func _sqlite3BtreeMovetoUnpacked(tls *crt.TLS, _pCur *XBtCursor, _pIdxKey *XUnpackedRecord, _intKey int64, _biasRight int32, _pRes *int32) (r0 int32) {
 55152  	var _rc, _12_lwr, _12_upr, _12_idx, _12_c, _25_nCell int32
 55153  	var _14_nCellKey int64
 55154  	var _12_chldPg uint32
 55155  	var _28_pCellKey unsafe.Pointer
 55156  	var _12_pCell, _28_pCellBody *uint8
 55157  	var _12_pPage *XMemPage
 55158  	var _xRecordCompare func(*crt.TLS, int32, unsafe.Pointer, *XUnpackedRecord) int32
 55159  	func() {
 55160  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 55161  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64180), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(71986)))
 55162  			crt.X__builtin_abort(tls)
 55163  		}
 55164  	}()
 55165  	func() {
 55166  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).Xmutex)) == 0 {
 55167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64181), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72011)))
 55168  			crt.X__builtin_abort(tls)
 55169  		}
 55170  	}()
 55171  	func() {
 55172  		if _pRes == nil {
 55173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64182), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72055)))
 55174  			crt.X__builtin_abort(tls)
 55175  		}
 55176  	}()
 55177  	func() {
 55178  		if (_pIdxKey == nil) != ((*XKeyInfo)(_pCur.XpKeyInfo) == nil) {
 55179  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64183), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72060)))
 55180  			crt.X__builtin_abort(tls)
 55181  		}
 55182  	}()
 55183  	func() {
 55184  		if int32(_pCur.XeState) == int32(1) && (_pIdxKey == nil) != (int32(_pCur.XcurIntKey) != int32(0)) {
 55185  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64184), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72094)))
 55186  			crt.X__builtin_abort(tls)
 55187  		}
 55188  	}()
 55189  	if _pIdxKey != nil || int32(_pCur.XeState) != int32(1) || (int32(_pCur.XcurFlags)&int32(2)) == int32(0) {
 55190  		goto _13
 55191  	}
 55192  	if (_pCur.Xinfo.XnKey) == _intKey {
 55193  		*_pRes = int32(0)
 55194  		return int32(0)
 55195  	}
 55196  	if (_pCur.Xinfo.XnKey) >= _intKey {
 55197  		goto _15
 55198  	}
 55199  	if (int32(_pCur.XcurFlags) & int32(8)) != int32(0) {
 55200  		*_pRes = int32(-1)
 55201  		return int32(0)
 55202  	}
 55203  	if ((_pCur.Xinfo.XnKey)+int64(1)) != _intKey || _pCur.XskipNext != 0 {
 55204  		goto _18
 55205  	}
 55206  	*_pRes = int32(0)
 55207  	_rc = _sqlite3BtreeNext(tls, _pCur, _pRes)
 55208  	if _rc != 0 {
 55209  		return _rc
 55210  	}
 55211  	if (*_pRes) != int32(0) {
 55212  		goto _20
 55213  	}
 55214  	_getCellInfo(tls, _pCur)
 55215  	if (_pCur.Xinfo.XnKey) == _intKey {
 55216  		return int32(0)
 55217  	}
 55218  _20:
 55219  _18:
 55220  _15:
 55221  _13:
 55222  	if _pIdxKey != nil {
 55223  		_xRecordCompare = _sqlite3VdbeFindCompare(tls, _pIdxKey)
 55224  		_pIdxKey.XerrCode = 0
 55225  		func() {
 55226  			if int32(_pIdxKey.Xdefault_rc) != int32(1) && int32(_pIdxKey.Xdefault_rc) != int32(0) && int32(_pIdxKey.Xdefault_rc) != int32(-1) {
 55227  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64221), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72159)))
 55228  				crt.X__builtin_abort(tls)
 55229  			}
 55230  		}()
 55231  		goto _27
 55232  	}
 55233  	_xRecordCompare = nil
 55234  _27:
 55235  	_rc = _moveToRoot(tls, _pCur)
 55236  	if _rc != 0 {
 55237  		return _rc
 55238  	}
 55239  	func() {
 55240  		if _pCur.XpgnoRoot != (0) && (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) == nil {
 55241  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64233), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72235)))
 55242  			crt.X__builtin_abort(tls)
 55243  		}
 55244  	}()
 55245  	func() {
 55246  		if _pCur.XpgnoRoot != (0) && ((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XisInit) == 0 {
 55247  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64234), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72282)))
 55248  			crt.X__builtin_abort(tls)
 55249  		}
 55250  	}()
 55251  	func() {
 55252  		if int32(_pCur.XeState) != int32(0) && int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) <= int32(0) {
 55253  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64235), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72337)))
 55254  			crt.X__builtin_abort(tls)
 55255  		}
 55256  	}()
 55257  	if int32(_pCur.XeState) == int32(0) {
 55258  		*_pRes = int32(-1)
 55259  		func() {
 55260  			if _pCur.XpgnoRoot != (0) && int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) != int32(0) {
 55261  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64238), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72404)))
 55262  				crt.X__builtin_abort(tls)
 55263  			}
 55264  		}()
 55265  		return int32(0)
 55266  	}
 55267  	func() {
 55268  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), 0)).XintKey) != int32(_pCur.XcurIntKey) {
 55269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64241), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72461)))
 55270  			crt.X__builtin_abort(tls)
 55271  		}
 55272  	}()
 55273  	func() {
 55274  		if _pCur.XcurIntKey == 0 && _pIdxKey == nil {
 55275  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64242), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72502)))
 55276  			crt.X__builtin_abort(tls)
 55277  		}
 55278  	}()
 55279  _47:
 55280  	_12_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 55281  	func() {
 55282  		if int32(_12_pPage.XnCell) <= int32(0) {
 55283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64255), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72529)))
 55284  			crt.X__builtin_abort(tls)
 55285  		}
 55286  	}()
 55287  	func() {
 55288  		if int32(_12_pPage.XintKey) != bool2int(_pIdxKey == nil) {
 55289  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64256), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72544)))
 55290  			crt.X__builtin_abort(tls)
 55291  		}
 55292  	}()
 55293  	_12_lwr = int32(0)
 55294  	_12_upr = int32(_12_pPage.XnCell) - int32(1)
 55295  	func() {
 55296  		if _biasRight != int32(0) && _biasRight != int32(1) {
 55297  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64259), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72572)))
 55298  			crt.X__builtin_abort(tls)
 55299  		}
 55300  	}()
 55301  	_12_idx = _12_upr >> uint(int32(1)-_biasRight)
 55302  	_pCur.Xix = uint16(_12_idx)
 55303  	if _xRecordCompare != nil {
 55304  		goto _57
 55305  	}
 55306  _58:
 55307  	_12_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.XaDataOfst)) + uintptr(int32(_12_pPage.XmaskPage)&((int32(*elem15(elem15(_12_pPage.XaCellIdx, uintptr(int32(2)*_12_idx)), 0))<<8)|int32(*elem15(elem15(_12_pPage.XaCellIdx, uintptr(int32(2)*_12_idx)), uintptr(1)))))))
 55308  	if _12_pPage.XintKeyLeaf == 0 {
 55309  		goto _61
 55310  	}
 55311  _62:
 55312  	if int32(128) > int32(*postInc15(&_12_pCell, 1)) {
 55313  		goto _63
 55314  	}
 55315  	if crt.P2U(unsafe.Pointer(_12_pCell)) >= crt.P2U(unsafe.Pointer(_12_pPage.XaDataEnd)) {
 55316  		return _sqlite3CorruptError(tls, int32(64268))
 55317  	}
 55318  	goto _62
 55319  _63:
 55320  _61:
 55321  	_sqlite3GetVarint(tls, _12_pCell, (*uint64)(unsafe.Pointer(&_14_nCellKey)))
 55322  	if _14_nCellKey >= _intKey {
 55323  		goto _65
 55324  	}
 55325  	_12_lwr = _12_idx + int32(1)
 55326  	if _12_lwr > _12_upr {
 55327  		_12_c = int32(-1)
 55328  		goto _60
 55329  	}
 55330  	goto _70
 55331  _65:
 55332  	if _14_nCellKey <= _intKey {
 55333  		goto _68
 55334  	}
 55335  	_12_upr = _12_idx - int32(1)
 55336  	if _12_lwr > _12_upr {
 55337  		_12_c = int32(1)
 55338  		goto _60
 55339  	}
 55340  	goto _70
 55341  _68:
 55342  	func() {
 55343  		if _14_nCellKey != _intKey {
 55344  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64279), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72601)))
 55345  			crt.X__builtin_abort(tls)
 55346  		}
 55347  	}()
 55348  	_pCur.Xix = uint16(_12_idx)
 55349  	if _12_pPage.Xleaf == 0 {
 55350  		_12_lwr = _12_idx
 55351  		goto _moveto_next_layer
 55352  	}
 55353  	{
 55354  		p := &_pCur.XcurFlags
 55355  		*p = uint8(int32(*p) | int32(2))
 55356  	}
 55357  	_pCur.Xinfo.XnKey = _14_nCellKey
 55358  	_pCur.Xinfo.XnSize = 0
 55359  	*_pRes = int32(0)
 55360  	return int32(0)
 55361  
 55362  _70:
 55363  	func() {
 55364  		if (_12_lwr + _12_upr) < int32(0) {
 55365  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64292), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72618)))
 55366  			crt.X__builtin_abort(tls)
 55367  		}
 55368  	}()
 55369  	_12_idx = (_12_lwr + _12_upr) >> 1
 55370  	goto _58
 55371  _60:
 55372  	goto _77
 55373  _57:
 55374  _78:
 55375  	_12_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.XaDataOfst)) + uintptr(int32(_12_pPage.XmaskPage)&((int32(*elem15(elem15(_12_pPage.XaCellIdx, uintptr(int32(2)*_12_idx)), 0))<<8)|int32(*elem15(elem15(_12_pPage.XaCellIdx, uintptr(int32(2)*_12_idx)), uintptr(1)))))))
 55376  	_25_nCell = int32(*elem15(_12_pCell, 0))
 55377  	if _25_nCell <= int32(_12_pPage.Xmax1bytePayload) {
 55378  		_12_c = _xRecordCompare(tls, _25_nCell, unsafe.Pointer(elem15(_12_pCell, uintptr(1))), _pIdxKey)
 55379  		goto _85
 55380  	}
 55381  	if ((int32(*elem15(_12_pCell, uintptr(1))) & int32(128)) == 0) && (store2(&_25_nCell, ((_25_nCell&int32(127))<<7)+int32(*elem15(_12_pCell, uintptr(1)))) <= int32(_12_pPage.XmaxLocal)) {
 55382  		_12_c = _xRecordCompare(tls, _25_nCell, unsafe.Pointer(elem15(_12_pCell, uintptr(2))), _pIdxKey)
 55383  		goto _85
 55384  	}
 55385  	_28_pCellBody = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pCell)) - uintptr(_12_pPage.XchildPtrSize)))
 55386  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 55387  		v := _12_pPage.XxParseCell
 55388  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 55389  	}()(tls, _12_pPage, _28_pCellBody, &_pCur.Xinfo)
 55390  	_25_nCell = int32(_pCur.Xinfo.XnKey)
 55391  	if _25_nCell < int32(2) {
 55392  		_rc = _sqlite3CorruptError(tls, int32(64341))
 55393  		goto _moveto_finish
 55394  	}
 55395  	_28_pCellKey = _sqlite3Malloc(tls, uint64(_25_nCell+int32(18)))
 55396  	if _28_pCellKey == nil {
 55397  		_rc = _sqlite3NomemError(tls, int32(64346))
 55398  		goto _moveto_finish
 55399  	}
 55400  	_pCur.Xix = uint16(_12_idx)
 55401  	_rc = _accessPayload(tls, _pCur, 0, uint32(_25_nCell), (*uint8)(_28_pCellKey), int32(0))
 55402  	{
 55403  		p := &_pCur.XcurFlags
 55404  		*p = uint8(int32(*p) & int32(-5))
 55405  	}
 55406  	if _rc != 0 {
 55407  		Xsqlite3_free(tls, _28_pCellKey)
 55408  		goto _moveto_finish
 55409  	}
 55410  	_12_c = _xRecordCompare(tls, _25_nCell, _28_pCellKey, _pIdxKey)
 55411  	Xsqlite3_free(tls, _28_pCellKey)
 55412  _85:
 55413  	func() {
 55414  		if int32(_pIdxKey.XerrCode) == int32(11) && _12_c != int32(0) || int32(_pIdxKey.XerrCode) == int32(7) && ((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).XmallocFailed) == 0 {
 55415  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64359), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72629)))
 55416  			crt.X__builtin_abort(tls)
 55417  		}
 55418  	}()
 55419  	if _12_c < int32(0) {
 55420  		_12_lwr = _12_idx + int32(1)
 55421  		goto _97
 55422  	}
 55423  	if _12_c > int32(0) {
 55424  		_12_upr = _12_idx - int32(1)
 55425  		goto _97
 55426  	}
 55427  	func() {
 55428  		if _12_c != int32(0) {
 55429  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64368), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72742)))
 55430  			crt.X__builtin_abort(tls)
 55431  		}
 55432  	}()
 55433  	*_pRes = int32(0)
 55434  	_rc = int32(0)
 55435  	_pCur.Xix = uint16(_12_idx)
 55436  	if _pIdxKey.XerrCode != 0 {
 55437  		_rc = int32(11)
 55438  	}
 55439  	goto _moveto_finish
 55440  _97:
 55441  	if _12_lwr > _12_upr {
 55442  		goto _80
 55443  	}
 55444  	func() {
 55445  		if (_12_lwr + _12_upr) < int32(0) {
 55446  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64376), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72618)))
 55447  			crt.X__builtin_abort(tls)
 55448  		}
 55449  	}()
 55450  	_12_idx = (_12_lwr + _12_upr) >> 1
 55451  	goto _78
 55452  _80:
 55453  _77:
 55454  	func() {
 55455  		if _12_lwr != (_12_upr+int32(1)) && (_12_pPage.XintKey == 0 || _12_pPage.Xleaf != 0) {
 55456  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64380), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72747)))
 55457  			crt.X__builtin_abort(tls)
 55458  		}
 55459  	}()
 55460  	func() {
 55461  		if _12_pPage.XisInit == 0 {
 55462  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64381), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72793)))
 55463  			crt.X__builtin_abort(tls)
 55464  		}
 55465  	}()
 55466  	if _12_pPage.Xleaf != 0 {
 55467  		func() {
 55468  			if int32(_pCur.Xix) >= int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) {
 55469  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64383), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(10552)))
 55470  				crt.X__builtin_abort(tls)
 55471  			}
 55472  		}()
 55473  		_pCur.Xix = uint16(_12_idx)
 55474  		*_pRes = _12_c
 55475  		_rc = int32(0)
 55476  		goto _moveto_finish
 55477  	}
 55478  _moveto_next_layer:
 55479  	if _12_lwr >= int32(_12_pPage.XnCell) {
 55480  		_12_chldPg = _sqlite3Get4byte(tls, elem15(_12_pPage.XaData, uintptr(int32(_12_pPage.XhdrOffset)+int32(8))))
 55481  		goto _114
 55482  	}
 55483  	_12_chldPg = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.XaData))+uintptr(int32(_12_pPage.XmaskPage)&((int32(*elem15(elem15(_12_pPage.XaCellIdx, uintptr(int32(2)*_12_lwr)), 0))<<8)|int32(*elem15(elem15(_12_pPage.XaCellIdx, uintptr(int32(2)*_12_lwr)), uintptr(1))))))))
 55484  _114:
 55485  	_pCur.Xix = uint16(_12_lwr)
 55486  	_rc = _moveToChild(tls, _pCur, _12_chldPg)
 55487  	if _rc != 0 {
 55488  		goto _moveto_finish
 55489  	}
 55490  	goto _47
 55491  _moveto_finish:
 55492  	_pCur.Xinfo.XnSize = 0
 55493  	func() {
 55494  		if (int32(_pCur.XcurFlags) & int32(4)) != int32(0) {
 55495  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64401), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72807)))
 55496  			crt.X__builtin_abort(tls)
 55497  		}
 55498  	}()
 55499  	return _rc
 55500  }
 55501  
 55502  // C comment
 55503  //  /* Verify that the cursor and the BtShared agree about what is the current
 55504  //  ** database connetion. This is important in shared-cache mode. If the database
 55505  //  ** connection pointers get out-of-sync, it is possible for routines like
 55506  //  ** btreeInitPage() to reference an stale connection pointer that references a
 55507  //  ** a connection that has already closed.  This routine is used inside assert()
 55508  //  ** statements only and for the purpose of double-checking that the btree code
 55509  //  ** does keep the database connection pointers up-to-date.
 55510  //  */
 55511  func _cursorOwnsBtShared(tls *crt.TLS, _p *XBtCursor) (r0 int32) {
 55512  	func() {
 55513  		if _cursorHoldsMutex(tls, _p) == 0 {
 55514  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59497), unsafe.Pointer(&_cursorOwnsBtSharedØ00__func__Ø000), unsafe.Pointer(str(72844)))
 55515  			crt.X__builtin_abort(tls)
 55516  		}
 55517  	}()
 55518  	return bool2int((*Xsqlite3)((*XBtree)(_p.XpBtree).Xdb) == (*Xsqlite3)((*XBtShared)(_p.XpBt).Xdb))
 55519  }
 55520  
 55521  var _cursorOwnsBtSharedØ00__func__Ø000 [19]int8
 55522  
 55523  func init() {
 55524  	crt.Xstrncpy(nil, &_cursorOwnsBtSharedØ00__func__Ø000[0], str(72864), 19)
 55525  }
 55526  
 55527  var _sqlite3BtreeMovetoUnpackedØ00__func__Ø000 [27]int8
 55528  
 55529  func init() {
 55530  	crt.Xstrncpy(nil, &_sqlite3BtreeMovetoUnpackedØ00__func__Ø000[0], str(72883), 27)
 55531  }
 55532  
 55533  func _sqlite3BtreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 55534  	var _pPage *XMemPage
 55535  	func() {
 55536  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 55537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64535), unsafe.Pointer(&_sqlite3BtreeNextØ00__func__Ø000), unsafe.Pointer(str(71986)))
 55538  			crt.X__builtin_abort(tls)
 55539  		}
 55540  	}()
 55541  	func() {
 55542  		if _pRes == nil {
 55543  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64536), unsafe.Pointer(&_sqlite3BtreeNextØ00__func__Ø000), unsafe.Pointer(str(72910)))
 55544  			crt.X__builtin_abort(tls)
 55545  		}
 55546  	}()
 55547  	func() {
 55548  		if (*_pRes) != int32(0) && (*_pRes) != int32(1) {
 55549  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64537), unsafe.Pointer(&_sqlite3BtreeNextØ00__func__Ø000), unsafe.Pointer(str(72918)))
 55550  			crt.X__builtin_abort(tls)
 55551  		}
 55552  	}()
 55553  	func() {
 55554  		if _pCur.XskipNext != int32(0) && int32(_pCur.XeState) == int32(1) {
 55555  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64538), unsafe.Pointer(&_sqlite3BtreeNextØ00__func__Ø000), unsafe.Pointer(str(72939)))
 55556  			crt.X__builtin_abort(tls)
 55557  		}
 55558  	}()
 55559  	_pCur.Xinfo.XnSize = 0
 55560  	{
 55561  		p := &_pCur.XcurFlags
 55562  		*p = uint8(int32(*p) & int32(-7))
 55563  	}
 55564  	*_pRes = int32(0)
 55565  	if int32(_pCur.XeState) != int32(1) {
 55566  		return _btreeNext(tls, _pCur, _pRes)
 55567  	}
 55568  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 55569  	if int32(preInc78(&_pCur.Xix, uint16(1))) >= int32(_pPage.XnCell) {
 55570  		_pCur.Xix -= 1
 55571  		return _btreeNext(tls, _pCur, _pRes)
 55572  	}
 55573  	if _pPage.Xleaf != 0 {
 55574  		return int32(0)
 55575  	}
 55576  	return _moveToLeftmost(tls, _pCur)
 55577  }
 55578  
 55579  var _sqlite3BtreeNextØ00__func__Ø000 [17]int8
 55580  
 55581  func init() {
 55582  	crt.Xstrncpy(nil, &_sqlite3BtreeNextØ00__func__Ø000[0], str(72987), 17)
 55583  }
 55584  
 55585  // C comment
 55586  //  /*
 55587  //  ** Advance the cursor to the next entry in the database.  If
 55588  //  ** successful then set *pRes=0.  If the cursor
 55589  //  ** was already pointing to the last entry in the database before
 55590  //  ** this routine was called, then set *pRes=1.
 55591  //  **
 55592  //  ** The main entry point is sqlite3BtreeNext().  That routine is optimized
 55593  //  ** for the common case of merely incrementing the cell counter BtCursor.aiIdx
 55594  //  ** to the next cell on the current page.  The (slower) btreeNext() helper
 55595  //  ** routine is called when it is necessary to move to a different page or
 55596  //  ** to restore the cursor.
 55597  //  **
 55598  //  ** The calling function will set *pRes to 0 or 1.  The initial *pRes value
 55599  //  ** will be 1 if the cursor being stepped corresponds to an SQL index and
 55600  //  ** if this routine could have been skipped if that SQL index had been
 55601  //  ** a unique index.  Otherwise the caller will have set *pRes to zero.
 55602  //  ** Zero is the common case. The btree implementation is free to use the
 55603  //  ** initial *pRes value as a hint to improve performance, but the current
 55604  //  ** SQLite btree implementation does not. (Note that the comdb2 btree
 55605  //  ** implementation does use this hint, however.)
 55606  //  */
 55607  func _btreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 55608  	var _rc, _idx int32
 55609  	var _pPage *XMemPage
 55610  	func() {
 55611  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 55612  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64471), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(71986)))
 55613  			crt.X__builtin_abort(tls)
 55614  		}
 55615  	}()
 55616  	func() {
 55617  		if _pCur.XskipNext != int32(0) && int32(_pCur.XeState) == int32(1) {
 55618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64472), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(72939)))
 55619  			crt.X__builtin_abort(tls)
 55620  		}
 55621  	}()
 55622  	func() {
 55623  		if (*_pRes) != int32(0) {
 55624  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64473), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(73004)))
 55625  			crt.X__builtin_abort(tls)
 55626  		}
 55627  	}()
 55628  	if int32(_pCur.XeState) == int32(1) {
 55629  		goto _7
 55630  	}
 55631  	func() {
 55632  		if (int32(_pCur.XcurFlags) & int32(4)) != int32(0) {
 55633  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64475), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(72807)))
 55634  			crt.X__builtin_abort(tls)
 55635  		}
 55636  	}()
 55637  	_rc = func() int32 {
 55638  		if int32(_pCur.XeState) >= int32(3) {
 55639  			return _btreeRestoreCursorPosition(tls, _pCur)
 55640  		}
 55641  		return int32(0)
 55642  	}()
 55643  	if _rc != int32(0) {
 55644  		return _rc
 55645  	}
 55646  	if int32(0) == int32(_pCur.XeState) {
 55647  		*_pRes = int32(1)
 55648  		return int32(0)
 55649  	}
 55650  	if _pCur.XskipNext == 0 {
 55651  		goto _14
 55652  	}
 55653  	func() {
 55654  		if int32(_pCur.XeState) != int32(1) && int32(_pCur.XeState) != int32(2) {
 55655  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64485), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(73013)))
 55656  			crt.X__builtin_abort(tls)
 55657  		}
 55658  	}()
 55659  	_pCur.XeState = uint8(1)
 55660  	if _pCur.XskipNext > int32(0) {
 55661  		_pCur.XskipNext = int32(0)
 55662  		return int32(0)
 55663  	}
 55664  	_pCur.XskipNext = int32(0)
 55665  _14:
 55666  _7:
 55667  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 55668  	_idx = int32(preInc78(&_pCur.Xix, uint16(1)))
 55669  	func() {
 55670  		if _pPage.XisInit == 0 {
 55671  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64497), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(72793)))
 55672  			crt.X__builtin_abort(tls)
 55673  		}
 55674  	}()
 55675  	if _idx < int32(_pPage.XnCell) {
 55676  		goto _21
 55677  	}
 55678  	if _pPage.Xleaf != 0 {
 55679  		goto _22
 55680  	}
 55681  	_rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, elem15(_pPage.XaData, uintptr(int32(_pPage.XhdrOffset)+int32(8)))))
 55682  	if _rc != 0 {
 55683  		return _rc
 55684  	}
 55685  	return _moveToLeftmost(tls, _pCur)
 55686  
 55687  _22:
 55688  	if int32(_pCur.XiPage) == int32(0) {
 55689  		*_pRes = int32(1)
 55690  		_pCur.XeState = 0
 55691  		return int32(0)
 55692  	}
 55693  	_moveToParent(tls, _pCur)
 55694  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 55695  	if int32(_pCur.Xix) >= int32(_pPage.XnCell) {
 55696  		goto _22
 55697  	}
 55698  	if _pPage.XintKey != 0 {
 55699  		return _sqlite3BtreeNext(tls, _pCur, _pRes)
 55700  	}
 55701  	return int32(0)
 55702  
 55703  _21:
 55704  	if _pPage.Xleaf != 0 {
 55705  		return int32(0)
 55706  	}
 55707  	return _moveToLeftmost(tls, _pCur)
 55708  }
 55709  
 55710  var _btreeNextØ00__func__Ø000 [10]int8
 55711  
 55712  func init() {
 55713  	crt.Xstrncpy(nil, &_btreeNextØ00__func__Ø000[0], str(73073), 10)
 55714  }
 55715  
 55716  // C comment
 55717  //  /*
 55718  //  ** Restore the cursor to the position it was in (or as close to as possible)
 55719  //  ** when saveCursorPosition() was called. Note that this call deletes the
 55720  //  ** saved position info stored by saveCursorPosition(), so there can be
 55721  //  ** at most one effective restoreCursorPosition() call after each
 55722  //  ** saveCursorPosition().
 55723  //  */
 55724  func _btreeRestoreCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 55725  	var _rc, _skipNext int32
 55726  	func() {
 55727  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 55728  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59832), unsafe.Pointer(&_btreeRestoreCursorPositionØ00__func__Ø000), unsafe.Pointer(str(71986)))
 55729  			crt.X__builtin_abort(tls)
 55730  		}
 55731  	}()
 55732  	func() {
 55733  		if int32(_pCur.XeState) < int32(3) {
 55734  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59833), unsafe.Pointer(&_btreeRestoreCursorPositionØ00__func__Ø000), unsafe.Pointer(str(73083)))
 55735  			crt.X__builtin_abort(tls)
 55736  		}
 55737  	}()
 55738  	if int32(_pCur.XeState) == int32(4) {
 55739  		return _pCur.XskipNext
 55740  	}
 55741  	_pCur.XeState = 0
 55742  	_rc = _btreeMoveto(tls, _pCur, _pCur.XpKey, _pCur.XnKey, int32(0), &_skipNext)
 55743  	if _rc != int32(0) {
 55744  		goto _5
 55745  	}
 55746  	Xsqlite3_free(tls, _pCur.XpKey)
 55747  	_pCur.XpKey = nil
 55748  	func() {
 55749  		if int32(_pCur.XeState) != int32(1) && int32(_pCur.XeState) != int32(0) {
 55750  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59842), unsafe.Pointer(&_btreeRestoreCursorPositionØ00__func__Ø000), unsafe.Pointer(str(73116)))
 55751  			crt.X__builtin_abort(tls)
 55752  		}
 55753  	}()
 55754  	_pCur.XskipNext |= _skipNext
 55755  	if _pCur.XskipNext != 0 && (int32(_pCur.XeState) == int32(1)) {
 55756  		_pCur.XeState = uint8(2)
 55757  	}
 55758  _5:
 55759  	return _rc
 55760  }
 55761  
 55762  var _btreeRestoreCursorPositionØ00__func__Ø000 [27]int8
 55763  
 55764  func init() {
 55765  	crt.Xstrncpy(nil, &_btreeRestoreCursorPositionØ00__func__Ø000[0], str(73175), 27)
 55766  }
 55767  
 55768  // C comment
 55769  //  /*
 55770  //  ** In this version of BtreeMoveto, pKey is a packed index record
 55771  //  ** such as is generated by the OP_MakeRecord opcode.  Unpack the
 55772  //  ** record and then call BtreeMovetoUnpacked() to do the work.
 55773  //  */
 55774  func _btreeMoveto(tls *crt.TLS, _pCur *XBtCursor, _pKey unsafe.Pointer, _nKey int64, _bias int32, _pRes *int32) (r0 int32) {
 55775  	var _rc int32
 55776  	var _pIdxKey *XUnpackedRecord
 55777  	if _pKey == nil {
 55778  		goto _0
 55779  	}
 55780  	func() {
 55781  		if _nKey != int64(int32(_nKey)) {
 55782  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59803), unsafe.Pointer(&_btreeMovetoØ00__func__Ø000), unsafe.Pointer(str(73202)))
 55783  			crt.X__builtin_abort(tls)
 55784  		}
 55785  	}()
 55786  	_pIdxKey = _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)(_pCur.XpKeyInfo))
 55787  	if _pIdxKey == nil {
 55788  		return _sqlite3NomemError(tls, int32(59805))
 55789  	}
 55790  	_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)(_pCur.XpKeyInfo), int32(_nKey), _pKey, _pIdxKey)
 55791  	if int32(_pIdxKey.XnField) == int32(0) {
 55792  		_rc = _sqlite3CorruptError(tls, int32(59808))
 55793  		goto _moveto_done
 55794  	}
 55795  	goto _5
 55796  _0:
 55797  	_pIdxKey = nil
 55798  _5:
 55799  	_rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, _pIdxKey, _nKey, _bias, _pRes)
 55800  _moveto_done:
 55801  	if _pIdxKey != nil {
 55802  		_sqlite3DbFree(tls, (*Xsqlite3)((*XKeyInfo)(_pCur.XpKeyInfo).Xdb), unsafe.Pointer(_pIdxKey))
 55803  	}
 55804  	return _rc
 55805  }
 55806  
 55807  var _btreeMovetoØ00__func__Ø000 [12]int8
 55808  
 55809  func init() {
 55810  	crt.Xstrncpy(nil, &_btreeMovetoØ00__func__Ø000[0], str(73223), 12)
 55811  }
 55812  
 55813  // C comment
 55814  //  /*
 55815  //  ** This routine is used to allocate sufficient space for an UnpackedRecord
 55816  //  ** structure large enough to be used with sqlite3VdbeRecordUnpack() if
 55817  //  ** the first argument is a pointer to KeyInfo structure pKeyInfo.
 55818  //  **
 55819  //  ** The space is either allocated using sqlite3DbMallocRaw() or from within
 55820  //  ** the unaligned buffer passed via the second and third arguments (presumably
 55821  //  ** stack space). If the former, then *ppFree is set to a pointer that should
 55822  //  ** be eventually freed by the caller using sqlite3DbFree(). Or, if the
 55823  //  ** allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL
 55824  //  ** before returning.
 55825  //  **
 55826  //  ** If an OOM error occurs, NULL is returned.
 55827  //  */
 55828  func _sqlite3VdbeAllocUnpackedRecord(tls *crt.TLS, _pKeyInfo *XKeyInfo) (r0 *XUnpackedRecord) {
 55829  	var _nByte int32
 55830  	var _p *XUnpackedRecord
 55831  	_nByte = int32(uint64(24) + (uint64(72) * uint64(int32(_pKeyInfo.XnField)+int32(1))))
 55832  	_p = (*XUnpackedRecord)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pKeyInfo.Xdb), uint64(_nByte)))
 55833  	if _p == nil {
 55834  		return nil
 55835  	}
 55836  	*(**XMem)(unsafe.Pointer(&_p.XaMem)) = (*XMem)(unsafe.Pointer(elem1((*int8)(unsafe.Pointer(_p)), uintptr(24))))
 55837  	func() {
 55838  		if _pKeyInfo.XaSortOrder == nil {
 55839  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74948), unsafe.Pointer(&_sqlite3VdbeAllocUnpackedRecordØ00__func__Ø000), unsafe.Pointer(str(37807)))
 55840  			crt.X__builtin_abort(tls)
 55841  		}
 55842  	}()
 55843  	*(**XKeyInfo)(unsafe.Pointer(&_p.XpKeyInfo)) = _pKeyInfo
 55844  	_p.XnField = uint16(int32(_pKeyInfo.XnField) + int32(1))
 55845  	return _p
 55846  }
 55847  
 55848  var _sqlite3VdbeAllocUnpackedRecordØ00__func__Ø000 [31]int8
 55849  
 55850  func init() {
 55851  	crt.Xstrncpy(nil, &_sqlite3VdbeAllocUnpackedRecordØ00__func__Ø000[0], str(73235), 31)
 55852  }
 55853  
 55854  func _sqlite3VdbeRecordUnpack(tls *crt.TLS, _pKeyInfo *XKeyInfo, _nKey int32, _pKey unsafe.Pointer, _p *XUnpackedRecord) {
 55855  	var _d int32
 55856  	var _idx, _szHdr, _1_serial_type uint32
 55857  	var _u uint16
 55858  	var _aKey *uint8
 55859  	var _pMem *XMem
 55860  	_aKey = (*uint8)(_pKey)
 55861  	_pMem = (*XMem)(_p.XaMem)
 55862  	_p.Xdefault_rc = 0
 55863  	func() {
 55864  		if (int64(uintptr(unsafe.Pointer(_pMem))) & int64(7)) != (0) {
 55865  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74973), unsafe.Pointer(&_sqlite3VdbeRecordUnpackØ00__func__Ø000), unsafe.Pointer(str(6222)))
 55866  			crt.X__builtin_abort(tls)
 55867  		}
 55868  	}()
 55869  	_idx = uint32(uint8(func() int32 {
 55870  		if int32(*_aKey) < int32(128) {
 55871  			return func() int32 { _szHdr = uint32(*_aKey); return int32(1) }()
 55872  		}
 55873  		return int32(_sqlite3GetVarint32(tls, _aKey, &_szHdr))
 55874  	}()))
 55875  	_d = int32(_szHdr)
 55876  	_u = 0
 55877  _4:
 55878  	if _idx >= _szHdr || _d > _nKey {
 55879  		goto _5
 55880  	}
 55881  	_idx += uint32(uint8(func() int32 {
 55882  		if int32(*elem15(_aKey, uintptr(_idx))) < int32(128) {
 55883  			return func() int32 { _1_serial_type = uint32(*elem15(_aKey, uintptr(_idx))); return int32(1) }()
 55884  		}
 55885  		return int32(_sqlite3GetVarint32(tls, elem15(_aKey, uintptr(_idx)), &_1_serial_type))
 55886  	}()))
 55887  	_pMem.Xenc = _pKeyInfo.Xenc
 55888  	*(**Xsqlite3)(unsafe.Pointer(&_pMem.Xdb)) = (*Xsqlite3)(_pKeyInfo.Xdb)
 55889  	_pMem.XszMalloc = int32(0)
 55890  	_pMem.Xz = nil
 55891  	{
 55892  		p := &_d
 55893  		*p = int32(uint32(*p) + _sqlite3VdbeSerialGet(tls, elem15(_aKey, uintptr(_d)), _1_serial_type, _pMem))
 55894  	}
 55895  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72)
 55896  	if int32(preInc78(&_u, uint16(1))) >= int32(_p.XnField) {
 55897  		goto _5
 55898  	}
 55899  	goto _4
 55900  _5:
 55901  	func() {
 55902  		if int32(_u) > (int32(_pKeyInfo.XnField) + int32(1)) {
 55903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74990), unsafe.Pointer(&_sqlite3VdbeRecordUnpackØ00__func__Ø000), unsafe.Pointer(str(73266)))
 55904  			crt.X__builtin_abort(tls)
 55905  		}
 55906  	}()
 55907  	_p.XnField = _u
 55908  }
 55909  
 55910  var _sqlite3VdbeRecordUnpackØ00__func__Ø000 [24]int8
 55911  
 55912  func init() {
 55913  	crt.Xstrncpy(nil, &_sqlite3VdbeRecordUnpackØ00__func__Ø000[0], str(73290), 24)
 55914  }
 55915  
 55916  // C comment
 55917  //  /*
 55918  //  ** Read a 32-bit variable-length integer from memory starting at p[0].
 55919  //  ** Return the number of bytes read.  The value is stored in *v.
 55920  //  **
 55921  //  ** If the varint stored in p[0] is larger than can fit in a 32-bit unsigned
 55922  //  ** integer, then set *v to 0xffffffff.
 55923  //  **
 55924  //  ** A MACRO version, getVarint32, is provided which inlines the
 55925  //  ** single-byte case.  All code should use the MACRO version as
 55926  //  ** this function assumes the single-byte case has already been handled.
 55927  //  */
 55928  func _sqlite3GetVarint32(tls *crt.TLS, _p *uint8, _v *uint32) (r0 uint8) {
 55929  	var _a, _b uint32
 55930  	var _3_v64 uint64
 55931  	var _3_n uint8
 55932  	_a = uint32(*_p)
 55933  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 55934  	_b = uint32(*_p)
 55935  	if (_b & uint32(128)) == 0 {
 55936  		_a &= uint32(127)
 55937  		_a = _a << 7
 55938  		*_v = _a | _b
 55939  		return uint8(2)
 55940  	}
 55941  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 55942  	_a = _a << 14
 55943  	_a |= uint32(*_p)
 55944  	if (_a & uint32(128)) == 0 {
 55945  		_a &= uint32(2080895)
 55946  		_b &= uint32(127)
 55947  		_b = _b << 7
 55948  		*_v = _a | _b
 55949  		return uint8(3)
 55950  	}
 55951  	*(*uintptr)(unsafe.Pointer(&_p)) -= uintptr(int32(2))
 55952  	_3_n = _sqlite3GetVarint(tls, _p, &_3_v64)
 55953  	func() {
 55954  		if int32(_3_n) <= int32(3) || int32(_3_n) > int32(9) {
 55955  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28722), unsafe.Pointer(&_sqlite3GetVarint32Ø00__func__Ø000), unsafe.Pointer(str(73314)))
 55956  			crt.X__builtin_abort(tls)
 55957  		}
 55958  	}()
 55959  	if (_3_v64 & uint64(4294967295)) != _3_v64 {
 55960  		*_v = uint32(4294967295)
 55961  		goto _6
 55962  	}
 55963  	*_v = uint32(_3_v64)
 55964  _6:
 55965  	return _3_n
 55966  }
 55967  
 55968  var _sqlite3GetVarint32Ø00__func__Ø000 [19]int8
 55969  
 55970  func init() {
 55971  	crt.Xstrncpy(nil, &_sqlite3GetVarint32Ø00__func__Ø000[0], str(73326), 19)
 55972  }
 55973  
 55974  func _sqlite3VdbeSerialGet(tls *crt.TLS, _buf *uint8, _serial_type uint32, _pMem *XMem) (r0 uint32) {
 55975  	switch _serial_type {
 55976  	case uint32(0):
 55977  		goto _1
 55978  	case uint32(1):
 55979  		goto _4
 55980  	case uint32(2):
 55981  		goto _5
 55982  	case uint32(3):
 55983  		goto _6
 55984  	case uint32(4):
 55985  		goto _7
 55986  	case uint32(5):
 55987  		goto _8
 55988  	case uint32(6):
 55989  		goto _9
 55990  	case uint32(7):
 55991  		goto _9
 55992  	case uint32(8):
 55993  		goto _11
 55994  	case uint32(9):
 55995  		goto _11
 55996  	case uint32(10):
 55997  		goto _1
 55998  	case uint32(11):
 55999  		goto _1
 56000  	default:
 56001  		goto _13
 56002  	}
 56003  
 56004  _1:
 56005  	_pMem.Xflags = uint16(1)
 56006  	goto _14
 56007  _4:
 56008  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(int8(*elem15(_buf, 0)))
 56009  	_pMem.Xflags = uint16(4)
 56010  	return uint32(1)
 56011  
 56012  _5:
 56013  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64((int32(256) * int32(int8(*elem15(_buf, 0)))) | int32(*elem15(_buf, uintptr(1))))
 56014  	_pMem.Xflags = uint16(4)
 56015  	return uint32(2)
 56016  
 56017  _6:
 56018  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(((int32(65536) * int32(int8(*elem15(_buf, 0)))) | (int32(*elem15(_buf, uintptr(1))) << 8)) | int32(*elem15(_buf, uintptr(2))))
 56019  	_pMem.Xflags = uint16(4)
 56020  	return uint32(3)
 56021  
 56022  _7:
 56023  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64((((int32(16777216) * int32(int8(*elem15(_buf, 0)))) | (int32(*elem15(_buf, uintptr(1))) << 16)) | (int32(*elem15(_buf, uintptr(2))) << 8)) | int32(*elem15(_buf, uintptr(3))))
 56024  	_pMem.Xflags = uint16(4)
 56025  	return uint32(4)
 56026  
 56027  _8:
 56028  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64((((uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(int32(2)))), 0))<<24)|uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(int32(2)))), uintptr(1)))<<16))|uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(int32(2)))), uintptr(2)))<<8))|uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(int32(2)))), uintptr(3)))) + (int64(4294967296) * int64((int32(256)*int32(int8(*elem15(_buf, 0))))|int32(*elem15(_buf, uintptr(1)))))
 56029  	_pMem.Xflags = uint16(4)
 56030  	return uint32(6)
 56031  
 56032  _9:
 56033  	return _serialGet(tls, _buf, _serial_type, _pMem)
 56034  
 56035  _11:
 56036  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(_serial_type - uint32(8))
 56037  	_pMem.Xflags = uint16(4)
 56038  	return 0
 56039  
 56040  _13:
 56041  	_pMem.Xz = (*int8)(unsafe.Pointer(_buf))
 56042  	_pMem.Xn = int32((_serial_type - uint32(12)) / uint32(2))
 56043  	_pMem.Xflags = *elem20((*uint16)(unsafe.Pointer(&_sqlite3VdbeSerialGetØ00aFlagØ001)), uintptr(_serial_type&uint32(1)))
 56044  	return uint32(_pMem.Xn)
 56045  
 56046  _14:
 56047  	return 0
 56048  }
 56049  
 56050  func _serialGet(tls *crt.TLS, _buf *uint8, _serial_type uint32, _pMem *XMem) (r0 uint32) {
 56051  	var _y uint32
 56052  	var _x, _2_t2 uint64
 56053  	_x = uint64((((uint32(*elem15(_buf, 0)) << 24) | uint32(int32(*elem15(_buf, uintptr(1)))<<16)) | uint32(int32(*elem15(_buf, uintptr(2)))<<8)) | uint32(*elem15(_buf, uintptr(3))))
 56054  	_y = (((uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(int32(4)))), 0)) << 24) | uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(int32(4)))), uintptr(1)))<<16)) | uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(int32(4)))), uintptr(2)))<<8)) | uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(int32(4)))), uintptr(3)))
 56055  	_x = (_x << 32) + uint64(_y)
 56056  	if _serial_type == uint32(6) {
 56057  		*(*int64)(unsafe.Pointer(&_pMem.Xu)) = *(*int64)(unsafe.Pointer(&_x))
 56058  		_pMem.Xflags = uint16(4)
 56059  		goto _1
 56060  	}
 56061  	_2_t2 = _serialGetØ00t1Ø001
 56062  	func() {
 56063  		if int32(1) == 0 || crt.Xmemcmp(tls, unsafe.Pointer(&_serialGetØ00r1Ø002), unsafe.Pointer(&_2_t2), uint64(8)) != int32(0) {
 56064  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74831), unsafe.Pointer(&_serialGetØ00__func__Ø000), unsafe.Pointer(str(73345)))
 56065  			crt.X__builtin_abort(tls)
 56066  		}
 56067  	}()
 56068  
 56069  	crt.Xmemcpy(tls, unsafe.Pointer((*float64)(unsafe.Pointer(&_pMem.Xu))), unsafe.Pointer(&_x), uint64(8))
 56070  	_pMem.Xflags = uint16(func() int32 {
 56071  		if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(&_pMem.Xu))) != 0 {
 56072  			return int32(1)
 56073  		}
 56074  		return int32(8)
 56075  	}())
 56076  _1:
 56077  	return uint32(8)
 56078  
 56079  	_ = _2_t2
 56080  	panic(0)
 56081  }
 56082  
 56083  var _serialGetØ00t1Ø001 uint64
 56084  
 56085  func init() {
 56086  	_serialGetØ00t1Ø001 = uint64(4607182418800017408)
 56087  }
 56088  
 56089  var _serialGetØ00r1Ø002 float64
 56090  
 56091  func init() {
 56092  	_serialGetØ00r1Ø002 = 1
 56093  }
 56094  
 56095  var _serialGetØ00__func__Ø000 [10]int8
 56096  
 56097  func init() {
 56098  	crt.Xstrncpy(nil, &_serialGetØ00__func__Ø000[0], str(73403), 10)
 56099  }
 56100  
 56101  var _sqlite3VdbeSerialGetØ00aFlagØ001 [2]uint16
 56102  
 56103  func init() {
 56104  	_sqlite3VdbeSerialGetØ00aFlagØ001 = [2]uint16{uint16(4112), uint16(4098)}
 56105  }
 56106  
 56107  // C comment
 56108  //  /*
 56109  //  ** Move the cursor down to a new child page.  The newPgno argument is the
 56110  //  ** page number of the child page to move to.
 56111  //  **
 56112  //  ** This function returns SQLITE_CORRUPT if the page-header flags field of
 56113  //  ** the new child page does not match the flags field of the parent (i.e.
 56114  //  ** if an intkey page appears to be the parent of a non-intkey page, or
 56115  //  ** vice-versa).
 56116  //  */
 56117  func _moveToChild(tls *crt.TLS, _pCur *XBtCursor, _newPgno uint32) (r0 int32) {
 56118  	var _pBt *XBtShared
 56119  	_pBt = (*XBtShared)(_pCur.XpBt)
 56120  	func() {
 56121  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 56122  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63862), unsafe.Pointer(&_moveToChildØ00__func__Ø000), unsafe.Pointer(str(71986)))
 56123  			crt.X__builtin_abort(tls)
 56124  		}
 56125  	}()
 56126  	func() {
 56127  		if int32(_pCur.XeState) != int32(1) {
 56128  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63863), unsafe.Pointer(&_moveToChildØ00__func__Ø000), unsafe.Pointer(str(10345)))
 56129  			crt.X__builtin_abort(tls)
 56130  		}
 56131  	}()
 56132  	func() {
 56133  		if int32(_pCur.XiPage) >= int32(20) {
 56134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63864), unsafe.Pointer(&_moveToChildØ00__func__Ø000), unsafe.Pointer(str(73413)))
 56135  			crt.X__builtin_abort(tls)
 56136  		}
 56137  	}()
 56138  	func() {
 56139  		if int32(_pCur.XiPage) < int32(0) {
 56140  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63865), unsafe.Pointer(&_moveToChildØ00__func__Ø000), unsafe.Pointer(str(73444)))
 56141  			crt.X__builtin_abort(tls)
 56142  		}
 56143  	}()
 56144  	if int32(_pCur.XiPage) >= int32(19) {
 56145  		return _sqlite3CorruptError(tls, int32(63867))
 56146  	}
 56147  	_pCur.Xinfo.XnSize = 0
 56148  	{
 56149  		p := &_pCur.XcurFlags
 56150  		*p = uint8(int32(*p) & int32(-7))
 56151  	}
 56152  	*elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), uintptr(postInc5(&_pCur.XiPage, 1))) = _pCur.Xix
 56153  	_pCur.Xix = 0
 56154  	return _getAndInitPage(tls, _pBt, _newPgno, elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage)), _pCur, int32(_pCur.XcurPagerFlags))
 56155  }
 56156  
 56157  var _moveToChildØ00__func__Ø000 [12]int8
 56158  
 56159  func init() {
 56160  	crt.Xstrncpy(nil, &_moveToChildØ00__func__Ø000[0], str(73459), 12)
 56161  }
 56162  
 56163  // C comment
 56164  //  /*
 56165  //  ** Get a page from the pager and initialize it.
 56166  //  **
 56167  //  ** If pCur!=0 then the page is being fetched as part of a moveToChild()
 56168  //  ** call.  Do additional sanity checking on the page in this case.
 56169  //  ** And if the fetch fails, this routine must decrement pCur->iPage.
 56170  //  **
 56171  //  ** The page is fetched as read-write unless pCur is not NULL and is
 56172  //  ** a read-only cursor.
 56173  //  **
 56174  //  ** If an error occurs, then *ppPage is undefined. It
 56175  //  ** may remain unchanged, or it may be set to an invalid value.
 56176  //  */
 56177  func _getAndInitPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _pCur *XBtCursor, _bReadOnly int32) (r0 int32) {
 56178  	var _rc int32
 56179  	var _pDbPage *XPgHdr
 56180  	func() {
 56181  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 56182  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61081), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 56183  			crt.X__builtin_abort(tls)
 56184  		}
 56185  	}()
 56186  	func() {
 56187  		if _pCur != nil && _ppPage != elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage)) {
 56188  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61082), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73471)))
 56189  			crt.X__builtin_abort(tls)
 56190  		}
 56191  	}()
 56192  	func() {
 56193  		if _pCur != nil && _bReadOnly != int32(_pCur.XcurPagerFlags) {
 56194  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61083), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73517)))
 56195  			crt.X__builtin_abort(tls)
 56196  		}
 56197  	}()
 56198  	func() {
 56199  		if _pCur != nil && int32(_pCur.XiPage) <= int32(0) {
 56200  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61084), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73559)))
 56201  			crt.X__builtin_abort(tls)
 56202  		}
 56203  	}()
 56204  	if _pgno > _btreePagecount(tls, _pBt) {
 56205  		_rc = _sqlite3CorruptError(tls, int32(61087))
 56206  		goto _getAndInitPage_error
 56207  	}
 56208  	_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.XpPager), _pgno, &_pDbPage, _bReadOnly)
 56209  	if _rc != 0 {
 56210  		goto _getAndInitPage_error
 56211  	}
 56212  	*_ppPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pDbPage))
 56213  	if int32((*_ppPage).XisInit) != int32(0) {
 56214  		goto _13
 56215  	}
 56216  	_btreePageFromDbPage(tls, _pDbPage, _pgno, _pBt)
 56217  	_rc = _btreeInitPage(tls, *_ppPage)
 56218  	if _rc != int32(0) {
 56219  		_releasePage(tls, *_ppPage)
 56220  		goto _getAndInitPage_error
 56221  	}
 56222  _13:
 56223  	func() {
 56224  		if ((*_ppPage).Xpgno) != _pgno {
 56225  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61103), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73584)))
 56226  			crt.X__builtin_abort(tls)
 56227  		}
 56228  	}()
 56229  	func() {
 56230  		if ((*_ppPage).XaData) != (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) {
 56231  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61104), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73606)))
 56232  			crt.X__builtin_abort(tls)
 56233  		}
 56234  	}()
 56235  	if (_pCur != nil) && ((int32((*_ppPage).XnCell) < int32(1)) || (int32((*_ppPage).XintKey) != int32(_pCur.XcurIntKey))) {
 56236  		_rc = _sqlite3CorruptError(tls, int32(61109))
 56237  		_releasePage(tls, *_ppPage)
 56238  		goto _getAndInitPage_error
 56239  	}
 56240  	return int32(0)
 56241  
 56242  _getAndInitPage_error:
 56243  	if _pCur != nil {
 56244  		_pCur.XiPage -= 1
 56245  	}
 56246  	func() {
 56247  		if _pgno == (0) && _rc != int32(11) {
 56248  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61118), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73653)))
 56249  			crt.X__builtin_abort(tls)
 56250  		}
 56251  	}()
 56252  	return _rc
 56253  }
 56254  
 56255  var _getAndInitPageØ00__func__Ø000 [15]int8
 56256  
 56257  func init() {
 56258  	crt.Xstrncpy(nil, &_getAndInitPageØ00__func__Ø000[0], str(73683), 15)
 56259  }
 56260  
 56261  // C comment
 56262  //  /*
 56263  //  ** Move the cursor down to the left-most leaf entry beneath the
 56264  //  ** entry to which it is currently pointing.
 56265  //  **
 56266  //  ** The left-most leaf is the one with the smallest key - the first
 56267  //  ** in ascending order.
 56268  //  */
 56269  func _moveToLeftmost(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 56270  	var _rc int32
 56271  	var _pgno uint32
 56272  	var _pPage *XMemPage
 56273  	_rc = int32(0)
 56274  	func() {
 56275  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 56276  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64033), unsafe.Pointer(&_moveToLeftmostØ00__func__Ø000), unsafe.Pointer(str(71986)))
 56277  			crt.X__builtin_abort(tls)
 56278  		}
 56279  	}()
 56280  	func() {
 56281  		if int32(_pCur.XeState) != int32(1) {
 56282  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64034), unsafe.Pointer(&_moveToLeftmostØ00__func__Ø000), unsafe.Pointer(str(10345)))
 56283  			crt.X__builtin_abort(tls)
 56284  		}
 56285  	}()
 56286  _4:
 56287  	if (_rc == int32(0)) && ((store86(&_pPage, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xleaf) == 0) {
 56288  		func() {
 56289  			if int32(_pCur.Xix) >= int32(_pPage.XnCell) {
 56290  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64036), unsafe.Pointer(&_moveToLeftmostØ00__func__Ø000), unsafe.Pointer(str(10637)))
 56291  				crt.X__builtin_abort(tls)
 56292  			}
 56293  		}()
 56294  		_pgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData))+uintptr(int32(_pPage.XmaskPage)&((int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*int32(_pCur.Xix))), 0))<<8)|int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*int32(_pCur.Xix))), uintptr(1))))))))
 56295  		_rc = _moveToChild(tls, _pCur, _pgno)
 56296  		goto _4
 56297  	}
 56298  	return _rc
 56299  }
 56300  
 56301  var _moveToLeftmostØ00__func__Ø000 [15]int8
 56302  
 56303  func init() {
 56304  	crt.Xstrncpy(nil, &_moveToLeftmostØ00__func__Ø000[0], str(73698), 15)
 56305  }
 56306  
 56307  // C comment
 56308  //  /*
 56309  //  ** Move the cursor up to the parent page.
 56310  //  **
 56311  //  ** pCur->idx is set to the cell index that contains the pointer
 56312  //  ** to the page we are coming from.  If we are coming from the
 56313  //  ** right-most child page then pCur->idx is set to one more than
 56314  //  ** the largest cell index.
 56315  //  */
 56316  func _moveToParent(tls *crt.TLS, _pCur *XBtCursor) {
 56317  	func() {
 56318  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 56319  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63908), unsafe.Pointer(&_moveToParentØ00__func__Ø000), unsafe.Pointer(str(71986)))
 56320  			crt.X__builtin_abort(tls)
 56321  		}
 56322  	}()
 56323  	func() {
 56324  		if int32(_pCur.XeState) != int32(1) {
 56325  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63909), unsafe.Pointer(&_moveToParentØ00__func__Ø000), unsafe.Pointer(str(10345)))
 56326  			crt.X__builtin_abort(tls)
 56327  		}
 56328  	}()
 56329  	func() {
 56330  		if int32(_pCur.XiPage) <= int32(0) {
 56331  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63910), unsafe.Pointer(&_moveToParentØ00__func__Ø000), unsafe.Pointer(str(73713)))
 56332  			crt.X__builtin_abort(tls)
 56333  		}
 56334  	}()
 56335  	func() {
 56336  		if (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) == nil {
 56337  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63911), unsafe.Pointer(&_moveToParentØ00__func__Ø000), unsafe.Pointer(str(73727)))
 56338  			crt.X__builtin_abort(tls)
 56339  		}
 56340  	}()
 56341  	_assertParentIndex(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(int32(_pCur.XiPage)-int32(1))), int32(*elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), uintptr(int32(_pCur.XiPage)-int32(1)))), (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xpgno)
 56342  	_pCur.Xinfo.XnSize = 0
 56343  	{
 56344  		p := &_pCur.XcurFlags
 56345  		*p = uint8(int32(*p) & int32(-7))
 56346  	}
 56347  	_pCur.Xix = *elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), uintptr(int32(_pCur.XiPage)-int32(1)))
 56348  	_releasePageNotNull(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(postInc5(&_pCur.XiPage, -1))))
 56349  }
 56350  
 56351  var _moveToParentØ00__func__Ø000 [13]int8
 56352  
 56353  func init() {
 56354  	crt.Xstrncpy(nil, &_moveToParentØ00__func__Ø000[0], str(73753), 13)
 56355  }
 56356  
 56357  // C comment
 56358  //  /*
 56359  //  ** Page pParent is an internal (non-leaf) tree page. This function
 56360  //  ** asserts that page number iChild is the left-child if the iIdx'th
 56361  //  ** cell in page pParent. Or, if iIdx is equal to the total number of
 56362  //  ** cells in pParent, that page number iChild is the right-child of
 56363  //  ** the page.
 56364  //  */
 56365  func _assertParentIndex(tls *crt.TLS, _pParent *XMemPage, _iIdx int32, _iChild uint32) {
 56366  	if _sqlite3Config.XneverCorrupt == int32(0) {
 56367  		return
 56368  	}
 56369  	func() {
 56370  		if _iIdx > int32(_pParent.XnCell) {
 56371  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63888), unsafe.Pointer(&_assertParentIndexØ00__func__Ø000), unsafe.Pointer(str(73766)))
 56372  			crt.X__builtin_abort(tls)
 56373  		}
 56374  	}()
 56375  	if _iIdx == int32(_pParent.XnCell) {
 56376  		func() {
 56377  			if _sqlite3Get4byte(tls, elem15(_pParent.XaData, uintptr(int32(_pParent.XhdrOffset)+int32(8)))) != _iChild {
 56378  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63890), unsafe.Pointer(&_assertParentIndexØ00__func__Ø000), unsafe.Pointer(str(73787)))
 56379  				crt.X__builtin_abort(tls)
 56380  			}
 56381  		}()
 56382  		goto _6
 56383  	}
 56384  	func() {
 56385  		if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.XaData))+uintptr(int32(_pParent.XmaskPage)&((int32(*elem15(elem15(_pParent.XaCellIdx, uintptr(int32(2)*_iIdx)), 0))<<8)|int32(*elem15(elem15(_pParent.XaCellIdx, uintptr(int32(2)*_iIdx)), uintptr(1)))))))) != _iChild {
 56386  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63892), unsafe.Pointer(&_assertParentIndexØ00__func__Ø000), unsafe.Pointer(str(73843)))
 56387  			crt.X__builtin_abort(tls)
 56388  		}
 56389  	}()
 56390  _6:
 56391  }
 56392  
 56393  var _assertParentIndexØ00__func__Ø000 [18]int8
 56394  
 56395  func init() {
 56396  	crt.Xstrncpy(nil, &_assertParentIndexØ00__func__Ø000[0], str(73885), 18)
 56397  }
 56398  
 56399  // C comment
 56400  //  /*
 56401  //  ** Return a pointer to an sqlite3VdbeRecordCompare() compatible function
 56402  //  ** suitable for comparing serialized records to the unpacked record passed
 56403  //  ** as the only argument.
 56404  //  */
 56405  func _sqlite3VdbeFindCompare(tls *crt.TLS, _p *XUnpackedRecord) (r0 func(*crt.TLS, int32, unsafe.Pointer, *XUnpackedRecord) int32) {
 56406  	var _1_flags int32
 56407  	if (int32((*XKeyInfo)(_p.XpKeyInfo).XnField) + int32((*XKeyInfo)(_p.XpKeyInfo).XnXField)) > int32(13) {
 56408  		goto _0
 56409  	}
 56410  	_1_flags = int32(elem25((*XMem)(_p.XaMem), 0).Xflags)
 56411  	if (*elem15((*XKeyInfo)(_p.XpKeyInfo).XaSortOrder, 0)) != 0 {
 56412  		_p.Xr1 = int8(1)
 56413  		_p.Xr2 = int8(-1)
 56414  		goto _2
 56415  	}
 56416  	_p.Xr1 = int8(-1)
 56417  	_p.Xr2 = int8(1)
 56418  _2:
 56419  	if (_1_flags & int32(4)) != 0 {
 56420  		return _vdbeRecordCompareInt
 56421  	}
 56422  	if ((_1_flags & int32(25)) == int32(0)) && ((*elem64((**XCollSeq)(unsafe.Pointer(&((*XKeyInfo)(_p.XpKeyInfo).XaColl))), 0)) == nil) {
 56423  		func() {
 56424  			if (_1_flags & int32(2)) == 0 {
 56425  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75785), unsafe.Pointer(&_sqlite3VdbeFindCompareØ00__func__Ø000), unsafe.Pointer(str(73903)))
 56426  				crt.X__builtin_abort(tls)
 56427  			}
 56428  		}()
 56429  		return _vdbeRecordCompareString
 56430  	}
 56431  _0:
 56432  	return _sqlite3VdbeRecordCompare
 56433  }
 56434  
 56435  // C comment
 56436  //  /*
 56437  //  ** This function is an optimized version of sqlite3VdbeRecordCompare()
 56438  //  ** that (a) the first field of pPKey2 is an integer, and (b) the
 56439  //  ** size-of-header varint at the start of (pKey1/nKey1) fits in a single
 56440  //  ** byte (i.e. is less than 128).
 56441  //  **
 56442  //  ** To avoid concerns about buffer overreads, this routine is only used
 56443  //  ** on schemas where the maximum valid header size is 63 bytes or less.
 56444  //  */
 56445  func _vdbeRecordCompareInt(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) {
 56446  	var _serial_type, _res int32
 56447  	var _v, _lhs int64
 56448  	var _y uint32
 56449  	var _x uint64
 56450  	var _aKey *uint8
 56451  	_aKey = elem15((*uint8)(_pKey1), uintptr(int32(*(*uint8)(_pKey1))&int32(63)))
 56452  	_serial_type = int32(*elem15((*uint8)(_pKey1), uintptr(1)))
 56453  	_vdbeAssertFieldCountWithinLimits(tls, _nKey1, _pKey1, (*XKeyInfo)(_pPKey2.XpKeyInfo))
 56454  	func() {
 56455  		if int32(*(*uint8)(_pKey1)) > int32(63) && _sqlite3Config.XneverCorrupt != int32(0) {
 56456  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75613), unsafe.Pointer(&_vdbeRecordCompareIntØ00__func__Ø000), unsafe.Pointer(str(73919)))
 56457  			crt.X__builtin_abort(tls)
 56458  		}
 56459  	}()
 56460  	switch _serial_type {
 56461  	case int32(0):
 56462  		goto _12
 56463  	case int32(1):
 56464  		goto _4
 56465  	case int32(2):
 56466  		goto _5
 56467  	case int32(3):
 56468  		goto _6
 56469  	case int32(4):
 56470  		goto _7
 56471  	case int32(5):
 56472  		goto _8
 56473  	case int32(6):
 56474  		goto _9
 56475  	case int32(7):
 56476  		goto _12
 56477  	case int32(8):
 56478  		goto _10
 56479  	case int32(9):
 56480  		goto _11
 56481  	default:
 56482  		goto _14
 56483  	}
 56484  
 56485  _4:
 56486  	_lhs = int64(int8(*elem15(_aKey, 0)))
 56487  	goto _15
 56488  _5:
 56489  	_lhs = int64((int32(256) * int32(int8(*elem15(_aKey, 0)))) | int32(*elem15(_aKey, uintptr(1))))
 56490  	goto _15
 56491  _6:
 56492  	_lhs = int64(((int32(65536) * int32(int8(*elem15(_aKey, 0)))) | (int32(*elem15(_aKey, uintptr(1))) << 8)) | int32(*elem15(_aKey, uintptr(2))))
 56493  	goto _15
 56494  _7:
 56495  	_y = (((uint32(*elem15(_aKey, 0)) << 24) | uint32(int32(*elem15(_aKey, uintptr(1)))<<16)) | uint32(int32(*elem15(_aKey, uintptr(2)))<<8)) | uint32(*elem15(_aKey, uintptr(3)))
 56496  	_lhs = int64(*(*int32)(unsafe.Pointer(&_y)))
 56497  	goto _15
 56498  _8:
 56499  	_lhs = int64((((uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(2)))), 0))<<24)|uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(2)))), uintptr(1)))<<16))|uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(2)))), uintptr(2)))<<8))|uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(2)))), uintptr(3)))) + (int64(4294967296) * int64((int32(256)*int32(int8(*elem15(_aKey, 0))))|int32(*elem15(_aKey, uintptr(1)))))
 56500  	goto _15
 56501  _9:
 56502  	_x = uint64((((uint32(*elem15(_aKey, 0)) << 24) | uint32(int32(*elem15(_aKey, uintptr(1)))<<16)) | uint32(int32(*elem15(_aKey, uintptr(2)))<<8)) | uint32(*elem15(_aKey, uintptr(3))))
 56503  	_x = (_x << 32) | uint64((((uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(4)))), 0))<<24)|uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(4)))), uintptr(1)))<<16))|uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(4)))), uintptr(2)))<<8))|uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(4)))), uintptr(3))))
 56504  	_lhs = *(*int64)(unsafe.Pointer(&_x))
 56505  	goto _15
 56506  _10:
 56507  	_lhs = 0
 56508  	goto _15
 56509  _11:
 56510  	_lhs = int64(1)
 56511  	goto _15
 56512  _12:
 56513  	return _sqlite3VdbeRecordCompare(tls, _nKey1, _pKey1, _pPKey2)
 56514  
 56515  _14:
 56516  	return _sqlite3VdbeRecordCompare(tls, _nKey1, _pKey1, _pPKey2)
 56517  
 56518  _15:
 56519  	_v = *(*int64)(unsafe.Pointer(&(elem25((*XMem)(_pPKey2.XaMem), 0).Xu)))
 56520  	if _v > _lhs {
 56521  		_res = int32(_pPKey2.Xr1)
 56522  		goto _21
 56523  	}
 56524  	if _v < _lhs {
 56525  		_res = int32(_pPKey2.Xr2)
 56526  		goto _21
 56527  	}
 56528  	if int32(_pPKey2.XnField) > int32(1) {
 56529  		_res = _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _pPKey2, int32(1))
 56530  		goto _21
 56531  	}
 56532  	_res = int32(_pPKey2.Xdefault_rc)
 56533  	_pPKey2.XeqSeen = uint8(1)
 56534  _21:
 56535  	func() {
 56536  		if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _res) == 0 {
 56537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75684), unsafe.Pointer(&_vdbeRecordCompareIntØ00__func__Ø000), unsafe.Pointer(str(73953)))
 56538  			crt.X__builtin_abort(tls)
 56539  		}
 56540  	}()
 56541  	return _res
 56542  
 56543  	_ = _y
 56544  	panic(0)
 56545  }
 56546  
 56547  // C comment
 56548  //  /*
 56549  //  ** Count the number of fields (a.k.a. columns) in the record given by
 56550  //  ** pKey,nKey.  The verify that this count is less than or equal to the
 56551  //  ** limit given by pKeyInfo->nField + pKeyInfo->nXField.
 56552  //  **
 56553  //  ** If this constraint is not satisfied, it means that the high-speed
 56554  //  ** vdbeRecordCompareInt() and vdbeRecordCompareString() routines will
 56555  //  ** not work correctly.  If this assert() ever fires, it probably means
 56556  //  ** that the KeyInfo.nField or KeyInfo.nXField values were computed
 56557  //  ** incorrectly.
 56558  //  */
 56559  func _vdbeAssertFieldCountWithinLimits(tls *crt.TLS, _nKey int32, _pKey unsafe.Pointer, _pKeyInfo *XKeyInfo) {
 56560  	var _nField int32
 56561  	var _szHdr, _idx, _notUsed uint32
 56562  	var _aKey *uint8
 56563  	_nField = int32(0)
 56564  	_aKey = (*uint8)(_pKey)
 56565  	if _sqlite3Config.XneverCorrupt == int32(0) {
 56566  		return
 56567  	}
 56568  	_idx = uint32(uint8(func() int32 {
 56569  		if int32(*_aKey) < int32(128) {
 56570  			return func() int32 { _szHdr = uint32(*_aKey); return int32(1) }()
 56571  		}
 56572  		return int32(_sqlite3GetVarint32(tls, _aKey, &_szHdr))
 56573  	}()))
 56574  	func() {
 56575  		if _nKey < int32(0) {
 56576  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75123), unsafe.Pointer(&_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000), unsafe.Pointer(str(74003)))
 56577  			crt.X__builtin_abort(tls)
 56578  		}
 56579  	}()
 56580  	func() {
 56581  		if _szHdr > uint32(_nKey) {
 56582  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75124), unsafe.Pointer(&_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000), unsafe.Pointer(str(74011)))
 56583  			crt.X__builtin_abort(tls)
 56584  		}
 56585  	}()
 56586  _7:
 56587  	if _idx < _szHdr {
 56588  		_idx += uint32(uint8(func() int32 {
 56589  			if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + uintptr(_idx)))) < int32(128) {
 56590  				return func() int32 {
 56591  					_notUsed = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + uintptr(_idx))))
 56592  					return int32(1)
 56593  				}()
 56594  			}
 56595  			return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(_idx))), &_notUsed))
 56596  		}()))
 56597  		_nField += 1
 56598  		goto _7
 56599  	}
 56600  	func() {
 56601  		if _nField > (int32(_pKeyInfo.XnField) + int32(_pKeyInfo.XnXField)) {
 56602  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75129), unsafe.Pointer(&_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000), unsafe.Pointer(str(74028)))
 56603  			crt.X__builtin_abort(tls)
 56604  		}
 56605  	}()
 56606  }
 56607  
 56608  var _vdbeAssertFieldCountWithinLimitsØ00__func__Ø000 [33]int8
 56609  
 56610  func init() {
 56611  	crt.Xstrncpy(nil, &_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000[0], str(74073), 33)
 56612  }
 56613  
 56614  var _vdbeRecordCompareIntØ00__func__Ø000 [21]int8
 56615  
 56616  func init() {
 56617  	crt.Xstrncpy(nil, &_vdbeRecordCompareIntØ00__func__Ø000[0], str(74106), 21)
 56618  }
 56619  
 56620  func _sqlite3VdbeRecordCompare(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) {
 56621  	return _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _pPKey2, int32(0))
 56622  }
 56623  
 56624  // C comment
 56625  //  /*
 56626  //  ** This function compares the two table rows or index records
 56627  //  ** specified by {nKey1, pKey1} and pPKey2.  It returns a negative, zero
 56628  //  ** or positive integer if key1 is less than, equal to or
 56629  //  ** greater than key2.  The {nKey1, pKey1} key must be a blob
 56630  //  ** created by the OP_MakeRecord opcode of the VDBE.  The pPKey2
 56631  //  ** key must be a parsed key such as obtained from
 56632  //  ** sqlite3VdbeParseRecord.
 56633  //  **
 56634  //  ** If argument bSkip is non-zero, it is assumed that the caller has already
 56635  //  ** determined that the first fields of the keys are equal.
 56636  //  **
 56637  //  ** Key1 and Key2 do not have to contain the same number of fields. If all
 56638  //  ** fields that appear in both keys are equal, then pPKey2->default_rc is
 56639  //  ** returned.
 56640  //  **
 56641  //  ** If database corruption is discovered, set pPKey2->errCode to
 56642  //  ** SQLITE_CORRUPT and return 0. If an OOM error is encountered,
 56643  //  ** pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the
 56644  //  ** malloc-failed flag set on database handle (pPKey2->pKeyInfo->db).
 56645  //  */
 56646  func _sqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord, _bSkip int32) (r0 int32) {
 56647  	var _i, _rc, _26_nCmp, _29_nStr, _34_nCmp int32
 56648  	var _9_lhs, _9_rhs int64
 56649  	var _d1, _szHdr1, _idx1, _1_s1, _4_serial_type uint32
 56650  	var _aKey1 *uint8
 56651  	var _mem1 XMem
 56652  	var _pRhs *XMem
 56653  	var _pKeyInfo *XKeyInfo
 56654  	_rc = int32(0)
 56655  	_pRhs = (*XMem)(_pPKey2.XaMem)
 56656  	_pKeyInfo = (*XKeyInfo)(_pPKey2.XpKeyInfo)
 56657  	_aKey1 = (*uint8)(_pKey1)
 56658  	if _bSkip != 0 {
 56659  		_idx1 = uint32(int32(1) + int32(uint8(func() int32 {
 56660  			if int32(*elem15(_aKey1, uintptr(1))) < int32(128) {
 56661  				return func() int32 { _1_s1 = uint32(*elem15(_aKey1, uintptr(1))); return int32(1) }()
 56662  			}
 56663  			return int32(_sqlite3GetVarint32(tls, elem15(_aKey1, uintptr(1)), &_1_s1))
 56664  		}())))
 56665  		_szHdr1 = uint32(*elem15(_aKey1, 0))
 56666  		_d1 = _szHdr1 + _sqlite3VdbeSerialTypeLen(tls, _1_s1)
 56667  		_i = int32(1)
 56668  		*(*uintptr)(unsafe.Pointer(&_pRhs)) += uintptr(72)
 56669  		goto _3
 56670  	}
 56671  	_idx1 = uint32(uint8(func() int32 {
 56672  		if int32(*_aKey1) < int32(128) {
 56673  			return func() int32 { _szHdr1 = uint32(*_aKey1); return int32(1) }()
 56674  		}
 56675  		return int32(_sqlite3GetVarint32(tls, _aKey1, &_szHdr1))
 56676  	}()))
 56677  	_d1 = _szHdr1
 56678  	if _d1 > uint32(_nKey1) {
 56679  		_pPKey2.XerrCode = uint8(_sqlite3CorruptError(tls, int32(75426)))
 56680  		return int32(0)
 56681  	}
 56682  	_i = int32(0)
 56683  _3:
 56684  	_mem1.XszMalloc = int32(0)
 56685  	func() {
 56686  		if (int32((*XKeyInfo)(_pPKey2.XpKeyInfo).XnField)+int32((*XKeyInfo)(_pPKey2.XpKeyInfo).XnXField)) < int32(_pPKey2.XnField) && _sqlite3Config.XneverCorrupt != int32(0) {
 56687  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75433), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74127)))
 56688  			crt.X__builtin_abort(tls)
 56689  		}
 56690  	}()
 56691  	func() {
 56692  		if ((*XKeyInfo)(_pPKey2.XpKeyInfo).XaSortOrder) == nil {
 56693  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75435), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74208)))
 56694  			crt.X__builtin_abort(tls)
 56695  		}
 56696  	}()
 56697  	func() {
 56698  		if int32((*XKeyInfo)(_pPKey2.XpKeyInfo).XnField) <= int32(0) {
 56699  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75436), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74240)))
 56700  			crt.X__builtin_abort(tls)
 56701  		}
 56702  	}()
 56703  	func() {
 56704  		if _idx1 > _szHdr1 && _sqlite3Config.XneverCorrupt != int32(0) {
 56705  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75437), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74267)))
 56706  			crt.X__builtin_abort(tls)
 56707  		}
 56708  	}()
 56709  _17:
 56710  	if (int32(_pRhs.Xflags) & int32(4)) == 0 {
 56711  		goto _18
 56712  	}
 56713  	_4_serial_type = uint32(*elem15(_aKey1, uintptr(_idx1)))
 56714  	if _4_serial_type >= uint32(10) {
 56715  		_rc = int32(1)
 56716  		goto _24
 56717  	}
 56718  	if _4_serial_type == (0) {
 56719  		_rc = int32(-1)
 56720  		goto _24
 56721  	}
 56722  	if _4_serial_type == uint32(7) {
 56723  		_sqlite3VdbeSerialGet(tls, elem15(_aKey1, uintptr(_d1)), _4_serial_type, &_mem1)
 56724  		_rc = -_sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer(&_pRhs.Xu)), *(*float64)(unsafe.Pointer(&_mem1.Xu)))
 56725  		goto _24
 56726  	}
 56727  	_9_lhs = _vdbeRecordDecodeInt(tls, _4_serial_type, elem15(_aKey1, uintptr(_d1)))
 56728  	_9_rhs = *(*int64)(unsafe.Pointer(&_pRhs.Xu))
 56729  	if _9_lhs < _9_rhs {
 56730  		_rc = int32(-1)
 56731  		goto _27
 56732  	}
 56733  	if _9_lhs > _9_rhs {
 56734  		_rc = int32(1)
 56735  	}
 56736  _27:
 56737  _24:
 56738  	goto _73
 56739  _18:
 56740  	if (int32(_pRhs.Xflags) & int32(8)) == 0 {
 56741  		goto _29
 56742  	}
 56743  	_4_serial_type = uint32(*elem15(_aKey1, uintptr(_idx1)))
 56744  	if _4_serial_type >= uint32(10) {
 56745  		_rc = int32(1)
 56746  		goto _33
 56747  	}
 56748  	if _4_serial_type == (0) {
 56749  		_rc = int32(-1)
 56750  		goto _33
 56751  	}
 56752  	_sqlite3VdbeSerialGet(tls, elem15(_aKey1, uintptr(_d1)), _4_serial_type, &_mem1)
 56753  	if _4_serial_type != uint32(7) {
 56754  		goto _34
 56755  	}
 56756  	if (*(*float64)(unsafe.Pointer(&_mem1.Xu))) < (*(*float64)(unsafe.Pointer(&_pRhs.Xu))) {
 56757  		_rc = int32(-1)
 56758  		goto _37
 56759  	}
 56760  	if (*(*float64)(unsafe.Pointer(&_mem1.Xu))) > (*(*float64)(unsafe.Pointer(&_pRhs.Xu))) {
 56761  		_rc = int32(1)
 56762  	}
 56763  _37:
 56764  	goto _38
 56765  _34:
 56766  	_rc = _sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer(&_mem1.Xu)), *(*float64)(unsafe.Pointer(&_pRhs.Xu)))
 56767  _38:
 56768  _33:
 56769  	goto _73
 56770  _29:
 56771  	if (int32(_pRhs.Xflags) & int32(2)) == 0 {
 56772  		goto _40
 56773  	}
 56774  	func() int32 {
 56775  		if int32(*elem15(_aKey1, uintptr(_idx1))) < int32(128) {
 56776  			return func() int32 { _4_serial_type = uint32(*elem15(_aKey1, uintptr(_idx1))); return int32(1) }()
 56777  		}
 56778  		return int32(_sqlite3GetVarint32(tls, elem15(_aKey1, uintptr(_idx1)), &_4_serial_type))
 56779  	}()
 56780  	if _4_serial_type < uint32(12) {
 56781  		_rc = int32(-1)
 56782  		goto _46
 56783  	}
 56784  	if (_4_serial_type & uint32(1)) == 0 {
 56785  		_rc = int32(1)
 56786  		goto _46
 56787  	}
 56788  	_mem1.Xn = int32((_4_serial_type - uint32(12)) / uint32(2))
 56789  	if (_d1 + uint32(_mem1.Xn)) > uint32(_nKey1) {
 56790  		_pPKey2.XerrCode = uint8(_sqlite3CorruptError(tls, int32(75501)))
 56791  		return int32(0)
 56792  	}
 56793  	if (*elem64((**XCollSeq)(unsafe.Pointer(&_pKeyInfo.XaColl)), uintptr(_i))) != nil {
 56794  		_mem1.Xenc = _pKeyInfo.Xenc
 56795  		*(**Xsqlite3)(unsafe.Pointer(&_mem1.Xdb)) = (*Xsqlite3)(_pKeyInfo.Xdb)
 56796  		_mem1.Xflags = uint16(2)
 56797  		_mem1.Xz = (*int8)(unsafe.Pointer(elem15(_aKey1, uintptr(_d1))))
 56798  		_rc = _vdbeCompareMemString(tls, &_mem1, _pRhs, *elem64((**XCollSeq)(unsafe.Pointer(&_pKeyInfo.XaColl)), uintptr(_i)), &_pPKey2.XerrCode)
 56799  		goto _50
 56800  	}
 56801  	_26_nCmp = func() int32 {
 56802  		if _mem1.Xn < _pRhs.Xn {
 56803  			return _mem1.Xn
 56804  		}
 56805  		return _pRhs.Xn
 56806  	}()
 56807  	_rc = crt.Xmemcmp(tls, unsafe.Pointer(elem15(_aKey1, uintptr(_d1))), unsafe.Pointer(_pRhs.Xz), uint64(_26_nCmp))
 56808  	if _rc == int32(0) {
 56809  		_rc = _mem1.Xn - _pRhs.Xn
 56810  	}
 56811  _50:
 56812  _46:
 56813  	goto _73
 56814  _40:
 56815  	if (int32(_pRhs.Xflags) & int32(16)) == 0 {
 56816  		goto _55
 56817  	}
 56818  	func() {
 56819  		if (int32(_pRhs.Xflags)&int32(16384)) != int32(0) && _pRhs.Xn != int32(0) {
 56820  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75521), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74294)))
 56821  			crt.X__builtin_abort(tls)
 56822  		}
 56823  	}()
 56824  	func() int32 {
 56825  		if int32(*elem15(_aKey1, uintptr(_idx1))) < int32(128) {
 56826  			return func() int32 { _4_serial_type = uint32(*elem15(_aKey1, uintptr(_idx1))); return int32(1) }()
 56827  		}
 56828  		return int32(_sqlite3GetVarint32(tls, elem15(_aKey1, uintptr(_idx1)), &_4_serial_type))
 56829  	}()
 56830  	if (_4_serial_type < uint32(12)) || ((_4_serial_type & uint32(1)) != 0) {
 56831  		_rc = int32(-1)
 56832  		goto _63
 56833  	}
 56834  	_29_nStr = int32((_4_serial_type - uint32(12)) / uint32(2))
 56835  	if (_d1 + uint32(_29_nStr)) > uint32(_nKey1) {
 56836  		_pPKey2.XerrCode = uint8(_sqlite3CorruptError(tls, int32(75531)))
 56837  		return int32(0)
 56838  	}
 56839  	if (int32(_pRhs.Xflags) & int32(16384)) == 0 {
 56840  		goto _66
 56841  	}
 56842  	if _isAllZero(tls, (*int8)(unsafe.Pointer(elem15(_aKey1, uintptr(_d1)))), _29_nStr) == 0 {
 56843  		_rc = int32(1)
 56844  		goto _68
 56845  	}
 56846  	_rc = _29_nStr - (*(*int32)(unsafe.Pointer(&_pRhs.Xu)))
 56847  _68:
 56848  	goto _69
 56849  _66:
 56850  	_34_nCmp = func() int32 {
 56851  		if _29_nStr < _pRhs.Xn {
 56852  			return _29_nStr
 56853  		}
 56854  		return _pRhs.Xn
 56855  	}()
 56856  	_rc = crt.Xmemcmp(tls, unsafe.Pointer(elem15(_aKey1, uintptr(_d1))), unsafe.Pointer(_pRhs.Xz), uint64(_34_nCmp))
 56857  	if _rc == int32(0) {
 56858  		_rc = _29_nStr - _pRhs.Xn
 56859  	}
 56860  _69:
 56861  _63:
 56862  	goto _73
 56863  _55:
 56864  	_4_serial_type = uint32(*elem15(_aKey1, uintptr(_idx1)))
 56865  	_rc = bool2int(_4_serial_type != (0))
 56866  _73:
 56867  	if _rc == int32(0) {
 56868  		goto _74
 56869  	}
 56870  	if (*elem15(_pKeyInfo.XaSortOrder, uintptr(_i))) != 0 {
 56871  		_rc = -_rc
 56872  	}
 56873  	func() {
 56874  		if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _rc) == 0 {
 56875  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75557), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74336)))
 56876  			crt.X__builtin_abort(tls)
 56877  		}
 56878  	}()
 56879  	func() {
 56880  		if _mem1.XszMalloc != int32(0) {
 56881  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75558), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74385)))
 56882  			crt.X__builtin_abort(tls)
 56883  		}
 56884  	}()
 56885  	return _rc
 56886  
 56887  _74:
 56888  	_i += 1
 56889  	*(*uintptr)(unsafe.Pointer(&_pRhs)) += uintptr(72)
 56890  	_d1 += _sqlite3VdbeSerialTypeLen(tls, _4_serial_type)
 56891  	_idx1 += uint32(_sqlite3VarintLen(tls, uint64(_4_serial_type)))
 56892  	if ((_idx1 < _szHdr1) && (_i < int32(_pPKey2.XnField))) && (_d1 <= uint32(_nKey1)) {
 56893  		goto _17
 56894  	}
 56895  	func() {
 56896  		if _mem1.XszMalloc != int32(0) {
 56897  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75571), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74385)))
 56898  			crt.X__builtin_abort(tls)
 56899  		}
 56900  	}()
 56901  	func() {
 56902  		if _sqlite3Config.XneverCorrupt != int32(0) && _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, int32(_pPKey2.Xdefault_rc)) == 0 && ((*Xsqlite3)(_pKeyInfo.Xdb).XmallocFailed) == 0 {
 56903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75576), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74402)))
 56904  			crt.X__builtin_abort(tls)
 56905  		}
 56906  	}()
 56907  	_pPKey2.XeqSeen = uint8(1)
 56908  	return int32(_pPKey2.Xdefault_rc)
 56909  }
 56910  
 56911  // C comment
 56912  //  /*
 56913  //  ** Return the length of the data corresponding to the supplied serial-type.
 56914  //  */
 56915  func _sqlite3VdbeSerialTypeLen(tls *crt.TLS, _serial_type uint32) (r0 uint32) {
 56916  	if _serial_type >= uint32(128) {
 56917  		return (_serial_type - uint32(12)) / uint32(2)
 56918  	}
 56919  	func() {
 56920  		if _serial_type >= uint32(12) && uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3SmallTypeSizes)), uintptr(_serial_type))) != ((_serial_type-uint32(12))/uint32(2)) {
 56921  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74674), unsafe.Pointer(&_sqlite3VdbeSerialTypeLenØ00__func__Ø000), unsafe.Pointer(str(74511)))
 56922  			crt.X__builtin_abort(tls)
 56923  		}
 56924  	}()
 56925  	return uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3SmallTypeSizes)), uintptr(_serial_type)))
 56926  }
 56927  
 56928  // C comment
 56929  //  /*
 56930  //  ** The sizes for serial types less than 128
 56931  //  */
 56932  var _sqlite3SmallTypeSizes [128]uint8
 56933  
 56934  func init() {
 56935  	_sqlite3SmallTypeSizes = [128]uint8{0, 1, 2, 3, 4, 6, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57}
 56936  }
 56937  
 56938  var _sqlite3VdbeSerialTypeLenØ00__func__Ø000 [25]int8
 56939  
 56940  func init() {
 56941  	crt.Xstrncpy(nil, &_sqlite3VdbeSerialTypeLenØ00__func__Ø000[0], str(74586), 25)
 56942  }
 56943  
 56944  var _sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000 [33]int8
 56945  
 56946  func init() {
 56947  	crt.Xstrncpy(nil, &_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000[0], str(74611), 33)
 56948  }
 56949  
 56950  // C comment
 56951  //  /*
 56952  //  ** The first argument passed to this function is a serial-type that
 56953  //  ** corresponds to an integer - all values between 1 and 9 inclusive
 56954  //  ** except 7. The second points to a buffer containing an integer value
 56955  //  ** serialized according to serial_type. This function deserializes
 56956  //  ** and returns the value.
 56957  //  */
 56958  func _vdbeRecordDecodeInt(tls *crt.TLS, _serial_type uint32, _aKey *uint8) (r0 int64) {
 56959  	var _y uint32
 56960  	var _4_x uint64
 56961  	func() {
 56962  		if _sqlite3Config.XneverCorrupt != int32(0) && (_serial_type < uint32(1) || _serial_type > uint32(9) || _serial_type == uint32(7)) {
 56963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75344), unsafe.Pointer(&_vdbeRecordDecodeIntØ00__func__Ø000), unsafe.Pointer(str(74644)))
 56964  			crt.X__builtin_abort(tls)
 56965  		}
 56966  	}()
 56967  	switch _serial_type {
 56968  	case uint32(0):
 56969  		goto _6
 56970  	case uint32(1):
 56971  		goto _6
 56972  	case uint32(2):
 56973  		goto _8
 56974  	case uint32(3):
 56975  		goto _9
 56976  	case uint32(4):
 56977  		goto _10
 56978  	case uint32(5):
 56979  		goto _11
 56980  	case uint32(6):
 56981  		goto _12
 56982  	default:
 56983  		goto _13
 56984  	}
 56985  
 56986  _6:
 56987  	return int64(int8(*elem15(_aKey, 0)))
 56988  
 56989  _8:
 56990  	return int64((int32(256) * int32(int8(*elem15(_aKey, 0)))) | int32(*elem15(_aKey, uintptr(1))))
 56991  
 56992  _9:
 56993  	return int64(((int32(65536) * int32(int8(*elem15(_aKey, 0)))) | (int32(*elem15(_aKey, uintptr(1))) << 8)) | int32(*elem15(_aKey, uintptr(2))))
 56994  
 56995  _10:
 56996  	_y = (((uint32(*elem15(_aKey, 0)) << 24) | uint32(int32(*elem15(_aKey, uintptr(1)))<<16)) | uint32(int32(*elem15(_aKey, uintptr(2)))<<8)) | uint32(*elem15(_aKey, uintptr(3)))
 56997  	return int64(*(*int32)(unsafe.Pointer(&_y)))
 56998  
 56999  _11:
 57000  	return int64((((uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(2)))), 0))<<24)|uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(2)))), uintptr(1)))<<16))|uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(2)))), uintptr(2)))<<8))|uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(2)))), uintptr(3)))) + (int64(4294967296) * int64((int32(256)*int32(int8(*elem15(_aKey, 0))))|int32(*elem15(_aKey, uintptr(1)))))
 57001  
 57002  _12:
 57003  	_4_x = uint64((((uint32(*elem15(_aKey, 0)) << 24) | uint32(int32(*elem15(_aKey, uintptr(1)))<<16)) | uint32(int32(*elem15(_aKey, uintptr(2)))<<8)) | uint32(*elem15(_aKey, uintptr(3))))
 57004  	_4_x = (_4_x << 32) | uint64((((uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(4)))), 0))<<24)|uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(4)))), uintptr(1)))<<16))|uint32(int32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(4)))), uintptr(2)))<<8))|uint32(*elem15((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(int32(4)))), uintptr(3))))
 57005  	return *(*int64)(unsafe.Pointer(&_4_x))
 57006  
 57007  _13:
 57008  	return int64(_serial_type - uint32(8))
 57009  
 57010  	_ = _y
 57011  	panic(0)
 57012  }
 57013  
 57014  var _vdbeRecordDecodeIntØ00__func__Ø000 [20]int8
 57015  
 57016  func init() {
 57017  	crt.Xstrncpy(nil, &_vdbeRecordDecodeIntØ00__func__Ø000[0], str(74711), 20)
 57018  }
 57019  
 57020  // C comment
 57021  //  /*
 57022  //  ** This function compares two index or table record keys in the same way
 57023  //  ** as the sqlite3VdbeRecordCompare() routine. Unlike VdbeRecordCompare(),
 57024  //  ** this function deserializes and compares values using the
 57025  //  ** sqlite3VdbeSerialGet() and sqlite3MemCompare() functions. It is used
 57026  //  ** in assert() statements to ensure that the optimized code in
 57027  //  ** sqlite3VdbeRecordCompare() returns results with these two primitives.
 57028  //  **
 57029  //  ** Return true if the result of comparison is equivalent to desiredResult.
 57030  //  ** Return false if there is a disagreement.
 57031  //  */
 57032  func _vdbeRecordCompareDebug(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord, _desiredResult int32) (r0 int32) {
 57033  	var _i, _rc int32
 57034  	var _d1, _idx1, _szHdr1, _1_serial_type1 uint32
 57035  	var _aKey1 *uint8
 57036  	var _mem1 XMem
 57037  	var _pKeyInfo *XKeyInfo
 57038  	_i = int32(0)
 57039  	_rc = int32(0)
 57040  	_aKey1 = (*uint8)(_pKey1)
 57041  	_pKeyInfo = (*XKeyInfo)(_pPKey2.XpKeyInfo)
 57042  	if (*Xsqlite3)(_pKeyInfo.Xdb) == nil {
 57043  		return int32(1)
 57044  	}
 57045  	_mem1.Xenc = _pKeyInfo.Xenc
 57046  	*(**Xsqlite3)(unsafe.Pointer(&_mem1.Xdb)) = (*Xsqlite3)(_pKeyInfo.Xdb)
 57047  	_mem1.XszMalloc = int32(0)
 57048  	_idx1 = uint32(uint8(func() int32 {
 57049  		if int32(*_aKey1) < int32(128) {
 57050  			return func() int32 { _szHdr1 = uint32(*_aKey1); return int32(1) }()
 57051  		}
 57052  		return int32(_sqlite3GetVarint32(tls, _aKey1, &_szHdr1))
 57053  	}()))
 57054  	if _szHdr1 > uint32(98307) {
 57055  		return int32(11)
 57056  	}
 57057  	_d1 = _szHdr1
 57058  	func() {
 57059  		if (int32(_pKeyInfo.XnField)+int32(_pKeyInfo.XnXField)) < int32(_pPKey2.XnField) && _sqlite3Config.XneverCorrupt != int32(0) {
 57060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75039), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(74731)))
 57061  			crt.X__builtin_abort(tls)
 57062  		}
 57063  	}()
 57064  	func() {
 57065  		if _pKeyInfo.XaSortOrder == nil {
 57066  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75040), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(37807)))
 57067  			crt.X__builtin_abort(tls)
 57068  		}
 57069  	}()
 57070  	func() {
 57071  		if int32(_pKeyInfo.XnField) <= int32(0) {
 57072  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75041), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(74796)))
 57073  			crt.X__builtin_abort(tls)
 57074  		}
 57075  	}()
 57076  	func() {
 57077  		if _idx1 > _szHdr1 && _sqlite3Config.XneverCorrupt != int32(0) {
 57078  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75042), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(74267)))
 57079  			crt.X__builtin_abort(tls)
 57080  		}
 57081  	}()
 57082  _14:
 57083  	_idx1 += uint32(uint8(func() int32 {
 57084  		if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + uintptr(_idx1)))) < int32(128) {
 57085  			return func() int32 {
 57086  				_1_serial_type1 = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + uintptr(_idx1))))
 57087  				return int32(1)
 57088  			}()
 57089  		}
 57090  		return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+uintptr(_idx1))), &_1_serial_type1))
 57091  	}()))
 57092  	if (((_d1 + _1_serial_type1) + uint32(2)) > uint32(_nKey1)) && ((_d1 + _sqlite3VdbeSerialTypeLen(tls, _1_serial_type1)) > uint32(_nKey1)) {
 57093  		goto _19
 57094  	}
 57095  	_d1 += _sqlite3VdbeSerialGet(tls, elem15(_aKey1, uintptr(_d1)), _1_serial_type1, &_mem1)
 57096  	_rc = _sqlite3MemCompare(tls, &_mem1, elem25((*XMem)(_pPKey2.XaMem), uintptr(_i)), *elem64((**XCollSeq)(unsafe.Pointer(&_pKeyInfo.XaColl)), uintptr(_i)))
 57097  	if _rc == int32(0) {
 57098  		goto _20
 57099  	}
 57100  	func() {
 57101  		if _mem1.XszMalloc != int32(0) {
 57102  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75069), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(74385)))
 57103  			crt.X__builtin_abort(tls)
 57104  		}
 57105  	}()
 57106  	if (*elem15(_pKeyInfo.XaSortOrder, uintptr(_i))) != 0 {
 57107  		_rc = -_rc
 57108  	}
 57109  	goto _debugCompareEnd
 57110  _20:
 57111  	_i += 1
 57112  	if (_idx1 < _szHdr1) && (_i < int32(_pPKey2.XnField)) {
 57113  		goto _14
 57114  	}
 57115  _19:
 57116  	func() {
 57117  		if _mem1.XszMalloc != int32(0) {
 57118  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75082), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(74385)))
 57119  			crt.X__builtin_abort(tls)
 57120  		}
 57121  	}()
 57122  	_rc = int32(_pPKey2.Xdefault_rc)
 57123  _debugCompareEnd:
 57124  	if (_desiredResult == int32(0)) && (_rc == int32(0)) {
 57125  		return int32(1)
 57126  	}
 57127  	if (_desiredResult < int32(0)) && (_rc < int32(0)) {
 57128  		return int32(1)
 57129  	}
 57130  	if (_desiredResult > int32(0)) && (_rc > int32(0)) {
 57131  		return int32(1)
 57132  	}
 57133  	if _sqlite3Config.XneverCorrupt == int32(0) {
 57134  		return int32(1)
 57135  	}
 57136  	if ((*Xsqlite3)(_pKeyInfo.Xdb).XmallocFailed) != 0 {
 57137  		return int32(1)
 57138  	}
 57139  	return int32(0)
 57140  }
 57141  
 57142  var _vdbeRecordCompareDebugØ00__func__Ø000 [23]int8
 57143  
 57144  func init() {
 57145  	crt.Xstrncpy(nil, &_vdbeRecordCompareDebugØ00__func__Ø000[0], str(74815), 23)
 57146  }
 57147  
 57148  // C comment
 57149  //  /*
 57150  //  ** Return the number of bytes that will be needed to store the given
 57151  //  ** 64-bit integer.
 57152  //  */
 57153  func _sqlite3VarintLen(tls *crt.TLS, _v uint64) (r0 int32) {
 57154  	var _i int32
 57155  	_i = int32(1)
 57156  _0:
 57157  	if store23(func() (*uint64, uint64) { p := &_v; return p, ((*p) >> 7) }()) == (0) {
 57158  		goto _3
 57159  	}
 57160  	func() {
 57161  		if _i >= int32(10) {
 57162  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28787), unsafe.Pointer(&_sqlite3VarintLenØ00__func__Ø000), unsafe.Pointer(str(74838)))
 57163  			crt.X__builtin_abort(tls)
 57164  		}
 57165  	}()
 57166  	_i += 1
 57167  	goto _0
 57168  _3:
 57169  	return _i
 57170  }
 57171  
 57172  var _sqlite3VarintLenØ00__func__Ø000 [17]int8
 57173  
 57174  func init() {
 57175  	crt.Xstrncpy(nil, &_sqlite3VarintLenØ00__func__Ø000[0], str(74843), 17)
 57176  }
 57177  
 57178  var _sqlite3VdbeFindCompareØ00__func__Ø000 [23]int8
 57179  
 57180  func init() {
 57181  	crt.Xstrncpy(nil, &_sqlite3VdbeFindCompareØ00__func__Ø000[0], str(74860), 23)
 57182  }
 57183  
 57184  // C comment
 57185  //  /*
 57186  //  ** This function is an optimized version of sqlite3VdbeRecordCompare()
 57187  //  ** that (a) the first field of pPKey2 is a string, that (b) the first field
 57188  //  ** uses the collation sequence BINARY and (c) that the size-of-header varint
 57189  //  ** at the start of (pKey1/nKey1) fits in a single byte.
 57190  //  */
 57191  func _vdbeRecordCompareString(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) {
 57192  	var _serial_type, _res, _3_nCmp, _3_nStr, _3_szHdr int32
 57193  	var _aKey1 *uint8
 57194  	_aKey1 = (*uint8)(_pKey1)
 57195  	func() {
 57196  		if (int32(elem25((*XMem)(_pPKey2.XaMem), 0).Xflags) & int32(2)) == 0 {
 57197  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75702), unsafe.Pointer(&_vdbeRecordCompareStringØ00__func__Ø000), unsafe.Pointer(str(74883)))
 57198  			crt.X__builtin_abort(tls)
 57199  		}
 57200  	}()
 57201  	_vdbeAssertFieldCountWithinLimits(tls, _nKey1, _pKey1, (*XKeyInfo)(_pPKey2.XpKeyInfo))
 57202  	func() int32 {
 57203  		if int32(*elem15(_aKey1, uintptr(1))) < int32(128) {
 57204  			return func() int32 { _serial_type = int32(uint32(*elem15(_aKey1, uintptr(1)))); return int32(1) }()
 57205  		}
 57206  		return int32(_sqlite3GetVarint32(tls, elem15(_aKey1, uintptr(1)), (*uint32)(unsafe.Pointer(&_serial_type))))
 57207  	}()
 57208  	if _serial_type < int32(12) {
 57209  		_res = int32(_pPKey2.Xr1)
 57210  		goto _7
 57211  	}
 57212  	if (_serial_type & int32(1)) == 0 {
 57213  		_res = int32(_pPKey2.Xr2)
 57214  		goto _7
 57215  	}
 57216  	_3_szHdr = int32(*elem15(_aKey1, 0))
 57217  	_3_nStr = (_serial_type - int32(12)) / int32(2)
 57218  	if (_3_szHdr + _3_nStr) > _nKey1 {
 57219  		_pPKey2.XerrCode = uint8(_sqlite3CorruptError(tls, int32(75716)))
 57220  		return int32(0)
 57221  	}
 57222  	_3_nCmp = func() int32 {
 57223  		if (elem25((*XMem)(_pPKey2.XaMem), 0).Xn) < _3_nStr {
 57224  			return (elem25((*XMem)(_pPKey2.XaMem), 0).Xn)
 57225  		}
 57226  		return _3_nStr
 57227  	}()
 57228  	_res = crt.Xmemcmp(tls, unsafe.Pointer(elem15(_aKey1, uintptr(_3_szHdr))), unsafe.Pointer(elem25((*XMem)(_pPKey2.XaMem), 0).Xz), uint64(_3_nCmp))
 57229  	if _res != int32(0) {
 57230  		goto _11
 57231  	}
 57232  	_res = _3_nStr - (elem25((*XMem)(_pPKey2.XaMem), 0).Xn)
 57233  	if _res != int32(0) {
 57234  		goto _12
 57235  	}
 57236  	if int32(_pPKey2.XnField) > int32(1) {
 57237  		_res = _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _pPKey2, int32(1))
 57238  		goto _14
 57239  	}
 57240  	_res = int32(_pPKey2.Xdefault_rc)
 57241  	_pPKey2.XeqSeen = uint8(1)
 57242  _14:
 57243  	goto _17
 57244  _12:
 57245  	if _res > int32(0) {
 57246  		_res = int32(_pPKey2.Xr2)
 57247  		goto _17
 57248  	}
 57249  	_res = int32(_pPKey2.Xr1)
 57250  _17:
 57251  	goto _20
 57252  _11:
 57253  	if _res > int32(0) {
 57254  		_res = int32(_pPKey2.Xr2)
 57255  		goto _20
 57256  	}
 57257  	_res = int32(_pPKey2.Xr1)
 57258  _20:
 57259  _7:
 57260  	func() {
 57261  		if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _res) == 0 && _sqlite3Config.XneverCorrupt != int32(0) && ((*Xsqlite3)((*XKeyInfo)(_pPKey2.XpKeyInfo).Xdb).XmallocFailed) == 0 {
 57262  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75743), unsafe.Pointer(&_vdbeRecordCompareStringØ00__func__Ø000), unsafe.Pointer(str(74915)))
 57263  			crt.X__builtin_abort(tls)
 57264  		}
 57265  	}()
 57266  	return _res
 57267  }
 57268  
 57269  var _vdbeRecordCompareStringØ00__func__Ø000 [24]int8
 57270  
 57271  func init() {
 57272  	crt.Xstrncpy(nil, &_vdbeRecordCompareStringØ00__func__Ø000[0], str(75017), 24)
 57273  }
 57274  
 57275  // C comment
 57276  //  /*
 57277  //  ** Move the cursor to point to the root page of its b-tree structure.
 57278  //  **
 57279  //  ** If the table has a virtual root page, then the cursor is moved to point
 57280  //  ** to the virtual root page instead of the actual root page. A table has a
 57281  //  ** virtual root page when the actual root page contains no cells and a
 57282  //  ** single child page. This can only happen with the table rooted at page 1.
 57283  //  **
 57284  //  ** If the b-tree structure is empty, the cursor state is set to
 57285  //  ** CURSOR_INVALID. Otherwise, the cursor is set to point to the first
 57286  //  ** cell located on the root (or virtual root) page and the cursor state
 57287  //  ** is set to CURSOR_VALID.
 57288  //  **
 57289  //  ** If this function returns successfully, it may be assumed that the
 57290  //  ** page-header flags indicate that the [virtual] root-page is the expected
 57291  //  ** kind of b-tree page (i.e. if when opening the cursor the caller did not
 57292  //  ** specify a KeyInfo structure the flags byte is set to 0x05 or 0x0D,
 57293  //  ** indicating a table b-tree, or if the caller did specify a KeyInfo
 57294  //  ** structure the flags byte is set to 0x02 or 0x0A, indicating an index
 57295  //  ** b-tree).
 57296  //  */
 57297  func _moveToRoot(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 57298  	var _rc int32
 57299  	var _11_subpage uint32
 57300  	var _pRoot *XMemPage
 57301  	_rc = int32(0)
 57302  	func() {
 57303  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 57304  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63949), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(71986)))
 57305  			crt.X__builtin_abort(tls)
 57306  		}
 57307  	}()
 57308  
 57309  	if int32(_pCur.XeState) < int32(3) {
 57310  		goto _2
 57311  	}
 57312  	if int32(_pCur.XeState) == int32(4) {
 57313  		func() {
 57314  			if _pCur.XskipNext == int32(0) {
 57315  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63955), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(75041)))
 57316  				crt.X__builtin_abort(tls)
 57317  			}
 57318  		}()
 57319  		return _pCur.XskipNext
 57320  	}
 57321  	_sqlite3BtreeClearCursor(tls, _pCur)
 57322  _2:
 57323  	if int32(_pCur.XiPage) < int32(0) {
 57324  		goto _6
 57325  	}
 57326  	if _pCur.XiPage == 0 {
 57327  		goto _7
 57328  	}
 57329  _8:
 57330  	func() {
 57331  		if (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) == nil {
 57332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63964), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(75067)))
 57333  			crt.X__builtin_abort(tls)
 57334  		}
 57335  	}()
 57336  	_releasePageNotNull(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(postInc5(&_pCur.XiPage, -1))))
 57337  	if _pCur.XiPage != 0 {
 57338  		goto _8
 57339  	}
 57340  	goto _skip_init
 57341  _7:
 57342  	goto _13
 57343  _6:
 57344  	if _pCur.XpgnoRoot == (0) {
 57345  		_pCur.XeState = 0
 57346  		return int32(0)
 57347  	}
 57348  	func() {
 57349  		if int32(_pCur.XiPage) != int32(-1) {
 57350  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63973), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(75096)))
 57351  			crt.X__builtin_abort(tls)
 57352  		}
 57353  	}()
 57354  	_rc = _getAndInitPage(tls, (*XBtShared)((*XBtree)(_pCur.XpBtree).XpBt), _pCur.XpgnoRoot, elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), 0), nil, int32(_pCur.XcurPagerFlags))
 57355  	if _rc != int32(0) {
 57356  		_pCur.XeState = 0
 57357  		return _rc
 57358  	}
 57359  	_pCur.XiPage = 0
 57360  	_pCur.XcurIntKey = (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), 0)).XintKey
 57361  _13:
 57362  	_pRoot = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), 0)
 57363  	func() {
 57364  		if _pRoot.Xpgno != _pCur.XpgnoRoot {
 57365  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63984), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(75114)))
 57366  			crt.X__builtin_abort(tls)
 57367  		}
 57368  	}()
 57369  	func() {
 57370  		if int32(_pRoot.XintKey) != int32(1) && int32(_pRoot.XintKey) != int32(0) {
 57371  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63996), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(75142)))
 57372  			crt.X__builtin_abort(tls)
 57373  		}
 57374  	}()
 57375  	if (int32(_pRoot.XisInit) == int32(0)) || (bool2int((*XKeyInfo)(_pCur.XpKeyInfo) == nil) != int32(_pRoot.XintKey)) {
 57376  		return _sqlite3CorruptError(tls, int32(63998))
 57377  	}
 57378  _skip_init:
 57379  	_pCur.Xix = 0
 57380  	_pCur.Xinfo.XnSize = 0
 57381  	{
 57382  		p := &_pCur.XcurFlags
 57383  		*p = uint8(int32(*p) & int32(-15))
 57384  	}
 57385  	_pRoot = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), 0)
 57386  	if int32(_pRoot.XnCell) > int32(0) {
 57387  		_pCur.XeState = uint8(1)
 57388  		goto _28
 57389  	}
 57390  	if _pRoot.Xleaf != 0 {
 57391  		goto _26
 57392  	}
 57393  	if _pRoot.Xpgno != uint32(1) {
 57394  		return _sqlite3CorruptError(tls, int32(64011))
 57395  	}
 57396  	_11_subpage = _sqlite3Get4byte(tls, elem15(_pRoot.XaData, uintptr(int32(_pRoot.XhdrOffset)+int32(8))))
 57397  	_pCur.XeState = uint8(1)
 57398  	_rc = _moveToChild(tls, _pCur, _11_subpage)
 57399  	goto _28
 57400  _26:
 57401  	_pCur.XeState = 0
 57402  _28:
 57403  	return _rc
 57404  }
 57405  
 57406  var _moveToRootØ00__func__Ø000 [11]int8
 57407  
 57408  func init() {
 57409  	crt.Xstrncpy(nil, &_moveToRootØ00__func__Ø000[0], str(75179), 11)
 57410  }
 57411  
 57412  // C comment
 57413  //  /*
 57414  //  ** Determine whether or not a cursor has moved from the position where
 57415  //  ** it was last placed, or has been invalidated for any other reason.
 57416  //  ** Cursors can move when the row they are pointing at is deleted out
 57417  //  ** from under them, for example.  Cursor might also move if a btree
 57418  //  ** is rebalanced.
 57419  //  **
 57420  //  ** Calling this routine with a NULL cursor pointer returns false.
 57421  //  **
 57422  //  ** Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor
 57423  //  ** back to where it ought to be if this routine returns true.
 57424  //  */
 57425  func _sqlite3BtreeCursorHasMoved(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 57426  	return bool2int(int32(_pCur.XeState) != int32(1))
 57427  }
 57428  
 57429  // C comment
 57430  //  /*
 57431  //  ** Something has moved cursor "p" out of place.  Maybe the row it was
 57432  //  ** pointed to was deleted out from under it.  Or maybe the btree was
 57433  //  ** rebalanced.  Whatever the cause, try to restore "p" to the place it
 57434  //  ** is supposed to be pointing.  If the row was deleted out from under the
 57435  //  ** cursor, set the cursor to point to a NULL row.
 57436  //  */
 57437  func _handleMovedCursor(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) {
 57438  	var _isDifferentRow, _rc int32
 57439  	func() {
 57440  		if int32(_p.XeCurType) != int32(0) {
 57441  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74500), unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000), unsafe.Pointer(str(71938)))
 57442  			crt.X__builtin_abort(tls)
 57443  		}
 57444  	}()
 57445  	func() {
 57446  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc))) == nil {
 57447  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74501), unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000), unsafe.Pointer(str(75190)))
 57448  			crt.X__builtin_abort(tls)
 57449  		}
 57450  	}()
 57451  	func() {
 57452  		if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc)))) == 0 {
 57453  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74502), unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000), unsafe.Pointer(str(75207)))
 57454  			crt.X__builtin_abort(tls)
 57455  		}
 57456  	}()
 57457  	_rc = _sqlite3BtreeCursorRestore(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc))), &_isDifferentRow)
 57458  	_p.XcacheStatus = 0
 57459  	if _isDifferentRow != 0 {
 57460  		_p.XnullRow = uint8(1)
 57461  	}
 57462  	return _rc
 57463  }
 57464  
 57465  var _handleMovedCursorØ00__func__Ø000 [18]int8
 57466  
 57467  func init() {
 57468  	crt.Xstrncpy(nil, &_handleMovedCursorØ00__func__Ø000[0], str(75249), 18)
 57469  }
 57470  
 57471  // C comment
 57472  //  /*
 57473  //  ** This routine restores a cursor back to its original position after it
 57474  //  ** has been moved by some outside activity (such as a btree rebalance or
 57475  //  ** a row having been deleted out from under the cursor).
 57476  //  **
 57477  //  ** On success, the *pDifferentRow parameter is false if the cursor is left
 57478  //  ** pointing at exactly the same row.  *pDifferntRow is the row the cursor
 57479  //  ** was pointing to has been deleted, forcing the cursor to point to some
 57480  //  ** nearby row.
 57481  //  **
 57482  //  ** This routine should only be called for a cursor that just returned
 57483  //  ** TRUE from sqlite3BtreeCursorHasMoved().
 57484  //  */
 57485  func _sqlite3BtreeCursorRestore(tls *crt.TLS, _pCur *XBtCursor, _pDifferentRow *int32) (r0 int32) {
 57486  	var _rc int32
 57487  	func() {
 57488  		if _pCur == nil {
 57489  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59888), unsafe.Pointer(&_sqlite3BtreeCursorRestoreØ00__func__Ø000), unsafe.Pointer(str(75267)))
 57490  			crt.X__builtin_abort(tls)
 57491  		}
 57492  	}()
 57493  	func() {
 57494  		if int32(_pCur.XeState) == int32(1) {
 57495  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59889), unsafe.Pointer(&_sqlite3BtreeCursorRestoreØ00__func__Ø000), unsafe.Pointer(str(75275)))
 57496  			crt.X__builtin_abort(tls)
 57497  		}
 57498  	}()
 57499  	_rc = func() int32 {
 57500  		if int32(_pCur.XeState) >= int32(3) {
 57501  			return _btreeRestoreCursorPosition(tls, _pCur)
 57502  		}
 57503  		return int32(0)
 57504  	}()
 57505  	if _rc != 0 {
 57506  		*_pDifferentRow = int32(1)
 57507  		return _rc
 57508  	}
 57509  	if int32(_pCur.XeState) != int32(1) {
 57510  		*_pDifferentRow = int32(1)
 57511  		goto _8
 57512  	}
 57513  	func() {
 57514  		if _pCur.XskipNext != int32(0) {
 57515  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59898), unsafe.Pointer(&_sqlite3BtreeCursorRestoreØ00__func__Ø000), unsafe.Pointer(str(75302)))
 57516  			crt.X__builtin_abort(tls)
 57517  		}
 57518  	}()
 57519  	*_pDifferentRow = int32(0)
 57520  _8:
 57521  	return int32(0)
 57522  }
 57523  
 57524  var _sqlite3BtreeCursorRestoreØ00__func__Ø000 [26]int8
 57525  
 57526  func init() {
 57527  	crt.Xstrncpy(nil, &_sqlite3BtreeCursorRestoreØ00__func__Ø000[0], str(75320), 26)
 57528  }
 57529  
 57530  // C comment
 57531  //  /* The next routine used only within assert() statements */
 57532  //  /*
 57533  //  ** Return true if the given BtCursor is valid.  A valid cursor is one
 57534  //  ** that is currently pointing to a row in a (non-empty) table.
 57535  //  ** This is a verification routine is used only within assert() statements.
 57536  //  */
 57537  func _sqlite3BtreeCursorIsValid(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 57538  	return bool2int((_pCur != nil) && (int32(_pCur.XeState) == int32(1)))
 57539  }
 57540  
 57541  // C comment
 57542  //  /*
 57543  //  ** For the entry that cursor pCur is point to, return as
 57544  //  ** many bytes of the key or data as are available on the local
 57545  //  ** b-tree page.  Write the number of available bytes into *pAmt.
 57546  //  **
 57547  //  ** The pointer returned is ephemeral.  The key/data may move
 57548  //  ** or be destroyed on the next call to any Btree routine,
 57549  //  ** including calls from other threads against the same cache.
 57550  //  ** Hence, a mutex on the BtShared should be held prior to calling
 57551  //  ** this routine.
 57552  //  **
 57553  //  ** These routines is used to get quick access to key and data
 57554  //  ** in the common case where no overflow pages are used.
 57555  //  */
 57556  func _sqlite3BtreePayloadFetch(tls *crt.TLS, _pCur *XBtCursor, _pAmt *uint32) (r0 unsafe.Pointer) {
 57557  	return _fetchPayload(tls, _pCur, _pAmt)
 57558  }
 57559  
 57560  // C comment
 57561  //  /*
 57562  //  ** Return a pointer to payload information from the entry that the
 57563  //  ** pCur cursor is pointing to.  The pointer is to the beginning of
 57564  //  ** the key if index btrees (pPage->intKey==0) and is the data for
 57565  //  ** table btrees (pPage->intKey==1). The number of bytes of available
 57566  //  ** key/data is written into *pAmt.  If *pAmt==0, then the value
 57567  //  ** returned will not be a valid pointer.
 57568  //  **
 57569  //  ** This routine is an optimization.  It is common for the entire key
 57570  //  ** and data to fit on the local page and for there to be no overflow
 57571  //  ** pages.  When that is so, this routine can be used to access the
 57572  //  ** key and data without making a copy.  If the key and/or data spills
 57573  //  ** onto overflow pages, then accessPayload() must be used to reassemble
 57574  //  ** the key/data and copy it into a preallocated buffer.
 57575  //  **
 57576  //  ** The pointer returned by this routine looks directly into the cached
 57577  //  ** page of the database.  The data might change or move the next time
 57578  //  ** any btree routine is called.
 57579  //  */
 57580  func _fetchPayload(tls *crt.TLS, _pCur *XBtCursor, _pAmt *uint32) (r0 unsafe.Pointer) {
 57581  	var _amt uint32
 57582  	func() {
 57583  		if _pCur == nil || int32(_pCur.XiPage) < int32(0) || (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) == nil {
 57584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63816), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(75346)))
 57585  			crt.X__builtin_abort(tls)
 57586  		}
 57587  	}()
 57588  	func() {
 57589  		if int32(_pCur.XeState) != int32(1) {
 57590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63817), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(10345)))
 57591  			crt.X__builtin_abort(tls)
 57592  		}
 57593  	}()
 57594  	func() {
 57595  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).Xmutex)) == 0 {
 57596  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63818), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(72011)))
 57597  			crt.X__builtin_abort(tls)
 57598  		}
 57599  	}()
 57600  	func() {
 57601  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 57602  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63819), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(71986)))
 57603  			crt.X__builtin_abort(tls)
 57604  		}
 57605  	}()
 57606  	func() {
 57607  		if int32(_pCur.Xix) >= int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) {
 57608  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63820), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(10552)))
 57609  			crt.X__builtin_abort(tls)
 57610  		}
 57611  	}()
 57612  	func() {
 57613  		if int32(_pCur.Xinfo.XnSize) <= int32(0) {
 57614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63821), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(75401)))
 57615  			crt.X__builtin_abort(tls)
 57616  		}
 57617  	}()
 57618  	func() {
 57619  		if crt.P2U(unsafe.Pointer(_pCur.Xinfo.XpPayload)) <= crt.P2U(unsafe.Pointer((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XaData)) && _sqlite3Config.XneverCorrupt != int32(0) {
 57620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63822), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(75420)))
 57621  			crt.X__builtin_abort(tls)
 57622  		}
 57623  	}()
 57624  	func() {
 57625  		if crt.P2U(unsafe.Pointer(_pCur.Xinfo.XpPayload)) >= crt.P2U(unsafe.Pointer((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XaDataEnd)) && _sqlite3Config.XneverCorrupt != int32(0) {
 57626  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63823), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(75487)))
 57627  			crt.X__builtin_abort(tls)
 57628  		}
 57629  	}()
 57630  	_amt = uint32(int32(int64(uintptr(unsafe.Pointer((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XaDataEnd)) - uintptr(unsafe.Pointer(_pCur.Xinfo.XpPayload)))))
 57631  	if uint32(_pCur.Xinfo.XnLocal) < _amt {
 57632  		_amt = uint32(_pCur.Xinfo.XnLocal)
 57633  	}
 57634  	*_pAmt = _amt
 57635  	return unsafe.Pointer(_pCur.Xinfo.XpPayload)
 57636  }
 57637  
 57638  var _fetchPayloadØ00__func__Ø000 [13]int8
 57639  
 57640  func init() {
 57641  	crt.Xstrncpy(nil, &_fetchPayloadØ00__func__Ø000[0], str(75556), 13)
 57642  }
 57643  
 57644  func _sqlite3VdbeMemFromBtree(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pMem *XMem) (r0 int32) {
 57645  	var _rc int32
 57646  	var _available uint32
 57647  	var _zData *int8
 57648  	_available = uint32(0)
 57649  	_rc = int32(0)
 57650  	func() {
 57651  		if _sqlite3BtreeCursorIsValid(tls, _pCur) == 0 {
 57652  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70690), unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000), unsafe.Pointer(str(75569)))
 57653  			crt.X__builtin_abort(tls)
 57654  		}
 57655  	}()
 57656  	func() {
 57657  		if (int32(_pMem.Xflags) & int32(9312)) != int32(0) {
 57658  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70691), unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000), unsafe.Pointer(str(75601)))
 57659  			crt.X__builtin_abort(tls)
 57660  		}
 57661  	}()
 57662  	func() {
 57663  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
 57664  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70695), unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000), unsafe.Pointer(str(6629)))
 57665  			crt.X__builtin_abort(tls)
 57666  		}
 57667  	}()
 57668  	_zData = (*int8)(_sqlite3BtreePayloadFetch(tls, _pCur, &_available))
 57669  	func() {
 57670  		if _zData == nil {
 57671  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70697), unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000), unsafe.Pointer(str(75623)))
 57672  			crt.X__builtin_abort(tls)
 57673  		}
 57674  	}()
 57675  	if (_offset + _amt) <= _available {
 57676  		_pMem.Xz = elem1(_zData, uintptr(_offset))
 57677  		_pMem.Xflags = uint16(4112)
 57678  		_pMem.Xn = int32(_amt)
 57679  		goto _9
 57680  	}
 57681  	_rc = _vdbeMemFromBtreeResize(tls, _pCur, _offset, _amt, _pMem)
 57682  _9:
 57683  	return _rc
 57684  }
 57685  
 57686  var _sqlite3VdbeMemFromBtreeØ00__func__Ø000 [24]int8
 57687  
 57688  func init() {
 57689  	crt.Xstrncpy(nil, &_sqlite3VdbeMemFromBtreeØ00__func__Ø000[0], str(75632), 24)
 57690  }
 57691  
 57692  // C comment
 57693  //  /*
 57694  //  ** Move data out of a btree key or data field and into a Mem structure.
 57695  //  ** The data is payload from the entry that pCur is currently pointing
 57696  //  ** to.  offset and amt determine what portion of the data or key to retrieve.
 57697  //  ** The result is written into the pMem element.
 57698  //  **
 57699  //  ** The pMem object must have been initialized.  This routine will use
 57700  //  ** pMem->zMalloc to hold the content from the btree, if possible.  New
 57701  //  ** pMem->zMalloc space will be allocated if necessary.  The calling routine
 57702  //  ** is responsible for making sure that the pMem object is eventually
 57703  //  ** destroyed.
 57704  //  **
 57705  //  ** If this routine fails for any reason (malloc returns NULL or unable
 57706  //  ** to read from the disk) then the pMem is left in an inconsistent state.
 57707  //  */
 57708  func _vdbeMemFromBtreeResize(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pMem *XMem) (r0 int32) {
 57709  	var _rc int32
 57710  	_pMem.Xflags = uint16(1)
 57711  	if int32(0) != store2(&_rc, _sqlite3VdbeMemClearAndResize(tls, _pMem, int32(_amt+uint32(2)))) {
 57712  		goto _0
 57713  	}
 57714  	_rc = _sqlite3BtreePayload(tls, _pCur, _offset, _amt, unsafe.Pointer(_pMem.Xz))
 57715  	if _rc == int32(0) {
 57716  		*elem1(_pMem.Xz, uintptr(_amt)) = 0
 57717  		*elem1(_pMem.Xz, uintptr(_amt+uint32(1))) = 0
 57718  		_pMem.Xflags = uint16(528)
 57719  		_pMem.Xn = int32(_amt)
 57720  		goto _2
 57721  	}
 57722  	_sqlite3VdbeMemRelease(tls, _pMem)
 57723  _2:
 57724  _0:
 57725  	return _rc
 57726  }
 57727  
 57728  func _sqlite3VdbeOneByteSerialTypeLen(tls *crt.TLS, _serial_type uint8) (r0 uint8) {
 57729  	func() {
 57730  		if int32(_serial_type) >= int32(128) {
 57731  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74680), unsafe.Pointer(&_sqlite3VdbeOneByteSerialTypeLenØ00__func__Ø000), unsafe.Pointer(str(75656)))
 57732  			crt.X__builtin_abort(tls)
 57733  		}
 57734  	}()
 57735  	return *elem15((*uint8)(unsafe.Pointer(&_sqlite3SmallTypeSizes)), uintptr(_serial_type))
 57736  }
 57737  
 57738  var _sqlite3VdbeOneByteSerialTypeLenØ00__func__Ø000 [32]int8
 57739  
 57740  func init() {
 57741  	crt.Xstrncpy(nil, &_sqlite3VdbeOneByteSerialTypeLenØ00__func__Ø000[0], str(75672), 32)
 57742  }
 57743  
 57744  var _sqlite3VdbeExecØ00aFlagØ004 [2]uint16
 57745  
 57746  func init() {
 57747  	_sqlite3VdbeExecØ00aFlagØ004 = [2]uint16{uint16(16), uint16(514)}
 57748  }
 57749  
 57750  var _sqlite3VdbeExecØ00aZeroØ005 [16]uint8
 57751  
 57752  // C comment
 57753  //  /*
 57754  //  ** Return the serial-type for the value stored in pMem.
 57755  //  */
 57756  func _sqlite3VdbeSerialType(tls *crt.TLS, _pMem *XMem, _file_format int32, _pLen *uint32) (r0 uint32) {
 57757  	var _flags int32
 57758  	var _2_i int64
 57759  	var _n uint32
 57760  	var _2_u uint64
 57761  	_flags = int32(_pMem.Xflags)
 57762  	func() {
 57763  		if _pLen == nil {
 57764  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74602), unsafe.Pointer(&_sqlite3VdbeSerialTypeØ00__func__Ø000), unsafe.Pointer(str(75704)))
 57765  			crt.X__builtin_abort(tls)
 57766  		}
 57767  	}()
 57768  	if (_flags & int32(1)) != 0 {
 57769  		*_pLen = 0
 57770  		return 0
 57771  	}
 57772  	if (_flags & int32(4)) == 0 {
 57773  		goto _3
 57774  	}
 57775  	_2_i = *(*int64)(unsafe.Pointer(&_pMem.Xu))
 57776  	if _2_i < (0) {
 57777  		_2_u = uint64(^_2_i)
 57778  		goto _5
 57779  	}
 57780  	_2_u = uint64(_2_i)
 57781  _5:
 57782  	if _2_u > uint64(127) {
 57783  		goto _6
 57784  	}
 57785  	if ((_2_i & int64(1)) == _2_i) && (_file_format >= int32(4)) {
 57786  		*_pLen = 0
 57787  		return uint32(8) + uint32(_2_u)
 57788  	}
 57789  	*_pLen = uint32(1)
 57790  	return uint32(1)
 57791  
 57792  _6:
 57793  	if _2_u <= uint64(32767) {
 57794  		*_pLen = uint32(2)
 57795  		return uint32(2)
 57796  	}
 57797  	if _2_u <= uint64(8388607) {
 57798  		*_pLen = uint32(3)
 57799  		return uint32(3)
 57800  	}
 57801  	if _2_u <= uint64(2147483647) {
 57802  		*_pLen = uint32(4)
 57803  		return uint32(4)
 57804  	}
 57805  	if _2_u <= uint64(140737488355327) {
 57806  		*_pLen = uint32(6)
 57807  		return uint32(5)
 57808  	}
 57809  	*_pLen = uint32(8)
 57810  	return uint32(6)
 57811  
 57812  _3:
 57813  	if (_flags & int32(8)) != 0 {
 57814  		*_pLen = uint32(8)
 57815  		return uint32(7)
 57816  	}
 57817  	func() {
 57818  		if ((*Xsqlite3)(_pMem.Xdb).XmallocFailed) == 0 && (_flags&int32(18)) == 0 {
 57819  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74637), unsafe.Pointer(&_sqlite3VdbeSerialTypeØ00__func__Ø000), unsafe.Pointer(str(75712)))
 57820  			crt.X__builtin_abort(tls)
 57821  		}
 57822  	}()
 57823  	func() {
 57824  		if _pMem.Xn < int32(0) {
 57825  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74638), unsafe.Pointer(&_sqlite3VdbeSerialTypeØ00__func__Ø000), unsafe.Pointer(str(5902)))
 57826  			crt.X__builtin_abort(tls)
 57827  		}
 57828  	}()
 57829  	_n = uint32(_pMem.Xn)
 57830  	if (_flags & int32(16384)) != 0 {
 57831  		_n += uint32(*(*int32)(unsafe.Pointer(&_pMem.Xu)))
 57832  	}
 57833  	*_pLen = _n
 57834  	return ((_n * uint32(2)) + uint32(12)) + uint32(bool2int((_flags&int32(2)) != int32(0)))
 57835  }
 57836  
 57837  var _sqlite3VdbeSerialTypeØ00__func__Ø000 [22]int8
 57838  
 57839  func init() {
 57840  	crt.Xstrncpy(nil, &_sqlite3VdbeSerialTypeØ00__func__Ø000[0], str(75763), 22)
 57841  }
 57842  
 57843  // C comment
 57844  //  /*
 57845  //  ** Routines to read and write variable-length integers.  These used to
 57846  //  ** be defined locally, but now we use the varint routines in the util.c
 57847  //  ** file.
 57848  //  */
 57849  func _sqlite3PutVarint(tls *crt.TLS, _p *uint8, _v uint64) (r0 int32) {
 57850  	if _v <= uint64(127) {
 57851  		*elem15(_p, 0) = uint8(_v & uint64(127))
 57852  		return int32(1)
 57853  	}
 57854  	if _v <= uint64(16383) {
 57855  		*elem15(_p, 0) = uint8(((_v >> 7) & uint64(127)) | uint64(128))
 57856  		*elem15(_p, uintptr(1)) = uint8(_v & uint64(127))
 57857  		return int32(2)
 57858  	}
 57859  	return _putVarint64(tls, _p, _v)
 57860  }
 57861  
 57862  // C comment
 57863  //  /*
 57864  //  ** Write a 64-bit variable-length integer to memory starting at p[0].
 57865  //  ** The length of data write will be between 1 and 9 bytes.  The number
 57866  //  ** of bytes written is returned.
 57867  //  **
 57868  //  ** A variable-length integer consists of the lower 7 bits of each byte
 57869  //  ** for all bytes that have the 8th bit set and one byte with the 8th
 57870  //  ** bit clear.  Except, if we get to the 9th byte, it stores the full
 57871  //  ** 8 bits and is the last byte.
 57872  //  */
 57873  func _putVarint64(tls *crt.TLS, _p *uint8, _v uint64) (r0 int32) {
 57874  	var _i, _j, _n int32
 57875  	var _buf [10]uint8
 57876  	if (_v & uint64(18374686479671623680)) == 0 {
 57877  		goto _0
 57878  	}
 57879  	*elem15(_p, uintptr(8)) = uint8(_v)
 57880  	_v >>= 8
 57881  	_i = int32(7)
 57882  _1:
 57883  	if _i < int32(0) {
 57884  		goto _4
 57885  	}
 57886  	*elem15(_p, uintptr(_i)) = uint8((_v & uint64(127)) | uint64(128))
 57887  	_v >>= 7
 57888  	_i -= 1
 57889  	goto _1
 57890  _4:
 57891  	return int32(9)
 57892  
 57893  _0:
 57894  	_n = int32(0)
 57895  _5:
 57896  	*elem15((*uint8)(unsafe.Pointer(&_buf)), uintptr(postInc2(&_n, 1))) = uint8((_v & uint64(127)) | uint64(128))
 57897  	_v >>= 7
 57898  	if _v != (0) {
 57899  		goto _5
 57900  	}
 57901  	{
 57902  		p := elem15((*uint8)(unsafe.Pointer(&_buf)), 0)
 57903  		*p = uint8(int32(*p) & int32(127))
 57904  	}
 57905  	func() {
 57906  		if _n > int32(9) {
 57907  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28455), unsafe.Pointer(&_putVarint64Ø00__func__Ø000), unsafe.Pointer(str(75785)))
 57908  			crt.X__builtin_abort(tls)
 57909  		}
 57910  	}()
 57911  	*func() *int32 { _i = int32(0); return &_j }() = _n - int32(1)
 57912  _8:
 57913  	if _j < int32(0) {
 57914  		goto _11
 57915  	}
 57916  	*elem15(_p, uintptr(_i)) = *elem15((*uint8)(unsafe.Pointer(&_buf)), uintptr(_j))
 57917  	*func() *int32 { _j -= 1; return &_i }() += 1
 57918  	goto _8
 57919  _11:
 57920  	return _n
 57921  
 57922  	_ = _buf
 57923  	panic(0)
 57924  }
 57925  
 57926  var _putVarint64Ø00__func__Ø000 [12]int8
 57927  
 57928  func init() {
 57929  	crt.Xstrncpy(nil, &_putVarint64Ø00__func__Ø000[0], str(75790), 12)
 57930  }
 57931  
 57932  func _sqlite3VdbeSerialPut(tls *crt.TLS, _buf *uint8, _pMem *XMem, _serial_type uint32) (r0 uint32) {
 57933  	var _len, _1_i uint32
 57934  	var _1_v uint64
 57935  	if _serial_type > uint32(7) || _serial_type <= (0) {
 57936  		goto _1
 57937  	}
 57938  	if _serial_type == uint32(7) {
 57939  		crt.Xmemcpy(tls, unsafe.Pointer(&_1_v), unsafe.Pointer((*float64)(unsafe.Pointer(&_pMem.Xu))), uint64(8))
 57940  		goto _3
 57941  	}
 57942  	_1_v = uint64(*(*int64)(unsafe.Pointer(&_pMem.Xu)))
 57943  _3:
 57944  	_len = store34(&_1_i, uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3SmallTypeSizes)), uintptr(_serial_type))))
 57945  	func() {
 57946  		if _1_i <= (0) {
 57947  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74765), unsafe.Pointer(&_sqlite3VdbeSerialPutØ00__func__Ø000), unsafe.Pointer(str(12925)))
 57948  			crt.X__builtin_abort(tls)
 57949  		}
 57950  	}()
 57951  _6:
 57952  	*elem15(_buf, uintptr(preInc34(&_1_i, uint32(4294967295)))) = uint8(_1_v & uint64(255))
 57953  	_1_v >>= 8
 57954  	if _1_i != 0 {
 57955  		goto _6
 57956  	}
 57957  	return _len
 57958  
 57959  _1:
 57960  	if _serial_type < uint32(12) {
 57961  		goto _7
 57962  	}
 57963  	func() {
 57964  		if (_pMem.Xn + func() int32 {
 57965  			if (int32(_pMem.Xflags) & int32(16384)) != 0 {
 57966  				return (*(*int32)(unsafe.Pointer(&_pMem.Xu)))
 57967  			}
 57968  			return int32(0)
 57969  		}()) != int32(_sqlite3VdbeSerialTypeLen(tls, _serial_type)) {
 57970  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74775), unsafe.Pointer(&_sqlite3VdbeSerialPutØ00__func__Ø000), unsafe.Pointer(str(75802)))
 57971  			crt.X__builtin_abort(tls)
 57972  		}
 57973  	}()
 57974  	_len = uint32(_pMem.Xn)
 57975  	if _len > (0) {
 57976  		crt.Xmemcpy(tls, unsafe.Pointer(_buf), unsafe.Pointer(_pMem.Xz), uint64(_len))
 57977  	}
 57978  	return _len
 57979  
 57980  _7:
 57981  	return 0
 57982  }
 57983  
 57984  var _sqlite3VdbeSerialPutØ00__func__Ø000 [21]int8
 57985  
 57986  func init() {
 57987  	crt.Xstrncpy(nil, &_sqlite3VdbeSerialPutØ00__func__Ø000[0], str(75901), 21)
 57988  }
 57989  
 57990  // C comment
 57991  //  /*
 57992  //  ** The first argument, pCur, is a cursor opened on some b-tree. Count the
 57993  //  ** number of entries in the b-tree and write the result to *pnEntry.
 57994  //  **
 57995  //  ** SQLITE_OK is returned if the operation is successfully executed.
 57996  //  ** Otherwise, if an error is encountered (i.e. an IO error or database
 57997  //  ** corruption) an SQLite error code is returned.
 57998  //  */
 57999  func _sqlite3BtreeCount(tls *crt.TLS, _pCur *XBtCursor, _pnEntry *int64) (r0 int32) {
 58000  	var _rc, _2_iIdx int32
 58001  	var _nEntry int64
 58002  	var _2_pPage *XMemPage
 58003  	_nEntry = int64(0)
 58004  	if _pCur.XpgnoRoot == (0) {
 58005  		*_pnEntry = 0
 58006  		return int32(0)
 58007  	}
 58008  	_rc = _moveToRoot(tls, _pCur)
 58009  _1:
 58010  	if _rc != int32(0) {
 58011  		goto _2
 58012  	}
 58013  	_2_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 58014  	if (_2_pPage.Xleaf != 0) || (_2_pPage.XintKey == 0) {
 58015  		_nEntry += int64(_2_pPage.XnCell)
 58016  	}
 58017  	if _2_pPage.Xleaf == 0 {
 58018  		goto _5
 58019  	}
 58020  _6:
 58021  	if int32(_pCur.XiPage) == int32(0) {
 58022  		*_pnEntry = _nEntry
 58023  		return _moveToRoot(tls, _pCur)
 58024  	}
 58025  	_moveToParent(tls, _pCur)
 58026  	if int32(_pCur.Xix) >= int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) {
 58027  		goto _6
 58028  	}
 58029  	_pCur.Xix += 1
 58030  	_2_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 58031  _5:
 58032  	_2_iIdx = int32(_pCur.Xix)
 58033  	if _2_iIdx == int32(_2_pPage.XnCell) {
 58034  		_rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, elem15(_2_pPage.XaData, uintptr(int32(_2_pPage.XhdrOffset)+int32(8)))))
 58035  		goto _9
 58036  	}
 58037  	_rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pPage.XaData))+uintptr(int32(_2_pPage.XmaskPage)&((int32(*elem15(elem15(_2_pPage.XaCellIdx, uintptr(int32(2)*_2_iIdx)), 0))<<8)|int32(*elem15(elem15(_2_pPage.XaCellIdx, uintptr(int32(2)*_2_iIdx)), uintptr(1)))))))))
 58038  _9:
 58039  	goto _1
 58040  _2:
 58041  	return _rc
 58042  }
 58043  
 58044  // C comment
 58045  //  /*
 58046  //  ** This function is only called from within an assert() expression. It
 58047  //  ** checks that the sqlite3.nTransaction variable is correctly set to
 58048  //  ** the number of non-transaction savepoints currently in the
 58049  //  ** linked list starting at sqlite3.pSavepoint.
 58050  //  **
 58051  //  ** Usage:
 58052  //  **
 58053  //  **     assert( checkSavepointCount(db) );
 58054  //  */
 58055  func _checkSavepointCount(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 58056  	var _n int32
 58057  	var _p *XSavepoint
 58058  	_n = int32(0)
 58059  	_p = (*XSavepoint)(_db.XpSavepoint)
 58060  _0:
 58061  	if _p == nil {
 58062  		goto _3
 58063  	}
 58064  	_n += 1
 58065  	_p = (*XSavepoint)(_p.XpNext)
 58066  	goto _0
 58067  _3:
 58068  	func() {
 58069  		if _n != (_db.XnSavepoint + int32(_db.XisTransactionSavepoint)) {
 58070  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78815), unsafe.Pointer(&_checkSavepointCountØ00__func__Ø000), unsafe.Pointer(str(75922)))
 58071  			crt.X__builtin_abort(tls)
 58072  		}
 58073  	}()
 58074  	return int32(1)
 58075  }
 58076  
 58077  var _checkSavepointCountØ00__func__Ø000 [20]int8
 58078  
 58079  func init() {
 58080  	crt.Xstrncpy(nil, &_checkSavepointCountØ00__func__Ø000[0], str(75971), 20)
 58081  }
 58082  
 58083  // C comment
 58084  //  /*
 58085  //  ** Start a statement subtransaction. The subtransaction can be rolled
 58086  //  ** back independently of the main transaction. You must start a transaction
 58087  //  ** before starting a subtransaction. The subtransaction is ended automatically
 58088  //  ** if the main transaction commits or rolls back.
 58089  //  **
 58090  //  ** Statement subtransactions are used around individual SQL statements
 58091  //  ** that are contained within a BEGIN...COMMIT block.  If a constraint
 58092  //  ** error occurs within the statement, the effect of that one statement
 58093  //  ** can be rolled back without having to rollback the entire transaction.
 58094  //  **
 58095  //  ** A statement sub-transaction is implemented as an anonymous savepoint. The
 58096  //  ** value passed as the second parameter is the total number of savepoints,
 58097  //  ** including the new anonymous savepoint, open on the B-Tree. i.e. if there
 58098  //  ** are no active savepoints and no other statement-transactions open,
 58099  //  ** iStatement is 1. This anonymous savepoint can be released or rolled back
 58100  //  ** using the sqlite3BtreeSavepoint() function.
 58101  //  */
 58102  func _sqlite3BtreeBeginStmt(tls *crt.TLS, _p *XBtree, _iStatement int32) (r0 int32) {
 58103  	var _rc int32
 58104  	var _pBt *XBtShared
 58105  	_pBt = (*XBtShared)(_p.XpBt)
 58106  	_sqlite3BtreeEnter(tls, _p)
 58107  	func() {
 58108  		if int32(_p.XinTrans) != int32(2) {
 58109  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63105), unsafe.Pointer(&_sqlite3BtreeBeginStmtØ00__func__Ø000), unsafe.Pointer(str(75991)))
 58110  			crt.X__builtin_abort(tls)
 58111  		}
 58112  	}()
 58113  	func() {
 58114  		if (int32(_pBt.XbtsFlags) & int32(1)) != int32(0) {
 58115  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63106), unsafe.Pointer(&_sqlite3BtreeBeginStmtØ00__func__Ø000), unsafe.Pointer(str(76015)))
 58116  			crt.X__builtin_abort(tls)
 58117  		}
 58118  	}()
 58119  	func() {
 58120  		if _iStatement <= int32(0) {
 58121  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63107), unsafe.Pointer(&_sqlite3BtreeBeginStmtØ00__func__Ø000), unsafe.Pointer(str(76050)))
 58122  			crt.X__builtin_abort(tls)
 58123  		}
 58124  	}()
 58125  	func() {
 58126  		if _iStatement <= ((*Xsqlite3)(_p.Xdb).XnSavepoint) {
 58127  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63108), unsafe.Pointer(&_sqlite3BtreeBeginStmtØ00__func__Ø000), unsafe.Pointer(str(76063)))
 58128  			crt.X__builtin_abort(tls)
 58129  		}
 58130  	}()
 58131  	func() {
 58132  		if int32(_pBt.XinTransaction) != int32(2) {
 58133  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63109), unsafe.Pointer(&_sqlite3BtreeBeginStmtØ00__func__Ø000), unsafe.Pointer(str(56904)))
 58134  			crt.X__builtin_abort(tls)
 58135  		}
 58136  	}()
 58137  	_rc = _sqlite3PagerOpenSavepoint(tls, (*XPager)(_pBt.XpPager), _iStatement)
 58138  	_sqlite3BtreeLeave(tls, _p)
 58139  	return _rc
 58140  }
 58141  
 58142  var _sqlite3BtreeBeginStmtØ00__func__Ø000 [22]int8
 58143  
 58144  func init() {
 58145  	crt.Xstrncpy(nil, &_sqlite3BtreeBeginStmtØ00__func__Ø000[0], str(76092), 22)
 58146  }
 58147  
 58148  // C comment
 58149  //  /*
 58150  //  ** Write meta-information back into the database.  Meta[0] is
 58151  //  ** read-only and may not be written.
 58152  //  */
 58153  func _sqlite3BtreeUpdateMeta(tls *crt.TLS, _p *XBtree, _idx int32, _iMeta uint32) (r0 int32) {
 58154  	var _rc int32
 58155  	var _pP1 *uint8
 58156  	var _pBt *XBtShared
 58157  	_pBt = (*XBtShared)(_p.XpBt)
 58158  	func() {
 58159  		if _idx < int32(1) || _idx > int32(15) {
 58160  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67891), unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000), unsafe.Pointer(str(76114)))
 58161  			crt.X__builtin_abort(tls)
 58162  		}
 58163  	}()
 58164  	_sqlite3BtreeEnter(tls, _p)
 58165  	func() {
 58166  		if int32(_p.XinTrans) != int32(2) {
 58167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67893), unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000), unsafe.Pointer(str(75991)))
 58168  			crt.X__builtin_abort(tls)
 58169  		}
 58170  	}()
 58171  	func() {
 58172  		if (*XMemPage)(_pBt.XpPage1) == nil {
 58173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67894), unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000), unsafe.Pointer(str(76132)))
 58174  			crt.X__builtin_abort(tls)
 58175  		}
 58176  	}()
 58177  	_pP1 = (*XMemPage)(_pBt.XpPage1).XaData
 58178  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage))
 58179  	if _rc != int32(0) {
 58180  		goto _7
 58181  	}
 58182  	_sqlite3Put4byte(tls, elem15(_pP1, uintptr(int32(36)+(_idx*int32(4)))), _iMeta)
 58183  	if _idx == int32(7) {
 58184  		func() {
 58185  			if _pBt.XautoVacuum == 0 && _iMeta != (0) {
 58186  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67901), unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000), unsafe.Pointer(str(76147)))
 58187  				crt.X__builtin_abort(tls)
 58188  			}
 58189  		}()
 58190  		func() {
 58191  			if _iMeta != (0) && _iMeta != uint32(1) {
 58192  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67902), unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000), unsafe.Pointer(str(76175)))
 58193  				crt.X__builtin_abort(tls)
 58194  			}
 58195  		}()
 58196  		_pBt.XincrVacuum = uint8(_iMeta)
 58197  	}
 58198  _7:
 58199  	_sqlite3BtreeLeave(tls, _p)
 58200  	return _rc
 58201  }
 58202  
 58203  var _sqlite3BtreeUpdateMetaØ00__func__Ø000 [23]int8
 58204  
 58205  func init() {
 58206  	crt.Xstrncpy(nil, &_sqlite3BtreeUpdateMetaØ00__func__Ø000[0], str(76196), 23)
 58207  }
 58208  
 58209  // C comment
 58210  //  /*
 58211  //  ** Allocate VdbeCursor number iCur.  Return a pointer to it.  Return NULL
 58212  //  ** if we run out of memory.
 58213  //  */
 58214  func _allocateCursor(tls *crt.TLS, _p *TVdbe, _iCur int32, _nField int32, _iDb int32, _eCurType uint8) (r0 *XVdbeCursor) {
 58215  	var _nByte int32
 58216  	var _pMem *XMem
 58217  	var _pCx *XVdbeCursor
 58218  	_pMem = func() *XMem {
 58219  		if _iCur > int32(0) {
 58220  			return elem25((*XMem)(_p.XaMem), uintptr(_p.XnMem-_iCur))
 58221  		}
 58222  		return (*XMem)(_p.XaMem)
 58223  	}()
 58224  	_pCx = nil
 58225  	_nByte = int32((uint64(120) + (uint64(8) * uint64(_nField))) + uint64(func() int32 {
 58226  		if int32(_eCurType) == int32(0) {
 58227  			return _sqlite3BtreeCursorSize(tls)
 58228  		}
 58229  		return int32(0)
 58230  	}()))
 58231  	func() {
 58232  		if _iCur < int32(0) || _iCur >= _p.XnCursor {
 58233  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78418), unsafe.Pointer(&_allocateCursorØ00__func__Ø000), unsafe.Pointer(str(76219)))
 58234  			crt.X__builtin_abort(tls)
 58235  		}
 58236  	}()
 58237  	if (*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur))) != nil {
 58238  		_sqlite3VdbeFreeCursor(tls, _p, *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur)))
 58239  		*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur)) = nil
 58240  	}
 58241  	if int32(0) != _sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte) {
 58242  		goto _8
 58243  	}
 58244  	*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur)) = store87(&_pCx, (*XVdbeCursor)(unsafe.Pointer(_pMem.Xz)))
 58245  	crt.Xmemset(tls, unsafe.Pointer(_pCx), int32(0), uint64(40))
 58246  	_pCx.XeCurType = _eCurType
 58247  	_pCx.XiDb = int8(_iDb)
 58248  	_pCx.XnField = int16(_nField)
 58249  	_pCx.XaOffset = elem31((*uint32)(unsafe.Pointer(&_pCx.XaType)), uintptr(_nField))
 58250  	if int32(_eCurType) == int32(0) {
 58251  		*(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc)))) = (*XBtCursor)(unsafe.Pointer(elem1(_pMem.Xz, uintptr(uint64(120)+(uint64(8)*uint64(_nField))))))
 58252  		_sqlite3BtreeCursorZero(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc))))
 58253  	}
 58254  _8:
 58255  	return _pCx
 58256  }
 58257  
 58258  // C comment
 58259  //  /*
 58260  //  ** Return the size of a BtCursor object in bytes.
 58261  //  **
 58262  //  ** This interfaces is needed so that users of cursors can preallocate
 58263  //  ** sufficient storage to hold a cursor.  The BtCursor object is opaque
 58264  //  ** to users so they cannot do the sizeof() themselves - they must call
 58265  //  ** this routine.
 58266  //  */
 58267  func _sqlite3BtreeCursorSize(tls *crt.TLS) (r0 int32) {
 58268  	return int32(304)
 58269  }
 58270  
 58271  var _allocateCursorØ00__func__Ø000 [15]int8
 58272  
 58273  func init() {
 58274  	crt.Xstrncpy(nil, &_allocateCursorØ00__func__Ø000[0], str(76246), 15)
 58275  }
 58276  
 58277  // C comment
 58278  //  /*
 58279  //  ** Initialize memory that will be converted into a BtCursor object.
 58280  //  **
 58281  //  ** The simple approach here would be to memset() the entire object
 58282  //  ** to zero.  But it turns out that the apPage[] and aiIdx[] arrays
 58283  //  ** do not need to be zeroed and they are large, so we can save a lot
 58284  //  ** of run-time by skipping the initialization of those elements.
 58285  //  */
 58286  func _sqlite3BtreeCursorZero(tls *crt.TLS, _p *XBtCursor) {
 58287  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(88))
 58288  }
 58289  
 58290  func _sqlite3BtreeCursor(tls *crt.TLS, _p *XBtree, _iTable int32, _wrFlag int32, _pKeyInfo *XKeyInfo, _pCur *XBtCursor) (r0 int32) {
 58291  	var _rc int32
 58292  	if _iTable < int32(1) {
 58293  		_rc = _sqlite3CorruptError(tls, int32(63273))
 58294  		goto _1
 58295  	}
 58296  	_sqlite3BtreeEnter(tls, _p)
 58297  	_rc = _btreeCursor(tls, _p, _iTable, _wrFlag, _pKeyInfo, _pCur)
 58298  	_sqlite3BtreeLeave(tls, _p)
 58299  _1:
 58300  	return _rc
 58301  }
 58302  
 58303  // C comment
 58304  //  /*
 58305  //  ** Create a new cursor for the BTree whose root is on the page
 58306  //  ** iTable. If a read-only cursor is requested, it is assumed that
 58307  //  ** the caller already has at least a read-only transaction open
 58308  //  ** on the database already. If a write-cursor is requested, then
 58309  //  ** the caller is assumed to have an open write transaction.
 58310  //  **
 58311  //  ** If the BTREE_WRCSR bit of wrFlag is clear, then the cursor can only
 58312  //  ** be used for reading.  If the BTREE_WRCSR bit is set, then the cursor
 58313  //  ** can be used for reading or for writing if other conditions for writing
 58314  //  ** are also met.  These are the conditions that must be met in order
 58315  //  ** for writing to be allowed:
 58316  //  **
 58317  //  ** 1:  The cursor must have been opened with wrFlag containing BTREE_WRCSR
 58318  //  **
 58319  //  ** 2:  Other database connections that share the same pager cache
 58320  //  **     but which are not in the READ_UNCOMMITTED state may not have
 58321  //  **     cursors open with wrFlag==0 on the same table.  Otherwise
 58322  //  **     the changes made by this write cursor would be visible to
 58323  //  **     the read cursors in the other database connection.
 58324  //  **
 58325  //  ** 3:  The database must be writable (not on read-only media)
 58326  //  **
 58327  //  ** 4:  There must be an active transaction.
 58328  //  **
 58329  //  ** The BTREE_FORDELETE bit of wrFlag may optionally be set if BTREE_WRCSR
 58330  //  ** is set.  If FORDELETE is set, that is a hint to the implementation that
 58331  //  ** this cursor will only be used to seek to and delete entries of an index
 58332  //  ** as part of a larger DELETE statement.  The FORDELETE hint is not used by
 58333  //  ** this implementation.  But in a hypothetical alternative storage engine
 58334  //  ** in which index entries are automatically deleted when corresponding table
 58335  //  ** rows are deleted, the FORDELETE flag is a hint that all SEEK and DELETE
 58336  //  ** operations on this cursor can be no-ops and all READ operations can
 58337  //  ** return a null row (2-bytes: 0x01 0x00).
 58338  //  **
 58339  //  ** No checking is done to make sure that page iTable really is the
 58340  //  ** root page of a b-tree.  If it is not, then the cursor acquired
 58341  //  ** will not work correctly.
 58342  //  **
 58343  //  ** It is assumed that the sqlite3BtreeCursorZero() has been called
 58344  //  ** on pCur to initialize the memory space prior to invoking this routine.
 58345  //  */
 58346  func _btreeCursor(tls *crt.TLS, _p *XBtree, _iTable int32, _wrFlag int32, _pKeyInfo *XKeyInfo, _pCur *XBtCursor) (r0 int32) {
 58347  	var _pBt *XBtShared
 58348  	var _pX *XBtCursor
 58349  	_pBt = (*XBtShared)(_p.XpBt)
 58350  	func() {
 58351  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 58352  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63214), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(17442)))
 58353  			crt.X__builtin_abort(tls)
 58354  		}
 58355  	}()
 58356  	func() {
 58357  		if _wrFlag != int32(0) && _wrFlag != int32(4) && _wrFlag != int32(12) {
 58358  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63215), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76261)))
 58359  			crt.X__builtin_abort(tls)
 58360  		}
 58361  	}()
 58362  	func() {
 58363  		if _hasSharedCacheTableLock(tls, _p, uint32(_iTable), bool2int(_pKeyInfo != nil), func() int32 {
 58364  			if _wrFlag != 0 {
 58365  				return int32(2)
 58366  			}
 58367  			return int32(1)
 58368  		}()) == 0 {
 58369  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63224), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76335)))
 58370  			crt.X__builtin_abort(tls)
 58371  		}
 58372  	}()
 58373  	func() {
 58374  		if _wrFlag != int32(0) && _hasReadConflicts(tls, _p, uint32(_iTable)) != 0 {
 58375  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63225), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76397)))
 58376  			crt.X__builtin_abort(tls)
 58377  		}
 58378  	}()
 58379  	func() {
 58380  		if int32(_p.XinTrans) <= int32(0) {
 58381  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63228), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(54118)))
 58382  			crt.X__builtin_abort(tls)
 58383  		}
 58384  	}()
 58385  	func() {
 58386  		if _wrFlag != int32(0) && int32(_p.XinTrans) != int32(2) {
 58387  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63229), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76439)))
 58388  			crt.X__builtin_abort(tls)
 58389  		}
 58390  	}()
 58391  	func() {
 58392  		if _pBt.XpPage1 == nil || ((*XMemPage)(_pBt.XpPage1).XaData) == nil {
 58393  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63230), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76476)))
 58394  			crt.X__builtin_abort(tls)
 58395  		}
 58396  	}()
 58397  	func() {
 58398  		if _wrFlag != int32(0) && (int32(_pBt.XbtsFlags)&int32(1)) != int32(0) {
 58399  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63231), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76510)))
 58400  			crt.X__builtin_abort(tls)
 58401  		}
 58402  	}()
 58403  	if _wrFlag == 0 {
 58404  		goto _24
 58405  	}
 58406  	_allocateTempSpace(tls, _pBt)
 58407  	if _pBt.XpTmpSpace == nil {
 58408  		return _sqlite3NomemError(tls, int32(63235))
 58409  	}
 58410  _24:
 58411  	if (_iTable == int32(1)) && (_btreePagecount(tls, _pBt) == (0)) {
 58412  		func() {
 58413  			if _wrFlag != int32(0) {
 58414  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63238), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76558)))
 58415  				crt.X__builtin_abort(tls)
 58416  			}
 58417  		}()
 58418  		_iTable = int32(0)
 58419  	}
 58420  	_pCur.XpgnoRoot = uint32(_iTable)
 58421  	_pCur.XiPage = int8(-1)
 58422  	*(**XKeyInfo)(unsafe.Pointer(&_pCur.XpKeyInfo)) = _pKeyInfo
 58423  	*(**XBtree)(unsafe.Pointer(&_pCur.XpBtree)) = _p
 58424  	*(**XBtShared)(unsafe.Pointer(&_pCur.XpBt)) = _pBt
 58425  	_pCur.XcurFlags = uint8(func() int32 {
 58426  		if _wrFlag != 0 {
 58427  			return int32(1)
 58428  		}
 58429  		return int32(0)
 58430  	}())
 58431  	_pCur.XcurPagerFlags = uint8(func() int32 {
 58432  		if _wrFlag != 0 {
 58433  			return int32(0)
 58434  		}
 58435  		return int32(2)
 58436  	}())
 58437  	_pX = (*XBtCursor)(_pBt.XpCursor)
 58438  _34:
 58439  	if _pX == nil {
 58440  		goto _37
 58441  	}
 58442  	if _pX.XpgnoRoot == uint32(_iTable) {
 58443  		{
 58444  			p := &_pX.XcurFlags
 58445  			*p = uint8(int32(*p) | int32(32))
 58446  		}
 58447  		{
 58448  			p := &_pCur.XcurFlags
 58449  			*p = uint8(int32(*p) | int32(32))
 58450  		}
 58451  	}
 58452  	_pX = (*XBtCursor)(_pX.XpNext)
 58453  	goto _34
 58454  _37:
 58455  	*(**XBtCursor)(unsafe.Pointer(&_pCur.XpNext)) = (*XBtCursor)(_pBt.XpCursor)
 58456  	*(**XBtCursor)(unsafe.Pointer(&_pBt.XpCursor)) = _pCur
 58457  	_pCur.XeState = 0
 58458  	return int32(0)
 58459  }
 58460  
 58461  var _btreeCursorØ00__func__Ø000 [12]int8
 58462  
 58463  func init() {
 58464  	crt.Xstrncpy(nil, &_btreeCursorØ00__func__Ø000[0], str(76568), 12)
 58465  }
 58466  
 58467  // C comment
 58468  //  /*
 58469  //  **** This function is only used as part of an assert() statement. ***
 58470  //  **
 58471  //  ** Check to see if pBtree holds the required locks to read or write to the
 58472  //  ** table with root page iRoot.   Return 1 if it does and 0 if not.
 58473  //  **
 58474  //  ** For example, when writing to a table with root-page iRoot via
 58475  //  ** Btree connection pBtree:
 58476  //  **
 58477  //  **    assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) );
 58478  //  **
 58479  //  ** When writing to an index that resides in a sharable database, the
 58480  //  ** caller should have first obtained a lock specifying the root page of
 58481  //  ** the corresponding table. This makes things a bit more complicated,
 58482  //  ** as this module treats each table as a separate structure. To determine
 58483  //  ** the table corresponding to the index being written, this
 58484  //  ** function has to search through the database schema.
 58485  //  **
 58486  //  ** Instead of a lock on the table/index rooted at page iRoot, the caller may
 58487  //  ** hold a write-lock on the schema table (root page 1). This is also
 58488  //  ** acceptable.
 58489  //  */
 58490  func _hasSharedCacheTableLock(tls *crt.TLS, _pBtree *XBtree, _iRoot uint32, _isIndex int32, _eLockType int32) (r0 int32) {
 58491  	var _iTab uint32
 58492  	var _pSchema *XSchema
 58493  	var _3_p *XHashElem
 58494  	var _pLock *XBtLock
 58495  	var _4_pIdx *XIndex
 58496  	_pSchema = (*XSchema)((*XBtShared)(_pBtree.XpBt).XpSchema)
 58497  	_iTab = uint32(0)
 58498  	if (int32(_pBtree.Xsharable) == int32(0)) || ((_eLockType == int32(1)) && (((*Xsqlite3)(_pBtree.Xdb).Xflags)&int32(16384)) != 0) {
 58499  		return int32(1)
 58500  	}
 58501  	if _isIndex != 0 && ((_pSchema == nil) || ((int32(_pSchema.XschemaFlags) & int32(1)) == int32(0))) {
 58502  		return int32(1)
 58503  	}
 58504  	if _isIndex == 0 {
 58505  		goto _6
 58506  	}
 58507  	_3_p = (*XHashElem)(_pSchema.XidxHash.Xfirst)
 58508  _7:
 58509  	if _3_p == nil {
 58510  		goto _10
 58511  	}
 58512  	_4_pIdx = (*XIndex)(_3_p.Xdata)
 58513  	if _4_pIdx.Xtnum != int32(_iRoot) {
 58514  		goto _11
 58515  	}
 58516  	if _iTab != 0 {
 58517  		return int32(1)
 58518  	}
 58519  	_iTab = uint32((*XTable)(_4_pIdx.XpTable).Xtnum)
 58520  _11:
 58521  	_3_p = (*XHashElem)(_3_p.Xnext)
 58522  	goto _7
 58523  _10:
 58524  	goto _13
 58525  _6:
 58526  	_iTab = _iRoot
 58527  _13:
 58528  	_pLock = (*XBtLock)((*XBtShared)(_pBtree.XpBt).XpLock)
 58529  _14:
 58530  	if _pLock == nil {
 58531  		goto _17
 58532  	}
 58533  	if (((*XBtree)(_pLock.XpBtree) == _pBtree) && ((_pLock.XiTable == _iTab) || ((int32(_pLock.XeLock) == int32(2)) && (_pLock.XiTable == uint32(1))))) && (int32(_pLock.XeLock) >= _eLockType) {
 58534  		return int32(1)
 58535  	}
 58536  	_pLock = (*XBtLock)(_pLock.XpNext)
 58537  	goto _14
 58538  _17:
 58539  	return int32(0)
 58540  }
 58541  
 58542  // C comment
 58543  //  /*
 58544  //  **** This function may be used as part of assert() statements only. ****
 58545  //  **
 58546  //  ** Return true if it would be illegal for pBtree to write into the
 58547  //  ** table or index rooted at iRoot because other shared connections are
 58548  //  ** simultaneously reading that same table or index.
 58549  //  **
 58550  //  ** It is illegal for pBtree to write if some other Btree object that
 58551  //  ** shares the same BtShared object is currently reading or writing
 58552  //  ** the iRoot table.  Except, if the other Btree object has the
 58553  //  ** read-uncommitted flag set, then it is OK for the other object to
 58554  //  ** have a read cursor.
 58555  //  **
 58556  //  ** For example, before writing to any part of the table or index
 58557  //  ** rooted at page iRoot, one should call:
 58558  //  **
 58559  //  **    assert( !hasReadConflicts(pBtree, iRoot) );
 58560  //  */
 58561  func _hasReadConflicts(tls *crt.TLS, _pBtree *XBtree, _iRoot uint32) (r0 int32) {
 58562  	var _p *XBtCursor
 58563  	_p = (*XBtCursor)((*XBtShared)(_pBtree.XpBt).XpCursor)
 58564  _0:
 58565  	if _p == nil {
 58566  		goto _3
 58567  	}
 58568  	if ((_p.XpgnoRoot == _iRoot) && ((*XBtree)(_p.XpBtree) != _pBtree)) && (int32(0) == (((*Xsqlite3)((*XBtree)(_p.XpBtree).Xdb).Xflags) & int32(16384))) {
 58569  		return int32(1)
 58570  	}
 58571  	_p = (*XBtCursor)(_p.XpNext)
 58572  	goto _0
 58573  _3:
 58574  	return int32(0)
 58575  }
 58576  
 58577  // C comment
 58578  //  /*
 58579  //  ** Make sure pBt->pTmpSpace points to an allocation of
 58580  //  ** MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child
 58581  //  ** pointer.
 58582  //  */
 58583  func _allocateTempSpace(tls *crt.TLS, _pBt *XBtShared) {
 58584  	if _pBt.XpTmpSpace != nil {
 58585  		goto _0
 58586  	}
 58587  	_pBt.XpTmpSpace = (*uint8)(_sqlite3PageMalloc(tls, int32(_pBt.XpageSize)))
 58588  	if _pBt.XpTmpSpace != nil {
 58589  		crt.Xmemset(tls, unsafe.Pointer(_pBt.XpTmpSpace), int32(0), uint64(8))
 58590  		*(*uintptr)(unsafe.Pointer(&_pBt.XpTmpSpace)) += uintptr(int32(4))
 58591  	}
 58592  _0:
 58593  }
 58594  
 58595  // C comment
 58596  //  /*
 58597  //  ** Provide flag hints to the cursor.
 58598  //  */
 58599  func _sqlite3BtreeCursorHintFlags(tls *crt.TLS, _pCur *XBtCursor, _x uint32) {
 58600  	func() {
 58601  		if _x != uint32(2) && _x != uint32(1) && _x != (0) {
 58602  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59919), unsafe.Pointer(&_sqlite3BtreeCursorHintFlagsØ00__func__Ø000), unsafe.Pointer(str(76580)))
 58603  			crt.X__builtin_abort(tls)
 58604  		}
 58605  	}()
 58606  	_pCur.Xhints = uint8(_x)
 58607  }
 58608  
 58609  var _sqlite3BtreeCursorHintFlagsØ00__func__Ø000 [28]int8
 58610  
 58611  func init() {
 58612  	crt.Xstrncpy(nil, &_sqlite3BtreeCursorHintFlagsØ00__func__Ø000[0], str(76626), 28)
 58613  }
 58614  
 58615  // C comment
 58616  //  /*
 58617  //  ** Open a database file.
 58618  //  **
 58619  //  ** zFilename is the name of the database file.  If zFilename is NULL
 58620  //  ** then an ephemeral database is created.  The ephemeral database might
 58621  //  ** be exclusively in memory, or it might use a disk-based memory cache.
 58622  //  ** Either way, the ephemeral database will be automatically deleted
 58623  //  ** when sqlite3BtreeClose() is called.
 58624  //  **
 58625  //  ** If zFilename is ":memory:" then an in-memory database is created
 58626  //  ** that is automatically destroyed when it is closed.
 58627  //  **
 58628  //  ** The "flags" parameter is a bitmask that might contain bits like
 58629  //  ** BTREE_OMIT_JOURNAL and/or BTREE_MEMORY.
 58630  //  **
 58631  //  ** If the database is already opened in the same database connection
 58632  //  ** and we are in shared cache mode, then the open will fail with an
 58633  //  ** SQLITE_CONSTRAINT error.  We cannot allow two or more BtShared
 58634  //  ** objects in the same database connection since doing so will lead
 58635  //  ** to problems with locking.
 58636  //  */
 58637  func _sqlite3BtreeOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFilename *int8, _db *Xsqlite3, _ppBtree **XBtree, _flags int32, _vfsFlags int32) (r0 int32) {
 58638  	var _rc, _isTempDb, _isMemdb, _5_nFilename, _5_nFullPathname, _11_iDb, _25_i int32
 58639  	var _5_zFullPathname *int8
 58640  	var _nReserve uint8
 58641  	var _mutexOpen, _5_mutexShared, _22_mutexShared *Xsqlite3_mutex
 58642  	var _p, _12_pExisting, _25_pSib *XBtree
 58643  	var _35_pFile *Xsqlite3_file
 58644  	var _zDbHeader [100]uint8
 58645  	var _pBt *XBtShared
 58646  	_pBt = nil
 58647  	_mutexOpen = nil
 58648  	_rc = int32(0)
 58649  	_isTempDb = bool2int((_zFilename == nil) || (int32(*elem1(_zFilename, 0)) == int32(0)))
 58650  	_isMemdb = bool2int((((_zFilename != nil) && (crt.Xstrcmp(tls, _zFilename, str(76654)) == int32(0))) || (_isTempDb != 0 && _sqlite3TempInMemory(tls, _db) != 0)) || ((_vfsFlags & int32(128)) != int32(0)))
 58651  	func() {
 58652  		if _db == nil {
 58653  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61256), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(1219)))
 58654  			crt.X__builtin_abort(tls)
 58655  		}
 58656  	}()
 58657  	func() {
 58658  		if _pVfs == nil {
 58659  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61257), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76663)))
 58660  			crt.X__builtin_abort(tls)
 58661  		}
 58662  	}()
 58663  	func() {
 58664  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 58665  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61258), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(881)))
 58666  			crt.X__builtin_abort(tls)
 58667  		}
 58668  	}()
 58669  	func() {
 58670  		if (_flags & int32(255)) != _flags {
 58671  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61259), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76671)))
 58672  			crt.X__builtin_abort(tls)
 58673  		}
 58674  	}()
 58675  	func() {
 58676  		if (_flags&int32(8)) != int32(0) && (_flags&int32(4)) == int32(0) {
 58677  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61262), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76691)))
 58678  			crt.X__builtin_abort(tls)
 58679  		}
 58680  	}()
 58681  	func() {
 58682  		if (_flags&int32(4)) != int32(0) && _isTempDb == 0 {
 58683  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61265), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76749)))
 58684  			crt.X__builtin_abort(tls)
 58685  		}
 58686  	}()
 58687  	if _isMemdb != 0 {
 58688  		_flags |= int32(2)
 58689  	}
 58690  	if ((_vfsFlags & int32(256)) != int32(0)) && (_isMemdb != 0 || _isTempDb != 0) {
 58691  		_vfsFlags = (_vfsFlags & int32(-257)) | int32(512)
 58692  	}
 58693  	_p = (*XBtree)(_sqlite3MallocZero(tls, uint64(72)))
 58694  	if _p == nil {
 58695  		return _sqlite3NomemError(tls, int32(61275))
 58696  	}
 58697  	_p.XinTrans = 0
 58698  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 58699  	*(**XBtree)(unsafe.Pointer(&(_p.Xlock.XpBtree))) = _p
 58700  	_p.Xlock.XiTable = uint32(1)
 58701  	if _isTempDb != int32(0) || _isMemdb != int32(0) && (_vfsFlags&int32(64)) == int32(0) {
 58702  		goto _26
 58703  	}
 58704  	if (_vfsFlags & int32(131072)) == 0 {
 58705  		goto _27
 58706  	}
 58707  	_5_nFilename = _sqlite3Strlen30(tls, _zFilename) + int32(1)
 58708  	_5_nFullPathname = _pVfs.XmxPathname + int32(1)
 58709  	_5_zFullPathname = (*int8)(_sqlite3Malloc(tls, uint64(func() int32 {
 58710  		if _5_nFullPathname > _5_nFilename {
 58711  			return _5_nFullPathname
 58712  		}
 58713  		return _5_nFilename
 58714  	}())))
 58715  	_p.Xsharable = uint8(1)
 58716  	if _5_zFullPathname == nil {
 58717  		Xsqlite3_free(tls, unsafe.Pointer(_p))
 58718  		return _sqlite3NomemError(tls, int32(61299))
 58719  	}
 58720  	if _isMemdb != 0 {
 58721  		crt.Xmemcpy(tls, unsafe.Pointer(_5_zFullPathname), unsafe.Pointer(_zFilename), uint64(_5_nFilename))
 58722  		goto _32
 58723  	}
 58724  	_rc = _sqlite3OsFullPathname(tls, _pVfs, _zFilename, _5_nFullPathname, _5_zFullPathname)
 58725  	if _rc != 0 {
 58726  		Xsqlite3_free(tls, unsafe.Pointer(_5_zFullPathname))
 58727  		Xsqlite3_free(tls, unsafe.Pointer(_p))
 58728  		return _rc
 58729  	}
 58730  _32:
 58731  	_mutexOpen = _sqlite3MutexAlloc(tls, int32(4))
 58732  	Xsqlite3_mutex_enter(tls, _mutexOpen)
 58733  	_5_mutexShared = _sqlite3MutexAlloc(tls, int32(2))
 58734  	Xsqlite3_mutex_enter(tls, _5_mutexShared)
 58735  	_pBt = _sqlite3SharedCacheList
 58736  _34:
 58737  	if _pBt == nil {
 58738  		goto _37
 58739  	}
 58740  	func() {
 58741  		if _pBt.XnRef <= int32(0) {
 58742  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61319), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76787)))
 58743  			crt.X__builtin_abort(tls)
 58744  		}
 58745  	}()
 58746  	if int32(0) != crt.Xstrcmp(tls, _5_zFullPathname, _sqlite3PagerFilename(tls, (*XPager)(_pBt.XpPager), int32(0))) || _sqlite3PagerVfs(tls, (*XPager)(_pBt.XpPager)) != _pVfs {
 58747  		goto _41
 58748  	}
 58749  	_11_iDb = _db.XnDb - int32(1)
 58750  _42:
 58751  	if _11_iDb < int32(0) {
 58752  		goto _45
 58753  	}
 58754  	_12_pExisting = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_11_iDb)).XpBt)
 58755  	if (_12_pExisting != nil) && ((*XBtShared)(_12_pExisting.XpBt) == _pBt) {
 58756  		Xsqlite3_mutex_leave(tls, _5_mutexShared)
 58757  		Xsqlite3_mutex_leave(tls, _mutexOpen)
 58758  		Xsqlite3_free(tls, unsafe.Pointer(_5_zFullPathname))
 58759  		Xsqlite3_free(tls, unsafe.Pointer(_p))
 58760  		return int32(19)
 58761  	}
 58762  	_11_iDb -= 1
 58763  	goto _42
 58764  _45:
 58765  	*(**XBtShared)(unsafe.Pointer(&_p.XpBt)) = _pBt
 58766  	_pBt.XnRef += 1
 58767  	goto _37
 58768  _41:
 58769  	_pBt = (*XBtShared)(_pBt.XpNext)
 58770  	goto _34
 58771  _37:
 58772  	Xsqlite3_mutex_leave(tls, _5_mutexShared)
 58773  	Xsqlite3_free(tls, unsafe.Pointer(_5_zFullPathname))
 58774  	goto _48
 58775  _27:
 58776  	_p.Xsharable = uint8(1)
 58777  _48:
 58778  _26:
 58779  	if _pBt != nil {
 58780  		goto _49
 58781  	}
 58782  
 58783  	_pBt = (*XBtShared)(_sqlite3MallocZero(tls, uint64(136)))
 58784  	if _pBt == nil {
 58785  		_rc = _sqlite3NomemError(tls, int32(61367))
 58786  		goto _btree_open_out
 58787  	}
 58788  	_rc = _sqlite3PagerOpen(tls, _pVfs, (**XPager)(unsafe.Pointer(&_pBt.XpPager)), _zFilename, int32(136), _flags, _vfsFlags, _pageReinit)
 58789  	if _rc == int32(0) {
 58790  		_sqlite3PagerSetMmapLimit(tls, (*XPager)(_pBt.XpPager), _db.XszMmap)
 58791  		_rc = _sqlite3PagerReadFileheader(tls, (*XPager)(_pBt.XpPager), int32(100), (*uint8)(unsafe.Pointer(&_zDbHeader)))
 58792  	}
 58793  	if _rc != int32(0) {
 58794  		goto _btree_open_out
 58795  	}
 58796  	_pBt.XopenFlags = uint8(_flags)
 58797  	*(**Xsqlite3)(unsafe.Pointer(&_pBt.Xdb)) = _db
 58798  	_sqlite3PagerSetBusyhandler(tls, (*XPager)(_pBt.XpPager), _btreeInvokeBusyHandler, unsafe.Pointer(_pBt))
 58799  	*(**XBtShared)(unsafe.Pointer(&_p.XpBt)) = _pBt
 58800  	*(**XBtCursor)(unsafe.Pointer(&_pBt.XpCursor)) = nil
 58801  	*(**XMemPage)(unsafe.Pointer(&_pBt.XpPage1)) = nil
 58802  	if _sqlite3PagerIsreadonly(tls, (*XPager)(_pBt.XpPager)) != 0 {
 58803  		{
 58804  			p := &_pBt.XbtsFlags
 58805  			*p = uint16(int32(*p) | int32(1))
 58806  		}
 58807  	}
 58808  	_pBt.XpageSize = uint32((int32(*elem15((*uint8)(unsafe.Pointer(&_zDbHeader)), uintptr(16))) << 8) | (int32(*elem15((*uint8)(unsafe.Pointer(&_zDbHeader)), uintptr(17))) << 16))
 58809  	if _pBt.XpageSize >= uint32(512) && _pBt.XpageSize <= uint32(65536) && ((_pBt.XpageSize-uint32(1))&_pBt.XpageSize) == (0) {
 58810  		goto _56
 58811  	}
 58812  	_pBt.XpageSize = 0
 58813  	if (_zFilename != nil) && (_isMemdb == 0) {
 58814  		_pBt.XautoVacuum = 0
 58815  		_pBt.XincrVacuum = 0
 58816  	}
 58817  	_nReserve = 0
 58818  	goto _59
 58819  _56:
 58820  	_nReserve = *elem15((*uint8)(unsafe.Pointer(&_zDbHeader)), uintptr(20))
 58821  	{
 58822  		p := &_pBt.XbtsFlags
 58823  		*p = uint16(int32(*p) | int32(2))
 58824  	}
 58825  	_pBt.XautoVacuum = uint8(func() int32 {
 58826  		if _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_zDbHeader)), uintptr(52))) != 0 {
 58827  			return int32(1)
 58828  		}
 58829  		return int32(0)
 58830  	}())
 58831  	_pBt.XincrVacuum = uint8(func() int32 {
 58832  		if _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_zDbHeader)), uintptr(64))) != 0 {
 58833  			return int32(1)
 58834  		}
 58835  		return int32(0)
 58836  	}())
 58837  _59:
 58838  	_rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.XpPager), &_pBt.XpageSize, int32(_nReserve))
 58839  	if _rc != 0 {
 58840  		goto _btree_open_out
 58841  	}
 58842  	_pBt.XusableSize = _pBt.XpageSize - uint32(_nReserve)
 58843  	func() {
 58844  		if (_pBt.XpageSize & uint32(7)) != (0) {
 58845  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61424), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76799)))
 58846  			crt.X__builtin_abort(tls)
 58847  		}
 58848  	}()
 58849  	_pBt.XnRef = int32(1)
 58850  	if _p.Xsharable == 0 {
 58851  		goto _67
 58852  	}
 58853  	_22_mutexShared = _sqlite3MutexAlloc(tls, int32(2))
 58854  	if int32(1) == 0 || _sqlite3Config.XbCoreMutex == 0 {
 58855  		goto _69
 58856  	}
 58857  	*(**Xsqlite3_mutex)(unsafe.Pointer(&_pBt.Xmutex)) = _sqlite3MutexAlloc(tls, int32(0))
 58858  	if (*Xsqlite3_mutex)(_pBt.Xmutex) == nil {
 58859  		_rc = _sqlite3NomemError(tls, int32(61436))
 58860  		goto _btree_open_out
 58861  	}
 58862  _69:
 58863  	Xsqlite3_mutex_enter(tls, _22_mutexShared)
 58864  	*(**XBtShared)(unsafe.Pointer(&_pBt.XpNext)) = _sqlite3SharedCacheList
 58865  	_sqlite3SharedCacheList = _pBt
 58866  	bug20530(_sqlite3SharedCacheList)
 58867  	Xsqlite3_mutex_leave(tls, _22_mutexShared)
 58868  _67:
 58869  _49:
 58870  	if _p.Xsharable == 0 {
 58871  		goto _71
 58872  	}
 58873  	_25_i = int32(0)
 58874  _72:
 58875  	if _25_i >= _db.XnDb {
 58876  		goto _75
 58877  	}
 58878  	if store88(&_25_pSib, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_25_i)).XpBt)) == nil || _25_pSib.Xsharable == 0 {
 58879  		goto _77
 58880  	}
 58881  _78:
 58882  	if _25_pSib.XpPrev != nil {
 58883  		_25_pSib = (*XBtree)(_25_pSib.XpPrev)
 58884  		goto _78
 58885  	}
 58886  	if uint64(crt.P2U(_p.XpBt)) < uint64(crt.P2U(_25_pSib.XpBt)) {
 58887  		*(**XBtree)(unsafe.Pointer(&_p.XpNext)) = _25_pSib
 58888  		*(**XBtree)(unsafe.Pointer(&_p.XpPrev)) = nil
 58889  		*(**XBtree)(unsafe.Pointer(&_25_pSib.XpPrev)) = _p
 58890  		goto _81
 58891  	}
 58892  _82:
 58893  	if (_25_pSib.XpNext != nil) && (uint64(crt.P2U((*XBtree)(_25_pSib.XpNext).XpBt)) < uint64(crt.P2U(_p.XpBt))) {
 58894  		_25_pSib = (*XBtree)(_25_pSib.XpNext)
 58895  		goto _82
 58896  	}
 58897  	*(**XBtree)(unsafe.Pointer(&_p.XpNext)) = (*XBtree)(_25_pSib.XpNext)
 58898  	*(**XBtree)(unsafe.Pointer(&_p.XpPrev)) = _25_pSib
 58899  	if _p.XpNext != nil {
 58900  		*(**XBtree)(unsafe.Pointer(&((*XBtree)(_p.XpNext).XpPrev))) = _p
 58901  	}
 58902  	*(**XBtree)(unsafe.Pointer(&_25_pSib.XpNext)) = _p
 58903  _81:
 58904  	goto _75
 58905  _77:
 58906  	_25_i += 1
 58907  	goto _72
 58908  _75:
 58909  _71:
 58910  	*_ppBtree = _p
 58911  _btree_open_out:
 58912  	if _rc == int32(0) {
 58913  		goto _86
 58914  	}
 58915  	if (_pBt != nil) && (_pBt.XpPager != nil) {
 58916  		_sqlite3PagerClose(tls, (*XPager)(_pBt.XpPager), nil)
 58917  	}
 58918  	Xsqlite3_free(tls, unsafe.Pointer(_pBt))
 58919  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 58920  	*_ppBtree = nil
 58921  	goto _89
 58922  _86:
 58923  	if _sqlite3BtreeSchema(tls, _p, int32(0), nil) == nil {
 58924  		_sqlite3PagerSetCachesize(tls, (*XPager)((*XBtShared)(_p.XpBt).XpPager), int32(-2000))
 58925  	}
 58926  	_35_pFile = _sqlite3PagerFile(tls, (*XPager)(_pBt.XpPager))
 58927  	if _35_pFile.XpMethods != nil {
 58928  		_sqlite3OsFileControlHint(tls, _35_pFile, int32(30), unsafe.Pointer(&_pBt.Xdb))
 58929  	}
 58930  _89:
 58931  	if _mutexOpen != nil {
 58932  		func() {
 58933  			if Xsqlite3_mutex_held(tls, _mutexOpen) == 0 {
 58934  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61506), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76822)))
 58935  				crt.X__builtin_abort(tls)
 58936  			}
 58937  		}()
 58938  		Xsqlite3_mutex_leave(tls, _mutexOpen)
 58939  	}
 58940  	func() {
 58941  		if _rc == int32(0) && _sqlite3BtreeConnectionCount(tls, *_ppBtree) <= int32(0) {
 58942  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61509), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76852)))
 58943  			crt.X__builtin_abort(tls)
 58944  		}
 58945  	}()
 58946  	return _rc
 58947  
 58948  	_ = _zDbHeader
 58949  	panic(0)
 58950  }
 58951  
 58952  var _sqlite3BtreeOpenØ00__func__Ø000 [17]int8
 58953  
 58954  func init() {
 58955  	crt.Xstrncpy(nil, &_sqlite3BtreeOpenØ00__func__Ø000[0], str(76909), 17)
 58956  }
 58957  
 58958  func _sqlite3OsFullPathname(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _nPathOut int32, _zPathOut *int8) (r0 int32) {
 58959  	*elem1(_zPathOut, 0) = 0
 58960  	return func() func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32 {
 58961  		v := _pVfs.XxFullPathname
 58962  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32)(unsafe.Pointer(&v))
 58963  	}()(tls, _pVfs, _zPath, _nPathOut, _zPathOut)
 58964  }
 58965  
 58966  // C comment
 58967  //  /*
 58968  //  ** Return the VFS structure for the pager.
 58969  //  */
 58970  func _sqlite3PagerVfs(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_vfs) {
 58971  	return (*Xsqlite3_vfs)(_pPager.XpVfs)
 58972  }
 58973  
 58974  // C comment
 58975  //  /*
 58976  //  ** Allocate and initialize a new Pager object and put a pointer to it
 58977  //  ** in *ppPager. The pager should eventually be freed by passing it
 58978  //  ** to sqlite3PagerClose().
 58979  //  **
 58980  //  ** The zFilename argument is the path to the database file to open.
 58981  //  ** If zFilename is NULL then a randomly-named temporary file is created
 58982  //  ** and used as the file to be cached. Temporary files are be deleted
 58983  //  ** automatically when they are closed. If zFilename is ":memory:" then
 58984  //  ** all information is held in cache. It is never written to disk.
 58985  //  ** This can be used to implement an in-memory database.
 58986  //  **
 58987  //  ** The nExtra parameter specifies the number of bytes of space allocated
 58988  //  ** along with each page reference. This space is available to the user
 58989  //  ** via the sqlite3PagerGetExtra() API.  When a new page is allocated, the
 58990  //  ** first 8 bytes of this space are zeroed but the remainder is uninitialized.
 58991  //  ** (The extra space is used by btree as the MemPage object.)
 58992  //  **
 58993  //  ** The flags argument is used to specify properties that affect the
 58994  //  ** operation of the pager. It should be passed some bitwise combination
 58995  //  ** of the PAGER_* flags.
 58996  //  **
 58997  //  ** The vfsFlags parameter is a bitmask to pass to the flags parameter
 58998  //  ** of the xOpen() method of the supplied VFS when opening files.
 58999  //  **
 59000  //  ** If the pager object is allocated and the specified file opened
 59001  //  ** successfully, SQLITE_OK is returned and *ppPager set to point to
 59002  //  ** the new pager object. If an error occurs, *ppPager is set to NULL
 59003  //  ** and error code returned. This function may return SQLITE_NOMEM
 59004  //  ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or
 59005  //  ** various SQLITE_IO_XXX errors.
 59006  //  */
 59007  func _sqlite3PagerOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _ppPager **XPager, _zFilename *int8, _nExtra int32, _flags int32, _vfsFlags int32, _xReinit func(*crt.TLS, *XPgHdr)) (r0 int32) {
 59008  	var _rc, _tempFile, _memDb, _readOnly, _journalFileSize, _nPathname, _useJournal, _pcacheSize, _nUri, _10_fout, _11_iDc int32
 59009  	var _szPageDflt uint32
 59010  	var _zPathname, _zUri, _3_z *int8
 59011  	var _pPtr *uint8
 59012  	var _pPager *XPager
 59013  	_pPager = nil
 59014  	_rc = int32(0)
 59015  	_tempFile = int32(0)
 59016  	_memDb = int32(0)
 59017  	_readOnly = int32(0)
 59018  	_zPathname = nil
 59019  	_nPathname = int32(0)
 59020  	_useJournal = bool2int((_flags & int32(1)) == int32(0))
 59021  	_pcacheSize = _sqlite3PcacheSize(tls)
 59022  	_szPageDflt = uint32(4096)
 59023  	_zUri = nil
 59024  	_nUri = int32(0)
 59025  	_journalFileSize = (_sqlite3JournalSize(tls, _pVfs) + int32(7)) & int32(-8)
 59026  	*_ppPager = nil
 59027  	if (_flags & int32(2)) == 0 {
 59028  		goto _0
 59029  	}
 59030  	_memDb = int32(1)
 59031  	if _zFilename == nil || (*elem1(_zFilename, 0)) == 0 {
 59032  		goto _2
 59033  	}
 59034  	_zPathname = _sqlite3DbStrDup(tls, nil, _zFilename)
 59035  	if _zPathname == nil {
 59036  		return _sqlite3NomemError(tls, int32(51601))
 59037  	}
 59038  	_nPathname = _sqlite3Strlen30(tls, _zPathname)
 59039  	_zFilename = nil
 59040  _2:
 59041  _0:
 59042  	if _zFilename == nil || (*elem1(_zFilename, 0)) == 0 {
 59043  		goto _5
 59044  	}
 59045  	_nPathname = _pVfs.XmxPathname + int32(1)
 59046  	_zPathname = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(_nPathname*int32(2))))
 59047  	if _zPathname == nil {
 59048  		return _sqlite3NomemError(tls, int32(51617))
 59049  	}
 59050  	*elem1(_zPathname, 0) = 0
 59051  	_rc = _sqlite3OsFullPathname(tls, _pVfs, _zFilename, _nPathname, _zPathname)
 59052  	_nPathname = _sqlite3Strlen30(tls, _zPathname)
 59053  	_3_z = store1(&_zUri, elem1(_zFilename, uintptr(_sqlite3Strlen30(tls, _zFilename)+int32(1))))
 59054  _7:
 59055  	if (*_3_z) != 0 {
 59056  		*(*uintptr)(unsafe.Pointer(&_3_z)) += uintptr(_sqlite3Strlen30(tls, _3_z) + int32(1))
 59057  		*(*uintptr)(unsafe.Pointer(&_3_z)) += uintptr(_sqlite3Strlen30(tls, _3_z) + int32(1))
 59058  		goto _7
 59059  	}
 59060  	_nUri = int32(int64(uintptr(unsafe.Pointer(elem1(_3_z, uintptr(1)))) - uintptr(unsafe.Pointer(_zUri))))
 59061  	func() {
 59062  		if _nUri < int32(0) {
 59063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51628), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(76926)))
 59064  			crt.X__builtin_abort(tls)
 59065  		}
 59066  	}()
 59067  	if (_rc == int32(0)) && ((_nPathname + int32(8)) > _pVfs.XmxPathname) {
 59068  		_rc = _sqlite3CantopenError(tls, int32(51636))
 59069  	}
 59070  	if _rc != int32(0) {
 59071  		_sqlite3DbFree(tls, nil, unsafe.Pointer(_zPathname))
 59072  		return _rc
 59073  	}
 59074  _5:
 59075  	_pPtr = (*uint8)(_sqlite3MallocZero(tls, (((((((((((uint64(304)+uint64((_pcacheSize+int32(7))&int32(-8)))+uint64((_pVfs.XszOsFile+int32(7))&int32(-8)))+uint64(_journalFileSize*int32(2)))+uint64(_nPathname))+uint64(1))+uint64(_nUri))+uint64(_nPathname))+uint64(8))+uint64(2))+uint64(_nPathname))+uint64(4))+uint64(2)))
 59076  	func() {
 59077  		if (int64(uintptr(crt.U2P(uintptr(int64(_journalFileSize))))) & int64(7)) != (0) {
 59078  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51667), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(76934)))
 59079  			crt.X__builtin_abort(tls)
 59080  		}
 59081  	}()
 59082  	if _pPtr == nil {
 59083  		_sqlite3DbFree(tls, nil, unsafe.Pointer(_zPathname))
 59084  		return _sqlite3NomemError(tls, int32(51670))
 59085  	}
 59086  	_pPager = (*XPager)(unsafe.Pointer(_pPtr))
 59087  	*(**XPCache)(unsafe.Pointer(&_pPager.XpPCache)) = (*XPCache)(unsafe.Pointer(store15(func() (**uint8, *uint8) { p := &_pPtr; return p, elem15(*p, uintptr(304)) }())))
 59088  	*(**Xsqlite3_file)(unsafe.Pointer(&_pPager.Xfd)) = (*Xsqlite3_file)(unsafe.Pointer(store15(func() (**uint8, *uint8) {
 59089  		p := &_pPtr
 59090  		return p, elem15(*p, uintptr((_pcacheSize+int32(7))&int32(-8)))
 59091  	}())))
 59092  	*(**Xsqlite3_file)(unsafe.Pointer(&_pPager.Xsjfd)) = (*Xsqlite3_file)(unsafe.Pointer(store15(func() (**uint8, *uint8) {
 59093  		p := &_pPtr
 59094  		return p, elem15(*p, uintptr((_pVfs.XszOsFile+int32(7))&int32(-8)))
 59095  	}())))
 59096  	*(**Xsqlite3_file)(unsafe.Pointer(&_pPager.Xjfd)) = (*Xsqlite3_file)(unsafe.Pointer(store15(func() (**uint8, *uint8) { p := &_pPtr; return p, elem15(*p, uintptr(_journalFileSize)) }())))
 59097  	_pPager.XzFilename = (*int8)(unsafe.Pointer(store15(func() (**uint8, *uint8) { p := &_pPtr; return p, elem15(*p, uintptr(_journalFileSize)) }())))
 59098  	func() {
 59099  		if (int64(uintptr(_pPager.Xjfd)) & int64(7)) != (0) {
 59100  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51678), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(76991)))
 59101  			crt.X__builtin_abort(tls)
 59102  		}
 59103  	}()
 59104  	if _zPathname == nil {
 59105  		goto _19
 59106  	}
 59107  	func() {
 59108  		if _nPathname <= int32(0) {
 59109  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51682), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77025)))
 59110  			crt.X__builtin_abort(tls)
 59111  		}
 59112  	}()
 59113  	_pPager.XzJournal = (*int8)(unsafe.Pointer(store15(func() (**uint8, *uint8) { p := &_pPtr; return p, elem15(*p, uintptr((_nPathname+int32(1))+_nUri)) }())))
 59114  	crt.Xmemcpy(tls, unsafe.Pointer(_pPager.XzFilename), unsafe.Pointer(_zPathname), uint64(_nPathname))
 59115  	if _nUri != 0 {
 59116  		crt.Xmemcpy(tls, unsafe.Pointer(elem1(_pPager.XzFilename, uintptr(_nPathname+int32(1)))), unsafe.Pointer(_zUri), uint64(_nUri))
 59117  	}
 59118  	crt.Xmemcpy(tls, unsafe.Pointer(_pPager.XzJournal), unsafe.Pointer(_zPathname), uint64(_nPathname))
 59119  	crt.Xmemcpy(tls, unsafe.Pointer(elem1(_pPager.XzJournal, uintptr(_nPathname))), unsafe.Pointer(str(77037)), uint64(10))
 59120  	_pPager.XzWal = elem1(_pPager.XzJournal, uintptr((_nPathname+int32(8))+int32(1)))
 59121  	crt.Xmemcpy(tls, unsafe.Pointer(_pPager.XzWal), unsafe.Pointer(_zPathname), uint64(_nPathname))
 59122  	crt.Xmemcpy(tls, unsafe.Pointer(elem1(_pPager.XzWal, uintptr(_nPathname))), unsafe.Pointer(str(77047)), uint64(5))
 59123  	_sqlite3DbFree(tls, nil, unsafe.Pointer(_zPathname))
 59124  _19:
 59125  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_pPager.XpVfs)) = _pVfs
 59126  	_pPager.XvfsFlags = uint32(_vfsFlags)
 59127  	if _zFilename == nil || (*elem1(_zFilename, 0)) == 0 {
 59128  		goto _24
 59129  	}
 59130  	_10_fout = int32(0)
 59131  	_rc = _sqlite3OsOpen(tls, _pVfs, _pPager.XzFilename, (*Xsqlite3_file)(_pPager.Xfd), _vfsFlags, &_10_fout)
 59132  	func() {
 59133  		if _memDb != 0 {
 59134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51705), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77053)))
 59135  			crt.X__builtin_abort(tls)
 59136  		}
 59137  	}()
 59138  	_readOnly = _10_fout & int32(1)
 59139  	if _rc != int32(0) {
 59140  		goto _27
 59141  	}
 59142  	_11_iDc = _sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xfd))
 59143  	if _readOnly != 0 {
 59144  		goto _28
 59145  	}
 59146  	_setSectorSize(tls, _pPager)
 59147  
 59148  	if _szPageDflt >= _pPager.XsectorSize {
 59149  		goto _29
 59150  	}
 59151  	if _pPager.XsectorSize > uint32(8192) {
 59152  		_szPageDflt = uint32(8192)
 59153  		goto _31
 59154  	}
 59155  	_szPageDflt = _pPager.XsectorSize
 59156  _31:
 59157  _29:
 59158  _28:
 59159  	_pPager.XnoLock = uint8(Xsqlite3_uri_boolean(tls, _zFilename, str(77060), int32(0)))
 59160  	if ((_11_iDc & int32(8192)) != int32(0)) || Xsqlite3_uri_boolean(tls, _zFilename, str(77067), int32(0)) != 0 {
 59161  		_vfsFlags |= int32(1)
 59162  		goto _act_like_temp_file
 59163  	}
 59164  _27:
 59165  	goto _34
 59166  _24:
 59167  _act_like_temp_file:
 59168  	_tempFile = int32(1)
 59169  	_pPager.XeState = uint8(1)
 59170  	_pPager.XeLock = uint8(4)
 59171  	_pPager.XnoLock = uint8(1)
 59172  	_readOnly = _vfsFlags & int32(1)
 59173  _34:
 59174  	if _rc == int32(0) {
 59175  		func() {
 59176  			if int32(_pPager.XmemDb) != int32(0) {
 59177  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51772), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77077)))
 59178  				crt.X__builtin_abort(tls)
 59179  			}
 59180  		}()
 59181  		_rc = _sqlite3PagerSetPagesize(tls, _pPager, &_szPageDflt, int32(-1))
 59182  	}
 59183  	if _rc == int32(0) {
 59184  		_nExtra = (_nExtra + int32(7)) & int32(-8)
 59185  		func() {
 59186  			if _nExtra < int32(8) || _nExtra >= int32(1000) {
 59187  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51780), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77094)))
 59188  				crt.X__builtin_abort(tls)
 59189  			}
 59190  		}()
 59191  		_rc = _sqlite3PcacheOpen(tls, int32(_szPageDflt), _nExtra, bool2int(_memDb == 0), func() func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32 {
 59192  			if _memDb == 0 {
 59193  				return _pagerStress
 59194  			}
 59195  			return nil
 59196  		}(), unsafe.Pointer(_pPager), (*XPCache)(_pPager.XpPCache))
 59197  	}
 59198  	if _rc != int32(0) {
 59199  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xfd))
 59200  		_sqlite3PageFree(tls, unsafe.Pointer(_pPager.XpTmpSpace))
 59201  		Xsqlite3_free(tls, unsafe.Pointer(_pPager))
 59202  		return _rc
 59203  	}
 59204  	_pPager.XuseJournal = uint8(_useJournal)
 59205  	_pPager.XmxPgno = uint32(1073741823)
 59206  	_pPager.XtempFile = uint8(_tempFile)
 59207  	func() {
 59208  		if _tempFile != int32(0) && _tempFile != int32(1) {
 59209  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51808), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77119)))
 59210  			crt.X__builtin_abort(tls)
 59211  		}
 59212  	}()
 59213  
 59214  	_pPager.XexclusiveMode = uint8(_tempFile)
 59215  	_pPager.XchangeCountDone = _pPager.XtempFile
 59216  	_pPager.XmemDb = uint8(_memDb)
 59217  	_pPager.XreadOnly = uint8(_readOnly)
 59218  	func() {
 59219  		if _useJournal == 0 && _pPager.XtempFile == 0 {
 59220  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51815), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77195)))
 59221  			crt.X__builtin_abort(tls)
 59222  		}
 59223  	}()
 59224  	_pPager.XnoSync = _pPager.XtempFile
 59225  	if _pPager.XnoSync != 0 {
 59226  		func() {
 59227  			if int32(_pPager.XfullSync) != int32(0) {
 59228  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51818), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77226)))
 59229  				crt.X__builtin_abort(tls)
 59230  			}
 59231  		}()
 59232  		func() {
 59233  			if int32(_pPager.XextraSync) != int32(0) {
 59234  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51819), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77246)))
 59235  				crt.X__builtin_abort(tls)
 59236  			}
 59237  		}()
 59238  		func() {
 59239  			if int32(_pPager.XsyncFlags) != int32(0) {
 59240  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51820), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77267)))
 59241  				crt.X__builtin_abort(tls)
 59242  			}
 59243  		}()
 59244  		func() {
 59245  			if int32(_pPager.XwalSyncFlags) != int32(0) {
 59246  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51821), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77288)))
 59247  				crt.X__builtin_abort(tls)
 59248  			}
 59249  		}()
 59250  		func() {
 59251  			if int32(_pPager.XckptSyncFlags) != int32(0) {
 59252  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51822), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77312)))
 59253  				crt.X__builtin_abort(tls)
 59254  			}
 59255  		}()
 59256  		goto _62
 59257  	}
 59258  	_pPager.XfullSync = uint8(1)
 59259  	_pPager.XextraSync = 0
 59260  	_pPager.XsyncFlags = uint8(2)
 59261  	_pPager.XwalSyncFlags = uint8(34)
 59262  	_pPager.XckptSyncFlags = uint8(2)
 59263  _62:
 59264  	_pPager.XnExtra = uint16(_nExtra)
 59265  	_pPager.XjournalSizeLimit = int64(-1)
 59266  	func() {
 59267  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _tempFile == 0 {
 59268  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51835), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77337)))
 59269  			crt.X__builtin_abort(tls)
 59270  		}
 59271  	}()
 59272  	_setSectorSize(tls, _pPager)
 59273  	if _useJournal == 0 {
 59274  		_pPager.XjournalMode = uint8(2)
 59275  		goto _68
 59276  	}
 59277  	if _memDb != 0 {
 59278  		_pPager.XjournalMode = uint8(4)
 59279  	}
 59280  _68:
 59281  	*(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&_pPager.XxReiniter)) = _xReinit
 59282  	_setGetterMethod(tls, _pPager)
 59283  	*_ppPager = _pPager
 59284  	return int32(0)
 59285  }
 59286  
 59287  // C comment
 59288  //  /*
 59289  //  ** Return the size in bytes of a PCache object.
 59290  //  */
 59291  func _sqlite3PcacheSize(tls *crt.TLS) (r0 int32) {
 59292  	return int32(72)
 59293  }
 59294  
 59295  // C comment
 59296  //  /*
 59297  //  ** Return the number of bytes required to store a JournalFile that uses vfs
 59298  //  ** pVfs to create the underlying on-disk files.
 59299  //  */
 59300  func _sqlite3JournalSize(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) {
 59301  	return func() int32 {
 59302  		if _pVfs.XszOsFile > int32(88) {
 59303  			return _pVfs.XszOsFile
 59304  		}
 59305  		return int32(88)
 59306  	}()
 59307  }
 59308  
 59309  var _sqlite3PagerOpenØ00__func__Ø000 [17]int8
 59310  
 59311  func init() {
 59312  	crt.Xstrncpy(nil, &_sqlite3PagerOpenØ00__func__Ø000[0], str(77368), 17)
 59313  }
 59314  
 59315  // C comment
 59316  //  /*
 59317  //  ** Return a boolean value for a query parameter.
 59318  //  */
 59319  func Xsqlite3_uri_boolean(tls *crt.TLS, _zFilename *int8, _zParam *int8, _bDflt int32) (r0 int32) {
 59320  	var _z *int8
 59321  	_z = Xsqlite3_uri_parameter(tls, _zFilename, _zParam)
 59322  	_bDflt = bool2int(_bDflt != int32(0))
 59323  	return func() int32 {
 59324  		if _z != nil {
 59325  			return int32(_sqlite3GetBoolean(tls, _z, uint8(_bDflt)))
 59326  		}
 59327  		return _bDflt
 59328  	}()
 59329  }
 59330  
 59331  // C comment
 59332  //  /*
 59333  //  ** This is a utility routine, useful to VFS implementations, that checks
 59334  //  ** to see if a database file was a URI that contained a specific query
 59335  //  ** parameter, and if so obtains the value of the query parameter.
 59336  //  **
 59337  //  ** The zFilename argument is the filename pointer passed into the xOpen()
 59338  //  ** method of a VFS implementation.  The zParam argument is the name of the
 59339  //  ** query parameter we seek.  This routine returns the value of the zParam
 59340  //  ** parameter if it exists.  If the parameter does not exist, this routine
 59341  //  ** returns a NULL pointer.
 59342  //  */
 59343  func Xsqlite3_uri_parameter(tls *crt.TLS, _zFilename *int8, _zParam *int8) (r0 *int8) {
 59344  	var _1_x int32
 59345  	if (_zFilename == nil) || (_zParam == nil) {
 59346  		return nil
 59347  	}
 59348  	*(*uintptr)(unsafe.Pointer(&_zFilename)) += uintptr(_sqlite3Strlen30(tls, _zFilename) + int32(1))
 59349  _2:
 59350  	if (*elem1(_zFilename, 0)) == 0 {
 59351  		goto _3
 59352  	}
 59353  	_1_x = crt.Xstrcmp(tls, _zFilename, _zParam)
 59354  	*(*uintptr)(unsafe.Pointer(&_zFilename)) += uintptr(_sqlite3Strlen30(tls, _zFilename) + int32(1))
 59355  	if _1_x == int32(0) {
 59356  		return _zFilename
 59357  	}
 59358  	*(*uintptr)(unsafe.Pointer(&_zFilename)) += uintptr(_sqlite3Strlen30(tls, _zFilename) + int32(1))
 59359  	goto _2
 59360  _3:
 59361  	return nil
 59362  }
 59363  
 59364  // C comment
 59365  //  /*
 59366  //  ** Interpret the given string as a boolean value.
 59367  //  */
 59368  func _sqlite3GetBoolean(tls *crt.TLS, _z *int8, _dflt uint8) (r0 uint8) {
 59369  	return uint8(bool2int(int32(_getSafetyLevel(tls, _z, int32(1), _dflt)) != int32(0)))
 59370  }
 59371  
 59372  // C comment
 59373  //  /*
 59374  //  ** Interpret the given string as a safety level.  Return 0 for OFF,
 59375  //  ** 1 for ON or NORMAL, 2 for FULL, and 3 for EXTRA.  Return 1 for an empty or
 59376  //  ** unrecognized string argument.  The FULL and EXTRA option is disallowed
 59377  //  ** if the omitFull parameter it 1.
 59378  //  **
 59379  //  ** Note that the values returned are one less that the values that
 59380  //  ** should be passed into sqlite3BtreeSetSafetyLevel().  The is done
 59381  //  ** to support legacy SQL code.  The safety level used to be boolean
 59382  //  ** and older scripts may have used numbers 0 for OFF and 1 for ON.
 59383  //  */
 59384  func _getSafetyLevel(tls *crt.TLS, _z *int8, _omitFull int32, _dflt uint8) (r0 uint8) {
 59385  	var _i, _n int32
 59386  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z)))) & int32(4)) != 0 {
 59387  		return uint8(_sqlite3Atoi(tls, _z))
 59388  	}
 59389  	_n = _sqlite3Strlen30(tls, _z)
 59390  	_i = int32(0)
 59391  _1:
 59392  	if _i >= int32(8) {
 59393  		goto _4
 59394  	}
 59395  	if ((int32(*elem15((*uint8)(unsafe.Pointer(&_getSafetyLevelØ00iLengthØ003)), uintptr(_i))) == _n) && (Xsqlite3_strnicmp(tls, elem1((*int8)(unsafe.Pointer(&_getSafetyLevelØ00zTextØ001)), uintptr(*elem15((*uint8)(unsafe.Pointer(&_getSafetyLevelØ00iOffsetØ002)), uintptr(_i)))), _z, _n) == int32(0))) && ((_omitFull == 0) || (int32(*elem15((*uint8)(unsafe.Pointer(&_getSafetyLevelØ00iValueØ004)), uintptr(_i))) <= int32(1))) {
 59396  		return *elem15((*uint8)(unsafe.Pointer(&_getSafetyLevelØ00iValueØ004)), uintptr(_i))
 59397  	}
 59398  	_i += 1
 59399  	goto _1
 59400  _4:
 59401  	return _dflt
 59402  }
 59403  
 59404  var _getSafetyLevelØ00iLengthØ003 [8]uint8
 59405  
 59406  func init() {
 59407  	_getSafetyLevelØ00iLengthØ003 = [8]uint8{2, 2, 3, 5, 3, 4, 5, 4}
 59408  }
 59409  
 59410  var _getSafetyLevelØ00zTextØ001 [25]int8
 59411  
 59412  func init() {
 59413  	crt.Xstrncpy(nil, &_getSafetyLevelØ00zTextØ001[0], str(77385), 25)
 59414  }
 59415  
 59416  var _getSafetyLevelØ00iOffsetØ002 [8]uint8
 59417  
 59418  func init() {
 59419  	_getSafetyLevelØ00iOffsetØ002 = [8]uint8{0, 1, 2, 4, 9, 12, 15, 20}
 59420  }
 59421  
 59422  var _getSafetyLevelØ00iValueØ004 [8]uint8
 59423  
 59424  func init() {
 59425  	_getSafetyLevelØ00iValueØ004 = [8]uint8{1, 0, 0, 0, 1, 1, 3, 2}
 59426  }
 59427  
 59428  // C comment
 59429  //  /*
 59430  //  ** Create a new PCache object. Storage space to hold the object
 59431  //  ** has already been allocated and is passed in as the p pointer.
 59432  //  ** The caller discovers how much space needs to be allocated by
 59433  //  ** calling sqlite3PcacheSize().
 59434  //  **
 59435  //  ** szExtra is some extra space allocated for each page.  The first
 59436  //  ** 8 bytes of the extra space will be zeroed as the page is allocated,
 59437  //  ** but remaining content will be uninitialized.  Though it is opaque
 59438  //  ** to this module, the extra space really ends up being the MemPage
 59439  //  ** structure in the pager.
 59440  //  */
 59441  func _sqlite3PcacheOpen(tls *crt.TLS, _szPage int32, _szExtra int32, _bPurgeable int32, _xStress func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32, _pStress unsafe.Pointer, _p *XPCache) (r0 int32) {
 59442  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(72))
 59443  	_p.XszPage = int32(1)
 59444  	_p.XszExtra = _szExtra
 59445  	func() {
 59446  		if _szExtra < int32(8) {
 59447  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44428), unsafe.Pointer(&_sqlite3PcacheOpenØ00__func__Ø000), unsafe.Pointer(str(77410)))
 59448  			crt.X__builtin_abort(tls)
 59449  		}
 59450  	}()
 59451  	_p.XbPurgeable = uint8(_bPurgeable)
 59452  	_p.XeCreate = uint8(2)
 59453  	*(*func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32)(unsafe.Pointer(&_p.XxStress)) = _xStress
 59454  	_p.XpStress = _pStress
 59455  	_p.XszCache = int32(100)
 59456  	_p.XszSpill = int32(1)
 59457  	return _sqlite3PcacheSetPageSize(tls, _p, _szPage)
 59458  }
 59459  
 59460  var _sqlite3PcacheOpenØ00__func__Ø000 [18]int8
 59461  
 59462  func init() {
 59463  	crt.Xstrncpy(nil, &_sqlite3PcacheOpenØ00__func__Ø000[0], str(77421), 18)
 59464  }
 59465  
 59466  // C comment
 59467  //  /*
 59468  //  ** This function is called by the pcache layer when it has reached some
 59469  //  ** soft memory limit. The first argument is a pointer to a Pager object
 59470  //  ** (cast as a void*). The pager is always 'purgeable' (not an in-memory
 59471  //  ** database). The second argument is a reference to a page that is
 59472  //  ** currently dirty but has no outstanding references. The page
 59473  //  ** is always associated with the Pager object passed as the first
 59474  //  ** argument.
 59475  //  **
 59476  //  ** The job of this function is to make pPg clean by writing its contents
 59477  //  ** out to the database file, if possible. This may involve syncing the
 59478  //  ** journal file.
 59479  //  **
 59480  //  ** If successful, sqlite3PcacheMakeClean() is called on the page and
 59481  //  ** SQLITE_OK returned. If an IO error occurs while trying to make the
 59482  //  ** page clean, the IO error code is returned. If the page cannot be
 59483  //  ** made clean for some other reason, but no error occurs, then SQLITE_OK
 59484  //  ** is returned by sqlite3PcacheMakeClean() is not called.
 59485  //  */
 59486  func _pagerStress(tls *crt.TLS, _p unsafe.Pointer, _pPg *XPgHdr) (r0 int32) {
 59487  	var _rc int32
 59488  	var _pPager *XPager
 59489  	_pPager = (*XPager)(_p)
 59490  	_rc = int32(0)
 59491  	func() {
 59492  		if (*XPager)(_pPg.XpPager) != _pPager {
 59493  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51451), unsafe.Pointer(&_pagerStressØ00__func__Ø000), unsafe.Pointer(str(18447)))
 59494  			crt.X__builtin_abort(tls)
 59495  		}
 59496  	}()
 59497  	func() {
 59498  		if (int32(_pPg.Xflags) & int32(2)) == 0 {
 59499  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51452), unsafe.Pointer(&_pagerStressØ00__func__Ø000), unsafe.Pointer(str(54011)))
 59500  			crt.X__builtin_abort(tls)
 59501  		}
 59502  	}()
 59503  	if func() int32 {
 59504  		if _pPager.XerrCode != 0 {
 59505  			return func() int32 {
 59506  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51470), unsafe.Pointer(&_pagerStressØ00__func__Ø000), unsafe.Pointer(str(4809)))
 59507  				crt.X__builtin_abort(tls)
 59508  				return int32(1)
 59509  			}()
 59510  		}
 59511  		return int32(0)
 59512  	}() != 0 {
 59513  		return int32(0)
 59514  	}
 59515  	if (_pPager.XdoNotSpill != 0) && (((int32(_pPager.XdoNotSpill) & int32(3)) != int32(0)) || ((int32(_pPg.Xflags) & int32(8)) != int32(0))) {
 59516  		return int32(0)
 59517  	}
 59518  	*(**XPgHdr)(unsafe.Pointer(&_pPg.XpDirty)) = nil
 59519  	if (*XWal)(_pPager.XpWal) == nil {
 59520  		goto _10
 59521  	}
 59522  	_rc = _subjournalPageIfRequired(tls, _pPg)
 59523  	if _rc == int32(0) {
 59524  		_rc = _pagerWalFrames(tls, _pPager, _pPg, 0, int32(0))
 59525  	}
 59526  	goto _12
 59527  _10:
 59528  	if (int32(_pPg.Xflags)&int32(8)) != 0 || (int32(_pPager.XeState) == int32(3)) {
 59529  		_rc = _syncJournal(tls, _pPager, int32(1))
 59530  	}
 59531  	if _rc == int32(0) {
 59532  		func() {
 59533  			if (int32(_pPg.Xflags) & int32(8)) != int32(0) {
 59534  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51499), unsafe.Pointer(&_pagerStressØ00__func__Ø000), unsafe.Pointer(str(77439)))
 59535  				crt.X__builtin_abort(tls)
 59536  			}
 59537  		}()
 59538  		_rc = _pager_write_pagelist(tls, _pPager, _pPg)
 59539  	}
 59540  _12:
 59541  	if _rc == int32(0) {
 59542  		_sqlite3PcacheMakeClean(tls, _pPg)
 59543  	}
 59544  	return _pager_error(tls, _pPager, _rc)
 59545  }
 59546  
 59547  var _pagerStressØ00__func__Ø000 [12]int8
 59548  
 59549  func init() {
 59550  	crt.Xstrncpy(nil, &_pagerStressØ00__func__Ø000[0], str(77471), 12)
 59551  }
 59552  
 59553  // C comment
 59554  //  /*
 59555  //  ** During a rollback, when the pager reloads information into the cache
 59556  //  ** so that the cache is restored to its original state at the start of
 59557  //  ** the transaction, for each page restored this routine is called.
 59558  //  **
 59559  //  ** This routine needs to reset the extra data section at the end of the
 59560  //  ** page to agree with the restored data.
 59561  //  */
 59562  func _pageReinit(tls *crt.TLS, _pData *XPgHdr) {
 59563  	var _pPage *XMemPage
 59564  	_pPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pData))
 59565  	func() {
 59566  		if _sqlite3PagerPageRefcount(tls, _pData) <= int32(0) {
 59567  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61180), unsafe.Pointer(&_pageReinitØ00__func__Ø000), unsafe.Pointer(str(77483)))
 59568  			crt.X__builtin_abort(tls)
 59569  		}
 59570  	}()
 59571  	if _pPage.XisInit == 0 {
 59572  		goto _2
 59573  	}
 59574  	func() {
 59575  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 59576  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61182), unsafe.Pointer(&_pageReinitØ00__func__Ø000), unsafe.Pointer(str(20394)))
 59577  			crt.X__builtin_abort(tls)
 59578  		}
 59579  	}()
 59580  	_pPage.XisInit = 0
 59581  	if _sqlite3PagerPageRefcount(tls, _pData) > int32(1) {
 59582  		_btreeInitPage(tls, _pPage)
 59583  	}
 59584  _2:
 59585  }
 59586  
 59587  var _pageReinitØ00__func__Ø000 [11]int8
 59588  
 59589  func init() {
 59590  	crt.Xstrncpy(nil, &_pageReinitØ00__func__Ø000[0], str(77517), 11)
 59591  }
 59592  
 59593  // C comment
 59594  //  /*
 59595  //  ** Change the maximum size of any memory mapping made of the database file.
 59596  //  */
 59597  func _sqlite3PagerSetMmapLimit(tls *crt.TLS, _pPager *XPager, _szMmap int64) {
 59598  	_pPager.XszMmap = _szMmap
 59599  	_pagerFixMaplimit(tls, _pPager)
 59600  }
 59601  
 59602  // C comment
 59603  //  /*
 59604  //  ** Read the first N bytes from the beginning of the file into memory
 59605  //  ** that pDest points to.
 59606  //  **
 59607  //  ** If the pager was opened on a transient file (zFilename==""), or
 59608  //  ** opened on a file less than N bytes in size, the output buffer is
 59609  //  ** zeroed and SQLITE_OK returned. The rationale for this is that this
 59610  //  ** function is used to read database headers, and a new transient or
 59611  //  ** zero sized database has a header than consists entirely of zeroes.
 59612  //  **
 59613  //  ** If any IO error apart from SQLITE_IOERR_SHORT_READ is encountered,
 59614  //  ** the error code is returned to the caller and the contents of the
 59615  //  ** output buffer undefined.
 59616  //  */
 59617  func _sqlite3PagerReadFileheader(tls *crt.TLS, _pPager *XPager, _N int32, _pDest *uint8) (r0 int32) {
 59618  	var _rc int32
 59619  	_rc = int32(0)
 59620  	crt.Xmemset(tls, unsafe.Pointer(_pDest), int32(0), uint64(_N))
 59621  	func() {
 59622  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _pPager.XtempFile == 0 {
 59623  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50765), unsafe.Pointer(&_sqlite3PagerReadFileheaderØ00__func__Ø000), unsafe.Pointer(str(19520)))
 59624  			crt.X__builtin_abort(tls)
 59625  		}
 59626  	}()
 59627  	func() {
 59628  		if (*XWal)(_pPager.XpWal) != nil {
 59629  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50771), unsafe.Pointer(&_sqlite3PagerReadFileheaderØ00__func__Ø000), unsafe.Pointer(str(12123)))
 59630  			crt.X__builtin_abort(tls)
 59631  		}
 59632  	}()
 59633  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 59634  		goto _5
 59635  	}
 59636  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xfd), unsafe.Pointer(_pDest), _N, 0)
 59637  	if _rc == int32(522) {
 59638  		_rc = int32(0)
 59639  	}
 59640  _5:
 59641  	return _rc
 59642  }
 59643  
 59644  var _sqlite3PagerReadFileheaderØ00__func__Ø000 [27]int8
 59645  
 59646  func init() {
 59647  	crt.Xstrncpy(nil, &_sqlite3PagerReadFileheaderØ00__func__Ø000[0], str(77528), 27)
 59648  }
 59649  
 59650  // C comment
 59651  //  /*
 59652  //  ** Set the busy handler function.
 59653  //  **
 59654  //  ** The pager invokes the busy-handler if sqlite3OsLock() returns
 59655  //  ** SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock,
 59656  //  ** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE
 59657  //  ** lock. It does *not* invoke the busy handler when upgrading from
 59658  //  ** SHARED to RESERVED, or when upgrading from SHARED to EXCLUSIVE
 59659  //  ** (which occurs during hot-journal rollback). Summary:
 59660  //  **
 59661  //  **   Transition                        | Invokes xBusyHandler
 59662  //  **   --------------------------------------------------------
 59663  //  **   NO_LOCK       -> SHARED_LOCK      | Yes
 59664  //  **   SHARED_LOCK   -> RESERVED_LOCK    | No
 59665  //  **   SHARED_LOCK   -> EXCLUSIVE_LOCK   | No
 59666  //  **   RESERVED_LOCK -> EXCLUSIVE_LOCK   | Yes
 59667  //  **
 59668  //  ** If the busy-handler callback returns non-zero, the lock is
 59669  //  ** retried. If it returns zero, then the SQLITE_BUSY error is
 59670  //  ** returned to the caller of the pager API function.
 59671  //  */
 59672  func _sqlite3PagerSetBusyhandler(tls *crt.TLS, _pPager *XPager, _xBusyHandler func(*crt.TLS, unsafe.Pointer) int32, _pBusyHandlerArg unsafe.Pointer) {
 59673  	var _1_ap *unsafe.Pointer
 59674  	_pPager.XxBusyHandler = _xBusyHandler
 59675  	_pPager.XpBusyHandlerArg = _pBusyHandlerArg
 59676  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil {
 59677  		_1_ap = (*unsafe.Pointer)(unsafe.Pointer(&_pPager.XxBusyHandler))
 59678  		func() {
 59679  			if *(*uintptr)(unsafe.Pointer(&struct {
 59680  				f func(*crt.TLS, unsafe.Pointer) int32
 59681  			}{func() func(*crt.TLS, unsafe.Pointer) int32 {
 59682  				v := *elem24(_1_ap, 0)
 59683  				return *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&v))
 59684  			}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 59685  				f func(*crt.TLS, unsafe.Pointer) int32
 59686  			}{_xBusyHandler})) {
 59687  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50605), unsafe.Pointer(&_sqlite3PagerSetBusyhandlerØ00__func__Ø000), unsafe.Pointer(str(77555)))
 59688  				crt.X__builtin_abort(tls)
 59689  			}
 59690  		}()
 59691  		func() {
 59692  			if (*elem24(_1_ap, uintptr(1))) != _pBusyHandlerArg {
 59693  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50606), unsafe.Pointer(&_sqlite3PagerSetBusyhandlerØ00__func__Ø000), unsafe.Pointer(str(77595)))
 59694  				crt.X__builtin_abort(tls)
 59695  			}
 59696  		}()
 59697  		_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(15), unsafe.Pointer(_1_ap))
 59698  	}
 59699  }
 59700  
 59701  var _sqlite3PagerSetBusyhandlerØ00__func__Ø000 [27]int8
 59702  
 59703  func init() {
 59704  	crt.Xstrncpy(nil, &_sqlite3PagerSetBusyhandlerØ00__func__Ø000[0], str(77618), 27)
 59705  }
 59706  
 59707  // C comment
 59708  //  /*
 59709  //  ** Return TRUE if the database file is opened read-only.  Return FALSE
 59710  //  ** if the database is (in theory) writable.
 59711  //  */
 59712  func _sqlite3PagerIsreadonly(tls *crt.TLS, _pPager *XPager) (r0 uint8) {
 59713  	return _pPager.XreadOnly
 59714  }
 59715  
 59716  // C comment
 59717  //  /*
 59718  //  ** This function returns a pointer to a blob of memory associated with
 59719  //  ** a single shared-btree. The memory is used by client code for its own
 59720  //  ** purposes (for example, to store a high-level schema associated with
 59721  //  ** the shared-btree). The btree layer manages reference counting issues.
 59722  //  **
 59723  //  ** The first time this is called on a shared-btree, nBytes bytes of memory
 59724  //  ** are allocated, zeroed, and returned to the caller. For each subsequent
 59725  //  ** call the nBytes parameter is ignored and a pointer to the same blob
 59726  //  ** of memory returned.
 59727  //  **
 59728  //  ** If the nBytes parameter is 0 and the blob of memory has not yet been
 59729  //  ** allocated, a null pointer is returned. If the blob has already been
 59730  //  ** allocated, it is returned as normal.
 59731  //  **
 59732  //  ** Just before the shared-btree is closed, the function passed as the
 59733  //  ** xFree argument when the memory allocation was made is invoked on the
 59734  //  ** blob of allocated memory. The xFree function should not call sqlite3_free()
 59735  //  ** on the memory, the btree layer does that.
 59736  //  */
 59737  func _sqlite3BtreeSchema(tls *crt.TLS, _p *XBtree, _nBytes int32, _xFree func(*crt.TLS, unsafe.Pointer)) (r0 unsafe.Pointer) {
 59738  	var _pBt *XBtShared
 59739  	_pBt = (*XBtShared)(_p.XpBt)
 59740  	_sqlite3BtreeEnter(tls, _p)
 59741  	if (_pBt.XpSchema == nil) && _nBytes != 0 {
 59742  		_pBt.XpSchema = _sqlite3DbMallocZero(tls, nil, uint64(_nBytes))
 59743  		_pBt.XxFreeSchema = _xFree
 59744  	}
 59745  	_sqlite3BtreeLeave(tls, _p)
 59746  	return _pBt.XpSchema
 59747  }
 59748  
 59749  // C comment
 59750  //  /*
 59751  //  ** Return the file handle for the database file associated
 59752  //  ** with the pager.  This might return NULL if the file has
 59753  //  ** not yet been opened.
 59754  //  */
 59755  func _sqlite3PagerFile(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_file) {
 59756  	return (*Xsqlite3_file)(_pPager.Xfd)
 59757  }
 59758  
 59759  // C comment
 59760  //  /*
 59761  //  ** Return the number of connections to the BtShared object accessed by
 59762  //  ** the Btree handle passed as the only argument. For private caches
 59763  //  ** this is always 1. For shared caches it may be 1 or greater.
 59764  //  */
 59765  func _sqlite3BtreeConnectionCount(tls *crt.TLS, _p *XBtree) (r0 int32) {
 59766  	return (*XBtShared)(_p.XpBt).XnRef
 59767  }
 59768  
 59769  var _sqlite3VdbeExecØ00vfsFlagsØ006 int32
 59770  
 59771  func init() {
 59772  	_sqlite3VdbeExecØ00vfsFlagsØ006 = int32(1054)
 59773  }
 59774  
 59775  func _sqlite3BtreeCreateTable(tls *crt.TLS, _p *XBtree, _piTable *int32, _flags int32) (r0 int32) {
 59776  	var _rc int32
 59777  	_sqlite3BtreeEnter(tls, _p)
 59778  	_rc = _btreeCreateTable(tls, _p, _piTable, _flags)
 59779  	_sqlite3BtreeLeave(tls, _p)
 59780  	return _rc
 59781  }
 59782  
 59783  // C comment
 59784  //  /*
 59785  //  ** Create a new BTree table.  Write into *piTable the page
 59786  //  ** number for the root page of the new table.
 59787  //  **
 59788  //  ** The type of type is determined by the flags parameter.  Only the
 59789  //  ** following values of flags are currently in use.  Other values for
 59790  //  ** flags might not work:
 59791  //  **
 59792  //  **     BTREE_INTKEY|BTREE_LEAFDATA     Used for SQL tables with rowid keys
 59793  //  **     BTREE_ZERODATA                  Used for SQL indices
 59794  //  */
 59795  func _btreeCreateTable(tls *crt.TLS, _p *XBtree, _piTable *int32, _createTabFlags int32) (r0 int32) {
 59796  	var _rc, _ptfFlags int32
 59797  	var _pgnoRoot, _1_pgnoMove, _4_iPtrPage uint32
 59798  	var _4_eType uint8
 59799  	var _pBt *XBtShared
 59800  	var _pRoot, _1_pPageMove *XMemPage
 59801  	_pBt = (*XBtShared)(_p.XpBt)
 59802  	func() {
 59803  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 59804  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67483), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(17442)))
 59805  			crt.X__builtin_abort(tls)
 59806  		}
 59807  	}()
 59808  	func() {
 59809  		if int32(_pBt.XinTransaction) != int32(2) {
 59810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67484), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(56904)))
 59811  			crt.X__builtin_abort(tls)
 59812  		}
 59813  	}()
 59814  	func() {
 59815  		if (int32(_pBt.XbtsFlags) & int32(1)) != int32(0) {
 59816  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67485), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(76015)))
 59817  			crt.X__builtin_abort(tls)
 59818  		}
 59819  	}()
 59820  	if _pBt.XautoVacuum == 0 {
 59821  		goto _6
 59822  	}
 59823  	_invalidateAllOverflowCache(tls, _pBt)
 59824  	_sqlite3BtreeGetMeta(tls, _p, int32(4), &_pgnoRoot)
 59825  	_pgnoRoot += 1
 59826  _7:
 59827  	if (_pgnoRoot == _ptrmapPageno(tls, _pBt, _pgnoRoot)) || (_pgnoRoot == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 59828  		_pgnoRoot += 1
 59829  		goto _7
 59830  	}
 59831  	func() {
 59832  		if _pgnoRoot < uint32(3) && _sqlite3Config.XneverCorrupt != int32(0) {
 59833  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67518), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77645)))
 59834  			crt.X__builtin_abort(tls)
 59835  		}
 59836  	}()
 59837  	_rc = _allocateBtreePage(tls, _pBt, &_1_pPageMove, &_1_pgnoMove, _pgnoRoot, uint8(1))
 59838  	if _rc != int32(0) {
 59839  		return _rc
 59840  	}
 59841  	if _1_pgnoMove == _pgnoRoot {
 59842  		goto _14
 59843  	}
 59844  	_4_eType = uint8(0)
 59845  	_4_iPtrPage = uint32(0)
 59846  	_rc = _saveAllCursors(tls, _pBt, 0, nil)
 59847  	_releasePage(tls, _1_pPageMove)
 59848  	if _rc != int32(0) {
 59849  		return _rc
 59850  	}
 59851  	_rc = _btreeGetPage(tls, _pBt, _pgnoRoot, &_pRoot, int32(0))
 59852  	if _rc != int32(0) {
 59853  		return _rc
 59854  	}
 59855  	_rc = _ptrmapGet(tls, _pBt, _pgnoRoot, &_4_eType, &_4_iPtrPage)
 59856  	if (int32(_4_eType) == int32(1)) || (int32(_4_eType) == int32(2)) {
 59857  		_rc = _sqlite3CorruptError(tls, int32(67556))
 59858  	}
 59859  	if _rc != int32(0) {
 59860  		_releasePage(tls, _pRoot)
 59861  		return _rc
 59862  	}
 59863  	func() {
 59864  		if int32(_4_eType) == int32(1) {
 59865  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67562), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77671)))
 59866  			crt.X__builtin_abort(tls)
 59867  		}
 59868  	}()
 59869  	func() {
 59870  		if int32(_4_eType) == int32(2) {
 59871  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67563), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77694)))
 59872  			crt.X__builtin_abort(tls)
 59873  		}
 59874  	}()
 59875  	_rc = _relocatePage(tls, _pBt, _pRoot, _4_eType, _4_iPtrPage, _1_pgnoMove, int32(0))
 59876  	_releasePage(tls, _pRoot)
 59877  	if _rc != int32(0) {
 59878  		return _rc
 59879  	}
 59880  	_rc = _btreeGetPage(tls, _pBt, _pgnoRoot, &_pRoot, int32(0))
 59881  	if _rc != int32(0) {
 59882  		return _rc
 59883  	}
 59884  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pRoot.XpDbPage))
 59885  	if _rc != int32(0) {
 59886  		_releasePage(tls, _pRoot)
 59887  		return _rc
 59888  	}
 59889  	goto _27
 59890  _14:
 59891  	_pRoot = _1_pPageMove
 59892  _27:
 59893  	_ptrmapPut(tls, _pBt, _pgnoRoot, uint8(1), 0, &_rc)
 59894  	if _rc != 0 {
 59895  		_releasePage(tls, _pRoot)
 59896  		return _rc
 59897  	}
 59898  	func() {
 59899  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage)) == 0 {
 59900  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67595), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77717)))
 59901  			crt.X__builtin_abort(tls)
 59902  		}
 59903  	}()
 59904  	_rc = _sqlite3BtreeUpdateMeta(tls, _p, int32(4), _pgnoRoot)
 59905  	if func() int32 {
 59906  		if _rc != 0 {
 59907  			return func() int32 {
 59908  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67597), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(4809)))
 59909  				crt.X__builtin_abort(tls)
 59910  				return int32(1)
 59911  			}()
 59912  		}
 59913  		return int32(0)
 59914  	}() != 0 {
 59915  		_releasePage(tls, _pRoot)
 59916  		return _rc
 59917  	}
 59918  	goto _34
 59919  _6:
 59920  	_rc = _allocateBtreePage(tls, _pBt, &_pRoot, &_pgnoRoot, uint32(1), 0)
 59921  	if _rc != 0 {
 59922  		return _rc
 59923  	}
 59924  _34:
 59925  	func() {
 59926  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pRoot.XpDbPage)) == 0 {
 59927  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67607), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77763)))
 59928  			crt.X__builtin_abort(tls)
 59929  		}
 59930  	}()
 59931  	if (_createTabFlags & int32(1)) != 0 {
 59932  		_ptfFlags = int32(13)
 59933  		goto _39
 59934  	}
 59935  	_ptfFlags = int32(10)
 59936  _39:
 59937  	_zeroPage(tls, _pRoot, _ptfFlags)
 59938  	_sqlite3PagerUnref(tls, (*XPgHdr)(_pRoot.XpDbPage))
 59939  	func() {
 59940  		if (int32(_pBt.XopenFlags)&int32(4)) != int32(0) && _pgnoRoot != uint32(2) {
 59941  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67615), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77803)))
 59942  			crt.X__builtin_abort(tls)
 59943  		}
 59944  	}()
 59945  	*_piTable = int32(_pgnoRoot)
 59946  	return int32(0)
 59947  }
 59948  
 59949  var _btreeCreateTableØ00__func__Ø000 [17]int8
 59950  
 59951  func init() {
 59952  	crt.Xstrncpy(nil, &_btreeCreateTableØ00__func__Ø000[0], str(77853), 17)
 59953  }
 59954  
 59955  // C comment
 59956  //  /*
 59957  //  ** Initialize the temporary index cursor just opened as a sorter cursor.
 59958  //  **
 59959  //  ** Usually, the sorter module uses the value of (pCsr->pKeyInfo->nField)
 59960  //  ** to determine the number of fields that should be compared from the
 59961  //  ** records being sorted. However, if the value passed as argument nField
 59962  //  ** is non-zero and the sorter is able to guarantee a stable sort, nField
 59963  //  ** is used instead. This is used when sorting records for a CREATE INDEX
 59964  //  ** statement. In this case, keys are always delivered to the sorter in
 59965  //  ** order of the primary key, which happens to be make up the final part
 59966  //  ** of the records being sorted. So if the sort is stable, there is never
 59967  //  ** any reason to compare PK fields and they can be ignored for a small
 59968  //  ** performance boost.
 59969  //  **
 59970  //  ** The sorter can guarantee a stable sort when running in single-threaded
 59971  //  ** mode, but not in multi-threaded mode.
 59972  //  **
 59973  //  ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 59974  //  */
 59975  func _sqlite3VdbeSorterInit(tls *crt.TLS, _db *Xsqlite3, _nField int32, _pCsr *XVdbeCursor) (r0 int32) {
 59976  	var _pgsz, _i, _szKeyInfo, _sz, _rc, _nWorker int32
 59977  	var _7_mxCache int64
 59978  	var _7_szPma uint32
 59979  	var _pKeyInfo *XKeyInfo
 59980  	var _pSorter *XVdbeSorter
 59981  	var _6_pTask *XSortSubtask
 59982  	_rc = int32(0)
 59983  	if _sqlite3TempInMemory(tls, _db) != 0 || (_sqlite3Config.XbCoreMutex == int32(0)) {
 59984  		_nWorker = int32(0)
 59985  		goto _2
 59986  	}
 59987  	_nWorker = *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(11))
 59988  _2:
 59989  	func() {
 59990  		if _pCsr.XpKeyInfo == nil || (*XBtree)(_pCsr.XpBtx) != nil {
 59991  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86975), unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000), unsafe.Pointer(str(77870)))
 59992  			crt.X__builtin_abort(tls)
 59993  		}
 59994  	}()
 59995  	func() {
 59996  		if int32(_pCsr.XeCurType) != int32(1) {
 59997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86976), unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000), unsafe.Pointer(str(57837)))
 59998  			crt.X__builtin_abort(tls)
 59999  		}
 60000  	}()
 60001  	_szKeyInfo = int32(uint64(40) + (uint64(int32((*XKeyInfo)(_pCsr.XpKeyInfo).XnField)-int32(1)) * uint64(8)))
 60002  	_sz = int32(uint64(200) + (uint64(_nWorker) * uint64(104)))
 60003  	_pSorter = (*XVdbeSorter)(_sqlite3DbMallocZero(tls, _db, uint64(_sz+_szKeyInfo)))
 60004  	*(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))) = _pSorter
 60005  	if _pSorter == nil {
 60006  		_rc = _sqlite3NomemError(tls, int32(86983))
 60007  		goto _9
 60008  	}
 60009  	*(**XKeyInfo)(unsafe.Pointer(&_pSorter.XpKeyInfo)) = store67(&_pKeyInfo, (*XKeyInfo)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pSorter))+uintptr(_sz))))))
 60010  	crt.Xmemcpy(tls, unsafe.Pointer(_pKeyInfo), _pCsr.XpKeyInfo, uint64(_szKeyInfo))
 60011  	*(**Xsqlite3)(unsafe.Pointer(&_pKeyInfo.Xdb)) = nil
 60012  	if _nField != 0 && (_nWorker == int32(0)) {
 60013  		{
 60014  			p := &_pKeyInfo.XnXField
 60015  			*p = uint16(int32(*p) + (int32(_pKeyInfo.XnField) - _nField))
 60016  		}
 60017  		_pKeyInfo.XnField = uint16(_nField)
 60018  	}
 60019  	_pSorter.Xpgsz = store2(&_pgsz, _sqlite3BtreeGetPageSize(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt)))
 60020  	_pSorter.XnTask = uint8(_nWorker + int32(1))
 60021  	_pSorter.XiPrev = uint8(_nWorker - int32(1))
 60022  	_pSorter.XbUseThreads = uint8(bool2int(int32(_pSorter.XnTask) > int32(1)))
 60023  	*(**Xsqlite3)(unsafe.Pointer(&_pSorter.Xdb)) = _db
 60024  	_i = int32(0)
 60025  _12:
 60026  	if _i >= int32(_pSorter.XnTask) {
 60027  		goto _15
 60028  	}
 60029  	_6_pTask = elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_i))
 60030  	*(**XVdbeSorter)(unsafe.Pointer(&_6_pTask.XpSorter)) = _pSorter
 60031  	_i += 1
 60032  	goto _12
 60033  _15:
 60034  	if _sqlite3TempInMemory(tls, _db) != 0 {
 60035  		goto _16
 60036  	}
 60037  	_7_szPma = _sqlite3Config.XszPma
 60038  	_pSorter.XmnPmaSize = int32(_7_szPma * uint32(_pgsz))
 60039  	_7_mxCache = int64((*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema).Xcache_size)
 60040  	if _7_mxCache < (0) {
 60041  		_7_mxCache = _7_mxCache * int64(-1024)
 60042  		goto _18
 60043  	}
 60044  	_7_mxCache = _7_mxCache * int64(_pgsz)
 60045  _18:
 60046  	_7_mxCache = func() int64 {
 60047  		if _7_mxCache < int64(536870912) {
 60048  			return _7_mxCache
 60049  		}
 60050  		return int64(536870912)
 60051  	}()
 60052  	_pSorter.XmxPmaSize = func() int32 {
 60053  		if _pSorter.XmnPmaSize > int32(_7_mxCache) {
 60054  			return _pSorter.XmnPmaSize
 60055  		}
 60056  		return int32(_7_mxCache)
 60057  	}()
 60058  	if _sqlite3Config.XpScratch != nil {
 60059  		goto _23
 60060  	}
 60061  	func() {
 60062  		if _pSorter.XiMemory != int32(0) {
 60063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87023), unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000), unsafe.Pointer(str(77902)))
 60064  			crt.X__builtin_abort(tls)
 60065  		}
 60066  	}()
 60067  	_pSorter.XnMemory = _pgsz
 60068  	_pSorter.Xlist.XaMemory = (*uint8)(_sqlite3Malloc(tls, uint64(_pgsz)))
 60069  	if (_pSorter.Xlist.XaMemory) == nil {
 60070  		_rc = _sqlite3NomemError(tls, int32(87026))
 60071  	}
 60072  _23:
 60073  _16:
 60074  	if ((int32(_pKeyInfo.XnField) + int32(_pKeyInfo.XnXField)) < int32(13)) && (((*elem64((**XCollSeq)(unsafe.Pointer(&_pKeyInfo.XaColl)), 0)) == nil) || ((*elem64((**XCollSeq)(unsafe.Pointer(&_pKeyInfo.XaColl)), 0)) == (*XCollSeq)(_db.XpDfltColl))) {
 60075  		_pSorter.XtypeMask = uint8(3)
 60076  	}
 60077  _9:
 60078  	return _rc
 60079  }
 60080  
 60081  var _sqlite3VdbeSorterInitØ00__func__Ø000 [22]int8
 60082  
 60083  func init() {
 60084  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterInitØ00__func__Ø000[0], str(77922), 22)
 60085  }
 60086  
 60087  // C comment
 60088  //  /*
 60089  //  ** Return true if the cursor has a hint specified.  This routine is
 60090  //  ** only used from within assert() statements
 60091  //  */
 60092  func _sqlite3BtreeCursorHasHint(tls *crt.TLS, _pCsr *XBtCursor, _mask uint32) (r0 int32) {
 60093  	return bool2int((uint32(_pCsr.Xhints) & _mask) != (0))
 60094  }
 60095  
 60096  func _sqlite3BtreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 60097  	func() {
 60098  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 60099  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64636), unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000), unsafe.Pointer(str(71986)))
 60100  			crt.X__builtin_abort(tls)
 60101  		}
 60102  	}()
 60103  	func() {
 60104  		if _pRes == nil {
 60105  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64637), unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000), unsafe.Pointer(str(72910)))
 60106  			crt.X__builtin_abort(tls)
 60107  		}
 60108  	}()
 60109  	func() {
 60110  		if (*_pRes) != int32(0) && (*_pRes) != int32(1) {
 60111  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64638), unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000), unsafe.Pointer(str(72918)))
 60112  			crt.X__builtin_abort(tls)
 60113  		}
 60114  	}()
 60115  	func() {
 60116  		if _pCur.XskipNext != int32(0) && int32(_pCur.XeState) == int32(1) {
 60117  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64639), unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000), unsafe.Pointer(str(72939)))
 60118  			crt.X__builtin_abort(tls)
 60119  		}
 60120  	}()
 60121  	*_pRes = int32(0)
 60122  	{
 60123  		p := &_pCur.XcurFlags
 60124  		*p = uint8(int32(*p) & int32(-15))
 60125  	}
 60126  	_pCur.Xinfo.XnSize = 0
 60127  	if ((int32(_pCur.XeState) != int32(1)) || (int32(_pCur.Xix) == int32(0))) || (int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xleaf) == int32(0)) {
 60128  		return _btreePrevious(tls, _pCur, _pRes)
 60129  	}
 60130  	_pCur.Xix -= 1
 60131  	return int32(0)
 60132  }
 60133  
 60134  var _sqlite3BtreePreviousØ00__func__Ø000 [21]int8
 60135  
 60136  func init() {
 60137  	crt.Xstrncpy(nil, &_sqlite3BtreePreviousØ00__func__Ø000[0], str(77944), 21)
 60138  }
 60139  
 60140  // C comment
 60141  //  /*
 60142  //  ** Step the cursor to the back to the previous entry in the database.  If
 60143  //  ** successful then set *pRes=0.  If the cursor
 60144  //  ** was already pointing to the first entry in the database before
 60145  //  ** this routine was called, then set *pRes=1.
 60146  //  **
 60147  //  ** The main entry point is sqlite3BtreePrevious().  That routine is optimized
 60148  //  ** for the common case of merely decrementing the cell counter BtCursor.aiIdx
 60149  //  ** to the previous cell on the current page.  The (slower) btreePrevious()
 60150  //  ** helper routine is called when it is necessary to move to a different page
 60151  //  ** or to restore the cursor.
 60152  //  **
 60153  //  ** The calling function will set *pRes to 0 or 1.  The initial *pRes value
 60154  //  ** will be 1 if the cursor being stepped corresponds to an SQL index and
 60155  //  ** if this routine could have been skipped if that SQL index had been
 60156  //  ** a unique index.  Otherwise the caller will have set *pRes to zero.
 60157  //  ** Zero is the common case. The btree implementation is free to use the
 60158  //  ** initial *pRes value as a hint to improve performance, but the current
 60159  //  ** SQLite btree implementation does not. (Note that the comdb2 btree
 60160  //  ** implementation does use this hint, however.)
 60161  //  */
 60162  func _btreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 60163  	var _rc, _6_idx int32
 60164  	var _pPage *XMemPage
 60165  	func() {
 60166  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 60167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64580), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(71986)))
 60168  			crt.X__builtin_abort(tls)
 60169  		}
 60170  	}()
 60171  	func() {
 60172  		if _pRes == nil {
 60173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64581), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(72910)))
 60174  			crt.X__builtin_abort(tls)
 60175  		}
 60176  	}()
 60177  	func() {
 60178  		if (*_pRes) != int32(0) {
 60179  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64582), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(73004)))
 60180  			crt.X__builtin_abort(tls)
 60181  		}
 60182  	}()
 60183  	func() {
 60184  		if _pCur.XskipNext != int32(0) && int32(_pCur.XeState) == int32(1) {
 60185  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64583), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(72939)))
 60186  			crt.X__builtin_abort(tls)
 60187  		}
 60188  	}()
 60189  	func() {
 60190  		if (int32(_pCur.XcurFlags) & int32(14)) != int32(0) {
 60191  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64584), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(77965)))
 60192  			crt.X__builtin_abort(tls)
 60193  		}
 60194  	}()
 60195  	func() {
 60196  		if int32(_pCur.Xinfo.XnSize) != int32(0) {
 60197  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64585), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(78031)))
 60198  			crt.X__builtin_abort(tls)
 60199  		}
 60200  	}()
 60201  	if int32(_pCur.XeState) == int32(1) {
 60202  		goto _13
 60203  	}
 60204  	_rc = func() int32 {
 60205  		if int32(_pCur.XeState) >= int32(3) {
 60206  			return _btreeRestoreCursorPosition(tls, _pCur)
 60207  		}
 60208  		return int32(0)
 60209  	}()
 60210  	if _rc != int32(0) {
 60211  		return _rc
 60212  	}
 60213  	if int32(0) == int32(_pCur.XeState) {
 60214  		*_pRes = int32(1)
 60215  		return int32(0)
 60216  	}
 60217  	if _pCur.XskipNext == 0 {
 60218  		goto _18
 60219  	}
 60220  	func() {
 60221  		if int32(_pCur.XeState) != int32(1) && int32(_pCur.XeState) != int32(2) {
 60222  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64596), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(73013)))
 60223  			crt.X__builtin_abort(tls)
 60224  		}
 60225  	}()
 60226  	_pCur.XeState = uint8(1)
 60227  	if _pCur.XskipNext < int32(0) {
 60228  		_pCur.XskipNext = int32(0)
 60229  		return int32(0)
 60230  	}
 60231  	_pCur.XskipNext = int32(0)
 60232  _18:
 60233  _13:
 60234  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 60235  	func() {
 60236  		if _pPage.XisInit == 0 {
 60237  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64607), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(72793)))
 60238  			crt.X__builtin_abort(tls)
 60239  		}
 60240  	}()
 60241  	if _pPage.Xleaf != 0 {
 60242  		goto _25
 60243  	}
 60244  	_6_idx = int32(_pCur.Xix)
 60245  	_rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData))+uintptr(int32(_pPage.XmaskPage)&((int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_6_idx)), 0))<<8)|int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_6_idx)), uintptr(1)))))))))
 60246  	if _rc != 0 {
 60247  		return _rc
 60248  	}
 60249  	_rc = _moveToRightmost(tls, _pCur)
 60250  	goto _27
 60251  _25:
 60252  _28:
 60253  	if int32(_pCur.Xix) != int32(0) {
 60254  		goto _29
 60255  	}
 60256  	if int32(_pCur.XiPage) == int32(0) {
 60257  		_pCur.XeState = 0
 60258  		*_pRes = int32(1)
 60259  		return int32(0)
 60260  	}
 60261  	_moveToParent(tls, _pCur)
 60262  	goto _28
 60263  _29:
 60264  	func() {
 60265  		if int32(_pCur.Xinfo.XnSize) != int32(0) {
 60266  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64622), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(78031)))
 60267  			crt.X__builtin_abort(tls)
 60268  		}
 60269  	}()
 60270  	func() {
 60271  		if (int32(_pCur.XcurFlags) & int32(4)) != int32(0) {
 60272  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64623), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(78051)))
 60273  			crt.X__builtin_abort(tls)
 60274  		}
 60275  	}()
 60276  	_pCur.Xix -= 1
 60277  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 60278  	if (_pPage.XintKey != 0) && (_pPage.Xleaf == 0) {
 60279  		_rc = _sqlite3BtreePrevious(tls, _pCur, _pRes)
 60280  		goto _37
 60281  	}
 60282  	_rc = int32(0)
 60283  _37:
 60284  _27:
 60285  	return _rc
 60286  }
 60287  
 60288  var _btreePreviousØ00__func__Ø000 [14]int8
 60289  
 60290  func init() {
 60291  	crt.Xstrncpy(nil, &_btreePreviousØ00__func__Ø000[0], str(78090), 14)
 60292  }
 60293  
 60294  // C comment
 60295  //  /*
 60296  //  ** Move the cursor down to the right-most leaf entry beneath the
 60297  //  ** page to which it is currently pointing.  Notice the difference
 60298  //  ** between moveToLeftmost() and moveToRightmost().  moveToLeftmost()
 60299  //  ** finds the left-most entry beneath the *entry* whereas moveToRightmost()
 60300  //  ** finds the right-most entry beneath the *page*.
 60301  //  **
 60302  //  ** The right-most entry is the one with the largest key - the last
 60303  //  ** key in ascending order.
 60304  //  */
 60305  func _moveToRightmost(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 60306  	var _rc int32
 60307  	var _pgno uint32
 60308  	var _pPage *XMemPage
 60309  	_rc = int32(0)
 60310  	_pPage = nil
 60311  	func() {
 60312  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 60313  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64058), unsafe.Pointer(&_moveToRightmostØ00__func__Ø000), unsafe.Pointer(str(71986)))
 60314  			crt.X__builtin_abort(tls)
 60315  		}
 60316  	}()
 60317  	func() {
 60318  		if int32(_pCur.XeState) != int32(1) {
 60319  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64059), unsafe.Pointer(&_moveToRightmostØ00__func__Ø000), unsafe.Pointer(str(10345)))
 60320  			crt.X__builtin_abort(tls)
 60321  		}
 60322  	}()
 60323  _4:
 60324  	if (store86(&_pPage, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xleaf) != 0 {
 60325  		goto _5
 60326  	}
 60327  	_pgno = _sqlite3Get4byte(tls, elem15(_pPage.XaData, uintptr(int32(_pPage.XhdrOffset)+int32(8))))
 60328  	_pCur.Xix = _pPage.XnCell
 60329  	_rc = _moveToChild(tls, _pCur, _pgno)
 60330  	if _rc != 0 {
 60331  		return _rc
 60332  	}
 60333  	goto _4
 60334  _5:
 60335  	_pCur.Xix = uint16(int32(_pPage.XnCell) - int32(1))
 60336  	func() {
 60337  		if int32(_pCur.Xinfo.XnSize) != int32(0) {
 60338  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64067), unsafe.Pointer(&_moveToRightmostØ00__func__Ø000), unsafe.Pointer(str(78031)))
 60339  			crt.X__builtin_abort(tls)
 60340  		}
 60341  	}()
 60342  	func() {
 60343  		if (int32(_pCur.XcurFlags) & int32(2)) != int32(0) {
 60344  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64068), unsafe.Pointer(&_moveToRightmostØ00__func__Ø000), unsafe.Pointer(str(78104)))
 60345  			crt.X__builtin_abort(tls)
 60346  		}
 60347  	}()
 60348  	return int32(0)
 60349  }
 60350  
 60351  var _moveToRightmostØ00__func__Ø000 [16]int8
 60352  
 60353  func init() {
 60354  	crt.Xstrncpy(nil, &_moveToRightmostØ00__func__Ø000[0], str(78141), 16)
 60355  }
 60356  
 60357  // C comment
 60358  //  /*
 60359  //  ** Return TRUE if the cursor is not pointing at an entry of the table.
 60360  //  **
 60361  //  ** TRUE will be returned after a call to sqlite3BtreeNext() moves
 60362  //  ** past the last entry in the table or sqlite3BtreePrev() moves past
 60363  //  ** the first entry.  TRUE is also returned if the table is empty.
 60364  //  */
 60365  func _sqlite3BtreeEof(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 60366  	return bool2int(int32(1) != int32(_pCur.XeState))
 60367  }
 60368  
 60369  // C comment
 60370  //  /* Move the cursor to the last entry in the table.  Return SQLITE_OK
 60371  //  ** on success.  Set *pRes to 0 if the cursor actually points to something
 60372  //  ** or set *pRes to 1 if the table is empty.
 60373  //  */
 60374  func _sqlite3BtreeLast(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 60375  	var _rc, _1_ii int32
 60376  	func() {
 60377  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 60378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64102), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(71986)))
 60379  			crt.X__builtin_abort(tls)
 60380  		}
 60381  	}()
 60382  	func() {
 60383  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).Xmutex)) == 0 {
 60384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64103), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(72011)))
 60385  			crt.X__builtin_abort(tls)
 60386  		}
 60387  	}()
 60388  	if int32(1) != int32(_pCur.XeState) || (int32(_pCur.XcurFlags)&int32(8)) == int32(0) {
 60389  		goto _5
 60390  	}
 60391  	_1_ii = int32(0)
 60392  _6:
 60393  	if _1_ii >= int32(_pCur.XiPage) {
 60394  		goto _9
 60395  	}
 60396  	func() {
 60397  		if int32(*elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), uintptr(_1_ii))) != int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_1_ii))).XnCell) {
 60398  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64112), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(78157)))
 60399  			crt.X__builtin_abort(tls)
 60400  		}
 60401  	}()
 60402  	_1_ii += 1
 60403  	goto _6
 60404  _9:
 60405  	func() {
 60406  		if int32(_pCur.Xix) != (int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) - int32(1)) {
 60407  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64114), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(78198)))
 60408  			crt.X__builtin_abort(tls)
 60409  		}
 60410  	}()
 60411  	func() {
 60412  		if ((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xleaf) == 0 {
 60413  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64115), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(78243)))
 60414  			crt.X__builtin_abort(tls)
 60415  		}
 60416  	}()
 60417  	return int32(0)
 60418  
 60419  _5:
 60420  	_rc = _moveToRoot(tls, _pCur)
 60421  	if _rc != int32(0) {
 60422  		goto _16
 60423  	}
 60424  	if int32(0) == int32(_pCur.XeState) {
 60425  		func() {
 60426  			if _pCur.XpgnoRoot != (0) && int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) != int32(0) {
 60427  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64123), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(72404)))
 60428  				crt.X__builtin_abort(tls)
 60429  			}
 60430  		}()
 60431  		*_pRes = int32(1)
 60432  		goto _21
 60433  	}
 60434  	func() {
 60435  		if int32(_pCur.XeState) != int32(1) {
 60436  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64126), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(10345)))
 60437  			crt.X__builtin_abort(tls)
 60438  		}
 60439  	}()
 60440  	*_pRes = int32(0)
 60441  	_rc = _moveToRightmost(tls, _pCur)
 60442  	if _rc == int32(0) {
 60443  		{
 60444  			p := &_pCur.XcurFlags
 60445  			*p = uint8(int32(*p) | int32(8))
 60446  		}
 60447  		goto _25
 60448  	}
 60449  	{
 60450  		p := &_pCur.XcurFlags
 60451  		*p = uint8(int32(*p) & int32(-9))
 60452  	}
 60453  _25:
 60454  _21:
 60455  _16:
 60456  	return _rc
 60457  }
 60458  
 60459  var _sqlite3BtreeLastØ00__func__Ø000 [17]int8
 60460  
 60461  func init() {
 60462  	crt.Xstrncpy(nil, &_sqlite3BtreeLastØ00__func__Ø000[0], str(78275), 17)
 60463  }
 60464  
 60465  // C comment
 60466  //  /*
 60467  //  ** Insert a new record into the BTree.  The content of the new record
 60468  //  ** is described by the pX object.  The pCur cursor is used only to
 60469  //  ** define what table the record should be inserted into, and is left
 60470  //  ** pointing at a random location.
 60471  //  **
 60472  //  ** For a table btree (used for rowid tables), only the pX.nKey value of
 60473  //  ** the key is used. The pX.pKey value must be NULL.  The pX.nKey is the
 60474  //  ** rowid or INTEGER PRIMARY KEY of the row.  The pX.nData,pData,nZero fields
 60475  //  ** hold the content of the row.
 60476  //  **
 60477  //  ** For an index btree (used for indexes and WITHOUT ROWID tables), the
 60478  //  ** key is an arbitrary byte sequence stored in pX.pKey,nKey.  The
 60479  //  ** pX.pData,nData,nZero fields must be zero.
 60480  //  **
 60481  //  ** If the seekResult parameter is non-zero, then a successful call to
 60482  //  ** MovetoUnpacked() to seek cursor pCur to (pKey,nKey) has already
 60483  //  ** been performed.  In other words, if seekResult!=0 then the cursor
 60484  //  ** is currently pointing to a cell that will be adjacent to the cell
 60485  //  ** to be inserted.  If seekResult<0 then pCur points to a cell that is
 60486  //  ** smaller then (pKey,nKey).  If seekResult>0 then pCur points to a cell
 60487  //  ** that is larger than (pKey,nKey).
 60488  //  **
 60489  //  ** If seekResult==0, that means pCur is pointing at some unknown location.
 60490  //  ** In that case, this routine must seek the cursor to the correct insertion
 60491  //  ** point for (pKey,nKey) before doing the insertion.  For index btrees,
 60492  //  ** if pX->nMem is non-zero, then pX->aMem contains pointers to the unpacked
 60493  //  ** key values and pX->aMem can be used instead of pX->pKey to avoid having
 60494  //  ** to decode the key.
 60495  //  */
 60496  func _sqlite3BtreeInsert(tls *crt.TLS, _pCur *XBtCursor, _pX *XBtreePayload, _flags int32, _seekResult int32) (r0 int32) {
 60497  	var _rc, _loc, _szNew, _idx int32
 60498  	var _oldCell, _newCell *uint8
 60499  	var _p *XBtree
 60500  	var _pBt *XBtShared
 60501  	var _9_info XCellInfo
 60502  	var _pPage *XMemPage
 60503  	var _7_r XUnpackedRecord
 60504  	_loc = _seekResult
 60505  	_szNew = int32(0)
 60506  	_p = (*XBtree)(_pCur.XpBtree)
 60507  	_pBt = (*XBtShared)(_p.XpBt)
 60508  	_newCell = nil
 60509  	func() {
 60510  		if (_flags & int32(10)) != _flags {
 60511  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67109), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78292)))
 60512  			crt.X__builtin_abort(tls)
 60513  		}
 60514  	}()
 60515  	if int32(_pCur.XeState) == int32(4) {
 60516  		func() {
 60517  			if _pCur.XskipNext == int32(0) {
 60518  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67112), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(75041)))
 60519  				crt.X__builtin_abort(tls)
 60520  			}
 60521  		}()
 60522  		return _pCur.XskipNext
 60523  	}
 60524  	func() {
 60525  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 60526  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67116), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(71986)))
 60527  			crt.X__builtin_abort(tls)
 60528  		}
 60529  	}()
 60530  	func() {
 60531  		if (int32(_pCur.XcurFlags)&int32(1)) == int32(0) || int32(_pBt.XinTransaction) != int32(2) || (int32(_pBt.XbtsFlags)&int32(1)) != int32(0) {
 60532  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67117), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78343)))
 60533  			crt.X__builtin_abort(tls)
 60534  		}
 60535  	}()
 60536  	func() {
 60537  		if _hasSharedCacheTableLock(tls, _p, _pCur.XpgnoRoot, bool2int((*XKeyInfo)(_pCur.XpKeyInfo) != nil), int32(2)) == 0 {
 60538  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67120), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78453)))
 60539  			crt.X__builtin_abort(tls)
 60540  		}
 60541  	}()
 60542  	func() {
 60543  		if (_pX.XpKey == nil) != ((*XKeyInfo)(_pCur.XpKeyInfo) == nil) {
 60544  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67127), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78518)))
 60545  			crt.X__builtin_abort(tls)
 60546  		}
 60547  	}()
 60548  	if (int32(_pCur.XcurFlags) & int32(32)) == 0 {
 60549  		goto _15
 60550  	}
 60551  	_rc = _saveAllCursors(tls, _pBt, _pCur.XpgnoRoot, _pCur)
 60552  	if _rc != 0 {
 60553  		return _rc
 60554  	}
 60555  _15:
 60556  	if (*XKeyInfo)(_pCur.XpKeyInfo) != nil {
 60557  		goto _17
 60558  	}
 60559  	func() {
 60560  		if _pX.XpKey != nil {
 60561  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67146), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78553)))
 60562  			crt.X__builtin_abort(tls)
 60563  		}
 60564  	}()
 60565  	_invalidateIncrblobCursors(tls, _p, _pCur.XpgnoRoot, _pX.XnKey, int32(0))
 60566  	func() {
 60567  		if (_flags&int32(2)) != int32(0) && ((int32(_pCur.XcurFlags)&int32(2)) == int32(0) || _pX.XnKey != (_pCur.Xinfo.XnKey)) {
 60568  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67153), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78565)))
 60569  			crt.X__builtin_abort(tls)
 60570  		}
 60571  	}()
 60572  	if ((int32(_pCur.XcurFlags) & int32(2)) != int32(0)) && (_pX.XnKey == (_pCur.Xinfo.XnKey)) {
 60573  		_loc = int32(0)
 60574  		goto _27
 60575  	}
 60576  	if _loc != int32(0) {
 60577  		goto _27
 60578  	}
 60579  	_rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, nil, _pX.XnKey, bool2int(_flags != int32(0)), &_loc)
 60580  	if _rc != 0 {
 60581  		return _rc
 60582  	}
 60583  _27:
 60584  	goto _31
 60585  _17:
 60586  	if _loc != int32(0) || (_flags&int32(2)) != int32(0) {
 60587  		goto _31
 60588  	}
 60589  	if _pX.XnMem != 0 {
 60590  		*(**XKeyInfo)(unsafe.Pointer(&_7_r.XpKeyInfo)) = (*XKeyInfo)(_pCur.XpKeyInfo)
 60591  		*(**XMem)(unsafe.Pointer(&_7_r.XaMem)) = (*XMem)(_pX.XaMem)
 60592  		_7_r.XnField = _pX.XnMem
 60593  		_7_r.Xdefault_rc = 0
 60594  		_7_r.XerrCode = 0
 60595  		_7_r.Xr1 = 0
 60596  		_7_r.Xr2 = 0
 60597  		_7_r.XeqSeen = 0
 60598  		_rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, &_7_r, 0, bool2int(_flags != int32(0)), &_loc)
 60599  		goto _33
 60600  	}
 60601  	_rc = _btreeMoveto(tls, _pCur, _pX.XpKey, _pX.XnKey, bool2int(_flags != int32(0)), &_loc)
 60602  _33:
 60603  	if _rc != 0 {
 60604  		return _rc
 60605  	}
 60606  _31:
 60607  	func() {
 60608  		if int32(_pCur.XeState) != int32(1) && (int32(_pCur.XeState) != int32(0) || _loc == 0) {
 60609  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67182), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78666)))
 60610  			crt.X__builtin_abort(tls)
 60611  		}
 60612  	}()
 60613  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 60614  	func() {
 60615  		if _pPage.XintKey == 0 && _pX.XnKey < (0) {
 60616  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67185), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78734)))
 60617  			crt.X__builtin_abort(tls)
 60618  		}
 60619  	}()
 60620  	func() {
 60621  		if _pPage.Xleaf == 0 && _pPage.XintKey != 0 {
 60622  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67186), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78763)))
 60623  			crt.X__builtin_abort(tls)
 60624  		}
 60625  	}()
 60626  	func() {
 60627  		if _pPage.XisInit == 0 {
 60628  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67191), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(72793)))
 60629  			crt.X__builtin_abort(tls)
 60630  		}
 60631  	}()
 60632  	_newCell = _pBt.XpTmpSpace
 60633  	func() {
 60634  		if _newCell == nil {
 60635  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67193), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78793)))
 60636  			crt.X__builtin_abort(tls)
 60637  		}
 60638  	}()
 60639  	_rc = _fillInCell(tls, _pPage, _newCell, _pX, &_szNew)
 60640  	if _rc != 0 {
 60641  		goto _end_insert
 60642  	}
 60643  	func() {
 60644  		if _szNew != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 60645  			v := _pPage.XxCellSize
 60646  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 60647  		}()(tls, _pPage, _newCell)) {
 60648  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67196), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78804)))
 60649  			crt.X__builtin_abort(tls)
 60650  		}
 60651  	}()
 60652  	func() {
 60653  		if _szNew > int32(_pBt.XpageSize-uint32(8)) {
 60654  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67197), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78844)))
 60655  			crt.X__builtin_abort(tls)
 60656  		}
 60657  	}()
 60658  	_idx = int32(_pCur.Xix)
 60659  	if _loc != int32(0) {
 60660  		goto _54
 60661  	}
 60662  	func() {
 60663  		if _idx >= int32(_pPage.XnCell) {
 60664  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67201), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78871)))
 60665  			crt.X__builtin_abort(tls)
 60666  		}
 60667  	}()
 60668  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))
 60669  	if _rc != 0 {
 60670  		goto _end_insert
 60671  	}
 60672  	_oldCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData)) + uintptr(int32(_pPage.XmaskPage)&((int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_idx)), 0))<<8)|int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_idx)), uintptr(1)))))))
 60673  	if _pPage.Xleaf == 0 {
 60674  		crt.Xmemcpy(tls, unsafe.Pointer(_newCell), unsafe.Pointer(_oldCell), uint64(4))
 60675  	}
 60676  	_rc = _clearCell(tls, _pPage, _oldCell, &_9_info)
 60677  	if int32(_9_info.XnSize) != _szNew || uint32(_9_info.XnLocal) != _9_info.XnPayload || _pBt.XautoVacuum != 0 && _szNew >= int32(_pPage.XminLocal) {
 60678  		goto _62
 60679  	}
 60680  	func() {
 60681  		if _rc != int32(0) {
 60682  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67223), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(14967)))
 60683  			crt.X__builtin_abort(tls)
 60684  		}
 60685  	}()
 60686  	if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_oldCell))+uintptr(_szNew))))) > crt.P2U(unsafe.Pointer(_pPage.XaDataEnd)) {
 60687  		return _sqlite3CorruptError(tls, int32(67224))
 60688  	}
 60689  	crt.Xmemcpy(tls, unsafe.Pointer(_oldCell), unsafe.Pointer(_newCell), uint64(_szNew))
 60690  	return int32(0)
 60691  
 60692  _62:
 60693  	_dropCell(tls, _pPage, _idx, int32(_9_info.XnSize), &_rc)
 60694  	if _rc != 0 {
 60695  		goto _end_insert
 60696  	}
 60697  	goto _72
 60698  _54:
 60699  	if (_loc < int32(0)) && (int32(_pPage.XnCell) > int32(0)) {
 60700  		func() {
 60701  			if _pPage.Xleaf == 0 {
 60702  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67231), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78888)))
 60703  				crt.X__builtin_abort(tls)
 60704  			}
 60705  		}()
 60706  		_idx = int32(preInc78(&_pCur.Xix, uint16(1)))
 60707  		{
 60708  			p := &_pCur.XcurFlags
 60709  			*p = uint8(int32(*p) & int32(-3))
 60710  		}
 60711  		goto _72
 60712  	}
 60713  	func() {
 60714  		if _pPage.Xleaf == 0 {
 60715  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67235), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78888)))
 60716  			crt.X__builtin_abort(tls)
 60717  		}
 60718  	}()
 60719  _72:
 60720  	_insertCell(tls, _pPage, _idx, _newCell, _szNew, nil, 0, &_rc)
 60721  	func() {
 60722  		if int32(_pPage.XnOverflow) != int32(0) && _rc != int32(0) {
 60723  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67238), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78900)))
 60724  			crt.X__builtin_abort(tls)
 60725  		}
 60726  	}()
 60727  	func() {
 60728  		if _rc == int32(0) && int32(_pPage.XnCell) <= int32(0) && int32(_pPage.XnOverflow) <= int32(0) {
 60729  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67239), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78937)))
 60730  			crt.X__builtin_abort(tls)
 60731  		}
 60732  	}()
 60733  	_pCur.Xinfo.XnSize = 0
 60734  	if _pPage.XnOverflow == 0 {
 60735  		goto _82
 60736  	}
 60737  	func() {
 60738  		if _rc != int32(0) {
 60739  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67263), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(14967)))
 60740  			crt.X__builtin_abort(tls)
 60741  		}
 60742  	}()
 60743  	{
 60744  		p := &_pCur.XcurFlags
 60745  		*p = uint8(int32(*p) & int32(-3))
 60746  	}
 60747  	_rc = _balance(tls, _pCur)
 60748  	(*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnOverflow = 0
 60749  	_pCur.XeState = 0
 60750  	if (_flags&int32(2)) == 0 || _rc != int32(0) {
 60751  		goto _86
 60752  	}
 60753  	_rc = _moveToRoot(tls, _pCur)
 60754  	if _pCur.XpKeyInfo == nil {
 60755  		goto _87
 60756  	}
 60757  	func() {
 60758  		if _pCur.XpKey != nil {
 60759  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67276), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78991)))
 60760  			crt.X__builtin_abort(tls)
 60761  		}
 60762  	}()
 60763  	_pCur.XpKey = _sqlite3Malloc(tls, uint64(_pX.XnKey))
 60764  	if _pCur.XpKey == nil {
 60765  		_rc = int32(7)
 60766  		goto _91
 60767  	}
 60768  	crt.Xmemcpy(tls, _pCur.XpKey, _pX.XpKey, uint64(_pX.XnKey))
 60769  _91:
 60770  _87:
 60771  	_pCur.XeState = uint8(3)
 60772  	_pCur.XnKey = _pX.XnKey
 60773  _86:
 60774  _82:
 60775  	func() {
 60776  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnOverflow) != int32(0) {
 60777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67288), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(79005)))
 60778  			crt.X__builtin_abort(tls)
 60779  		}
 60780  	}()
 60781  _end_insert:
 60782  	return _rc
 60783  }
 60784  
 60785  var _sqlite3BtreeInsertØ00__func__Ø000 [19]int8
 60786  
 60787  func init() {
 60788  	crt.Xstrncpy(nil, &_sqlite3BtreeInsertØ00__func__Ø000[0], str(79045), 19)
 60789  }
 60790  
 60791  // C comment
 60792  //  /*
 60793  //  ** This function is called before modifying the contents of a table
 60794  //  ** to invalidate any incrblob cursors that are open on the
 60795  //  ** row or one of the rows being modified.
 60796  //  **
 60797  //  ** If argument isClearTable is true, then the entire contents of the
 60798  //  ** table is about to be deleted. In this case invalidate all incrblob
 60799  //  ** cursors open on any row within the table with root-page pgnoRoot.
 60800  //  **
 60801  //  ** Otherwise, if argument isClearTable is false, then the row with
 60802  //  ** rowid iRow is being replaced or deleted. In this case invalidate
 60803  //  ** only those incrblob cursors open on that specific row.
 60804  //  */
 60805  func _invalidateIncrblobCursors(tls *crt.TLS, _pBtree *XBtree, _pgnoRoot uint32, _iRow int64, _isClearTable int32) {
 60806  	var _p *XBtCursor
 60807  	if int32(_pBtree.XhasIncrblobCur) == int32(0) {
 60808  		return
 60809  	}
 60810  	func() {
 60811  		if _sqlite3BtreeHoldsMutex(tls, _pBtree) == 0 {
 60812  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59542), unsafe.Pointer(&_invalidateIncrblobCursorsØ00__func__Ø000), unsafe.Pointer(str(79064)))
 60813  			crt.X__builtin_abort(tls)
 60814  		}
 60815  	}()
 60816  	_pBtree.XhasIncrblobCur = 0
 60817  	_p = (*XBtCursor)((*XBtShared)(_pBtree.XpBt).XpCursor)
 60818  _3:
 60819  	if _p == nil {
 60820  		goto _6
 60821  	}
 60822  	if (int32(_p.XcurFlags) & int32(16)) == int32(0) {
 60823  		goto _7
 60824  	}
 60825  	_pBtree.XhasIncrblobCur = uint8(1)
 60826  	if (_p.XpgnoRoot == _pgnoRoot) && (_isClearTable != 0 || ((_p.Xinfo.XnKey) == _iRow)) {
 60827  		_p.XeState = 0
 60828  	}
 60829  _7:
 60830  	_p = (*XBtCursor)(_p.XpNext)
 60831  	goto _3
 60832  _6:
 60833  }
 60834  
 60835  var _invalidateIncrblobCursorsØ00__func__Ø000 [26]int8
 60836  
 60837  func init() {
 60838  	crt.Xstrncpy(nil, &_invalidateIncrblobCursorsØ00__func__Ø000[0], str(79095), 26)
 60839  }
 60840  
 60841  // C comment
 60842  //  /*
 60843  //  ** Create the byte sequence used to represent a cell on page pPage
 60844  //  ** and write that byte sequence into pCell[].  Overflow pages are
 60845  //  ** allocated and filled in as necessary.  The calling procedure
 60846  //  ** is responsible for making sure sufficient space has been allocated
 60847  //  ** for pCell[].
 60848  //  **
 60849  //  ** Note that pCell does not necessary need to point to the pPage->aData
 60850  //  ** area.  pCell might point to some temporary storage.  The cell will
 60851  //  ** be constructed in this temporary area then copied into pPage->aData
 60852  //  ** later.
 60853  //  */
 60854  func _fillInCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pX *XBtreePayload, _pnSize *int32) (r0 int32) {
 60855  	var _nPayload, _nSrc, _n, _rc, _spaceLeft, _nHeader, _4_mn int32
 60856  	var _pgnoOvfl, _7_pgnoPtrmap uint32
 60857  	var _10_eType uint8
 60858  	var _pSrc, _pPrior, _pPayload *uint8
 60859  	var _pBt *XBtShared
 60860  	var _5_info XCellInfo
 60861  	var _pOvfl, _pToRelease *XMemPage
 60862  	_pOvfl = nil
 60863  	_pToRelease = nil
 60864  	_pBt = (*XBtShared)(_pPage.XpBt)
 60865  	_pgnoOvfl = uint32(0)
 60866  	func() {
 60867  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 60868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65233), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(20394)))
 60869  			crt.X__builtin_abort(tls)
 60870  		}
 60871  	}()
 60872  	func() {
 60873  		if crt.P2U(unsafe.Pointer(_pCell)) >= crt.P2U(unsafe.Pointer(_pPage.XaData)) && crt.P2U(unsafe.Pointer(_pCell)) < crt.P2U(unsafe.Pointer(elem15(_pPage.XaData, uintptr(_pBt.XpageSize)))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 60874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65237), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79121)))
 60875  			crt.X__builtin_abort(tls)
 60876  		}
 60877  	}()
 60878  	_nHeader = int32(_pPage.XchildPtrSize)
 60879  	if _pPage.XintKey != 0 {
 60880  		_nPayload = _pX.XnData + _pX.XnZero
 60881  		_pSrc = (*uint8)(_pX.XpData)
 60882  		_nSrc = _pX.XnData
 60883  		func() {
 60884  			if _pPage.XintKeyLeaf == 0 {
 60885  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65246), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(53541)))
 60886  				crt.X__builtin_abort(tls)
 60887  			}
 60888  		}()
 60889  		_nHeader += int32(uint8(func() int32 {
 60890  			if uint32(_nPayload) < uint32(128) {
 60891  				return func() int32 { *elem15(_pCell, uintptr(_nHeader)) = uint8(_nPayload); return int32(1) }()
 60892  			}
 60893  			return _sqlite3PutVarint(tls, elem15(_pCell, uintptr(_nHeader)), uint64(_nPayload))
 60894  		}()))
 60895  		_nHeader += _sqlite3PutVarint(tls, elem15(_pCell, uintptr(_nHeader)), *(*uint64)(unsafe.Pointer(&_pX.XnKey)))
 60896  		goto _11
 60897  	}
 60898  	func() {
 60899  		if _pX.XnKey > int64(2147483647) || _pX.XpKey == nil {
 60900  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65250), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79222)))
 60901  			crt.X__builtin_abort(tls)
 60902  		}
 60903  	}()
 60904  	_nSrc = store2(&_nPayload, int32(_pX.XnKey))
 60905  	_pSrc = (*uint8)(_pX.XpKey)
 60906  	_nHeader += int32(uint8(func() int32 {
 60907  		if uint32(_nPayload) < uint32(128) {
 60908  			return func() int32 { *elem15(_pCell, uintptr(_nHeader)) = uint8(_nPayload); return int32(1) }()
 60909  		}
 60910  		return _sqlite3PutVarint(tls, elem15(_pCell, uintptr(_nHeader)), uint64(_nPayload))
 60911  	}()))
 60912  _11:
 60913  	if _nPayload > int32(_pPage.XmaxLocal) {
 60914  		goto _17
 60915  	}
 60916  	_n = _nHeader + _nPayload
 60917  	if _n < int32(4) {
 60918  		_n = int32(4)
 60919  	}
 60920  	*_pnSize = _n
 60921  	_spaceLeft = _nPayload
 60922  	_pPrior = _pCell
 60923  	goto _19
 60924  _17:
 60925  	_4_mn = int32(_pPage.XminLocal)
 60926  	_n = int32(uint32(_4_mn) + (uint32(_nPayload-_4_mn) % (((*XBtShared)(_pPage.XpBt).XusableSize) - uint32(4))))
 60927  	if _n > int32(_pPage.XmaxLocal) {
 60928  		_n = _4_mn
 60929  	}
 60930  	_spaceLeft = _n
 60931  	*_pnSize = (_n + _nHeader) + int32(4)
 60932  	_pPrior = elem15(_pCell, uintptr(_nHeader+_n))
 60933  _19:
 60934  	_pPayload = elem15(_pCell, uintptr(_nHeader))
 60935  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 60936  		v := _pPage.XxParseCell
 60937  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 60938  	}()(tls, _pPage, _pCell, &_5_info)
 60939  	func() {
 60940  		if _nHeader != int32(int64(uintptr(unsafe.Pointer(_5_info.XpPayload))-uintptr(unsafe.Pointer(_pCell)))) {
 60941  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65293), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79258)))
 60942  			crt.X__builtin_abort(tls)
 60943  		}
 60944  	}()
 60945  	func() {
 60946  		if _5_info.XnKey != _pX.XnKey {
 60947  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65294), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79296)))
 60948  			crt.X__builtin_abort(tls)
 60949  		}
 60950  	}()
 60951  	func() {
 60952  		if (*_pnSize) != int32(_5_info.XnSize) {
 60953  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65295), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79316)))
 60954  			crt.X__builtin_abort(tls)
 60955  		}
 60956  	}()
 60957  	func() {
 60958  		if _spaceLeft != int32(_5_info.XnLocal) {
 60959  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65296), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79338)))
 60960  			crt.X__builtin_abort(tls)
 60961  		}
 60962  	}()
 60963  _29:
 60964  	if _nPayload <= int32(0) {
 60965  		goto _30
 60966  	}
 60967  	if _spaceLeft != int32(0) {
 60968  		goto _31
 60969  	}
 60970  	_7_pgnoPtrmap = _pgnoOvfl
 60971  	if _pBt.XautoVacuum == 0 {
 60972  		goto _32
 60973  	}
 60974  _33:
 60975  	_pgnoOvfl += 1
 60976  	if (_ptrmapPageno(tls, _pBt, _pgnoOvfl) == _pgnoOvfl) || (_pgnoOvfl == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 60977  		goto _33
 60978  	}
 60979  _32:
 60980  	_rc = _allocateBtreePage(tls, _pBt, &_pOvfl, &_pgnoOvfl, _pgnoOvfl, 0)
 60981  	if _pBt.XautoVacuum == 0 || _rc != int32(0) {
 60982  		goto _36
 60983  	}
 60984  	_10_eType = uint8(func() int32 {
 60985  		if _7_pgnoPtrmap != 0 {
 60986  			return int32(4)
 60987  		}
 60988  		return int32(3)
 60989  	}())
 60990  	_ptrmapPut(tls, _pBt, _pgnoOvfl, _10_eType, _7_pgnoPtrmap, &_rc)
 60991  	if _rc != 0 {
 60992  		_releasePage(tls, _pOvfl)
 60993  	}
 60994  _36:
 60995  	if _rc != 0 {
 60996  		_releasePage(tls, _pToRelease)
 60997  		return _rc
 60998  	}
 60999  	func() {
 61000  		if _pToRelease != nil && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pToRelease.XpDbPage)) == 0 {
 61001  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65340), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79363)))
 61002  			crt.X__builtin_abort(tls)
 61003  		}
 61004  	}()
 61005  	func() {
 61006  		if crt.P2U(unsafe.Pointer(_pPrior)) >= crt.P2U(unsafe.Pointer(_pPage.XaData)) && crt.P2U(unsafe.Pointer(_pPrior)) < crt.P2U(unsafe.Pointer(elem15(_pPage.XaData, uintptr(_pBt.XpageSize)))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 61007  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65344), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79425)))
 61008  			crt.X__builtin_abort(tls)
 61009  		}
 61010  	}()
 61011  	_sqlite3Put4byte(tls, _pPrior, _pgnoOvfl)
 61012  	_releasePage(tls, _pToRelease)
 61013  	_pToRelease = _pOvfl
 61014  	_pPrior = _pOvfl.XaData
 61015  	_sqlite3Put4byte(tls, _pPrior, 0)
 61016  	_pPayload = elem15(_pOvfl.XaData, uintptr(4))
 61017  	_spaceLeft = int32(_pBt.XusableSize - uint32(4))
 61018  _31:
 61019  	_n = _nPayload
 61020  	if _n > _spaceLeft {
 61021  		_n = _spaceLeft
 61022  	}
 61023  	func() {
 61024  		if _pToRelease != nil && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pToRelease.XpDbPage)) == 0 {
 61025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65360), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79363)))
 61026  			crt.X__builtin_abort(tls)
 61027  		}
 61028  	}()
 61029  	func() {
 61030  		if crt.P2U(unsafe.Pointer(_pPayload)) >= crt.P2U(unsafe.Pointer(_pPage.XaData)) && crt.P2U(unsafe.Pointer(_pPayload)) < crt.P2U(unsafe.Pointer(elem15(_pPage.XaData, uintptr(_pBt.XpageSize)))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 61031  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65364), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79528)))
 61032  			crt.X__builtin_abort(tls)
 61033  		}
 61034  	}()
 61035  	if _nSrc <= int32(0) {
 61036  		goto _56
 61037  	}
 61038  	if _n > _nSrc {
 61039  		_n = _nSrc
 61040  	}
 61041  	func() {
 61042  		if _pSrc == nil {
 61043  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65369), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79635)))
 61044  			crt.X__builtin_abort(tls)
 61045  		}
 61046  	}()
 61047  	crt.Xmemcpy(tls, unsafe.Pointer(_pPayload), unsafe.Pointer(_pSrc), uint64(_n))
 61048  	goto _60
 61049  _56:
 61050  	crt.Xmemset(tls, unsafe.Pointer(_pPayload), int32(0), uint64(_n))
 61051  _60:
 61052  	_nPayload -= _n
 61053  	*(*uintptr)(unsafe.Pointer(&_pPayload)) += uintptr(_n)
 61054  	*(*uintptr)(unsafe.Pointer(&_pSrc)) += uintptr(_n)
 61055  	_nSrc -= _n
 61056  	_spaceLeft -= _n
 61057  	goto _29
 61058  _30:
 61059  	_releasePage(tls, _pToRelease)
 61060  	return int32(0)
 61061  }
 61062  
 61063  var _fillInCellØ00__func__Ø000 [11]int8
 61064  
 61065  func init() {
 61066  	crt.Xstrncpy(nil, &_fillInCellØ00__func__Ø000[0], str(79640), 11)
 61067  }
 61068  
 61069  // C comment
 61070  //  /*
 61071  //  ** Free any overflow pages associated with the given Cell.  Write the
 61072  //  ** local Cell size (the number of bytes on the original page, omitting
 61073  //  ** overflow) into *pnSize.
 61074  //  */
 61075  func _clearCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) (r0 int32) {
 61076  	var _rc, _nOvfl int32
 61077  	var _ovflPgno, _ovflPageSize, _3_iNext uint32
 61078  	var _pBt *XBtShared
 61079  	var _3_pOvfl *XMemPage
 61080  	_pBt = (*XBtShared)(_pPage.XpBt)
 61081  	func() {
 61082  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 61083  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65147), unsafe.Pointer(&_clearCellØ00__func__Ø000), unsafe.Pointer(str(20394)))
 61084  			crt.X__builtin_abort(tls)
 61085  		}
 61086  	}()
 61087  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 61088  		v := _pPage.XxParseCell
 61089  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 61090  	}()(tls, _pPage, _pCell, _pInfo)
 61091  	if uint32(_pInfo.XnLocal) == _pInfo.XnPayload {
 61092  		return int32(0)
 61093  	}
 61094  	if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+uintptr(_pInfo.XnSize)))))-uintptr(int32(1)))))) > crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData))+uintptr(_pPage.XmaskPage))))) {
 61095  		return _sqlite3CorruptError(tls, int32(65153))
 61096  	}
 61097  	_ovflPgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+uintptr(_pInfo.XnSize)))))-uintptr(int32(4)))))
 61098  	func() {
 61099  		if _pBt.XusableSize <= uint32(4) {
 61100  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65156), unsafe.Pointer(&_clearCellØ00__func__Ø000), unsafe.Pointer(str(79651)))
 61101  			crt.X__builtin_abort(tls)
 61102  		}
 61103  	}()
 61104  	_ovflPageSize = _pBt.XusableSize - uint32(4)
 61105  	_nOvfl = int32((((_pInfo.XnPayload - uint32(_pInfo.XnLocal)) + _ovflPageSize) - uint32(1)) / _ovflPageSize)
 61106  	func() {
 61107  		if _nOvfl <= int32(0) && (_sqlite3Config.XneverCorrupt != int32(0) || (_pInfo.XnPayload+_ovflPageSize) >= _ovflPageSize) {
 61108  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65159), unsafe.Pointer(&_clearCellØ00__func__Ø000), unsafe.Pointer(str(79671)))
 61109  			crt.X__builtin_abort(tls)
 61110  		}
 61111  	}()
 61112  _10:
 61113  	if postInc2(&_nOvfl, -1) == 0 {
 61114  		goto _11
 61115  	}
 61116  	_3_iNext = 0
 61117  	_3_pOvfl = nil
 61118  	if (_ovflPgno < uint32(2)) || (_ovflPgno > _btreePagecount(tls, _pBt)) {
 61119  		return _sqlite3CorruptError(tls, int32(65169))
 61120  	}
 61121  	if _nOvfl == 0 {
 61122  		goto _14
 61123  	}
 61124  	_rc = _getOverflowPage(tls, _pBt, _ovflPgno, &_3_pOvfl, &_3_iNext)
 61125  	if _rc != 0 {
 61126  		return _rc
 61127  	}
 61128  _14:
 61129  	if ((_3_pOvfl != nil) || (store86(&_3_pOvfl, _btreePageLookup(tls, _pBt, _ovflPgno)) != nil)) && (_sqlite3PagerPageRefcount(tls, (*XPgHdr)(_3_pOvfl.XpDbPage)) != int32(1)) {
 61130  		_rc = _sqlite3CorruptError(tls, int32(65189))
 61131  		goto _19
 61132  	}
 61133  	_rc = _freePage2(tls, _pBt, _3_pOvfl, _ovflPgno)
 61134  _19:
 61135  	if _3_pOvfl != nil {
 61136  		_sqlite3PagerUnref(tls, (*XPgHdr)(_3_pOvfl.XpDbPage))
 61137  	}
 61138  	if _rc != 0 {
 61139  		return _rc
 61140  	}
 61141  	_ovflPgno = _3_iNext
 61142  	goto _10
 61143  _11:
 61144  	return int32(0)
 61145  }
 61146  
 61147  var _clearCellØ00__func__Ø000 [10]int8
 61148  
 61149  func init() {
 61150  	crt.Xstrncpy(nil, &_clearCellØ00__func__Ø000[0], str(79744), 10)
 61151  }
 61152  
 61153  // C comment
 61154  //  /*
 61155  //  ** Retrieve a page from the pager cache. If the requested page is not
 61156  //  ** already in the pager cache return NULL. Initialize the MemPage.pBt and
 61157  //  ** MemPage.aData elements if needed.
 61158  //  */
 61159  func _btreePageLookup(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 *XMemPage) {
 61160  	var _pDbPage *XPgHdr
 61161  	func() {
 61162  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 61163  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61038), unsafe.Pointer(&_btreePageLookupØ00__func__Ø000), unsafe.Pointer(str(9235)))
 61164  			crt.X__builtin_abort(tls)
 61165  		}
 61166  	}()
 61167  	_pDbPage = _sqlite3PagerLookup(tls, (*XPager)(_pBt.XpPager), _pgno)
 61168  	if _pDbPage != nil {
 61169  		return _btreePageFromDbPage(tls, _pDbPage, _pgno, _pBt)
 61170  	}
 61171  	return nil
 61172  }
 61173  
 61174  var _btreePageLookupØ00__func__Ø000 [16]int8
 61175  
 61176  func init() {
 61177  	crt.Xstrncpy(nil, &_btreePageLookupØ00__func__Ø000[0], str(79754), 16)
 61178  }
 61179  
 61180  // C comment
 61181  //  /*
 61182  //  ** This function is used to add page iPage to the database file free-list.
 61183  //  ** It is assumed that the page is not already a part of the free-list.
 61184  //  **
 61185  //  ** The value passed as the second argument to this function is optional.
 61186  //  ** If the caller happens to have a pointer to the MemPage object
 61187  //  ** corresponding to page iPage handy, it may pass it as the second value.
 61188  //  ** Otherwise, it may pass NULL.
 61189  //  **
 61190  //  ** If a pointer to a MemPage object is passed as the second argument,
 61191  //  ** its reference count is not altered by this function.
 61192  //  */
 61193  func _freePage2(tls *crt.TLS, _pBt *XBtShared, _pMemPage *XMemPage, _iPage uint32) (r0 int32) {
 61194  	var _rc, _nFree int32
 61195  	var _iTrunk, _6_nLeaf uint32
 61196  	var _pTrunk, _pPage1, _pPage *XMemPage
 61197  	_pTrunk = nil
 61198  	_iTrunk = uint32(0)
 61199  	_pPage1 = (*XMemPage)(_pBt.XpPage1)
 61200  	func() {
 61201  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 61202  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65005), unsafe.Pointer(&_freePage2Ø00__func__Ø000), unsafe.Pointer(str(9235)))
 61203  			crt.X__builtin_abort(tls)
 61204  		}
 61205  	}()
 61206  	func() {
 61207  		if _sqlite3Config.XneverCorrupt != int32(0) && _iPage <= uint32(1) {
 61208  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65006), unsafe.Pointer(&_freePage2Ø00__func__Ø000), unsafe.Pointer(str(79770)))
 61209  			crt.X__builtin_abort(tls)
 61210  		}
 61211  	}()
 61212  	func() {
 61213  		if _pMemPage != nil && _pMemPage.Xpgno != _iPage {
 61214  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65007), unsafe.Pointer(&_freePage2Ø00__func__Ø000), unsafe.Pointer(str(79792)))
 61215  			crt.X__builtin_abort(tls)
 61216  		}
 61217  	}()
 61218  	if _iPage < uint32(2) {
 61219  		return _sqlite3CorruptError(tls, int32(65009))
 61220  	}
 61221  	if _pMemPage != nil {
 61222  		_pPage = _pMemPage
 61223  		_sqlite3PagerRef(tls, (*XPgHdr)(_pPage.XpDbPage))
 61224  		goto _10
 61225  	}
 61226  	_pPage = _btreePageLookup(tls, _pBt, _iPage)
 61227  _10:
 61228  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage1.XpDbPage))
 61229  	if _rc != 0 {
 61230  		goto _freepage_out
 61231  	}
 61232  	_nFree = int32(_sqlite3Get4byte(tls, elem15(_pPage1.XaData, uintptr(36))))
 61233  	_sqlite3Put4byte(tls, elem15(_pPage1.XaData, uintptr(36)), uint32(_nFree+int32(1)))
 61234  	if (int32(_pBt.XbtsFlags) & int32(4)) == 0 {
 61235  		goto _12
 61236  	}
 61237  	if ((_pPage == nil) && (store2(&_rc, _btreeGetPage(tls, _pBt, _iPage, &_pPage, int32(0))) != int32(0))) || (store2(&_rc, _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))) != int32(0)) {
 61238  		goto _freepage_out
 61239  	}
 61240  	crt.Xmemset(tls, unsafe.Pointer(_pPage.XaData), int32(0), uint64((*XBtShared)(_pPage.XpBt).XpageSize))
 61241  _12:
 61242  	if _pBt.XautoVacuum == 0 {
 61243  		goto _16
 61244  	}
 61245  	_ptrmapPut(tls, _pBt, _iPage, uint8(2), 0, &_rc)
 61246  	if _rc != 0 {
 61247  		goto _freepage_out
 61248  	}
 61249  _16:
 61250  	if _nFree == int32(0) {
 61251  		goto _18
 61252  	}
 61253  	_iTrunk = _sqlite3Get4byte(tls, elem15(_pPage1.XaData, uintptr(32)))
 61254  	_rc = _btreeGetPage(tls, _pBt, _iTrunk, &_pTrunk, int32(0))
 61255  	if _rc != int32(0) {
 61256  		goto _freepage_out
 61257  	}
 61258  	_6_nLeaf = _sqlite3Get4byte(tls, elem15(_pTrunk.XaData, uintptr(4)))
 61259  	func() {
 61260  		if _pBt.XusableSize <= uint32(32) {
 61261  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65060), unsafe.Pointer(&_freePage2Ø00__func__Ø000), unsafe.Pointer(str(79827)))
 61262  			crt.X__builtin_abort(tls)
 61263  		}
 61264  	}()
 61265  	if _6_nLeaf > ((_pBt.XusableSize / uint32(4)) - uint32(2)) {
 61266  		_rc = _sqlite3CorruptError(tls, int32(65062))
 61267  		goto _freepage_out
 61268  	}
 61269  	if _6_nLeaf >= ((_pBt.XusableSize / uint32(4)) - uint32(8)) {
 61270  		goto _23
 61271  	}
 61272  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.XpDbPage))
 61273  	if _rc != int32(0) {
 61274  		goto _24
 61275  	}
 61276  	_sqlite3Put4byte(tls, elem15(_pTrunk.XaData, uintptr(4)), _6_nLeaf+uint32(1))
 61277  	_sqlite3Put4byte(tls, elem15(_pTrunk.XaData, uintptr(uint32(8)+(_6_nLeaf*uint32(4)))), _iPage)
 61278  	if (_pPage != nil) && ((int32(_pBt.XbtsFlags) & int32(4)) == int32(0)) {
 61279  		_sqlite3PagerDontWrite(tls, (*XPgHdr)(_pPage.XpDbPage))
 61280  	}
 61281  	_rc = _btreeSetHasContent(tls, _pBt, _iPage)
 61282  _24:
 61283  	goto _freepage_out
 61284  _23:
 61285  _18:
 61286  	if (_pPage == nil) && (int32(0) != store2(&_rc, _btreeGetPage(tls, _pBt, _iPage, &_pPage, int32(0)))) {
 61287  		goto _freepage_out
 61288  	}
 61289  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))
 61290  	if _rc != int32(0) {
 61291  		goto _freepage_out
 61292  	}
 61293  	_sqlite3Put4byte(tls, _pPage.XaData, _iTrunk)
 61294  	_sqlite3Put4byte(tls, elem15(_pPage.XaData, uintptr(4)), 0)
 61295  	_sqlite3Put4byte(tls, elem15(_pPage1.XaData, uintptr(32)), _iPage)
 61296  _freepage_out:
 61297  	if _pPage != nil {
 61298  		_pPage.XisInit = 0
 61299  	}
 61300  	_releasePage(tls, _pPage)
 61301  	_releasePage(tls, _pTrunk)
 61302  	return _rc
 61303  }
 61304  
 61305  var _freePage2Ø00__func__Ø000 [10]int8
 61306  
 61307  func init() {
 61308  	crt.Xstrncpy(nil, &_freePage2Ø00__func__Ø000[0], str(79846), 10)
 61309  }
 61310  
 61311  // C comment
 61312  //  /*
 61313  //  ** Increment the reference count for page pPg.
 61314  //  */
 61315  func _sqlite3PagerRef(tls *crt.TLS, _pPg *XPgHdr) {
 61316  	_sqlite3PcacheRef(tls, _pPg)
 61317  }
 61318  
 61319  // C comment
 61320  //  /*
 61321  //  ** Increase the reference count of a supplied page by 1.
 61322  //  */
 61323  func _sqlite3PcacheRef(tls *crt.TLS, _p *XPgHdr) {
 61324  	func() {
 61325  		if int32(_p.XnRef) <= int32(0) {
 61326  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44653), unsafe.Pointer(&_sqlite3PcacheRefØ00__func__Ø000), unsafe.Pointer(str(13812)))
 61327  			crt.X__builtin_abort(tls)
 61328  		}
 61329  	}()
 61330  	func() {
 61331  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 61332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44654), unsafe.Pointer(&_sqlite3PcacheRefØ00__func__Ø000), unsafe.Pointer(str(13822)))
 61333  			crt.X__builtin_abort(tls)
 61334  		}
 61335  	}()
 61336  	_p.XnRef += 1
 61337  	(*XPCache)(_p.XpCache).XnRefSum += 1
 61338  }
 61339  
 61340  var _sqlite3PcacheRefØ00__func__Ø000 [17]int8
 61341  
 61342  func init() {
 61343  	crt.Xstrncpy(nil, &_sqlite3PcacheRefØ00__func__Ø000[0], str(79856), 17)
 61344  }
 61345  
 61346  // C comment
 61347  //  /*
 61348  //  ** A call to this routine tells the pager that it is not necessary to
 61349  //  ** write the information on page pPg back to the disk, even though
 61350  //  ** that page might be marked as dirty.  This happens, for example, when
 61351  //  ** the page has been added as a leaf of the freelist and so its
 61352  //  ** content no longer matters.
 61353  //  **
 61354  //  ** The overlying software layer calls this routine when all of the data
 61355  //  ** on the given page is unused. The pager marks the page as clean so
 61356  //  ** that it does not get written to disk.
 61357  //  **
 61358  //  ** Tests show that this optimization can quadruple the speed of large
 61359  //  ** DELETE operations.
 61360  //  **
 61361  //  ** This optimization cannot be used with a temp-file, as the page may
 61362  //  ** have been dirty at the start of the transaction. In that case, if
 61363  //  ** memory pressure forces page pPg out of the cache, the data does need
 61364  //  ** to be written out to disk so that it may be read back in if the
 61365  //  ** current transaction is rolled back.
 61366  //  */
 61367  func _sqlite3PagerDontWrite(tls *crt.TLS, _pPg *XPgHdr) {
 61368  	var _pPager *XPager
 61369  	_pPager = (*XPager)(_pPg.XpPager)
 61370  	if ((_pPager.XtempFile == 0) && (int32(_pPg.Xflags)&int32(2)) != 0) && (_pPager.XnSavepoint == int32(0)) {
 61371  		{
 61372  			p := &_pPg.Xflags
 61373  			*p = uint16(int32(*p) | int32(16))
 61374  		}
 61375  		{
 61376  			p := &_pPg.Xflags
 61377  			*p = uint16(int32(*p) & int32(-5))
 61378  		}
 61379  	}
 61380  }
 61381  
 61382  // C comment
 61383  //  /*
 61384  //  ** Set bit pgno of the BtShared.pHasContent bitvec. This is called
 61385  //  ** when a page that previously contained data becomes a free-list leaf
 61386  //  ** page.
 61387  //  **
 61388  //  ** The BtShared.pHasContent bitvec exists to work around an obscure
 61389  //  ** bug caused by the interaction of two useful IO optimizations surrounding
 61390  //  ** free-list leaf pages:
 61391  //  **
 61392  //  **   1) When all data is deleted from a page and the page becomes
 61393  //  **      a free-list leaf page, the page is not written to the database
 61394  //  **      (as free-list leaf pages contain no meaningful data). Sometimes
 61395  //  **      such a page is not even journalled (as it will not be modified,
 61396  //  **      why bother journalling it?).
 61397  //  **
 61398  //  **   2) When a free-list leaf page is reused, its content is not read
 61399  //  **      from the database or written to the journal file (why should it
 61400  //  **      be, if it is not at all meaningful?).
 61401  //  **
 61402  //  ** By themselves, these optimizations work fine and provide a handy
 61403  //  ** performance boost to bulk delete or insert operations. However, if
 61404  //  ** a page is moved to the free-list and then reused within the same
 61405  //  ** transaction, a problem comes up. If the page is not journalled when
 61406  //  ** it is moved to the free-list and it is also not journalled when it
 61407  //  ** is extracted from the free-list and reused, then the original data
 61408  //  ** may be lost. In the event of a rollback, it may not be possible
 61409  //  ** to restore the database to its original configuration.
 61410  //  **
 61411  //  ** The solution is the BtShared.pHasContent bitvec. Whenever a page is
 61412  //  ** moved to become a free-list leaf page, the corresponding bit is
 61413  //  ** set in the bitvec. Whenever a leaf page is extracted from the free-list,
 61414  //  ** optimization 2 above is omitted if the corresponding bit is already
 61415  //  ** set in BtShared.pHasContent. The contents of the bitvec are cleared
 61416  //  ** at the end of every transaction.
 61417  //  */
 61418  func _btreeSetHasContent(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 int32) {
 61419  	var _rc int32
 61420  	_rc = int32(0)
 61421  	if _pBt.XpHasContent != nil {
 61422  		goto _0
 61423  	}
 61424  	func() {
 61425  		if _pgno > _pBt.XnPage {
 61426  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59597), unsafe.Pointer(&_btreeSetHasContentØ00__func__Ø000), unsafe.Pointer(str(79873)))
 61427  			crt.X__builtin_abort(tls)
 61428  		}
 61429  	}()
 61430  	*(**XBitvec)(unsafe.Pointer(&_pBt.XpHasContent)) = _sqlite3BitvecCreate(tls, _pBt.XnPage)
 61431  	if _pBt.XpHasContent == nil {
 61432  		_rc = _sqlite3NomemError(tls, int32(59600))
 61433  	}
 61434  _0:
 61435  	if (_rc == int32(0)) && (_pgno <= _sqlite3BitvecSize(tls, (*XBitvec)(_pBt.XpHasContent))) {
 61436  		_rc = _sqlite3BitvecSet(tls, (*XBitvec)(_pBt.XpHasContent), _pgno)
 61437  	}
 61438  	return _rc
 61439  }
 61440  
 61441  var _btreeSetHasContentØ00__func__Ø000 [19]int8
 61442  
 61443  func init() {
 61444  	crt.Xstrncpy(nil, &_btreeSetHasContentØ00__func__Ø000[0], str(79890), 19)
 61445  }
 61446  
 61447  // C comment
 61448  //  /*
 61449  //  ** Remove the i-th cell from pPage.  This routine effects pPage only.
 61450  //  ** The cell content is not freed or deallocated.  It is assumed that
 61451  //  ** the cell content has been copied someplace else.  This routine just
 61452  //  ** removes the reference to the cell from pPage.
 61453  //  **
 61454  //  ** "sz" must be the number of bytes in the cell.
 61455  //  */
 61456  func _dropCell(tls *crt.TLS, _pPage *XMemPage, _idx int32, _sz int32, _pRC *int32) {
 61457  	var _rc, _hdr int32
 61458  	var _pc uint32
 61459  	var _data, _ptr *uint8
 61460  	if (*_pRC) != 0 {
 61461  		return
 61462  	}
 61463  	func() {
 61464  		if _idx < int32(0) || _idx >= int32(_pPage.XnCell) {
 61465  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65400), unsafe.Pointer(&_dropCellØ00__func__Ø000), unsafe.Pointer(str(79909)))
 61466  			crt.X__builtin_abort(tls)
 61467  		}
 61468  	}()
 61469  	func() {
 61470  		if _sqlite3Config.XneverCorrupt != int32(0) && _sz != int32(_cellSize(tls, _pPage, _idx)) {
 61471  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65401), unsafe.Pointer(&_dropCellØ00__func__Ø000), unsafe.Pointer(str(79936)))
 61472  			crt.X__builtin_abort(tls)
 61473  		}
 61474  	}()
 61475  	func() {
 61476  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 61477  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65402), unsafe.Pointer(&_dropCellØ00__func__Ø000), unsafe.Pointer(str(53310)))
 61478  			crt.X__builtin_abort(tls)
 61479  		}
 61480  	}()
 61481  	func() {
 61482  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 61483  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65403), unsafe.Pointer(&_dropCellØ00__func__Ø000), unsafe.Pointer(str(20394)))
 61484  			crt.X__builtin_abort(tls)
 61485  		}
 61486  	}()
 61487  	_data = _pPage.XaData
 61488  	_ptr = elem15(_pPage.XaCellIdx, uintptr(int32(2)*_idx))
 61489  	_pc = uint32((int32(*elem15(_ptr, 0)) << 8) | int32(*elem15(_ptr, uintptr(1))))
 61490  	_hdr = int32(_pPage.XhdrOffset)
 61491  	if (_pc < uint32((int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0))<<8)|int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), uintptr(1))))) || ((_pc + uint32(_sz)) > ((*XBtShared)(_pPage.XpBt).XusableSize)) {
 61492  		*_pRC = _sqlite3CorruptError(tls, int32(65411))
 61493  		return
 61494  	}
 61495  	_rc = _freeSpace(tls, _pPage, uint16(_pc), uint16(_sz))
 61496  	if _rc != 0 {
 61497  		*_pRC = _rc
 61498  		return
 61499  	}
 61500  	_pPage.XnCell -= 1
 61501  	if int32(_pPage.XnCell) == int32(0) {
 61502  		crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(_hdr+int32(1)))), int32(0), uint64(4))
 61503  		*elem15(_data, uintptr(_hdr+int32(7))) = 0
 61504  		*elem15(elem15(func() *uint8 {
 61505  			*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0) = uint8(((*XBtShared)(_pPage.XpBt).XusableSize) >> 8)
 61506  			return _data
 61507  		}(), uintptr(_hdr+int32(5))), uintptr(1)) = uint8((*XBtShared)(_pPage.XpBt).XusableSize)
 61508  		_pPage.XnFree = uint16(((((*XBtShared)(_pPage.XpBt).XusableSize) - uint32(_pPage.XhdrOffset)) - uint32(_pPage.XchildPtrSize)) - uint32(8))
 61509  		goto _15
 61510  	}
 61511  	crt.Xmemmove(tls, unsafe.Pointer(_ptr), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_ptr))+uintptr(int32(2))))), uint64(int32(2)*(int32(_pPage.XnCell)-_idx)))
 61512  	*elem15(elem15(func() *uint8 {
 61513  		*elem15(elem15(_data, uintptr(_hdr+int32(3))), 0) = uint8(int32(_pPage.XnCell) >> 8)
 61514  		return _data
 61515  	}(), uintptr(_hdr+int32(3))), uintptr(1)) = uint8(_pPage.XnCell)
 61516  	{
 61517  		p := &_pPage.XnFree
 61518  		*p = uint16(int32(*p) + int32(2))
 61519  	}
 61520  _15:
 61521  }
 61522  
 61523  var _dropCellØ00__func__Ø000 [9]int8
 61524  
 61525  func init() {
 61526  	crt.Xstrncpy(nil, &_dropCellØ00__func__Ø000[0], str(79975), 9)
 61527  }
 61528  
 61529  // C comment
 61530  //  /* This variation on cellSizePtr() is used inside of assert() statements
 61531  //  ** only. */
 61532  func _cellSize(tls *crt.TLS, _pPage *XMemPage, _iCell int32) (r0 uint16) {
 61533  	return func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 61534  		v := _pPage.XxCellSize
 61535  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 61536  	}()(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData))+uintptr(int32(_pPage.XmaskPage)&((int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_iCell)), 0))<<8)|int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_iCell)), uintptr(1))))))))
 61537  }
 61538  
 61539  // C comment
 61540  //  /*
 61541  //  ** Return a section of the pPage->aData to the freelist.
 61542  //  ** The first byte of the new free block is pPage->aData[iStart]
 61543  //  ** and the size of the block is iSize bytes.
 61544  //  **
 61545  //  ** Adjacent freeblocks are coalesced.
 61546  //  **
 61547  //  ** Note that even though the freeblock list was checked by btreeInitPage(),
 61548  //  ** that routine will not detect overlap between cells or freeblocks.  Nor
 61549  //  ** does it detect cells or freeblocks that encrouch into the reserved bytes
 61550  //  ** at the end of the page.  So do additional corruption checks inside this
 61551  //  ** routine and return SQLITE_CORRUPT if any problems are found.
 61552  //  */
 61553  func _freeSpace(tls *crt.TLS, _pPage *XMemPage, _iStart uint16, _iSize uint16) (r0 int32) {
 61554  	var _7_iPtrEnd int32
 61555  	var _iLast, _iEnd uint32
 61556  	var _iPtr, _iFreeBlk, _iOrigSize uint16
 61557  	var _hdr, _nFrag uint8
 61558  	var _data *uint8
 61559  	_nFrag = uint8(0)
 61560  	_iOrigSize = _iSize
 61561  	_iLast = ((*XBtShared)(_pPage.XpBt).XusableSize) - uint32(4)
 61562  	_iEnd = uint32(int32(_iStart) + int32(_iSize))
 61563  	_data = _pPage.XaData
 61564  	func() {
 61565  		if (*XBtShared)(_pPage.XpBt) == nil {
 61566  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60667), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(55336)))
 61567  			crt.X__builtin_abort(tls)
 61568  		}
 61569  	}()
 61570  	func() {
 61571  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 61572  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60668), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(53310)))
 61573  			crt.X__builtin_abort(tls)
 61574  		}
 61575  	}()
 61576  	func() {
 61577  		if _sqlite3Config.XneverCorrupt != int32(0) && int32(_iStart) < ((int32(_pPage.XhdrOffset)+int32(6))+int32(_pPage.XchildPtrSize)) {
 61578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60669), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(79984)))
 61579  			crt.X__builtin_abort(tls)
 61580  		}
 61581  	}()
 61582  	func() {
 61583  		if _sqlite3Config.XneverCorrupt != int32(0) && _iEnd > ((*XBtShared)(_pPage.XpBt).XusableSize) {
 61584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60670), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(80045)))
 61585  			crt.X__builtin_abort(tls)
 61586  		}
 61587  	}()
 61588  	func() {
 61589  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 61590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60671), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(20394)))
 61591  			crt.X__builtin_abort(tls)
 61592  		}
 61593  	}()
 61594  	func() {
 61595  		if int32(_iSize) < int32(4) {
 61596  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60672), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(80090)))
 61597  			crt.X__builtin_abort(tls)
 61598  		}
 61599  	}()
 61600  	func() {
 61601  		if uint32(_iStart) > _iLast {
 61602  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60673), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(80099)))
 61603  			crt.X__builtin_abort(tls)
 61604  		}
 61605  	}()
 61606  	if (int32((*XBtShared)(_pPage.XpBt).XbtsFlags) & int32(4)) != 0 {
 61607  		crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(_iStart))), int32(0), uint64(_iSize))
 61608  	}
 61609  	_hdr = _pPage.XhdrOffset
 61610  	_iPtr = uint16(int32(_hdr) + int32(1))
 61611  	if (int32(*elem15(_data, uintptr(int32(_iPtr)+int32(1)))) == int32(0)) && (int32(*elem15(_data, uintptr(_iPtr))) == int32(0)) {
 61612  		_iFreeBlk = 0
 61613  		goto _19
 61614  	}
 61615  _20:
 61616  	if int32(store78(&_iFreeBlk, uint16((int32(*elem15(elem15(_data, uintptr(_iPtr)), 0))<<8)|int32(*elem15(elem15(_data, uintptr(_iPtr)), uintptr(1)))))) >= int32(_iStart) {
 61617  		goto _21
 61618  	}
 61619  	if int32(_iFreeBlk) >= (int32(_iPtr) + int32(4)) {
 61620  		goto _22
 61621  	}
 61622  	if int32(_iFreeBlk) == int32(0) {
 61623  		goto _21
 61624  	}
 61625  	return _sqlite3CorruptError(tls, int32(60692))
 61626  
 61627  _22:
 61628  	_iPtr = _iFreeBlk
 61629  	goto _20
 61630  _21:
 61631  	if uint32(_iFreeBlk) > _iLast {
 61632  		return _sqlite3CorruptError(tls, int32(60696))
 61633  	}
 61634  	func() {
 61635  		if int32(_iFreeBlk) <= int32(_iPtr) && int32(_iFreeBlk) != int32(0) {
 61636  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60697), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(80113)))
 61637  			crt.X__builtin_abort(tls)
 61638  		}
 61639  	}()
 61640  	if _iFreeBlk == 0 || (_iEnd+uint32(3)) < uint32(_iFreeBlk) {
 61641  		goto _29
 61642  	}
 61643  	_nFrag = uint8(uint32(_iFreeBlk) - _iEnd)
 61644  	if _iEnd > uint32(_iFreeBlk) {
 61645  		return _sqlite3CorruptError(tls, int32(60707))
 61646  	}
 61647  	_iEnd = uint32(int32(_iFreeBlk) + ((int32(*elem15(elem15(_data, uintptr(int32(_iFreeBlk)+int32(2))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(int32(_iFreeBlk)+int32(2))), uintptr(1)))))
 61648  	if _iEnd > ((*XBtShared)(_pPage.XpBt).XusableSize) {
 61649  		return _sqlite3CorruptError(tls, int32(60709))
 61650  	}
 61651  	_iSize = uint16(_iEnd - uint32(_iStart))
 61652  	_iFreeBlk = uint16((int32(*elem15(elem15(_data, uintptr(_iFreeBlk)), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_iFreeBlk)), uintptr(1))))
 61653  _29:
 61654  	if int32(_iPtr) <= (int32(_hdr) + int32(1)) {
 61655  		goto _32
 61656  	}
 61657  	_7_iPtrEnd = int32(_iPtr) + ((int32(*elem15(elem15(_data, uintptr(int32(_iPtr)+int32(2))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(int32(_iPtr)+int32(2))), uintptr(1))))
 61658  	if (_7_iPtrEnd + int32(3)) < int32(_iStart) {
 61659  		goto _33
 61660  	}
 61661  	if _7_iPtrEnd > int32(_iStart) {
 61662  		return _sqlite3CorruptError(tls, int32(60721))
 61663  	}
 61664  	{
 61665  		p := &_nFrag
 61666  		*p = uint8(int32(*p) + (int32(_iStart) - _7_iPtrEnd))
 61667  	}
 61668  	_iSize = uint16(_iEnd - uint32(_iPtr))
 61669  	_iStart = _iPtr
 61670  _33:
 61671  _32:
 61672  	if int32(_nFrag) > int32(*elem15(_data, uintptr(int32(_hdr)+int32(7)))) {
 61673  		return _sqlite3CorruptError(tls, int32(60727))
 61674  	}
 61675  	{
 61676  		p := elem15(_data, uintptr(int32(_hdr)+int32(7)))
 61677  		*p = uint8(int32(*p) - int32(_nFrag))
 61678  	}
 61679  _19:
 61680  	if int32(_iStart) != ((int32(*elem15(elem15(_data, uintptr(int32(_hdr)+int32(5))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(int32(_hdr)+int32(5))), uintptr(1)))) {
 61681  		goto _36
 61682  	}
 61683  	if int32(_iPtr) != (int32(_hdr) + int32(1)) {
 61684  		return _sqlite3CorruptError(tls, int32(60734))
 61685  	}
 61686  	*elem15(elem15(func() *uint8 {
 61687  		*elem15(elem15(_data, uintptr(int32(_hdr)+int32(1))), 0) = uint8(int32(_iFreeBlk) >> 8)
 61688  		return _data
 61689  	}(), uintptr(int32(_hdr)+int32(1))), uintptr(1)) = uint8(_iFreeBlk)
 61690  	*elem15(elem15(func() *uint8 {
 61691  		*elem15(elem15(_data, uintptr(int32(_hdr)+int32(5))), 0) = uint8(_iEnd >> 8)
 61692  		return _data
 61693  	}(), uintptr(int32(_hdr)+int32(5))), uintptr(1)) = uint8(_iEnd)
 61694  	goto _38
 61695  _36:
 61696  	*elem15(elem15(func() *uint8 { *elem15(elem15(_data, uintptr(_iPtr)), 0) = uint8(int32(_iStart) >> 8); return _data }(), uintptr(_iPtr)), uintptr(1)) = uint8(_iStart)
 61697  	*elem15(elem15(func() *uint8 {
 61698  		*elem15(elem15(_data, uintptr(_iStart)), 0) = uint8(int32(_iFreeBlk) >> 8)
 61699  		return _data
 61700  	}(), uintptr(_iStart)), uintptr(1)) = uint8(_iFreeBlk)
 61701  	*elem15(elem15(func() *uint8 {
 61702  		*elem15(elem15(_data, uintptr(int32(_iStart)+int32(2))), 0) = uint8(int32(_iSize) >> 8)
 61703  		return _data
 61704  	}(), uintptr(int32(_iStart)+int32(2))), uintptr(1)) = uint8(_iSize)
 61705  _38:
 61706  	{
 61707  		p := &_pPage.XnFree
 61708  		*p = uint16(int32(*p) + int32(_iOrigSize))
 61709  	}
 61710  	return int32(0)
 61711  }
 61712  
 61713  var _freeSpaceØ00__func__Ø000 [10]int8
 61714  
 61715  func init() {
 61716  	crt.Xstrncpy(nil, &_freeSpaceØ00__func__Ø000[0], str(80142), 10)
 61717  }
 61718  
 61719  // C comment
 61720  //  /*
 61721  //  ** Insert a new cell on pPage at cell index "i".  pCell points to the
 61722  //  ** content of the cell.
 61723  //  **
 61724  //  ** If the cell content will fit on the page, then put it there.  If it
 61725  //  ** will not fit, then make a copy of the cell content into pTemp if
 61726  //  ** pTemp is not null.  Regardless of pTemp, allocate a new entry
 61727  //  ** in pPage->apOvfl[] and make it point to the cell content (either
 61728  //  ** in pTemp or the original pCell) and also record its index.
 61729  //  ** Allocating a new entry in pPage->aCell[] implies that
 61730  //  ** pPage->nOverflow is incremented.
 61731  //  **
 61732  //  ** *pRC must be SQLITE_OK when this routine is called.
 61733  //  */
 61734  func _insertCell(tls *crt.TLS, _pPage *XMemPage, _i int32, _pCell *uint8, _sz int32, _pTemp *uint8, _iChild uint32, _pRC *int32) {
 61735  	var _idx, _j, _4_rc int32
 61736  	var _data, _pIns *uint8
 61737  	_idx = int32(0)
 61738  	func() {
 61739  		if (*_pRC) != int32(0) {
 61740  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65461), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80152)))
 61741  			crt.X__builtin_abort(tls)
 61742  		}
 61743  	}()
 61744  	func() {
 61745  		if _i < int32(0) || _i > (int32(_pPage.XnCell)+int32(_pPage.XnOverflow)) {
 61746  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65462), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80168)))
 61747  			crt.X__builtin_abort(tls)
 61748  		}
 61749  	}()
 61750  	func() {
 61751  		if ((((*XBtShared)(_pPage.XpBt).XpageSize) - uint32(8)) / uint32(6)) > uint32(10921) {
 61752  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65463), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80209)))
 61753  			crt.X__builtin_abort(tls)
 61754  		}
 61755  	}()
 61756  	func() {
 61757  		if uint32(_pPage.XnCell) > ((((*XBtShared)(_pPage.XpBt).XpageSize)-uint32(8))/uint32(6)) && _sqlite3Config.XneverCorrupt != int32(0) {
 61758  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65464), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80236)))
 61759  			crt.X__builtin_abort(tls)
 61760  		}
 61761  	}()
 61762  	func() {
 61763  		if int32(_pPage.XnOverflow) > int32(4) {
 61764  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65465), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80284)))
 61765  			crt.X__builtin_abort(tls)
 61766  		}
 61767  	}()
 61768  
 61769  	func() {
 61770  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 61771  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65467), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(20394)))
 61772  			crt.X__builtin_abort(tls)
 61773  		}
 61774  	}()
 61775  	func() {
 61776  		if _sz != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 61777  			v := _pPage.XxCellSize
 61778  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 61779  		}()(tls, _pPage, _pCell)) && (_sz != int32(8) || _iChild <= (0)) {
 61780  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65473), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80327)))
 61781  			crt.X__builtin_abort(tls)
 61782  		}
 61783  	}()
 61784  	if _pPage.XnOverflow == 0 && (_sz+int32(2)) <= int32(_pPage.XnFree) {
 61785  		goto _19
 61786  	}
 61787  	if _pTemp != nil {
 61788  		crt.Xmemcpy(tls, unsafe.Pointer(_pTemp), unsafe.Pointer(_pCell), uint64(_sz))
 61789  		_pCell = _pTemp
 61790  	}
 61791  	if _iChild != 0 {
 61792  		_sqlite3Put4byte(tls, _pCell, _iChild)
 61793  	}
 61794  	_j = int32(postInc3(&_pPage.XnOverflow, byte(1)))
 61795  	func() {
 61796  		if _j >= int32(3) {
 61797  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65486), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80385)))
 61798  			crt.X__builtin_abort(tls)
 61799  		}
 61800  	}()
 61801  	*elem89((**uint8)(unsafe.Pointer(&_pPage.XapOvfl)), uintptr(_j)) = _pCell
 61802  	*elem20((*uint16)(unsafe.Pointer(&_pPage.XaiOvfl)), uintptr(_j)) = uint16(_i)
 61803  	func() {
 61804  		if _j != int32(0) && int32(*elem20((*uint16)(unsafe.Pointer(&_pPage.XaiOvfl)), uintptr(_j-int32(1)))) >= int32(uint16(_i)) {
 61805  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65495), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80416)))
 61806  			crt.X__builtin_abort(tls)
 61807  		}
 61808  	}()
 61809  	func() {
 61810  		if _j != int32(0) && _i != (int32(*elem20((*uint16)(unsafe.Pointer(&_pPage.XaiOvfl)), uintptr(_j-int32(1))))+int32(1)) {
 61811  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65496), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80450)))
 61812  			crt.X__builtin_abort(tls)
 61813  		}
 61814  	}()
 61815  	goto _30
 61816  _19:
 61817  	_4_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))
 61818  	if _4_rc != int32(0) {
 61819  		*_pRC = _4_rc
 61820  		return
 61821  	}
 61822  	func() {
 61823  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 61824  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65503), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(53310)))
 61825  			crt.X__builtin_abort(tls)
 61826  		}
 61827  	}()
 61828  	_data = _pPage.XaData
 61829  	func() {
 61830  		if elem15(_data, uintptr(_pPage.XcellOffset)) != _pPage.XaCellIdx {
 61831  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65505), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80482)))
 61832  			crt.X__builtin_abort(tls)
 61833  		}
 61834  	}()
 61835  	_4_rc = _allocateSpace(tls, _pPage, _sz, &_idx)
 61836  	if _4_rc != 0 {
 61837  		*_pRC = _4_rc
 61838  		return
 61839  	}
 61840  	func() {
 61841  		if _idx < int32(0) {
 61842  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65510), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80524)))
 61843  			crt.X__builtin_abort(tls)
 61844  		}
 61845  	}()
 61846  	func() {
 61847  		if _idx < ((int32(_pPage.XcellOffset)+(int32(2)*int32(_pPage.XnCell)))+int32(2)) && _sqlite3Config.XneverCorrupt != int32(0) {
 61848  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65511), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80533)))
 61849  			crt.X__builtin_abort(tls)
 61850  		}
 61851  	}()
 61852  	func() {
 61853  		if (_idx + _sz) > int32((*XBtShared)(_pPage.XpBt).XusableSize) {
 61854  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65512), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80589)))
 61855  			crt.X__builtin_abort(tls)
 61856  		}
 61857  	}()
 61858  	{
 61859  		p := &_pPage.XnFree
 61860  		*p = uint16(int32(*p) - int32(uint16(int32(2)+_sz)))
 61861  	}
 61862  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_data, uintptr(_idx))), unsafe.Pointer(_pCell), uint64(_sz))
 61863  	if _iChild != 0 {
 61864  		_sqlite3Put4byte(tls, elem15(_data, uintptr(_idx)), _iChild)
 61865  	}
 61866  	_pIns = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaCellIdx)) + uintptr(_i*int32(2))))
 61867  	crt.Xmemmove(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIns))+uintptr(int32(2))))), unsafe.Pointer(_pIns), uint64(int32(2)*(int32(_pPage.XnCell)-_i)))
 61868  	*elem15(func() *uint8 { *elem15(_pIns, 0) = uint8(_idx >> 8); return _pIns }(), uintptr(1)) = uint8(_idx)
 61869  	_pPage.XnCell += 1
 61870  	if int32(preInc3(elem15(_data, uintptr(int32(_pPage.XhdrOffset)+int32(4))), byte(1))) == int32(0) {
 61871  		*elem15(_data, uintptr(int32(_pPage.XhdrOffset)+int32(3))) += 1
 61872  	}
 61873  	func() {
 61874  		if ((int32(*elem15(elem15(_data, uintptr(int32(_pPage.XhdrOffset)+int32(3))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(int32(_pPage.XhdrOffset)+int32(3))), uintptr(1)))) != int32(_pPage.XnCell) {
 61875  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65524), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80627)))
 61876  			crt.X__builtin_abort(tls)
 61877  		}
 61878  	}()
 61879  	if ((*XBtShared)(_pPage.XpBt).XautoVacuum) != 0 {
 61880  		_ptrmapPutOvflPtr(tls, _pPage, _pCell, _pRC)
 61881  	}
 61882  _30:
 61883  }
 61884  
 61885  var _insertCellØ00__func__Ø000 [11]int8
 61886  
 61887  func init() {
 61888  	crt.Xstrncpy(nil, &_insertCellØ00__func__Ø000[0], str(80677), 11)
 61889  }
 61890  
 61891  // C comment
 61892  //  /*
 61893  //  ** Allocate nByte bytes of space from within the B-Tree page passed
 61894  //  ** as the first argument. Write into *pIdx the index into pPage->aData[]
 61895  //  ** of the first byte of allocated space. Return either SQLITE_OK or
 61896  //  ** an error code (usually SQLITE_CORRUPT).
 61897  //  **
 61898  //  ** The caller guarantees that there is sufficient space to make the
 61899  //  ** allocation.  This routine might need to defragment in order to bring
 61900  //  ** all the space together, however.  This routine will avoid using
 61901  //  ** the first two bytes past the cell pointer area since presumably this
 61902  //  ** allocation is being made in order to insert a new cell, so we will
 61903  //  ** also end up needing a new cell pointer.
 61904  //  */
 61905  func _allocateSpace(tls *crt.TLS, _pPage *XMemPage, _nByte int32, _pIdx *int32) (r0 int32) {
 61906  	var _hdr, _top, _rc, _gap int32
 61907  	var _data, _4_pSpace *uint8
 61908  	_hdr = int32(_pPage.XhdrOffset)
 61909  	_data = _pPage.XaData
 61910  	_rc = int32(0)
 61911  	func() {
 61912  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 61913  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60574), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(53310)))
 61914  			crt.X__builtin_abort(tls)
 61915  		}
 61916  	}()
 61917  	func() {
 61918  		if _pPage.XpBt == nil {
 61919  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60575), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(20262)))
 61920  			crt.X__builtin_abort(tls)
 61921  		}
 61922  	}()
 61923  	func() {
 61924  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 61925  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60576), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(20394)))
 61926  			crt.X__builtin_abort(tls)
 61927  		}
 61928  	}()
 61929  	func() {
 61930  		if _nByte < int32(0) {
 61931  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60577), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80688)))
 61932  			crt.X__builtin_abort(tls)
 61933  		}
 61934  	}()
 61935  	func() {
 61936  		if int32(_pPage.XnFree) < _nByte {
 61937  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60578), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80697)))
 61938  			crt.X__builtin_abort(tls)
 61939  		}
 61940  	}()
 61941  	func() {
 61942  		if int32(_pPage.XnOverflow) != int32(0) {
 61943  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60579), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80717)))
 61944  			crt.X__builtin_abort(tls)
 61945  		}
 61946  	}()
 61947  	func() {
 61948  		if _nByte >= int32(((*XBtShared)(_pPage.XpBt).XusableSize)-uint32(8)) {
 61949  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60580), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80737)))
 61950  			crt.X__builtin_abort(tls)
 61951  		}
 61952  	}()
 61953  	func() {
 61954  		if int32(_pPage.XcellOffset) != ((_hdr + int32(12)) - (int32(4) * int32(_pPage.Xleaf))) {
 61955  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60582), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80777)))
 61956  			crt.X__builtin_abort(tls)
 61957  		}
 61958  	}()
 61959  	_gap = int32(_pPage.XcellOffset) + (int32(2) * int32(_pPage.XnCell))
 61960  	func() {
 61961  		if _gap > int32(65536) {
 61962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60584), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80823)))
 61963  			crt.X__builtin_abort(tls)
 61964  		}
 61965  	}()
 61966  	_top = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), uintptr(1)))
 61967  	func() {
 61968  		if _top > int32((*XBtShared)(_pPage.XpBt).XusableSize) {
 61969  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60591), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80834)))
 61970  			crt.X__builtin_abort(tls)
 61971  		}
 61972  	}()
 61973  	if _gap <= _top {
 61974  		goto _20
 61975  	}
 61976  	if (_top == int32(0)) && (((*XBtShared)(_pPage.XpBt).XusableSize) == uint32(65536)) {
 61977  		_top = int32(65536)
 61978  		goto _23
 61979  	}
 61980  	return _sqlite3CorruptError(tls, int32(60596))
 61981  
 61982  _23:
 61983  _20:
 61984  	if (*elem15(_data, uintptr(_hdr+int32(2)))) == 0 && (*elem15(_data, uintptr(_hdr+int32(1)))) == 0 || (_gap+int32(2)) > _top {
 61985  		goto _26
 61986  	}
 61987  	_4_pSpace = _pageFindSlot(tls, _pPage, _nByte, &_rc)
 61988  	if _4_pSpace != nil {
 61989  		func() {
 61990  			if crt.P2U(unsafe.Pointer(_4_pSpace)) < crt.P2U(unsafe.Pointer(_data)) || int64(uintptr(unsafe.Pointer(_4_pSpace))-uintptr(unsafe.Pointer(_data))) >= int64(65536) {
 61991  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60610), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80867)))
 61992  				crt.X__builtin_abort(tls)
 61993  			}
 61994  		}()
 61995  		*_pIdx = int32(int64(uintptr(unsafe.Pointer(_4_pSpace)) - uintptr(unsafe.Pointer(_data))))
 61996  		return int32(0)
 61997  	}
 61998  	if _rc != 0 {
 61999  		return _rc
 62000  	}
 62001  _26:
 62002  	if ((_gap + int32(2)) + _nByte) <= _top {
 62003  		goto _33
 62004  	}
 62005  	func() {
 62006  		if int32(_pPage.XnCell) <= int32(0) && _sqlite3Config.XneverCorrupt != int32(0) {
 62007  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60623), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80905)))
 62008  			crt.X__builtin_abort(tls)
 62009  		}
 62010  	}()
 62011  	_rc = _defragmentPage(tls, _pPage, func() int32 {
 62012  		if int32(4) < (int32(_pPage.XnFree) - (int32(2) + _nByte)) {
 62013  			return int32(4)
 62014  		}
 62015  		return (int32(_pPage.XnFree) - (int32(2) + _nByte))
 62016  	}())
 62017  	if _rc != 0 {
 62018  		return _rc
 62019  	}
 62020  	_top = ((((int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), uintptr(1)))) - int32(1)) & int32(65535)) + int32(1)
 62021  	func() {
 62022  		if ((_gap + int32(2)) + _nByte) > _top {
 62023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60627), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80934)))
 62024  			crt.X__builtin_abort(tls)
 62025  		}
 62026  	}()
 62027  _33:
 62028  	_top -= _nByte
 62029  	*elem15(elem15(func() *uint8 { *elem15(elem15(_data, uintptr(_hdr+int32(5))), 0) = uint8(_top >> 8); return _data }(), uintptr(_hdr+int32(5))), uintptr(1)) = uint8(_top)
 62030  	func() {
 62031  		if (_top + _nByte) > int32((*XBtShared)(_pPage.XpBt).XusableSize) {
 62032  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60639), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80951)))
 62033  			crt.X__builtin_abort(tls)
 62034  		}
 62035  	}()
 62036  	*_pIdx = _top
 62037  	return int32(0)
 62038  }
 62039  
 62040  var _allocateSpaceØ00__func__Ø000 [14]int8
 62041  
 62042  func init() {
 62043  	crt.Xstrncpy(nil, &_allocateSpaceØ00__func__Ø000[0], str(80992), 14)
 62044  }
 62045  
 62046  // C comment
 62047  //  /*
 62048  //  ** Search the free-list on page pPg for space to store a cell nByte bytes in
 62049  //  ** size. If one can be found, return a pointer to the space and remove it
 62050  //  ** from the free-list.
 62051  //  **
 62052  //  ** If no suitable space can be found on the free-list, return NULL.
 62053  //  **
 62054  //  ** This function may detect corruption within pPg.  If corruption is
 62055  //  ** detected then *pRc is set to SQLITE_CORRUPT and NULL is returned.
 62056  //  **
 62057  //  ** Slots on the free list that are between 1 and 3 bytes larger than nByte
 62058  //  ** will be ignored if adding the extra space to the fragmentation count
 62059  //  ** causes the fragmentation count to exceed 60.
 62060  //  */
 62061  func _pageFindSlot(tls *crt.TLS, _pPg *XMemPage, _nByte int32, _pRc *int32) (r0 *uint8) {
 62062  	var _hdr, _iAddr, _pc, _x, _usableSize, _1_size int32
 62063  	var _aData *uint8
 62064  	_hdr = int32(_pPg.XhdrOffset)
 62065  	_aData = _pPg.XaData
 62066  	_iAddr = _hdr + int32(1)
 62067  	_pc = (int32(*elem15(elem15(_aData, uintptr(_iAddr)), 0)) << 8) | int32(*elem15(elem15(_aData, uintptr(_iAddr)), uintptr(1)))
 62068  	_usableSize = int32((*XBtShared)(_pPg.XpBt).XusableSize)
 62069  	func() {
 62070  		if _pc <= int32(0) {
 62071  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60512), unsafe.Pointer(&_pageFindSlotØ00__func__Ø000), unsafe.Pointer(str(81006)))
 62072  			crt.X__builtin_abort(tls)
 62073  		}
 62074  	}()
 62075  _2:
 62076  	if (_pc > (_usableSize - int32(4))) || (_pc < (_iAddr + int32(4))) {
 62077  		*_pRc = _sqlite3CorruptError(tls, int32(60518))
 62078  		return nil
 62079  	}
 62080  	_1_size = (int32(*elem15(elem15(_aData, uintptr(_pc+int32(2))), 0)) << 8) | int32(*elem15(elem15(_aData, uintptr(_pc+int32(2))), uintptr(1)))
 62081  	if store2(&_x, _1_size-_nByte) < int32(0) {
 62082  		goto _5
 62083  	}
 62084  	if (_pc < (int32(_pPg.XcellOffset) + (int32(2) * int32(_pPg.XnCell)))) || ((_1_size + _pc) > _usableSize) {
 62085  		*_pRc = _sqlite3CorruptError(tls, int32(60529))
 62086  		return nil
 62087  	}
 62088  	if _x >= int32(4) {
 62089  		goto _9
 62090  	}
 62091  	if int32(*elem15(_aData, uintptr(_hdr+int32(7)))) > int32(57) {
 62092  		return nil
 62093  	}
 62094  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_aData, uintptr(_iAddr))), unsafe.Pointer(elem15(_aData, uintptr(_pc))), uint64(2))
 62095  	{
 62096  		p := elem15(_aData, uintptr(_hdr+int32(7)))
 62097  		*p = uint8(int32(*p) + int32(uint8(_x)))
 62098  	}
 62099  	goto _11
 62100  _9:
 62101  	*elem15(elem15(func() *uint8 { *elem15(elem15(_aData, uintptr(_pc+int32(2))), 0) = uint8(_x >> 8); return _aData }(), uintptr(_pc+int32(2))), uintptr(1)) = uint8(_x)
 62102  _11:
 62103  	return elem15(_aData, uintptr(_pc+_x))
 62104  
 62105  _5:
 62106  	_iAddr = _pc
 62107  	_pc = (int32(*elem15(elem15(_aData, uintptr(_pc)), 0)) << 8) | int32(*elem15(elem15(_aData, uintptr(_pc)), uintptr(1)))
 62108  	if _pc != 0 {
 62109  		goto _2
 62110  	}
 62111  	return nil
 62112  }
 62113  
 62114  var _pageFindSlotØ00__func__Ø000 [13]int8
 62115  
 62116  func init() {
 62117  	crt.Xstrncpy(nil, &_pageFindSlotØ00__func__Ø000[0], str(81011), 13)
 62118  }
 62119  
 62120  // C comment
 62121  //  /*
 62122  //  ** Defragment the page given. This routine reorganizes cells within the
 62123  //  ** page so that there are no free-blocks on the free-block list.
 62124  //  **
 62125  //  ** Parameter nMaxFrag is the maximum amount of fragmented space that may be
 62126  //  ** present in the page after this routine returns.
 62127  //  **
 62128  //  ** EVIDENCE-OF: R-44582-60138 SQLite may from time to time reorganize a
 62129  //  ** b-tree page so that there are no freeblocks or fragment bytes, all
 62130  //  ** unused bytes are contained in the unallocated space region, and all
 62131  //  ** cells are packed tightly at the end of the page.
 62132  //  */
 62133  func _defragmentPage(tls *crt.TLS, _pPage *XMemPage, _nMaxFrag int32) (r0 int32) {
 62134  	var _i, _pc, _hdr, _size, _usableSize, _cellOffset, _cbrk, _nCell, _iCellFirst, _iCellLast, _1_iFree, _2_iFree2, _3_sz2, _3_sz, _3_top, _11_x int32
 62135  	var _data, _temp, _src, _3_pEnd, _3_pAddr, _8_pAddr *uint8
 62136  	func() {
 62137  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 62138  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60381), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(53310)))
 62139  			crt.X__builtin_abort(tls)
 62140  		}
 62141  	}()
 62142  	func() {
 62143  		if (*XBtShared)(_pPage.XpBt) == nil {
 62144  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60382), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(55336)))
 62145  			crt.X__builtin_abort(tls)
 62146  		}
 62147  	}()
 62148  	func() {
 62149  		if ((*XBtShared)(_pPage.XpBt).XusableSize) > uint32(65536) {
 62150  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60383), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81024)))
 62151  			crt.X__builtin_abort(tls)
 62152  		}
 62153  	}()
 62154  	func() {
 62155  		if int32(_pPage.XnOverflow) != int32(0) {
 62156  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60384), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(80717)))
 62157  			crt.X__builtin_abort(tls)
 62158  		}
 62159  	}()
 62160  	func() {
 62161  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 62162  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60385), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(20394)))
 62163  			crt.X__builtin_abort(tls)
 62164  		}
 62165  	}()
 62166  	_temp = nil
 62167  	_src = store15(&_data, _pPage.XaData)
 62168  	_hdr = int32(_pPage.XhdrOffset)
 62169  	_cellOffset = int32(_pPage.XcellOffset)
 62170  	_nCell = int32(_pPage.XnCell)
 62171  	func() {
 62172  		if _nCell != ((int32(*elem15(elem15(_data, uintptr(_hdr+int32(3))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(3))), uintptr(1)))) {
 62173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60391), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81071)))
 62174  			crt.X__builtin_abort(tls)
 62175  		}
 62176  	}()
 62177  	_iCellFirst = _cellOffset + (int32(2) * _nCell)
 62178  	_usableSize = int32((*XBtShared)(_pPage.XpBt).XusableSize)
 62179  	if int32(*elem15(_data, uintptr(_hdr+int32(7)))) > _nMaxFrag {
 62180  		goto _12
 62181  	}
 62182  	_1_iFree = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(1))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(1))), uintptr(1)))
 62183  	if _1_iFree == 0 {
 62184  		goto _13
 62185  	}
 62186  	_2_iFree2 = (int32(*elem15(elem15(_data, uintptr(_1_iFree)), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_1_iFree)), uintptr(1)))
 62187  	func() {
 62188  		if _2_iFree2 != int32(0) && _2_iFree2 <= _1_iFree {
 62189  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60411), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81101)))
 62190  			crt.X__builtin_abort(tls)
 62191  		}
 62192  	}()
 62193  	func() {
 62194  		if (_1_iFree + ((int32(*elem15(elem15(_data, uintptr(_1_iFree+int32(2))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_1_iFree+int32(2))), uintptr(1))))) > _usableSize {
 62195  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60412), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81127)))
 62196  			crt.X__builtin_abort(tls)
 62197  		}
 62198  	}()
 62199  	func() {
 62200  		if _2_iFree2 != int32(0) && (_2_iFree2+((int32(*elem15(elem15(_data, uintptr(_2_iFree2+int32(2))), 0))<<8)|int32(*elem15(elem15(_data, uintptr(_2_iFree2+int32(2))), uintptr(1))))) > _usableSize {
 62201  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60413), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81172)))
 62202  			crt.X__builtin_abort(tls)
 62203  		}
 62204  	}()
 62205  	if int32(0) != _2_iFree2 && (int32(*elem15(_data, uintptr(_2_iFree2))) != int32(0) || int32(*elem15(_data, uintptr(_2_iFree2+int32(1)))) != int32(0)) {
 62206  		goto _24
 62207  	}
 62208  	_3_pEnd = elem15(_data, uintptr(_cellOffset+(_nCell*int32(2))))
 62209  	_3_sz2 = int32(0)
 62210  	_3_sz = (int32(*elem15(elem15(_data, uintptr(_1_iFree+int32(2))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_1_iFree+int32(2))), uintptr(1)))
 62211  	_3_top = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), uintptr(1)))
 62212  	if _2_iFree2 == 0 {
 62213  		goto _25
 62214  	}
 62215  	if (_1_iFree + _3_sz) > _2_iFree2 {
 62216  		return _sqlite3CorruptError(tls, int32(60422))
 62217  	}
 62218  	_3_sz2 = (int32(*elem15(elem15(_data, uintptr(_2_iFree2+int32(2))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_2_iFree2+int32(2))), uintptr(1)))
 62219  	func() {
 62220  		if ((((_1_iFree + _3_sz) + _3_sz2) + _2_iFree2) - (_1_iFree + _3_sz)) > _usableSize {
 62221  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60424), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81232)))
 62222  			crt.X__builtin_abort(tls)
 62223  		}
 62224  	}()
 62225  	crt.Xmemmove(tls, unsafe.Pointer(elem15(_data, uintptr((_1_iFree+_3_sz)+_3_sz2))), unsafe.Pointer(elem15(_data, uintptr(_1_iFree+_3_sz))), uint64(_2_iFree2-(_1_iFree+_3_sz)))
 62226  	_3_sz += _3_sz2
 62227  _25:
 62228  	_cbrk = _3_top + _3_sz
 62229  	func() {
 62230  		if (_cbrk + (_1_iFree - _3_top)) > _usableSize {
 62231  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60429), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81277)))
 62232  			crt.X__builtin_abort(tls)
 62233  		}
 62234  	}()
 62235  	crt.Xmemmove(tls, unsafe.Pointer(elem15(_data, uintptr(_cbrk))), unsafe.Pointer(elem15(_data, uintptr(_3_top))), uint64(_1_iFree-_3_top))
 62236  	_3_pAddr = elem15(_data, uintptr(_cellOffset))
 62237  _31:
 62238  	if crt.P2U(unsafe.Pointer(_3_pAddr)) >= crt.P2U(unsafe.Pointer(_3_pEnd)) {
 62239  		goto _34
 62240  	}
 62241  	_pc = (int32(*elem15(_3_pAddr, 0)) << 8) | int32(*elem15(_3_pAddr, uintptr(1)))
 62242  	if _pc < _1_iFree {
 62243  		*elem15(func() *uint8 { *elem15(_3_pAddr, 0) = uint8((_pc + _3_sz) >> 8); return _3_pAddr }(), uintptr(1)) = uint8(_pc + _3_sz)
 62244  		goto _37
 62245  	}
 62246  	if _pc < _2_iFree2 {
 62247  		*elem15(func() *uint8 { *elem15(_3_pAddr, 0) = uint8((_pc + _3_sz2) >> 8); return _3_pAddr }(), uintptr(1)) = uint8(_pc + _3_sz2)
 62248  	}
 62249  _37:
 62250  	*(*uintptr)(unsafe.Pointer(&_3_pAddr)) += uintptr(int32(2))
 62251  	goto _31
 62252  _34:
 62253  	goto _defragment_out
 62254  _24:
 62255  _13:
 62256  _12:
 62257  	_cbrk = _usableSize
 62258  	_iCellLast = _usableSize - int32(4)
 62259  	_i = int32(0)
 62260  _38:
 62261  	if _i >= _nCell {
 62262  		goto _41
 62263  	}
 62264  	_8_pAddr = elem15(_data, uintptr(_cellOffset+(_i*int32(2))))
 62265  	_pc = (int32(*elem15(_8_pAddr, 0)) << 8) | int32(*elem15(_8_pAddr, uintptr(1)))
 62266  	if (_pc < _iCellFirst) || (_pc > _iCellLast) {
 62267  		return _sqlite3CorruptError(tls, int32(60453))
 62268  	}
 62269  	func() {
 62270  		if _pc < _iCellFirst || _pc > _iCellLast {
 62271  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60455), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81308)))
 62272  			crt.X__builtin_abort(tls)
 62273  		}
 62274  	}()
 62275  	_size = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 62276  		v := _pPage.XxCellSize
 62277  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 62278  	}()(tls, _pPage, elem15(_src, uintptr(_pc))))
 62279  	_cbrk -= _size
 62280  	if (_cbrk < _iCellFirst) || ((_pc + _size) > _usableSize) {
 62281  		return _sqlite3CorruptError(tls, int32(60459))
 62282  	}
 62283  	func() {
 62284  		if (_cbrk+_size) > _usableSize || _cbrk < _iCellFirst {
 62285  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60461), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81340)))
 62286  			crt.X__builtin_abort(tls)
 62287  		}
 62288  	}()
 62289  	*elem15(func() *uint8 { *elem15(_8_pAddr, 0) = uint8(_cbrk >> 8); return _8_pAddr }(), uintptr(1)) = uint8(_cbrk)
 62290  	if _temp != nil {
 62291  		goto _52
 62292  	}
 62293  	if _cbrk == _pc {
 62294  		goto _39
 62295  	}
 62296  	_temp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPage.XpBt).XpPager)))
 62297  	_11_x = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), uintptr(1)))
 62298  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_temp, uintptr(_11_x))), unsafe.Pointer(elem15(_data, uintptr(_11_x))), uint64((_cbrk+_size)-_11_x))
 62299  	_src = _temp
 62300  _52:
 62301  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_data, uintptr(_cbrk))), unsafe.Pointer(elem15(_src, uintptr(_pc))), uint64(_size))
 62302  _39:
 62303  	_i += 1
 62304  	goto _38
 62305  _41:
 62306  	*elem15(_data, uintptr(_hdr+int32(7))) = 0
 62307  _defragment_out:
 62308  	if ((int32(*elem15(_data, uintptr(_hdr+int32(7)))) + _cbrk) - _iCellFirst) != int32(_pPage.XnFree) {
 62309  		return _sqlite3CorruptError(tls, int32(60479))
 62310  	}
 62311  	func() {
 62312  		if _cbrk < _iCellFirst {
 62313  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60481), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81382)))
 62314  			crt.X__builtin_abort(tls)
 62315  		}
 62316  	}()
 62317  	*elem15(elem15(func() *uint8 { *elem15(elem15(_data, uintptr(_hdr+int32(5))), 0) = uint8(_cbrk >> 8); return _data }(), uintptr(_hdr+int32(5))), uintptr(1)) = uint8(_cbrk)
 62318  	*elem15(_data, uintptr(_hdr+int32(1))) = 0
 62319  	*elem15(_data, uintptr(_hdr+int32(2))) = 0
 62320  	crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(_iCellFirst))), int32(0), uint64(_cbrk-_iCellFirst))
 62321  	func() {
 62322  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 62323  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60486), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(53310)))
 62324  			crt.X__builtin_abort(tls)
 62325  		}
 62326  	}()
 62327  	return int32(0)
 62328  }
 62329  
 62330  var _defragmentPageØ00__func__Ø000 [15]int8
 62331  
 62332  func init() {
 62333  	crt.Xstrncpy(nil, &_defragmentPageØ00__func__Ø000[0], str(81399), 15)
 62334  }
 62335  
 62336  // C comment
 62337  //  /*
 62338  //  ** Return a pointer to the "temporary page" buffer held internally
 62339  //  ** by the pager.  This is a buffer that is big enough to hold the
 62340  //  ** entire content of a database page.  This buffer is used internally
 62341  //  ** during rollback and will be overwritten whenever a rollback
 62342  //  ** occurs.  But other modules are free to use it too, as long as
 62343  //  ** no rollbacks are happening.
 62344  //  */
 62345  func _sqlite3PagerTempSpace(tls *crt.TLS, _pPager *XPager) (r0 unsafe.Pointer) {
 62346  	return unsafe.Pointer(_pPager.XpTmpSpace)
 62347  }
 62348  
 62349  // C comment
 62350  //  /*
 62351  //  ** The page that pCur currently points to has just been modified in
 62352  //  ** some way. This function figures out if this modification means the
 62353  //  ** tree needs to be balanced, and if so calls the appropriate balancing
 62354  //  ** routine. Balancing routines are:
 62355  //  **
 62356  //  **   balance_quick()
 62357  //  **   balance_deeper()
 62358  //  **   balance_nonroot()
 62359  //  */
 62360  func _balance(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 62361  	var _rc, _nMin, _balance_quick_called, _balance_deeper_called, _1_iPage, _7_iIdx int32
 62362  	var _pFree, _10_pSpace *uint8
 62363  	var _1_pPage, _7_pParent *XMemPage
 62364  	var _aBalanceQuickSpace [13]uint8
 62365  	_rc = int32(0)
 62366  	_nMin = int32((((*XBtShared)(_pCur.XpBt).XusableSize) * uint32(2)) / uint32(3))
 62367  	_pFree = nil
 62368  	_balance_quick_called = int32(0)
 62369  	_balance_deeper_called = int32(0)
 62370  _0:
 62371  	_1_iPage = int32(_pCur.XiPage)
 62372  	_1_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_1_iPage))
 62373  	if _1_iPage != int32(0) {
 62374  		goto _1
 62375  	}
 62376  	if _1_pPage.XnOverflow == 0 {
 62377  		goto _2
 62378  	}
 62379  	func() {
 62380  		if _balance_deeper_called != int32(0) {
 62381  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66966), unsafe.Pointer(&_balanceØ00__func__Ø000), unsafe.Pointer(str(81414)))
 62382  			crt.X__builtin_abort(tls)
 62383  		}
 62384  	}()
 62385  	_balance_deeper_called += 1
 62386  	_rc = _balance_deeper(tls, _1_pPage, elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(1)))
 62387  	if _rc == int32(0) {
 62388  		_pCur.XiPage = int8(1)
 62389  		_pCur.Xix = 0
 62390  		*elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), 0) = 0
 62391  		func() {
 62392  			if ((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(1))).XnOverflow) == 0 {
 62393  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66973), unsafe.Pointer(&_balanceØ00__func__Ø000), unsafe.Pointer(str(81439)))
 62394  				crt.X__builtin_abort(tls)
 62395  			}
 62396  		}()
 62397  	}
 62398  	goto _8
 62399  _2:
 62400  	goto _9
 62401  _8:
 62402  	goto _13
 62403  _1:
 62404  	if (int32(_1_pPage.XnOverflow) == int32(0)) && (int32(_1_pPage.XnFree) <= _nMin) {
 62405  		goto _9
 62406  	}
 62407  	_7_pParent = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_1_iPage-int32(1)))
 62408  	_7_iIdx = int32(*elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), uintptr(_1_iPage-int32(1))))
 62409  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_7_pParent.XpDbPage))
 62410  	if _rc != int32(0) {
 62411  		goto _14
 62412  	}
 62413  	if ((((_1_pPage.XintKeyLeaf != 0) && (int32(_1_pPage.XnOverflow) == int32(1))) && (int32(*elem20((*uint16)(unsafe.Pointer(&_1_pPage.XaiOvfl)), 0)) == int32(_1_pPage.XnCell))) && (_7_pParent.Xpgno != uint32(1))) && (int32(_7_pParent.XnCell) == _7_iIdx) {
 62414  		func() {
 62415  			if _balance_quick_called != int32(0) {
 62416  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67006), unsafe.Pointer(&_balanceØ00__func__Ø000), unsafe.Pointer(str(81466)))
 62417  				crt.X__builtin_abort(tls)
 62418  			}
 62419  		}()
 62420  		_balance_quick_called += 1
 62421  		_rc = _balance_quick(tls, _7_pParent, _1_pPage, (*uint8)(unsafe.Pointer(&_aBalanceQuickSpace)))
 62422  		goto _22
 62423  	}
 62424  	_10_pSpace = (*uint8)(_sqlite3PageMalloc(tls, int32((*XBtShared)(_pCur.XpBt).XpageSize)))
 62425  	_rc = _balance_nonroot(tls, _7_pParent, _7_iIdx, _10_pSpace, bool2int(_1_iPage == int32(1)), int32(_pCur.Xhints)&int32(1))
 62426  	if _pFree != nil {
 62427  		_sqlite3PageFree(tls, unsafe.Pointer(_pFree))
 62428  	}
 62429  	_pFree = _10_pSpace
 62430  _22:
 62431  _14:
 62432  	_1_pPage.XnOverflow = 0
 62433  	_releasePage(tls, _1_pPage)
 62434  	_pCur.XiPage -= 1
 62435  	func() {
 62436  		if int32(_pCur.XiPage) < int32(0) {
 62437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67052), unsafe.Pointer(&_balanceØ00__func__Ø000), unsafe.Pointer(str(73444)))
 62438  			crt.X__builtin_abort(tls)
 62439  		}
 62440  	}()
 62441  _13:
 62442  	if _rc == int32(0) {
 62443  		goto _0
 62444  	}
 62445  _9:
 62446  	if _pFree != nil {
 62447  		_sqlite3PageFree(tls, unsafe.Pointer(_pFree))
 62448  	}
 62449  	return _rc
 62450  
 62451  	_ = _aBalanceQuickSpace
 62452  	panic(0)
 62453  }
 62454  
 62455  var _balanceØ00__func__Ø000 [8]int8
 62456  
 62457  func init() {
 62458  	crt.Xstrncpy(nil, &_balanceØ00__func__Ø000[0], str(81490), 8)
 62459  }
 62460  
 62461  // C comment
 62462  //  /*
 62463  //  ** This function is called when the root page of a b-tree structure is
 62464  //  ** overfull (has one or more overflow pages).
 62465  //  **
 62466  //  ** A new child page is allocated and the contents of the current root
 62467  //  ** page, including overflow cells, are copied into the child. The root
 62468  //  ** page is then overwritten to make it an empty page with the right-child
 62469  //  ** pointer pointing to the new page.
 62470  //  **
 62471  //  ** Before returning, all pointer-map entries corresponding to pages
 62472  //  ** that the new child-page now contains pointers to are updated. The
 62473  //  ** entry corresponding to the new right-child pointer of the root
 62474  //  ** page is also updated.
 62475  //  **
 62476  //  ** If successful, *ppChild is set to contain a reference to the child
 62477  //  ** page and SQLITE_OK is returned. In this case the caller is required
 62478  //  ** to call releasePage() on *ppChild exactly once. If an error occurs,
 62479  //  ** an error code is returned and *ppChild is set to 0.
 62480  //  */
 62481  func _balance_deeper(tls *crt.TLS, _pRoot *XMemPage, _ppChild **XMemPage) (r0 int32) {
 62482  	var _rc int32
 62483  	var _pgnoChild uint32
 62484  	var _pBt *XBtShared
 62485  	var _pChild *XMemPage
 62486  	_pChild = nil
 62487  	_pgnoChild = uint32(0)
 62488  	_pBt = (*XBtShared)(_pRoot.XpBt)
 62489  	func() {
 62490  		if int32(_pRoot.XnOverflow) <= int32(0) {
 62491  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66895), unsafe.Pointer(&_balance_deeperØ00__func__Ø000), unsafe.Pointer(str(81498)))
 62492  			crt.X__builtin_abort(tls)
 62493  		}
 62494  	}()
 62495  	func() {
 62496  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 62497  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66896), unsafe.Pointer(&_balance_deeperØ00__func__Ø000), unsafe.Pointer(str(9235)))
 62498  			crt.X__builtin_abort(tls)
 62499  		}
 62500  	}()
 62501  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pRoot.XpDbPage))
 62502  	if _rc != int32(0) {
 62503  		goto _4
 62504  	}
 62505  	_rc = _allocateBtreePage(tls, _pBt, &_pChild, &_pgnoChild, _pRoot.Xpgno, 0)
 62506  	_copyNodeContent(tls, _pRoot, _pChild, &_rc)
 62507  	if _pBt.XautoVacuum != 0 {
 62508  		_ptrmapPut(tls, _pBt, _pgnoChild, uint8(5), _pRoot.Xpgno, &_rc)
 62509  	}
 62510  _4:
 62511  	if _rc != 0 {
 62512  		*_ppChild = nil
 62513  		_releasePage(tls, _pChild)
 62514  		return _rc
 62515  	}
 62516  	func() {
 62517  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pChild.XpDbPage)) == 0 {
 62518  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66915), unsafe.Pointer(&_balance_deeperØ00__func__Ø000), unsafe.Pointer(str(81517)))
 62519  			crt.X__builtin_abort(tls)
 62520  		}
 62521  	}()
 62522  	func() {
 62523  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pRoot.XpDbPage)) == 0 {
 62524  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66916), unsafe.Pointer(&_balance_deeperØ00__func__Ø000), unsafe.Pointer(str(77763)))
 62525  			crt.X__builtin_abort(tls)
 62526  		}
 62527  	}()
 62528  	func() {
 62529  		if int32(_pChild.XnCell) != int32(_pRoot.XnCell) {
 62530  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66917), unsafe.Pointer(&_balance_deeperØ00__func__Ø000), unsafe.Pointer(str(81558)))
 62531  			crt.X__builtin_abort(tls)
 62532  		}
 62533  	}()
 62534  	crt.Xmemcpy(tls, unsafe.Pointer(&_pChild.XaiOvfl), unsafe.Pointer(&_pRoot.XaiOvfl), uint64(_pRoot.XnOverflow)*uint64(2))
 62535  	crt.Xmemcpy(tls, unsafe.Pointer(&_pChild.XapOvfl), unsafe.Pointer(&_pRoot.XapOvfl), uint64(_pRoot.XnOverflow)*uint64(8))
 62536  	_pChild.XnOverflow = _pRoot.XnOverflow
 62537  	_zeroPage(tls, _pRoot, int32(*elem15(_pChild.XaData, 0))&int32(-9))
 62538  	_sqlite3Put4byte(tls, elem15(_pRoot.XaData, uintptr(int32(_pRoot.XhdrOffset)+int32(8))), _pgnoChild)
 62539  	*_ppChild = _pChild
 62540  	return int32(0)
 62541  }
 62542  
 62543  var _balance_deeperØ00__func__Ø000 [15]int8
 62544  
 62545  func init() {
 62546  	crt.Xstrncpy(nil, &_balance_deeperØ00__func__Ø000[0], str(81586), 15)
 62547  }
 62548  
 62549  // C comment
 62550  //  /*
 62551  //  ** This function is used to copy the contents of the b-tree node stored
 62552  //  ** on page pFrom to page pTo. If page pFrom was not a leaf page, then
 62553  //  ** the pointer-map entries for each child page are updated so that the
 62554  //  ** parent page stored in the pointer map is page pTo. If pFrom contained
 62555  //  ** any cells with overflow page pointers, then the corresponding pointer
 62556  //  ** map entries are also updated so that the parent page is page pTo.
 62557  //  **
 62558  //  ** If pFrom is currently carrying any overflow cells (entries in the
 62559  //  ** MemPage.apOvfl[] array), they are not copied to pTo.
 62560  //  **
 62561  //  ** Before returning, page pTo is reinitialized using btreeInitPage().
 62562  //  **
 62563  //  ** The performance of this function is not critical. It is only used by
 62564  //  ** the balance_shallower() and balance_deeper() procedures, neither of
 62565  //  ** which are called often under normal circumstances.
 62566  //  */
 62567  func _copyNodeContent(tls *crt.TLS, _pFrom *XMemPage, _pTo *XMemPage, _pRC *int32) {
 62568  	var _1_iFromHdr, _1_iToHdr, _1_rc, _1_iData int32
 62569  	var _1_aFrom, _1_aTo *uint8
 62570  	var _1_pBt *XBtShared
 62571  	if (*_pRC) != int32(0) {
 62572  		goto _0
 62573  	}
 62574  	_1_pBt = (*XBtShared)(_pFrom.XpBt)
 62575  	_1_aFrom = _pFrom.XaData
 62576  	_1_aTo = _pTo.XaData
 62577  	_1_iFromHdr = int32(_pFrom.XhdrOffset)
 62578  	_1_iToHdr = func() int32 {
 62579  		if _pTo.Xpgno == uint32(1) {
 62580  			return int32(100)
 62581  		}
 62582  		return int32(0)
 62583  	}()
 62584  	func() {
 62585  		if _pFrom.XisInit == 0 {
 62586  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66056), unsafe.Pointer(&_copyNodeContentØ00__func__Ø000), unsafe.Pointer(str(81601)))
 62587  			crt.X__builtin_abort(tls)
 62588  		}
 62589  	}()
 62590  	func() {
 62591  		if int32(_pFrom.XnFree) < _1_iToHdr {
 62592  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66057), unsafe.Pointer(&_copyNodeContentØ00__func__Ø000), unsafe.Pointer(str(81615)))
 62593  			crt.X__builtin_abort(tls)
 62594  		}
 62595  	}()
 62596  	func() {
 62597  		if ((int32(*elem15(elem15(_1_aFrom, uintptr(_1_iFromHdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_1_aFrom, uintptr(_1_iFromHdr+int32(5))), uintptr(1)))) > int32(_1_pBt.XusableSize) {
 62598  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66058), unsafe.Pointer(&_copyNodeContentØ00__func__Ø000), unsafe.Pointer(str(81636)))
 62599  			crt.X__builtin_abort(tls)
 62600  		}
 62601  	}()
 62602  	_1_iData = (int32(*elem15(elem15(_1_aFrom, uintptr(_1_iFromHdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_1_aFrom, uintptr(_1_iFromHdr+int32(5))), uintptr(1)))
 62603  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_1_aTo, uintptr(_1_iData))), unsafe.Pointer(elem15(_1_aFrom, uintptr(_1_iData))), uint64(_1_pBt.XusableSize-uint32(_1_iData)))
 62604  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_1_aTo, uintptr(_1_iToHdr))), unsafe.Pointer(elem15(_1_aFrom, uintptr(_1_iFromHdr))), uint64(int32(_pFrom.XcellOffset)+(int32(2)*int32(_pFrom.XnCell))))
 62605  	_pTo.XisInit = 0
 62606  	_1_rc = _btreeInitPage(tls, _pTo)
 62607  	if _1_rc != int32(0) {
 62608  		*_pRC = _1_rc
 62609  		return
 62610  	}
 62611  	if _1_pBt.XautoVacuum != 0 {
 62612  		*_pRC = _setChildPtrmaps(tls, _pTo)
 62613  	}
 62614  _0:
 62615  }
 62616  
 62617  var _copyNodeContentØ00__func__Ø000 [16]int8
 62618  
 62619  func init() {
 62620  	crt.Xstrncpy(nil, &_copyNodeContentØ00__func__Ø000[0], str(81689), 16)
 62621  }
 62622  
 62623  // C comment
 62624  //  /*
 62625  //  ** This version of balance() handles the common special case where
 62626  //  ** a new entry is being inserted on the extreme right-end of the
 62627  //  ** tree, in other words, when the new entry will become the largest
 62628  //  ** entry in the tree.
 62629  //  **
 62630  //  ** Instead of trying to balance the 3 right-most leaf pages, just add
 62631  //  ** a new page to the right-hand side and put the one new entry in
 62632  //  ** that page.  This leaves the right side of the tree somewhat
 62633  //  ** unbalanced.  But odds are that we will be inserting new entries
 62634  //  ** at the end soon afterwards so the nearly empty page will quickly
 62635  //  ** fill up.  On average.
 62636  //  **
 62637  //  ** pPage is the leaf page which is the right-most page in the tree.
 62638  //  ** pParent is its parent.  pPage must have a single overflow entry
 62639  //  ** which is also the right-most entry on the page.
 62640  //  **
 62641  //  ** The pSpace buffer is used to store a temporary copy of the divider
 62642  //  ** cell that will be inserted into pParent. Such a cell consists of a 4
 62643  //  ** byte page number followed by a variable length integer. In other
 62644  //  ** words, at most 13 bytes. Hence the pSpace buffer must be at
 62645  //  ** least 13 bytes in size.
 62646  //  */
 62647  func _balance_quick(tls *crt.TLS, _pParent *XMemPage, _pPage *XMemPage, _pSpace *uint8) (r0 int32) {
 62648  	var _rc int32
 62649  	var _pgnoNew uint32
 62650  	var _1_szCell uint16
 62651  	var _1_pOut, _1_pCell, _1_pStop *uint8
 62652  	var _pBt *XBtShared
 62653  	var _pNew *XMemPage
 62654  	_pBt = (*XBtShared)(_pPage.XpBt)
 62655  	func() {
 62656  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 62657  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65907), unsafe.Pointer(&_balance_quickØ00__func__Ø000), unsafe.Pointer(str(20394)))
 62658  			crt.X__builtin_abort(tls)
 62659  		}
 62660  	}()
 62661  	func() {
 62662  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.XpDbPage)) == 0 {
 62663  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65908), unsafe.Pointer(&_balance_quickØ00__func__Ø000), unsafe.Pointer(str(81705)))
 62664  			crt.X__builtin_abort(tls)
 62665  		}
 62666  	}()
 62667  	func() {
 62668  		if int32(_pPage.XnOverflow) != int32(1) {
 62669  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65909), unsafe.Pointer(&_balance_quickØ00__func__Ø000), unsafe.Pointer(str(81747)))
 62670  			crt.X__builtin_abort(tls)
 62671  		}
 62672  	}()
 62673  	if func() int32 {
 62674  		if int32(_pPage.XnCell) == int32(0) {
 62675  			return func() int32 {
 62676  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65912), unsafe.Pointer(&_balance_quickØ00__func__Ø000), unsafe.Pointer(str(4809)))
 62677  				crt.X__builtin_abort(tls)
 62678  				return int32(1)
 62679  			}()
 62680  		}
 62681  		return int32(0)
 62682  	}() != 0 {
 62683  		return _sqlite3CorruptError(tls, int32(65912))
 62684  	}
 62685  	_rc = _allocateBtreePage(tls, _pBt, &_pNew, &_pgnoNew, 0, 0)
 62686  	if _rc != int32(0) {
 62687  		goto _9
 62688  	}
 62689  	_1_pOut = elem15(_pSpace, uintptr(4))
 62690  	_1_pCell = *elem89((**uint8)(unsafe.Pointer(&_pPage.XapOvfl)), 0)
 62691  	_1_szCell = func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 62692  		v := _pPage.XxCellSize
 62693  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 62694  	}()(tls, _pPage, _1_pCell)
 62695  	func() {
 62696  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pNew.XpDbPage)) == 0 {
 62697  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65927), unsafe.Pointer(&_balance_quickØ00__func__Ø000), unsafe.Pointer(str(81767)))
 62698  			crt.X__builtin_abort(tls)
 62699  		}
 62700  	}()
 62701  	func() {
 62702  		if int32(*elem15(_pPage.XaData, 0)) != int32(13) {
 62703  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65928), unsafe.Pointer(&_balance_quickØ00__func__Ø000), unsafe.Pointer(str(81806)))
 62704  			crt.X__builtin_abort(tls)
 62705  		}
 62706  	}()
 62707  	_zeroPage(tls, _pNew, int32(13))
 62708  	_rc = _rebuildPage(tls, _pNew, int32(1), &_1_pCell, &_1_szCell)
 62709  	if func() int32 {
 62710  		if _rc != 0 {
 62711  			return func() int32 {
 62712  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65931), unsafe.Pointer(&_balance_quickØ00__func__Ø000), unsafe.Pointer(str(4809)))
 62713  				crt.X__builtin_abort(tls)
 62714  				return int32(1)
 62715  			}()
 62716  		}
 62717  		return int32(0)
 62718  	}() != 0 {
 62719  		return _rc
 62720  	}
 62721  	_pNew.XnFree = uint16(((_pBt.XusableSize - uint32(_pNew.XcellOffset)) - uint32(2)) - uint32(_1_szCell))
 62722  	if _pBt.XautoVacuum == 0 {
 62723  		goto _17
 62724  	}
 62725  	_ptrmapPut(tls, _pBt, _pgnoNew, uint8(5), _pParent.Xpgno, &_rc)
 62726  	if int32(_1_szCell) > int32(_pNew.XminLocal) {
 62727  		_ptrmapPutOvflPtr(tls, _pNew, _1_pCell, &_rc)
 62728  	}
 62729  _17:
 62730  	_1_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData)) + uintptr(int32(_pPage.XmaskPage)&((int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*(int32(_pPage.XnCell)-int32(1)))), 0))<<8)|int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*(int32(_pPage.XnCell)-int32(1)))), uintptr(1)))))))
 62731  	_1_pStop = elem15(_1_pCell, uintptr(9))
 62732  _19:
 62733  	if (int32(*postInc15(&_1_pCell, 1))&int32(128)) != 0 && (crt.P2U(unsafe.Pointer(_1_pCell)) < crt.P2U(unsafe.Pointer(_1_pStop))) {
 62734  		goto _19
 62735  	}
 62736  	_1_pStop = elem15(_1_pCell, uintptr(9))
 62737  _22:
 62738  	if (int32(store3(postInc15(&_1_pOut, 1), *postInc15(&_1_pCell, 1)))&int32(128)) != 0 && (crt.P2U(unsafe.Pointer(_1_pCell)) < crt.P2U(unsafe.Pointer(_1_pStop))) {
 62739  		goto _22
 62740  	}
 62741  	if _rc == int32(0) {
 62742  		_insertCell(tls, _pParent, int32(_pParent.XnCell), _pSpace, int32(int64(uintptr(unsafe.Pointer(_1_pOut))-uintptr(unsafe.Pointer(_pSpace)))), nil, _pPage.Xpgno, &_rc)
 62743  	}
 62744  	_sqlite3Put4byte(tls, elem15(_pParent.XaData, uintptr(int32(_pParent.XhdrOffset)+int32(8))), _pgnoNew)
 62745  	_releasePage(tls, _pNew)
 62746  _9:
 62747  	return _rc
 62748  }
 62749  
 62750  var _balance_quickØ00__func__Ø000 [14]int8
 62751  
 62752  func init() {
 62753  	crt.Xstrncpy(nil, &_balance_quickØ00__func__Ø000[0], str(81858), 14)
 62754  }
 62755  
 62756  // C comment
 62757  //  /*
 62758  //  ** Array apCell[] contains pointers to nCell b-tree page cells. The
 62759  //  ** szCell[] array contains the size in bytes of each cell. This function
 62760  //  ** replaces the current contents of page pPg with the contents of the cell
 62761  //  ** array.
 62762  //  **
 62763  //  ** Some of the cells in apCell[] may currently be stored in pPg. This
 62764  //  ** function works around problems caused by this by making a copy of any
 62765  //  ** such cells before overwriting the page data.
 62766  //  **
 62767  //  ** The MemPage.nFree field is invalidated by this function. It is the
 62768  //  ** responsibility of the caller to set it correctly.
 62769  //  */
 62770  func _rebuildPage(tls *crt.TLS, _pPg *XMemPage, _nCell int32, _apCell **uint8, _szCell *uint16) (r0 int32) {
 62771  	var _hdr, _usableSize, _i int32
 62772  	var _aData, _pEnd, _pCellptr, _pTmp, _pData, _1_pCell *uint8
 62773  	_hdr = int32(_pPg.XhdrOffset)
 62774  	_aData = _pPg.XaData
 62775  	_usableSize = int32((*XBtShared)(_pPg.XpBt).XusableSize)
 62776  	_pEnd = elem15(_aData, uintptr(_usableSize))
 62777  	_pCellptr = _pPg.XaCellIdx
 62778  	_pTmp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPg.XpBt).XpPager)))
 62779  	_i = (int32(*elem15(elem15(_aData, uintptr(_hdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_aData, uintptr(_hdr+int32(5))), uintptr(1)))
 62780  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_pTmp, uintptr(_i))), unsafe.Pointer(elem15(_aData, uintptr(_i))), uint64(_usableSize-_i))
 62781  	_pData = _pEnd
 62782  	_i = int32(0)
 62783  _0:
 62784  	if _i >= _nCell {
 62785  		goto _3
 62786  	}
 62787  	_1_pCell = *elem89(_apCell, uintptr(_i))
 62788  	if (uint64(crt.P2U(unsafe.Pointer(_1_pCell))) >= uint64(crt.P2U(unsafe.Pointer(_aData)))) && (uint64(crt.P2U(unsafe.Pointer(_1_pCell))) < uint64(crt.P2U(unsafe.Pointer(_pEnd)))) {
 62789  		_1_pCell = elem15(_pTmp, uintptr(int64(uintptr(unsafe.Pointer(_1_pCell))-uintptr(unsafe.Pointer(_aData)))))
 62790  	}
 62791  	*(*uintptr)(unsafe.Pointer(&_pData)) -= uintptr(*elem20(_szCell, uintptr(_i)))
 62792  	*elem15(func() *uint8 {
 62793  		*elem15(_pCellptr, 0) = uint8(int64(uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData))) >> 8)
 62794  		return _pCellptr
 62795  	}(), uintptr(1)) = uint8(int64(uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))))
 62796  	*(*uintptr)(unsafe.Pointer(&_pCellptr)) += uintptr(int32(2))
 62797  	if crt.P2U(unsafe.Pointer(_pData)) < crt.P2U(unsafe.Pointer(_pCellptr)) {
 62798  		return _sqlite3CorruptError(tls, int32(65622))
 62799  	}
 62800  	crt.Xmemcpy(tls, unsafe.Pointer(_pData), unsafe.Pointer(_1_pCell), uint64(*elem20(_szCell, uintptr(_i))))
 62801  	func() {
 62802  		if int32(*elem20(_szCell, uintptr(_i))) != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 62803  			v := _pPg.XxCellSize
 62804  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 62805  		}()(tls, _pPg, _1_pCell)) && _sqlite3Config.XneverCorrupt != int32(0) {
 62806  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65624), unsafe.Pointer(&_rebuildPageØ00__func__Ø000), unsafe.Pointer(str(81872)))
 62807  			crt.X__builtin_abort(tls)
 62808  		}
 62809  	}()
 62810  	_i += 1
 62811  	goto _0
 62812  _3:
 62813  	_pPg.XnCell = uint16(_nCell)
 62814  	_pPg.XnOverflow = 0
 62815  	*elem15(elem15(func() *uint8 { *elem15(elem15(_aData, uintptr(_hdr+int32(1))), 0) = uint8(0); return _aData }(), uintptr(_hdr+int32(1))), uintptr(1)) = uint8(0)
 62816  	*elem15(elem15(func() *uint8 {
 62817  		*elem15(elem15(_aData, uintptr(_hdr+int32(3))), 0) = uint8(int32(_pPg.XnCell) >> 8)
 62818  		return _aData
 62819  	}(), uintptr(_hdr+int32(3))), uintptr(1)) = uint8(_pPg.XnCell)
 62820  	*elem15(elem15(func() *uint8 {
 62821  		*elem15(elem15(_aData, uintptr(_hdr+int32(5))), 0) = uint8(int64(uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData))) >> 8)
 62822  		return _aData
 62823  	}(), uintptr(_hdr+int32(5))), uintptr(1)) = uint8(int64(uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))))
 62824  	*elem15(_aData, uintptr(_hdr+int32(7))) = 0
 62825  	return int32(0)
 62826  }
 62827  
 62828  var _rebuildPageØ00__func__Ø000 [12]int8
 62829  
 62830  func init() {
 62831  	crt.Xstrncpy(nil, &_rebuildPageØ00__func__Ø000[0], str(81924), 12)
 62832  }
 62833  
 62834  // C comment
 62835  //  /*
 62836  //  ** This routine redistributes cells on the iParentIdx'th child of pParent
 62837  //  ** (hereafter "the page") and up to 2 siblings so that all pages have about the
 62838  //  ** same amount of free space. Usually a single sibling on either side of the
 62839  //  ** page are used in the balancing, though both siblings might come from one
 62840  //  ** side if the page is the first or last child of its parent. If the page
 62841  //  ** has fewer than 2 siblings (something which can only happen if the page
 62842  //  ** is a root page or a child of a root page) then all available siblings
 62843  //  ** participate in the balancing.
 62844  //  **
 62845  //  ** The number of siblings of the page might be increased or decreased by
 62846  //  ** one or two in an effort to keep pages nearly full but not over full.
 62847  //  **
 62848  //  ** Note that when this routine is called, some of the cells on the page
 62849  //  ** might not actually be stored in MemPage.aData[]. This can happen
 62850  //  ** if the page is overfull. This routine ensures that all cells allocated
 62851  //  ** to the page and its siblings fit into MemPage.aData[] before returning.
 62852  //  **
 62853  //  ** In the course of balancing the page and its siblings, cells may be
 62854  //  ** inserted into or removed from the parent page (pParent). Doing so
 62855  //  ** may cause the parent page to become overfull or underfull. If this
 62856  //  ** happens, it is the responsibility of the caller to invoke the correct
 62857  //  ** balancing routine to fix this problem (see the balance() routine).
 62858  //  **
 62859  //  ** If this routine fails for any reason, it might leave the database
 62860  //  ** in a corrupted state. So if this routine fails, the database should
 62861  //  ** be rolled back.
 62862  //  **
 62863  //  ** The third argument to this function, aOvflSpace, is a pointer to a
 62864  //  ** buffer big enough to hold one page. If while inserting cells into the parent
 62865  //  ** page (pParent) the parent page becomes overfull, this buffer is
 62866  //  ** used to store the parent's overflow cells. Because this function inserts
 62867  //  ** a maximum of four divider cells into the parent page, and the maximum
 62868  //  ** size of a cell stored within an internal node is always less than 1/4
 62869  //  ** of the page-size, the aOvflSpace[] buffer is guaranteed to be large
 62870  //  ** enough for all overflow cells.
 62871  //  **
 62872  //  ** If aOvflSpace is set to a null pointer, this function returns
 62873  //  ** SQLITE_NOMEM.
 62874  //  */
 62875  func _balance_nonroot(tls *crt.TLS, _pParent *XMemPage, _iParentIdx int32, _aOvflSpace *uint8, _isRoot int32, _bBulk int32) (r0 int32) {
 62876  	var _nMaxCells, _nNew, _nOld, _i, _j, _k, _nxDiv, _rc, _leafData, _usableSpace, _pageFlags, _iSpace1, _iOvflSpace, _szScratch, _13_iOff, _17_limit, _29_sz, _42_szRight, _42_szLeft, _42_r, _42_d, _54_iBest, _59_cntOldNext, _59_usableSize, _59_iNew, _59_iOld, _66_sz, _71_iPg, _72_iNew, _72_iOld, _72_nNewCell int32
 62877  	var _pgno, _77_key uint32
 62878  	var _leafCorrection, _17_maskPage, _23_sz uint16
 62879  	var _pRight, _aSpace1, _17_aData, _17_piCell, _17_piEnd, _23_pTemp, _59_aOld, _60_pCell, _66_pCell, _66_pTemp *uint8
 62880  	var _aPgno, _aPgOrder [5]uint32
 62881  	var _pBt *XBtShared
 62882  	var _68_info XCellInfo
 62883  	var _17_pOld, _27_p, _46_pNew, _58_pOld, _59_pNew, _61_pOld, _66_pNew *XMemPage
 62884  	var _b XCellArray
 62885  	var _apOld [3]*XMemPage
 62886  	var _apNew [5]*XMemPage
 62887  	var _apDiv [2]*uint8
 62888  	var _cntNew, _cntOld, _szNew [5]int32
 62889  	var _abDone [5]uint8
 62890  	var _aPgFlags [5]uint16
 62891  	_nMaxCells = int32(0)
 62892  	_nNew = int32(0)
 62893  	_rc = int32(0)
 62894  	_iSpace1 = int32(0)
 62895  	_iOvflSpace = int32(0)
 62896  	crt.Xmemset(tls, unsafe.Pointer(&_abDone), int32(0), uint64(5))
 62897  	_b.XnCell = int32(0)
 62898  	_b.XapCell = nil
 62899  	_pBt = (*XBtShared)(_pParent.XpBt)
 62900  	func() {
 62901  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 62902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66166), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(9235)))
 62903  			crt.X__builtin_abort(tls)
 62904  		}
 62905  	}()
 62906  	func() {
 62907  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.XpDbPage)) == 0 {
 62908  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66167), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(81705)))
 62909  			crt.X__builtin_abort(tls)
 62910  		}
 62911  	}()
 62912  	func() {
 62913  		if int32(_pParent.XnOverflow) != int32(0) && int32(_pParent.XnOverflow) != int32(1) {
 62914  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66178), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(81936)))
 62915  			crt.X__builtin_abort(tls)
 62916  		}
 62917  	}()
 62918  	func() {
 62919  		if int32(_pParent.XnOverflow) != int32(0) && int32(*elem20((*uint16)(unsafe.Pointer(&_pParent.XaiOvfl)), 0)) != _iParentIdx {
 62920  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66179), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(81983)))
 62921  			crt.X__builtin_abort(tls)
 62922  		}
 62923  	}()
 62924  	if _aOvflSpace == nil {
 62925  		return _sqlite3NomemError(tls, int32(66182))
 62926  	}
 62927  	_i = int32(_pParent.XnOverflow) + int32(_pParent.XnCell)
 62928  	if _i < int32(2) {
 62929  		_nxDiv = int32(0)
 62930  		goto _12
 62931  	}
 62932  	func() {
 62933  		if _bBulk != int32(0) && _bBulk != int32(1) {
 62934  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66200), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82039)))
 62935  			crt.X__builtin_abort(tls)
 62936  		}
 62937  	}()
 62938  	if _iParentIdx == int32(0) {
 62939  		_nxDiv = int32(0)
 62940  		goto _19
 62941  	}
 62942  	if _iParentIdx == _i {
 62943  		_nxDiv = (_i - int32(2)) + _bBulk
 62944  		goto _19
 62945  	}
 62946  	_nxDiv = _iParentIdx - int32(1)
 62947  _19:
 62948  	_i = int32(2) - _bBulk
 62949  _12:
 62950  	_nOld = _i + int32(1)
 62951  	if ((_i + _nxDiv) - int32(_pParent.XnOverflow)) == int32(_pParent.XnCell) {
 62952  		_pRight = elem15(_pParent.XaData, uintptr(int32(_pParent.XhdrOffset)+int32(8)))
 62953  		goto _21
 62954  	}
 62955  	_pRight = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.XaData)) + uintptr(int32(_pParent.XmaskPage)&((int32(*elem15(elem15(_pParent.XaCellIdx, uintptr(int32(2)*((_i+_nxDiv)-int32(_pParent.XnOverflow)))), 0))<<8)|int32(*elem15(elem15(_pParent.XaCellIdx, uintptr(int32(2)*((_i+_nxDiv)-int32(_pParent.XnOverflow)))), uintptr(1)))))))
 62956  _21:
 62957  	_pgno = _sqlite3Get4byte(tls, _pRight)
 62958  _22:
 62959  	_rc = _getAndInitPage(tls, _pBt, _pgno, elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i)), nil, int32(0))
 62960  	if _rc != 0 {
 62961  		crt.Xmemset(tls, unsafe.Pointer(&_apOld), int32(0), uint64(_i+int32(1))*uint64(8))
 62962  		goto _balance_cleanup
 62963  	}
 62964  	_nMaxCells += (int32(1) + int32((*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i))).XnCell)) + int32((*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i))).XnOverflow)
 62965  	if postInc2(&_i, -1) == int32(0) {
 62966  		goto _23
 62967  	}
 62968  	if (_pParent.XnOverflow != 0) && ((_i + _nxDiv) == int32(*elem20((*uint16)(unsafe.Pointer(&_pParent.XaiOvfl)), 0))) {
 62969  		*elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i)) = *elem89((**uint8)(unsafe.Pointer(&_pParent.XapOvfl)), 0)
 62970  		_pgno = _sqlite3Get4byte(tls, *elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i)))
 62971  		*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 62972  			v := _pParent.XxCellSize
 62973  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 62974  		}()(tls, _pParent, *elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))))
 62975  		_pParent.XnOverflow = 0
 62976  		goto _28
 62977  	}
 62978  	*elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.XaData)) + uintptr(int32(_pParent.XmaskPage)&((int32(*elem15(elem15(_pParent.XaCellIdx, uintptr(int32(2)*((_i+_nxDiv)-int32(_pParent.XnOverflow)))), 0))<<8)|int32(*elem15(elem15(_pParent.XaCellIdx, uintptr(int32(2)*((_i+_nxDiv)-int32(_pParent.XnOverflow)))), uintptr(1)))))))
 62979  	_pgno = _sqlite3Get4byte(tls, *elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i)))
 62980  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 62981  		v := _pParent.XxCellSize
 62982  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 62983  	}()(tls, _pParent, *elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))))
 62984  	if (int32(_pBt.XbtsFlags) & int32(4)) == 0 {
 62985  		goto _29
 62986  	}
 62987  	_13_iOff = int32(int64(crt.P2U(unsafe.Pointer(*elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i)))))) - int32(int64(crt.P2U(unsafe.Pointer(_pParent.XaData))))
 62988  	if (_13_iOff + (*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)))) > int32(_pBt.XusableSize) {
 62989  		_rc = _sqlite3CorruptError(tls, int32(66253))
 62990  		crt.Xmemset(tls, unsafe.Pointer(&_apOld), int32(0), uint64(_i+int32(1))*uint64(8))
 62991  		goto _balance_cleanup
 62992  	}
 62993  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_aOvflSpace, uintptr(_13_iOff))), unsafe.Pointer(*elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))), uint64(*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i))))
 62994  	*elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i)) = elem15(_aOvflSpace, uintptr(int64(uintptr(unsafe.Pointer(*elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))))-uintptr(unsafe.Pointer(_pParent.XaData)))))
 62995  _29:
 62996  	_dropCell(tls, _pParent, (_i+_nxDiv)-int32(_pParent.XnOverflow), *elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)), &_rc)
 62997  _28:
 62998  	goto _22
 62999  _23:
 63000  	_nMaxCells = (_nMaxCells + int32(3)) & int32(-4)
 63001  	_szScratch = int32(((uint64(_nMaxCells) * uint64(8)) + (uint64(_nMaxCells) * uint64(2))) + uint64(_pBt.XpageSize))
 63002  	func() {
 63003  		if _szScratch > (int32(6) * int32(_pBt.XpageSize)) {
 63004  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66279), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82060)))
 63005  			crt.X__builtin_abort(tls)
 63006  		}
 63007  	}()
 63008  	_b.XapCell = (**uint8)(_sqlite3ScratchMalloc(tls, _szScratch))
 63009  	if _b.XapCell == nil {
 63010  		_rc = _sqlite3NomemError(tls, int32(66282))
 63011  		goto _balance_cleanup
 63012  	}
 63013  	_b.XszCell = (*uint16)(unsafe.Pointer(elem89(_b.XapCell, uintptr(_nMaxCells))))
 63014  	_aSpace1 = (*uint8)(unsafe.Pointer(elem20(_b.XszCell, uintptr(_nMaxCells))))
 63015  	func() {
 63016  		if (int64(uintptr(unsafe.Pointer(_aSpace1))) & int64(7)) != (0) {
 63017  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66287), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82092)))
 63018  			crt.X__builtin_abort(tls)
 63019  		}
 63020  	}()
 63021  	*(**XMemPage)(unsafe.Pointer(&_b.XpRef)) = *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), 0)
 63022  	_leafCorrection = uint16(int32((*XMemPage)(_b.XpRef).Xleaf) * int32(4))
 63023  	_leafData = int32((*XMemPage)(_b.XpRef).XintKeyLeaf)
 63024  	_i = int32(0)
 63025  _37:
 63026  	if _i >= _nOld {
 63027  		goto _40
 63028  	}
 63029  	_17_pOld = *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i))
 63030  	_17_limit = int32(_17_pOld.XnCell)
 63031  	_17_aData = _17_pOld.XaData
 63032  	_17_maskPage = _17_pOld.XmaskPage
 63033  	_17_piCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(_17_pOld.XcellOffset)))
 63034  	if int32(*elem15(_17_pOld.XaData, 0)) != int32(*elem15((*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), 0)).XaData, 0)) {
 63035  		_rc = _sqlite3CorruptError(tls, int32(66320))
 63036  		goto _balance_cleanup
 63037  	}
 63038  	crt.Xmemset(tls, unsafe.Pointer(elem20(_b.XszCell, uintptr(_b.XnCell))), int32(0), uint64(2)*uint64(_17_limit+int32(_17_pOld.XnOverflow)))
 63039  	if int32(_17_pOld.XnOverflow) <= int32(0) {
 63040  		goto _42
 63041  	}
 63042  	_17_limit = int32(*elem20((*uint16)(unsafe.Pointer(&_17_pOld.XaiOvfl)), 0))
 63043  	_j = int32(0)
 63044  _43:
 63045  	if _j >= _17_limit {
 63046  		goto _46
 63047  	}
 63048  	*elem89(_b.XapCell, uintptr(_b.XnCell)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(int32(_17_maskPage)&((int32(*elem15(_17_piCell, 0))<<8)|int32(*elem15(_17_piCell, uintptr(1)))))))
 63049  	*(*uintptr)(unsafe.Pointer(&_17_piCell)) += uintptr(int32(2))
 63050  	_b.XnCell += 1
 63051  	_j += 1
 63052  	goto _43
 63053  _46:
 63054  	_k = int32(0)
 63055  _47:
 63056  	if _k >= int32(_17_pOld.XnOverflow) {
 63057  		goto _50
 63058  	}
 63059  	func() {
 63060  		if _k != int32(0) && (int32(*elem20((*uint16)(unsafe.Pointer(&_17_pOld.XaiOvfl)), uintptr(_k-int32(1))))+int32(1)) != int32(*elem20((*uint16)(unsafe.Pointer(&_17_pOld.XaiOvfl)), uintptr(_k))) {
 63061  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66350), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82122)))
 63062  			crt.X__builtin_abort(tls)
 63063  		}
 63064  	}()
 63065  	*elem89(_b.XapCell, uintptr(_b.XnCell)) = *elem89((**uint8)(unsafe.Pointer(&_17_pOld.XapOvfl)), uintptr(_k))
 63066  	_b.XnCell += 1
 63067  	_k += 1
 63068  	goto _47
 63069  _50:
 63070  _42:
 63071  	_17_piEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData))+uintptr(_17_pOld.XcellOffset))))) + uintptr(int32(2)*int32(_17_pOld.XnCell))))
 63072  _54:
 63073  	if crt.P2U(unsafe.Pointer(_17_piCell)) < crt.P2U(unsafe.Pointer(_17_piEnd)) {
 63074  		func() {
 63075  			if _b.XnCell >= _nMaxCells {
 63076  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66357), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82167)))
 63077  				crt.X__builtin_abort(tls)
 63078  			}
 63079  		}()
 63080  		*elem89(_b.XapCell, uintptr(_b.XnCell)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(int32(_17_maskPage)&((int32(*elem15(_17_piCell, 0))<<8)|int32(*elem15(_17_piCell, uintptr(1)))))))
 63081  		*(*uintptr)(unsafe.Pointer(&_17_piCell)) += uintptr(int32(2))
 63082  		_b.XnCell += 1
 63083  		goto _54
 63084  	}
 63085  	*elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_i)) = _b.XnCell
 63086  	if _i >= (_nOld-int32(1)) || _leafData != 0 {
 63087  		goto _59
 63088  	}
 63089  	_23_sz = uint16(*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)))
 63090  	func() {
 63091  		if _b.XnCell >= _nMaxCells {
 63092  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66367), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82167)))
 63093  			crt.X__builtin_abort(tls)
 63094  		}
 63095  	}()
 63096  	*elem20(_b.XszCell, uintptr(_b.XnCell)) = _23_sz
 63097  	_23_pTemp = elem15(_aSpace1, uintptr(_iSpace1))
 63098  	_iSpace1 += int32(_23_sz)
 63099  	func() {
 63100  		if int32(_23_sz) > (int32(_pBt.XmaxLocal) + int32(23)) {
 63101  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66371), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82185)))
 63102  			crt.X__builtin_abort(tls)
 63103  		}
 63104  	}()
 63105  	func() {
 63106  		if _iSpace1 > int32(_pBt.XpageSize) {
 63107  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66372), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82206)))
 63108  			crt.X__builtin_abort(tls)
 63109  		}
 63110  	}()
 63111  	crt.Xmemcpy(tls, unsafe.Pointer(_23_pTemp), unsafe.Pointer(*elem89((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))), uint64(_23_sz))
 63112  	*elem89(_b.XapCell, uintptr(_b.XnCell)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_23_pTemp)) + uintptr(_leafCorrection)))
 63113  	func() {
 63114  		if int32(_leafCorrection) != int32(0) && int32(_leafCorrection) != int32(4) {
 63115  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66375), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82236)))
 63116  			crt.X__builtin_abort(tls)
 63117  		}
 63118  	}()
 63119  	*elem20(_b.XszCell, uintptr(_b.XnCell)) = uint16(int32(*elem20(_b.XszCell, uintptr(_b.XnCell))) - int32(_leafCorrection))
 63120  	if _17_pOld.Xleaf == 0 {
 63121  		func() {
 63122  			if int32(_leafCorrection) != int32(0) {
 63123  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66378), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82275)))
 63124  				crt.X__builtin_abort(tls)
 63125  			}
 63126  		}()
 63127  		func() {
 63128  			if int32(_17_pOld.XhdrOffset) != int32(0) {
 63129  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66379), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82293)))
 63130  				crt.X__builtin_abort(tls)
 63131  			}
 63132  		}()
 63133  		crt.Xmemcpy(tls, unsafe.Pointer(*elem89(_b.XapCell, uintptr(_b.XnCell))), unsafe.Pointer(elem15(_17_pOld.XaData, uintptr(8))), uint64(4))
 63134  		goto _74
 63135  	}
 63136  	func() {
 63137  		if int32(_leafCorrection) != int32(4) {
 63138  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66384), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82312)))
 63139  			crt.X__builtin_abort(tls)
 63140  		}
 63141  	}()
 63142  _77:
 63143  	if int32(*elem20(_b.XszCell, uintptr(_b.XnCell))) < int32(4) {
 63144  		func() {
 63145  			if int32(*elem20(_b.XszCell, uintptr(_b.XnCell))) != int32(3) && _sqlite3Config.XneverCorrupt != int32(0) {
 63146  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66388), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82330)))
 63147  				crt.X__builtin_abort(tls)
 63148  			}
 63149  		}()
 63150  		func() {
 63151  			if (*elem89(_b.XapCell, uintptr(_b.XnCell))) != elem15(_aSpace1, uintptr(_iSpace1-int32(3))) && _sqlite3Config.XneverCorrupt != int32(0) {
 63152  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66389), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82365)))
 63153  				crt.X__builtin_abort(tls)
 63154  			}
 63155  		}()
 63156  		*elem15(_aSpace1, uintptr(postInc2(&_iSpace1, 1))) = 0
 63157  		*elem20(_b.XszCell, uintptr(_b.XnCell)) += 1
 63158  		goto _77
 63159  	}
 63160  _74:
 63161  	_b.XnCell += 1
 63162  _59:
 63163  	_i += 1
 63164  	goto _37
 63165  _40:
 63166  	_usableSpace = int32((_pBt.XusableSize - uint32(12)) + uint32(_leafCorrection))
 63167  	_i = int32(0)
 63168  _85:
 63169  	if _i >= _nOld {
 63170  		goto _88
 63171  	}
 63172  	_27_p = *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i))
 63173  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) = _usableSpace - int32(_27_p.XnFree)
 63174  	_j = int32(0)
 63175  _89:
 63176  	if _j >= int32(_27_p.XnOverflow) {
 63177  		goto _92
 63178  	}
 63179  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) += int32(2) + int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 63180  		v := _27_p.XxCellSize
 63181  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 63182  	}()(tls, _27_p, *elem89((**uint8)(unsafe.Pointer(&_27_p.XapOvfl)), uintptr(_j))))
 63183  	_j += 1
 63184  	goto _89
 63185  _92:
 63186  	*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i)) = *elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_i))
 63187  	_i += 1
 63188  	goto _85
 63189  _88:
 63190  	_k = _nOld
 63191  	_i = int32(0)
 63192  _93:
 63193  	if _i >= _k {
 63194  		goto _96
 63195  	}
 63196  _97:
 63197  	if (*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i))) <= _usableSpace {
 63198  		goto _98
 63199  	}
 63200  	if (_i + int32(1)) < _k {
 63201  		goto _99
 63202  	}
 63203  	_k = _i + int32(2)
 63204  	if _k > int32(5) {
 63205  		_rc = _sqlite3CorruptError(tls, int32(66429))
 63206  		goto _balance_cleanup
 63207  	}
 63208  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_k-int32(1))) = int32(0)
 63209  	*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_k-int32(1))) = _b.XnCell
 63210  _99:
 63211  	_29_sz = int32(2) + int32(_cachedCellSize(tls, &_b, (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i)))-int32(1)))
 63212  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) -= _29_sz
 63213  	if _leafData != 0 {
 63214  		goto _101
 63215  	}
 63216  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))) < _b.XnCell {
 63217  		_29_sz = int32(2) + int32(_cachedCellSize(tls, &_b, *elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))))
 63218  		goto _103
 63219  	}
 63220  	_29_sz = int32(0)
 63221  _103:
 63222  _101:
 63223  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i+int32(1))) += _29_sz
 63224  	*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i)) -= 1
 63225  	goto _97
 63226  _98:
 63227  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))) >= _b.XnCell {
 63228  		goto _105
 63229  	}
 63230  	_29_sz = int32(2) + int32(_cachedCellSize(tls, &_b, *elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))))
 63231  	if ((*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i))) + _29_sz) > _usableSpace {
 63232  		goto _105
 63233  	}
 63234  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) += _29_sz
 63235  	*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i)) += 1
 63236  	if _leafData != 0 {
 63237  		goto _107
 63238  	}
 63239  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))) < _b.XnCell {
 63240  		_29_sz = int32(2) + int32(_cachedCellSize(tls, &_b, *elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))))
 63241  		goto _109
 63242  	}
 63243  	_29_sz = int32(0)
 63244  _109:
 63245  _107:
 63246  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i+int32(1))) -= _29_sz
 63247  	goto _98
 63248  _105:
 63249  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))) >= _b.XnCell {
 63250  		_k = _i + int32(1)
 63251  		goto _114
 63252  	}
 63253  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))) <= func() int32 {
 63254  		if _i > int32(0) {
 63255  			return (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i-int32(1))))
 63256  		}
 63257  		return int32(0)
 63258  	}() {
 63259  		_rc = _sqlite3CorruptError(tls, int32(66462))
 63260  		goto _balance_cleanup
 63261  	}
 63262  _114:
 63263  	_i += 1
 63264  	goto _93
 63265  _96:
 63266  	_i = _k - int32(1)
 63267  _115:
 63268  	if _i <= int32(0) {
 63269  		goto _118
 63270  	}
 63271  	_42_szRight = *elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i))
 63272  	_42_szLeft = *elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i-int32(1)))
 63273  	_42_r = (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i-int32(1)))) - int32(1)
 63274  	_42_d = (_42_r + int32(1)) - _leafData
 63275  	_cachedCellSize(tls, &_b, _42_d)
 63276  _119:
 63277  	func() {
 63278  		if _42_d >= _nMaxCells {
 63279  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66488), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82418)))
 63280  			crt.X__builtin_abort(tls)
 63281  		}
 63282  	}()
 63283  	func() {
 63284  		if _42_r >= _nMaxCells {
 63285  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66489), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82430)))
 63286  			crt.X__builtin_abort(tls)
 63287  		}
 63288  	}()
 63289  	_cachedCellSize(tls, &_b, _42_r)
 63290  	if (_42_szRight != int32(0)) && (_bBulk != 0 || (((_42_szRight + int32(*elem20(_b.XszCell, uintptr(_42_d)))) + int32(2)) > (_42_szLeft - (int32(*elem20(_b.XszCell, uintptr(_42_r))) + func() int32 {
 63291  		if _i == (_k - int32(1)) {
 63292  			return int32(0)
 63293  		}
 63294  		return int32(2)
 63295  	}())))) {
 63296  		goto _129
 63297  	}
 63298  	_42_szRight += int32(*elem20(_b.XszCell, uintptr(_42_d))) + int32(2)
 63299  	_42_szLeft -= int32(*elem20(_b.XszCell, uintptr(_42_r))) + int32(2)
 63300  	*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i-int32(1))) = _42_r
 63301  	_42_r -= 1
 63302  	_42_d -= 1
 63303  	if _42_r >= int32(0) {
 63304  		goto _119
 63305  	}
 63306  _129:
 63307  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) = _42_szRight
 63308  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i-int32(1))) = _42_szLeft
 63309  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i-int32(1)))) <= func() int32 {
 63310  		if _i > int32(1) {
 63311  			return (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i-int32(2))))
 63312  		}
 63313  		return int32(0)
 63314  	}() {
 63315  		_rc = _sqlite3CorruptError(tls, int32(66504))
 63316  		goto _balance_cleanup
 63317  	}
 63318  	_i -= 1
 63319  	goto _115
 63320  _118:
 63321  	func() {
 63322  		if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), 0)) <= int32(0) && (_pParent.Xpgno != uint32(1) || int32(_pParent.XnCell) != int32(0)) && _sqlite3Config.XneverCorrupt != int32(0) {
 63323  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66516), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82442)))
 63324  			crt.X__builtin_abort(tls)
 63325  		}
 63326  	}()
 63327  	_pageFlags = int32(*elem15((*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), 0)).XaData, 0))
 63328  	_i = int32(0)
 63329  _138:
 63330  	if _i >= _k {
 63331  		goto _141
 63332  	}
 63333  	if _i >= _nOld {
 63334  		goto _142
 63335  	}
 63336  	_46_pNew = store86(elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i)), *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i)))
 63337  	*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i)) = nil
 63338  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_46_pNew.XpDbPage))
 63339  	_nNew += 1
 63340  	if _rc != 0 {
 63341  		goto _balance_cleanup
 63342  	}
 63343  	goto _144
 63344  _142:
 63345  	func() {
 63346  		if _i <= int32(0) {
 63347  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66536), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(12925)))
 63348  			crt.X__builtin_abort(tls)
 63349  		}
 63350  	}()
 63351  	_rc = _allocateBtreePage(tls, _pBt, &_46_pNew, &_pgno, func() uint32 {
 63352  		if _bBulk != 0 {
 63353  			return uint32(1)
 63354  		}
 63355  		return _pgno
 63356  	}(), 0)
 63357  	if _rc != 0 {
 63358  		goto _balance_cleanup
 63359  	}
 63360  	_zeroPage(tls, _46_pNew, _pageFlags)
 63361  	*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i)) = _46_pNew
 63362  	_nNew += 1
 63363  	*elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_i)) = _b.XnCell
 63364  	if _pBt.XautoVacuum == 0 {
 63365  		goto _150
 63366  	}
 63367  	_ptrmapPut(tls, _pBt, _46_pNew.Xpgno, uint8(5), _pParent.Xpgno, &_rc)
 63368  	if _rc != int32(0) {
 63369  		goto _balance_cleanup
 63370  	}
 63371  _150:
 63372  _144:
 63373  	_i += 1
 63374  	goto _138
 63375  _141:
 63376  	_i = int32(0)
 63377  _152:
 63378  	if _i >= _nNew {
 63379  		goto _155
 63380  	}
 63381  	*elem31((*uint32)(unsafe.Pointer(&_aPgOrder)), uintptr(_i)) = store34(elem31((*uint32)(unsafe.Pointer(&_aPgno)), uintptr(_i)), (*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).Xpgno)
 63382  	*elem20((*uint16)(unsafe.Pointer(&_aPgFlags)), uintptr(_i)) = (*XPgHdr)((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).XpDbPage).Xflags
 63383  	_j = int32(0)
 63384  _156:
 63385  	if _j >= _i {
 63386  		goto _159
 63387  	}
 63388  	if (*elem31((*uint32)(unsafe.Pointer(&_aPgno)), uintptr(_j))) == (*elem31((*uint32)(unsafe.Pointer(&_aPgno)), uintptr(_i))) {
 63389  		func() {
 63390  			if _sqlite3Config.XneverCorrupt != int32(0) {
 63391  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66577), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82511)))
 63392  				crt.X__builtin_abort(tls)
 63393  			}
 63394  		}()
 63395  		_rc = _sqlite3CorruptError(tls, int32(66578))
 63396  		goto _balance_cleanup
 63397  	}
 63398  	_j += 1
 63399  	goto _156
 63400  _159:
 63401  	_i += 1
 63402  	goto _152
 63403  _155:
 63404  	_i = int32(0)
 63405  _163:
 63406  	if _i >= _nNew {
 63407  		goto _166
 63408  	}
 63409  	_54_iBest = int32(0)
 63410  	_j = int32(1)
 63411  _167:
 63412  	if _j >= _nNew {
 63413  		goto _170
 63414  	}
 63415  	if (*elem31((*uint32)(unsafe.Pointer(&_aPgOrder)), uintptr(_j))) < (*elem31((*uint32)(unsafe.Pointer(&_aPgOrder)), uintptr(_54_iBest))) {
 63416  		_54_iBest = _j
 63417  	}
 63418  	_j += 1
 63419  	goto _167
 63420  _170:
 63421  	_pgno = *elem31((*uint32)(unsafe.Pointer(&_aPgOrder)), uintptr(_54_iBest))
 63422  	*elem31((*uint32)(unsafe.Pointer(&_aPgOrder)), uintptr(_54_iBest)) = uint32(4294967295)
 63423  	if _54_iBest == _i {
 63424  		goto _172
 63425  	}
 63426  	if _54_iBest > _i {
 63427  		_sqlite3PagerRekey(tls, (*XPgHdr)((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_54_iBest))).XpDbPage), (_pBt.XnPage+uint32(_54_iBest))+uint32(1), 0)
 63428  	}
 63429  	_sqlite3PagerRekey(tls, (*XPgHdr)((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).XpDbPage), _pgno, *elem20((*uint16)(unsafe.Pointer(&_aPgFlags)), uintptr(_54_iBest)))
 63430  	(*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).Xpgno = _pgno
 63431  _172:
 63432  	_i += 1
 63433  	goto _163
 63434  _166:
 63435  	func() {
 63436  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.XpDbPage)) == 0 {
 63437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66612), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(81705)))
 63438  			crt.X__builtin_abort(tls)
 63439  		}
 63440  	}()
 63441  	_sqlite3Put4byte(tls, _pRight, (*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_nNew-int32(1)))).Xpgno)
 63442  	if ((_pageFlags & int32(8)) == int32(0)) && (_nOld != _nNew) {
 63443  		_58_pOld = *elem30(func() **XMemPage {
 63444  			if _nNew > _nOld {
 63445  				return (**XMemPage)(unsafe.Pointer(&_apNew))
 63446  			}
 63447  			return (**XMemPage)(unsafe.Pointer(&_apOld))
 63448  		}(), uintptr(_nOld-int32(1)))
 63449  		crt.Xmemcpy(tls, unsafe.Pointer(elem15((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_nNew-int32(1)))).XaData, uintptr(8))), unsafe.Pointer(elem15(_58_pOld.XaData, uintptr(8))), uint64(4))
 63450  	}
 63451  	if _pBt.XautoVacuum == 0 {
 63452  		goto _180
 63453  	}
 63454  	_59_pNew = *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0)
 63455  	_59_aOld = _59_pNew.XaData
 63456  	_59_cntOldNext = int32(_59_pNew.XnCell) + int32(_59_pNew.XnOverflow)
 63457  	_59_usableSize = int32(_pBt.XusableSize)
 63458  	_59_iNew = int32(0)
 63459  	_59_iOld = int32(0)
 63460  	_i = int32(0)
 63461  _181:
 63462  	if _i >= _b.XnCell {
 63463  		goto _184
 63464  	}
 63465  	_60_pCell = *elem89(_b.XapCell, uintptr(_i))
 63466  	if _i == _59_cntOldNext {
 63467  		_61_pOld = func() *XMemPage {
 63468  			if preInc2(&_59_iOld, 1) < _nNew {
 63469  				return (*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_59_iOld)))
 63470  			}
 63471  			return (*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_59_iOld)))
 63472  		}()
 63473  		_59_cntOldNext += (int32(_61_pOld.XnCell) + int32(_61_pOld.XnOverflow)) + bool2int(_leafData == 0)
 63474  		_59_aOld = _61_pOld.XaData
 63475  	}
 63476  	if _i != (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_59_iNew))) {
 63477  		goto _188
 63478  	}
 63479  	_59_pNew = *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(preInc2(&_59_iNew, 1)))
 63480  	if _leafData == 0 {
 63481  		goto _182
 63482  	}
 63483  _188:
 63484  	if _59_iOld < _nNew && _59_pNew.Xpgno == (*elem31((*uint32)(unsafe.Pointer(&_aPgno)), uintptr(_59_iOld))) && (uint64(crt.P2U(unsafe.Pointer(_60_pCell))) >= uint64(crt.P2U(unsafe.Pointer(_59_aOld))) && uint64(crt.P2U(unsafe.Pointer(_60_pCell))) < uint64(crt.P2U(unsafe.Pointer(elem15(_59_aOld, uintptr(_59_usableSize)))))) {
 63485  		goto _193
 63486  	}
 63487  	if _leafCorrection == 0 {
 63488  		_ptrmapPut(tls, _pBt, _sqlite3Get4byte(tls, _60_pCell), uint8(5), _59_pNew.Xpgno, &_rc)
 63489  	}
 63490  	if int32(_cachedCellSize(tls, &_b, _i)) > int32(_59_pNew.XminLocal) {
 63491  		_ptrmapPutOvflPtr(tls, _59_pNew, _60_pCell, &_rc)
 63492  	}
 63493  	if _rc != 0 {
 63494  		goto _balance_cleanup
 63495  	}
 63496  _193:
 63497  _182:
 63498  	_i += 1
 63499  	goto _181
 63500  _184:
 63501  _180:
 63502  	_i = int32(0)
 63503  _197:
 63504  	if _i >= (_nNew - int32(1)) {
 63505  		goto _200
 63506  	}
 63507  	_66_pNew = *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))
 63508  	_j = *elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))
 63509  	func() {
 63510  		if _j >= _nMaxCells {
 63511  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66688), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82522)))
 63512  			crt.X__builtin_abort(tls)
 63513  		}
 63514  	}()
 63515  	func() {
 63516  		if (*elem89(_b.XapCell, uintptr(_j))) == nil {
 63517  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66689), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82534)))
 63518  			crt.X__builtin_abort(tls)
 63519  		}
 63520  	}()
 63521  	_66_pCell = *elem89(_b.XapCell, uintptr(_j))
 63522  	_66_sz = int32(*elem20(_b.XszCell, uintptr(_j))) + int32(_leafCorrection)
 63523  	_66_pTemp = elem15(_aOvflSpace, uintptr(_iOvflSpace))
 63524  	if _66_pNew.Xleaf == 0 {
 63525  		crt.Xmemcpy(tls, unsafe.Pointer(elem15(_66_pNew.XaData, uintptr(8))), unsafe.Pointer(_66_pCell), uint64(4))
 63526  		goto _208
 63527  	}
 63528  	if _leafData != 0 {
 63529  		_j -= 1
 63530  		func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 63531  			v := _66_pNew.XxParseCell
 63532  			return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 63533  		}()(tls, _66_pNew, *elem89(_b.XapCell, uintptr(_j)), &_68_info)
 63534  		_66_pCell = _66_pTemp
 63535  		_66_sz = int32(4) + _sqlite3PutVarint(tls, elem15(_66_pCell, uintptr(4)), uint64(_68_info.XnKey))
 63536  		_66_pTemp = nil
 63537  		goto _208
 63538  	}
 63539  	*(*uintptr)(unsafe.Pointer(&_66_pCell)) -= uintptr(int32(4))
 63540  	if int32(*elem20(_b.XszCell, uintptr(_j))) == int32(4) {
 63541  		func() {
 63542  			if int32(_leafCorrection) != int32(4) {
 63543  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66721), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82312)))
 63544  				crt.X__builtin_abort(tls)
 63545  			}
 63546  		}()
 63547  		_66_sz = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 63548  			v := _pParent.XxCellSize
 63549  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 63550  		}()(tls, _pParent, _66_pCell))
 63551  	}
 63552  _208:
 63553  	_iOvflSpace += _66_sz
 63554  	func() {
 63555  		if _66_sz > (int32(_pBt.XmaxLocal) + int32(23)) {
 63556  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66726), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82185)))
 63557  			crt.X__builtin_abort(tls)
 63558  		}
 63559  	}()
 63560  	func() {
 63561  		if _iOvflSpace > int32(_pBt.XpageSize) {
 63562  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66727), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82549)))
 63563  			crt.X__builtin_abort(tls)
 63564  		}
 63565  	}()
 63566  	_insertCell(tls, _pParent, _nxDiv+_i, _66_pCell, _66_sz, _66_pTemp, _66_pNew.Xpgno, &_rc)
 63567  	if _rc != int32(0) {
 63568  		goto _balance_cleanup
 63569  	}
 63570  	func() {
 63571  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.XpDbPage)) == 0 {
 63572  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66730), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(81705)))
 63573  			crt.X__builtin_abort(tls)
 63574  		}
 63575  	}()
 63576  	_i += 1
 63577  	goto _197
 63578  _200:
 63579  	_i = int32(1) - _nNew
 63580  _219:
 63581  	if _i >= _nNew {
 63582  		goto _222
 63583  	}
 63584  	_71_iPg = func() int32 {
 63585  		if _i < int32(0) {
 63586  			return (-_i)
 63587  		}
 63588  		return _i
 63589  	}()
 63590  	func() {
 63591  		if _71_iPg < int32(0) || _71_iPg >= _nNew {
 63592  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66757), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82582)))
 63593  			crt.X__builtin_abort(tls)
 63594  		}
 63595  	}()
 63596  	if (*elem15((*uint8)(unsafe.Pointer(&_abDone)), uintptr(_71_iPg))) != 0 {
 63597  		goto _220
 63598  	}
 63599  	if _i < int32(0) && (*elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_71_iPg-int32(1)))) < (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_71_iPg-int32(1)))) {
 63600  		goto _230
 63601  	}
 63602  	func() {
 63603  		if _71_iPg != int32(0) && (*elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_71_iPg-int32(1)))) < (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_71_iPg-int32(1)))) && (*elem15((*uint8)(unsafe.Pointer(&_abDone)), uintptr(_71_iPg-int32(1)))) == 0 {
 63604  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66768), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82601)))
 63605  			crt.X__builtin_abort(tls)
 63606  		}
 63607  	}()
 63608  	func() {
 63609  		if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_71_iPg))) < (*elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_71_iPg))) && (*elem15((*uint8)(unsafe.Pointer(&_abDone)), uintptr(_71_iPg+int32(1)))) == 0 {
 63610  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66772), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82657)))
 63611  			crt.X__builtin_abort(tls)
 63612  		}
 63613  	}()
 63614  	if _71_iPg == int32(0) {
 63615  		_72_iNew = store2(&_72_iOld, int32(0))
 63616  		_72_nNewCell = *elem8((*int32)(unsafe.Pointer(&_cntNew)), 0)
 63617  		goto _239
 63618  	}
 63619  	_72_iOld = func() int32 {
 63620  		if _71_iPg < _nOld {
 63621  			return ((*elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_71_iPg-int32(1)))) + bool2int(_leafData == 0))
 63622  		}
 63623  		return _b.XnCell
 63624  	}()
 63625  	_72_iNew = (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_71_iPg-int32(1)))) + bool2int(_leafData == 0)
 63626  	_72_nNewCell = (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_71_iPg))) - _72_iNew
 63627  _239:
 63628  	_rc = _editPage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_71_iPg)), _72_iOld, _72_iNew, _72_nNewCell, &_b)
 63629  	if _rc != 0 {
 63630  		goto _balance_cleanup
 63631  	}
 63632  	*elem15((*uint8)(unsafe.Pointer(&_abDone)), uintptr(_71_iPg)) += 1
 63633  	(*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_71_iPg))).XnFree = uint16(_usableSpace - (*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_71_iPg))))
 63634  	func() {
 63635  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_71_iPg))).XnOverflow) != int32(0) {
 63636  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66787), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82699)))
 63637  			crt.X__builtin_abort(tls)
 63638  		}
 63639  	}()
 63640  	func() {
 63641  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_71_iPg))).XnCell) != _72_nNewCell {
 63642  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66788), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82724)))
 63643  			crt.X__builtin_abort(tls)
 63644  		}
 63645  	}()
 63646  _230:
 63647  _220:
 63648  	_i += 1
 63649  	goto _219
 63650  _222:
 63651  	func() {
 63652  		if crt.Xmemcmp(tls, unsafe.Pointer(&_abDone), unsafe.Pointer(str(82752)), uint64(_nNew)) != int32(0) {
 63653  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66793), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82758)))
 63654  			crt.X__builtin_abort(tls)
 63655  		}
 63656  	}()
 63657  	func() {
 63658  		if _nOld <= int32(0) {
 63659  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66795), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82801)))
 63660  			crt.X__builtin_abort(tls)
 63661  		}
 63662  	}()
 63663  	func() {
 63664  		if _nNew <= int32(0) {
 63665  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66796), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82808)))
 63666  			crt.X__builtin_abort(tls)
 63667  		}
 63668  	}()
 63669  	if (_isRoot != 0 && (int32(_pParent.XnCell) == int32(0))) && (int32(_pParent.XhdrOffset) <= int32((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0)).XnFree)) {
 63670  		func() {
 63671  			if _nNew != int32(1) && _sqlite3Config.XneverCorrupt != int32(0) {
 63672  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66814), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82815)))
 63673  				crt.X__builtin_abort(tls)
 63674  			}
 63675  		}()
 63676  		_rc = _defragmentPage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0), int32(-1))
 63677  		func() {
 63678  			if int32((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0)).XnFree) != ((((int32(*elem15(elem15((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0)).XaData, uintptr(5)), 0))<<8)|int32(*elem15(elem15((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0)).XaData, uintptr(5)), uintptr(1))))-int32((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0)).XcellOffset))-(int32((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0)).XnCell)*int32(2))) && _rc == int32(0) {
 63679  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66817), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82837)))
 63680  				crt.X__builtin_abort(tls)
 63681  			}
 63682  		}()
 63683  		_copyNodeContent(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0), _pParent, &_rc)
 63684  		_freePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0), &_rc)
 63685  		goto _264
 63686  	}
 63687  	if _pBt.XautoVacuum == 0 || _leafCorrection != 0 {
 63688  		goto _264
 63689  	}
 63690  	_i = int32(0)
 63691  _265:
 63692  	if _i >= _nNew {
 63693  		goto _268
 63694  	}
 63695  	_77_key = _sqlite3Get4byte(tls, elem15((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).XaData, uintptr(8)))
 63696  	_ptrmapPut(tls, _pBt, _77_key, uint8(5), (*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).Xpgno, &_rc)
 63697  	_i += 1
 63698  	goto _265
 63699  _268:
 63700  _264:
 63701  	func() {
 63702  		if _pParent.XisInit == 0 {
 63703  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66833), unsafe.Pointer(&_balance_nonrootØ00__func__Ø000), unsafe.Pointer(str(82944)))
 63704  			crt.X__builtin_abort(tls)
 63705  		}
 63706  	}()
 63707  	_i = _nNew
 63708  _271:
 63709  	if _i >= _nOld {
 63710  		goto _balance_cleanup
 63711  	}
 63712  	_freePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i)), &_rc)
 63713  	_i += 1
 63714  	goto _271
 63715  _balance_cleanup:
 63716  	_sqlite3ScratchFree(tls, unsafe.Pointer(_b.XapCell))
 63717  	_i = int32(0)
 63718  _275:
 63719  	if _i >= _nOld {
 63720  		goto _278
 63721  	}
 63722  	_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i)))
 63723  	_i += 1
 63724  	goto _275
 63725  _278:
 63726  	_i = int32(0)
 63727  _279:
 63728  	if _i >= _nNew {
 63729  		goto _282
 63730  	}
 63731  	_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i)))
 63732  	_i += 1
 63733  	goto _279
 63734  _282:
 63735  	return _rc
 63736  
 63737  	_ = _apOld
 63738  	_ = _apNew
 63739  	_ = _apDiv
 63740  	_ = _cntNew
 63741  	_ = _cntOld
 63742  	_ = _szNew
 63743  	_ = _abDone
 63744  	_ = _aPgno
 63745  	_ = _aPgOrder
 63746  	_ = _aPgFlags
 63747  	panic(0)
 63748  }
 63749  
 63750  var _balance_nonrootØ00__func__Ø000 [16]int8
 63751  
 63752  func init() {
 63753  	crt.Xstrncpy(nil, &_balance_nonrootØ00__func__Ø000[0], str(82960), 16)
 63754  }
 63755  
 63756  // C comment
 63757  //  /*
 63758  //  ** Allocate memory that is to be used and released right away.
 63759  //  ** This routine is similar to alloca() in that it is not intended
 63760  //  ** for situations where the memory might be held long-term.  This
 63761  //  ** routine is intended to get memory to old large transient data
 63762  //  ** structures that would not normally fit on the stack of an
 63763  //  ** embedded processor.
 63764  //  */
 63765  func _sqlite3ScratchMalloc(tls *crt.TLS, _n int32) (r0 unsafe.Pointer) {
 63766  	var _p unsafe.Pointer
 63767  	func() {
 63768  		if _n <= int32(0) {
 63769  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24542), unsafe.Pointer(&_sqlite3ScratchMallocØ00__func__Ø000), unsafe.Pointer(str(1376)))
 63770  			crt.X__builtin_abort(tls)
 63771  		}
 63772  	}()
 63773  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 63774  	_sqlite3StatusHighwater(tls, int32(8), _n)
 63775  	if (_mem0.XnScratchFree != 0) && (_sqlite3Config.XszScratch >= _n) {
 63776  		_p = _mem0.XpScratchFree
 63777  		*(**XScratchFreeslot)(unsafe.Pointer(&_mem0.XpScratchFree)) = (*XScratchFreeslot)((*XScratchFreeslot)(_mem0.XpScratchFree).XpNext)
 63778  		_mem0.XnScratchFree -= 1
 63779  		_sqlite3StatusUp(tls, int32(3), int32(1))
 63780  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 63781  		goto _4
 63782  	}
 63783  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 63784  	_p = _sqlite3Malloc(tls, uint64(_n))
 63785  	if _sqlite3Config.XbMemstat != 0 && (_p != nil) {
 63786  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 63787  		_sqlite3StatusUp(tls, int32(4), _sqlite3MallocSize(tls, _p))
 63788  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 63789  	}
 63790  _4:
 63791  	func() {
 63792  		if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)(_mem0.Xmutex)) == 0 {
 63793  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24562), unsafe.Pointer(&_sqlite3ScratchMallocØ00__func__Ø000), unsafe.Pointer(str(82976)))
 63794  			crt.X__builtin_abort(tls)
 63795  		}
 63796  	}()
 63797  	return _p
 63798  }
 63799  
 63800  var _sqlite3ScratchMallocØ00__func__Ø000 [21]int8
 63801  
 63802  func init() {
 63803  	crt.Xstrncpy(nil, &_sqlite3ScratchMallocØ00__func__Ø000[0], str(83010), 21)
 63804  }
 63805  
 63806  func _cachedCellSize(tls *crt.TLS, _p *XCellArray, _N int32) (r0 uint16) {
 63807  	func() {
 63808  		if _N < int32(0) || _N >= _p.XnCell {
 63809  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65577), unsafe.Pointer(&_cachedCellSizeØ00__func__Ø000), unsafe.Pointer(str(83031)))
 63810  			crt.X__builtin_abort(tls)
 63811  		}
 63812  	}()
 63813  	if (*elem20(_p.XszCell, uintptr(_N))) != 0 {
 63814  		return *elem20(_p.XszCell, uintptr(_N))
 63815  	}
 63816  	return _computeCellSize(tls, _p, _N)
 63817  }
 63818  
 63819  var _cachedCellSizeØ00__func__Ø000 [15]int8
 63820  
 63821  func init() {
 63822  	crt.Xstrncpy(nil, &_cachedCellSizeØ00__func__Ø000[0], str(83050), 15)
 63823  }
 63824  
 63825  // C comment
 63826  //  /*
 63827  //  ** Return the size of the Nth element of the cell array
 63828  //  */
 63829  func _computeCellSize(tls *crt.TLS, _p *XCellArray, _N int32) (r0 uint16) {
 63830  	func() {
 63831  		if _N < int32(0) || _N >= _p.XnCell {
 63832  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65571), unsafe.Pointer(&_computeCellSizeØ00__func__Ø000), unsafe.Pointer(str(83031)))
 63833  			crt.X__builtin_abort(tls)
 63834  		}
 63835  	}()
 63836  	func() {
 63837  		if int32(*elem20(_p.XszCell, uintptr(_N))) != int32(0) {
 63838  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65572), unsafe.Pointer(&_computeCellSizeØ00__func__Ø000), unsafe.Pointer(str(83065)))
 63839  			crt.X__builtin_abort(tls)
 63840  		}
 63841  	}()
 63842  	*elem20(_p.XszCell, uintptr(_N)) = func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 63843  		v := (*XMemPage)(_p.XpRef).XxCellSize
 63844  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 63845  	}()(tls, (*XMemPage)(_p.XpRef), *elem89(_p.XapCell, uintptr(_N)))
 63846  	return *elem20(_p.XszCell, uintptr(_N))
 63847  }
 63848  
 63849  var _computeCellSizeØ00__func__Ø000 [16]int8
 63850  
 63851  func init() {
 63852  	crt.Xstrncpy(nil, &_computeCellSizeØ00__func__Ø000[0], str(83081), 16)
 63853  }
 63854  
 63855  // C comment
 63856  //  /*
 63857  //  ** The page handle passed as the first argument refers to a dirty page
 63858  //  ** with a page number other than iNew. This function changes the page's
 63859  //  ** page number to iNew and sets the value of the PgHdr.flags field to
 63860  //  ** the value passed as the third parameter.
 63861  //  */
 63862  func _sqlite3PagerRekey(tls *crt.TLS, _pPg *XPgHdr, _iNew uint32, _flags uint16) {
 63863  	func() {
 63864  		if _pPg.Xpgno == _iNew {
 63865  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54015), unsafe.Pointer(&_sqlite3PagerRekeyØ00__func__Ø000), unsafe.Pointer(str(83097)))
 63866  			crt.X__builtin_abort(tls)
 63867  		}
 63868  	}()
 63869  	_pPg.Xflags = _flags
 63870  	_sqlite3PcacheMove(tls, _pPg, _iNew)
 63871  }
 63872  
 63873  var _sqlite3PagerRekeyØ00__func__Ø000 [18]int8
 63874  
 63875  func init() {
 63876  	crt.Xstrncpy(nil, &_sqlite3PagerRekeyØ00__func__Ø000[0], str(83113), 18)
 63877  }
 63878  
 63879  // C comment
 63880  //  /*
 63881  //  ** apCell[] and szCell[] contains pointers to and sizes of all cells in the
 63882  //  ** pages being balanced.  The current page, pPg, has pPg->nCell cells starting
 63883  //  ** with apCell[iOld].  After balancing, this page should hold nNew cells
 63884  //  ** starting at apCell[iNew].
 63885  //  **
 63886  //  ** This routine makes the necessary adjustments to pPg so that it contains
 63887  //  ** the correct cells after being balanced.
 63888  //  **
 63889  //  ** The pPg->nFree field is invalid when this function returns. It is the
 63890  //  ** responsibility of the caller to set it correctly.
 63891  //  */
 63892  func _editPage(tls *crt.TLS, _pPg *XMemPage, _iOld int32, _iNew int32, _nNew int32, _pCArray *XCellArray) (r0 int32) {
 63893  	var _hdr, _nCell, _i, _iOldEnd, _iNewEnd, _1_nShift, _3_nAdd, _4_iCell, _6_iOff int32
 63894  	var _aData, _pBegin, _pData, _pCellptr, _pTmp, _6_pCell *uint8
 63895  	_aData = _pPg.XaData
 63896  	_hdr = int32(_pPg.XhdrOffset)
 63897  	_pBegin = elem15(_pPg.XaCellIdx, uintptr(_nNew*int32(2)))
 63898  	_nCell = int32(_pPg.XnCell)
 63899  	_iOldEnd = (_iOld + int32(_pPg.XnCell)) + int32(_pPg.XnOverflow)
 63900  	_iNewEnd = _iNew + _nNew
 63901  	_pTmp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPg.XpBt).XpPager)))
 63902  	crt.Xmemcpy(tls, unsafe.Pointer(_pTmp), unsafe.Pointer(_aData), uint64((*XBtShared)(_pPg.XpBt).XusableSize))
 63903  	if _iOld < _iNew {
 63904  		_1_nShift = _pageFreeArray(tls, _pPg, _iOld, _iNew-_iOld, _pCArray)
 63905  		crt.Xmemmove(tls, unsafe.Pointer(_pPg.XaCellIdx), unsafe.Pointer(elem15(_pPg.XaCellIdx, uintptr(_1_nShift*int32(2)))), uint64(_nCell*int32(2)))
 63906  		_nCell -= _1_nShift
 63907  	}
 63908  	if _iNewEnd < _iOldEnd {
 63909  		_nCell -= _pageFreeArray(tls, _pPg, _iNewEnd, _iOldEnd-_iNewEnd, _pCArray)
 63910  	}
 63911  	_pData = elem15(_aData, uintptr(((((int32(*elem15(elem15(_aData, uintptr(_hdr+int32(5))), 0))<<8)|int32(*elem15(elem15(_aData, uintptr(_hdr+int32(5))), uintptr(1))))-int32(1))&int32(65535))+int32(1)))
 63912  	if crt.P2U(unsafe.Pointer(_pData)) < crt.P2U(unsafe.Pointer(_pBegin)) {
 63913  		goto _editpage_fail
 63914  	}
 63915  	if _iNew >= _iOld {
 63916  		goto _3
 63917  	}
 63918  	_3_nAdd = func() int32 {
 63919  		if _nNew < (_iOld - _iNew) {
 63920  			return _nNew
 63921  		}
 63922  		return (_iOld - _iNew)
 63923  	}()
 63924  	func() {
 63925  		if (_iOld-_iNew) >= _nNew && _nCell != int32(0) && _sqlite3Config.XneverCorrupt != int32(0) {
 63926  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65805), unsafe.Pointer(&_editPageØ00__func__Ø000), unsafe.Pointer(str(83131)))
 63927  			crt.X__builtin_abort(tls)
 63928  		}
 63929  	}()
 63930  	_pCellptr = _pPg.XaCellIdx
 63931  	crt.Xmemmove(tls, unsafe.Pointer(elem15(_pCellptr, uintptr(_3_nAdd*int32(2)))), unsafe.Pointer(_pCellptr), uint64(_nCell*int32(2)))
 63932  	if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _iNew, _3_nAdd, _pCArray) != 0 {
 63933  		goto _editpage_fail
 63934  	}
 63935  	_nCell += _3_nAdd
 63936  _3:
 63937  	_i = int32(0)
 63938  _11:
 63939  	if _i >= int32(_pPg.XnOverflow) {
 63940  		goto _14
 63941  	}
 63942  	_4_iCell = (_iOld + int32(*elem20((*uint16)(unsafe.Pointer(&_pPg.XaiOvfl)), uintptr(_i)))) - _iNew
 63943  	if _4_iCell < int32(0) || _4_iCell >= _nNew {
 63944  		goto _16
 63945  	}
 63946  	_pCellptr = elem15(_pPg.XaCellIdx, uintptr(_4_iCell*int32(2)))
 63947  	crt.Xmemmove(tls, unsafe.Pointer(elem15(_pCellptr, uintptr(2))), unsafe.Pointer(_pCellptr), uint64((_nCell-_4_iCell)*int32(2)))
 63948  	_nCell += 1
 63949  	if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _4_iCell+_iNew, int32(1), _pCArray) != 0 {
 63950  		goto _editpage_fail
 63951  	}
 63952  _16:
 63953  	_i += 1
 63954  	goto _11
 63955  _14:
 63956  	_pCellptr = elem15(_pPg.XaCellIdx, uintptr(_nCell*int32(2)))
 63957  	if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _iNew+_nCell, _nNew-_nCell, _pCArray) != 0 {
 63958  		goto _editpage_fail
 63959  	}
 63960  	_pPg.XnCell = uint16(_nNew)
 63961  	_pPg.XnOverflow = 0
 63962  	*elem15(elem15(func() *uint8 {
 63963  		*elem15(elem15(_aData, uintptr(_hdr+int32(3))), 0) = uint8(int32(_pPg.XnCell) >> 8)
 63964  		return _aData
 63965  	}(), uintptr(_hdr+int32(3))), uintptr(1)) = uint8(_pPg.XnCell)
 63966  	*elem15(elem15(func() *uint8 {
 63967  		*elem15(elem15(_aData, uintptr(_hdr+int32(5))), 0) = uint8(int64(uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData))) >> 8)
 63968  		return _aData
 63969  	}(), uintptr(_hdr+int32(5))), uintptr(1)) = uint8(int64(uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))))
 63970  	_i = int32(0)
 63971  _19:
 63972  	if _i >= _nNew || _sqlite3Config.XneverCorrupt == int32(0) {
 63973  		goto _23
 63974  	}
 63975  	_6_pCell = *elem89(_pCArray.XapCell, uintptr(_i+_iNew))
 63976  	_6_iOff = (int32(*elem15(elem15(_pPg.XaCellIdx, uintptr(_i*int32(2))), 0)) << 8) | int32(*elem15(elem15(_pPg.XaCellIdx, uintptr(_i*int32(2))), uintptr(1)))
 63977  	if (uint64(crt.P2U(unsafe.Pointer(_6_pCell))) >= uint64(crt.P2U(unsafe.Pointer(_aData)))) && (uint64(crt.P2U(unsafe.Pointer(_6_pCell))) < uint64(crt.P2U(unsafe.Pointer(elem15(_aData, uintptr((*XBtShared)(_pPg.XpBt).XusableSize)))))) {
 63978  		_6_pCell = elem15(_pTmp, uintptr(int64(uintptr(unsafe.Pointer(_6_pCell))-uintptr(unsafe.Pointer(_aData)))))
 63979  	}
 63980  	func() {
 63981  		if int32(0) != crt.Xmemcmp(tls, unsafe.Pointer(_6_pCell), unsafe.Pointer(elem15(_aData, uintptr(_6_iOff))), uint64(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 63982  			v := (*XMemPage)(_pCArray.XpRef).XxCellSize
 63983  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 63984  		}()(tls, (*XMemPage)(_pCArray.XpRef), *elem89(_pCArray.XapCell, uintptr(_i+_iNew))))) {
 63985  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65849), unsafe.Pointer(&_editPageØ00__func__Ø000), unsafe.Pointer(str(83174)))
 63986  			crt.X__builtin_abort(tls)
 63987  		}
 63988  	}()
 63989  	_i += 1
 63990  	goto _19
 63991  _23:
 63992  	return int32(0)
 63993  
 63994  _editpage_fail:
 63995  	_populateCellCache(tls, _pCArray, _iNew, _nNew)
 63996  	return _rebuildPage(tls, _pPg, _nNew, elem89(_pCArray.XapCell, uintptr(_iNew)), elem20(_pCArray.XszCell, uintptr(_iNew)))
 63997  }
 63998  
 63999  // C comment
 64000  //  /*
 64001  //  ** Array apCell[] contains nCell pointers to b-tree cells. Array szCell
 64002  //  ** contains the size in bytes of each such cell. This function adds the
 64003  //  ** space associated with each cell in the array that is currently stored
 64004  //  ** within the body of pPg to the pPg free-list. The cell-pointers and other
 64005  //  ** fields of the page are not updated.
 64006  //  **
 64007  //  ** This function returns the total number of cells added to the free-list.
 64008  //  */
 64009  func _pageFreeArray(tls *crt.TLS, _pPg *XMemPage, _iFirst int32, _nCell int32, _pCArray *XCellArray) (r0 int32) {
 64010  	var _nRet, _i, _iEnd, _szFree, _2_sz int32
 64011  	var _aData, _pEnd, _pStart, _pFree, _1_pCell *uint8
 64012  	_aData = _pPg.XaData
 64013  	_pEnd = elem15(_aData, uintptr((*XBtShared)(_pPg.XpBt).XusableSize))
 64014  	_pStart = elem15(_aData, uintptr((int32(_pPg.XhdrOffset)+int32(8))+int32(_pPg.XchildPtrSize)))
 64015  	_nRet = int32(0)
 64016  	_iEnd = _iFirst + _nCell
 64017  	_pFree = nil
 64018  	_szFree = int32(0)
 64019  	_i = _iFirst
 64020  _0:
 64021  	if _i >= _iEnd {
 64022  		goto _3
 64023  	}
 64024  	_1_pCell = *elem89(_pCArray.XapCell, uintptr(_i))
 64025  	if uint64(crt.P2U(unsafe.Pointer(_1_pCell))) < uint64(crt.P2U(unsafe.Pointer(_pStart))) || uint64(crt.P2U(unsafe.Pointer(_1_pCell))) >= uint64(crt.P2U(unsafe.Pointer(_pEnd))) {
 64026  		goto _5
 64027  	}
 64028  	_2_sz = int32(*elem20(_pCArray.XszCell, uintptr(_i)))
 64029  	func() {
 64030  		if _2_sz <= int32(0) {
 64031  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65732), unsafe.Pointer(&_pageFreeArrayØ00__func__Ø000), unsafe.Pointer(str(83271)))
 64032  			crt.X__builtin_abort(tls)
 64033  		}
 64034  	}()
 64035  	if _pFree == (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pCell))+uintptr(_2_sz))) {
 64036  		goto _8
 64037  	}
 64038  	if _pFree != nil {
 64039  		func() {
 64040  			if crt.P2U(unsafe.Pointer(_pFree)) <= crt.P2U(unsafe.Pointer(_aData)) || int64(uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData))) >= int64(65536) {
 64041  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65735), unsafe.Pointer(&_pageFreeArrayØ00__func__Ø000), unsafe.Pointer(str(83276)))
 64042  				crt.X__builtin_abort(tls)
 64043  			}
 64044  		}()
 64045  		_freeSpace(tls, _pPg, uint16(int64(uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData)))), uint16(_szFree))
 64046  	}
 64047  	_pFree = _1_pCell
 64048  	_szFree = _2_sz
 64049  	if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pFree))+uintptr(_2_sz))))) > crt.P2U(unsafe.Pointer(_pEnd)) {
 64050  		return int32(0)
 64051  	}
 64052  	goto _14
 64053  _8:
 64054  	_pFree = _1_pCell
 64055  	_szFree += _2_sz
 64056  _14:
 64057  	_nRet += 1
 64058  _5:
 64059  	_i += 1
 64060  	goto _0
 64061  _3:
 64062  	if _pFree != nil {
 64063  		func() {
 64064  			if crt.P2U(unsafe.Pointer(_pFree)) <= crt.P2U(unsafe.Pointer(_aData)) || int64(uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData))) >= int64(65536) {
 64065  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65749), unsafe.Pointer(&_pageFreeArrayØ00__func__Ø000), unsafe.Pointer(str(83276)))
 64066  				crt.X__builtin_abort(tls)
 64067  			}
 64068  		}()
 64069  		_freeSpace(tls, _pPg, uint16(int64(uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData)))), uint16(_szFree))
 64070  	}
 64071  	return _nRet
 64072  }
 64073  
 64074  var _pageFreeArrayØ00__func__Ø000 [14]int8
 64075  
 64076  func init() {
 64077  	crt.Xstrncpy(nil, &_pageFreeArrayØ00__func__Ø000[0], str(83313), 14)
 64078  }
 64079  
 64080  var _editPageØ00__func__Ø000 [9]int8
 64081  
 64082  func init() {
 64083  	crt.Xstrncpy(nil, &_editPageØ00__func__Ø000[0], str(83327), 9)
 64084  }
 64085  
 64086  // C comment
 64087  //  /*
 64088  //  ** Array apCell[] contains nCell pointers to b-tree cells. Array szCell
 64089  //  ** contains the size in bytes of each such cell. This function attempts to
 64090  //  ** add the cells stored in the array to page pPg. If it cannot (because
 64091  //  ** the page needs to be defragmented before the cells will fit), non-zero
 64092  //  ** is returned. Otherwise, if the cells are added successfully, zero is
 64093  //  ** returned.
 64094  //  **
 64095  //  ** Argument pCellptr points to the first entry in the cell-pointer array
 64096  //  ** (part of page pPg) to populate. After cell apCell[0] is written to the
 64097  //  ** page body, a 16-bit offset is written to pCellptr. And so on, for each
 64098  //  ** cell in the array. It is the responsibility of the caller to ensure
 64099  //  ** that it is safe to overwrite this part of the cell-pointer array.
 64100  //  **
 64101  //  ** When this function is called, *ppData points to the start of the
 64102  //  ** content area on page pPg. If the size of the content area is extended,
 64103  //  ** *ppData is updated to point to the new start of the content area
 64104  //  ** before returning.
 64105  //  **
 64106  //  ** Finally, argument pBegin points to the byte immediately following the
 64107  //  ** end of the space required by this page for the cell-pointer area (for
 64108  //  ** all cells - not just those inserted by the current call). If the content
 64109  //  ** area must be extended to before this point in order to accomodate all
 64110  //  ** cells in apCell[], then the cells do not fit and non-zero is returned.
 64111  //  */
 64112  func _pageInsertArray(tls *crt.TLS, _pPg *XMemPage, _pBegin *uint8, _ppData **uint8, _pCellptr *uint8, _iFirst int32, _nCell int32, _pCArray *XCellArray) (r0 int32) {
 64113  	var _i, _iEnd, _1_sz, _1_rc int32
 64114  	var _aData, _pData, _1_pSlot *uint8
 64115  	_aData = _pPg.XaData
 64116  	_pData = *_ppData
 64117  	_iEnd = _iFirst + _nCell
 64118  	func() {
 64119  		if _sqlite3Config.XneverCorrupt != int32(0) && int32(_pPg.XhdrOffset) != int32(0) {
 64120  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65677), unsafe.Pointer(&_pageInsertArrayØ00__func__Ø000), unsafe.Pointer(str(83336)))
 64121  			crt.X__builtin_abort(tls)
 64122  		}
 64123  	}()
 64124  	_i = _iFirst
 64125  _3:
 64126  	if _i >= _iEnd {
 64127  		goto _6
 64128  	}
 64129  	_1_sz = int32(_cachedCellSize(tls, _pCArray, _i))
 64130  	if (int32(*elem15(_aData, uintptr(1))) != int32(0) || int32(*elem15(_aData, uintptr(2))) != int32(0)) && store15(&_1_pSlot, _pageFindSlot(tls, _pPg, _1_sz, &_1_rc)) != nil {
 64131  		goto _9
 64132  	}
 64133  	if int64(uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_pBegin))) < int64(_1_sz) {
 64134  		return int32(1)
 64135  	}
 64136  	*(*uintptr)(unsafe.Pointer(&_pData)) -= uintptr(_1_sz)
 64137  	_1_pSlot = _pData
 64138  _9:
 64139  	func() {
 64140  		if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pSlot))+uintptr(_1_sz))))) > crt.P2U(unsafe.Pointer(*elem89(_pCArray.XapCell, uintptr(_i)))) && crt.P2U(unsafe.Pointer(_1_pSlot)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*elem89(_pCArray.XapCell, uintptr(_i))))+uintptr(_1_sz))))) && _sqlite3Config.XneverCorrupt != int32(0) {
 64141  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65690), unsafe.Pointer(&_pageInsertArrayØ00__func__Ø000), unsafe.Pointer(str(83368)))
 64142  			crt.X__builtin_abort(tls)
 64143  		}
 64144  	}()
 64145  	crt.Xmemmove(tls, unsafe.Pointer(_1_pSlot), unsafe.Pointer(*elem89(_pCArray.XapCell, uintptr(_i))), uint64(_1_sz))
 64146  	*elem15(func() *uint8 {
 64147  		*elem15(_pCellptr, 0) = uint8(int64(uintptr(unsafe.Pointer(_1_pSlot))-uintptr(unsafe.Pointer(_aData))) >> 8)
 64148  		return _pCellptr
 64149  	}(), uintptr(1)) = uint8(int64(uintptr(unsafe.Pointer(_1_pSlot)) - uintptr(unsafe.Pointer(_aData))))
 64150  	*(*uintptr)(unsafe.Pointer(&_pCellptr)) += uintptr(int32(2))
 64151  	_i += 1
 64152  	goto _3
 64153  _6:
 64154  	*_ppData = _pData
 64155  	return int32(0)
 64156  }
 64157  
 64158  var _pageInsertArrayØ00__func__Ø000 [16]int8
 64159  
 64160  func init() {
 64161  	crt.Xstrncpy(nil, &_pageInsertArrayØ00__func__Ø000[0], str(83447), 16)
 64162  }
 64163  
 64164  // C comment
 64165  //  /*
 64166  //  ** Make sure the cell sizes at idx, idx+1, ..., idx+N-1 have been
 64167  //  ** computed.
 64168  //  */
 64169  func _populateCellCache(tls *crt.TLS, _p *XCellArray, _idx int32, _N int32) {
 64170  	func() {
 64171  		if _idx < int32(0) || (_idx+_N) > _p.XnCell {
 64172  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65553), unsafe.Pointer(&_populateCellCacheØ00__func__Ø000), unsafe.Pointer(str(83463)))
 64173  			crt.X__builtin_abort(tls)
 64174  		}
 64175  	}()
 64176  _3:
 64177  	if _N <= int32(0) {
 64178  		goto _4
 64179  	}
 64180  	func() {
 64181  		if (*elem89(_p.XapCell, uintptr(_idx))) == nil {
 64182  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65555), unsafe.Pointer(&_populateCellCacheØ00__func__Ø000), unsafe.Pointer(str(83489)))
 64183  			crt.X__builtin_abort(tls)
 64184  		}
 64185  	}()
 64186  	if int32(*elem20(_p.XszCell, uintptr(_idx))) == int32(0) {
 64187  		*elem20(_p.XszCell, uintptr(_idx)) = func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 64188  			v := (*XMemPage)(_p.XpRef).XxCellSize
 64189  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 64190  		}()(tls, (*XMemPage)(_p.XpRef), *elem89(_p.XapCell, uintptr(_idx)))
 64191  		goto _8
 64192  	}
 64193  	func() {
 64194  		if _sqlite3Config.XneverCorrupt != int32(0) && int32(*elem20(_p.XszCell, uintptr(_idx))) != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 64195  			v := (*XMemPage)(_p.XpRef).XxCellSize
 64196  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 64197  		}()(tls, (*XMemPage)(_p.XpRef), *elem89(_p.XapCell, uintptr(_idx)))) {
 64198  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65559), unsafe.Pointer(&_populateCellCacheØ00__func__Ø000), unsafe.Pointer(str(83507)))
 64199  			crt.X__builtin_abort(tls)
 64200  		}
 64201  	}()
 64202  _8:
 64203  	_idx += 1
 64204  	_N -= 1
 64205  	goto _3
 64206  _4:
 64207  }
 64208  
 64209  var _populateCellCacheØ00__func__Ø000 [18]int8
 64210  
 64211  func init() {
 64212  	crt.Xstrncpy(nil, &_populateCellCacheØ00__func__Ø000[0], str(83581), 18)
 64213  }
 64214  
 64215  func _freePage(tls *crt.TLS, _pPage *XMemPage, _pRC *int32) {
 64216  	if (*_pRC) == int32(0) {
 64217  		*_pRC = _freePage2(tls, (*XBtShared)(_pPage.XpBt), _pPage, _pPage.Xpgno)
 64218  	}
 64219  }
 64220  
 64221  func _sqlite3ScratchFree(tls *crt.TLS, _p unsafe.Pointer) {
 64222  	var _4_iSize int32
 64223  	var _2_pSlot *XScratchFreeslot
 64224  	if _p == nil {
 64225  		goto _0
 64226  	}
 64227  	if (uint64(crt.P2U(_p)) >= uint64(crt.P2U(_sqlite3Config.XpScratch))) && (uint64(crt.P2U(_p)) < uint64(crt.P2U(_mem0.XpScratchEnd))) {
 64228  		_2_pSlot = (*XScratchFreeslot)(_p)
 64229  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 64230  		*(**XScratchFreeslot)(unsafe.Pointer(&_2_pSlot.XpNext)) = (*XScratchFreeslot)(_mem0.XpScratchFree)
 64231  		*(**XScratchFreeslot)(unsafe.Pointer(&_mem0.XpScratchFree)) = _2_pSlot
 64232  		_mem0.XnScratchFree += 1
 64233  		func() {
 64234  			if _mem0.XnScratchFree > uint32(_sqlite3Config.XnScratch) {
 64235  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24597), unsafe.Pointer(&_sqlite3ScratchFreeØ00__func__Ø000), unsafe.Pointer(str(83599)))
 64236  				crt.X__builtin_abort(tls)
 64237  			}
 64238  		}()
 64239  		_sqlite3StatusDown(tls, int32(3), int32(1))
 64240  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 64241  		goto _5
 64242  	}
 64243  
 64244  	if _sqlite3Config.XbMemstat != 0 {
 64245  		_4_iSize = _sqlite3MallocSize(tls, _p)
 64246  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 64247  		_sqlite3StatusDown(tls, int32(4), _4_iSize)
 64248  		_sqlite3StatusDown(tls, int32(0), _4_iSize)
 64249  		_sqlite3StatusDown(tls, int32(9), int32(1))
 64250  		(_sqlite3Config.Xm.XxFree)(tls, _p)
 64251  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 64252  		goto _7
 64253  	}
 64254  	(_sqlite3Config.Xm.XxFree)(tls, _p)
 64255  _7:
 64256  _5:
 64257  _0:
 64258  }
 64259  
 64260  var _sqlite3ScratchFreeØ00__func__Ø000 [19]int8
 64261  
 64262  func init() {
 64263  	crt.Xstrncpy(nil, &_sqlite3ScratchFreeØ00__func__Ø000[0], str(83654), 19)
 64264  }
 64265  
 64266  // C comment
 64267  //  /*
 64268  //  ** Delete the entry that the cursor is pointing to.
 64269  //  **
 64270  //  ** If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then
 64271  //  ** the cursor is left pointing at an arbitrary location after the delete.
 64272  //  ** But if that bit is set, then the cursor is left in a state such that
 64273  //  ** the next call to BtreeNext() or BtreePrev() moves it to the same row
 64274  //  ** as it would have been on if the call to BtreeDelete() had been omitted.
 64275  //  **
 64276  //  ** The BTREE_AUXDELETE bit of flags indicates that is one of several deletes
 64277  //  ** associated with a single table entry and its indexes.  Only one of those
 64278  //  ** deletes is considered the "primary" delete.  The primary delete occurs
 64279  //  ** on a cursor that is not a BTREE_FORDELETE cursor.  All but one delete
 64280  //  ** operation on non-FORDELETE cursors is tagged with the AUXDELETE flag.
 64281  //  ** The BTREE_AUXDELETE bit is a hint that is not used by this implementation,
 64282  //  ** but which might be used by alternative storage engines.
 64283  //  */
 64284  func _sqlite3BtreeDelete(tls *crt.TLS, _pCur *XBtCursor, _flags uint8) (r0 int32) {
 64285  	var _rc, _iCellIdx, _iCellDepth, _bSkipnext, _4_notUsed, _7_nCell int32
 64286  	var _7_n uint32
 64287  	var _bPreserve uint8
 64288  	var _pCell, _7_pTmp *uint8
 64289  	var _p *XBtree
 64290  	var _pBt *XBtShared
 64291  	var _info XCellInfo
 64292  	var _pPage, _7_pLeaf *XMemPage
 64293  	_p = (*XBtree)(_pCur.XpBtree)
 64294  	_pBt = (*XBtShared)(_p.XpBt)
 64295  	_bSkipnext = int32(0)
 64296  	_bPreserve = uint8(int32(_flags) & int32(2))
 64297  	func() {
 64298  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 64299  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67323), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(71986)))
 64300  			crt.X__builtin_abort(tls)
 64301  		}
 64302  	}()
 64303  	func() {
 64304  		if int32(_pBt.XinTransaction) != int32(2) {
 64305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67324), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(56904)))
 64306  			crt.X__builtin_abort(tls)
 64307  		}
 64308  	}()
 64309  	func() {
 64310  		if (int32(_pBt.XbtsFlags) & int32(1)) != int32(0) {
 64311  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67325), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(76015)))
 64312  			crt.X__builtin_abort(tls)
 64313  		}
 64314  	}()
 64315  	func() {
 64316  		if (int32(_pCur.XcurFlags) & int32(1)) == 0 {
 64317  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67326), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83673)))
 64318  			crt.X__builtin_abort(tls)
 64319  		}
 64320  	}()
 64321  	func() {
 64322  		if _hasSharedCacheTableLock(tls, _p, _pCur.XpgnoRoot, bool2int((*XKeyInfo)(_pCur.XpKeyInfo) != nil), int32(2)) == 0 {
 64323  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67327), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(78453)))
 64324  			crt.X__builtin_abort(tls)
 64325  		}
 64326  	}()
 64327  	func() {
 64328  		if _hasReadConflicts(tls, _p, _pCur.XpgnoRoot) != 0 {
 64329  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67328), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83705)))
 64330  			crt.X__builtin_abort(tls)
 64331  		}
 64332  	}()
 64333  	func() {
 64334  		if int32(_pCur.Xix) >= int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) {
 64335  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67329), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(10552)))
 64336  			crt.X__builtin_abort(tls)
 64337  		}
 64338  	}()
 64339  	func() {
 64340  		if int32(_pCur.XeState) != int32(1) {
 64341  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67330), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(10345)))
 64342  			crt.X__builtin_abort(tls)
 64343  		}
 64344  	}()
 64345  	func() {
 64346  		if (int32(_flags) & int32(-7)) != int32(0) {
 64347  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67331), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83742)))
 64348  			crt.X__builtin_abort(tls)
 64349  		}
 64350  	}()
 64351  	_iCellDepth = int32(_pCur.XiPage)
 64352  	_iCellIdx = int32(_pCur.Xix)
 64353  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_iCellDepth))
 64354  	_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData)) + uintptr(int32(_pPage.XmaskPage)&((int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_iCellIdx)), 0))<<8)|int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_iCellIdx)), uintptr(1)))))))
 64355  	if _bPreserve == 0 {
 64356  		goto _18
 64357  	}
 64358  	if _pPage.Xleaf != 0 && ((int32(_pPage.XnFree)+int32(_cellSizePtr(tls, _pPage, _pCell)))+int32(2)) <= int32((_pBt.XusableSize*uint32(2))/uint32(3)) {
 64359  		goto _20
 64360  	}
 64361  	_rc = _saveCursorKey(tls, _pCur)
 64362  	if _rc != 0 {
 64363  		return _rc
 64364  	}
 64365  	goto _22
 64366  _20:
 64367  	_bSkipnext = int32(1)
 64368  _22:
 64369  _18:
 64370  	if _pPage.Xleaf != 0 {
 64371  		goto _23
 64372  	}
 64373  	_4_notUsed = int32(0)
 64374  	_rc = _sqlite3BtreePrevious(tls, _pCur, &_4_notUsed)
 64375  	if _rc != 0 {
 64376  		return _rc
 64377  	}
 64378  _23:
 64379  	if (int32(_pCur.XcurFlags) & int32(32)) == 0 {
 64380  		goto _25
 64381  	}
 64382  	_rc = _saveAllCursors(tls, _pBt, _pCur.XpgnoRoot, _pCur)
 64383  	if _rc != 0 {
 64384  		return _rc
 64385  	}
 64386  _25:
 64387  	if (*XKeyInfo)(_pCur.XpKeyInfo) == nil {
 64388  		_invalidateIncrblobCursors(tls, _p, _pCur.XpgnoRoot, _pCur.Xinfo.XnKey, int32(0))
 64389  	}
 64390  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))
 64391  	if _rc != 0 {
 64392  		return _rc
 64393  	}
 64394  	_rc = _clearCell(tls, _pPage, _pCell, &_info)
 64395  	_dropCell(tls, _pPage, _iCellIdx, int32(_info.XnSize), &_rc)
 64396  	if _rc != 0 {
 64397  		return _rc
 64398  	}
 64399  	if _pPage.Xleaf != 0 {
 64400  		goto _30
 64401  	}
 64402  	_7_pLeaf = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 64403  	_7_n = (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_iCellDepth+int32(1)))).Xpgno
 64404  	_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_7_pLeaf.XaData)) + uintptr(int32(_7_pLeaf.XmaskPage)&((int32(*elem15(elem15(_7_pLeaf.XaCellIdx, uintptr(int32(2)*(int32(_7_pLeaf.XnCell)-int32(1)))), 0))<<8)|int32(*elem15(elem15(_7_pLeaf.XaCellIdx, uintptr(int32(2)*(int32(_7_pLeaf.XnCell)-int32(1)))), uintptr(1)))))))
 64405  	if crt.P2U(unsafe.Pointer(_pCell)) < crt.P2U(unsafe.Pointer(elem15(_7_pLeaf.XaData, uintptr(4)))) {
 64406  		return _sqlite3CorruptError(tls, int32(67407))
 64407  	}
 64408  	_7_nCell = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 64409  		v := _7_pLeaf.XxCellSize
 64410  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 64411  	}()(tls, _7_pLeaf, _pCell))
 64412  	func() {
 64413  		if int32(_pBt.XpageSize-uint32(8)) < _7_nCell {
 64414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67409), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83795)))
 64415  			crt.X__builtin_abort(tls)
 64416  		}
 64417  	}()
 64418  	_7_pTmp = _pBt.XpTmpSpace
 64419  	func() {
 64420  		if _7_pTmp == nil {
 64421  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67411), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83822)))
 64422  			crt.X__builtin_abort(tls)
 64423  		}
 64424  	}()
 64425  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_7_pLeaf.XpDbPage))
 64426  	if _rc == int32(0) {
 64427  		_insertCell(tls, _pPage, _iCellIdx, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))-uintptr(int32(4)))), _7_nCell+int32(4), _7_pTmp, _7_n, &_rc)
 64428  	}
 64429  	_dropCell(tls, _7_pLeaf, int32(_7_pLeaf.XnCell)-int32(1), _7_nCell, &_rc)
 64430  	if _rc != 0 {
 64431  		return _rc
 64432  	}
 64433  _30:
 64434  	_rc = _balance(tls, _pCur)
 64435  	if _rc != int32(0) || int32(_pCur.XiPage) <= _iCellDepth {
 64436  		goto _39
 64437  	}
 64438  _40:
 64439  	if int32(_pCur.XiPage) > _iCellDepth {
 64440  		_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(postInc5(&_pCur.XiPage, -1))))
 64441  		goto _40
 64442  	}
 64443  	_rc = _balance(tls, _pCur)
 64444  _39:
 64445  	if _rc != int32(0) {
 64446  		goto _42
 64447  	}
 64448  	if _bSkipnext == 0 {
 64449  		goto _43
 64450  	}
 64451  	func() {
 64452  		if _bPreserve == 0 || int32(_pCur.XiPage) != _iCellDepth && _sqlite3Config.XneverCorrupt != int32(0) {
 64453  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67445), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83830)))
 64454  			crt.X__builtin_abort(tls)
 64455  		}
 64456  	}()
 64457  	func() {
 64458  		if _pPage != (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) && _sqlite3Config.XneverCorrupt != int32(0) {
 64459  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67446), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83883)))
 64460  			crt.X__builtin_abort(tls)
 64461  		}
 64462  	}()
 64463  	func() {
 64464  		if int32(_pPage.XnCell) <= int32(0) && _sqlite3Config.XneverCorrupt != int32(0) || _iCellIdx > int32(_pPage.XnCell) {
 64465  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67447), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83930)))
 64466  			crt.X__builtin_abort(tls)
 64467  		}
 64468  	}()
 64469  	_pCur.XeState = uint8(2)
 64470  	if _iCellIdx >= int32(_pPage.XnCell) {
 64471  		_pCur.XskipNext = int32(-1)
 64472  		_pCur.Xix = uint16(int32(_pPage.XnCell) - int32(1))
 64473  		goto _56
 64474  	}
 64475  	_pCur.XskipNext = int32(1)
 64476  _56:
 64477  	goto _57
 64478  _43:
 64479  	_rc = _moveToRoot(tls, _pCur)
 64480  	if _bPreserve != 0 {
 64481  		_pCur.XeState = uint8(3)
 64482  	}
 64483  _57:
 64484  _42:
 64485  	return _rc
 64486  }
 64487  
 64488  var _sqlite3BtreeDeleteØ00__func__Ø000 [19]int8
 64489  
 64490  func init() {
 64491  	crt.Xstrncpy(nil, &_sqlite3BtreeDeleteØ00__func__Ø000[0], str(83987), 19)
 64492  }
 64493  
 64494  // C comment
 64495  //  /*
 64496  //  ** Compare the key in memory cell pVal with the key that the sorter cursor
 64497  //  ** passed as the first argument currently points to. For the purposes of
 64498  //  ** the comparison, ignore the rowid field at the end of each record.
 64499  //  **
 64500  //  ** If the sorter cursor key contains any NULL values, consider it to be
 64501  //  ** less than pVal. Even if pVal also contains NULL values.
 64502  //  **
 64503  //  ** If an error occurs, return an SQLite error code (i.e. SQLITE_NOMEM).
 64504  //  ** Otherwise, set *pRes to a negative, zero or positive value if the
 64505  //  ** key in pVal is smaller than, equal to or larger than the current sorter
 64506  //  ** key.
 64507  //  **
 64508  //  ** This routine forms the core of the OP_SorterCompare opcode, which in
 64509  //  ** turn is used to verify uniqueness when constructing a UNIQUE INDEX.
 64510  //  */
 64511  func _sqlite3VdbeSorterCompare(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem, _nKeyCol int32, _pRes *int32) (r0 int32) {
 64512  	var _i, _nKey int32
 64513  	var _pKey unsafe.Pointer
 64514  	var _r2 *XUnpackedRecord
 64515  	var _pKeyInfo *XKeyInfo
 64516  	var _pSorter *XVdbeSorter
 64517  	func() {
 64518  		if int32(_pCsr.XeCurType) != int32(1) {
 64519  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88740), unsafe.Pointer(&_sqlite3VdbeSorterCompareØ00__func__Ø000), unsafe.Pointer(str(57837)))
 64520  			crt.X__builtin_abort(tls)
 64521  		}
 64522  	}()
 64523  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 64524  	_r2 = (*XUnpackedRecord)(_pSorter.XpUnpacked)
 64525  	_pKeyInfo = (*XKeyInfo)(_pCsr.XpKeyInfo)
 64526  	if _r2 != nil {
 64527  		goto _2
 64528  	}
 64529  	_r2 = store85((**XUnpackedRecord)(unsafe.Pointer(&_pSorter.XpUnpacked)), _sqlite3VdbeAllocUnpackedRecord(tls, _pKeyInfo))
 64530  	if _r2 == nil {
 64531  		return _sqlite3NomemError(tls, int32(88746))
 64532  	}
 64533  	_r2.XnField = uint16(_nKeyCol)
 64534  _2:
 64535  	func() {
 64536  		if int32(_r2.XnField) != _nKeyCol {
 64537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88749), unsafe.Pointer(&_sqlite3VdbeSorterCompareØ00__func__Ø000), unsafe.Pointer(str(84006)))
 64538  			crt.X__builtin_abort(tls)
 64539  		}
 64540  	}()
 64541  	_pKey = _vdbeSorterRowkey(tls, _pSorter, &_nKey)
 64542  	_sqlite3VdbeRecordUnpack(tls, _pKeyInfo, _nKey, _pKey, _r2)
 64543  	_i = int32(0)
 64544  _6:
 64545  	if _i >= _nKeyCol {
 64546  		goto _9
 64547  	}
 64548  	if (int32(elem25((*XMem)(_r2.XaMem), uintptr(_i)).Xflags) & int32(1)) != 0 {
 64549  		*_pRes = int32(-1)
 64550  		return int32(0)
 64551  	}
 64552  	_i += 1
 64553  	goto _6
 64554  _9:
 64555  	*_pRes = _sqlite3VdbeRecordCompare(tls, _pVal.Xn, unsafe.Pointer(_pVal.Xz), _r2)
 64556  	return int32(0)
 64557  }
 64558  
 64559  var _sqlite3VdbeSorterCompareØ00__func__Ø000 [25]int8
 64560  
 64561  func init() {
 64562  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterCompareØ00__func__Ø000[0], str(84026), 25)
 64563  }
 64564  
 64565  // C comment
 64566  //  /*
 64567  //  ** Return a pointer to a buffer owned by the sorter that contains the
 64568  //  ** current key.
 64569  //  */
 64570  func _vdbeSorterRowkey(tls *crt.TLS, _pSorter *XVdbeSorter, _pnKey *int32) (r0 unsafe.Pointer) {
 64571  	var _pKey unsafe.Pointer
 64572  	var _1_pReader *XPmaReader
 64573  	if _pSorter.XbUsePMA == 0 {
 64574  		goto _0
 64575  	}
 64576  	if _pSorter.XbUseThreads != 0 {
 64577  		_1_pReader = (*XPmaReader)(_pSorter.XpReader)
 64578  		goto _2
 64579  	}
 64580  	_1_pReader = elem82((*XPmaReader)((*XMergeEngine)(_pSorter.XpMerger).XaReadr), uintptr(*elem8((*XMergeEngine)(_pSorter.XpMerger).XaTree, uintptr(1))))
 64581  _2:
 64582  	*_pnKey = _1_pReader.XnKey
 64583  	_pKey = unsafe.Pointer(_1_pReader.XaKey)
 64584  	goto _3
 64585  _0:
 64586  	*_pnKey = (*XSorterRecord)(_pSorter.Xlist.XpList).XnVal
 64587  	_pKey = unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(_pSorter.Xlist.XpList) + uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(int32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16))))))))))))
 64588  _3:
 64589  	return _pKey
 64590  }
 64591  
 64592  // C comment
 64593  //  /*
 64594  //  ** Copy the current sorter key into the memory cell pOut.
 64595  //  */
 64596  func _sqlite3VdbeSorterRowkey(tls *crt.TLS, _pCsr *XVdbeCursor, _pOut *XMem) (r0 int32) {
 64597  	var _nKey int32
 64598  	var _pKey unsafe.Pointer
 64599  	var _pSorter *XVdbeSorter
 64600  	func() {
 64601  		if int32(_pCsr.XeCurType) != int32(1) {
 64602  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88699), unsafe.Pointer(&_sqlite3VdbeSorterRowkeyØ00__func__Ø000), unsafe.Pointer(str(57837)))
 64603  			crt.X__builtin_abort(tls)
 64604  		}
 64605  	}()
 64606  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 64607  	_pKey = _vdbeSorterRowkey(tls, _pSorter, &_nKey)
 64608  	if _sqlite3VdbeMemClearAndResize(tls, _pOut, _nKey) != 0 {
 64609  		return _sqlite3NomemError(tls, int32(88703))
 64610  	}
 64611  	_pOut.Xn = _nKey
 64612  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(16))
 64613  	crt.Xmemcpy(tls, unsafe.Pointer(_pOut.Xz), _pKey, uint64(_nKey))
 64614  	return int32(0)
 64615  }
 64616  
 64617  var _sqlite3VdbeSorterRowkeyØ00__func__Ø000 [24]int8
 64618  
 64619  func init() {
 64620  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterRowkeyØ00__func__Ø000[0], str(84051), 24)
 64621  }
 64622  
 64623  // C comment
 64624  //  /*
 64625  //  ** Check to ensure that the cursor is valid.  Restore the cursor
 64626  //  ** if need be.  Return any I/O error from the restore operation.
 64627  //  */
 64628  func _sqlite3VdbeCursorRestore(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) {
 64629  	func() {
 64630  		if int32(_p.XeCurType) != int32(0) {
 64631  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74514), unsafe.Pointer(&_sqlite3VdbeCursorRestoreØ00__func__Ø000), unsafe.Pointer(str(71938)))
 64632  			crt.X__builtin_abort(tls)
 64633  		}
 64634  	}()
 64635  	if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc)))) != 0 {
 64636  		return _handleMovedCursor(tls, _p)
 64637  	}
 64638  	return int32(0)
 64639  }
 64640  
 64641  var _sqlite3VdbeCursorRestoreØ00__func__Ø000 [25]int8
 64642  
 64643  func init() {
 64644  	crt.Xstrncpy(nil, &_sqlite3VdbeCursorRestoreØ00__func__Ø000[0], str(84075), 25)
 64645  }
 64646  
 64647  // C comment
 64648  //  /* NDEBUG */
 64649  func _sqlite3BtreeCursorIsValidNN(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 64650  	func() {
 64651  		if _pCur == nil {
 64652  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63381), unsafe.Pointer(&_sqlite3BtreeCursorIsValidNNØ00__func__Ø000), unsafe.Pointer(str(75267)))
 64653  			crt.X__builtin_abort(tls)
 64654  		}
 64655  	}()
 64656  	return bool2int(int32(_pCur.XeState) == int32(1))
 64657  }
 64658  
 64659  var _sqlite3BtreeCursorIsValidNNØ00__func__Ø000 [28]int8
 64660  
 64661  func init() {
 64662  	crt.Xstrncpy(nil, &_sqlite3BtreeCursorIsValidNNØ00__func__Ø000[0], str(84100), 28)
 64663  }
 64664  
 64665  // C comment
 64666  //  /* Move the cursor to the first entry in the table.  Return SQLITE_OK
 64667  //  ** on success.  Set *pRes to 0 if the cursor actually points to something
 64668  //  ** or set *pRes to 1 if the table is empty.
 64669  //  */
 64670  func _sqlite3BtreeFirst(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 64671  	var _rc int32
 64672  	func() {
 64673  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 64674  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64079), unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000), unsafe.Pointer(str(71986)))
 64675  			crt.X__builtin_abort(tls)
 64676  		}
 64677  	}()
 64678  	func() {
 64679  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).Xmutex)) == 0 {
 64680  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64080), unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000), unsafe.Pointer(str(72011)))
 64681  			crt.X__builtin_abort(tls)
 64682  		}
 64683  	}()
 64684  	_rc = _moveToRoot(tls, _pCur)
 64685  	if _rc != int32(0) {
 64686  		goto _4
 64687  	}
 64688  	if int32(_pCur.XeState) == int32(0) {
 64689  		func() {
 64690  			if _pCur.XpgnoRoot != (0) && int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) != int32(0) {
 64691  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64084), unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000), unsafe.Pointer(str(72404)))
 64692  				crt.X__builtin_abort(tls)
 64693  			}
 64694  		}()
 64695  		*_pRes = int32(1)
 64696  		goto _9
 64697  	}
 64698  	func() {
 64699  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) <= int32(0) {
 64700  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64087), unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000), unsafe.Pointer(str(84128)))
 64701  			crt.X__builtin_abort(tls)
 64702  		}
 64703  	}()
 64704  	*_pRes = int32(0)
 64705  	_rc = _moveToLeftmost(tls, _pCur)
 64706  _9:
 64707  _4:
 64708  	return _rc
 64709  }
 64710  
 64711  var _sqlite3BtreeFirstØ00__func__Ø000 [18]int8
 64712  
 64713  func init() {
 64714  	crt.Xstrncpy(nil, &_sqlite3BtreeFirstØ00__func__Ø000[0], str(84163), 18)
 64715  }
 64716  
 64717  // C comment
 64718  //  /*
 64719  //  ** Return an estimate for the number of rows in the table that pCur is
 64720  //  ** pointing to.  Return a negative number if no estimate is currently
 64721  //  ** available.
 64722  //  */
 64723  func _sqlite3BtreeRowCountEst(tls *crt.TLS, _pCur *XBtCursor) (r0 int64) {
 64724  	var _n int64
 64725  	var _i uint8
 64726  	func() {
 64727  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 64728  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64430), unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000), unsafe.Pointer(str(71986)))
 64729  			crt.X__builtin_abort(tls)
 64730  		}
 64731  	}()
 64732  	func() {
 64733  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).Xmutex)) == 0 {
 64734  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64431), unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000), unsafe.Pointer(str(72011)))
 64735  			crt.X__builtin_abort(tls)
 64736  		}
 64737  	}()
 64738  	if func() int32 {
 64739  		if int32(_pCur.XeState) != int32(1) {
 64740  			return func() int32 {
 64741  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64436), unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000), unsafe.Pointer(str(4809)))
 64742  				crt.X__builtin_abort(tls)
 64743  				return int32(1)
 64744  			}()
 64745  		}
 64746  		return int32(0)
 64747  	}() != 0 {
 64748  		return int64(-1)
 64749  	}
 64750  	if func() int32 {
 64751  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xleaf) == int32(0) {
 64752  			return func() int32 {
 64753  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64437), unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000), unsafe.Pointer(str(4809)))
 64754  				crt.X__builtin_abort(tls)
 64755  				return int32(1)
 64756  			}()
 64757  		}
 64758  		return int32(0)
 64759  	}() != 0 {
 64760  		return int64(-1)
 64761  	}
 64762  	*func() *uint8 { _n = int64(1); return &_i }() = 0
 64763  _10:
 64764  	if int32(_i) > int32(_pCur.XiPage) {
 64765  		goto _13
 64766  	}
 64767  	_n *= int64((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_i))).XnCell)
 64768  	_i += 1
 64769  	goto _10
 64770  _13:
 64771  	return _n
 64772  }
 64773  
 64774  var _sqlite3BtreeRowCountEstØ00__func__Ø000 [24]int8
 64775  
 64776  func init() {
 64777  	crt.Xstrncpy(nil, &_sqlite3BtreeRowCountEstØ00__func__Ø000[0], str(84181), 24)
 64778  }
 64779  
 64780  // C comment
 64781  //  /*
 64782  //  ** Once the sorter has been populated by calls to sqlite3VdbeSorterWrite,
 64783  //  ** this function is called to prepare for iterating through the records
 64784  //  ** in sorted order.
 64785  //  */
 64786  func _sqlite3VdbeSorterRewind(tls *crt.TLS, _pCsr *XVdbeCursor, _pbEof *int32) (r0 int32) {
 64787  	var _rc int32
 64788  	var _pSorter *XVdbeSorter
 64789  	_rc = int32(0)
 64790  	func() {
 64791  		if int32(_pCsr.XeCurType) != int32(1) {
 64792  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88587), unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000), unsafe.Pointer(str(57837)))
 64793  			crt.X__builtin_abort(tls)
 64794  		}
 64795  	}()
 64796  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 64797  	func() {
 64798  		if _pSorter == nil {
 64799  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88589), unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000), unsafe.Pointer(str(84205)))
 64800  			crt.X__builtin_abort(tls)
 64801  		}
 64802  	}()
 64803  	if int32(_pSorter.XbUsePMA) != int32(0) {
 64804  		goto _4
 64805  	}
 64806  	if (_pSorter.Xlist.XpList) != nil {
 64807  		*_pbEof = int32(0)
 64808  		_rc = _vdbeSorterSort(tls, elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), 0), &_pSorter.Xlist)
 64809  		goto _6
 64810  	}
 64811  	*_pbEof = int32(1)
 64812  _6:
 64813  	return _rc
 64814  
 64815  _4:
 64816  	func() {
 64817  		if (_pSorter.Xlist.XpList) == nil {
 64818  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88608), unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000), unsafe.Pointer(str(84213)))
 64819  			crt.X__builtin_abort(tls)
 64820  		}
 64821  	}()
 64822  	_rc = _vdbeSorterFlushPMA(tls, _pSorter)
 64823  	_rc = _vdbeSorterJoinAll(tls, _pSorter, _rc)
 64824  	func() {
 64825  		if (*XPmaReader)(_pSorter.XpReader) != nil {
 64826  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88618), unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000), unsafe.Pointer(str(84233)))
 64827  			crt.X__builtin_abort(tls)
 64828  		}
 64829  	}()
 64830  	if _rc == int32(0) {
 64831  		_rc = _vdbeSorterSetupMerge(tls, _pSorter)
 64832  		*_pbEof = int32(0)
 64833  	}
 64834  	return _rc
 64835  }
 64836  
 64837  var _sqlite3VdbeSorterRewindØ00__func__Ø000 [24]int8
 64838  
 64839  func init() {
 64840  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterRewindØ00__func__Ø000[0], str(84253), 24)
 64841  }
 64842  
 64843  // C comment
 64844  //  /*
 64845  //  ** Sort the linked list of records headed at pTask->pList. Return
 64846  //  ** SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if
 64847  //  ** an error occurs.
 64848  //  */
 64849  func _vdbeSorterSort(tls *crt.TLS, _pTask *XSortSubtask, _pList *t90) (r0 int32) {
 64850  	var _i, _rc int32
 64851  	var _p, _2_pNext *XSorterRecord
 64852  	var _aSlot **XSorterRecord
 64853  	_rc = _vdbeSortAllocUnpacked(tls, _pTask)
 64854  	if _rc != int32(0) {
 64855  		return _rc
 64856  	}
 64857  	_p = (*XSorterRecord)(_pList.XpList)
 64858  	*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&_pTask.XxCompare)) = _vdbeSorterGetCompare(tls, (*XVdbeSorter)(_pTask.XpSorter))
 64859  	_aSlot = (**XSorterRecord)(_sqlite3MallocZero(tls, uint64(512)))
 64860  	if _aSlot == nil {
 64861  		return _sqlite3NomemError(tls, int32(87425))
 64862  	}
 64863  _1:
 64864  	if _p == nil {
 64865  		goto _3
 64866  	}
 64867  	if _pList.XaMemory == nil {
 64868  		goto _4
 64869  	}
 64870  	if (*uint8)(unsafe.Pointer(_p)) == _pList.XaMemory {
 64871  		_2_pNext = nil
 64872  		goto _6
 64873  	}
 64874  	func() {
 64875  		if (*(*int32)(unsafe.Pointer(&_p.Xu))) >= _sqlite3MallocSize(tls, unsafe.Pointer(_pList.XaMemory)) {
 64876  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87434), unsafe.Pointer(&_vdbeSorterSortØ00__func__Ø000), unsafe.Pointer(str(84277)))
 64877  			crt.X__builtin_abort(tls)
 64878  		}
 64879  	}()
 64880  	_2_pNext = (*XSorterRecord)(unsafe.Pointer(elem15(_pList.XaMemory, uintptr(*(*int32)(unsafe.Pointer(&_p.Xu))))))
 64881  _6:
 64882  	goto _9
 64883  _4:
 64884  	_2_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
 64885  _9:
 64886  	*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))) = nil
 64887  	_i = int32(0)
 64888  _10:
 64889  	if (*elem91(_aSlot, uintptr(_i))) == nil {
 64890  		goto _13
 64891  	}
 64892  	_p = _vdbeSorterMerge(tls, _pTask, _p, *elem91(_aSlot, uintptr(_i)))
 64893  	*elem91(_aSlot, uintptr(_i)) = nil
 64894  	_i += 1
 64895  	goto _10
 64896  _13:
 64897  	*elem91(_aSlot, uintptr(_i)) = _p
 64898  	_p = _2_pNext
 64899  	goto _1
 64900  _3:
 64901  	_p = nil
 64902  	_i = int32(0)
 64903  _14:
 64904  	if _i >= int32(64) {
 64905  		goto _17
 64906  	}
 64907  	if (*elem91(_aSlot, uintptr(_i))) == nil {
 64908  		goto _15
 64909  	}
 64910  	_p = func() *XSorterRecord {
 64911  		if _p != nil {
 64912  			return _vdbeSorterMerge(tls, _pTask, _p, *elem91(_aSlot, uintptr(_i)))
 64913  		}
 64914  		return (*elem91(_aSlot, uintptr(_i)))
 64915  	}()
 64916  _15:
 64917  	_i += 1
 64918  	goto _14
 64919  _17:
 64920  	*(**XSorterRecord)(unsafe.Pointer(&_pList.XpList)) = _p
 64921  	Xsqlite3_free(tls, unsafe.Pointer(_aSlot))
 64922  	func() {
 64923  		if int32((*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode) != int32(0) && int32((*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode) != int32(7) {
 64924  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87458), unsafe.Pointer(&_vdbeSorterSortØ00__func__Ø000), unsafe.Pointer(str(84322)))
 64925  			crt.X__builtin_abort(tls)
 64926  		}
 64927  	}()
 64928  	return int32((*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode)
 64929  }
 64930  
 64931  // C comment
 64932  //  /*
 64933  //  ** If it has not already been allocated, allocate the UnpackedRecord
 64934  //  ** structure at pTask->pUnpacked. Return SQLITE_OK if successful (or
 64935  //  ** if no allocation was required), or SQLITE_NOMEM otherwise.
 64936  //  */
 64937  func _vdbeSortAllocUnpacked(tls *crt.TLS, _pTask *XSortSubtask) (r0 int32) {
 64938  	if (*XUnpackedRecord)(_pTask.XpUnpacked) != nil {
 64939  		goto _0
 64940  	}
 64941  	*(**XUnpackedRecord)(unsafe.Pointer(&_pTask.XpUnpacked)) = _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo))
 64942  	if (*XUnpackedRecord)(_pTask.XpUnpacked) == nil {
 64943  		return _sqlite3NomemError(tls, int32(87344))
 64944  	}
 64945  	(*XUnpackedRecord)(_pTask.XpUnpacked).XnField = (*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo).XnField
 64946  	(*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode = 0
 64947  _0:
 64948  	return int32(0)
 64949  }
 64950  
 64951  // C comment
 64952  //  /*
 64953  //  ** Return the SorterCompare function to compare values collected by the
 64954  //  ** sorter object passed as the only argument.
 64955  //  */
 64956  func _vdbeSorterGetCompare(tls *crt.TLS, _p *XVdbeSorter) (r0 func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32) {
 64957  	if int32(_p.XtypeMask) == int32(1) {
 64958  		return _vdbeSorterCompareInt
 64959  	}
 64960  	if int32(_p.XtypeMask) == int32(2) {
 64961  		return _vdbeSorterCompareText
 64962  	}
 64963  	return _vdbeSorterCompare
 64964  }
 64965  
 64966  // C comment
 64967  //  /*
 64968  //  ** A specially optimized version of vdbeSorterCompare() that assumes that
 64969  //  ** the first field of each key is an INTEGER value.
 64970  //  */
 64971  func _vdbeSorterCompareInt(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
 64972  	var _s1, _s2, _res, _1_i int32
 64973  	var _1_n uint8
 64974  	var _p1, _p2, _v1, _v2 *uint8
 64975  	_p1 = (*uint8)(_pKey1)
 64976  	_p2 = (*uint8)(_pKey2)
 64977  	_s1 = int32(*elem15(_p1, uintptr(1)))
 64978  	_s2 = int32(*elem15(_p2, uintptr(1)))
 64979  	_v1 = elem15(_p1, uintptr(*elem15(_p1, 0)))
 64980  	_v2 = elem15(_p2, uintptr(*elem15(_p2, 0)))
 64981  	func() {
 64982  		if (_s1 <= int32(0) || _s1 >= int32(7)) && _s1 != int32(8) && _s1 != int32(9) {
 64983  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86872), unsafe.Pointer(&_vdbeSorterCompareIntØ00__func__Ø000), unsafe.Pointer(str(84402)))
 64984  			crt.X__builtin_abort(tls)
 64985  		}
 64986  	}()
 64987  	func() {
 64988  		if (_s2 <= int32(0) || _s2 >= int32(7)) && _s2 != int32(8) && _s2 != int32(9) {
 64989  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86873), unsafe.Pointer(&_vdbeSorterCompareIntØ00__func__Ø000), unsafe.Pointer(str(84435)))
 64990  			crt.X__builtin_abort(tls)
 64991  		}
 64992  	}()
 64993  	if _s1 != _s2 {
 64994  		goto _10
 64995  	}
 64996  	_1_n = *elem15((*uint8)(unsafe.Pointer(&_vdbeSorterCompareIntØ00aLenØ001)), uintptr(_s1))
 64997  	_res = int32(0)
 64998  	_1_i = int32(0)
 64999  _11:
 65000  	if _1_i >= int32(_1_n) {
 65001  		goto _14
 65002  	}
 65003  	if store2(&_res, int32(*elem15(_v1, uintptr(_1_i)))-int32(*elem15(_v2, uintptr(_1_i)))) == int32(0) {
 65004  		goto _15
 65005  	}
 65006  	if ((int32(*elem15(_v1, 0)) ^ int32(*elem15(_v2, 0))) & int32(128)) != int32(0) {
 65007  		_res = func() int32 {
 65008  			if (int32(*elem15(_v1, 0)) & int32(128)) != 0 {
 65009  				return int32(-1)
 65010  			}
 65011  			return int32(1)
 65012  		}()
 65013  	}
 65014  	goto _14
 65015  _15:
 65016  	_1_i += 1
 65017  	goto _11
 65018  _14:
 65019  	goto _22
 65020  _10:
 65021  	if (_s1 > int32(7)) && (_s2 > int32(7)) {
 65022  		_res = _s1 - _s2
 65023  		goto _22
 65024  	}
 65025  	if _s2 > int32(7) {
 65026  		_res = int32(1)
 65027  		goto _26
 65028  	}
 65029  	if _s1 > int32(7) {
 65030  		_res = int32(-1)
 65031  		goto _26
 65032  	}
 65033  	_res = _s1 - _s2
 65034  _26:
 65035  	func() {
 65036  		if _res == int32(0) {
 65037  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86899), unsafe.Pointer(&_vdbeSorterCompareIntØ00__func__Ø000), unsafe.Pointer(str(66473)))
 65038  			crt.X__builtin_abort(tls)
 65039  		}
 65040  	}()
 65041  	if _res <= int32(0) {
 65042  		goto _29
 65043  	}
 65044  	if (int32(*_v1) & int32(128)) != 0 {
 65045  		_res = int32(-1)
 65046  	}
 65047  	goto _31
 65048  _29:
 65049  	if (int32(*_v2) & int32(128)) != 0 {
 65050  		_res = int32(1)
 65051  	}
 65052  _31:
 65053  _22:
 65054  	if _res != int32(0) {
 65055  		goto _33
 65056  	}
 65057  	if int32((*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo).XnField) > int32(1) {
 65058  		_res = _vdbeSorterCompareTail(tls, _pTask, _pbKey2Cached, _pKey1, _nKey1, _pKey2, _nKey2)
 65059  	}
 65060  	goto _36
 65061  _33:
 65062  	if (*elem15((*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo).XaSortOrder, 0)) != 0 {
 65063  		_res = _res * int32(-1)
 65064  	}
 65065  _36:
 65066  	return _res
 65067  }
 65068  
 65069  var _vdbeSorterCompareIntØ00__func__Ø000 [21]int8
 65070  
 65071  func init() {
 65072  	crt.Xstrncpy(nil, &_vdbeSorterCompareIntØ00__func__Ø000[0], str(84468), 21)
 65073  }
 65074  
 65075  var _vdbeSorterCompareIntØ00aLenØ001 [10]uint8
 65076  
 65077  func init() {
 65078  	_vdbeSorterCompareIntØ00aLenØ001 = [10]uint8{0, 1, 2, 3, 4, 6, 8, 0, 0, 0}
 65079  }
 65080  
 65081  // C comment
 65082  //  /*
 65083  //  ** A version of vdbeSorterCompare() that assumes that it has already been
 65084  //  ** determined that the first field of key1 is equal to the first field of
 65085  //  ** key2.
 65086  //  */
 65087  func _vdbeSorterCompareTail(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
 65088  	var _r2 *XUnpackedRecord
 65089  	_r2 = (*XUnpackedRecord)(_pTask.XpUnpacked)
 65090  	if (*_pbKey2Cached) == int32(0) {
 65091  		_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo), _nKey2, _pKey2, _r2)
 65092  		*_pbKey2Cached = int32(1)
 65093  	}
 65094  	return _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _r2, int32(1))
 65095  }
 65096  
 65097  // C comment
 65098  //  /*
 65099  //  ** A specially optimized version of vdbeSorterCompare() that assumes that
 65100  //  ** the first field of each key is a TEXT value and that the collation
 65101  //  ** sequence to compare them with is BINARY.
 65102  //  */
 65103  func _vdbeSorterCompareText(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
 65104  	var _n1, _n2, _res int32
 65105  	var _p1, _p2, _v1, _v2 *uint8
 65106  	_p1 = (*uint8)(_pKey1)
 65107  	_p2 = (*uint8)(_pKey2)
 65108  	_v1 = elem15(_p1, uintptr(*elem15(_p1, 0)))
 65109  	_v2 = elem15(_p2, uintptr(*elem15(_p2, 0)))
 65110  	func() int32 {
 65111  		if int32(*elem15(_p1, uintptr(1))) < int32(128) {
 65112  			return func() int32 { _n1 = int32(uint32(*elem15(_p1, uintptr(1)))); return int32(1) }()
 65113  		}
 65114  		return int32(_sqlite3GetVarint32(tls, elem15(_p1, uintptr(1)), (*uint32)(unsafe.Pointer(&_n1))))
 65115  	}()
 65116  	_n1 = (_n1 - int32(13)) / int32(2)
 65117  	func() int32 {
 65118  		if int32(*elem15(_p2, uintptr(1))) < int32(128) {
 65119  			return func() int32 { _n2 = int32(uint32(*elem15(_p2, uintptr(1)))); return int32(1) }()
 65120  		}
 65121  		return int32(_sqlite3GetVarint32(tls, elem15(_p2, uintptr(1)), (*uint32)(unsafe.Pointer(&_n2))))
 65122  	}()
 65123  	_n2 = (_n2 - int32(13)) / int32(2)
 65124  	_res = crt.Xmemcmp(tls, unsafe.Pointer(_v1), unsafe.Pointer(_v2), uint64(func() int32 {
 65125  		if _n1 < _n2 {
 65126  			return _n1
 65127  		}
 65128  		return _n2
 65129  	}()))
 65130  	if _res == int32(0) {
 65131  		_res = _n1 - _n2
 65132  	}
 65133  	if _res != int32(0) {
 65134  		goto _7
 65135  	}
 65136  	if int32((*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo).XnField) > int32(1) {
 65137  		_res = _vdbeSorterCompareTail(tls, _pTask, _pbKey2Cached, _pKey1, _nKey1, _pKey2, _nKey2)
 65138  	}
 65139  	goto _9
 65140  _7:
 65141  	if (*elem15((*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo).XaSortOrder, 0)) != 0 {
 65142  		_res = _res * int32(-1)
 65143  	}
 65144  _9:
 65145  	return _res
 65146  }
 65147  
 65148  // C comment
 65149  //  /*
 65150  //  ** Compare key1 (buffer pKey1, size nKey1 bytes) with key2 (buffer pKey2,
 65151  //  ** size nKey2 bytes). Use (pTask->pKeyInfo) for the collation sequences
 65152  //  ** used by the comparison. Return the result of the comparison.
 65153  //  **
 65154  //  ** If IN/OUT parameter *pbKey2Cached is true when this function is called,
 65155  //  ** it is assumed that (pTask->pUnpacked) contains the unpacked version
 65156  //  ** of key2. If it is false, (pTask->pUnpacked) is populated with the unpacked
 65157  //  ** version of key2 and *pbKey2Cached set to true before returning.
 65158  //  **
 65159  //  ** If an OOM error is encountered, (pTask->pUnpacked->error_rc) is set
 65160  //  ** to SQLITE_NOMEM.
 65161  //  */
 65162  func _vdbeSorterCompare(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
 65163  	var _r2 *XUnpackedRecord
 65164  	_r2 = (*XUnpackedRecord)(_pTask.XpUnpacked)
 65165  	if (*_pbKey2Cached) == 0 {
 65166  		_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo), _nKey2, _pKey2, _r2)
 65167  		*_pbKey2Cached = int32(1)
 65168  	}
 65169  	return _sqlite3VdbeRecordCompare(tls, _nKey1, _pKey1, _r2)
 65170  }
 65171  
 65172  var _vdbeSorterSortØ00__func__Ø000 [15]int8
 65173  
 65174  func init() {
 65175  	crt.Xstrncpy(nil, &_vdbeSorterSortØ00__func__Ø000[0], str(84489), 15)
 65176  }
 65177  
 65178  // C comment
 65179  //  /*
 65180  //  ** Merge the two sorted lists p1 and p2 into a single list.
 65181  //  */
 65182  func _vdbeSorterMerge(tls *crt.TLS, _pTask *XSortSubtask, _p1 *XSorterRecord, _p2 *XSorterRecord) (r0 *XSorterRecord) {
 65183  	var _bCached, _1_res int32
 65184  	var _pFinal *XSorterRecord
 65185  	var _pp **XSorterRecord
 65186  	_pFinal = nil
 65187  	_pp = &_pFinal
 65188  	_bCached = int32(0)
 65189  	func() {
 65190  		if _p1 == nil || _p2 == nil {
 65191  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87364), unsafe.Pointer(&_vdbeSorterMergeØ00__func__Ø000), unsafe.Pointer(str(84504)))
 65192  			crt.X__builtin_abort(tls)
 65193  		}
 65194  	}()
 65195  _3:
 65196  	_1_res = func() func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 {
 65197  		v := _pTask.XxCompare
 65198  		return *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&v))
 65199  	}()(tls, _pTask, &_bCached, unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(int32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))), _p1.XnVal, unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(int32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))), _p2.XnVal)
 65200  	if _1_res > int32(0) {
 65201  		goto _6
 65202  	}
 65203  	*_pp = _p1
 65204  	_pp = (**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p1.Xu))))
 65205  	_p1 = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_p1.Xu)))
 65206  	if _p1 == nil {
 65207  		*_pp = _p2
 65208  		goto _5
 65209  	}
 65210  	goto _8
 65211  _6:
 65212  	*_pp = _p2
 65213  	_pp = (**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p2.Xu))))
 65214  	_p2 = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_p2.Xu)))
 65215  	_bCached = int32(0)
 65216  	if _p2 == nil {
 65217  		*_pp = _p1
 65218  		goto _5
 65219  	}
 65220  _8:
 65221  	goto _3
 65222  _5:
 65223  	return _pFinal
 65224  }
 65225  
 65226  var _vdbeSorterMergeØ00__func__Ø000 [16]int8
 65227  
 65228  func init() {
 65229  	crt.Xstrncpy(nil, &_vdbeSorterMergeØ00__func__Ø000[0], str(84519), 16)
 65230  }
 65231  
 65232  // C comment
 65233  //  /*
 65234  //  ** Flush the current contents of VdbeSorter.list to a new PMA, possibly
 65235  //  ** using a background thread.
 65236  //  */
 65237  func _vdbeSorterFlushPMA(tls *crt.TLS, _pSorter *XVdbeSorter) (r0 int32) {
 65238  	var _rc, _i, _nWorker, _1_iTest int32
 65239  	var _5_pCtx unsafe.Pointer
 65240  	var _5_aMem *uint8
 65241  	var _pTask *XSortSubtask
 65242  	_rc = int32(0)
 65243  	_pTask = nil
 65244  	_nWorker = int32(_pSorter.XnTask) - int32(1)
 65245  	_pSorter.XbUsePMA = uint8(1)
 65246  	_i = int32(0)
 65247  _0:
 65248  	if _i >= _nWorker {
 65249  		goto _3
 65250  	}
 65251  	_1_iTest = ((int32(_pSorter.XiPrev) + _i) + int32(1)) % _nWorker
 65252  	_pTask = elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_1_iTest))
 65253  	if _pTask.XbDone != 0 {
 65254  		_rc = _vdbeSorterJoinThread(tls, _pTask)
 65255  	}
 65256  	if (_rc != int32(0)) || ((*XSQLiteThread)(_pTask.XpThread) == nil) {
 65257  		goto _3
 65258  	}
 65259  	_i += 1
 65260  	goto _0
 65261  _3:
 65262  	if _rc != int32(0) {
 65263  		goto _7
 65264  	}
 65265  	if _i == _nWorker {
 65266  		_rc = _vdbeSorterListToPMA(tls, elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_nWorker)), &_pSorter.Xlist)
 65267  		goto _9
 65268  	}
 65269  	_5_aMem = _pTask.Xlist.XaMemory
 65270  	_5_pCtx = unsafe.Pointer(_pTask)
 65271  	func() {
 65272  		if (*XSQLiteThread)(_pTask.XpThread) != nil || _pTask.XbDone != int32(0) {
 65273  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87751), unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000), unsafe.Pointer(str(84535)))
 65274  			crt.X__builtin_abort(tls)
 65275  		}
 65276  	}()
 65277  	func() {
 65278  		if (*XSorterRecord)(_pTask.Xlist.XpList) != nil {
 65279  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87752), unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000), unsafe.Pointer(str(84572)))
 65280  			crt.X__builtin_abort(tls)
 65281  		}
 65282  	}()
 65283  	func() {
 65284  		if (_pTask.Xlist.XaMemory) != nil && (_pSorter.Xlist.XaMemory) == nil {
 65285  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87753), unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000), unsafe.Pointer(str(84593)))
 65286  			crt.X__builtin_abort(tls)
 65287  		}
 65288  	}()
 65289  	_pSorter.XiPrev = uint8(int64((uintptr(unsafe.Pointer(_pTask)) - uintptr(unsafe.Pointer(&_pSorter.XaTask))) / 104))
 65290  	_pTask.Xlist = _pSorter.Xlist
 65291  	*(**XSorterRecord)(unsafe.Pointer(&(_pSorter.Xlist.XpList))) = nil
 65292  	_pSorter.Xlist.XszPMA = int32(0)
 65293  	if _5_aMem != nil {
 65294  		_pSorter.Xlist.XaMemory = _5_aMem
 65295  		_pSorter.XnMemory = _sqlite3MallocSize(tls, unsafe.Pointer(_5_aMem))
 65296  		goto _20
 65297  	}
 65298  	if (_pSorter.Xlist.XaMemory) == nil {
 65299  		goto _20
 65300  	}
 65301  	_pSorter.Xlist.XaMemory = (*uint8)(_sqlite3Malloc(tls, uint64(_pSorter.XnMemory)))
 65302  	if (_pSorter.Xlist.XaMemory) == nil {
 65303  		return _sqlite3NomemError(tls, int32(87764))
 65304  	}
 65305  _20:
 65306  	_rc = _vdbeSorterCreateThread(tls, _pTask, _vdbeSorterFlushThread, _5_pCtx)
 65307  _9:
 65308  _7:
 65309  	return _rc
 65310  }
 65311  
 65312  // C comment
 65313  //  /*
 65314  //  ** Write the current contents of in-memory linked-list pList to a level-0
 65315  //  ** PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if
 65316  //  ** successful, or an SQLite error code otherwise.
 65317  //  **
 65318  //  ** The format of a PMA is:
 65319  //  **
 65320  //  **     * A varint. This varint contains the total number of bytes of content
 65321  //  **       in the PMA (not including the varint itself).
 65322  //  **
 65323  //  **     * One or more records packed end-to-end in order of ascending keys.
 65324  //  **       Each record consists of a varint followed by a blob of data (the
 65325  //  **       key). The varint is the number of bytes in the blob of data.
 65326  //  */
 65327  func _vdbeSorterListToPMA(tls *crt.TLS, _pTask *XSortSubtask, _pList *t90) (r0 int32) {
 65328  	var _rc int32
 65329  	var _iSz int64
 65330  	var _db *Xsqlite3
 65331  	var _4_p, _4_pNext *XSorterRecord
 65332  	var _writer XPmaWriter
 65333  	_db = (*Xsqlite3)((*XVdbeSorter)(_pTask.XpSorter).Xdb)
 65334  	_rc = int32(0)
 65335  	_iSz = int64(_pList.XszPMA+_sqlite3VarintLen(tls, uint64(_pList.XszPMA))) + (_pTask.Xfile.XiEof)
 65336  	crt.Xmemset(tls, unsafe.Pointer(&_writer), int32(0), uint64(48))
 65337  	func() {
 65338  		if _pList.XszPMA <= int32(0) {
 65339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87575), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84644)))
 65340  			crt.X__builtin_abort(tls)
 65341  		}
 65342  	}()
 65343  	if (*Xsqlite3_file)(_pTask.Xfile.XpFd) == nil {
 65344  		_rc = _vdbeSorterOpenTempFile(tls, _db, 0, (**Xsqlite3_file)(unsafe.Pointer(&(_pTask.Xfile.XpFd))))
 65345  		func() {
 65346  			if _rc == int32(0) && (_pTask.Xfile.XpFd) == nil {
 65347  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87580), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84659)))
 65348  				crt.X__builtin_abort(tls)
 65349  			}
 65350  		}()
 65351  		func() {
 65352  			if (_pTask.Xfile.XiEof) != (0) {
 65353  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87581), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84692)))
 65354  				crt.X__builtin_abort(tls)
 65355  			}
 65356  		}()
 65357  		func() {
 65358  			if _pTask.XnPMA != int32(0) {
 65359  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87582), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84712)))
 65360  				crt.X__builtin_abort(tls)
 65361  			}
 65362  		}()
 65363  	}
 65364  	if _rc == int32(0) {
 65365  		_vdbeSorterExtendFile(tls, _db, (*Xsqlite3_file)(_pTask.Xfile.XpFd), ((_pTask.Xfile.XiEof)+int64(_pList.XszPMA))+int64(9))
 65366  	}
 65367  	if _rc == int32(0) {
 65368  		_rc = _vdbeSorterSort(tls, _pTask, _pList)
 65369  	}
 65370  	if _rc != int32(0) {
 65371  		goto _12
 65372  	}
 65373  	_4_pNext = nil
 65374  	_vdbePmaWriterInit(tls, (*Xsqlite3_file)(_pTask.Xfile.XpFd), &_writer, (*XVdbeSorter)(_pTask.XpSorter).Xpgsz, _pTask.Xfile.XiEof)
 65375  	_pTask.XnPMA += 1
 65376  	_vdbePmaWriteVarint(tls, &_writer, uint64(_pList.XszPMA))
 65377  	_4_p = (*XSorterRecord)(_pList.XpList)
 65378  _13:
 65379  	if _4_p == nil {
 65380  		goto _16
 65381  	}
 65382  	_4_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_p.Xu)))
 65383  	_vdbePmaWriteVarint(tls, &_writer, uint64(_4_p.XnVal))
 65384  	_vdbePmaWriteBlob(tls, &_writer, (*uint8)(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_p))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(int32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16))))))))))))), _4_p.XnVal)
 65385  	if _pList.XaMemory == nil {
 65386  		Xsqlite3_free(tls, unsafe.Pointer(_4_p))
 65387  	}
 65388  	_4_p = _4_pNext
 65389  	goto _13
 65390  _16:
 65391  	*(**XSorterRecord)(unsafe.Pointer(&_pList.XpList)) = _4_p
 65392  	_rc = _vdbePmaWriterFinish(tls, &_writer, &(_pTask.Xfile.XiEof))
 65393  _12:
 65394  	func() {
 65395  		if _rc == int32(0) && (*XSorterRecord)(_pList.XpList) != nil {
 65396  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87614), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84727)))
 65397  			crt.X__builtin_abort(tls)
 65398  		}
 65399  	}()
 65400  	func() {
 65401  		if _rc == int32(0) && (_pTask.Xfile.XiEof) != _iSz {
 65402  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87615), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84760)))
 65403  			crt.X__builtin_abort(tls)
 65404  		}
 65405  	}()
 65406  	return _rc
 65407  }
 65408  
 65409  var _vdbeSorterListToPMAØ00__func__Ø000 [20]int8
 65410  
 65411  func init() {
 65412  	crt.Xstrncpy(nil, &_vdbeSorterListToPMAØ00__func__Ø000[0], str(84799), 20)
 65413  }
 65414  
 65415  // C comment
 65416  //  /*
 65417  //  ** Allocate space for a file-handle and open a temporary file. If successful,
 65418  //  ** set *ppFd to point to the malloc'd file-handle and return SQLITE_OK.
 65419  //  ** Otherwise, set *ppFd to 0 and return an SQLite error code.
 65420  //  */
 65421  func _vdbeSorterOpenTempFile(tls *crt.TLS, _db *Xsqlite3, _nExtend int64, _ppFd **Xsqlite3_file) (r0 int32) {
 65422  	var _rc int32
 65423  	var _1_max int64
 65424  	if _sqlite3FaultSim(tls, int32(202)) != 0 {
 65425  		return int32(3338)
 65426  	}
 65427  	_rc = _sqlite3OsOpenMalloc(tls, (*Xsqlite3_vfs)(_db.XpVfs), nil, _ppFd, int32(4126), &_rc)
 65428  	if _rc != int32(0) {
 65429  		goto _1
 65430  	}
 65431  	_1_max = int64(2147418112)
 65432  	_sqlite3OsFileControlHint(tls, *_ppFd, int32(18), unsafe.Pointer(&_1_max))
 65433  	if _nExtend > (0) {
 65434  		_vdbeSorterExtendFile(tls, _db, *_ppFd, _nExtend)
 65435  	}
 65436  _1:
 65437  	return _rc
 65438  
 65439  	_ = _1_max
 65440  	panic(0)
 65441  }
 65442  
 65443  // C comment
 65444  //  /*
 65445  //  ** The first argument is a file-handle open on a temporary file. The file
 65446  //  ** is guaranteed to be nByte bytes or smaller in size. This function
 65447  //  ** attempts to extend the file to nByte bytes in size and to ensure that
 65448  //  ** the VFS has memory mapped it.
 65449  //  **
 65450  //  ** Whether or not the file does end up memory mapped of course depends on
 65451  //  ** the specific VFS implementation.
 65452  //  */
 65453  func _vdbeSorterExtendFile(tls *crt.TLS, _db *Xsqlite3, _pFd *Xsqlite3_file, _nByte int64) {
 65454  	var _1_chunksize int32
 65455  	var _1_p unsafe.Pointer
 65456  	if (_nByte <= int64(_db.XnMaxSorterMmap)) && (((*Xsqlite3_io_methods)(_pFd.XpMethods).XiVersion) >= int32(3)) {
 65457  		_1_p = nil
 65458  		_1_chunksize = int32(4096)
 65459  		_sqlite3OsFileControlHint(tls, _pFd, int32(6), unsafe.Pointer(&_1_chunksize))
 65460  		_sqlite3OsFileControlHint(tls, _pFd, int32(5), unsafe.Pointer(&_nByte))
 65461  		_sqlite3OsFetch(tls, _pFd, 0, int32(_nByte), &_1_p)
 65462  		_sqlite3OsUnfetch(tls, _pFd, 0, _1_p)
 65463  	}
 65464  	_ = _1_chunksize
 65465  }
 65466  
 65467  // C comment
 65468  //  /*
 65469  //  ** Initialize a PMA-writer object.
 65470  //  */
 65471  func _vdbePmaWriterInit(tls *crt.TLS, _pFd *Xsqlite3_file, _p *XPmaWriter, _nBuf int32, _iStart int64) {
 65472  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(48))
 65473  	_p.XaBuffer = (*uint8)(_sqlite3Malloc(tls, uint64(_nBuf)))
 65474  	if _p.XaBuffer == nil {
 65475  		_p.XeFWErr = _sqlite3NomemError(tls, int32(87476))
 65476  		goto _1
 65477  	}
 65478  	_p.XiBufEnd = store2(&_p.XiBufStart, int32(_iStart%int64(_nBuf)))
 65479  	_p.XiWriteOff = _iStart - int64(_p.XiBufStart)
 65480  	_p.XnBuffer = _nBuf
 65481  	*(**Xsqlite3_file)(unsafe.Pointer(&_p.XpFd)) = _pFd
 65482  _1:
 65483  }
 65484  
 65485  // C comment
 65486  //  /*
 65487  //  ** Write value iVal encoded as a varint to the PMA. Return
 65488  //  ** SQLITE_OK if successful, or an SQLite error code if an error occurs.
 65489  //  */
 65490  func _vdbePmaWriteVarint(tls *crt.TLS, _p *XPmaWriter, _iVal uint64) {
 65491  	var _nByte int32
 65492  	var _aByte [10]uint8
 65493  	_nByte = _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(&_aByte)), _iVal)
 65494  	_vdbePmaWriteBlob(tls, _p, (*uint8)(unsafe.Pointer(&_aByte)), _nByte)
 65495  	_ = _aByte
 65496  }
 65497  
 65498  // C comment
 65499  //  /*
 65500  //  ** Write nData bytes of data to the PMA. Return SQLITE_OK
 65501  //  ** if successful, or an SQLite error code if an error occurs.
 65502  //  */
 65503  func _vdbePmaWriteBlob(tls *crt.TLS, _p *XPmaWriter, _pData *uint8, _nData int32) {
 65504  	var _nRem, _1_nCopy int32
 65505  	_nRem = _nData
 65506  _0:
 65507  	if _nRem <= int32(0) || _p.XeFWErr != int32(0) {
 65508  		goto _1
 65509  	}
 65510  	_1_nCopy = _nRem
 65511  	if _1_nCopy > (_p.XnBuffer - _p.XiBufEnd) {
 65512  		_1_nCopy = _p.XnBuffer - _p.XiBufEnd
 65513  	}
 65514  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_p.XaBuffer, uintptr(_p.XiBufEnd))), unsafe.Pointer(elem15(_pData, uintptr(_nData-_nRem))), uint64(_1_nCopy))
 65515  	_p.XiBufEnd += _1_nCopy
 65516  	if _p.XiBufEnd == _p.XnBuffer {
 65517  		_p.XeFWErr = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.XpFd), unsafe.Pointer(elem15(_p.XaBuffer, uintptr(_p.XiBufStart))), _p.XiBufEnd-_p.XiBufStart, _p.XiWriteOff+int64(_p.XiBufStart))
 65518  		_p.XiBufStart = store2(&_p.XiBufEnd, int32(0))
 65519  		_p.XiWriteOff += int64(_p.XnBuffer)
 65520  	}
 65521  	func() {
 65522  		if _p.XiBufEnd >= _p.XnBuffer {
 65523  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87507), unsafe.Pointer(&_vdbePmaWriteBlobØ00__func__Ø000), unsafe.Pointer(str(84819)))
 65524  			crt.X__builtin_abort(tls)
 65525  		}
 65526  	}()
 65527  	_nRem -= _1_nCopy
 65528  	goto _0
 65529  _1:
 65530  }
 65531  
 65532  var _vdbePmaWriteBlobØ00__func__Ø000 [17]int8
 65533  
 65534  func init() {
 65535  	crt.Xstrncpy(nil, &_vdbePmaWriteBlobØ00__func__Ø000[0], str(84841), 17)
 65536  }
 65537  
 65538  // C comment
 65539  //  /*
 65540  //  ** Flush any buffered data to disk and clean up the PMA-writer object.
 65541  //  ** The results of using the PMA-writer after this call are undefined.
 65542  //  ** Return SQLITE_OK if flushing the buffered data succeeds or is not
 65543  //  ** required. Otherwise, return an SQLite error code.
 65544  //  **
 65545  //  ** Before returning, set *piEof to the offset immediately following the
 65546  //  ** last byte written to the file.
 65547  //  */
 65548  func _vdbePmaWriterFinish(tls *crt.TLS, _p *XPmaWriter, _piEof *int64) (r0 int32) {
 65549  	var _rc int32
 65550  	if ((_p.XeFWErr == int32(0)) && func() int32 {
 65551  		if _p.XaBuffer != nil {
 65552  			return int32(1)
 65553  		}
 65554  		return func() int32 {
 65555  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87524), unsafe.Pointer(&_vdbePmaWriterFinishØ00__func__Ø000), unsafe.Pointer(str(4809)))
 65556  			crt.X__builtin_abort(tls)
 65557  			return int32(0)
 65558  		}()
 65559  	}() != 0) && (_p.XiBufEnd > _p.XiBufStart) {
 65560  		_p.XeFWErr = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.XpFd), unsafe.Pointer(elem15(_p.XaBuffer, uintptr(_p.XiBufStart))), _p.XiBufEnd-_p.XiBufStart, _p.XiWriteOff+int64(_p.XiBufStart))
 65561  	}
 65562  	*_piEof = _p.XiWriteOff + int64(_p.XiBufEnd)
 65563  	Xsqlite3_free(tls, unsafe.Pointer(_p.XaBuffer))
 65564  	_rc = _p.XeFWErr
 65565  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(48))
 65566  	return _rc
 65567  }
 65568  
 65569  var _vdbePmaWriterFinishØ00__func__Ø000 [20]int8
 65570  
 65571  func init() {
 65572  	crt.Xstrncpy(nil, &_vdbePmaWriterFinishØ00__func__Ø000[0], str(84858), 20)
 65573  }
 65574  
 65575  var _vdbeSorterFlushPMAØ00__func__Ø000 [19]int8
 65576  
 65577  func init() {
 65578  	crt.Xstrncpy(nil, &_vdbeSorterFlushPMAØ00__func__Ø000[0], str(84878), 19)
 65579  }
 65580  
 65581  // C comment
 65582  //  /*
 65583  //  ** Launch a background thread to run xTask(pIn).
 65584  //  */
 65585  func _vdbeSorterCreateThread(tls *crt.TLS, _pTask *XSortSubtask, _xTask func(*crt.TLS, unsafe.Pointer) unsafe.Pointer, _pIn unsafe.Pointer) (r0 int32) {
 65586  	func() {
 65587  		if (*XSQLiteThread)(_pTask.XpThread) != nil || _pTask.XbDone != int32(0) {
 65588  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87148), unsafe.Pointer(&_vdbeSorterCreateThreadØ00__func__Ø000), unsafe.Pointer(str(84535)))
 65589  			crt.X__builtin_abort(tls)
 65590  		}
 65591  	}()
 65592  	return _sqlite3ThreadCreate(tls, (**XSQLiteThread)(unsafe.Pointer(&_pTask.XpThread)), _xTask, _pIn)
 65593  }
 65594  
 65595  var _vdbeSorterCreateThreadØ00__func__Ø000 [23]int8
 65596  
 65597  func init() {
 65598  	crt.Xstrncpy(nil, &_vdbeSorterCreateThreadØ00__func__Ø000[0], str(84897), 23)
 65599  }
 65600  
 65601  // C comment
 65602  //  /* Create a new thread */
 65603  func _sqlite3ThreadCreate(tls *crt.TLS, _ppThread **XSQLiteThread, _xTask func(*crt.TLS, unsafe.Pointer) unsafe.Pointer, _pIn unsafe.Pointer) (r0 int32) {
 65604  	var _rc int32
 65605  	var _p *XSQLiteThread
 65606  	func() {
 65607  		if _ppThread == nil {
 65608  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26905), unsafe.Pointer(&_sqlite3ThreadCreateØ00__func__Ø000), unsafe.Pointer(str(84920)))
 65609  			crt.X__builtin_abort(tls)
 65610  		}
 65611  	}()
 65612  	func() {
 65613  		if _xTask == nil {
 65614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26906), unsafe.Pointer(&_sqlite3ThreadCreateØ00__func__Ø000), unsafe.Pointer(str(84932)))
 65615  			crt.X__builtin_abort(tls)
 65616  		}
 65617  	}()
 65618  	func() {
 65619  		if _sqlite3Config.XbCoreMutex == int32(0) {
 65620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26908), unsafe.Pointer(&_sqlite3ThreadCreateØ00__func__Ø000), unsafe.Pointer(str(84941)))
 65621  			crt.X__builtin_abort(tls)
 65622  		}
 65623  	}()
 65624  	*_ppThread = nil
 65625  	_p = (*XSQLiteThread)(_sqlite3Malloc(tls, uint64(40)))
 65626  	if _p == nil {
 65627  		return _sqlite3NomemError(tls, int32(26912))
 65628  	}
 65629  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(40))
 65630  	_p.XxTask = _xTask
 65631  	_p.XpIn = _pIn
 65632  	if _sqlite3FaultSim(tls, int32(200)) != 0 {
 65633  		_rc = int32(1)
 65634  		goto _8
 65635  	}
 65636  	_rc = crt.Xpthread_create(tls, &_p.Xtid, nil, _xTask, _pIn)
 65637  _8:
 65638  	if _rc != 0 {
 65639  		_p.Xdone = int32(1)
 65640  		_p.XpOut = _xTask(tls, _pIn)
 65641  	}
 65642  	*_ppThread = _p
 65643  	return int32(0)
 65644  }
 65645  
 65646  var _sqlite3ThreadCreateØ00__func__Ø000 [20]int8
 65647  
 65648  func init() {
 65649  	crt.Xstrncpy(nil, &_sqlite3ThreadCreateØ00__func__Ø000[0], str(84975), 20)
 65650  }
 65651  
 65652  // C comment
 65653  //  /*
 65654  //  ** The main routine for background threads that write level-0 PMAs.
 65655  //  */
 65656  func _vdbeSorterFlushThread(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) {
 65657  	var _rc int32
 65658  	var _pTask *XSortSubtask
 65659  	_pTask = (*XSortSubtask)(_pCtx)
 65660  	func() {
 65661  		if _pTask.XbDone != int32(0) {
 65662  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87700), unsafe.Pointer(&_vdbeSorterFlushThreadØ00__func__Ø000), unsafe.Pointer(str(84995)))
 65663  			crt.X__builtin_abort(tls)
 65664  		}
 65665  	}()
 65666  	_rc = _vdbeSorterListToPMA(tls, _pTask, &_pTask.Xlist)
 65667  	_pTask.XbDone = int32(1)
 65668  	return crt.U2P(uintptr(int64(_rc)))
 65669  }
 65670  
 65671  var _vdbeSorterFlushThreadØ00__func__Ø000 [22]int8
 65672  
 65673  func init() {
 65674  	crt.Xstrncpy(nil, &_vdbeSorterFlushThreadØ00__func__Ø000[0], str(85011), 22)
 65675  }
 65676  
 65677  // C comment
 65678  //  /*
 65679  //  ** This function is called as part of an sqlite3VdbeSorterRewind() operation
 65680  //  ** on a sorter that has written two or more PMAs to temporary files. It sets
 65681  //  ** up either VdbeSorter.pMerger (for single threaded sorters) or pReader
 65682  //  ** (for multi-threaded sorters) so that it can be used to iterate through
 65683  //  ** all records stored in the sorter.
 65684  //  **
 65685  //  ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 65686  //  */
 65687  func _vdbeSorterSetupMerge(tls *crt.TLS, _pSorter *XVdbeSorter) (r0 int32) {
 65688  	var _rc, _i, _3_iTask int32
 65689  	var _db *Xsqlite3
 65690  	var _3_pReadr, _9_p *XPmaReader
 65691  	var _7_pIncr *XIncrMerger
 65692  	var _pTask0, _3_pLast *XSortSubtask
 65693  	var _xCompare func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32
 65694  	var _pMain *XMergeEngine
 65695  	_pTask0 = elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), 0)
 65696  	_pMain = nil
 65697  	_db = (*Xsqlite3)((*XVdbeSorter)(_pTask0.XpSorter).Xdb)
 65698  	_xCompare = _vdbeSorterGetCompare(tls, _pSorter)
 65699  	_i = int32(0)
 65700  _0:
 65701  	if _i >= int32(_pSorter.XnTask) {
 65702  		goto _3
 65703  	}
 65704  	*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&(elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_i)).XxCompare))) = _xCompare
 65705  	_i += 1
 65706  	goto _0
 65707  _3:
 65708  	_rc = _vdbeSorterMergeTreeBuild(tls, _pSorter, &_pMain)
 65709  	if _rc != int32(0) {
 65710  		goto _4
 65711  	}
 65712  	func() {
 65713  		if int32(_pSorter.XbUseThreads) != int32(0) && int32(_pSorter.XnTask) <= int32(1) {
 65714  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88517), unsafe.Pointer(&_vdbeSorterSetupMergeØ00__func__Ø000), unsafe.Pointer(str(85033)))
 65715  			crt.X__builtin_abort(tls)
 65716  		}
 65717  	}()
 65718  	if _pSorter.XbUseThreads == 0 {
 65719  		goto _8
 65720  	}
 65721  	_3_pReadr = nil
 65722  	_3_pLast = elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(int32(_pSorter.XnTask)-int32(1)))
 65723  	_rc = _vdbeSortAllocUnpacked(tls, _3_pLast)
 65724  	if _rc != int32(0) {
 65725  		goto _9
 65726  	}
 65727  	_3_pReadr = (*XPmaReader)(_sqlite3DbMallocZero(tls, _db, uint64(80)))
 65728  	*(**XPmaReader)(unsafe.Pointer(&_pSorter.XpReader)) = _3_pReadr
 65729  	if _3_pReadr == nil {
 65730  		_rc = _sqlite3NomemError(tls, int32(88526))
 65731  	}
 65732  _9:
 65733  	if _rc != int32(0) {
 65734  		goto _11
 65735  	}
 65736  	_rc = _vdbeIncrMergerNew(tls, _3_pLast, _pMain, (**XIncrMerger)(unsafe.Pointer(&_3_pReadr.XpIncr)))
 65737  	if _rc != int32(0) {
 65738  		goto _12
 65739  	}
 65740  	_vdbeIncrMergerSetThreads(tls, (*XIncrMerger)(_3_pReadr.XpIncr))
 65741  	_3_iTask = int32(0)
 65742  _13:
 65743  	if _3_iTask >= (int32(_pSorter.XnTask) - int32(1)) {
 65744  		goto _16
 65745  	}
 65746  	if store92(&_7_pIncr, (*XIncrMerger)(elem82((*XPmaReader)(_pMain.XaReadr), uintptr(_3_iTask)).XpIncr)) != nil {
 65747  		_vdbeIncrMergerSetThreads(tls, _7_pIncr)
 65748  		func() {
 65749  			if (*XSortSubtask)(_7_pIncr.XpTask) == _3_pLast {
 65750  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88536), unsafe.Pointer(&_vdbeSorterSetupMergeØ00__func__Ø000), unsafe.Pointer(str(85077)))
 65751  				crt.X__builtin_abort(tls)
 65752  			}
 65753  		}()
 65754  	}
 65755  	_3_iTask += 1
 65756  	goto _13
 65757  _16:
 65758  	_3_iTask = int32(0)
 65759  _20:
 65760  	if _rc != int32(0) || _3_iTask >= int32(_pSorter.XnTask) {
 65761  		goto _24
 65762  	}
 65763  	_9_p = elem82((*XPmaReader)(_pMain.XaReadr), uintptr(_3_iTask))
 65764  	func() {
 65765  		if (*XIncrMerger)(_9_p.XpIncr) != nil && ((*XSortSubtask)((*XIncrMerger)(_9_p.XpIncr).XpTask) != elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_3_iTask)) || _3_iTask == (int32(_pSorter.XnTask)-int32(1)) && ((*XIncrMerger)(_9_p.XpIncr).XbUseThread) != int32(0)) {
 65766  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88550), unsafe.Pointer(&_vdbeSorterSetupMergeØ00__func__Ø000), unsafe.Pointer(str(85097)))
 65767  			crt.X__builtin_abort(tls)
 65768  		}
 65769  	}()
 65770  	_rc = _vdbePmaReaderIncrInit(tls, _9_p, int32(1))
 65771  	_3_iTask += 1
 65772  	goto _20
 65773  _24:
 65774  _12:
 65775  	_pMain = nil
 65776  _11:
 65777  	if _rc == int32(0) {
 65778  		_rc = _vdbePmaReaderIncrMergeInit(tls, _3_pReadr, int32(2))
 65779  	}
 65780  	goto _31
 65781  _8:
 65782  	_rc = _vdbeMergeEngineInit(tls, _pTask0, _pMain, int32(0))
 65783  	*(**XMergeEngine)(unsafe.Pointer(&_pSorter.XpMerger)) = _pMain
 65784  	_pMain = nil
 65785  _31:
 65786  _4:
 65787  	if _rc != int32(0) {
 65788  		_vdbeMergeEngineFree(tls, _pMain)
 65789  	}
 65790  	return _rc
 65791  }
 65792  
 65793  // C comment
 65794  //  /*
 65795  //  ** This function is called as part of a SorterRewind() operation on a sorter
 65796  //  ** that has already written two or more level-0 PMAs to one or more temp
 65797  //  ** files. It builds a tree of MergeEngine/IncrMerger/PmaReader objects that
 65798  //  ** can be used to incrementally merge all PMAs on disk.
 65799  //  **
 65800  //  ** If successful, SQLITE_OK is returned and *ppOut set to point to the
 65801  //  ** MergeEngine object at the root of the tree before returning. Or, if an
 65802  //  ** error occurs, an SQLite error code is returned and the final value
 65803  //  ** of *ppOut is undefined.
 65804  //  */
 65805  func _vdbeSorterMergeTreeBuild(tls *crt.TLS, _pSorter *XVdbeSorter, _ppOut **XMergeEngine) (r0 int32) {
 65806  	var _rc, _iTask, _3_nDepth, _5_i, _5_iSeq, _6_nReader int32
 65807  	var _3_iReadOff int64
 65808  	var _2_pTask *XSortSubtask
 65809  	var _pMain, _3_pRoot, _6_pMerger *XMergeEngine
 65810  	_pMain = nil
 65811  	_rc = int32(0)
 65812  	func() {
 65813  		if _pSorter.XbUseThreads == 0 && int32(_pSorter.XnTask) != int32(1) {
 65814  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88434), unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000), unsafe.Pointer(str(85214)))
 65815  			crt.X__builtin_abort(tls)
 65816  		}
 65817  	}()
 65818  	if int32(_pSorter.XnTask) <= int32(1) {
 65819  		goto _3
 65820  	}
 65821  	_pMain = _vdbeMergeEngineNew(tls, int32(_pSorter.XnTask))
 65822  	if _pMain == nil {
 65823  		_rc = _sqlite3NomemError(tls, int32(88437))
 65824  	}
 65825  _3:
 65826  	_iTask = int32(0)
 65827  _5:
 65828  	if _rc != int32(0) || _iTask >= int32(_pSorter.XnTask) {
 65829  		goto _9
 65830  	}
 65831  	_2_pTask = elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_iTask))
 65832  	func() {
 65833  		if _2_pTask.XnPMA <= int32(0) && int32(1) == 0 {
 65834  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88443), unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000), unsafe.Pointer(str(85256)))
 65835  			crt.X__builtin_abort(tls)
 65836  		}
 65837  	}()
 65838  	if int32(0) == 0 && _2_pTask.XnPMA == 0 {
 65839  		goto _14
 65840  	}
 65841  	_3_pRoot = nil
 65842  	_3_nDepth = _vdbeSorterTreeDepth(tls, _2_pTask.XnPMA)
 65843  	_3_iReadOff = 0
 65844  	if _2_pTask.XnPMA <= int32(16) {
 65845  		_rc = _vdbeMergeEngineLevel0(tls, _2_pTask, _2_pTask.XnPMA, &_3_iReadOff, &_3_pRoot)
 65846  		goto _16
 65847  	}
 65848  	_5_iSeq = int32(0)
 65849  	_3_pRoot = _vdbeMergeEngineNew(tls, int32(16))
 65850  	if _3_pRoot == nil {
 65851  		_rc = _sqlite3NomemError(tls, int32(88455))
 65852  	}
 65853  	_5_i = int32(0)
 65854  _18:
 65855  	if _5_i >= _2_pTask.XnPMA || _rc != int32(0) {
 65856  		goto _22
 65857  	}
 65858  	_6_pMerger = nil
 65859  	_6_nReader = func() int32 {
 65860  		if (_2_pTask.XnPMA - _5_i) < int32(16) {
 65861  			return (_2_pTask.XnPMA - _5_i)
 65862  		}
 65863  		return int32(16)
 65864  	}()
 65865  	_rc = _vdbeMergeEngineLevel0(tls, _2_pTask, _6_nReader, &_3_iReadOff, &_6_pMerger)
 65866  	if _rc == int32(0) {
 65867  		_rc = _vdbeSorterAddToTree(tls, _2_pTask, _3_nDepth, postInc2(&_5_iSeq, 1), _3_pRoot, _6_pMerger)
 65868  	}
 65869  	_5_i += int32(16)
 65870  	goto _18
 65871  _22:
 65872  _16:
 65873  	if _rc != int32(0) {
 65874  		goto _26
 65875  	}
 65876  	if _pMain != nil {
 65877  		_rc = _vdbeIncrMergerNew(tls, _2_pTask, _3_pRoot, (**XIncrMerger)(unsafe.Pointer(&(elem82((*XPmaReader)(_pMain.XaReadr), uintptr(_iTask)).XpIncr))))
 65878  		goto _28
 65879  	}
 65880  	func() {
 65881  		if _pMain != nil {
 65882  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88475), unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000), unsafe.Pointer(str(85301)))
 65883  			crt.X__builtin_abort(tls)
 65884  		}
 65885  	}()
 65886  	_pMain = _3_pRoot
 65887  _28:
 65888  	goto _31
 65889  _26:
 65890  	_vdbeMergeEngineFree(tls, _3_pRoot)
 65891  _31:
 65892  _14:
 65893  	_iTask += 1
 65894  	goto _5
 65895  _9:
 65896  	if _rc != int32(0) {
 65897  		_vdbeMergeEngineFree(tls, _pMain)
 65898  		_pMain = nil
 65899  	}
 65900  	*_ppOut = _pMain
 65901  	return _rc
 65902  
 65903  	_ = _5_iSeq
 65904  	panic(0)
 65905  }
 65906  
 65907  var _vdbeSorterMergeTreeBuildØ00__func__Ø000 [25]int8
 65908  
 65909  func init() {
 65910  	crt.Xstrncpy(nil, &_vdbeSorterMergeTreeBuildØ00__func__Ø000[0], str(85310), 25)
 65911  }
 65912  
 65913  // C comment
 65914  //  /*
 65915  //  ** Allocate a new MergeEngine object capable of handling up to
 65916  //  ** nReader PmaReader inputs.
 65917  //  **
 65918  //  ** nReader is automatically rounded up to the next power of two.
 65919  //  ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up.
 65920  //  */
 65921  func _vdbeMergeEngineNew(tls *crt.TLS, _nReader int32) (r0 *XMergeEngine) {
 65922  	var _N, _nByte int32
 65923  	var _pNew *XMergeEngine
 65924  	_N = int32(2)
 65925  	func() {
 65926  		if _nReader > int32(16) {
 65927  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87191), unsafe.Pointer(&_vdbeMergeEngineNewØ00__func__Ø000), unsafe.Pointer(str(85335)))
 65928  			crt.X__builtin_abort(tls)
 65929  		}
 65930  	}()
 65931  _2:
 65932  	if _N < _nReader {
 65933  		_N += _N
 65934  		goto _2
 65935  	}
 65936  	_nByte = int32(uint64(32) + (uint64(_N) * uint64(84)))
 65937  	_pNew = func() *XMergeEngine {
 65938  		if _sqlite3FaultSim(tls, int32(100)) != 0 {
 65939  			return nil
 65940  		}
 65941  		return (*XMergeEngine)(_sqlite3MallocZero(tls, uint64(_nByte)))
 65942  	}()
 65943  	if _pNew != nil {
 65944  		_pNew.XnTree = _N
 65945  		*(**XSortSubtask)(unsafe.Pointer(&_pNew.XpTask)) = nil
 65946  		*(**XPmaReader)(unsafe.Pointer(&_pNew.XaReadr)) = (*XPmaReader)(unsafe.Pointer(elem93(_pNew, uintptr(1))))
 65947  		_pNew.XaTree = (*int32)(unsafe.Pointer(elem82((*XPmaReader)(_pNew.XaReadr), uintptr(_N))))
 65948  	}
 65949  	return _pNew
 65950  }
 65951  
 65952  var _vdbeMergeEngineNewØ00__func__Ø000 [19]int8
 65953  
 65954  func init() {
 65955  	crt.Xstrncpy(nil, &_vdbeMergeEngineNewØ00__func__Ø000[0], str(85367), 19)
 65956  }
 65957  
 65958  // C comment
 65959  //  /*
 65960  //  ** Return the depth of a tree comprising nPMA PMAs, assuming a fanout of
 65961  //  ** SORTER_MAX_MERGE_COUNT. The returned value does not include leaf nodes.
 65962  //  **
 65963  //  ** i.e.
 65964  //  **
 65965  //  **   nPMA<=16    -> TreeDepth() == 0
 65966  //  **   nPMA<=256   -> TreeDepth() == 1
 65967  //  **   nPMA<=65536 -> TreeDepth() == 2
 65968  //  */
 65969  func _vdbeSorterTreeDepth(tls *crt.TLS, _nPMA int32) (r0 int32) {
 65970  	var _nDepth int32
 65971  	var _nDiv int64
 65972  	_nDepth = int32(0)
 65973  	_nDiv = int64(16)
 65974  _0:
 65975  	if _nDiv < int64(_nPMA) {
 65976  		_nDiv = _nDiv * int64(16)
 65977  		_nDepth += 1
 65978  		goto _0
 65979  	}
 65980  	return _nDepth
 65981  }
 65982  
 65983  // C comment
 65984  //  /*
 65985  //  ** Allocate a new MergeEngine object to merge the contents of nPMA level-0
 65986  //  ** PMAs from pTask->file. If no error occurs, set *ppOut to point to
 65987  //  ** the new object and return SQLITE_OK. Or, if an error does occur, set *ppOut
 65988  //  ** to NULL and return an SQLite error code.
 65989  //  **
 65990  //  ** When this function is called, *piOffset is set to the offset of the
 65991  //  ** first PMA to read from pTask->file. Assuming no error occurs, it is
 65992  //  ** set to the offset immediately following the last byte of the last
 65993  //  ** PMA before returning. If an error does occur, then the final value of
 65994  //  ** *piOffset is undefined.
 65995  //  */
 65996  func _vdbeMergeEngineLevel0(tls *crt.TLS, _pTask *XSortSubtask, _nPMA int32, _piOffset *int64, _ppOut **XMergeEngine) (r0 int32) {
 65997  	var _i, _rc int32
 65998  	var _iOff, _1_nDummy int64
 65999  	var _1_pReadr *XPmaReader
 66000  	var _pNew *XMergeEngine
 66001  	_iOff = *_piOffset
 66002  	_rc = int32(0)
 66003  	*_ppOut = store93(&_pNew, _vdbeMergeEngineNew(tls, _nPMA))
 66004  	if _pNew == nil {
 66005  		_rc = _sqlite3NomemError(tls, int32(88321))
 66006  	}
 66007  	_i = int32(0)
 66008  _1:
 66009  	if _i >= _nPMA || _rc != int32(0) {
 66010  		goto _5
 66011  	}
 66012  	_1_nDummy = 0
 66013  	_1_pReadr = elem82((*XPmaReader)(_pNew.XaReadr), uintptr(_i))
 66014  	_rc = _vdbePmaReaderInit(tls, _pTask, &_pTask.Xfile, _iOff, _1_pReadr, &_1_nDummy)
 66015  	_iOff = _1_pReadr.XiEof
 66016  	_i += 1
 66017  	goto _1
 66018  _5:
 66019  	if _rc != int32(0) {
 66020  		_vdbeMergeEngineFree(tls, _pNew)
 66021  		*_ppOut = nil
 66022  	}
 66023  	*_piOffset = _iOff
 66024  	return _rc
 66025  }
 66026  
 66027  // C comment
 66028  //  /*
 66029  //  ** Initialize PmaReader pReadr to scan through the PMA stored in file pFile
 66030  //  ** starting at offset iStart and ending at offset iEof-1. This function
 66031  //  ** leaves the PmaReader pointing to the first key in the PMA (or EOF if the
 66032  //  ** PMA is empty).
 66033  //  **
 66034  //  ** If the pnByte parameter is NULL, then it is assumed that the file
 66035  //  ** contains a single PMA, and that that PMA omits the initial length varint.
 66036  //  */
 66037  func _vdbePmaReaderInit(tls *crt.TLS, _pTask *XSortSubtask, _pFile *XSorterFile, _iStart int64, _pReadr *XPmaReader, _pnByte *int64) (r0 int32) {
 66038  	var _rc int32
 66039  	var _1_nByte uint64
 66040  	func() {
 66041  		if _pFile.XiEof <= _iStart {
 66042  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86747), unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000), unsafe.Pointer(str(85386)))
 66043  			crt.X__builtin_abort(tls)
 66044  		}
 66045  	}()
 66046  	func() {
 66047  		if _pReadr.XaAlloc != nil || _pReadr.XnAlloc != int32(0) {
 66048  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86748), unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000), unsafe.Pointer(str(85405)))
 66049  			crt.X__builtin_abort(tls)
 66050  		}
 66051  	}()
 66052  	func() {
 66053  		if _pReadr.XaBuffer != nil {
 66054  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86749), unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000), unsafe.Pointer(str(85444)))
 66055  			crt.X__builtin_abort(tls)
 66056  		}
 66057  	}()
 66058  	func() {
 66059  		if _pReadr.XaMap != nil {
 66060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86750), unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000), unsafe.Pointer(str(85463)))
 66061  			crt.X__builtin_abort(tls)
 66062  		}
 66063  	}()
 66064  	_rc = _vdbePmaReaderSeek(tls, _pTask, _pReadr, _pFile, _iStart)
 66065  	if _rc == int32(0) {
 66066  		_1_nByte = uint64(0)
 66067  		_rc = _vdbePmaReadVarint(tls, _pReadr, &_1_nByte)
 66068  		_pReadr.XiEof = int64(uint64(_pReadr.XiReadOff) + _1_nByte)
 66069  		{
 66070  			p := _pnByte
 66071  			*p = int64(uint64(*p) + _1_nByte)
 66072  		}
 66073  	}
 66074  	if _rc == int32(0) {
 66075  		_rc = _vdbePmaReaderNext(tls, _pReadr)
 66076  	}
 66077  	return _rc
 66078  }
 66079  
 66080  var _vdbePmaReaderInitØ00__func__Ø000 [18]int8
 66081  
 66082  func init() {
 66083  	crt.Xstrncpy(nil, &_vdbePmaReaderInitØ00__func__Ø000[0], str(85479), 18)
 66084  }
 66085  
 66086  // C comment
 66087  //  /*
 66088  //  ** Attach PmaReader pReadr to file pFile (if it is not already attached to
 66089  //  ** that file) and seek it to offset iOff within the file.  Return SQLITE_OK
 66090  //  ** if successful, or an SQLite error code if an error occurs.
 66091  //  */
 66092  func _vdbePmaReaderSeek(tls *crt.TLS, _pTask *XSortSubtask, _pReadr *XPmaReader, _pFile *XSorterFile, _iOff int64) (r0 int32) {
 66093  	var _rc, _2_pgsz, _2_iBuf, _4_nRead int32
 66094  	_rc = int32(0)
 66095  	func() {
 66096  		if (*XIncrMerger)(_pReadr.XpIncr) != nil && ((*XIncrMerger)(_pReadr.XpIncr).XbEof) != int32(0) {
 66097  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86652), unsafe.Pointer(&_vdbePmaReaderSeekØ00__func__Ø000), unsafe.Pointer(str(85497)))
 66098  			crt.X__builtin_abort(tls)
 66099  		}
 66100  	}()
 66101  	if _sqlite3FaultSim(tls, int32(201)) != 0 {
 66102  		return int32(266)
 66103  	}
 66104  	if _pReadr.XaMap != nil {
 66105  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pReadr.XpFd), 0, unsafe.Pointer(_pReadr.XaMap))
 66106  		_pReadr.XaMap = nil
 66107  	}
 66108  	_pReadr.XiReadOff = _iOff
 66109  	_pReadr.XiEof = _pFile.XiEof
 66110  	*(**Xsqlite3_file)(unsafe.Pointer(&_pReadr.XpFd)) = (*Xsqlite3_file)(_pFile.XpFd)
 66111  	_rc = _vdbeSorterMapFile(tls, _pTask, _pFile, &_pReadr.XaMap)
 66112  	if _rc != int32(0) || _pReadr.XaMap != nil {
 66113  		goto _6
 66114  	}
 66115  	_2_pgsz = (*XVdbeSorter)(_pTask.XpSorter).Xpgsz
 66116  	_2_iBuf = int32(_pReadr.XiReadOff % int64(_2_pgsz))
 66117  	if _pReadr.XaBuffer != nil {
 66118  		goto _7
 66119  	}
 66120  	_pReadr.XaBuffer = (*uint8)(_sqlite3Malloc(tls, uint64(_2_pgsz)))
 66121  	if _pReadr.XaBuffer == nil {
 66122  		_rc = _sqlite3NomemError(tls, int32(86669))
 66123  	}
 66124  	_pReadr.XnBuffer = _2_pgsz
 66125  _7:
 66126  	if _rc != int32(0) || _2_iBuf == 0 {
 66127  		goto _10
 66128  	}
 66129  	_4_nRead = _2_pgsz - _2_iBuf
 66130  	if (_pReadr.XiReadOff + int64(_4_nRead)) > _pReadr.XiEof {
 66131  		_4_nRead = int32(_pReadr.XiEof - _pReadr.XiReadOff)
 66132  	}
 66133  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pReadr.XpFd), unsafe.Pointer(elem15(_pReadr.XaBuffer, uintptr(_2_iBuf))), _4_nRead, _pReadr.XiReadOff)
 66134  _10:
 66135  _6:
 66136  	return _rc
 66137  }
 66138  
 66139  var _vdbePmaReaderSeekØ00__func__Ø000 [18]int8
 66140  
 66141  func init() {
 66142  	crt.Xstrncpy(nil, &_vdbePmaReaderSeekØ00__func__Ø000[0], str(85540), 18)
 66143  }
 66144  
 66145  // C comment
 66146  //  /*
 66147  //  ** Attempt to memory map file pFile. If successful, set *pp to point to the
 66148  //  ** new mapping and return SQLITE_OK. If the mapping is not attempted
 66149  //  ** (because the file is too large or the VFS layer is configured not to use
 66150  //  ** mmap), return SQLITE_OK and set *pp to NULL.
 66151  //  **
 66152  //  ** Or, if an error occurs, return an SQLite error code. The final value of
 66153  //  ** *pp is undefined in this case.
 66154  //  */
 66155  func _vdbeSorterMapFile(tls *crt.TLS, _pTask *XSortSubtask, _pFile *XSorterFile, _pp **uint8) (r0 int32) {
 66156  	var _rc int32
 66157  	var _1_pFd *Xsqlite3_file
 66158  	_rc = int32(0)
 66159  	if _pFile.XiEof > int64((*Xsqlite3)((*XVdbeSorter)(_pTask.XpSorter).Xdb).XnMaxSorterMmap) {
 66160  		goto _0
 66161  	}
 66162  	_1_pFd = (*Xsqlite3_file)(_pFile.XpFd)
 66163  	if ((*Xsqlite3_io_methods)(_1_pFd.XpMethods).XiVersion) >= int32(3) {
 66164  		_rc = _sqlite3OsFetch(tls, _1_pFd, 0, int32(_pFile.XiEof), (*unsafe.Pointer)(unsafe.Pointer(_pp)))
 66165  	}
 66166  _0:
 66167  	return _rc
 66168  }
 66169  
 66170  // C comment
 66171  //  /*
 66172  //  ** Read a varint from the stream of data accessed by p. Set *pnOut to
 66173  //  ** the value read.
 66174  //  */
 66175  func _vdbePmaReadVarint(tls *crt.TLS, _p *XPmaReader, _pnOut *uint64) (r0 int32) {
 66176  	var _iBuf, _4_i, _4_rc int32
 66177  	var _4_a *uint8
 66178  	var _4_aVarint [16]uint8
 66179  	if _p.XaMap != nil {
 66180  		_p.XiReadOff += int64(_sqlite3GetVarint(tls, elem15(_p.XaMap, uintptr(_p.XiReadOff)), _pnOut))
 66181  		goto _1
 66182  	}
 66183  	_iBuf = int32(_p.XiReadOff % int64(_p.XnBuffer))
 66184  	if _iBuf != 0 && ((_p.XnBuffer - _iBuf) >= int32(9)) {
 66185  		_p.XiReadOff += int64(_sqlite3GetVarint(tls, elem15(_p.XaBuffer, uintptr(_iBuf)), _pnOut))
 66186  		goto _4
 66187  	}
 66188  	_4_i = int32(0)
 66189  _5:
 66190  	_4_rc = _vdbePmaReadBlob(tls, _p, int32(1), &_4_a)
 66191  	if _4_rc != 0 {
 66192  		return _4_rc
 66193  	}
 66194  	*elem15((*uint8)(unsafe.Pointer(&_4_aVarint)), uintptr(postInc2(&_4_i, 1)&int32(15))) = *elem15(_4_a, 0)
 66195  	if (int32(*elem15(_4_a, 0)) & int32(128)) != int32(0) {
 66196  		goto _5
 66197  	}
 66198  	_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(&_4_aVarint)), _pnOut)
 66199  _4:
 66200  _1:
 66201  	return int32(0)
 66202  
 66203  	_ = _4_aVarint
 66204  	_ = _4_i
 66205  	panic(0)
 66206  }
 66207  
 66208  // C comment
 66209  //  /*
 66210  //  ** Read the next nByte bytes of data from the PMA p.
 66211  //  ** If successful, set *ppOut to point to a buffer containing the data
 66212  //  ** and return SQLITE_OK. Otherwise, if an error occurs, return an SQLite
 66213  //  ** error code.
 66214  //  **
 66215  //  ** The buffer returned in *ppOut is only valid until the
 66216  //  ** next call to this function.
 66217  //  */
 66218  func _vdbePmaReadBlob(tls *crt.TLS, _p *XPmaReader, _nByte int32, _ppOut **uint8) (r0 int32) {
 66219  	var _iBuf, _nAvail, _2_nRead, _2_rc, _6_nRem, _7_nNew, _8_rc, _8_nCopy int32
 66220  	var _7_aNew, _8_aNext *uint8
 66221  	if _p.XaMap != nil {
 66222  		*_ppOut = elem15(_p.XaMap, uintptr(_p.XiReadOff))
 66223  		_p.XiReadOff += int64(_nByte)
 66224  		return int32(0)
 66225  	}
 66226  	func() {
 66227  		if _p.XaBuffer == nil {
 66228  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86514), unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000), unsafe.Pointer(str(85558)))
 66229  			crt.X__builtin_abort(tls)
 66230  		}
 66231  	}()
 66232  	_iBuf = int32(_p.XiReadOff % int64(_p.XnBuffer))
 66233  	if _iBuf != int32(0) {
 66234  		goto _3
 66235  	}
 66236  	if (_p.XiEof - _p.XiReadOff) > int64(_p.XnBuffer) {
 66237  		_2_nRead = _p.XnBuffer
 66238  		goto _5
 66239  	}
 66240  	_2_nRead = int32(_p.XiEof - _p.XiReadOff)
 66241  _5:
 66242  	func() {
 66243  		if _2_nRead <= int32(0) {
 66244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86530), unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000), unsafe.Pointer(str(85569)))
 66245  			crt.X__builtin_abort(tls)
 66246  		}
 66247  	}()
 66248  	_2_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_p.XpFd), unsafe.Pointer(_p.XaBuffer), _2_nRead, _p.XiReadOff)
 66249  	func() {
 66250  		if _2_rc == int32(522) {
 66251  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86534), unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000), unsafe.Pointer(str(85577)))
 66252  			crt.X__builtin_abort(tls)
 66253  		}
 66254  	}()
 66255  	if _2_rc != int32(0) {
 66256  		return _2_rc
 66257  	}
 66258  _3:
 66259  	_nAvail = _p.XnBuffer - _iBuf
 66260  	if _nByte <= _nAvail {
 66261  		*_ppOut = elem15(_p.XaBuffer, uintptr(_iBuf))
 66262  		_p.XiReadOff += int64(_nByte)
 66263  		goto _12
 66264  	}
 66265  	if _p.XnAlloc >= _nByte {
 66266  		goto _13
 66267  	}
 66268  	_7_nNew = func() int32 {
 66269  		if int32(128) > (_p.XnAlloc * int32(2)) {
 66270  			return int32(128)
 66271  		}
 66272  		return (_p.XnAlloc * int32(2))
 66273  	}()
 66274  _16:
 66275  	if _nByte > _7_nNew {
 66276  		_7_nNew = _7_nNew * int32(2)
 66277  		goto _16
 66278  	}
 66279  	_7_aNew = (*uint8)(_sqlite3Realloc(tls, unsafe.Pointer(_p.XaAlloc), uint64(_7_nNew)))
 66280  	if _7_aNew == nil {
 66281  		return _sqlite3NomemError(tls, int32(86557))
 66282  	}
 66283  	_p.XnAlloc = _7_nNew
 66284  	_p.XaAlloc = _7_aNew
 66285  _13:
 66286  	crt.Xmemcpy(tls, unsafe.Pointer(_p.XaAlloc), unsafe.Pointer(elem15(_p.XaBuffer, uintptr(_iBuf))), uint64(_nAvail))
 66287  	_p.XiReadOff += int64(_nAvail)
 66288  	_6_nRem = _nByte - _nAvail
 66289  _19:
 66290  	if _6_nRem <= int32(0) {
 66291  		goto _20
 66292  	}
 66293  	_8_nCopy = _6_nRem
 66294  	if _6_nRem > _p.XnBuffer {
 66295  		_8_nCopy = _p.XnBuffer
 66296  	}
 66297  	_8_rc = _vdbePmaReadBlob(tls, _p, _8_nCopy, &_8_aNext)
 66298  	if _8_rc != int32(0) {
 66299  		return _8_rc
 66300  	}
 66301  	func() {
 66302  		if _8_aNext == _p.XaAlloc {
 66303  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86579), unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000), unsafe.Pointer(str(85605)))
 66304  			crt.X__builtin_abort(tls)
 66305  		}
 66306  	}()
 66307  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_p.XaAlloc, uintptr(_nByte-_6_nRem))), unsafe.Pointer(_8_aNext), uint64(_8_nCopy))
 66308  	_6_nRem -= _8_nCopy
 66309  	goto _19
 66310  _20:
 66311  	*_ppOut = _p.XaAlloc
 66312  _12:
 66313  	return int32(0)
 66314  }
 66315  
 66316  var _vdbePmaReadBlobØ00__func__Ø000 [16]int8
 66317  
 66318  func init() {
 66319  	crt.Xstrncpy(nil, &_vdbePmaReadBlobØ00__func__Ø000[0], str(85622), 16)
 66320  }
 66321  
 66322  // C comment
 66323  //  /*
 66324  //  ** Advance PmaReader pReadr to the next key in its PMA. Return SQLITE_OK if
 66325  //  ** no error occurs, or an SQLite error code if one does.
 66326  //  */
 66327  func _vdbePmaReaderNext(tls *crt.TLS, _pReadr *XPmaReader) (r0 int32) {
 66328  	var _rc, _1_bEof int32
 66329  	var _nRec uint64
 66330  	var _1_pIncr *XIncrMerger
 66331  	_rc = int32(0)
 66332  	_nRec = uint64(0)
 66333  	if _pReadr.XiReadOff < _pReadr.XiEof {
 66334  		goto _0
 66335  	}
 66336  	_1_pIncr = (*XIncrMerger)(_pReadr.XpIncr)
 66337  	_1_bEof = int32(1)
 66338  	if _1_pIncr == nil {
 66339  		goto _1
 66340  	}
 66341  	_rc = _vdbeIncrSwap(tls, _1_pIncr)
 66342  	if (_rc == int32(0)) && (_1_pIncr.XbEof == int32(0)) {
 66343  		_rc = _vdbePmaReaderSeek(tls, (*XSortSubtask)(_1_pIncr.XpTask), _pReadr, elem81((*XSorterFile)(unsafe.Pointer(&_1_pIncr.XaFile)), 0), _1_pIncr.XiStartOff)
 66344  		_1_bEof = int32(0)
 66345  	}
 66346  _1:
 66347  	if _1_bEof != 0 {
 66348  		_vdbePmaReaderClear(tls, _pReadr)
 66349  		return _rc
 66350  	}
 66351  _0:
 66352  	if _rc == int32(0) {
 66353  		_rc = _vdbePmaReadVarint(tls, _pReadr, &_nRec)
 66354  	}
 66355  	if _rc == int32(0) {
 66356  		_pReadr.XnKey = int32(_nRec)
 66357  		_rc = _vdbePmaReadBlob(tls, _pReadr, int32(_nRec), &_pReadr.XaKey)
 66358  	}
 66359  	return _rc
 66360  }
 66361  
 66362  // C comment
 66363  //  /*
 66364  //  ** This function is called when the PmaReader corresponding to pIncr has
 66365  //  ** finished reading the contents of aFile[0]. Its purpose is to "refill"
 66366  //  ** aFile[0] such that the PmaReader should start rereading it from the
 66367  //  ** beginning.
 66368  //  **
 66369  //  ** For single-threaded objects, this is accomplished by literally reading
 66370  //  ** keys from pIncr->pMerger and repopulating aFile[0].
 66371  //  **
 66372  //  ** For multi-threaded objects, all that is required is to wait until the
 66373  //  ** background thread is finished (if it is not already) and then swap
 66374  //  ** aFile[0] and aFile[1] in place. If the contents of pMerger have not
 66375  //  ** been exhausted, this function also launches a new background thread
 66376  //  ** to populate the new aFile[1].
 66377  //  **
 66378  //  ** SQLITE_OK is returned on success, or an SQLite error code otherwise.
 66379  //  */
 66380  func _vdbeIncrSwap(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) {
 66381  	var _rc int32
 66382  	var _2_f0 XSorterFile
 66383  	_rc = int32(0)
 66384  	if _pIncr.XbUseThread == 0 {
 66385  		goto _0
 66386  	}
 66387  	_rc = _vdbeSorterJoinThread(tls, (*XSortSubtask)(_pIncr.XpTask))
 66388  	if _rc == int32(0) {
 66389  		_2_f0 = *elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0)
 66390  		*elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0) = *elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1))
 66391  		*elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1)) = _2_f0
 66392  	}
 66393  	if _rc != int32(0) {
 66394  		goto _2
 66395  	}
 66396  	if (elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0).XiEof) == _pIncr.XiStartOff {
 66397  		_pIncr.XbEof = int32(1)
 66398  		goto _4
 66399  	}
 66400  	_rc = _vdbeIncrBgPopulate(tls, _pIncr)
 66401  _4:
 66402  _2:
 66403  	goto _5
 66404  _0:
 66405  	_rc = _vdbeIncrPopulate(tls, _pIncr)
 66406  	*elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0) = *elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1))
 66407  	if (elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0).XiEof) == _pIncr.XiStartOff {
 66408  		_pIncr.XbEof = int32(1)
 66409  	}
 66410  _5:
 66411  	return _rc
 66412  }
 66413  
 66414  // C comment
 66415  //  /*
 66416  //  ** Launch a background thread to populate aFile[1] of pIncr.
 66417  //  */
 66418  func _vdbeIncrBgPopulate(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) {
 66419  	var _p unsafe.Pointer
 66420  	_p = unsafe.Pointer(_pIncr)
 66421  	func() {
 66422  		if _pIncr.XbUseThread == 0 {
 66423  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87940), unsafe.Pointer(&_vdbeIncrBgPopulateØ00__func__Ø000), unsafe.Pointer(str(85638)))
 66424  			crt.X__builtin_abort(tls)
 66425  		}
 66426  	}()
 66427  	return _vdbeSorterCreateThread(tls, (*XSortSubtask)(_pIncr.XpTask), _vdbeIncrPopulateThread, _p)
 66428  }
 66429  
 66430  var _vdbeIncrBgPopulateØ00__func__Ø000 [19]int8
 66431  
 66432  func init() {
 66433  	crt.Xstrncpy(nil, &_vdbeIncrBgPopulateØ00__func__Ø000[0], str(85656), 19)
 66434  }
 66435  
 66436  // C comment
 66437  //  /*
 66438  //  ** The main routine for background threads that populate aFile[1] of
 66439  //  ** multi-threaded IncrMerger objects.
 66440  //  */
 66441  func _vdbeIncrPopulateThread(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) {
 66442  	var _pRet unsafe.Pointer
 66443  	var _pIncr *XIncrMerger
 66444  	_pIncr = (*XIncrMerger)(_pCtx)
 66445  	_pRet = crt.U2P(uintptr(int64(_vdbeIncrPopulate(tls, _pIncr))))
 66446  	(*XSortSubtask)(_pIncr.XpTask).XbDone = int32(1)
 66447  	return _pRet
 66448  }
 66449  
 66450  // C comment
 66451  //  /*
 66452  //  ** Read keys from pIncr->pMerger and populate pIncr->aFile[1]. The format
 66453  //  ** of the data stored in aFile[1] is the same as that used by regular PMAs,
 66454  //  ** except that the number-of-bytes varint is omitted from the start.
 66455  //  */
 66456  func _vdbeIncrPopulate(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) {
 66457  	var _rc, _rc2, _1_dummy, _1_nKey int32
 66458  	var _iStart, _1_iEof int64
 66459  	var _1_pReader *XPmaReader
 66460  	var _pTask *XSortSubtask
 66461  	var _pOut *XSorterFile
 66462  	var _pMerger *XMergeEngine
 66463  	var _writer XPmaWriter
 66464  	_rc = int32(0)
 66465  	_iStart = _pIncr.XiStartOff
 66466  	_pOut = elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1))
 66467  	_pTask = (*XSortSubtask)(_pIncr.XpTask)
 66468  	_pMerger = (*XMergeEngine)(_pIncr.XpMerger)
 66469  	func() {
 66470  		if _pIncr.XbEof != int32(0) {
 66471  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87894), unsafe.Pointer(&_vdbeIncrPopulateØ00__func__Ø000), unsafe.Pointer(str(85675)))
 66472  			crt.X__builtin_abort(tls)
 66473  		}
 66474  	}()
 66475  	_vdbePmaWriterInit(tls, (*Xsqlite3_file)(_pOut.XpFd), &_writer, (*XVdbeSorter)(_pTask.XpSorter).Xpgsz, _iStart)
 66476  _2:
 66477  	if _rc != int32(0) {
 66478  		goto _3
 66479  	}
 66480  	_1_pReader = elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(*elem8(_pMerger.XaTree, uintptr(1))))
 66481  	_1_nKey = _1_pReader.XnKey
 66482  	_1_iEof = _writer.XiWriteOff + int64(_writer.XiBufEnd)
 66483  	if (*Xsqlite3_file)(_1_pReader.XpFd) == nil {
 66484  		goto _3
 66485  	}
 66486  	if ((_1_iEof + int64(_1_nKey)) + int64(_sqlite3VarintLen(tls, uint64(_1_nKey)))) > (_iStart + int64(_pIncr.XmxSz)) {
 66487  		goto _3
 66488  	}
 66489  	_vdbePmaWriteVarint(tls, &_writer, uint64(_1_nKey))
 66490  	_vdbePmaWriteBlob(tls, &_writer, _1_pReader.XaKey, _1_nKey)
 66491  	func() {
 66492  		if (*XSortSubtask)((*XMergeEngine)(_pIncr.XpMerger).XpTask) != _pTask {
 66493  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87913), unsafe.Pointer(&_vdbeIncrPopulateØ00__func__Ø000), unsafe.Pointer(str(85690)))
 66494  			crt.X__builtin_abort(tls)
 66495  		}
 66496  	}()
 66497  	_rc = _vdbeMergeEngineStep(tls, (*XMergeEngine)(_pIncr.XpMerger), &_1_dummy)
 66498  	goto _2
 66499  _3:
 66500  	_rc2 = _vdbePmaWriterFinish(tls, &_writer, &_pOut.XiEof)
 66501  	if _rc == int32(0) {
 66502  		_rc = _rc2
 66503  	}
 66504  	return _rc
 66505  }
 66506  
 66507  var _vdbeIncrPopulateØ00__func__Ø000 [17]int8
 66508  
 66509  func init() {
 66510  	crt.Xstrncpy(nil, &_vdbeIncrPopulateØ00__func__Ø000[0], str(85719), 17)
 66511  }
 66512  
 66513  // C comment
 66514  //  /*
 66515  //  ** Advance the MergeEngine to its next entry.
 66516  //  ** Set *pbEof to true there is no next entry because
 66517  //  ** the MergeEngine has reached the end of all its inputs.
 66518  //  **
 66519  //  ** Return SQLITE_OK if successful or an error code if an error occurs.
 66520  //  */
 66521  func _vdbeMergeEngineStep(tls *crt.TLS, _pMerger *XMergeEngine, _pbEof *int32) (r0 int32) {
 66522  	var _rc, _iPrev, _1_i, _1_bCached, _2_iRes int32
 66523  	var _1_pReadr1, _1_pReadr2 *XPmaReader
 66524  	var _pTask *XSortSubtask
 66525  	_iPrev = *elem8(_pMerger.XaTree, uintptr(1))
 66526  	_pTask = (*XSortSubtask)(_pMerger.XpTask)
 66527  	_rc = _vdbePmaReaderNext(tls, elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(_iPrev)))
 66528  	if _rc != int32(0) {
 66529  		goto _0
 66530  	}
 66531  	_1_bCached = int32(0)
 66532  	_1_pReadr1 = elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(_iPrev&int32(65534)))
 66533  	_1_pReadr2 = elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(_iPrev|int32(1)))
 66534  	_1_i = (_pMerger.XnTree + _iPrev) / int32(2)
 66535  _1:
 66536  	if _1_i <= int32(0) {
 66537  		goto _4
 66538  	}
 66539  	if (*Xsqlite3_file)(_1_pReadr1.XpFd) == nil {
 66540  		_2_iRes = int32(1)
 66541  		goto _8
 66542  	}
 66543  	if (*Xsqlite3_file)(_1_pReadr2.XpFd) == nil {
 66544  		_2_iRes = int32(-1)
 66545  		goto _8
 66546  	}
 66547  	_2_iRes = func() func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 {
 66548  		v := _pTask.XxCompare
 66549  		return *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&v))
 66550  	}()(tls, _pTask, &_1_bCached, unsafe.Pointer(_1_pReadr1.XaKey), _1_pReadr1.XnKey, unsafe.Pointer(_1_pReadr2.XaKey), _1_pReadr2.XnKey)
 66551  _8:
 66552  	if (_2_iRes < int32(0)) || ((_2_iRes == int32(0)) && (crt.P2U(unsafe.Pointer(_1_pReadr1)) < crt.P2U(unsafe.Pointer(_1_pReadr2)))) {
 66553  		*elem8(_pMerger.XaTree, uintptr(_1_i)) = int32(int64((uintptr(unsafe.Pointer(_1_pReadr1)) - uintptr(_pMerger.XaReadr)) / 80))
 66554  		_1_pReadr2 = elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(*elem8(_pMerger.XaTree, uintptr(_1_i^int32(1)))))
 66555  		_1_bCached = int32(0)
 66556  		goto _12
 66557  	}
 66558  	if _1_pReadr1.XpFd != nil {
 66559  		_1_bCached = int32(0)
 66560  	}
 66561  	*elem8(_pMerger.XaTree, uintptr(_1_i)) = int32(int64((uintptr(unsafe.Pointer(_1_pReadr2)) - uintptr(_pMerger.XaReadr)) / 80))
 66562  	_1_pReadr1 = elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(*elem8(_pMerger.XaTree, uintptr(_1_i^int32(1)))))
 66563  _12:
 66564  	_1_i = _1_i / int32(2)
 66565  	goto _1
 66566  _4:
 66567  	*_pbEof = bool2int((*Xsqlite3_file)(elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(*elem8(_pMerger.XaTree, uintptr(1)))).XpFd) == nil)
 66568  _0:
 66569  	return func() int32 {
 66570  		if _rc == int32(0) {
 66571  			return int32((*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode)
 66572  		}
 66573  		return _rc
 66574  	}()
 66575  }
 66576  
 66577  // C comment
 66578  //  /*
 66579  //  ** pRoot is the root of an incremental merge-tree with depth nDepth (according
 66580  //  ** to vdbeSorterTreeDepth()). pLeaf is the iSeq'th leaf to be added to the
 66581  //  ** tree, counting from zero. This function adds pLeaf to the tree.
 66582  //  **
 66583  //  ** If successful, SQLITE_OK is returned. If an error occurs, an SQLite error
 66584  //  ** code is returned and pLeaf is freed.
 66585  //  */
 66586  func _vdbeSorterAddToTree(tls *crt.TLS, _pTask *XSortSubtask, _nDepth int32, _iSeq int32, _pRoot *XMergeEngine, _pLeaf *XMergeEngine) (r0 int32) {
 66587  	var _rc, _nDiv, _i, _2_iIter int32
 66588  	var _2_pReadr *XPmaReader
 66589  	var _pIncr *XIncrMerger
 66590  	var _p, _3_pNew *XMergeEngine
 66591  	_rc = int32(0)
 66592  	_nDiv = int32(1)
 66593  	_p = _pRoot
 66594  	_rc = _vdbeIncrMergerNew(tls, _pTask, _pLeaf, &_pIncr)
 66595  	_i = int32(1)
 66596  _0:
 66597  	if _i >= _nDepth {
 66598  		goto _3
 66599  	}
 66600  	_nDiv = _nDiv * int32(16)
 66601  	_i += 1
 66602  	goto _0
 66603  _3:
 66604  	_i = int32(1)
 66605  _4:
 66606  	if _i >= _nDepth || _rc != int32(0) {
 66607  		goto _8
 66608  	}
 66609  	_2_iIter = (_iSeq / _nDiv) % int32(16)
 66610  	_2_pReadr = elem82((*XPmaReader)(_p.XaReadr), uintptr(_2_iIter))
 66611  	if (*XIncrMerger)(_2_pReadr.XpIncr) != nil {
 66612  		goto _9
 66613  	}
 66614  	_3_pNew = _vdbeMergeEngineNew(tls, int32(16))
 66615  	if _3_pNew == nil {
 66616  		_rc = _sqlite3NomemError(tls, int32(88392))
 66617  		goto _11
 66618  	}
 66619  	_rc = _vdbeIncrMergerNew(tls, _pTask, _3_pNew, (**XIncrMerger)(unsafe.Pointer(&_2_pReadr.XpIncr)))
 66620  _11:
 66621  _9:
 66622  	if _rc == int32(0) {
 66623  		_p = (*XMergeEngine)((*XIncrMerger)(_2_pReadr.XpIncr).XpMerger)
 66624  		_nDiv = _nDiv / int32(16)
 66625  	}
 66626  	_i += 1
 66627  	goto _4
 66628  _8:
 66629  	if _rc == int32(0) {
 66630  		*(**XIncrMerger)(unsafe.Pointer(&(elem82((*XPmaReader)(_p.XaReadr), uintptr(_iSeq%int32(16))).XpIncr))) = _pIncr
 66631  		goto _14
 66632  	}
 66633  	_vdbeIncrFree(tls, _pIncr)
 66634  _14:
 66635  	return _rc
 66636  }
 66637  
 66638  // C comment
 66639  //  /*
 66640  //  ** Allocate and return a new IncrMerger object to read data from pMerger.
 66641  //  **
 66642  //  ** If an OOM condition is encountered, return NULL. In this case free the
 66643  //  ** pMerger argument before returning.
 66644  //  */
 66645  func _vdbeIncrMergerNew(tls *crt.TLS, _pTask *XSortSubtask, _pMerger *XMergeEngine, _ppOut **XIncrMerger) (r0 int32) {
 66646  	var _rc int32
 66647  	var _pIncr *XIncrMerger
 66648  	_rc = int32(0)
 66649  	_pIncr = store92(_ppOut, (*XIncrMerger)(func() unsafe.Pointer {
 66650  		if _sqlite3FaultSim(tls, int32(100)) != 0 {
 66651  			return nil
 66652  		}
 66653  		return _sqlite3MallocZero(tls, uint64(72))
 66654  	}()))
 66655  	if _pIncr != nil {
 66656  		*(**XMergeEngine)(unsafe.Pointer(&_pIncr.XpMerger)) = _pMerger
 66657  		*(**XSortSubtask)(unsafe.Pointer(&_pIncr.XpTask)) = _pTask
 66658  		_pIncr.XmxSz = func() int32 {
 66659  			if (((*XVdbeSorter)(_pTask.XpSorter).XmxKeysize) + int32(9)) > (((*XVdbeSorter)(_pTask.XpSorter).XmxPmaSize) / int32(2)) {
 66660  				return (((*XVdbeSorter)(_pTask.XpSorter).XmxKeysize) + int32(9))
 66661  			}
 66662  			return (((*XVdbeSorter)(_pTask.XpSorter).XmxPmaSize) / int32(2))
 66663  		}()
 66664  		_pTask.Xfile2.XiEof += int64(_pIncr.XmxSz)
 66665  		goto _5
 66666  	}
 66667  	_vdbeMergeEngineFree(tls, _pMerger)
 66668  	_rc = _sqlite3NomemError(tls, int32(88016))
 66669  _5:
 66670  	return _rc
 66671  }
 66672  
 66673  var _vdbeSorterSetupMergeØ00__func__Ø000 [21]int8
 66674  
 66675  func init() {
 66676  	crt.Xstrncpy(nil, &_vdbeSorterSetupMergeØ00__func__Ø000[0], str(85736), 21)
 66677  }
 66678  
 66679  // C comment
 66680  //  /*
 66681  //  ** Set the "use-threads" flag on object pIncr.
 66682  //  */
 66683  func _vdbeIncrMergerSetThreads(tls *crt.TLS, _pIncr *XIncrMerger) {
 66684  	_pIncr.XbUseThread = int32(1)
 66685  	((*XSortSubtask)(_pIncr.XpTask).Xfile2).XiEof -= int64(_pIncr.XmxSz)
 66686  }
 66687  
 66688  // C comment
 66689  //  /*
 66690  //  ** If the PmaReader passed as the first argument is not an incremental-reader
 66691  //  ** (if pReadr->pIncr==0), then this function is a no-op. Otherwise, it invokes
 66692  //  ** the vdbePmaReaderIncrMergeInit() function with the parameters passed to
 66693  //  ** this routine to initialize the incremental merge.
 66694  //  **
 66695  //  ** If the IncrMerger object is multi-threaded (IncrMerger.bUseThread==1),
 66696  //  ** then a background thread is launched to call vdbePmaReaderIncrMergeInit().
 66697  //  ** Or, if the IncrMerger is single threaded, the same function is called
 66698  //  ** using the current thread.
 66699  //  */
 66700  func _vdbePmaReaderIncrInit(tls *crt.TLS, _pReadr *XPmaReader, _eMode int32) (r0 int32) {
 66701  	var _rc int32
 66702  	var _2_pCtx unsafe.Pointer
 66703  	var _pIncr *XIncrMerger
 66704  	_pIncr = (*XIncrMerger)(_pReadr.XpIncr)
 66705  	_rc = int32(0)
 66706  	if _pIncr == nil {
 66707  		goto _0
 66708  	}
 66709  	func() {
 66710  		if _pIncr.XbUseThread != int32(0) && _eMode != int32(1) {
 66711  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88284), unsafe.Pointer(&_vdbePmaReaderIncrInitØ00__func__Ø000), unsafe.Pointer(str(85757)))
 66712  			crt.X__builtin_abort(tls)
 66713  		}
 66714  	}()
 66715  	if _pIncr.XbUseThread != 0 {
 66716  		_2_pCtx = unsafe.Pointer(_pReadr)
 66717  		_rc = _vdbeSorterCreateThread(tls, (*XSortSubtask)(_pIncr.XpTask), _vdbePmaReaderBgIncrInit, _2_pCtx)
 66718  		goto _5
 66719  	}
 66720  	_rc = _vdbePmaReaderIncrMergeInit(tls, _pReadr, _eMode)
 66721  _5:
 66722  _0:
 66723  	return _rc
 66724  }
 66725  
 66726  var _vdbePmaReaderIncrInitØ00__func__Ø000 [22]int8
 66727  
 66728  func init() {
 66729  	crt.Xstrncpy(nil, &_vdbePmaReaderIncrInitØ00__func__Ø000[0], str(85802), 22)
 66730  }
 66731  
 66732  // C comment
 66733  //  /*
 66734  //  ** The main routine for vdbePmaReaderIncrMergeInit() operations run in
 66735  //  ** background threads.
 66736  //  */
 66737  func _vdbePmaReaderBgIncrInit(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) {
 66738  	var _pRet unsafe.Pointer
 66739  	var _pReader *XPmaReader
 66740  	_pReader = (*XPmaReader)(_pCtx)
 66741  	_pRet = crt.U2P(uintptr(int64(_vdbePmaReaderIncrMergeInit(tls, _pReader, int32(1)))))
 66742  	(*XSortSubtask)((*XIncrMerger)(_pReader.XpIncr).XpTask).XbDone = int32(1)
 66743  	return _pRet
 66744  }
 66745  
 66746  // C comment
 66747  //  /*
 66748  //  ** The PmaReader passed as the first argument is guaranteed to be an
 66749  //  ** incremental-reader (pReadr->pIncr!=0). This function serves to open
 66750  //  ** and/or initialize the temp file related fields of the IncrMerge
 66751  //  ** object at (pReadr->pIncr).
 66752  //  **
 66753  //  ** If argument eMode is set to INCRINIT_NORMAL, then all PmaReaders
 66754  //  ** in the sub-tree headed by pReadr are also initialized. Data is then
 66755  //  ** loaded into the buffers belonging to pReadr and it is set to point to
 66756  //  ** the first key in its range.
 66757  //  **
 66758  //  ** If argument eMode is set to INCRINIT_TASK, then pReadr is guaranteed
 66759  //  ** to be a multi-threaded PmaReader and this function is being called in a
 66760  //  ** background thread. In this case all PmaReaders in the sub-tree are
 66761  //  ** initialized as for INCRINIT_NORMAL and the aFile[1] buffer belonging to
 66762  //  ** pReadr is populated. However, pReadr itself is not set up to point
 66763  //  ** to its first key. A call to vdbePmaReaderNext() is still required to do
 66764  //  ** that.
 66765  //  **
 66766  //  ** The reason this function does not call vdbePmaReaderNext() immediately
 66767  //  ** in the INCRINIT_TASK case is that vdbePmaReaderNext() assumes that it has
 66768  //  ** to block on thread (pTask->thread) before accessing aFile[1]. But, since
 66769  //  ** this entire function is being run by thread (pTask->thread), that will
 66770  //  ** lead to the current background thread attempting to join itself.
 66771  //  **
 66772  //  ** Finally, if argument eMode is set to INCRINIT_ROOT, it may be assumed
 66773  //  ** that pReadr->pIncr is a multi-threaded IncrMerge objects, and that all
 66774  //  ** child-trees have already been initialized using IncrInit(INCRINIT_TASK).
 66775  //  ** In this case vdbePmaReaderNext() is called on all child PmaReaders and
 66776  //  ** the current PmaReader set to point to the first key in its range.
 66777  //  **
 66778  //  ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 66779  //  */
 66780  func _vdbePmaReaderIncrMergeInit(tls *crt.TLS, _pReadr *XPmaReader, _eMode int32) (r0 int32) {
 66781  	var _rc, _1_mxSz int32
 66782  	var _db *Xsqlite3
 66783  	var _pIncr *XIncrMerger
 66784  	var _pTask *XSortSubtask
 66785  	_rc = int32(0)
 66786  	_pIncr = (*XIncrMerger)(_pReadr.XpIncr)
 66787  	_pTask = (*XSortSubtask)(_pIncr.XpTask)
 66788  	_db = (*Xsqlite3)((*XVdbeSorter)(_pTask.XpSorter).Xdb)
 66789  
 66790  	_rc = _vdbeMergeEngineInit(tls, _pTask, (*XMergeEngine)(_pIncr.XpMerger), _eMode)
 66791  	if _rc != int32(0) {
 66792  		goto _0
 66793  	}
 66794  	_1_mxSz = _pIncr.XmxSz
 66795  	if _pIncr.XbUseThread == 0 {
 66796  		goto _1
 66797  	}
 66798  	_rc = _vdbeSorterOpenTempFile(tls, _db, int64(_1_mxSz), (**Xsqlite3_file)(unsafe.Pointer(&(elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0).XpFd))))
 66799  	if _rc == int32(0) {
 66800  		_rc = _vdbeSorterOpenTempFile(tls, _db, int64(_1_mxSz), (**Xsqlite3_file)(unsafe.Pointer(&(elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1)).XpFd))))
 66801  	}
 66802  	goto _3
 66803  _1:
 66804  	if (*Xsqlite3_file)(_pTask.Xfile2.XpFd) == nil {
 66805  		func() {
 66806  			if (_pTask.Xfile2.XiEof) <= (0) {
 66807  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88217), unsafe.Pointer(&_vdbePmaReaderIncrMergeInitØ00__func__Ø000), unsafe.Pointer(str(85824)))
 66808  				crt.X__builtin_abort(tls)
 66809  			}
 66810  		}()
 66811  		_rc = _vdbeSorterOpenTempFile(tls, _db, _pTask.Xfile2.XiEof, (**Xsqlite3_file)(unsafe.Pointer(&(_pTask.Xfile2.XpFd))))
 66812  		_pTask.Xfile2.XiEof = 0
 66813  	}
 66814  	if _rc == int32(0) {
 66815  		*(**Xsqlite3_file)(unsafe.Pointer(&(elem81((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1)).XpFd))) = (*Xsqlite3_file)(_pTask.Xfile2.XpFd)
 66816  		_pIncr.XiStartOff = _pTask.Xfile2.XiEof
 66817  		_pTask.Xfile2.XiEof += int64(_1_mxSz)
 66818  	}
 66819  _3:
 66820  _0:
 66821  	if (_rc == int32(0)) && _pIncr.XbUseThread != 0 {
 66822  		func() {
 66823  			if _eMode != int32(2) && _eMode != int32(1) {
 66824  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88241), unsafe.Pointer(&_vdbePmaReaderIncrMergeInitØ00__func__Ø000), unsafe.Pointer(str(85844)))
 66825  				crt.X__builtin_abort(tls)
 66826  			}
 66827  		}()
 66828  		_rc = _vdbeIncrPopulate(tls, _pIncr)
 66829  	}
 66830  	if (_rc == int32(0)) && (int32(0) != 0 || (_eMode != int32(1))) {
 66831  		_rc = _vdbePmaReaderNext(tls, _pReadr)
 66832  	}
 66833  	return _rc
 66834  }
 66835  
 66836  // C comment
 66837  //  /*
 66838  //  ** Initialize the MergeEngine object passed as the second argument. Once this
 66839  //  ** function returns, the first key of merged data may be read from the
 66840  //  ** MergeEngine object in the usual fashion.
 66841  //  **
 66842  //  ** If argument eMode is INCRINIT_ROOT, then it is assumed that any IncrMerge
 66843  //  ** objects attached to the PmaReader objects that the merger reads from have
 66844  //  ** already been populated, but that they have not yet populated aFile[0] and
 66845  //  ** set the PmaReader objects up to read from it. In this case all that is
 66846  //  ** required is to call vdbePmaReaderNext() on each PmaReader to point it at
 66847  //  ** its first key.
 66848  //  **
 66849  //  ** Otherwise, if eMode is any value other than INCRINIT_ROOT, then use
 66850  //  ** vdbePmaReaderIncrMergeInit() to initialize each PmaReader that feeds data
 66851  //  ** to pMerger.
 66852  //  **
 66853  //  ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 66854  //  */
 66855  func _vdbeMergeEngineInit(tls *crt.TLS, _pTask *XSortSubtask, _pMerger *XMergeEngine, _eMode int32) (r0 int32) {
 66856  	var _rc, _i, _nTree int32
 66857  	_rc = int32(0)
 66858  	_nTree = _pMerger.XnTree
 66859  
 66860  	func() {
 66861  		if (*XSortSubtask)(_pMerger.XpTask) != nil {
 66862  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88133), unsafe.Pointer(&_vdbeMergeEngineInitØ00__func__Ø000), unsafe.Pointer(str(85889)))
 66863  			crt.X__builtin_abort(tls)
 66864  		}
 66865  	}()
 66866  	*(**XSortSubtask)(unsafe.Pointer(&_pMerger.XpTask)) = _pTask
 66867  	_i = int32(0)
 66868  _2:
 66869  	if _i >= _nTree {
 66870  		goto _5
 66871  	}
 66872  	if int32(1) != 0 && (_eMode == int32(2)) {
 66873  		_rc = _vdbePmaReaderNext(tls, elem82((*XPmaReader)(_pMerger.XaReadr), uintptr((_nTree-_i)-int32(1))))
 66874  		goto _8
 66875  	}
 66876  	_rc = _vdbePmaReaderIncrInit(tls, elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(_i)), int32(0))
 66877  _8:
 66878  	if _rc != int32(0) {
 66879  		return _rc
 66880  	}
 66881  	_i += 1
 66882  	goto _2
 66883  _5:
 66884  	_i = _pMerger.XnTree - int32(1)
 66885  _10:
 66886  	if _i <= int32(0) {
 66887  		goto _13
 66888  	}
 66889  	_vdbeMergeEngineCompare(tls, _pMerger, _i)
 66890  	_i -= 1
 66891  	goto _10
 66892  _13:
 66893  	return int32((*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode)
 66894  }
 66895  
 66896  var _vdbeMergeEngineInitØ00__func__Ø000 [20]int8
 66897  
 66898  func init() {
 66899  	crt.Xstrncpy(nil, &_vdbeMergeEngineInitØ00__func__Ø000[0], str(85907), 20)
 66900  }
 66901  
 66902  // C comment
 66903  //  /*
 66904  //  ** Recompute pMerger->aTree[iOut] by comparing the next keys on the
 66905  //  ** two PmaReaders that feed that entry.  Neither of the PmaReaders
 66906  //  ** are advanced.  This routine merely does the comparison.
 66907  //  */
 66908  func _vdbeMergeEngineCompare(tls *crt.TLS, _pMerger *XMergeEngine, _iOut int32) {
 66909  	var _i1, _i2, _iRes, _5_bCached, _5_res int32
 66910  	var _p1, _p2 *XPmaReader
 66911  	var _5_pTask *XSortSubtask
 66912  	func() {
 66913  		if _iOut >= _pMerger.XnTree || _iOut <= int32(0) {
 66914  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88048), unsafe.Pointer(&_vdbeMergeEngineCompareØ00__func__Ø000), unsafe.Pointer(str(85927)))
 66915  			crt.X__builtin_abort(tls)
 66916  		}
 66917  	}()
 66918  	if _iOut >= (_pMerger.XnTree / int32(2)) {
 66919  		_i1 = (_iOut - (_pMerger.XnTree / int32(2))) * int32(2)
 66920  		_i2 = _i1 + int32(1)
 66921  		goto _4
 66922  	}
 66923  	_i1 = *elem8(_pMerger.XaTree, uintptr(_iOut*int32(2)))
 66924  	_i2 = *elem8(_pMerger.XaTree, uintptr((_iOut*int32(2))+int32(1)))
 66925  _4:
 66926  	_p1 = elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(_i1))
 66927  	_p2 = elem82((*XPmaReader)(_pMerger.XaReadr), uintptr(_i2))
 66928  	if (*Xsqlite3_file)(_p1.XpFd) == nil {
 66929  		_iRes = _i2
 66930  		goto _8
 66931  	}
 66932  	if (*Xsqlite3_file)(_p2.XpFd) == nil {
 66933  		_iRes = _i1
 66934  		goto _8
 66935  	}
 66936  	_5_pTask = (*XSortSubtask)(_pMerger.XpTask)
 66937  	_5_bCached = int32(0)
 66938  	func() {
 66939  		if (*XUnpackedRecord)(_5_pTask.XpUnpacked) == nil {
 66940  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88069), unsafe.Pointer(&_vdbeMergeEngineCompareØ00__func__Ø000), unsafe.Pointer(str(85957)))
 66941  			crt.X__builtin_abort(tls)
 66942  		}
 66943  	}()
 66944  	_5_res = func() func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 {
 66945  		v := _5_pTask.XxCompare
 66946  		return *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&v))
 66947  	}()(tls, _5_pTask, &_5_bCached, unsafe.Pointer(_p1.XaKey), _p1.XnKey, unsafe.Pointer(_p2.XaKey), _p2.XnKey)
 66948  	if _5_res <= int32(0) {
 66949  		_iRes = _i1
 66950  		goto _12
 66951  	}
 66952  	_iRes = _i2
 66953  _12:
 66954  _8:
 66955  	*elem8(_pMerger.XaTree, uintptr(_iOut)) = _iRes
 66956  }
 66957  
 66958  var _vdbeMergeEngineCompareØ00__func__Ø000 [23]int8
 66959  
 66960  func init() {
 66961  	crt.Xstrncpy(nil, &_vdbeMergeEngineCompareØ00__func__Ø000[0], str(85977), 23)
 66962  }
 66963  
 66964  var _vdbePmaReaderIncrMergeInitØ00__func__Ø000 [27]int8
 66965  
 66966  func init() {
 66967  	crt.Xstrncpy(nil, &_vdbePmaReaderIncrMergeInitØ00__func__Ø000[0], str(86000), 27)
 66968  }
 66969  
 66970  // C comment
 66971  //  /*
 66972  //  ** Advance to the next element in the sorter.
 66973  //  */
 66974  func _sqlite3VdbeSorterNext(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor, _pbEof *int32) (r0 int32) {
 66975  	var _rc int32
 66976  	var _pSorter *XVdbeSorter
 66977  	var _4_pFree *XSorterRecord
 66978  	func() {
 66979  		if int32(_pCsr.XeCurType) != int32(1) {
 66980  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88635), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(57837)))
 66981  			crt.X__builtin_abort(tls)
 66982  		}
 66983  	}()
 66984  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 66985  	func() {
 66986  		if _pSorter.XbUsePMA == 0 && ((*XPmaReader)(_pSorter.XpReader) != nil || (*XMergeEngine)(_pSorter.XpMerger) != nil) {
 66987  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88637), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86027)))
 66988  			crt.X__builtin_abort(tls)
 66989  		}
 66990  	}()
 66991  	if _pSorter.XbUsePMA == 0 {
 66992  		goto _6
 66993  	}
 66994  	func() {
 66995  		if (*XPmaReader)(_pSorter.XpReader) != nil && (*XMergeEngine)(_pSorter.XpMerger) != nil {
 66996  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88639), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86092)))
 66997  			crt.X__builtin_abort(tls)
 66998  		}
 66999  	}()
 67000  	func() {
 67001  		if int32(_pSorter.XbUseThreads) != int32(0) && _pSorter.XpReader == nil {
 67002  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88640), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86135)))
 67003  			crt.X__builtin_abort(tls)
 67004  		}
 67005  	}()
 67006  	func() {
 67007  		if int32(_pSorter.XbUseThreads) != int32(1) && _pSorter.XpMerger == nil {
 67008  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88641), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86179)))
 67009  			crt.X__builtin_abort(tls)
 67010  		}
 67011  	}()
 67012  	if _pSorter.XbUseThreads != 0 {
 67013  		_rc = _vdbePmaReaderNext(tls, (*XPmaReader)(_pSorter.XpReader))
 67014  		*_pbEof = bool2int((*Xsqlite3_file)((*XPmaReader)(_pSorter.XpReader).XpFd) == nil)
 67015  		goto _17
 67016  	}
 67017  	func() {
 67018  		if (*XMergeEngine)(_pSorter.XpMerger) == nil {
 67019  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88649), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86223)))
 67020  			crt.X__builtin_abort(tls)
 67021  		}
 67022  	}()
 67023  	func() {
 67024  		if (*XSortSubtask)((*XMergeEngine)(_pSorter.XpMerger).XpTask) != elem80((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), 0) {
 67025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88650), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86243)))
 67026  			crt.X__builtin_abort(tls)
 67027  		}
 67028  	}()
 67029  	_rc = _vdbeMergeEngineStep(tls, (*XMergeEngine)(_pSorter.XpMerger), _pbEof)
 67030  _17:
 67031  	goto _22
 67032  _6:
 67033  	_4_pFree = (*XSorterRecord)(_pSorter.Xlist.XpList)
 67034  	*(**XSorterRecord)(unsafe.Pointer(&(_pSorter.Xlist.XpList))) = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_pFree.Xu)))
 67035  	*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_pFree.Xu)))) = nil
 67036  	if (_pSorter.Xlist.XaMemory) == nil {
 67037  		_vdbeSorterRecordFree(tls, _db, _4_pFree)
 67038  	}
 67039  	*_pbEof = bool2int((_pSorter.Xlist.XpList) == nil)
 67040  	_rc = int32(0)
 67041  _22:
 67042  	return _rc
 67043  }
 67044  
 67045  var _sqlite3VdbeSorterNextØ00__func__Ø000 [22]int8
 67046  
 67047  func init() {
 67048  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterNextØ00__func__Ø000[0], str(86289), 22)
 67049  }
 67050  
 67051  // C comment
 67052  //  /*
 67053  //  ** Add a record to the sorter.
 67054  //  */
 67055  func _sqlite3VdbeSorterWrite(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem) (r0 int32) {
 67056  	var _rc, _bFlush, _nReq, _nPMA, _t, _9_nMin, _10_iListOff, _10_nNew int32
 67057  	var _10_aNew *uint8
 67058  	var _pSorter *XVdbeSorter
 67059  	var _pNew *XSorterRecord
 67060  	_rc = int32(0)
 67061  	func() {
 67062  		if int32(_pCsr.XeCurType) != int32(1) {
 67063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87790), unsafe.Pointer(&_sqlite3VdbeSorterWriteØ00__func__Ø000), unsafe.Pointer(str(57837)))
 67064  			crt.X__builtin_abort(tls)
 67065  		}
 67066  	}()
 67067  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 67068  	func() int32 {
 67069  		if int32(*(*uint8)(unsafe.Pointer(elem1(_pVal.Xz, uintptr(1))))) < int32(128) {
 67070  			return func() int32 {
 67071  				_t = int32(uint32(*(*uint8)(unsafe.Pointer(elem1(_pVal.Xz, uintptr(1))))))
 67072  				return int32(1)
 67073  			}()
 67074  		}
 67075  		return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(elem1(_pVal.Xz, uintptr(1)))), (*uint32)(unsafe.Pointer(&_t))))
 67076  	}()
 67077  	if ((_t > int32(0)) && (_t < int32(10))) && (_t != int32(7)) {
 67078  		{
 67079  			p := &_pSorter.XtypeMask
 67080  			*p = uint8(int32(*p) & int32(1))
 67081  		}
 67082  		goto _10
 67083  	}
 67084  	if (_t > int32(10)) && (_t&int32(1)) != 0 {
 67085  		{
 67086  			p := &_pSorter.XtypeMask
 67087  			*p = uint8(int32(*p) & int32(2))
 67088  		}
 67089  		goto _10
 67090  	}
 67091  	_pSorter.XtypeMask = 0
 67092  _10:
 67093  	func() {
 67094  		if _pSorter == nil {
 67095  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87801), unsafe.Pointer(&_sqlite3VdbeSorterWriteØ00__func__Ø000), unsafe.Pointer(str(84205)))
 67096  			crt.X__builtin_abort(tls)
 67097  		}
 67098  	}()
 67099  	_nReq = int32(uint64(_pVal.Xn) + uint64(16))
 67100  	_nPMA = _pVal.Xn + _sqlite3VarintLen(tls, uint64(_pVal.Xn))
 67101  	if _pSorter.XmxPmaSize == 0 {
 67102  		goto _13
 67103  	}
 67104  	if (_pSorter.Xlist.XaMemory) != nil {
 67105  		_bFlush = bool2int(_pSorter.XiMemory != 0 && ((_pSorter.XiMemory + _nReq) > _pSorter.XmxPmaSize))
 67106  		goto _16
 67107  	}
 67108  	_bFlush = bool2int(((_pSorter.Xlist.XszPMA) > _pSorter.XmxPmaSize) || (((_pSorter.Xlist.XszPMA) > _pSorter.XmnPmaSize) && _sqlite3HeapNearlyFull(tls) != 0))
 67109  _16:
 67110  	if _bFlush != 0 {
 67111  		_rc = _vdbeSorterFlushPMA(tls, _pSorter)
 67112  		_pSorter.Xlist.XszPMA = int32(0)
 67113  		_pSorter.XiMemory = int32(0)
 67114  		func() {
 67115  			if _rc == int32(0) && (*XSorterRecord)(_pSorter.Xlist.XpList) != nil {
 67116  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87834), unsafe.Pointer(&_sqlite3VdbeSorterWriteØ00__func__Ø000), unsafe.Pointer(str(86311)))
 67117  				crt.X__builtin_abort(tls)
 67118  			}
 67119  		}()
 67120  	}
 67121  _13:
 67122  	_pSorter.Xlist.XszPMA += _nPMA
 67123  	if _nPMA > _pSorter.XmxKeysize {
 67124  		_pSorter.XmxKeysize = _nPMA
 67125  	}
 67126  	if (_pSorter.Xlist.XaMemory) == nil {
 67127  		goto _24
 67128  	}
 67129  	_9_nMin = _pSorter.XiMemory + _nReq
 67130  	if _9_nMin <= _pSorter.XnMemory {
 67131  		goto _25
 67132  	}
 67133  	_10_iListOff = int32(int64(uintptr(_pSorter.Xlist.XpList) - uintptr(unsafe.Pointer(_pSorter.Xlist.XaMemory))))
 67134  	_10_nNew = _pSorter.XnMemory * int32(2)
 67135  _26:
 67136  	if _10_nNew < _9_nMin {
 67137  		_10_nNew = _10_nNew * int32(2)
 67138  		goto _26
 67139  	}
 67140  	if _10_nNew > _pSorter.XmxPmaSize {
 67141  		_10_nNew = _pSorter.XmxPmaSize
 67142  	}
 67143  	if _10_nNew < _9_nMin {
 67144  		_10_nNew = _9_nMin
 67145  	}
 67146  	_10_aNew = (*uint8)(_sqlite3Realloc(tls, unsafe.Pointer(_pSorter.Xlist.XaMemory), uint64(_10_nNew)))
 67147  	if _10_aNew == nil {
 67148  		return _sqlite3NomemError(tls, int32(87855))
 67149  	}
 67150  	*(**XSorterRecord)(unsafe.Pointer(&(_pSorter.Xlist.XpList))) = (*XSorterRecord)(unsafe.Pointer(elem15(_10_aNew, uintptr(_10_iListOff))))
 67151  	_pSorter.Xlist.XaMemory = _10_aNew
 67152  	_pSorter.XnMemory = _10_nNew
 67153  _25:
 67154  	_pNew = (*XSorterRecord)(unsafe.Pointer(elem15(_pSorter.Xlist.XaMemory, uintptr(_pSorter.XiMemory))))
 67155  	_pSorter.XiMemory += (_nReq + int32(7)) & int32(-8)
 67156  	if (_pSorter.Xlist.XpList) != nil {
 67157  		*(*int32)(unsafe.Pointer(&_pNew.Xu)) = int32(int64(uintptr(_pSorter.Xlist.XpList) - uintptr(unsafe.Pointer(_pSorter.Xlist.XaMemory))))
 67158  	}
 67159  	goto _32
 67160  _24:
 67161  	_pNew = (*XSorterRecord)(_sqlite3Malloc(tls, uint64(_nReq)))
 67162  	if _pNew == nil {
 67163  		return _sqlite3NomemError(tls, int32(87869))
 67164  	}
 67165  	*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.Xu)))) = (*XSorterRecord)(_pSorter.Xlist.XpList)
 67166  _32:
 67167  	crt.Xmemcpy(tls, unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(int32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))), unsafe.Pointer(_pVal.Xz), uint64(_pVal.Xn))
 67168  	_pNew.XnVal = _pVal.Xn
 67169  	*(**XSorterRecord)(unsafe.Pointer(&(_pSorter.Xlist.XpList))) = _pNew
 67170  	return _rc
 67171  }
 67172  
 67173  var _sqlite3VdbeSorterWriteØ00__func__Ø000 [23]int8
 67174  
 67175  func init() {
 67176  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterWriteØ00__func__Ø000[0], str(86351), 23)
 67177  }
 67178  
 67179  // C comment
 67180  //  /*
 67181  //  ** pCur points at an index entry created using the OP_MakeRecord opcode.
 67182  //  ** Read the rowid (the last field in the record) and store it in *rowid.
 67183  //  ** Return SQLITE_OK if everything works, or an error code otherwise.
 67184  //  **
 67185  //  ** pCur might be pointing to text obtained from a corrupt database file.
 67186  //  ** So the content cannot be trusted.  Do appropriate checks on the content.
 67187  //  */
 67188  func _sqlite3VdbeIdxRowid(tls *crt.TLS, _db *Xsqlite3, _pCur *XBtCursor, _rowid *int64) (r0 int32) {
 67189  	var _rc int32
 67190  	var _nCellKey int64
 67191  	var _szHdr, _typeRowid, _lenRowid uint32
 67192  	var _m, _v XMem
 67193  	_nCellKey = int64(0)
 67194  	func() {
 67195  		if _sqlite3BtreeCursorIsValid(tls, _pCur) == 0 {
 67196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75814), unsafe.Pointer(&_sqlite3VdbeIdxRowidØ00__func__Ø000), unsafe.Pointer(str(75569)))
 67197  			crt.X__builtin_abort(tls)
 67198  		}
 67199  	}()
 67200  	_nCellKey = int64(_sqlite3BtreePayloadSize(tls, _pCur))
 67201  	func() {
 67202  		if (uint64(_nCellKey) & uint64(4294967295)) != uint64(_nCellKey) {
 67203  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75816), unsafe.Pointer(&_sqlite3VdbeIdxRowidØ00__func__Ø000), unsafe.Pointer(str(86374)))
 67204  			crt.X__builtin_abort(tls)
 67205  		}
 67206  	}()
 67207  	_sqlite3VdbeMemInit(tls, &_m, _db, 0)
 67208  	_rc = _sqlite3VdbeMemFromBtree(tls, _pCur, 0, uint32(_nCellKey), &_m)
 67209  	if _rc != 0 {
 67210  		return _rc
 67211  	}
 67212  	func() int32 {
 67213  		if int32(*(*uint8)(unsafe.Pointer(_m.Xz))) < int32(128) {
 67214  			return func() int32 { _szHdr = uint32(*(*uint8)(unsafe.Pointer(_m.Xz))); return int32(1) }()
 67215  		}
 67216  		return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(_m.Xz)), &_szHdr))
 67217  	}()
 67218  	if (_szHdr < uint32(3)) || (int32(_szHdr) > _m.Xn) {
 67219  		goto _idx_rowid_corruption
 67220  	}
 67221  	func() int32 {
 67222  		if int32(*(*uint8)(unsafe.Pointer(elem1(_m.Xz, uintptr(_szHdr-uint32(1)))))) < int32(128) {
 67223  			return func() int32 {
 67224  				_typeRowid = uint32(*(*uint8)(unsafe.Pointer(elem1(_m.Xz, uintptr(_szHdr-uint32(1))))))
 67225  				return int32(1)
 67226  			}()
 67227  		}
 67228  		return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(elem1(_m.Xz, uintptr(_szHdr-uint32(1))))), &_typeRowid))
 67229  	}()
 67230  	if ((_typeRowid < uint32(1)) || (_typeRowid > uint32(9))) || (_typeRowid == uint32(7)) {
 67231  		goto _idx_rowid_corruption
 67232  	}
 67233  	_lenRowid = uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3SmallTypeSizes)), uintptr(_typeRowid)))
 67234  	if uint32(_m.Xn) < (_szHdr + _lenRowid) {
 67235  		goto _idx_rowid_corruption
 67236  	}
 67237  	_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(elem1(_m.Xz, uintptr(uint32(_m.Xn)-_lenRowid)))), _typeRowid, &_v)
 67238  	*_rowid = *(*int64)(unsafe.Pointer(&_v.Xu))
 67239  	_sqlite3VdbeMemRelease(tls, &_m)
 67240  	return int32(0)
 67241  
 67242  _idx_rowid_corruption:
 67243  	_sqlite3VdbeMemRelease(tls, &_m)
 67244  	return _sqlite3CorruptError(tls, int32(75864))
 67245  }
 67246  
 67247  var _sqlite3VdbeIdxRowidØ00__func__Ø000 [20]int8
 67248  
 67249  func init() {
 67250  	crt.Xstrncpy(nil, &_sqlite3VdbeIdxRowidØ00__func__Ø000[0], str(86417), 20)
 67251  }
 67252  
 67253  // C comment
 67254  //  /*
 67255  //  ** Compare the key of the index entry that cursor pC is pointing to against
 67256  //  ** the key string in pUnpacked.  Write into *pRes a number
 67257  //  ** that is negative, zero, or positive if pC is less than, equal to,
 67258  //  ** or greater than pUnpacked.  Return SQLITE_OK on success.
 67259  //  **
 67260  //  ** pUnpacked is either created without a rowid or is truncated so that it
 67261  //  ** omits the rowid at the end.  The rowid at the end of the index entry
 67262  //  ** is ignored as well.  Hence, this routine only compares the prefixes
 67263  //  ** of the keys prior to the final rowid, not the entire key.
 67264  //  */
 67265  func _sqlite3VdbeIdxKeyCompare(tls *crt.TLS, _db *Xsqlite3, _pC *XVdbeCursor, _pUnpacked *XUnpackedRecord, _res *int32) (r0 int32) {
 67266  	var _rc int32
 67267  	var _nCellKey int64
 67268  	var _m XMem
 67269  	var _pCur *XBtCursor
 67270  	_nCellKey = int64(0)
 67271  	func() {
 67272  		if int32(_pC.XeCurType) != int32(0) {
 67273  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75889), unsafe.Pointer(&_sqlite3VdbeIdxKeyCompareØ00__func__Ø000), unsafe.Pointer(str(63921)))
 67274  			crt.X__builtin_abort(tls)
 67275  		}
 67276  	}()
 67277  	_pCur = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pC.Xuc)))
 67278  	func() {
 67279  		if _sqlite3BtreeCursorIsValid(tls, _pCur) == 0 {
 67280  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75891), unsafe.Pointer(&_sqlite3VdbeIdxKeyCompareØ00__func__Ø000), unsafe.Pointer(str(75569)))
 67281  			crt.X__builtin_abort(tls)
 67282  		}
 67283  	}()
 67284  	_nCellKey = int64(_sqlite3BtreePayloadSize(tls, _pCur))
 67285  	if (_nCellKey <= (0)) || (_nCellKey > int64(2147483647)) {
 67286  		*_res = int32(0)
 67287  		return _sqlite3CorruptError(tls, int32(75897))
 67288  	}
 67289  	_sqlite3VdbeMemInit(tls, &_m, _db, 0)
 67290  	_rc = _sqlite3VdbeMemFromBtree(tls, _pCur, 0, uint32(_nCellKey), &_m)
 67291  	if _rc != 0 {
 67292  		return _rc
 67293  	}
 67294  	*_res = _sqlite3VdbeRecordCompare(tls, _m.Xn, unsafe.Pointer(_m.Xz), _pUnpacked)
 67295  	_sqlite3VdbeMemRelease(tls, &_m)
 67296  	return int32(0)
 67297  }
 67298  
 67299  var _sqlite3VdbeIdxKeyCompareØ00__func__Ø000 [25]int8
 67300  
 67301  func init() {
 67302  	crt.Xstrncpy(nil, &_sqlite3VdbeIdxKeyCompareØ00__func__Ø000[0], str(86437), 25)
 67303  }
 67304  
 67305  func _sqlite3BtreeDropTable(tls *crt.TLS, _p *XBtree, _iTable int32, _piMoved *int32) (r0 int32) {
 67306  	var _rc int32
 67307  	_sqlite3BtreeEnter(tls, _p)
 67308  	_rc = _btreeDropTable(tls, _p, uint32(_iTable), _piMoved)
 67309  	_sqlite3BtreeLeave(tls, _p)
 67310  	return _rc
 67311  }
 67312  
 67313  // C comment
 67314  //  /*
 67315  //  ** Erase all information in a table and add the root of the table to
 67316  //  ** the freelist.  Except, the root of the principle table (the one on
 67317  //  ** page 1) is never added to the freelist.
 67318  //  **
 67319  //  ** This routine will fail with SQLITE_LOCKED if there are any open
 67320  //  ** cursors on the table.
 67321  //  **
 67322  //  ** If AUTOVACUUM is enabled and the page at iTable is not the last
 67323  //  ** root page in the database file, then the last root page
 67324  //  ** in the database file is moved into the slot formerly occupied by
 67325  //  ** iTable and that last slot formerly occupied by the last root page
 67326  //  ** is added to the freelist instead of iTable.  In this say, all
 67327  //  ** root pages are kept at the beginning of the database file, which
 67328  //  ** is necessary for AUTOVACUUM to work right.  *piMoved is set to the
 67329  //  ** page number that used to be the last root page in the file before
 67330  //  ** the move.  If no page gets moved, *piMoved is set to 0.
 67331  //  ** The last root page is recorded in meta[3] and the value of
 67332  //  ** meta[3] is updated by this procedure.
 67333  //  */
 67334  func _btreeDropTable(tls *crt.TLS, _p *XBtree, _iTable uint32, _piMoved *int32) (r0 int32) {
 67335  	var _rc int32
 67336  	var _2_maxRootPgno uint32
 67337  	var _pBt *XBtShared
 67338  	var _pPage, _5_pMove *XMemPage
 67339  	_pPage = nil
 67340  	_pBt = (*XBtShared)(_p.XpBt)
 67341  	func() {
 67342  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 67343  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67751), unsafe.Pointer(&_btreeDropTableØ00__func__Ø000), unsafe.Pointer(str(17442)))
 67344  			crt.X__builtin_abort(tls)
 67345  		}
 67346  	}()
 67347  	func() {
 67348  		if int32(_p.XinTrans) != int32(2) {
 67349  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67752), unsafe.Pointer(&_btreeDropTableØ00__func__Ø000), unsafe.Pointer(str(75991)))
 67350  			crt.X__builtin_abort(tls)
 67351  		}
 67352  	}()
 67353  	func() {
 67354  		if _iTable < uint32(2) {
 67355  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67753), unsafe.Pointer(&_btreeDropTableØ00__func__Ø000), unsafe.Pointer(str(86462)))
 67356  			crt.X__builtin_abort(tls)
 67357  		}
 67358  	}()
 67359  	_rc = _btreeGetPage(tls, _pBt, _iTable, &_pPage, int32(0))
 67360  	if _rc != 0 {
 67361  		return _rc
 67362  	}
 67363  	_rc = _sqlite3BtreeClearTable(tls, _p, int32(_iTable), nil)
 67364  	if _rc != 0 {
 67365  		_releasePage(tls, _pPage)
 67366  		return _rc
 67367  	}
 67368  	*_piMoved = int32(0)
 67369  	if _pBt.XautoVacuum == 0 {
 67370  		goto _8
 67371  	}
 67372  	_sqlite3BtreeGetMeta(tls, _p, int32(4), &_2_maxRootPgno)
 67373  	if _iTable != _2_maxRootPgno {
 67374  		goto _9
 67375  	}
 67376  	_freePage(tls, _pPage, &_rc)
 67377  	_releasePage(tls, _pPage)
 67378  	if _rc != int32(0) {
 67379  		return _rc
 67380  	}
 67381  	goto _11
 67382  _9:
 67383  	_releasePage(tls, _pPage)
 67384  	_rc = _btreeGetPage(tls, _pBt, _2_maxRootPgno, &_5_pMove, int32(0))
 67385  	if _rc != int32(0) {
 67386  		return _rc
 67387  	}
 67388  	_rc = _relocatePage(tls, _pBt, _5_pMove, uint8(1), 0, _iTable, int32(0))
 67389  	_releasePage(tls, _5_pMove)
 67390  	if _rc != int32(0) {
 67391  		return _rc
 67392  	}
 67393  	_5_pMove = nil
 67394  	_rc = _btreeGetPage(tls, _pBt, _2_maxRootPgno, &_5_pMove, int32(0))
 67395  	_freePage(tls, _5_pMove, &_rc)
 67396  	_releasePage(tls, _5_pMove)
 67397  	if _rc != int32(0) {
 67398  		return _rc
 67399  	}
 67400  	*_piMoved = int32(_2_maxRootPgno)
 67401  _11:
 67402  	_2_maxRootPgno -= 1
 67403  _15:
 67404  	if (_2_maxRootPgno == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) || (_ptrmapPageno(tls, _pBt, _2_maxRootPgno) == _2_maxRootPgno) {
 67405  		_2_maxRootPgno -= 1
 67406  		goto _15
 67407  	}
 67408  	func() {
 67409  		if _2_maxRootPgno == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 67410  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67818), unsafe.Pointer(&_btreeDropTableØ00__func__Ø000), unsafe.Pointer(str(86472)))
 67411  			crt.X__builtin_abort(tls)
 67412  		}
 67413  	}()
 67414  	_rc = _sqlite3BtreeUpdateMeta(tls, _p, int32(4), _2_maxRootPgno)
 67415  	goto _20
 67416  _8:
 67417  	_freePage(tls, _pPage, &_rc)
 67418  	_releasePage(tls, _pPage)
 67419  _20:
 67420  	return _rc
 67421  }
 67422  
 67423  var _btreeDropTableØ00__func__Ø000 [15]int8
 67424  
 67425  func init() {
 67426  	crt.Xstrncpy(nil, &_btreeDropTableØ00__func__Ø000[0], str(86508), 15)
 67427  }
 67428  
 67429  // C comment
 67430  //  /*
 67431  //  ** Delete all information from a single table in the database.  iTable is
 67432  //  ** the page number of the root of the table.  After this routine returns,
 67433  //  ** the root page is empty, but still exists.
 67434  //  **
 67435  //  ** This routine will fail with SQLITE_LOCKED if there are any open
 67436  //  ** read cursors on the table.  Open write cursors are moved to the
 67437  //  ** root of the table.
 67438  //  **
 67439  //  ** If pnChange is not NULL, then table iTable must be an intkey table. The
 67440  //  ** integer value pointed to by pnChange is incremented by the number of
 67441  //  ** entries in the table.
 67442  //  */
 67443  func _sqlite3BtreeClearTable(tls *crt.TLS, _p *XBtree, _iTable int32, _pnChange *int32) (r0 int32) {
 67444  	var _rc int32
 67445  	var _pBt *XBtShared
 67446  	_pBt = (*XBtShared)(_p.XpBt)
 67447  	_sqlite3BtreeEnter(tls, _p)
 67448  	func() {
 67449  		if int32(_p.XinTrans) != int32(2) {
 67450  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67702), unsafe.Pointer(&_sqlite3BtreeClearTableØ00__func__Ø000), unsafe.Pointer(str(75991)))
 67451  			crt.X__builtin_abort(tls)
 67452  		}
 67453  	}()
 67454  	_rc = _saveAllCursors(tls, _pBt, uint32(_iTable), nil)
 67455  	if int32(0) == _rc {
 67456  		_invalidateIncrblobCursors(tls, _p, uint32(_iTable), 0, int32(1))
 67457  		_rc = _clearDatabasePage(tls, _pBt, uint32(_iTable), int32(0), _pnChange)
 67458  	}
 67459  	_sqlite3BtreeLeave(tls, _p)
 67460  	return _rc
 67461  }
 67462  
 67463  var _sqlite3BtreeClearTableØ00__func__Ø000 [23]int8
 67464  
 67465  func init() {
 67466  	crt.Xstrncpy(nil, &_sqlite3BtreeClearTableØ00__func__Ø000[0], str(86523), 23)
 67467  }
 67468  
 67469  // C comment
 67470  //  /*
 67471  //  ** Erase the given database page and all its children.  Return
 67472  //  ** the page to the freelist.
 67473  //  */
 67474  func _clearDatabasePage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _freePageFlag int32, _pnChange *int32) (r0 int32) {
 67475  	var _rc, _i, _hdr int32
 67476  	var _pCell *uint8
 67477  	var _info XCellInfo
 67478  	var _pPage *XMemPage
 67479  	func() {
 67480  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 67481  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67644), unsafe.Pointer(&_clearDatabasePageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 67482  			crt.X__builtin_abort(tls)
 67483  		}
 67484  	}()
 67485  	if _pgno > _btreePagecount(tls, _pBt) {
 67486  		return _sqlite3CorruptError(tls, int32(67646))
 67487  	}
 67488  	_rc = _getAndInitPage(tls, _pBt, _pgno, &_pPage, nil, int32(0))
 67489  	if _rc != 0 {
 67490  		return _rc
 67491  	}
 67492  	if _pPage.XbBusy != 0 {
 67493  		_rc = _sqlite3CorruptError(tls, int32(67651))
 67494  		goto _cleardatabasepage_out
 67495  	}
 67496  	_pPage.XbBusy = uint8(1)
 67497  	_hdr = int32(_pPage.XhdrOffset)
 67498  	_i = int32(0)
 67499  _5:
 67500  	if _i >= int32(_pPage.XnCell) {
 67501  		goto _8
 67502  	}
 67503  	_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaData)) + uintptr(int32(_pPage.XmaskPage)&((int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_i)), 0))<<8)|int32(*elem15(elem15(_pPage.XaCellIdx, uintptr(int32(2)*_i)), uintptr(1)))))))
 67504  	if _pPage.Xleaf != 0 {
 67505  		goto _9
 67506  	}
 67507  	_rc = _clearDatabasePage(tls, _pBt, _sqlite3Get4byte(tls, _pCell), int32(1), _pnChange)
 67508  	if _rc != 0 {
 67509  		goto _cleardatabasepage_out
 67510  	}
 67511  _9:
 67512  	_rc = _clearCell(tls, _pPage, _pCell, &_info)
 67513  	if _rc != 0 {
 67514  		goto _cleardatabasepage_out
 67515  	}
 67516  	_i += 1
 67517  	goto _5
 67518  _8:
 67519  	if _pPage.Xleaf != 0 {
 67520  		goto _12
 67521  	}
 67522  	_rc = _clearDatabasePage(tls, _pBt, _sqlite3Get4byte(tls, elem15(_pPage.XaData, uintptr(_hdr+int32(8)))), int32(1), _pnChange)
 67523  	if _rc != 0 {
 67524  		goto _cleardatabasepage_out
 67525  	}
 67526  	goto _15
 67527  _12:
 67528  	if _pnChange != nil {
 67529  		func() {
 67530  			if _pPage.XintKey == 0 && _sqlite3Config.XneverCorrupt != int32(0) {
 67531  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67669), unsafe.Pointer(&_clearDatabasePageØ00__func__Ø000), unsafe.Pointer(str(86546)))
 67532  				crt.X__builtin_abort(tls)
 67533  			}
 67534  		}()
 67535  		*_pnChange += int32(_pPage.XnCell)
 67536  	}
 67537  _15:
 67538  	if _freePageFlag != 0 {
 67539  		_freePage(tls, _pPage, &_rc)
 67540  		goto _cleardatabasepage_out
 67541  	}
 67542  	if store2(&_rc, _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))) == int32(0) {
 67543  		_zeroPage(tls, _pPage, int32(*elem15(_pPage.XaData, uintptr(_hdr)))|int32(8))
 67544  	}
 67545  _cleardatabasepage_out:
 67546  	_pPage.XbBusy = 0
 67547  	_releasePage(tls, _pPage)
 67548  	return _rc
 67549  }
 67550  
 67551  var _clearDatabasePageØ00__func__Ø000 [18]int8
 67552  
 67553  func init() {
 67554  	crt.Xstrncpy(nil, &_clearDatabasePageØ00__func__Ø000[0], str(86574), 18)
 67555  }
 67556  
 67557  func _sqlite3RootPageMoved(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _iFrom int32, _iTo int32) {
 67558  	var _pDb *XDb
 67559  	var _pElem *XHashElem
 67560  	var _pHash *XHash
 67561  	var _1_pTab *XTable
 67562  	var _3_pIdx *XIndex
 67563  	func() {
 67564  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 67565  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101998), unsafe.Pointer(&_sqlite3RootPageMovedØ00__func__Ø000), unsafe.Pointer(str(51126)))
 67566  			crt.X__builtin_abort(tls)
 67567  		}
 67568  	}()
 67569  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 67570  	_pHash = &((*XSchema)(_pDb.XpSchema).XtblHash)
 67571  	_pElem = (*XHashElem)(_pHash.Xfirst)
 67572  _2:
 67573  	if _pElem == nil {
 67574  		goto _5
 67575  	}
 67576  	_1_pTab = (*XTable)(_pElem.Xdata)
 67577  	if _1_pTab.Xtnum == _iFrom {
 67578  		_1_pTab.Xtnum = _iTo
 67579  	}
 67580  	_pElem = (*XHashElem)(_pElem.Xnext)
 67581  	goto _2
 67582  _5:
 67583  	_pHash = &((*XSchema)(_pDb.XpSchema).XidxHash)
 67584  	_pElem = (*XHashElem)(_pHash.Xfirst)
 67585  _7:
 67586  	if _pElem == nil {
 67587  		goto _10
 67588  	}
 67589  	_3_pIdx = (*XIndex)(_pElem.Xdata)
 67590  	if _3_pIdx.Xtnum == _iFrom {
 67591  		_3_pIdx.Xtnum = _iTo
 67592  	}
 67593  	_pElem = (*XHashElem)(_pElem.Xnext)
 67594  	goto _7
 67595  _10:
 67596  }
 67597  
 67598  var _sqlite3RootPageMovedØ00__func__Ø000 [21]int8
 67599  
 67600  func init() {
 67601  	crt.Xstrncpy(nil, &_sqlite3RootPageMovedØ00__func__Ø000[0], str(86592), 21)
 67602  }
 67603  
 67604  // C comment
 67605  //  /*
 67606  //  ** Delete all information from the single table that pCur is open on.
 67607  //  **
 67608  //  ** This routine only work for pCur on an ephemeral table.
 67609  //  */
 67610  func _sqlite3BtreeClearTableOfCursor(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 67611  	return _sqlite3BtreeClearTable(tls, (*XBtree)(_pCur.XpBtree), int32(_pCur.XpgnoRoot), nil)
 67612  }
 67613  
 67614  // C comment
 67615  //  /*
 67616  //  ** Load the content of the sqlite_stat1 and sqlite_stat3/4 tables. The
 67617  //  ** contents of sqlite_stat1 are used to populate the Index.aiRowEst[]
 67618  //  ** arrays. The contents of sqlite_stat3/4 are used to populate the
 67619  //  ** Index.aSample[] arrays.
 67620  //  **
 67621  //  ** If the sqlite_stat1 table is not present in the database, SQLITE_ERROR
 67622  //  ** is returned. In this case, even if SQLITE_ENABLE_STAT3/4 was defined
 67623  //  ** during compilation and the sqlite_stat3/4 table is present, no data is
 67624  //  ** read from it.
 67625  //  **
 67626  //  ** If SQLITE_ENABLE_STAT3/4 was defined during compilation and the
 67627  //  ** sqlite_stat4 table is not present in the database, SQLITE_ERROR is
 67628  //  ** returned. However, in this case, data is read from the sqlite_stat1
 67629  //  ** table (if it is present) before returning.
 67630  //  **
 67631  //  ** If an OOM error occurs, this function always sets db->mallocFailed.
 67632  //  ** This means if the caller does not care about other errors, the return
 67633  //  ** code may be ignored.
 67634  //  */
 67635  func _sqlite3AnalysisLoad(tls *crt.TLS, _db *Xsqlite3, _iDb int32) (r0 int32) {
 67636  	var _rc int32
 67637  	var _zSql *int8
 67638  	var _pSchema *XSchema
 67639  	var _i *XHashElem
 67640  	var _1_pTab *XTable
 67641  	var _2_pIdx, _6_pIdx *XIndex
 67642  	var _sInfo XanalysisInfo
 67643  	_rc = int32(0)
 67644  	_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
 67645  	func() {
 67646  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 67647  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98771), unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000), unsafe.Pointer(str(21693)))
 67648  			crt.X__builtin_abort(tls)
 67649  		}
 67650  	}()
 67651  	func() {
 67652  		if (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt) == nil {
 67653  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98772), unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000), unsafe.Pointer(str(65334)))
 67654  			crt.X__builtin_abort(tls)
 67655  		}
 67656  	}()
 67657  	func() {
 67658  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 67659  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98775), unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000), unsafe.Pointer(str(51126)))
 67660  			crt.X__builtin_abort(tls)
 67661  		}
 67662  	}()
 67663  	_i = (*XHashElem)(_pSchema.XtblHash.Xfirst)
 67664  _7:
 67665  	if _i == nil {
 67666  		goto _10
 67667  	}
 67668  	_1_pTab = (*XTable)(_i.Xdata)
 67669  	_1_pTab.XtabFlags &= uint32(4294967279)
 67670  	_i = (*XHashElem)(_i.Xnext)
 67671  	goto _7
 67672  _10:
 67673  	_i = (*XHashElem)(_pSchema.XidxHash.Xfirst)
 67674  _11:
 67675  	if _i == nil {
 67676  		goto _14
 67677  	}
 67678  	_2_pIdx = (*XIndex)(_i.Xdata)
 67679  	storebits5(&_2_pIdx.XidxType, 0, 128, 7)
 67680  	_i = (*XHashElem)(_i.Xnext)
 67681  	goto _11
 67682  _14:
 67683  	*(**Xsqlite3)(unsafe.Pointer(&_sInfo.Xdb)) = _db
 67684  	_sInfo.XzDatabase = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 67685  	if _sqlite3FindTable(tls, _db, str(86613), _sInfo.XzDatabase) == nil {
 67686  		goto _15
 67687  	}
 67688  	_zSql = _sqlite3MPrintf(tls, _db, str(86626), unsafe.Pointer(_sInfo.XzDatabase))
 67689  	if _zSql == nil {
 67690  		_rc = _sqlite3NomemError(tls, int32(98796))
 67691  		goto _17
 67692  	}
 67693  	_rc = Xsqlite3_exec(tls, _db, _zSql, _analysisLoader, unsafe.Pointer(&_sInfo), nil)
 67694  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zSql))
 67695  _17:
 67696  _15:
 67697  	func() {
 67698  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 67699  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98804), unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000), unsafe.Pointer(str(51126)))
 67700  			crt.X__builtin_abort(tls)
 67701  		}
 67702  	}()
 67703  	_i = (*XHashElem)(_pSchema.XidxHash.Xfirst)
 67704  _20:
 67705  	if _i == nil {
 67706  		goto _23
 67707  	}
 67708  	_6_pIdx = (*XIndex)(_i.Xdata)
 67709  	if ((uint32(_6_pIdx.XidxType>>7) << 31) >> 31) == 0 {
 67710  		_sqlite3DefaultRowEst(tls, _6_pIdx)
 67711  	}
 67712  	_i = (*XHashElem)(_i.Xnext)
 67713  	goto _20
 67714  _23:
 67715  	if _rc == int32(7) {
 67716  		_sqlite3OomFault(tls, _db)
 67717  	}
 67718  	return _rc
 67719  }
 67720  
 67721  var _sqlite3AnalysisLoadØ00__func__Ø000 [20]int8
 67722  
 67723  func init() {
 67724  	crt.Xstrncpy(nil, &_sqlite3AnalysisLoadØ00__func__Ø000[0], str(86667), 20)
 67725  }
 67726  
 67727  // C comment
 67728  //  /*
 67729  //  ** Locate the in-memory structure that describes a particular database
 67730  //  ** table given the name of that table and (optionally) the name of the
 67731  //  ** database containing the table.  Return NULL if not found.
 67732  //  **
 67733  //  ** If zDatabase is 0, all databases are searched for the table and the
 67734  //  ** first matching table is returned.  (No checking for duplicate table
 67735  //  ** names is done.)  The search order is TEMP first, then MAIN, then any
 67736  //  ** auxiliary databases added using the ATTACH command.
 67737  //  **
 67738  //  ** See also sqlite3LocateTable().
 67739  //  */
 67740  func _sqlite3FindTable(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _zDatabase *int8) (r0 *XTable) {
 67741  	var _i, _2_j int32
 67742  	var _p *XTable
 67743  	_p = nil
 67744  	func() {
 67745  		if _zDatabase == nil && _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
 67746  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99999), unsafe.Pointer(&_sqlite3FindTableØ00__func__Ø000), unsafe.Pointer(str(86687)))
 67747  			crt.X__builtin_abort(tls)
 67748  		}
 67749  	}()
 67750  _3:
 67751  	_i = int32(0)
 67752  _5:
 67753  	if _i >= _db.XnDb {
 67754  		goto _8
 67755  	}
 67756  	_2_j = func() int32 {
 67757  		if _i < int32(2) {
 67758  			return (_i ^ int32(1))
 67759  		}
 67760  		return _i
 67761  	}()
 67762  	if _zDatabase != nil && _sqlite3StrICmp(tls, _zDatabase, elem27((*XDb)(_db.XaDb), uintptr(_2_j)).XzDbSName) != int32(0) {
 67763  		goto _12
 67764  	}
 67765  	func() {
 67766  		if _sqlite3SchemaMutexHeld(tls, _db, _2_j, nil) == 0 {
 67767  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100011), unsafe.Pointer(&_sqlite3FindTableØ00__func__Ø000), unsafe.Pointer(str(59943)))
 67768  			crt.X__builtin_abort(tls)
 67769  		}
 67770  	}()
 67771  	_p = (*XTable)(_sqlite3HashFind(tls, &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_2_j)).XpSchema).XtblHash), _zName))
 67772  	if _p != nil {
 67773  		return _p
 67774  	}
 67775  _12:
 67776  	_i += 1
 67777  	goto _5
 67778  _8:
 67779  	if _sqlite3StrICmp(tls, _zName, str(49981)) != int32(0) {
 67780  		goto _4
 67781  	}
 67782  	if Xsqlite3_stricmp(tls, _zDatabase, elem27((*XDb)(_db.XaDb), uintptr(1)).XzDbSName) != int32(0) {
 67783  		goto _4
 67784  	}
 67785  	_zName = str(49962)
 67786  	goto _3
 67787  _4:
 67788  	return nil
 67789  }
 67790  
 67791  var _sqlite3FindTableØ00__func__Ø000 [17]int8
 67792  
 67793  func init() {
 67794  	crt.Xstrncpy(nil, &_sqlite3FindTableØ00__func__Ø000[0], str(86735), 17)
 67795  }
 67796  
 67797  // C comment
 67798  //  /*
 67799  //  ** This callback is invoked once for each index when reading the
 67800  //  ** sqlite_stat1 table.
 67801  //  **
 67802  //  **     argv[0] = name of the table
 67803  //  **     argv[1] = name of the index (might be NULL)
 67804  //  **     argv[2] = results of analysis - on integer for each column
 67805  //  **
 67806  //  ** Entries for which argv[1]==NULL simply record the number of rows in
 67807  //  ** the table.
 67808  //  */
 67809  func _analysisLoader(tls *crt.TLS, _pData unsafe.Pointer, _argc int32, _argv **int8, _NotUsed **int8) (r0 int32) {
 67810  	var _6_nCol int32
 67811  	var _z *int8
 67812  	var _pTable *XTable
 67813  	var _6_aiRowEst *uint32
 67814  	var _pIndex *XIndex
 67815  	var _8_fakeIdx XIndex
 67816  	var _pInfo *XanalysisInfo
 67817  	_pInfo = (*XanalysisInfo)(_pData)
 67818  	func() {
 67819  		if _argc != int32(3) {
 67820  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98427), unsafe.Pointer(&_analysisLoaderØ00__func__Ø000), unsafe.Pointer(str(50249)))
 67821  			crt.X__builtin_abort(tls)
 67822  		}
 67823  	}()
 67824  	_ = _argc
 67825  
 67826  	if ((_argv == nil) || ((*elem0(_argv, 0)) == nil)) || ((*elem0(_argv, uintptr(2))) == nil) {
 67827  		return int32(0)
 67828  	}
 67829  	_pTable = _sqlite3FindTable(tls, (*Xsqlite3)(_pInfo.Xdb), *elem0(_argv, 0), _pInfo.XzDatabase)
 67830  	if _pTable == nil {
 67831  		return int32(0)
 67832  	}
 67833  	if (*elem0(_argv, uintptr(1))) == nil {
 67834  		_pIndex = nil
 67835  		goto _9
 67836  	}
 67837  	if Xsqlite3_stricmp(tls, *elem0(_argv, 0), *elem0(_argv, uintptr(1))) == int32(0) {
 67838  		_pIndex = _sqlite3PrimaryKeyIndex(tls, _pTable)
 67839  		goto _9
 67840  	}
 67841  	_pIndex = _sqlite3FindIndex(tls, (*Xsqlite3)(_pInfo.Xdb), *elem0(_argv, uintptr(1)), _pInfo.XzDatabase)
 67842  _9:
 67843  	_z = *elem0(_argv, uintptr(2))
 67844  	if _pIndex == nil {
 67845  		goto _10
 67846  	}
 67847  	_6_aiRowEst = nil
 67848  	_6_nCol = int32(_pIndex.XnKeyCol) + int32(1)
 67849  	storebits5(&_pIndex.XidxType, 0, 4, 2)
 67850  	_decodeIntArray(tls, _z, _6_nCol, _6_aiRowEst, _pIndex.XaiRowLogEst, _pIndex)
 67851  	storebits5(&_pIndex.XidxType, int8(1), 128, 7)
 67852  	if (*XExpr)(_pIndex.XpPartIdxWhere) == nil {
 67853  		_pTable.XnRowLogEst = *elem52(_pIndex.XaiRowLogEst, 0)
 67854  		_pTable.XtabFlags |= uint32(16)
 67855  	}
 67856  	goto _12
 67857  _10:
 67858  	_8_fakeIdx.XszIdxRow = _pTable.XszTabRow
 67859  	_decodeIntArray(tls, _z, int32(1), nil, &_pTable.XnRowLogEst, &_8_fakeIdx)
 67860  	_pTable.XszTabRow = _8_fakeIdx.XszIdxRow
 67861  	_pTable.XtabFlags |= uint32(16)
 67862  _12:
 67863  	return int32(0)
 67864  }
 67865  
 67866  var _analysisLoaderØ00__func__Ø000 [15]int8
 67867  
 67868  func init() {
 67869  	crt.Xstrncpy(nil, &_analysisLoaderØ00__func__Ø000[0], str(86752), 15)
 67870  }
 67871  
 67872  // C comment
 67873  //  /*
 67874  //  ** The first argument points to a nul-terminated string containing a
 67875  //  ** list of space separated integers. Read the first nOut of these into
 67876  //  ** the array aOut[].
 67877  //  */
 67878  func _decodeIntArray(tls *crt.TLS, _zIntArray *int8, _nOut int32, _aOut *uint32, _aLog *int16, _pIndex *XIndex) {
 67879  	var _c, _i int32
 67880  	var _v uint32
 67881  	var _z *int8
 67882  	_z = _zIntArray
 67883  	func() {
 67884  		if _z == nil {
 67885  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98365), unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000), unsafe.Pointer(str(44406)))
 67886  			crt.X__builtin_abort(tls)
 67887  		}
 67888  	}()
 67889  	_i = int32(0)
 67890  _2:
 67891  	if (*_z) == 0 || _i >= _nOut {
 67892  		goto _6
 67893  	}
 67894  	_v = 0
 67895  _7:
 67896  	if (store2(&_c, int32(*elem1(_z, 0))) >= int32(48)) && (_c <= int32(57)) {
 67897  		_v = ((_v * uint32(10)) + uint32(_c)) - uint32(48)
 67898  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 67899  		goto _7
 67900  	}
 67901  	func() {
 67902  		if _aOut != nil {
 67903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98377), unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000), unsafe.Pointer(str(86767)))
 67904  			crt.X__builtin_abort(tls)
 67905  		}
 67906  	}()
 67907  
 67908  	func() {
 67909  		if _aLog == nil {
 67910  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98379), unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000), unsafe.Pointer(str(86775)))
 67911  			crt.X__builtin_abort(tls)
 67912  		}
 67913  	}()
 67914  	*elem52(_aLog, uintptr(_i)) = _sqlite3LogEst(tls, uint64(_v))
 67915  	if int32(*_z) == int32(32) {
 67916  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 67917  	}
 67918  	_i += 1
 67919  	goto _2
 67920  _6:
 67921  	func() {
 67922  		if _pIndex == nil {
 67923  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98385), unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000), unsafe.Pointer(str(86783)))
 67924  			crt.X__builtin_abort(tls)
 67925  		}
 67926  	}()
 67927  	storebits5(&_pIndex.XidxType, 0, 4, 2)
 67928  	storebits5(&_pIndex.XidxType, 0, 64, 6)
 67929  _17:
 67930  	if (*elem1(_z, 0)) == 0 {
 67931  		goto _18
 67932  	}
 67933  	if Xsqlite3_strglob(tls, str(86793), _z) == int32(0) {
 67934  		storebits5(&_pIndex.XidxType, int8(1), 4, 2)
 67935  		goto _23
 67936  	}
 67937  	if Xsqlite3_strglob(tls, str(86804), _z) == int32(0) {
 67938  		_pIndex.XszIdxRow = _sqlite3LogEst(tls, uint64(_sqlite3Atoi(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(int32(3)))))))
 67939  		goto _23
 67940  	}
 67941  	if Xsqlite3_strglob(tls, str(86814), _z) == int32(0) {
 67942  		storebits5(&_pIndex.XidxType, int8(1), 64, 6)
 67943  	}
 67944  _23:
 67945  	if (int32(*elem1(_z, 0)) != int32(0)) && (int32(*elem1(_z, 0)) != int32(32)) {
 67946  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 67947  		goto _23
 67948  	}
 67949  _25:
 67950  	if int32(*elem1(_z, 0)) == int32(32) {
 67951  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 67952  		goto _25
 67953  	}
 67954  	goto _17
 67955  _18:
 67956  }
 67957  
 67958  var _decodeIntArrayØ00__func__Ø000 [15]int8
 67959  
 67960  func init() {
 67961  	crt.Xstrncpy(nil, &_decodeIntArrayØ00__func__Ø000[0], str(86826), 15)
 67962  }
 67963  
 67964  // C comment
 67965  //  /*
 67966  //  ** The sqlite3_strglob() interface.  Return 0 on a match (like strcmp()) and
 67967  //  ** non-zero if there is no match.
 67968  //  */
 67969  func Xsqlite3_strglob(tls *crt.TLS, _zGlobPattern *int8, _zString *int8) (r0 int32) {
 67970  	return _patternCompare(tls, (*uint8)(unsafe.Pointer(_zGlobPattern)), (*uint8)(unsafe.Pointer(_zString)), &_globInfo, uint32(91))
 67971  }
 67972  
 67973  // C comment
 67974  //  /*
 67975  //  ** Compare two UTF-8 strings for equality where the first string is
 67976  //  ** a GLOB or LIKE expression.  Return values:
 67977  //  **
 67978  //  **    SQLITE_MATCH:            Match
 67979  //  **    SQLITE_NOMATCH:          No match
 67980  //  **    SQLITE_NOWILDCARDMATCH:  No match in spite of having * or % wildcards.
 67981  //  **
 67982  //  ** Globbing rules:
 67983  //  **
 67984  //  **      '*'       Matches any sequence of zero or more characters.
 67985  //  **
 67986  //  **      '?'       Matches exactly one character.
 67987  //  **
 67988  //  **     [...]      Matches one character from the enclosed list of
 67989  //  **                characters.
 67990  //  **
 67991  //  **     [^...]     Matches one character not in the enclosed list.
 67992  //  **
 67993  //  ** With the [...] and [^...] matching, a ']' character can be included
 67994  //  ** in the list by making it the first character after '[' or '^'.  A
 67995  //  ** range of characters can be specified using '-'.  Example:
 67996  //  ** "[a-z]" matches any single lower-case letter.  To match a '-', make
 67997  //  ** it the last character in the list.
 67998  //  **
 67999  //  ** Like matching rules:
 68000  //  **
 68001  //  **      '%'       Matches any sequence of zero or more characters
 68002  //  **
 68003  //  ***     '_'       Matches any one character
 68004  //  **
 68005  //  **      Ec        Where E is the "esc" character and c is any other
 68006  //  **                character, including '%', '_', and esc, match exactly c.
 68007  //  **
 68008  //  ** The comments within this routine usually assume glob matching.
 68009  //  **
 68010  //  ** This routine is usually quick, but can be N**2 in the worst case.
 68011  //  */
 68012  func _patternCompare(tls *crt.TLS, _zPattern *uint8, _zString *uint8, _pInfo *TcompareInfo, _matchOther uint32) (r0 int32) {
 68013  	var _9_bMatch, _13_bMatch, _17_bMatch, _21_seen, _21_invert int32
 68014  	var _c, _c2, _matchOne, _matchAll, _13_cx, _21_prior_c uint32
 68015  	var _noCase uint8
 68016  	var _zEscaped *uint8
 68017  	_matchOne = uint32(_pInfo.XmatchOne)
 68018  	_matchAll = uint32(_pInfo.XmatchAll)
 68019  	_noCase = _pInfo.XnoCase
 68020  	_zEscaped = nil
 68021  _0:
 68022  	if store34(&_c, func() uint32 {
 68023  		if int32(*elem15(_zPattern, 0)) < int32(128) {
 68024  			return uint32(*postInc15(&_zPattern, 1))
 68025  		}
 68026  		return _sqlite3Utf8Read(tls, &_zPattern)
 68027  	}()) == (0) {
 68028  		goto _1
 68029  	}
 68030  	if _c != _matchAll {
 68031  		goto _4
 68032  	}
 68033  _5:
 68034  	if store34(&_c, func() uint32 {
 68035  		if int32(*elem15(_zPattern, 0)) < int32(128) {
 68036  			return uint32(*postInc15(&_zPattern, 1))
 68037  		}
 68038  		return _sqlite3Utf8Read(tls, &_zPattern)
 68039  	}()) != _matchAll && _c != _matchOne {
 68040  		goto _6
 68041  	}
 68042  	if (_c == _matchOne) && (_sqlite3Utf8Read(tls, &_zString) == (0)) {
 68043  		return int32(2)
 68044  	}
 68045  	goto _5
 68046  _6:
 68047  	if _c == (0) {
 68048  		return int32(0)
 68049  	}
 68050  	if _c != _matchOther {
 68051  		goto _14
 68052  	}
 68053  	if int32(_pInfo.XmatchSet) != int32(0) {
 68054  		goto _15
 68055  	}
 68056  	_c = _sqlite3Utf8Read(tls, &_zPattern)
 68057  	if _c == (0) {
 68058  		return int32(2)
 68059  	}
 68060  	goto _17
 68061  _15:
 68062  	func() {
 68063  		if _matchOther >= uint32(128) {
 68064  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106217), unsafe.Pointer(&_patternCompareØ00__func__Ø000), unsafe.Pointer(str(86841)))
 68065  			crt.X__builtin_abort(tls)
 68066  		}
 68067  	}()
 68068  _20:
 68069  	if (*_zString) == 0 {
 68070  		goto _21
 68071  	}
 68072  	_9_bMatch = _patternCompare(tls, elem15(_zPattern, uintptr(18446744073709551615)), _zString, _pInfo, _matchOther)
 68073  	if _9_bMatch != int32(1) {
 68074  		return _9_bMatch
 68075  	}
 68076  	if int32(*postInc15(&_zString, 1)) < int32(192) {
 68077  		goto _23
 68078  	}
 68079  _24:
 68080  	if (int32(*_zString) & int32(192)) == int32(128) {
 68081  		*(*uintptr)(unsafe.Pointer(&_zString)) += uintptr(1)
 68082  		goto _24
 68083  	}
 68084  _23:
 68085  	goto _20
 68086  _21:
 68087  	return int32(2)
 68088  
 68089  _17:
 68090  _14:
 68091  	if _c > uint32(128) {
 68092  		goto _26
 68093  	}
 68094  	if _noCase != 0 {
 68095  		_13_cx = _c & uint32(^(int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(_c)))) & int32(32)))
 68096  		_c = uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(_c))))
 68097  		goto _28
 68098  	}
 68099  	_13_cx = _c
 68100  _28:
 68101  	if store34(&_c2, uint32(*postInc15(&_zString, 1))) == (0) {
 68102  		goto _30
 68103  	}
 68104  	if (_c2 != _c) && (_c2 != _13_cx) {
 68105  		goto _28
 68106  	}
 68107  	_13_bMatch = _patternCompare(tls, _zPattern, _zString, _pInfo, _matchOther)
 68108  	if _13_bMatch != int32(1) {
 68109  		return _13_bMatch
 68110  	}
 68111  	goto _28
 68112  _30:
 68113  	goto _34
 68114  _26:
 68115  _35:
 68116  	if store34(&_c2, func() uint32 {
 68117  		if int32(*elem15(_zString, 0)) < int32(128) {
 68118  			return uint32(*postInc15(&_zString, 1))
 68119  		}
 68120  		return _sqlite3Utf8Read(tls, &_zString)
 68121  	}()) == (0) {
 68122  		goto _36
 68123  	}
 68124  	if _c2 != _c {
 68125  		goto _35
 68126  	}
 68127  	_17_bMatch = _patternCompare(tls, _zPattern, _zString, _pInfo, _matchOther)
 68128  	if _17_bMatch != int32(1) {
 68129  		return _17_bMatch
 68130  	}
 68131  	goto _35
 68132  _36:
 68133  _34:
 68134  	return int32(2)
 68135  
 68136  _4:
 68137  	if _c != _matchOther {
 68138  		goto _41
 68139  	}
 68140  	if int32(_pInfo.XmatchSet) != int32(0) {
 68141  		goto _42
 68142  	}
 68143  	_c = _sqlite3Utf8Read(tls, &_zPattern)
 68144  	if _c == (0) {
 68145  		return int32(1)
 68146  	}
 68147  	_zEscaped = _zPattern
 68148  	goto _44
 68149  _42:
 68150  	_21_prior_c = 0
 68151  	_21_seen = int32(0)
 68152  	_21_invert = int32(0)
 68153  	_c = _sqlite3Utf8Read(tls, &_zString)
 68154  	if _c == (0) {
 68155  		return int32(1)
 68156  	}
 68157  	_c2 = _sqlite3Utf8Read(tls, &_zPattern)
 68158  	if _c2 == uint32(94) {
 68159  		_21_invert = int32(1)
 68160  		_c2 = _sqlite3Utf8Read(tls, &_zPattern)
 68161  	}
 68162  	if _c2 != uint32(93) {
 68163  		goto _47
 68164  	}
 68165  	if _c == uint32(93) {
 68166  		_21_seen = int32(1)
 68167  	}
 68168  	_c2 = _sqlite3Utf8Read(tls, &_zPattern)
 68169  _47:
 68170  	if _c2 == 0 || _c2 == uint32(93) {
 68171  		goto _50
 68172  	}
 68173  	if _c2 != uint32(45) || int32(*elem15(_zPattern, 0)) == int32(93) || int32(*elem15(_zPattern, 0)) == int32(0) || _21_prior_c <= (0) {
 68174  		goto _55
 68175  	}
 68176  	_c2 = _sqlite3Utf8Read(tls, &_zPattern)
 68177  	if (_c >= _21_prior_c) && (_c <= _c2) {
 68178  		_21_seen = int32(1)
 68179  	}
 68180  	_21_prior_c = 0
 68181  	goto _58
 68182  _55:
 68183  	if _c == _c2 {
 68184  		_21_seen = int32(1)
 68185  	}
 68186  	_21_prior_c = _c2
 68187  _58:
 68188  	_c2 = _sqlite3Utf8Read(tls, &_zPattern)
 68189  	goto _47
 68190  _50:
 68191  	if (_c2 == (0)) || ((_21_seen ^ _21_invert) == int32(0)) {
 68192  		return int32(1)
 68193  	}
 68194  	goto _0
 68195  _44:
 68196  _41:
 68197  	_c2 = func() uint32 {
 68198  		if int32(*elem15(_zString, 0)) < int32(128) {
 68199  			return uint32(*postInc15(&_zString, 1))
 68200  		}
 68201  		return _sqlite3Utf8Read(tls, &_zString)
 68202  	}()
 68203  	if _c == _c2 {
 68204  		goto _0
 68205  	}
 68206  	if (((_noCase != 0) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(_c)))) == int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(_c2)))))) && (_c < uint32(128))) && (_c2 < uint32(128)) {
 68207  		goto _0
 68208  	}
 68209  	if ((_c == _matchOne) && (_zPattern != _zEscaped)) && (_c2 != (0)) {
 68210  		goto _0
 68211  	}
 68212  	return int32(1)
 68213  
 68214  _1:
 68215  	return func() int32 {
 68216  		if int32(*_zString) == int32(0) {
 68217  			return int32(0)
 68218  		}
 68219  		return int32(1)
 68220  	}()
 68221  }
 68222  
 68223  func _sqlite3Utf8Read(tls *crt.TLS, _pz **uint8) (r0 uint32) {
 68224  	var _c uint32
 68225  	_c = uint32(*postInc15(_pz, 1))
 68226  	if _c < uint32(192) {
 68227  		goto _0
 68228  	}
 68229  	_c = uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3Utf8Trans1)), uintptr(_c-uint32(192))))
 68230  _1:
 68231  	if (int32(*(*_pz)) & int32(192)) == int32(128) {
 68232  		_c = (_c << 6) + uint32(int32(63)&int32(*postInc15(_pz, 1)))
 68233  		goto _1
 68234  	}
 68235  	if ((_c < uint32(128)) || ((_c & uint32(4294965248)) == uint32(55296))) || ((_c & uint32(4294967294)) == uint32(65534)) {
 68236  		_c = uint32(65533)
 68237  	}
 68238  _0:
 68239  	return _c
 68240  }
 68241  
 68242  var _patternCompareØ00__func__Ø000 [15]int8
 68243  
 68244  func init() {
 68245  	crt.Xstrncpy(nil, &_patternCompareØ00__func__Ø000[0], str(86857), 15)
 68246  }
 68247  
 68248  var _globInfo TcompareInfo
 68249  
 68250  func init() {
 68251  	_globInfo = TcompareInfo{XmatchAll: uint8(42), XmatchOne: uint8(63), XmatchSet: uint8(91)}
 68252  }
 68253  
 68254  // C comment
 68255  //  /*
 68256  //  ** Fill the Index.aiRowEst[] array with default information - information
 68257  //  ** to be used when we have not run the ANALYZE command.
 68258  //  **
 68259  //  ** aiRowEst[0] is supposed to contain the number of elements in the index.
 68260  //  ** Since we do not know, guess 1 million.  aiRowEst[1] is an estimate of the
 68261  //  ** number of rows in the table that match any particular value of the
 68262  //  ** first column of the index.  aiRowEst[2] is an estimate of the number
 68263  //  ** of rows that match any particular combination of the first 2 columns
 68264  //  ** of the index.  And so forth.  It must always be the case that
 68265  //  *
 68266  //  **           aiRowEst[N]<=aiRowEst[N-1]
 68267  //  **           aiRowEst[N]>=1
 68268  //  **
 68269  //  ** Apart from that, we have little to go on besides intuition as to
 68270  //  ** how aiRowEst[] should be initialized.  The numbers generated here
 68271  //  ** are based on typical values found in actual indices.
 68272  //  */
 68273  func _sqlite3DefaultRowEst(tls *crt.TLS, _pIdx *XIndex) {
 68274  	var _nCopy, _i int32
 68275  	var _a *int16
 68276  	var _aVal [5]int16
 68277  	_aVal = [5]int16{int16(33), int16(32), int16(30), int16(28), int16(26)}
 68278  	_a = _pIdx.XaiRowLogEst
 68279  	_nCopy = func() int32 {
 68280  		if int32(5) < int32(_pIdx.XnKeyCol) {
 68281  			return int32(5)
 68282  		}
 68283  		return int32(_pIdx.XnKeyCol)
 68284  	}()
 68285  	func() {
 68286  		if ((uint32(_pIdx.XidxType>>7) << 31) >> 31) != 0 {
 68287  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103155), unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000), unsafe.Pointer(str(86872)))
 68288  			crt.X__builtin_abort(tls)
 68289  		}
 68290  	}()
 68291  	*elem52(_a, 0) = (*XTable)(_pIdx.XpTable).XnRowLogEst
 68292  	if (*XExpr)(_pIdx.XpPartIdxWhere) != nil {
 68293  		{
 68294  			p := elem52(_a, 0)
 68295  			*p = int16(int32(*p) - int32(10))
 68296  		}
 68297  	}
 68298  	func() {
 68299  		if int32(10) != int32(_sqlite3LogEst(tls, uint64(2))) {
 68300  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103161), unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000), unsafe.Pointer(str(86888)))
 68301  			crt.X__builtin_abort(tls)
 68302  		}
 68303  	}()
 68304  	if int32(*elem52(_a, 0)) < int32(33) {
 68305  		*elem52(_a, 0) = int16(33)
 68306  	}
 68307  	func() {
 68308  		if int32(33) != int32(_sqlite3LogEst(tls, uint64(10))) {
 68309  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103162), unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000), unsafe.Pointer(str(86909)))
 68310  			crt.X__builtin_abort(tls)
 68311  		}
 68312  	}()
 68313  	crt.Xmemcpy(tls, unsafe.Pointer(elem52(_a, uintptr(1))), unsafe.Pointer(&_aVal), uint64(_nCopy)*uint64(2))
 68314  	_i = _nCopy + int32(1)
 68315  _10:
 68316  	if _i > int32(_pIdx.XnKeyCol) {
 68317  		goto _13
 68318  	}
 68319  	*elem52(_a, uintptr(_i)) = int16(23)
 68320  	func() {
 68321  		if int32(23) != int32(_sqlite3LogEst(tls, uint64(5))) {
 68322  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103168), unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000), unsafe.Pointer(str(86931)))
 68323  			crt.X__builtin_abort(tls)
 68324  		}
 68325  	}()
 68326  	_i += 1
 68327  	goto _10
 68328  _13:
 68329  	func() {
 68330  		if int32(0) != int32(_sqlite3LogEst(tls, uint64(1))) {
 68331  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103171), unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000), unsafe.Pointer(str(46336)))
 68332  			crt.X__builtin_abort(tls)
 68333  		}
 68334  	}()
 68335  	if int32(_pIdx.XonError) != int32(0) {
 68336  		*elem52(_a, uintptr(_pIdx.XnKeyCol)) = 0
 68337  	}
 68338  	_ = _aVal
 68339  }
 68340  
 68341  var _sqlite3DefaultRowEstØ00__func__Ø000 [21]int8
 68342  
 68343  func init() {
 68344  	crt.Xstrncpy(nil, &_sqlite3DefaultRowEstØ00__func__Ø000[0], str(86952), 21)
 68345  }
 68346  
 68347  // C comment
 68348  //  /*
 68349  //  ** Unlink the given table from the hash tables and the delete the
 68350  //  ** table structure with all its indices and foreign keys.
 68351  //  */
 68352  func _sqlite3UnlinkAndDeleteTable(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTabName *int8) {
 68353  	var _pDb *XDb
 68354  	var _p *XTable
 68355  	func() {
 68356  		if _db == nil {
 68357  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100356), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000), unsafe.Pointer(str(1219)))
 68358  			crt.X__builtin_abort(tls)
 68359  		}
 68360  	}()
 68361  	func() {
 68362  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 68363  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100357), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000), unsafe.Pointer(str(21693)))
 68364  			crt.X__builtin_abort(tls)
 68365  		}
 68366  	}()
 68367  	func() {
 68368  		if _zTabName == nil {
 68369  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100358), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000), unsafe.Pointer(str(86973)))
 68370  			crt.X__builtin_abort(tls)
 68371  		}
 68372  	}()
 68373  	func() {
 68374  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 68375  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100359), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000), unsafe.Pointer(str(51126)))
 68376  			crt.X__builtin_abort(tls)
 68377  		}
 68378  	}()
 68379  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 68380  	_p = (*XTable)(_sqlite3HashInsert(tls, &((*XSchema)(_pDb.XpSchema).XtblHash), _zTabName, nil))
 68381  	_sqlite3DeleteTable(tls, _db, _p)
 68382  	_db.Xflags |= int32(2)
 68383  }
 68384  
 68385  var _sqlite3UnlinkAndDeleteTableØ00__func__Ø000 [28]int8
 68386  
 68387  func init() {
 68388  	crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteTableØ00__func__Ø000[0], str(86982), 28)
 68389  }
 68390  
 68391  // C comment
 68392  //  /*
 68393  //  ** For the index called zIdxName which is found in the database iDb,
 68394  //  ** unlike that index from its Table then remove the index from
 68395  //  ** the index hash table and free all memory structures associated
 68396  //  ** with the index.
 68397  //  */
 68398  func _sqlite3UnlinkAndDeleteIndex(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zIdxName *int8) {
 68399  	var _pHash *XHash
 68400  	var _pIndex, _3_p *XIndex
 68401  	func() {
 68402  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 68403  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100160), unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000), unsafe.Pointer(str(51126)))
 68404  			crt.X__builtin_abort(tls)
 68405  		}
 68406  	}()
 68407  	_pHash = &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XidxHash)
 68408  	_pIndex = (*XIndex)(_sqlite3HashInsert(tls, _pHash, _zIdxName, nil))
 68409  	if func() int32 {
 68410  		if _pIndex != nil {
 68411  			return int32(1)
 68412  		}
 68413  		return func() int32 {
 68414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100163), unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 68415  			crt.X__builtin_abort(tls)
 68416  			return int32(0)
 68417  		}()
 68418  	}() == 0 {
 68419  		goto _4
 68420  	}
 68421  	if (*XIndex)((*XTable)(_pIndex.XpTable).XpIndex) == _pIndex {
 68422  		*(**XIndex)(unsafe.Pointer(&((*XTable)(_pIndex.XpTable).XpIndex))) = (*XIndex)(_pIndex.XpNext)
 68423  		goto _6
 68424  	}
 68425  	_3_p = (*XIndex)((*XTable)(_pIndex.XpTable).XpIndex)
 68426  _7:
 68427  	if func() int32 {
 68428  		if _3_p != nil {
 68429  			return int32(1)
 68430  		}
 68431  		return func() int32 {
 68432  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100171), unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 68433  			crt.X__builtin_abort(tls)
 68434  			return int32(0)
 68435  		}()
 68436  	}() != 0 && ((*XIndex)(_3_p.XpNext) != _pIndex) {
 68437  		_3_p = (*XIndex)(_3_p.XpNext)
 68438  		goto _7
 68439  	}
 68440  	if func() int32 {
 68441  		if (_3_p != nil) && ((*XIndex)(_3_p.XpNext) == _pIndex) {
 68442  			return int32(1)
 68443  		}
 68444  		return func() int32 {
 68445  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100172), unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 68446  			crt.X__builtin_abort(tls)
 68447  			return int32(0)
 68448  		}()
 68449  	}() != 0 {
 68450  		*(**XIndex)(unsafe.Pointer(&_3_p.XpNext)) = (*XIndex)(_pIndex.XpNext)
 68451  	}
 68452  _6:
 68453  	_freeIndex(tls, _db, _pIndex)
 68454  _4:
 68455  	_db.Xflags |= int32(2)
 68456  }
 68457  
 68458  var _sqlite3UnlinkAndDeleteIndexØ00__func__Ø000 [28]int8
 68459  
 68460  func init() {
 68461  	crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000[0], str(87010), 28)
 68462  }
 68463  
 68464  // C comment
 68465  //  /*
 68466  //  ** Remove a trigger from the hash tables of the sqlite* pointer.
 68467  //  */
 68468  func _sqlite3UnlinkAndDeleteTrigger(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zName *int8) {
 68469  	var _pHash *XHash
 68470  	var _pTrigger *XTrigger
 68471  	var _2_pTab *XTable
 68472  	var _2_pp **XTrigger
 68473  	func() {
 68474  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 68475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123220), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000), unsafe.Pointer(str(51126)))
 68476  			crt.X__builtin_abort(tls)
 68477  		}
 68478  	}()
 68479  	_pHash = &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XtrigHash)
 68480  	_pTrigger = (*XTrigger)(_sqlite3HashInsert(tls, _pHash, _zName, nil))
 68481  	if func() int32 {
 68482  		if _pTrigger != nil {
 68483  			return int32(1)
 68484  		}
 68485  		return func() int32 {
 68486  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123223), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000), unsafe.Pointer(str(4809)))
 68487  			crt.X__builtin_abort(tls)
 68488  			return int32(0)
 68489  		}()
 68490  	}() == 0 {
 68491  		goto _4
 68492  	}
 68493  	if (*XSchema)(_pTrigger.XpSchema) != (*XSchema)(_pTrigger.XpTabSchema) {
 68494  		goto _5
 68495  	}
 68496  	_2_pTab = _tableOfTrigger(tls, _pTrigger)
 68497  	_2_pp = (**XTrigger)(unsafe.Pointer(&_2_pTab.XpTrigger))
 68498  _6:
 68499  	if (*_2_pp) == _pTrigger {
 68500  		goto _9
 68501  	}
 68502  	_2_pp = (**XTrigger)(unsafe.Pointer(&((*_2_pp).XpNext)))
 68503  	goto _6
 68504  _9:
 68505  	*_2_pp = (*XTrigger)((*_2_pp).XpNext)
 68506  _5:
 68507  	_sqlite3DeleteTrigger(tls, _db, _pTrigger)
 68508  	_db.Xflags |= int32(2)
 68509  _4:
 68510  }
 68511  
 68512  var _sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000 [30]int8
 68513  
 68514  func init() {
 68515  	crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000[0], str(87038), 30)
 68516  }
 68517  
 68518  // C comment
 68519  //  /*
 68520  //  ** Return a pointer to the Table structure for the table that a trigger
 68521  //  ** is set on.
 68522  //  */
 68523  func _tableOfTrigger(tls *crt.TLS, _pTrigger *XTrigger) (r0 *XTable) {
 68524  	return (*XTable)(_sqlite3HashFind(tls, &((*XSchema)(_pTrigger.XpTabSchema).XtblHash), _pTrigger.Xtable))
 68525  }
 68526  
 68527  // C comment
 68528  //  /*
 68529  //  ** This routine does a complete check of the given BTree file.  aRoot[] is
 68530  //  ** an array of pages numbers were each page number is the root page of
 68531  //  ** a table.  nRoot is the number of entries in aRoot.
 68532  //  **
 68533  //  ** A read-only or read-write transaction must be opened before calling
 68534  //  ** this function.
 68535  //  **
 68536  //  ** Write the number of error seen in *pnErr.  Except for some memory
 68537  //  ** allocation errors,  an error message held in memory obtained from
 68538  //  ** malloc is returned if *pnErr is non-zero.  If *pnErr==0 then NULL is
 68539  //  ** returned.  If a memory allocation error occurs, NULL is returned.
 68540  //  */
 68541  func _sqlite3BtreeIntegrityCheck(tls *crt.TLS, _p *XBtree, _aRoot *int32, _nRoot int32, _mxErr int32, _pnErr *int32) (r0 *int8) {
 68542  	var _savedDbFlags, _nRef int32
 68543  	var _4_notUsed int64
 68544  	var _i uint32
 68545  	var _zErr [100]int8
 68546  	var _pBt *XBtShared
 68547  	var _sCheck XIntegrityCk
 68548  	_pBt = (*XBtShared)(_p.XpBt)
 68549  	_savedDbFlags = (*Xsqlite3)(_pBt.Xdb).Xflags
 68550  	_sqlite3BtreeEnter(tls, _p)
 68551  	func() {
 68552  		if int32(_p.XinTrans) <= int32(0) || int32(_pBt.XinTransaction) <= int32(0) {
 68553  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68515), unsafe.Pointer(&_sqlite3BtreeIntegrityCheckØ00__func__Ø000), unsafe.Pointer(str(87068)))
 68554  			crt.X__builtin_abort(tls)
 68555  		}
 68556  	}()
 68557  	_nRef = _sqlite3PagerRefcount(tls, (*XPager)(_pBt.XpPager))
 68558  	func() {
 68559  		if _nRef < int32(0) {
 68560  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68517), unsafe.Pointer(&_sqlite3BtreeIntegrityCheckØ00__func__Ø000), unsafe.Pointer(str(87123)))
 68561  			crt.X__builtin_abort(tls)
 68562  		}
 68563  	}()
 68564  	*(**XBtShared)(unsafe.Pointer(&_sCheck.XpBt)) = _pBt
 68565  	*(**XPager)(unsafe.Pointer(&_sCheck.XpPager)) = (*XPager)(_pBt.XpPager)
 68566  	_sCheck.XnPage = _btreePagecount(tls, (*XBtShared)(_sCheck.XpBt))
 68567  	_sCheck.XmxErr = _mxErr
 68568  	_sCheck.XnErr = int32(0)
 68569  	_sCheck.XmallocFailed = int32(0)
 68570  	_sCheck.XzPfx = nil
 68571  	_sCheck.Xv1 = int32(0)
 68572  	_sCheck.Xv2 = int32(0)
 68573  	_sCheck.XaPgRef = nil
 68574  	_sCheck.Xheap = nil
 68575  	_sqlite3StrAccumInit(tls, &_sCheck.XerrMsg, nil, (*int8)(unsafe.Pointer(&_zErr)), int32(100), int32(1000000000))
 68576  	_sCheck.XerrMsg.XprintfFlags = uint8(1)
 68577  	if _sCheck.XnPage == (0) {
 68578  		goto _integrity_ck_cleanup
 68579  	}
 68580  	_sCheck.XaPgRef = (*uint8)(_sqlite3MallocZero(tls, uint64((_sCheck.XnPage/uint32(8))+uint32(1))))
 68581  	if _sCheck.XaPgRef == nil {
 68582  		_sCheck.XmallocFailed = int32(1)
 68583  		goto _integrity_ck_cleanup
 68584  	}
 68585  	_sCheck.Xheap = (*uint32)(_sqlite3PageMalloc(tls, int32(_pBt.XpageSize)))
 68586  	if _sCheck.Xheap == nil {
 68587  		_sCheck.XmallocFailed = int32(1)
 68588  		goto _integrity_ck_cleanup
 68589  	}
 68590  	_i = (uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)
 68591  	if _i <= _sCheck.XnPage {
 68592  		_setPageReferenced(tls, &_sCheck, _i)
 68593  	}
 68594  	_sCheck.XzPfx = str(87131)
 68595  	_checkList(tls, &_sCheck, int32(1), int32(_sqlite3Get4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(32)))), int32(_sqlite3Get4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(36)))))
 68596  	_sCheck.XzPfx = nil
 68597  	(*Xsqlite3)(_pBt.Xdb).Xflags &= int32(-536870913)
 68598  	_i = 0
 68599  _9:
 68600  	if int32(_i) >= _nRoot || _sCheck.XmxErr == 0 {
 68601  		goto _13
 68602  	}
 68603  	if (*elem8(_aRoot, uintptr(_i))) == int32(0) {
 68604  		goto _10
 68605  	}
 68606  	if (_pBt.XautoVacuum != 0) && ((*elem8(_aRoot, uintptr(_i))) > int32(1)) {
 68607  		_checkPtrmap(tls, &_sCheck, uint32(*elem8(_aRoot, uintptr(_i))), uint8(1), 0)
 68608  	}
 68609  	_checkTreePage(tls, &_sCheck, *elem8(_aRoot, uintptr(_i)), &_4_notUsed, int64(9223372036854775807))
 68610  _10:
 68611  	_i += 1
 68612  	goto _9
 68613  _13:
 68614  	(*Xsqlite3)(_pBt.Xdb).Xflags = _savedDbFlags
 68615  	_i = uint32(1)
 68616  _17:
 68617  	if _i > _sCheck.XnPage || _sCheck.XmxErr == 0 {
 68618  		goto _integrity_ck_cleanup
 68619  	}
 68620  	if (_getPageReferenced(tls, &_sCheck, _i) == int32(0)) && ((_ptrmapPageno(tls, _pBt, _i) != _i) || (_pBt.XautoVacuum == 0)) {
 68621  		_checkAppendMsg(tls, &_sCheck, str(87147), _i)
 68622  	}
 68623  	if (_getPageReferenced(tls, &_sCheck, _i) != int32(0)) && ((_ptrmapPageno(tls, _pBt, _i) == _i) && (_pBt.XautoVacuum != 0)) {
 68624  		_checkAppendMsg(tls, &_sCheck, str(87169), _i)
 68625  	}
 68626  	_i += 1
 68627  	goto _17
 68628  _integrity_ck_cleanup:
 68629  	_sqlite3PageFree(tls, unsafe.Pointer(_sCheck.Xheap))
 68630  	Xsqlite3_free(tls, unsafe.Pointer(_sCheck.XaPgRef))
 68631  	if _sCheck.XmallocFailed != 0 {
 68632  		_sqlite3StrAccumReset(tls, &_sCheck.XerrMsg)
 68633  		_sCheck.XnErr += 1
 68634  	}
 68635  	*_pnErr = _sCheck.XnErr
 68636  	if _sCheck.XnErr == int32(0) {
 68637  		_sqlite3StrAccumReset(tls, &_sCheck.XerrMsg)
 68638  	}
 68639  	func() {
 68640  		if _nRef != _sqlite3PagerRefcount(tls, (*XPager)(_pBt.XpPager)) {
 68641  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68606), unsafe.Pointer(&_sqlite3BtreeIntegrityCheckØ00__func__Ø000), unsafe.Pointer(str(87203)))
 68642  			crt.X__builtin_abort(tls)
 68643  		}
 68644  	}()
 68645  	_sqlite3BtreeLeave(tls, _p)
 68646  	return _sqlite3StrAccumFinish(tls, &_sCheck.XerrMsg)
 68647  
 68648  	_ = _zErr
 68649  	panic(0)
 68650  }
 68651  
 68652  var _sqlite3BtreeIntegrityCheckØ00__func__Ø000 [27]int8
 68653  
 68654  func init() {
 68655  	crt.Xstrncpy(nil, &_sqlite3BtreeIntegrityCheckØ00__func__Ø000[0], str(87243), 27)
 68656  }
 68657  
 68658  // C comment
 68659  //  /*
 68660  //  ** Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg.
 68661  //  */
 68662  func _setPageReferenced(tls *crt.TLS, _pCheck *XIntegrityCk, _iPg uint32) {
 68663  	func() {
 68664  		if _iPg > _pCheck.XnPage || int32(1) == 0 {
 68665  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68037), unsafe.Pointer(&_setPageReferencedØ00__func__Ø000), unsafe.Pointer(str(87270)))
 68666  			crt.X__builtin_abort(tls)
 68667  		}
 68668  	}()
 68669  	{
 68670  		p := elem15(_pCheck.XaPgRef, uintptr(_iPg/uint32(8)))
 68671  		*p = uint8(int32(*p) | (int32(1) << uint(int32(_iPg&uint32(7)))))
 68672  	}
 68673  }
 68674  
 68675  var _setPageReferencedØ00__func__Ø000 [18]int8
 68676  
 68677  func init() {
 68678  	crt.Xstrncpy(nil, &_setPageReferencedØ00__func__Ø000[0], str(87321), 18)
 68679  }
 68680  
 68681  // C comment
 68682  //  /*
 68683  //  ** Check the integrity of the freelist or of an overflow page list.
 68684  //  ** Verify that the number of pages on the list is N.
 68685  //  */
 68686  func _checkList(tls *crt.TLS, _pCheck *XIntegrityCk, _isFreeList int32, _iPage int32, _N int32) {
 68687  	var _i, _expected, _iFirst, _4_n int32
 68688  	var _8_iFreePage uint32
 68689  	var _1_pOvflData *uint8
 68690  	var _1_pOvflPage *XPgHdr
 68691  	_expected = _N
 68692  	_iFirst = _iPage
 68693  _0:
 68694  	if postInc2(&_N, -1) <= int32(0) || _pCheck.XmxErr == 0 {
 68695  		goto _1
 68696  	}
 68697  	if _iPage < int32(1) {
 68698  		_checkAppendMsg(tls, _pCheck, str(87339), _N+int32(1), _expected, _iFirst)
 68699  		goto _1
 68700  	}
 68701  	if _checkRef(tls, _pCheck, uint32(_iPage)) != 0 {
 68702  		goto _1
 68703  	}
 68704  	if _sqlite3PagerGet(tls, (*XPager)(_pCheck.XpPager), uint32(_iPage), &_1_pOvflPage, int32(0)) != 0 {
 68705  		_checkAppendMsg(tls, _pCheck, str(87396), _iPage)
 68706  		goto _1
 68707  	}
 68708  	_1_pOvflData = (*uint8)(_sqlite3PagerGetData(tls, _1_pOvflPage))
 68709  	if _isFreeList == 0 {
 68710  		goto _6
 68711  	}
 68712  	_4_n = int32(_sqlite3Get4byte(tls, elem15(_1_pOvflData, uintptr(4))))
 68713  	if ((*XBtShared)(_pCheck.XpBt).XautoVacuum) != 0 {
 68714  		_checkPtrmap(tls, _pCheck, uint32(_iPage), uint8(2), 0)
 68715  	}
 68716  	if _4_n > ((int32((*XBtShared)(_pCheck.XpBt).XusableSize) / int32(4)) - int32(2)) {
 68717  		_checkAppendMsg(tls, _pCheck, str(87418), _iPage)
 68718  		_N -= 1
 68719  		goto _9
 68720  	}
 68721  	_i = int32(0)
 68722  _10:
 68723  	if _i >= _4_n {
 68724  		goto _13
 68725  	}
 68726  	_8_iFreePage = _sqlite3Get4byte(tls, elem15(_1_pOvflData, uintptr(int32(8)+(_i*int32(4)))))
 68727  	if ((*XBtShared)(_pCheck.XpBt).XautoVacuum) != 0 {
 68728  		_checkPtrmap(tls, _pCheck, _8_iFreePage, uint8(2), 0)
 68729  	}
 68730  	_checkRef(tls, _pCheck, _8_iFreePage)
 68731  	_i += 1
 68732  	goto _10
 68733  _13:
 68734  	_N -= _4_n
 68735  _9:
 68736  	goto _15
 68737  _6:
 68738  	if (((*XBtShared)(_pCheck.XpBt).XautoVacuum) != 0) && (_N > int32(0)) {
 68739  		_i = int32(_sqlite3Get4byte(tls, _1_pOvflData))
 68740  		_checkPtrmap(tls, _pCheck, uint32(_i), uint8(4), uint32(_iPage))
 68741  	}
 68742  _15:
 68743  	_iPage = int32(_sqlite3Get4byte(tls, _1_pOvflData))
 68744  	_sqlite3PagerUnref(tls, _1_pOvflPage)
 68745  	if _isFreeList != 0 && (_N < bool2int(_iPage != int32(0))) {
 68746  		_checkAppendMsg(tls, _pCheck, str(87457))
 68747  	}
 68748  	goto _0
 68749  _1:
 68750  }
 68751  
 68752  // C comment
 68753  //  /*
 68754  //  ** Append a message to the error message string.
 68755  //  */
 68756  func _checkAppendMsg(tls *crt.TLS, _pCheck *XIntegrityCk, _zFormat *int8, args ...interface{}) {
 68757  	var _ap []interface{}
 68758  	if _pCheck.XmxErr == 0 {
 68759  		return
 68760  	}
 68761  	_pCheck.XmxErr -= 1
 68762  	_pCheck.XnErr += 1
 68763  	_ap = args
 68764  	if (_pCheck.XerrMsg.XnChar) != 0 {
 68765  		_sqlite3StrAccumAppend(tls, &_pCheck.XerrMsg, str(37655), int32(1))
 68766  	}
 68767  	if _pCheck.XzPfx != nil {
 68768  		_sqlite3XPrintf(tls, &_pCheck.XerrMsg, _pCheck.XzPfx, _pCheck.Xv1, _pCheck.Xv2)
 68769  	}
 68770  	_sqlite3VXPrintf(tls, &_pCheck.XerrMsg, _zFormat, _ap)
 68771  	_ap = nil
 68772  	if int32(_pCheck.XerrMsg.XaccError) == int32(1) {
 68773  		_pCheck.XmallocFailed = int32(1)
 68774  	}
 68775  }
 68776  
 68777  // C comment
 68778  //  /*
 68779  //  ** Add 1 to the reference count for page iPage.  If this is the second
 68780  //  ** reference to the page, add an error message to pCheck->zErrMsg.
 68781  //  ** Return 1 if there are 2 or more references to the page and 0 if
 68782  //  ** if this is the first reference to the page.
 68783  //  **
 68784  //  ** Also check that the page number is in bounds.
 68785  //  */
 68786  func _checkRef(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage uint32) (r0 int32) {
 68787  	if _iPage == (0) {
 68788  		return int32(1)
 68789  	}
 68790  	if _iPage > _pCheck.XnPage {
 68791  		_checkAppendMsg(tls, _pCheck, str(87496), _iPage)
 68792  		return int32(1)
 68793  	}
 68794  	if _getPageReferenced(tls, _pCheck, _iPage) != 0 {
 68795  		_checkAppendMsg(tls, _pCheck, str(87519), _iPage)
 68796  		return int32(1)
 68797  	}
 68798  	_setPageReferenced(tls, _pCheck, _iPage)
 68799  	return int32(0)
 68800  }
 68801  
 68802  // C comment
 68803  //  /*
 68804  //  ** Return non-zero if the bit in the IntegrityCk.aPgRef[] array that
 68805  //  ** corresponds to page iPg is already set.
 68806  //  */
 68807  func _getPageReferenced(tls *crt.TLS, _pCheck *XIntegrityCk, _iPg uint32) (r0 int32) {
 68808  	func() {
 68809  		if _iPg > _pCheck.XnPage || int32(1) == 0 {
 68810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68029), unsafe.Pointer(&_getPageReferencedØ00__func__Ø000), unsafe.Pointer(str(87270)))
 68811  			crt.X__builtin_abort(tls)
 68812  		}
 68813  	}()
 68814  	return int32(*elem15(_pCheck.XaPgRef, uintptr(_iPg/uint32(8)))) & (int32(1) << uint(int32(_iPg&uint32(7))))
 68815  }
 68816  
 68817  var _getPageReferencedØ00__func__Ø000 [18]int8
 68818  
 68819  func init() {
 68820  	crt.Xstrncpy(nil, &_getPageReferencedØ00__func__Ø000[0], str(87544), 18)
 68821  }
 68822  
 68823  // C comment
 68824  //  /*
 68825  //  ** Check that the entry in the pointer-map for page iChild maps to
 68826  //  ** page iParent, pointer type ptrType. If not, append an error message
 68827  //  ** to pCheck.
 68828  //  */
 68829  func _checkPtrmap(tls *crt.TLS, _pCheck *XIntegrityCk, _iChild uint32, _eType uint8, _iParent uint32) {
 68830  	var _rc int32
 68831  	var _iPtrmapParent uint32
 68832  	var _ePtrmapType uint8
 68833  	_rc = _ptrmapGet(tls, (*XBtShared)(_pCheck.XpBt), _iChild, &_ePtrmapType, &_iPtrmapParent)
 68834  	if _rc == int32(0) {
 68835  		goto _0
 68836  	}
 68837  	if (_rc == int32(7)) || (_rc == int32(3082)) {
 68838  		_pCheck.XmallocFailed = int32(1)
 68839  	}
 68840  	_checkAppendMsg(tls, _pCheck, str(87562), _iChild)
 68841  	return
 68842  _0:
 68843  	if (int32(_ePtrmapType) != int32(_eType)) || (_iPtrmapParent != _iParent) {
 68844  		_checkAppendMsg(tls, _pCheck, str(87591), _iChild, int32(_eType), _iParent, int32(_ePtrmapType), _iPtrmapParent)
 68845  	}
 68846  }
 68847  
 68848  // C comment
 68849  //  /*
 68850  //  ** Do various sanity checks on a single page of a tree.  Return
 68851  //  ** the tree depth.  Root pages return 0.  Parents of root pages
 68852  //  ** return 1, and so forth.
 68853  //  **
 68854  //  ** These checks are done:
 68855  //  **
 68856  //  **      1.  Make sure that cells and freeblocks do not overlap
 68857  //  **          but combine to completely cover the page.
 68858  //  **      2.  Make sure integer cell keys are in order.
 68859  //  **      3.  Check the integrity of overflow pages.
 68860  //  **      4.  Recursively call checkTreePage on all children.
 68861  //  **      5.  Verify that the depth of all children is the same.
 68862  //  */
 68863  func _checkTreePage(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage int32, _piMinKey *int64, _maxKey int64) (r0 int32) {
 68864  	var _i, _rc, _depth, _d2, _pgno, _nFrag, _hdr, _cellStart, _nCell, _doCoverageCheck, _keyCanBeEqual, _saved_v1, _saved_v2, _11_nPage, _20_size, _20_j int32
 68865  	var _pc, _usableSize, _contentOffset, _x, _prev, _11_pgnoOvfl, _19_size uint32
 68866  	var _saved_zPfx *int8
 68867  	var _savedIsInit uint8
 68868  	var _data, _pCell, _pCellIdx *uint8
 68869  	var _heap *uint32
 68870  	var _pBt *XBtShared
 68871  	var _6_info XCellInfo
 68872  	var _pPage *XMemPage
 68873  	_pPage = nil
 68874  	_depth = int32(-1)
 68875  	_doCoverageCheck = int32(1)
 68876  	_keyCanBeEqual = int32(1)
 68877  	_heap = nil
 68878  	_prev = uint32(0)
 68879  	_saved_zPfx = _pCheck.XzPfx
 68880  	_saved_v1 = _pCheck.Xv1
 68881  	_saved_v2 = _pCheck.Xv2
 68882  	_savedIsInit = uint8(0)
 68883  	_pBt = (*XBtShared)(_pCheck.XpBt)
 68884  	_usableSize = _pBt.XusableSize
 68885  	if _iPage == int32(0) {
 68886  		return int32(0)
 68887  	}
 68888  	if _checkRef(tls, _pCheck, uint32(_iPage)) != 0 {
 68889  		return int32(0)
 68890  	}
 68891  	_pCheck.XzPfx = str(87645)
 68892  	_pCheck.Xv1 = _iPage
 68893  	if store2(&_rc, _btreeGetPage(tls, _pBt, uint32(_iPage), &_pPage, int32(0))) != int32(0) {
 68894  		_checkAppendMsg(tls, _pCheck, str(87655), _rc)
 68895  		goto _end_of_check
 68896  	}
 68897  	_savedIsInit = _pPage.XisInit
 68898  	_pPage.XisInit = 0
 68899  	if store2(&_rc, _btreeInitPage(tls, _pPage)) != int32(0) {
 68900  		func() {
 68901  			if _rc != int32(11) {
 68902  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68286), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87693)))
 68903  				crt.X__builtin_abort(tls)
 68904  			}
 68905  		}()
 68906  		_checkAppendMsg(tls, _pCheck, str(87712), _rc)
 68907  		goto _end_of_check
 68908  	}
 68909  	_data = _pPage.XaData
 68910  	_hdr = int32(_pPage.XhdrOffset)
 68911  	_pCheck.XzPfx = str(87750)
 68912  	_contentOffset = uint32(((((int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), uintptr(1)))) - int32(1)) & int32(65535)) + int32(1))
 68913  	func() {
 68914  		if _contentOffset > _usableSize {
 68915  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68297), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87776)))
 68916  			crt.X__builtin_abort(tls)
 68917  		}
 68918  	}()
 68919  	_nCell = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(3))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(3))), uintptr(1)))
 68920  	func() {
 68921  		if int32(_pPage.XnCell) != _nCell {
 68922  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68302), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87802)))
 68923  			crt.X__builtin_abort(tls)
 68924  		}
 68925  	}()
 68926  	_cellStart = (_hdr + int32(12)) - (int32(4) * int32(_pPage.Xleaf))
 68927  	func() {
 68928  		if _pPage.XaCellIdx != elem15(_data, uintptr(_cellStart)) {
 68929  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68307), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87822)))
 68930  			crt.X__builtin_abort(tls)
 68931  		}
 68932  	}()
 68933  	_pCellIdx = elem15(_data, uintptr(_cellStart+(int32(2)*(_nCell-int32(1)))))
 68934  	if _pPage.Xleaf != 0 {
 68935  		goto _12
 68936  	}
 68937  	_pgno = int32(_sqlite3Get4byte(tls, elem15(_data, uintptr(_hdr+int32(8)))))
 68938  	if _pBt.XautoVacuum != 0 {
 68939  		_pCheck.XzPfx = str(87856)
 68940  		_checkPtrmap(tls, _pCheck, uint32(_pgno), uint8(5), uint32(_iPage))
 68941  	}
 68942  	_depth = _checkTreePage(tls, _pCheck, _pgno, &_maxKey, _maxKey)
 68943  	_keyCanBeEqual = int32(0)
 68944  	goto _14
 68945  _12:
 68946  	_heap = _pCheck.Xheap
 68947  	*elem31(_heap, 0) = 0
 68948  _14:
 68949  	_i = _nCell - int32(1)
 68950  _15:
 68951  	if _i < int32(0) || _pCheck.XmxErr == 0 {
 68952  		goto _19
 68953  	}
 68954  	_pCheck.Xv2 = _i
 68955  	func() {
 68956  		if _pCellIdx != elem15(_data, uintptr(_cellStart+(_i*int32(2)))) {
 68957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68335), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87884)))
 68958  			crt.X__builtin_abort(tls)
 68959  		}
 68960  	}()
 68961  	_pc = uint32((int32(*elem15(_pCellIdx, 0)) << 8) | int32(*elem15(_pCellIdx, uintptr(1))))
 68962  	*(*uintptr)(unsafe.Pointer(&_pCellIdx)) -= uintptr(int32(2))
 68963  	if (_pc < _contentOffset) || (_pc > (_usableSize - uint32(4))) {
 68964  		_checkAppendMsg(tls, _pCheck, str(87917), _pc, _contentOffset, _usableSize-uint32(4))
 68965  		_doCoverageCheck = int32(0)
 68966  		goto _16
 68967  	}
 68968  	_pCell = elem15(_data, uintptr(_pc))
 68969  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 68970  		v := _pPage.XxParseCell
 68971  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 68972  	}()(tls, _pPage, _pCell, &_6_info)
 68973  	if (_pc + uint32(_6_info.XnSize)) > _usableSize {
 68974  		_checkAppendMsg(tls, _pCheck, str(87947))
 68975  		_doCoverageCheck = int32(0)
 68976  		goto _16
 68977  	}
 68978  	if _pPage.XintKey == 0 {
 68979  		goto _25
 68980  	}
 68981  	if func() int32 {
 68982  		if _keyCanBeEqual != 0 {
 68983  			return bool2int(_6_info.XnKey > _maxKey)
 68984  		}
 68985  		return bool2int(_6_info.XnKey >= _maxKey)
 68986  	}() != 0 {
 68987  		_checkAppendMsg(tls, _pCheck, str(87971), _6_info.XnKey)
 68988  	}
 68989  	_maxKey = _6_info.XnKey
 68990  	_keyCanBeEqual = int32(0)
 68991  _25:
 68992  	if _6_info.XnPayload <= uint32(_6_info.XnLocal) {
 68993  		goto _29
 68994  	}
 68995  	func() {
 68996  		if ((_pc + uint32(_6_info.XnSize)) - uint32(4)) > _usableSize {
 68997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68365), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87995)))
 68998  			crt.X__builtin_abort(tls)
 68999  		}
 69000  	}()
 69001  	_11_nPage = int32((((_6_info.XnPayload - uint32(_6_info.XnLocal)) + _usableSize) - uint32(5)) / (_usableSize - uint32(4)))
 69002  	_11_pgnoOvfl = _sqlite3Get4byte(tls, elem15(_pCell, uintptr(int32(_6_info.XnSize)-int32(4))))
 69003  	if _pBt.XautoVacuum != 0 {
 69004  		_checkPtrmap(tls, _pCheck, _11_pgnoOvfl, uint8(3), uint32(_iPage))
 69005  	}
 69006  	_checkList(tls, _pCheck, int32(0), int32(_11_pgnoOvfl), _11_nPage)
 69007  _29:
 69008  	if _pPage.Xleaf != 0 {
 69009  		goto _33
 69010  	}
 69011  	_pgno = int32(_sqlite3Get4byte(tls, _pCell))
 69012  	if _pBt.XautoVacuum != 0 {
 69013  		_checkPtrmap(tls, _pCheck, uint32(_pgno), uint8(5), uint32(_iPage))
 69014  	}
 69015  	_d2 = _checkTreePage(tls, _pCheck, _pgno, &_maxKey, _maxKey)
 69016  	_keyCanBeEqual = int32(0)
 69017  	if _d2 != _depth {
 69018  		_checkAppendMsg(tls, _pCheck, str(88029))
 69019  		_depth = _d2
 69020  	}
 69021  	goto _36
 69022  _33:
 69023  	_btreeHeapInsert(tls, _heap, (_pc<<16)|((_pc+uint32(_6_info.XnSize))-uint32(1)))
 69024  _36:
 69025  _16:
 69026  	_i -= 1
 69027  	goto _15
 69028  _19:
 69029  	*_piMinKey = _maxKey
 69030  	_pCheck.XzPfx = nil
 69031  	if _doCoverageCheck == 0 || _pCheck.XmxErr <= int32(0) {
 69032  		goto _end_of_check
 69033  	}
 69034  	if _pPage.Xleaf != 0 {
 69035  		goto _39
 69036  	}
 69037  	_heap = _pCheck.Xheap
 69038  	*elem31(_heap, 0) = 0
 69039  	_i = _nCell - int32(1)
 69040  _40:
 69041  	if _i < int32(0) {
 69042  		goto _43
 69043  	}
 69044  	_pc = uint32((int32(*elem15(elem15(_data, uintptr(_cellStart+(_i*int32(2)))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_cellStart+(_i*int32(2)))), uintptr(1))))
 69045  	_19_size = uint32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 69046  		v := _pPage.XxCellSize
 69047  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 69048  	}()(tls, _pPage, elem15(_data, uintptr(_pc))))
 69049  	_btreeHeapInsert(tls, _heap, (_pc<<16)|((_pc+_19_size)-uint32(1)))
 69050  	_i -= 1
 69051  	goto _40
 69052  _43:
 69053  _39:
 69054  	_i = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(1))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(1))), uintptr(1)))
 69055  _44:
 69056  	if _i > int32(0) {
 69057  		func() {
 69058  			if uint32(_i) > (_usableSize - uint32(4)) {
 69059  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68423), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(88054)))
 69060  				crt.X__builtin_abort(tls)
 69061  			}
 69062  		}()
 69063  		_20_size = (int32(*elem15(elem15(_data, uintptr(_i+int32(2))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_i+int32(2))), uintptr(1)))
 69064  		func() {
 69065  			if uint32(_i+_20_size) > _usableSize {
 69066  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68425), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(88075)))
 69067  				crt.X__builtin_abort(tls)
 69068  			}
 69069  		}()
 69070  		_btreeHeapInsert(tls, _heap, (uint32(_i)<<16)|uint32((_i+_20_size)-int32(1)))
 69071  		_20_j = (int32(*elem15(elem15(_data, uintptr(_i)), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_i)), uintptr(1)))
 69072  		func() {
 69073  			if _20_j != int32(0) && _20_j <= (_i+_20_size) {
 69074  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68434), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(88101)))
 69075  				crt.X__builtin_abort(tls)
 69076  			}
 69077  		}()
 69078  		func() {
 69079  			if uint32(_20_j) > (_usableSize - uint32(4)) {
 69080  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68435), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(88118)))
 69081  				crt.X__builtin_abort(tls)
 69082  			}
 69083  		}()
 69084  		_i = _20_j
 69085  		goto _44
 69086  	}
 69087  	_nFrag = int32(0)
 69088  	_prev = _contentOffset - uint32(1)
 69089  _55:
 69090  	if _btreeHeapPull(tls, _heap, &_x) == 0 {
 69091  		goto _56
 69092  	}
 69093  	if (_prev & uint32(65535)) >= (_x >> 16) {
 69094  		_checkAppendMsg(tls, _pCheck, str(88139), _x>>16, _iPage)
 69095  		goto _56
 69096  	}
 69097  	{
 69098  		p := &_nFrag
 69099  		*p = int32(uint32(*p) + (((_x >> 16) - (_prev & uint32(65535))) - uint32(1)))
 69100  	}
 69101  	_prev = _x
 69102  	goto _55
 69103  _56:
 69104  	{
 69105  		p := &_nFrag
 69106  		*p = int32(uint32(*p) + ((_usableSize - (_prev & uint32(65535))) - uint32(1)))
 69107  	}
 69108  	if ((*elem31(_heap, 0)) == (0)) && (_nFrag != int32(*elem15(_data, uintptr(_hdr+int32(7))))) {
 69109  		_checkAppendMsg(tls, _pCheck, str(88176), _nFrag, int32(*elem15(_data, uintptr(_hdr+int32(7)))), _iPage)
 69110  	}
 69111  _end_of_check:
 69112  	if _doCoverageCheck == 0 {
 69113  		_pPage.XisInit = _savedIsInit
 69114  	}
 69115  	_releasePage(tls, _pPage)
 69116  	_pCheck.XzPfx = _saved_zPfx
 69117  	_pCheck.Xv1 = _saved_v1
 69118  	_pCheck.Xv2 = _saved_v2
 69119  	return _depth + int32(1)
 69120  }
 69121  
 69122  var _checkTreePageØ00__func__Ø000 [14]int8
 69123  
 69124  func init() {
 69125  	crt.Xstrncpy(nil, &_checkTreePageØ00__func__Ø000[0], str(88228), 14)
 69126  }
 69127  
 69128  // C comment
 69129  //  /*
 69130  //  ** An implementation of a min-heap.
 69131  //  **
 69132  //  ** aHeap[0] is the number of elements on the heap.  aHeap[1] is the
 69133  //  ** root element.  The daughter nodes of aHeap[N] are aHeap[N*2]
 69134  //  ** and aHeap[N*2+1].
 69135  //  **
 69136  //  ** The heap property is this:  Every node is less than or equal to both
 69137  //  ** of its daughter nodes.  A consequence of the heap property is that the
 69138  //  ** root node aHeap[1] is always the minimum value currently in the heap.
 69139  //  **
 69140  //  ** The btreeHeapInsert() routine inserts an unsigned 32-bit number onto
 69141  //  ** the heap, preserving the heap property.  The btreeHeapPull() routine
 69142  //  ** removes the root element from the heap (the minimum value in the heap)
 69143  //  ** and then moves other nodes around as necessary to preserve the heap
 69144  //  ** property.
 69145  //  **
 69146  //  ** This heap is used for cell overlap and coverage testing.  Each u32
 69147  //  ** entry represents the span of a cell or freeblock on a btree page.
 69148  //  ** The upper 16 bits are the index of the first byte of a range and the
 69149  //  ** lower 16 bits are the index of the last byte of that range.
 69150  //  */
 69151  func _btreeHeapInsert(tls *crt.TLS, _aHeap *uint32, _x uint32) {
 69152  	var _j, _i uint32
 69153  	_i = preInc34(elem31(_aHeap, 0), uint32(1))
 69154  	*elem31(_aHeap, uintptr(_i)) = _x
 69155  _0:
 69156  	if (store34(&_j, _i/uint32(2)) > (0)) && ((*elem31(_aHeap, uintptr(_j))) > (*elem31(_aHeap, uintptr(_i)))) {
 69157  		_x = *elem31(_aHeap, uintptr(_j))
 69158  		*elem31(_aHeap, uintptr(_j)) = *elem31(_aHeap, uintptr(_i))
 69159  		*elem31(_aHeap, uintptr(_i)) = _x
 69160  		_i = _j
 69161  		goto _0
 69162  	}
 69163  }
 69164  
 69165  func _btreeHeapPull(tls *crt.TLS, _aHeap *uint32, _pOut *uint32) (r0 int32) {
 69166  	var _j, _i, _x uint32
 69167  	if store34(&_x, *elem31(_aHeap, 0)) == (0) {
 69168  		return int32(0)
 69169  	}
 69170  	*_pOut = *elem31(_aHeap, uintptr(1))
 69171  	*elem31(_aHeap, uintptr(1)) = *elem31(_aHeap, uintptr(_x))
 69172  	*elem31(_aHeap, uintptr(_x)) = uint32(4294967295)
 69173  	*elem31(_aHeap, 0) -= 1
 69174  	_i = uint32(1)
 69175  _1:
 69176  	if store34(&_j, _i*uint32(2)) > (*elem31(_aHeap, 0)) {
 69177  		goto _2
 69178  	}
 69179  	if (*elem31(_aHeap, uintptr(_j))) > (*elem31(_aHeap, uintptr(_j+uint32(1)))) {
 69180  		_j += 1
 69181  	}
 69182  	if (*elem31(_aHeap, uintptr(_i))) < (*elem31(_aHeap, uintptr(_j))) {
 69183  		goto _2
 69184  	}
 69185  	_x = *elem31(_aHeap, uintptr(_i))
 69186  	*elem31(_aHeap, uintptr(_i)) = *elem31(_aHeap, uintptr(_j))
 69187  	*elem31(_aHeap, uintptr(_j)) = _x
 69188  	_i = _j
 69189  	goto _1
 69190  _2:
 69191  	return int32(1)
 69192  }
 69193  
 69194  // C comment
 69195  //  /*
 69196  //  ** Delete any previous value and set the value of pMem to be an
 69197  //  ** empty boolean index.
 69198  //  */
 69199  func _sqlite3VdbeMemSetRowSet(tls *crt.TLS, _pMem *XMem) {
 69200  	var _db *Xsqlite3
 69201  	_db = (*Xsqlite3)(_pMem.Xdb)
 69202  	func() {
 69203  		if _db == nil {
 69204  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70429), unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000), unsafe.Pointer(str(1219)))
 69205  			crt.X__builtin_abort(tls)
 69206  		}
 69207  	}()
 69208  	func() {
 69209  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
 69210  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70430), unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000), unsafe.Pointer(str(6629)))
 69211  			crt.X__builtin_abort(tls)
 69212  		}
 69213  	}()
 69214  	_sqlite3VdbeMemRelease(tls, _pMem)
 69215  	_pMem.XzMalloc = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(64)))
 69216  	if _db.XmallocFailed != 0 {
 69217  		_pMem.Xflags = uint16(1)
 69218  		_pMem.XszMalloc = int32(0)
 69219  		goto _5
 69220  	}
 69221  	func() {
 69222  		if _pMem.XzMalloc == nil {
 69223  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70437), unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000), unsafe.Pointer(str(88242)))
 69224  			crt.X__builtin_abort(tls)
 69225  		}
 69226  	}()
 69227  	_pMem.XszMalloc = _sqlite3DbMallocSize(tls, _db, unsafe.Pointer(_pMem.XzMalloc))
 69228  	*(**XRowSet)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMem.Xu)))) = _sqlite3RowSetInit(tls, _db, unsafe.Pointer(_pMem.XzMalloc), uint32(_pMem.XszMalloc))
 69229  	func() {
 69230  		if (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_pMem.Xu))) == nil {
 69231  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70440), unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000), unsafe.Pointer(str(88256)))
 69232  			crt.X__builtin_abort(tls)
 69233  		}
 69234  	}()
 69235  	_pMem.Xflags = uint16(32)
 69236  _5:
 69237  }
 69238  
 69239  var _sqlite3VdbeMemSetRowSetØ00__func__Ø000 [24]int8
 69240  
 69241  func init() {
 69242  	crt.Xstrncpy(nil, &_sqlite3VdbeMemSetRowSetØ00__func__Ø000[0], str(88275), 24)
 69243  }
 69244  
 69245  // C comment
 69246  //  /*
 69247  //  ** Turn bulk memory into a RowSet object.  N bytes of memory
 69248  //  ** are available at pSpace.  The db pointer is used as a memory context
 69249  //  ** for any subsequent allocations that need to occur.
 69250  //  ** Return a pointer to the new RowSet object.
 69251  //  **
 69252  //  ** It must be the case that N is sufficient to make a Rowset.  If not
 69253  //  ** an assertion fault occurs.
 69254  //  **
 69255  //  ** If N is larger than the minimum, use the surplus as an initial
 69256  //  ** allocation of entries available to be filled.
 69257  //  */
 69258  func _sqlite3RowSetInit(tls *crt.TLS, _db *Xsqlite3, _pSpace unsafe.Pointer, _N uint32) (r0 *XRowSet) {
 69259  	var _p *XRowSet
 69260  	func() {
 69261  		if uint64(_N) < uint64(56) {
 69262  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46404), unsafe.Pointer(&_sqlite3RowSetInitØ00__func__Ø000), unsafe.Pointer(str(88299)))
 69263  			crt.X__builtin_abort(tls)
 69264  		}
 69265  	}()
 69266  	_p = (*XRowSet)(_pSpace)
 69267  	*(**TRowSetChunk)(unsafe.Pointer(&_p.XpChunk)) = nil
 69268  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 69269  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpEntry)) = nil
 69270  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLast)) = nil
 69271  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpForest)) = nil
 69272  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpFresh)) = (*TRowSetEntry)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(uint64(56)) + uintptr(unsafe.Pointer(_p))))))
 69273  	_p.XnFresh = uint16((uint64(_N) - uint64(56)) / uint64(24))
 69274  	_p.XrsFlags = uint16(1)
 69275  	_p.XiBatch = int32(0)
 69276  	return _p
 69277  }
 69278  
 69279  var _sqlite3RowSetInitØ00__func__Ø000 [18]int8
 69280  
 69281  func init() {
 69282  	crt.Xstrncpy(nil, &_sqlite3RowSetInitØ00__func__Ø000[0], str(88323), 18)
 69283  }
 69284  
 69285  // C comment
 69286  //  /*
 69287  //  ** Insert a new value into a RowSet.
 69288  //  **
 69289  //  ** The mallocFailed flag of the database connection is set if a
 69290  //  ** memory allocation fails.
 69291  //  */
 69292  func _sqlite3RowSetInsert(tls *crt.TLS, _p *XRowSet, _rowid int64) {
 69293  	var _pEntry, _pLast *TRowSetEntry
 69294  	func() {
 69295  		if _p == nil || (int32(_p.XrsFlags)&int32(2)) != int32(0) {
 69296  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46475), unsafe.Pointer(&_sqlite3RowSetInsertØ00__func__Ø000), unsafe.Pointer(str(88341)))
 69297  			crt.X__builtin_abort(tls)
 69298  		}
 69299  	}()
 69300  	_pEntry = _rowSetEntryAlloc(tls, _p)
 69301  	if _pEntry == nil {
 69302  		return
 69303  	}
 69304  	_pEntry.Xv = _rowid
 69305  	*(**TRowSetEntry)(unsafe.Pointer(&_pEntry.XpRight)) = nil
 69306  	_pLast = (*TRowSetEntry)(_p.XpLast)
 69307  	if _pLast == nil {
 69308  		goto _4
 69309  	}
 69310  	if _rowid <= _pLast.Xv {
 69311  		{
 69312  			p := &_p.XrsFlags
 69313  			*p = uint16(int32(*p) & int32(-2))
 69314  		}
 69315  	}
 69316  	*(**TRowSetEntry)(unsafe.Pointer(&_pLast.XpRight)) = _pEntry
 69317  	goto _6
 69318  _4:
 69319  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpEntry)) = _pEntry
 69320  _6:
 69321  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLast)) = _pEntry
 69322  }
 69323  
 69324  var _sqlite3RowSetInsertØ00__func__Ø000 [20]int8
 69325  
 69326  func init() {
 69327  	crt.Xstrncpy(nil, &_sqlite3RowSetInsertØ00__func__Ø000[0], str(88379), 20)
 69328  }
 69329  
 69330  // C comment
 69331  //  /*
 69332  //  ** Allocate a new RowSetEntry object that is associated with the
 69333  //  ** given RowSet.  Return a pointer to the new and completely uninitialized
 69334  //  ** objected.
 69335  //  **
 69336  //  ** In an OOM situation, the RowSet.db->mallocFailed flag is set and this
 69337  //  ** routine returns NULL.
 69338  //  */
 69339  func _rowSetEntryAlloc(tls *crt.TLS, _p *XRowSet) (r0 *TRowSetEntry) {
 69340  	var _1_pNew *TRowSetChunk
 69341  	func() {
 69342  		if _p == nil {
 69343  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46446), unsafe.Pointer(&_rowSetEntryAllocØ00__func__Ø000), unsafe.Pointer(str(807)))
 69344  			crt.X__builtin_abort(tls)
 69345  		}
 69346  	}()
 69347  	if int32(_p.XnFresh) != int32(0) {
 69348  		goto _2
 69349  	}
 69350  	_1_pNew = (*TRowSetChunk)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_p.Xdb), uint64(1016)))
 69351  	if _1_pNew == nil {
 69352  		return nil
 69353  	}
 69354  	*(**TRowSetChunk)(unsafe.Pointer(&_1_pNew.XpNextChunk)) = (*TRowSetChunk)(_p.XpChunk)
 69355  	*(**TRowSetChunk)(unsafe.Pointer(&_p.XpChunk)) = _1_pNew
 69356  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpFresh)) = (*TRowSetEntry)(unsafe.Pointer(&_1_pNew.XaEntry))
 69357  	_p.XnFresh = uint16(42)
 69358  _2:
 69359  	_p.XnFresh -= 1
 69360  	return postInc94((**TRowSetEntry)(unsafe.Pointer(&_p.XpFresh)), 24)
 69361  }
 69362  
 69363  var _rowSetEntryAllocØ00__func__Ø000 [17]int8
 69364  
 69365  func init() {
 69366  	crt.Xstrncpy(nil, &_rowSetEntryAllocØ00__func__Ø000[0], str(88399), 17)
 69367  }
 69368  
 69369  // C comment
 69370  //  /*
 69371  //  ** Extract the smallest element from the RowSet.
 69372  //  ** Write the element into *pRowid.  Return 1 on success.  Return
 69373  //  ** 0 if the RowSet is already empty.
 69374  //  **
 69375  //  ** After this routine has been called, the sqlite3RowSetInsert()
 69376  //  ** routine may not be called again.
 69377  //  **
 69378  //  ** This routine may not be called after sqlite3RowSetTest() has
 69379  //  ** been used.  Older versions of RowSet allowed that, but as the
 69380  //  ** capability was not used by the code generator, it was removed
 69381  //  ** for code economy.
 69382  //  */
 69383  func _sqlite3RowSetNext(tls *crt.TLS, _p *XRowSet, _pRowid *int64) (r0 int32) {
 69384  	func() {
 69385  		if _p == nil {
 69386  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46669), unsafe.Pointer(&_sqlite3RowSetNextØ00__func__Ø000), unsafe.Pointer(str(807)))
 69387  			crt.X__builtin_abort(tls)
 69388  		}
 69389  	}()
 69390  	func() {
 69391  		if (*TRowSetEntry)(_p.XpForest) != nil {
 69392  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46670), unsafe.Pointer(&_sqlite3RowSetNextØ00__func__Ø000), unsafe.Pointer(str(88416)))
 69393  			crt.X__builtin_abort(tls)
 69394  		}
 69395  	}()
 69396  	if (int32(_p.XrsFlags) & int32(2)) != int32(0) {
 69397  		goto _4
 69398  	}
 69399  	if (int32(_p.XrsFlags) & int32(1)) == int32(0) {
 69400  		*(**TRowSetEntry)(unsafe.Pointer(&_p.XpEntry)) = _rowSetEntrySort(tls, (*TRowSetEntry)(_p.XpEntry))
 69401  	}
 69402  	{
 69403  		p := &_p.XrsFlags
 69404  		*p = uint16(int32(*p) | int32(3))
 69405  	}
 69406  _4:
 69407  	if _p.XpEntry == nil {
 69408  		goto _6
 69409  	}
 69410  	*_pRowid = (*TRowSetEntry)(_p.XpEntry).Xv
 69411  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpEntry)) = (*TRowSetEntry)((*TRowSetEntry)(_p.XpEntry).XpRight)
 69412  	if (*TRowSetEntry)(_p.XpEntry) == nil {
 69413  		_sqlite3RowSetClear(tls, _p)
 69414  	}
 69415  	return int32(1)
 69416  
 69417  _6:
 69418  	return int32(0)
 69419  }
 69420  
 69421  var _sqlite3RowSetNextØ00__func__Ø000 [18]int8
 69422  
 69423  func init() {
 69424  	crt.Xstrncpy(nil, &_sqlite3RowSetNextØ00__func__Ø000[0], str(88430), 18)
 69425  }
 69426  
 69427  func _rowSetEntrySort(tls *crt.TLS, _pIn *TRowSetEntry) (r0 *TRowSetEntry) {
 69428  	var _i uint32
 69429  	var _pNext *TRowSetEntry
 69430  	var _aBucket [40]*TRowSetEntry
 69431  	crt.Xmemset(tls, unsafe.Pointer(&_aBucket), int32(0), uint64(320))
 69432  _0:
 69433  	if _pIn == nil {
 69434  		goto _1
 69435  	}
 69436  	_pNext = (*TRowSetEntry)(_pIn.XpRight)
 69437  	*(**TRowSetEntry)(unsafe.Pointer(&_pIn.XpRight)) = nil
 69438  	_i = 0
 69439  _2:
 69440  	if (*elem95((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i))) == nil {
 69441  		goto _5
 69442  	}
 69443  	_pIn = _rowSetEntryMerge(tls, *elem95((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i)), _pIn)
 69444  	*elem95((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i)) = nil
 69445  	_i += 1
 69446  	goto _2
 69447  _5:
 69448  	*elem95((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i)) = _pIn
 69449  	_pIn = _pNext
 69450  	goto _0
 69451  _1:
 69452  	_pIn = *elem95((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), 0)
 69453  	_i = uint32(1)
 69454  _6:
 69455  	if uint64(_i) >= uint64(40) {
 69456  		goto _9
 69457  	}
 69458  	if (*elem95((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i))) == nil {
 69459  		goto _7
 69460  	}
 69461  	_pIn = func() *TRowSetEntry {
 69462  		if _pIn != nil {
 69463  			return _rowSetEntryMerge(tls, _pIn, *elem95((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i)))
 69464  		}
 69465  		return (*elem95((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i)))
 69466  	}()
 69467  _7:
 69468  	_i += 1
 69469  	goto _6
 69470  _9:
 69471  	return _pIn
 69472  
 69473  	_ = _aBucket
 69474  	panic(0)
 69475  }
 69476  
 69477  // C comment
 69478  //  /*
 69479  //  ** Merge two lists of RowSetEntry objects.  Remove duplicates.
 69480  //  **
 69481  //  ** The input lists are connected via pRight pointers and are
 69482  //  ** assumed to each already be in sorted order.
 69483  //  */
 69484  func _rowSetEntryMerge(tls *crt.TLS, _pA *TRowSetEntry, _pB *TRowSetEntry) (r0 *TRowSetEntry) {
 69485  	var _head TRowSetEntry
 69486  	var _pTail *TRowSetEntry
 69487  	_pTail = &_head
 69488  	func() {
 69489  		if _pA == nil || _pB == nil {
 69490  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46509), unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000), unsafe.Pointer(str(16574)))
 69491  			crt.X__builtin_abort(tls)
 69492  		}
 69493  	}()
 69494  _3:
 69495  	func() {
 69496  		if (*TRowSetEntry)(_pA.XpRight) != nil && _pA.Xv > ((*TRowSetEntry)(_pA.XpRight).Xv) {
 69497  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46511), unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000), unsafe.Pointer(str(88448)))
 69498  			crt.X__builtin_abort(tls)
 69499  		}
 69500  	}()
 69501  	func() {
 69502  		if (*TRowSetEntry)(_pB.XpRight) != nil && _pB.Xv > ((*TRowSetEntry)(_pB.XpRight).Xv) {
 69503  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46512), unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000), unsafe.Pointer(str(88486)))
 69504  			crt.X__builtin_abort(tls)
 69505  		}
 69506  	}()
 69507  	if _pA.Xv > _pB.Xv {
 69508  		goto _12
 69509  	}
 69510  	if _pA.Xv < _pB.Xv {
 69511  		_pTail = store94((**TRowSetEntry)(unsafe.Pointer(&_pTail.XpRight)), _pA)
 69512  	}
 69513  	_pA = (*TRowSetEntry)(_pA.XpRight)
 69514  	if _pA == nil {
 69515  		*(**TRowSetEntry)(unsafe.Pointer(&_pTail.XpRight)) = _pB
 69516  		goto _5
 69517  	}
 69518  	goto _15
 69519  _12:
 69520  	_pTail = store94((**TRowSetEntry)(unsafe.Pointer(&_pTail.XpRight)), _pB)
 69521  	_pB = (*TRowSetEntry)(_pB.XpRight)
 69522  	if _pB == nil {
 69523  		*(**TRowSetEntry)(unsafe.Pointer(&_pTail.XpRight)) = _pA
 69524  		goto _5
 69525  	}
 69526  _15:
 69527  	goto _3
 69528  _5:
 69529  	return (*TRowSetEntry)(_head.XpRight)
 69530  }
 69531  
 69532  var _rowSetEntryMergeØ00__func__Ø000 [17]int8
 69533  
 69534  func init() {
 69535  	crt.Xstrncpy(nil, &_rowSetEntryMergeØ00__func__Ø000[0], str(88524), 17)
 69536  }
 69537  
 69538  // C comment
 69539  //  /*
 69540  //  ** Check to see if element iRowid was inserted into the rowset as
 69541  //  ** part of any insert batch prior to iBatch.  Return 1 or 0.
 69542  //  **
 69543  //  ** If this is the first test of a new batch and if there exist entries
 69544  //  ** on pRowSet->pEntry, then sort those entries into the forest at
 69545  //  ** pRowSet->pForest so that they can be tested.
 69546  //  */
 69547  func _sqlite3RowSetTest(tls *crt.TLS, _pRowSet *XRowSet, _iBatch int32, _iRowid int64) (r0 int32) {
 69548  	var _p, _pTree, _6_pAux, _6_pTail *TRowSetEntry
 69549  	var _2_ppPrevTree **TRowSetEntry
 69550  	func() {
 69551  		if _pRowSet == nil || (int32(_pRowSet.XrsFlags)&int32(2)) != int32(0) {
 69552  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46706), unsafe.Pointer(&_sqlite3RowSetTestØ00__func__Ø000), unsafe.Pointer(str(88541)))
 69553  			crt.X__builtin_abort(tls)
 69554  		}
 69555  	}()
 69556  	if _iBatch == _pRowSet.XiBatch {
 69557  		goto _3
 69558  	}
 69559  	_p = (*TRowSetEntry)(_pRowSet.XpEntry)
 69560  	if _p == nil {
 69561  		goto _4
 69562  	}
 69563  	_2_ppPrevTree = (**TRowSetEntry)(unsafe.Pointer(&_pRowSet.XpForest))
 69564  	if (int32(_pRowSet.XrsFlags) & int32(1)) == int32(0) {
 69565  		_p = _rowSetEntrySort(tls, _p)
 69566  	}
 69567  	_pTree = (*TRowSetEntry)(_pRowSet.XpForest)
 69568  _6:
 69569  	if _pTree == nil {
 69570  		goto _9
 69571  	}
 69572  	_2_ppPrevTree = (**TRowSetEntry)(unsafe.Pointer(&_pTree.XpRight))
 69573  	if (*TRowSetEntry)(_pTree.XpLeft) == nil {
 69574  		*(**TRowSetEntry)(unsafe.Pointer(&_pTree.XpLeft)) = _rowSetListToTree(tls, _p)
 69575  		goto _9
 69576  	}
 69577  	_rowSetTreeToList(tls, (*TRowSetEntry)(_pTree.XpLeft), &_6_pAux, &_6_pTail)
 69578  	*(**TRowSetEntry)(unsafe.Pointer(&_pTree.XpLeft)) = nil
 69579  	_p = _rowSetEntryMerge(tls, _6_pAux, _p)
 69580  	_pTree = (*TRowSetEntry)(_pTree.XpRight)
 69581  	goto _6
 69582  _9:
 69583  	if _pTree != nil {
 69584  		goto _12
 69585  	}
 69586  	*_2_ppPrevTree = store94(&_pTree, _rowSetEntryAlloc(tls, _pRowSet))
 69587  	if _pTree != nil {
 69588  		_pTree.Xv = 0
 69589  		*(**TRowSetEntry)(unsafe.Pointer(&_pTree.XpRight)) = nil
 69590  		*(**TRowSetEntry)(unsafe.Pointer(&_pTree.XpLeft)) = _rowSetListToTree(tls, _p)
 69591  	}
 69592  _12:
 69593  	*(**TRowSetEntry)(unsafe.Pointer(&_pRowSet.XpEntry)) = nil
 69594  	*(**TRowSetEntry)(unsafe.Pointer(&_pRowSet.XpLast)) = nil
 69595  	{
 69596  		p := &_pRowSet.XrsFlags
 69597  		*p = uint16(int32(*p) | int32(1))
 69598  	}
 69599  _4:
 69600  	_pRowSet.XiBatch = _iBatch
 69601  _3:
 69602  	_pTree = (*TRowSetEntry)(_pRowSet.XpForest)
 69603  _14:
 69604  	if _pTree == nil {
 69605  		goto _17
 69606  	}
 69607  	_p = (*TRowSetEntry)(_pTree.XpLeft)
 69608  _18:
 69609  	if _p == nil {
 69610  		goto _19
 69611  	}
 69612  	if _p.Xv < _iRowid {
 69613  		_p = (*TRowSetEntry)(_p.XpRight)
 69614  		goto _23
 69615  	}
 69616  	if _p.Xv > _iRowid {
 69617  		_p = (*TRowSetEntry)(_p.XpLeft)
 69618  		goto _23
 69619  	}
 69620  	return int32(1)
 69621  
 69622  _23:
 69623  	goto _18
 69624  _19:
 69625  	_pTree = (*TRowSetEntry)(_pTree.XpRight)
 69626  	goto _14
 69627  _17:
 69628  	return int32(0)
 69629  }
 69630  
 69631  var _sqlite3RowSetTestØ00__func__Ø000 [18]int8
 69632  
 69633  func init() {
 69634  	crt.Xstrncpy(nil, &_sqlite3RowSetTestØ00__func__Ø000[0], str(88591), 18)
 69635  }
 69636  
 69637  // C comment
 69638  //  /*
 69639  //  ** Convert a sorted list of elements into a binary tree. Make the tree
 69640  //  ** as deep as it needs to be in order to contain the entire list.
 69641  //  */
 69642  func _rowSetListToTree(tls *crt.TLS, _pList *TRowSetEntry) (r0 *TRowSetEntry) {
 69643  	var _iDepth int32
 69644  	var _p, _pLeft *TRowSetEntry
 69645  	func() {
 69646  		if _pList == nil {
 69647  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46641), unsafe.Pointer(&_rowSetListToTreeØ00__func__Ø000), unsafe.Pointer(str(88609)))
 69648  			crt.X__builtin_abort(tls)
 69649  		}
 69650  	}()
 69651  	_p = _pList
 69652  	_pList = (*TRowSetEntry)(_p.XpRight)
 69653  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLeft)) = store94((**TRowSetEntry)(unsafe.Pointer(&_p.XpRight)), nil)
 69654  	_iDepth = int32(1)
 69655  _2:
 69656  	if _pList == nil {
 69657  		goto _5
 69658  	}
 69659  	_pLeft = _p
 69660  	_p = _pList
 69661  	_pList = (*TRowSetEntry)(_p.XpRight)
 69662  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLeft)) = _pLeft
 69663  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpRight)) = _rowSetNDeepTree(tls, &_pList, _iDepth)
 69664  	_iDepth += 1
 69665  	goto _2
 69666  _5:
 69667  	return _p
 69668  }
 69669  
 69670  var _rowSetListToTreeØ00__func__Ø000 [17]int8
 69671  
 69672  func init() {
 69673  	crt.Xstrncpy(nil, &_rowSetListToTreeØ00__func__Ø000[0], str(88618), 17)
 69674  }
 69675  
 69676  // C comment
 69677  //  /*
 69678  //  ** Convert a sorted list of elements (connected by pRight) into a binary
 69679  //  ** tree with depth of iDepth.  A depth of 1 means the tree contains a single
 69680  //  ** node taken from the head of *ppList.  A depth of 2 means a tree with
 69681  //  ** three nodes.  And so forth.
 69682  //  **
 69683  //  ** Use as many entries from the input list as required and update the
 69684  //  ** *ppList to point to the unused elements of the list.  If the input
 69685  //  ** list contains too few elements, then construct an incomplete tree
 69686  //  ** and leave *ppList set to NULL.
 69687  //  **
 69688  //  ** Return a pointer to the root of the constructed binary tree.
 69689  //  */
 69690  func _rowSetNDeepTree(tls *crt.TLS, _ppList **TRowSetEntry, _iDepth int32) (r0 *TRowSetEntry) {
 69691  	var _p, _pLeft *TRowSetEntry
 69692  	if (*_ppList) == nil {
 69693  		return nil
 69694  	}
 69695  	if _iDepth <= int32(1) {
 69696  		goto _1
 69697  	}
 69698  	_pLeft = _rowSetNDeepTree(tls, _ppList, _iDepth-int32(1))
 69699  	_p = *_ppList
 69700  	if _p == nil {
 69701  		return _pLeft
 69702  	}
 69703  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLeft)) = _pLeft
 69704  	*_ppList = (*TRowSetEntry)(_p.XpRight)
 69705  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpRight)) = _rowSetNDeepTree(tls, _ppList, _iDepth-int32(1))
 69706  	goto _3
 69707  _1:
 69708  	_p = *_ppList
 69709  	*_ppList = (*TRowSetEntry)(_p.XpRight)
 69710  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLeft)) = store94((**TRowSetEntry)(unsafe.Pointer(&_p.XpRight)), nil)
 69711  _3:
 69712  	return _p
 69713  }
 69714  
 69715  // C comment
 69716  //  /*
 69717  //  ** The input, pIn, is a binary tree (or subtree) of RowSetEntry objects.
 69718  //  ** Convert this tree into a linked list connected by the pRight pointers
 69719  //  ** and return pointers to the first and last elements of the new list.
 69720  //  */
 69721  func _rowSetTreeToList(tls *crt.TLS, _pIn *TRowSetEntry, _ppFirst **TRowSetEntry, _ppLast **TRowSetEntry) {
 69722  	var _1_p *TRowSetEntry
 69723  	func() {
 69724  		if _pIn == nil {
 69725  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46570), unsafe.Pointer(&_rowSetTreeToListØ00__func__Ø000), unsafe.Pointer(str(88635)))
 69726  			crt.X__builtin_abort(tls)
 69727  		}
 69728  	}()
 69729  	if _pIn.XpLeft != nil {
 69730  		_rowSetTreeToList(tls, (*TRowSetEntry)(_pIn.XpLeft), _ppFirst, &_1_p)
 69731  		*(**TRowSetEntry)(unsafe.Pointer(&_1_p.XpRight)) = _pIn
 69732  		goto _3
 69733  	}
 69734  	*_ppFirst = _pIn
 69735  _3:
 69736  	if _pIn.XpRight != nil {
 69737  		_rowSetTreeToList(tls, (*TRowSetEntry)(_pIn.XpRight), (**TRowSetEntry)(unsafe.Pointer(&_pIn.XpRight)), _ppLast)
 69738  		goto _5
 69739  	}
 69740  	*_ppLast = _pIn
 69741  _5:
 69742  	func() {
 69743  		if (*TRowSetEntry)((*_ppLast).XpRight) != nil {
 69744  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46583), unsafe.Pointer(&_rowSetTreeToListØ00__func__Ø000), unsafe.Pointer(str(88642)))
 69745  			crt.X__builtin_abort(tls)
 69746  		}
 69747  	}()
 69748  }
 69749  
 69750  var _rowSetTreeToListØ00__func__Ø000 [17]int8
 69751  
 69752  func init() {
 69753  	crt.Xstrncpy(nil, &_rowSetTreeToListØ00__func__Ø000[0], str(88663), 17)
 69754  }
 69755  
 69756  // C comment
 69757  //  /*
 69758  //  ** Run a checkpoint on database iDb. This is a no-op if database iDb is
 69759  //  ** not currently open in WAL mode.
 69760  //  **
 69761  //  ** If a transaction is open on the database being checkpointed, this
 69762  //  ** function returns SQLITE_LOCKED and a checkpoint is not attempted. If
 69763  //  ** an error occurs while running the checkpoint, an SQLite error code is
 69764  //  ** returned (i.e. SQLITE_IOERR). Otherwise, SQLITE_OK.
 69765  //  **
 69766  //  ** The mutex on database handle db should be held by the caller. The mutex
 69767  //  ** associated with the specific b-tree being checkpointed is taken by
 69768  //  ** this function while the checkpoint is running.
 69769  //  **
 69770  //  ** If iDb is passed SQLITE_MAX_ATTACHED, then all attached databases are
 69771  //  ** checkpointed. If an error is encountered it is returned immediately -
 69772  //  ** no attempt is made to checkpoint any remaining databases.
 69773  //  **
 69774  //  ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
 69775  //  */
 69776  func _sqlite3Checkpoint(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
 69777  	var _rc, _i, _bBusy int32
 69778  	_rc = int32(0)
 69779  	_bBusy = int32(0)
 69780  	func() {
 69781  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 69782  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142642), unsafe.Pointer(&_sqlite3CheckpointØ00__func__Ø000), unsafe.Pointer(str(881)))
 69783  			crt.X__builtin_abort(tls)
 69784  		}
 69785  	}()
 69786  	func() {
 69787  		if _pnLog != nil && (*_pnLog) != int32(-1) {
 69788  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142643), unsafe.Pointer(&_sqlite3CheckpointØ00__func__Ø000), unsafe.Pointer(str(88680)))
 69789  			crt.X__builtin_abort(tls)
 69790  		}
 69791  	}()
 69792  	func() {
 69793  		if _pnCkpt != nil && (*_pnCkpt) != int32(-1) {
 69794  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142644), unsafe.Pointer(&_sqlite3CheckpointØ00__func__Ø000), unsafe.Pointer(str(88701)))
 69795  			crt.X__builtin_abort(tls)
 69796  		}
 69797  	}()
 69798  	_i = int32(0)
 69799  _8:
 69800  	if _i >= _db.XnDb || _rc != int32(0) {
 69801  		goto _12
 69802  	}
 69803  	if _i != _iDb && _iDb != int32(10) {
 69804  		goto _14
 69805  	}
 69806  	_rc = _sqlite3BtreeCheckpoint(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt), _eMode, _pnLog, _pnCkpt)
 69807  	_pnLog = nil
 69808  	_pnCkpt = nil
 69809  	if _rc == int32(5) {
 69810  		_bBusy = int32(1)
 69811  		_rc = int32(0)
 69812  	}
 69813  _14:
 69814  	_i += 1
 69815  	goto _8
 69816  _12:
 69817  	return func() int32 {
 69818  		if (_rc == int32(0)) && _bBusy != 0 {
 69819  			return int32(5)
 69820  		}
 69821  		return _rc
 69822  	}()
 69823  }
 69824  
 69825  var _sqlite3CheckpointØ00__func__Ø000 [18]int8
 69826  
 69827  func init() {
 69828  	crt.Xstrncpy(nil, &_sqlite3CheckpointØ00__func__Ø000[0], str(88724), 18)
 69829  }
 69830  
 69831  // C comment
 69832  //  /*
 69833  //  ** Run a checkpoint on the Btree passed as the first argument.
 69834  //  **
 69835  //  ** Return SQLITE_LOCKED if this or any other connection has an open
 69836  //  ** transaction on the shared-cache the argument Btree is connected to.
 69837  //  **
 69838  //  ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
 69839  //  */
 69840  func _sqlite3BtreeCheckpoint(tls *crt.TLS, _p *XBtree, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
 69841  	var _rc int32
 69842  	var _1_pBt *XBtShared
 69843  	_rc = int32(0)
 69844  	if _p == nil {
 69845  		goto _0
 69846  	}
 69847  	_1_pBt = (*XBtShared)(_p.XpBt)
 69848  	_sqlite3BtreeEnter(tls, _p)
 69849  	if int32(_1_pBt.XinTransaction) != int32(0) {
 69850  		_rc = int32(6)
 69851  		goto _2
 69852  	}
 69853  	_rc = _sqlite3PagerCheckpoint(tls, (*XPager)(_1_pBt.XpPager), (*Xsqlite3)(_p.Xdb), _eMode, _pnLog, _pnCkpt)
 69854  _2:
 69855  	_sqlite3BtreeLeave(tls, _p)
 69856  _0:
 69857  	return _rc
 69858  }
 69859  
 69860  // C comment
 69861  //  /*
 69862  //  ** This function is called when the user invokes "PRAGMA wal_checkpoint",
 69863  //  ** "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint()
 69864  //  ** or wal_blocking_checkpoint() API functions.
 69865  //  **
 69866  //  ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
 69867  //  */
 69868  func _sqlite3PagerCheckpoint(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
 69869  	var _rc int32
 69870  	_rc = int32(0)
 69871  	if _pPager.XpWal != nil {
 69872  		_rc = _sqlite3WalCheckpoint(tls, (*XWal)(_pPager.XpWal), _db, _eMode, func() func(*crt.TLS, unsafe.Pointer) int32 {
 69873  			if _eMode == int32(0) {
 69874  				return nil
 69875  			}
 69876  			return _pPager.XxBusyHandler
 69877  		}(), _pPager.XpBusyHandlerArg, int32(_pPager.XckptSyncFlags), _pPager.XpageSize, (*uint8)(unsafe.Pointer(_pPager.XpTmpSpace)), _pnLog, _pnCkpt)
 69878  	}
 69879  	return _rc
 69880  }
 69881  
 69882  // C comment
 69883  //  /*
 69884  //  ** Return TRUE if the pager is in a state where it is OK to change the
 69885  //  ** journalmode.  Journalmode changes can only happen when the database
 69886  //  ** is unmodified.
 69887  //  */
 69888  func _sqlite3PagerOkToChangeJournalMode(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 69889  	func() {
 69890  		if _assert_pager_state(tls, _pPager) == 0 {
 69891  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54187), unsafe.Pointer(&_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000), unsafe.Pointer(str(10971)))
 69892  			crt.X__builtin_abort(tls)
 69893  		}
 69894  	}()
 69895  	if int32(_pPager.XeState) >= int32(3) {
 69896  		return int32(0)
 69897  	}
 69898  	if func() int32 {
 69899  		if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil) && (_pPager.XjournalOff > (0)) {
 69900  			return func() int32 {
 69901  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54189), unsafe.Pointer(&_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000), unsafe.Pointer(str(4809)))
 69902  				crt.X__builtin_abort(tls)
 69903  				return int32(1)
 69904  			}()
 69905  		}
 69906  		return int32(0)
 69907  	}() != 0 {
 69908  		return int32(0)
 69909  	}
 69910  	return int32(1)
 69911  }
 69912  
 69913  var _sqlite3PagerOkToChangeJournalModeØ00__func__Ø000 [34]int8
 69914  
 69915  func init() {
 69916  	crt.Xstrncpy(nil, &_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000[0], str(88742), 34)
 69917  }
 69918  
 69919  // C comment
 69920  //  /*
 69921  //  ** This function is called to close the connection to the log file prior
 69922  //  ** to switching from WAL to rollback mode.
 69923  //  **
 69924  //  ** Before closing the log file, this function attempts to take an
 69925  //  ** EXCLUSIVE lock on the database file. If this cannot be obtained, an
 69926  //  ** error (SQLITE_BUSY) is returned and the log connection is not closed.
 69927  //  ** If successful, the EXCLUSIVE lock is not released before returning.
 69928  //  */
 69929  func _sqlite3PagerCloseWal(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int32) {
 69930  	var _rc, _1_logexists int32
 69931  	_rc = int32(0)
 69932  	func() {
 69933  		if int32(_pPager.XjournalMode) != int32(5) {
 69934  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54380), unsafe.Pointer(&_sqlite3PagerCloseWalØ00__func__Ø000), unsafe.Pointer(str(88776)))
 69935  			crt.X__builtin_abort(tls)
 69936  		}
 69937  	}()
 69938  	if _pPager.XpWal != nil {
 69939  		goto _2
 69940  	}
 69941  	_1_logexists = int32(0)
 69942  	_rc = _pagerLockDb(tls, _pPager, int32(1))
 69943  	if _rc == int32(0) {
 69944  		_rc = _sqlite3OsAccess(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzWal, int32(0), &_1_logexists)
 69945  	}
 69946  	if (_rc == int32(0)) && _1_logexists != 0 {
 69947  		_rc = _pagerOpenWal(tls, _pPager)
 69948  	}
 69949  _2:
 69950  	if _rc != int32(0) || _pPager.XpWal == nil {
 69951  		goto _7
 69952  	}
 69953  	_rc = _pagerExclusiveLock(tls, _pPager)
 69954  	if _rc != int32(0) {
 69955  		goto _8
 69956  	}
 69957  	_rc = _sqlite3WalClose(tls, (*XWal)(_pPager.XpWal), _db, int32(_pPager.XckptSyncFlags), _pPager.XpageSize, (*uint8)(unsafe.Pointer(_pPager.XpTmpSpace)))
 69958  	*(**XWal)(unsafe.Pointer(&_pPager.XpWal)) = nil
 69959  	_pagerFixMaplimit(tls, _pPager)
 69960  	if _rc != 0 && (_pPager.XexclusiveMode == 0) {
 69961  		_pagerUnlockDb(tls, _pPager, int32(1))
 69962  	}
 69963  _8:
 69964  _7:
 69965  	return _rc
 69966  }
 69967  
 69968  var _sqlite3PagerCloseWalØ00__func__Ø000 [21]int8
 69969  
 69970  func init() {
 69971  	crt.Xstrncpy(nil, &_sqlite3PagerCloseWalØ00__func__Ø000[0], str(88819), 21)
 69972  }
 69973  
 69974  // C comment
 69975  //  /*
 69976  //  ** Set the journal-mode for this pager. Parameter eMode must be one of:
 69977  //  **
 69978  //  **    PAGER_JOURNALMODE_DELETE
 69979  //  **    PAGER_JOURNALMODE_TRUNCATE
 69980  //  **    PAGER_JOURNALMODE_PERSIST
 69981  //  **    PAGER_JOURNALMODE_OFF
 69982  //  **    PAGER_JOURNALMODE_MEMORY
 69983  //  **    PAGER_JOURNALMODE_WAL
 69984  //  **
 69985  //  ** The journalmode is set to the value specified if the change is allowed.
 69986  //  ** The change may be disallowed for the following reasons:
 69987  //  **
 69988  //  **   *  An in-memory database can only have its journal_mode set to _OFF
 69989  //  **      or _MEMORY.
 69990  //  **
 69991  //  **   *  Temporary databases cannot have _WAL journalmode.
 69992  //  **
 69993  //  ** The returned indicate the current (possibly updated) journal-mode.
 69994  //  */
 69995  func _sqlite3PagerSetJournalMode(tls *crt.TLS, _pPager *XPager, _eMode int32) (r0 int32) {
 69996  	var _6_rc, _6_state int32
 69997  	var _eOld uint8
 69998  	_eOld = _pPager.XjournalMode
 69999  	_print_pager_state(tls, _pPager)
 70000  	func() {
 70001  		if _eMode != int32(0) && _eMode != int32(3) && _eMode != int32(1) && _eMode != int32(2) && _eMode != int32(5) && _eMode != int32(4) {
 70002  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54090), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(88840)))
 70003  			crt.X__builtin_abort(tls)
 70004  		}
 70005  	}()
 70006  	func() {
 70007  		if int32(_pPager.XtempFile) != int32(0) && _eMode == int32(5) {
 70008  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54101), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(89044)))
 70009  			crt.X__builtin_abort(tls)
 70010  		}
 70011  	}()
 70012  	if _pPager.XmemDb == 0 {
 70013  		goto _10
 70014  	}
 70015  	func() {
 70016  		if int32(_eOld) != int32(4) && int32(_eOld) != int32(2) {
 70017  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54107), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(89096)))
 70018  			crt.X__builtin_abort(tls)
 70019  		}
 70020  	}()
 70021  	if (_eMode != int32(4)) && (_eMode != int32(2)) {
 70022  		_eMode = int32(_eOld)
 70023  	}
 70024  _10:
 70025  	if _eMode == int32(_eOld) {
 70026  		goto _16
 70027  	}
 70028  	func() {
 70029  		if int32(_pPager.XeState) == int32(6) {
 70030  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54116), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(15019)))
 70031  			crt.X__builtin_abort(tls)
 70032  		}
 70033  	}()
 70034  	_pPager.XjournalMode = uint8(_eMode)
 70035  
 70036  	func() {
 70037  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _pPager.XexclusiveMode == 0 {
 70038  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54130), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(89158)))
 70039  			crt.X__builtin_abort(tls)
 70040  		}
 70041  	}()
 70042  	if _pPager.XexclusiveMode != 0 || (int32(_eOld)&int32(5)) != int32(1) || (_eMode&int32(1)) != int32(0) {
 70043  		goto _24
 70044  	}
 70045  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 70046  	if int32(_pPager.XeLock) >= int32(2) {
 70047  		_sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzJournal, int32(0))
 70048  		goto _26
 70049  	}
 70050  	_6_rc = int32(0)
 70051  	_6_state = int32(_pPager.XeState)
 70052  	func() {
 70053  		if _6_state != int32(0) && _6_state != int32(1) {
 70054  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54147), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(89202)))
 70055  			crt.X__builtin_abort(tls)
 70056  		}
 70057  	}()
 70058  	if _6_state == int32(0) {
 70059  		_6_rc = _sqlite3PagerSharedLock(tls, _pPager)
 70060  	}
 70061  	if int32(_pPager.XeState) == int32(1) {
 70062  		func() {
 70063  			if _6_rc != int32(0) {
 70064  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54152), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(14967)))
 70065  				crt.X__builtin_abort(tls)
 70066  			}
 70067  		}()
 70068  		_6_rc = _pagerLockDb(tls, _pPager, int32(2))
 70069  	}
 70070  	if _6_rc == int32(0) {
 70071  		_sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzJournal, int32(0))
 70072  	}
 70073  	if (_6_rc == int32(0)) && (_6_state == int32(1)) {
 70074  		_pagerUnlockDb(tls, _pPager, int32(1))
 70075  		goto _38
 70076  	}
 70077  	if _6_state == int32(0) {
 70078  		_pager_unlock(tls, _pPager)
 70079  	}
 70080  _38:
 70081  	func() {
 70082  		if _6_state != int32(_pPager.XeState) {
 70083  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54163), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(89243)))
 70084  			crt.X__builtin_abort(tls)
 70085  		}
 70086  	}()
 70087  _26:
 70088  	goto _42
 70089  _24:
 70090  	if _eMode == int32(2) {
 70091  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 70092  	}
 70093  _42:
 70094  _16:
 70095  	return int32(_pPager.XjournalMode)
 70096  }
 70097  
 70098  // C comment
 70099  //  /*
 70100  //  ** Return a pointer to a human readable string in a static buffer
 70101  //  ** containing the state of the Pager object passed as an argument. This
 70102  //  ** is intended to be used within debuggers. For example, as an alternative
 70103  //  ** to "print *pPager" in gdb:
 70104  //  **
 70105  //  ** (gdb) printf "%s", print_pager_state(pPager)
 70106  //  */
 70107  func _print_pager_state(tls *crt.TLS, _p *XPager) (r0 *int8) {
 70108  	Xsqlite3_snprintf(tls, int32(1024), (*int8)(unsafe.Pointer(&_print_pager_stateØ00zRetØ001)), str(89265), unsafe.Pointer(_p.XzFilename), unsafe.Pointer(func() *int8 {
 70109  		if int32(_p.XeState) == int32(0) {
 70110  			return str(89543)
 70111  		}
 70112  		return func() *int8 {
 70113  			if int32(_p.XeState) == int32(1) {
 70114  				return str(89548)
 70115  			}
 70116  			return func() *int8 {
 70117  				if int32(_p.XeState) == int32(2) {
 70118  					return str(89555)
 70119  				}
 70120  				return func() *int8 {
 70121  					if int32(_p.XeState) == int32(3) {
 70122  						return str(89569)
 70123  					}
 70124  					return func() *int8 {
 70125  						if int32(_p.XeState) == int32(4) {
 70126  							return str(89585)
 70127  						}
 70128  						return func() *int8 {
 70129  							if int32(_p.XeState) == int32(5) {
 70130  								return str(89598)
 70131  							}
 70132  							return func() *int8 {
 70133  								if int32(_p.XeState) == int32(6) {
 70134  									return str(89614)
 70135  								}
 70136  								return str(89620)
 70137  							}()
 70138  						}()
 70139  					}()
 70140  				}()
 70141  			}()
 70142  		}()
 70143  	}()), _p.XerrCode, unsafe.Pointer(func() *int8 {
 70144  		if int32(_p.XeLock) == int32(0) {
 70145  			return str(89628)
 70146  		}
 70147  		return func() *int8 {
 70148  			if int32(_p.XeLock) == int32(2) {
 70149  				return str(89636)
 70150  			}
 70151  			return func() *int8 {
 70152  				if int32(_p.XeLock) == int32(4) {
 70153  					return str(24975)
 70154  				}
 70155  				return func() *int8 {
 70156  					if int32(_p.XeLock) == int32(1) {
 70157  						return str(89645)
 70158  					}
 70159  					return func() *int8 {
 70160  						if int32(_p.XeLock) == int32(5) {
 70161  							return str(89652)
 70162  						}
 70163  						return str(89620)
 70164  					}()
 70165  				}()
 70166  			}()
 70167  		}()
 70168  	}()), unsafe.Pointer(func() *int8 {
 70169  		if _p.XexclusiveMode != 0 {
 70170  			return str(89660)
 70171  		}
 70172  		return str(89670)
 70173  	}()), unsafe.Pointer(func() *int8 {
 70174  		if int32(_p.XjournalMode) == int32(4) {
 70175  			return str(89677)
 70176  		}
 70177  		return func() *int8 {
 70178  			if int32(_p.XjournalMode) == int32(2) {
 70179  				return str(89684)
 70180  			}
 70181  			return func() *int8 {
 70182  				if int32(_p.XjournalMode) == int32(0) {
 70183  					return str(89688)
 70184  				}
 70185  				return func() *int8 {
 70186  					if int32(_p.XjournalMode) == int32(1) {
 70187  						return str(89695)
 70188  					}
 70189  					return func() *int8 {
 70190  						if int32(_p.XjournalMode) == int32(3) {
 70191  							return str(89703)
 70192  						}
 70193  						return func() *int8 {
 70194  							if int32(_p.XjournalMode) == int32(5) {
 70195  								return str(89712)
 70196  							}
 70197  							return str(89620)
 70198  						}()
 70199  					}()
 70200  				}()
 70201  			}()
 70202  		}()
 70203  	}()), int32(_p.XtempFile), int32(_p.XmemDb), int32(_p.XuseJournal), _p.XjournalOff, _p.XjournalHdr, int32(_p.XdbSize), int32(_p.XdbOrigSize), int32(_p.XdbFileSize))
 70204  	return (*int8)(unsafe.Pointer(&_print_pager_stateØ00zRetØ001))
 70205  }
 70206  
 70207  var _print_pager_stateØ00zRetØ001 [1024]int8
 70208  
 70209  var _sqlite3PagerSetJournalModeØ00__func__Ø000 [27]int8
 70210  
 70211  func init() {
 70212  	crt.Xstrncpy(nil, &_sqlite3PagerSetJournalModeØ00__func__Ø000[0], str(89716), 27)
 70213  }
 70214  
 70215  // C comment
 70216  //  /*
 70217  //  ** Set both the "read version" (single byte at byte offset 18) and
 70218  //  ** "write version" (single byte at byte offset 19) fields in the database
 70219  //  ** header to iVersion.
 70220  //  */
 70221  func _sqlite3BtreeSetVersion(tls *crt.TLS, _pBtree *XBtree, _iVersion int32) (r0 int32) {
 70222  	var _rc int32
 70223  	var _1_aData *uint8
 70224  	var _pBt *XBtShared
 70225  	_pBt = (*XBtShared)(_pBtree.XpBt)
 70226  	func() {
 70227  		if _iVersion != int32(1) && _iVersion != int32(2) {
 70228  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68831), unsafe.Pointer(&_sqlite3BtreeSetVersionØ00__func__Ø000), unsafe.Pointer(str(89743)))
 70229  			crt.X__builtin_abort(tls)
 70230  		}
 70231  	}()
 70232  	{
 70233  		p := &_pBt.XbtsFlags
 70234  		*p = uint16(int32(*p) & int32(-17))
 70235  	}
 70236  	if _iVersion == int32(1) {
 70237  		{
 70238  			p := &_pBt.XbtsFlags
 70239  			*p = uint16(int32(*p) | int32(16))
 70240  		}
 70241  	}
 70242  	_rc = _sqlite3BtreeBeginTrans(tls, _pBtree, int32(0))
 70243  	if _rc != int32(0) {
 70244  		goto _4
 70245  	}
 70246  	_1_aData = (*XMemPage)(_pBt.XpPage1).XaData
 70247  	if int32(*elem15(_1_aData, uintptr(18))) == int32(uint8(_iVersion)) && int32(*elem15(_1_aData, uintptr(19))) == int32(uint8(_iVersion)) {
 70248  		goto _6
 70249  	}
 70250  	_rc = _sqlite3BtreeBeginTrans(tls, _pBtree, int32(2))
 70251  	if _rc != int32(0) {
 70252  		goto _7
 70253  	}
 70254  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage))
 70255  	if _rc == int32(0) {
 70256  		*elem15(_1_aData, uintptr(18)) = uint8(_iVersion)
 70257  		*elem15(_1_aData, uintptr(19)) = uint8(_iVersion)
 70258  	}
 70259  _7:
 70260  _6:
 70261  _4:
 70262  	{
 70263  		p := &_pBt.XbtsFlags
 70264  		*p = uint16(int32(*p) & int32(-17))
 70265  	}
 70266  	return _rc
 70267  }
 70268  
 70269  var _sqlite3BtreeSetVersionØ00__func__Ø000 [23]int8
 70270  
 70271  func init() {
 70272  	crt.Xstrncpy(nil, &_sqlite3BtreeSetVersionØ00__func__Ø000[0], str(89770), 23)
 70273  }
 70274  
 70275  // C comment
 70276  //  /*
 70277  //  ** Parameter eMode must be one of the PAGER_JOURNALMODE_XXX constants
 70278  //  ** defined in pager.h. This function returns the associated lowercase
 70279  //  ** journal-mode name.
 70280  //  */
 70281  func _sqlite3JournalModename(tls *crt.TLS, _eMode int32) (r0 *int8) {
 70282  	func() {
 70283  		if _eMode < int32(0) || _eMode > int32(6) {
 70284  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113499), unsafe.Pointer(&_sqlite3JournalModenameØ00__func__Ø000), unsafe.Pointer(str(89793)))
 70285  			crt.X__builtin_abort(tls)
 70286  		}
 70287  	}()
 70288  	if _eMode == int32(6) {
 70289  		return nil
 70290  	}
 70291  	return *elem0((**int8)(unsafe.Pointer(&_sqlite3JournalModenameØ00azModeNameØ001)), uintptr(_eMode))
 70292  }
 70293  
 70294  var _sqlite3JournalModenameØ00__func__Ø000 [23]int8
 70295  
 70296  func init() {
 70297  	crt.Xstrncpy(nil, &_sqlite3JournalModenameØ00__func__Ø000[0], str(89834), 23)
 70298  }
 70299  
 70300  var _sqlite3JournalModenameØ00azModeNameØ001 [6]*int8
 70301  
 70302  func init() {
 70303  	_sqlite3JournalModenameØ00azModeNameØ001 = [6]*int8{str(89688), str(89695), str(89684), str(89703), str(89677), str(89712)}
 70304  }
 70305  
 70306  // C comment
 70307  //  /*
 70308  //  ** This routine implements the OP_Vacuum opcode of the VDBE.
 70309  //  */
 70310  func _sqlite3RunVacuum(tls *crt.TLS, _pzErrMsg **int8, _db *Xsqlite3, _iDb int32) (r0 int32) {
 70311  	var _rc, _saved_flags, _saved_nChange, _saved_nTotalChange, _isMemDb, _nRes, _nDb, _5_i int32
 70312  	var _5_meta uint32
 70313  	var _zDbMain *int8
 70314  	var _saved_mTrace uint8
 70315  	var _pMain, _pTemp *XBtree
 70316  	var _pDb *XDb
 70317  	_rc = int32(0)
 70318  	_pDb = nil
 70319  	if _db.XautoCommit == 0 {
 70320  		_sqlite3SetString(tls, _pzErrMsg, _db, str(89857))
 70321  		return int32(1)
 70322  	}
 70323  	if _db.XnVdbeActive > int32(1) {
 70324  		_sqlite3SetString(tls, _pzErrMsg, _db, str(89897))
 70325  		return int32(1)
 70326  	}
 70327  	_saved_flags = _db.Xflags
 70328  	_saved_nChange = _db.XnChange
 70329  	_saved_nTotalChange = _db.XnTotalChange
 70330  	_saved_mTrace = _db.XmTrace
 70331  	_db.Xflags |= int32(270542848)
 70332  	_db.Xflags &= int32(-655489)
 70333  	_db.XmTrace = 0
 70334  	_zDbMain = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 70335  	_pMain = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt)
 70336  	_isMemDb = _sqlite3PagerIsMemdb(tls, _sqlite3BtreePager(tls, _pMain))
 70337  	_nDb = _db.XnDb
 70338  	_rc = _execSql(tls, _db, _pzErrMsg, str(89940))
 70339  	if _rc != int32(0) {
 70340  		goto _end_of_vacuum
 70341  	}
 70342  	func() {
 70343  		if (_db.XnDb - int32(1)) != _nDb {
 70344  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124801), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(89961)))
 70345  			crt.X__builtin_abort(tls)
 70346  		}
 70347  	}()
 70348  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_nDb))
 70349  	func() {
 70350  		if crt.Xstrcmp(tls, _pDb.XzDbSName, str(89978)) != int32(0) {
 70351  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124803), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(89988)))
 70352  			crt.X__builtin_abort(tls)
 70353  		}
 70354  	}()
 70355  	_pTemp = (*XBtree)(_pDb.XpBt)
 70356  	_sqlite3BtreeCommit(tls, _pTemp)
 70357  	_nRes = _sqlite3BtreeGetOptimalReserve(tls, _pMain)
 70358  	_sqlite3BtreeSetCacheSize(tls, _pTemp, (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).Xcache_size)
 70359  	_sqlite3BtreeSetSpillSize(tls, _pTemp, _sqlite3BtreeSetSpillSize(tls, _pMain, int32(0)))
 70360  	_sqlite3BtreeSetPagerFlags(tls, _pTemp, uint32(33))
 70361  	_rc = _execSql(tls, _db, _pzErrMsg, str(24938))
 70362  	if _rc != int32(0) {
 70363  		goto _end_of_vacuum
 70364  	}
 70365  	_rc = _sqlite3BtreeBeginTrans(tls, _pMain, int32(2))
 70366  	if _rc != int32(0) {
 70367  		goto _end_of_vacuum
 70368  	}
 70369  	if _sqlite3PagerGetJournalMode(tls, _sqlite3BtreePager(tls, _pMain)) == int32(5) {
 70370  		_db.XnextPagesize = int32(0)
 70371  	}
 70372  	if (_sqlite3BtreeSetPageSize(tls, _pTemp, _sqlite3BtreeGetPageSize(tls, _pMain), _nRes, int32(0)) != 0 || ((_isMemDb == 0) && _sqlite3BtreeSetPageSize(tls, _pTemp, _db.XnextPagesize, _nRes, int32(0)) != 0)) || func() int32 {
 70373  		if _db.XmallocFailed != 0 {
 70374  			return func() int32 {
 70375  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124846), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(4809)))
 70376  				crt.X__builtin_abort(tls)
 70377  				return int32(1)
 70378  			}()
 70379  		}
 70380  		return int32(0)
 70381  	}() != 0 {
 70382  		_rc = _sqlite3NomemError(tls, int32(124848))
 70383  		goto _end_of_vacuum
 70384  	}
 70385  	_sqlite3BtreeSetAutoVacuum(tls, _pTemp, func() int32 {
 70386  		if int32(_db.XnextAutovac) >= int32(0) {
 70387  			return int32(_db.XnextAutovac)
 70388  		}
 70389  		return _sqlite3BtreeGetAutoVacuum(tls, _pMain)
 70390  	}())
 70391  	_db.Xinit.XiDb = uint8(_nDb)
 70392  	_rc = _execSqlF(tls, _db, _pzErrMsg, str(90025), unsafe.Pointer(_zDbMain))
 70393  	if _rc != int32(0) {
 70394  		goto _end_of_vacuum
 70395  	}
 70396  	_rc = _execSqlF(tls, _db, _pzErrMsg, str(90133), unsafe.Pointer(_zDbMain))
 70397  	if _rc != int32(0) {
 70398  		goto _end_of_vacuum
 70399  	}
 70400  	_db.Xinit.XiDb = 0
 70401  	_rc = _execSqlF(tls, _db, _pzErrMsg, str(90206), unsafe.Pointer(_zDbMain))
 70402  	func() {
 70403  		if (_db.Xflags & int32(268435456)) == int32(0) {
 70404  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124887), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(90357)))
 70405  			crt.X__builtin_abort(tls)
 70406  		}
 70407  	}()
 70408  	_db.Xflags &= int32(-268435457)
 70409  	if _rc != int32(0) {
 70410  		goto _end_of_vacuum
 70411  	}
 70412  	_rc = _execSqlF(tls, _db, _pzErrMsg, str(90388), unsafe.Pointer(_zDbMain))
 70413  	if _rc != 0 {
 70414  		goto _end_of_vacuum
 70415  	}
 70416  	func() {
 70417  		if int32(1) != _sqlite3BtreeIsInTrans(tls, _pTemp) {
 70418  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124929), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(90518)))
 70419  			crt.X__builtin_abort(tls)
 70420  		}
 70421  	}()
 70422  	func() {
 70423  		if int32(1) != _sqlite3BtreeIsInTrans(tls, _pMain) {
 70424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124930), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(90550)))
 70425  			crt.X__builtin_abort(tls)
 70426  		}
 70427  	}()
 70428  	_5_i = int32(0)
 70429  _28:
 70430  	if _5_i >= int32(10) {
 70431  		goto _31
 70432  	}
 70433  	_sqlite3BtreeGetMeta(tls, _pMain, int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3RunVacuumØ00aCopyØ001)), uintptr(_5_i))), &_5_meta)
 70434  	_rc = _sqlite3BtreeUpdateMeta(tls, _pTemp, int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3RunVacuumØ00aCopyØ001)), uintptr(_5_i))), _5_meta+uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3RunVacuumØ00aCopyØ001)), uintptr(_5_i+int32(1)))))
 70435  	if func() int32 {
 70436  		if _rc != int32(0) {
 70437  			return func() int32 {
 70438  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124938), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(4809)))
 70439  				crt.X__builtin_abort(tls)
 70440  				return int32(1)
 70441  			}()
 70442  		}
 70443  		return int32(0)
 70444  	}() != 0 {
 70445  		goto _end_of_vacuum
 70446  	}
 70447  	_5_i += int32(2)
 70448  	goto _28
 70449  _31:
 70450  	_rc = _sqlite3BtreeCopyFile(tls, _pMain, _pTemp)
 70451  	if _rc != int32(0) {
 70452  		goto _end_of_vacuum
 70453  	}
 70454  	_rc = _sqlite3BtreeCommit(tls, _pTemp)
 70455  	if _rc != int32(0) {
 70456  		goto _end_of_vacuum
 70457  	}
 70458  	_sqlite3BtreeSetAutoVacuum(tls, _pMain, _sqlite3BtreeGetAutoVacuum(tls, _pTemp))
 70459  	func() {
 70460  		if _rc != int32(0) {
 70461  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124950), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(14967)))
 70462  			crt.X__builtin_abort(tls)
 70463  		}
 70464  	}()
 70465  	_rc = _sqlite3BtreeSetPageSize(tls, _pMain, _sqlite3BtreeGetPageSize(tls, _pTemp), _nRes, int32(1))
 70466  _end_of_vacuum:
 70467  	_db.Xinit.XiDb = 0
 70468  	_db.Xflags = _saved_flags
 70469  	_db.XnChange = _saved_nChange
 70470  	_db.XnTotalChange = _saved_nTotalChange
 70471  	_db.XmTrace = _saved_mTrace
 70472  	_sqlite3BtreeSetPageSize(tls, _pMain, int32(-1), int32(-1), int32(1))
 70473  	_db.XautoCommit = uint8(1)
 70474  	if _pDb != nil {
 70475  		_sqlite3BtreeClose(tls, (*XBtree)(_pDb.XpBt))
 70476  		*(**XBtree)(unsafe.Pointer(&_pDb.XpBt)) = nil
 70477  		*(**XSchema)(unsafe.Pointer(&_pDb.XpSchema)) = nil
 70478  	}
 70479  	_sqlite3ResetAllSchemasOfConnection(tls, _db)
 70480  	return _rc
 70481  }
 70482  
 70483  // C comment
 70484  //  /*
 70485  //  ** Execute zSql on database db.
 70486  //  **
 70487  //  ** If zSql returns rows, then each row will have exactly one
 70488  //  ** column.  (This will only happen if zSql begins with "SELECT".)
 70489  //  ** Take each row of result and call execSql() again recursively.
 70490  //  **
 70491  //  ** The execSqlF() routine does the same thing, except it accepts
 70492  //  ** a format string as its third argument
 70493  //  */
 70494  func _execSql(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8, _zSql *int8) (r0 int32) {
 70495  	var _rc int32
 70496  	var _1_zSubSql *int8
 70497  	var _pStmt unsafe.Pointer
 70498  	_rc = Xsqlite3_prepare_v2(tls, _db, _zSql, int32(-1), &_pStmt, nil)
 70499  	if _rc != int32(0) {
 70500  		return _rc
 70501  	}
 70502  _0:
 70503  	if int32(100) != store2(&_rc, Xsqlite3_step(tls, _pStmt)) {
 70504  		goto _2
 70505  	}
 70506  	_1_zSubSql = (*int8)(unsafe.Pointer(Xsqlite3_column_text(tls, _pStmt, int32(0))))
 70507  	func() {
 70508  		if Xsqlite3_strnicmp(tls, _zSql, str(25657), int32(6)) != int32(0) {
 70509  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124657), unsafe.Pointer(&_execSqlØ00__func__Ø000), unsafe.Pointer(str(90582)))
 70510  			crt.X__builtin_abort(tls)
 70511  		}
 70512  	}()
 70513  	if _1_zSubSql == nil {
 70514  		goto _5
 70515  	}
 70516  	func() {
 70517  		if int32(*elem1(_1_zSubSql, 0)) == int32(83) {
 70518  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124659), unsafe.Pointer(&_execSqlØ00__func__Ø000), unsafe.Pointer(str(90619)))
 70519  			crt.X__builtin_abort(tls)
 70520  		}
 70521  	}()
 70522  	_rc = _execSql(tls, _db, _pzErrMsg, _1_zSubSql)
 70523  	if _rc != int32(0) {
 70524  		goto _2
 70525  	}
 70526  _5:
 70527  	goto _0
 70528  _2:
 70529  	func() {
 70530  		if _rc == int32(100) {
 70531  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124664), unsafe.Pointer(&_execSqlØ00__func__Ø000), unsafe.Pointer(str(90635)))
 70532  			crt.X__builtin_abort(tls)
 70533  		}
 70534  	}()
 70535  	if _rc == int32(101) {
 70536  		_rc = int32(0)
 70537  	}
 70538  	if _rc != 0 {
 70539  		_sqlite3SetString(tls, _pzErrMsg, _db, Xsqlite3_errmsg(tls, _db))
 70540  	}
 70541  	Xsqlite3_finalize(tls, _pStmt)
 70542  	return _rc
 70543  }
 70544  
 70545  var _execSqlØ00__func__Ø000 [8]int8
 70546  
 70547  func init() {
 70548  	crt.Xstrncpy(nil, &_execSqlØ00__func__Ø000[0], str(90650), 8)
 70549  }
 70550  
 70551  var _sqlite3RunVacuumØ00__func__Ø000 [17]int8
 70552  
 70553  func init() {
 70554  	crt.Xstrncpy(nil, &_sqlite3RunVacuumØ00__func__Ø000[0], str(90658), 17)
 70555  }
 70556  
 70557  // C comment
 70558  //  /*
 70559  //  ** Return the number of bytes of space at the end of every page that
 70560  //  ** are intentually left unused.  This is the "reserved" space that is
 70561  //  ** sometimes used by extensions.
 70562  //  **
 70563  //  ** If SQLITE_HAS_MUTEX is defined then the number returned is the
 70564  //  ** greater of the current reserved space and the maximum requested
 70565  //  ** reserve space.
 70566  //  */
 70567  func _sqlite3BtreeGetOptimalReserve(tls *crt.TLS, _p *XBtree) (r0 int32) {
 70568  	var _n int32
 70569  	_sqlite3BtreeEnter(tls, _p)
 70570  	_n = _sqlite3BtreeGetReserveNoMutex(tls, _p)
 70571  	_sqlite3BtreeLeave(tls, _p)
 70572  	return _n
 70573  }
 70574  
 70575  // C comment
 70576  //  /*
 70577  //  ** Change the "spill" limit on the number of pages in the cache.
 70578  //  ** If the number of pages exceeds this limit during a write transaction,
 70579  //  ** the pager might attempt to "spill" pages to the journal early in
 70580  //  ** order to free up memory.
 70581  //  **
 70582  //  ** The value returned is the current spill size.  If zero is passed
 70583  //  ** as an argument, no changes are made to the spill size setting, so
 70584  //  ** using mxPage of 0 is a way to query the current spill size.
 70585  //  */
 70586  func _sqlite3BtreeSetSpillSize(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) {
 70587  	var _res int32
 70588  	var _pBt *XBtShared
 70589  	_pBt = (*XBtShared)(_p.XpBt)
 70590  	func() {
 70591  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 70592  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61682), unsafe.Pointer(&_sqlite3BtreeSetSpillSizeØ00__func__Ø000), unsafe.Pointer(str(8939)))
 70593  			crt.X__builtin_abort(tls)
 70594  		}
 70595  	}()
 70596  	_sqlite3BtreeEnter(tls, _p)
 70597  	_res = _sqlite3PagerSetSpillsize(tls, (*XPager)(_pBt.XpPager), _mxPage)
 70598  	_sqlite3BtreeLeave(tls, _p)
 70599  	return _res
 70600  }
 70601  
 70602  var _sqlite3BtreeSetSpillSizeØ00__func__Ø000 [25]int8
 70603  
 70604  func init() {
 70605  	crt.Xstrncpy(nil, &_sqlite3BtreeSetSpillSizeØ00__func__Ø000[0], str(90675), 25)
 70606  }
 70607  
 70608  // C comment
 70609  //  /*
 70610  //  ** Change the maximum number of in-memory pages that are allowed
 70611  //  ** before attempting to spill pages to journal.
 70612  //  */
 70613  func _sqlite3PagerSetSpillsize(tls *crt.TLS, _pPager *XPager, _mxPage int32) (r0 int32) {
 70614  	return _sqlite3PcacheSetSpillsize(tls, (*XPCache)(_pPager.XpPCache), _mxPage)
 70615  }
 70616  
 70617  // C comment
 70618  //  /*
 70619  //  ** Set the suggested cache-spill value.  Make no changes if if the
 70620  //  ** argument is zero.  Return the effective cache-spill size, which will
 70621  //  ** be the larger of the szSpill and szCache.
 70622  //  */
 70623  func _sqlite3PcacheSetSpillsize(tls *crt.TLS, _p *XPCache, _mxPage int32) (r0 int32) {
 70624  	var _res int32
 70625  	func() {
 70626  		if _p.XpCache == nil {
 70627  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44952), unsafe.Pointer(&_sqlite3PcacheSetSpillsizeØ00__func__Ø000), unsafe.Pointer(str(90700)))
 70628  			crt.X__builtin_abort(tls)
 70629  		}
 70630  	}()
 70631  	if _mxPage == 0 {
 70632  		goto _2
 70633  	}
 70634  	if _mxPage < int32(0) {
 70635  		_mxPage = int32((int64(-1024) * int64(_mxPage)) / int64(_p.XszPage+_p.XszExtra))
 70636  	}
 70637  	_p.XszSpill = _mxPage
 70638  _2:
 70639  	_res = _numberOfCachePages(tls, _p)
 70640  	if _res < _p.XszSpill {
 70641  		_res = _p.XszSpill
 70642  	}
 70643  	return _res
 70644  }
 70645  
 70646  var _sqlite3PcacheSetSpillsizeØ00__func__Ø000 [26]int8
 70647  
 70648  func init() {
 70649  	crt.Xstrncpy(nil, &_sqlite3PcacheSetSpillsizeØ00__func__Ø000[0], str(90713), 26)
 70650  }
 70651  
 70652  func _sqlite3BtreeSetPagerFlags(tls *crt.TLS, _p *XBtree, _pgFlags uint32) (r0 int32) {
 70653  	var _pBt *XBtShared
 70654  	_pBt = (*XBtShared)(_p.XpBt)
 70655  	func() {
 70656  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 70657  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61718), unsafe.Pointer(&_sqlite3BtreeSetPagerFlagsØ00__func__Ø000), unsafe.Pointer(str(8939)))
 70658  			crt.X__builtin_abort(tls)
 70659  		}
 70660  	}()
 70661  	_sqlite3BtreeEnter(tls, _p)
 70662  	_sqlite3PagerSetFlags(tls, (*XPager)(_pBt.XpPager), _pgFlags)
 70663  	_sqlite3BtreeLeave(tls, _p)
 70664  	return int32(0)
 70665  }
 70666  
 70667  var _sqlite3BtreeSetPagerFlagsØ00__func__Ø000 [26]int8
 70668  
 70669  func init() {
 70670  	crt.Xstrncpy(nil, &_sqlite3BtreeSetPagerFlagsØ00__func__Ø000[0], str(90739), 26)
 70671  }
 70672  
 70673  func _sqlite3PagerSetFlags(tls *crt.TLS, _pPager *XPager, _pgFlags uint32) {
 70674  	var _level uint32
 70675  	_level = _pgFlags & uint32(7)
 70676  	if _pPager.XtempFile != 0 {
 70677  		_pPager.XnoSync = uint8(1)
 70678  		_pPager.XfullSync = 0
 70679  		_pPager.XextraSync = 0
 70680  		goto _1
 70681  	}
 70682  	_pPager.XnoSync = uint8(func() int32 {
 70683  		if _level == uint32(1) {
 70684  			return int32(1)
 70685  		}
 70686  		return int32(0)
 70687  	}())
 70688  	_pPager.XfullSync = uint8(func() int32 {
 70689  		if _level >= uint32(3) {
 70690  			return int32(1)
 70691  		}
 70692  		return int32(0)
 70693  	}())
 70694  	_pPager.XextraSync = uint8(func() int32 {
 70695  		if _level == uint32(4) {
 70696  			return int32(1)
 70697  		}
 70698  		return int32(0)
 70699  	}())
 70700  _1:
 70701  	if _pPager.XnoSync != 0 {
 70702  		_pPager.XsyncFlags = 0
 70703  		_pPager.XckptSyncFlags = 0
 70704  		goto _13
 70705  	}
 70706  	if (_pgFlags & uint32(8)) != 0 {
 70707  		_pPager.XsyncFlags = uint8(3)
 70708  		_pPager.XckptSyncFlags = uint8(3)
 70709  		goto _13
 70710  	}
 70711  	if (_pgFlags & uint32(16)) != 0 {
 70712  		_pPager.XsyncFlags = uint8(2)
 70713  		_pPager.XckptSyncFlags = uint8(3)
 70714  		goto _13
 70715  	}
 70716  	_pPager.XsyncFlags = uint8(2)
 70717  	_pPager.XckptSyncFlags = uint8(2)
 70718  _13:
 70719  	_pPager.XwalSyncFlags = _pPager.XsyncFlags
 70720  	if _pPager.XfullSync != 0 {
 70721  		{
 70722  			p := &_pPager.XwalSyncFlags
 70723  			*p = uint8(int32(*p) | int32(32))
 70724  		}
 70725  	}
 70726  	if (_pgFlags & uint32(32)) != 0 {
 70727  		{
 70728  			p := &_pPager.XdoNotSpill
 70729  			*p = uint8(int32(*p) & int32(-2))
 70730  		}
 70731  		goto _16
 70732  	}
 70733  	{
 70734  		p := &_pPager.XdoNotSpill
 70735  		*p = uint8(int32(*p) | int32(1))
 70736  	}
 70737  _16:
 70738  }
 70739  
 70740  // C comment
 70741  //  /*
 70742  //  ** Change the default pages size and the number of reserved bytes per page.
 70743  //  ** Or, if the page size has already been fixed, return SQLITE_READONLY
 70744  //  ** without changing anything.
 70745  //  **
 70746  //  ** The page size must be a power of 2 between 512 and 65536.  If the page
 70747  //  ** size supplied does not meet this constraint then the page size is not
 70748  //  ** changed.
 70749  //  **
 70750  //  ** Page sizes are constrained to be a power of two so that the region
 70751  //  ** of the database file used for locking (beginning at PENDING_BYTE,
 70752  //  ** the first byte past the 1GB boundary, 0x40000000) needs to occur
 70753  //  ** at the beginning of a page.
 70754  //  **
 70755  //  ** If parameter nReserve is less than zero, then the number of reserved
 70756  //  ** bytes per page is left unchanged.
 70757  //  **
 70758  //  ** If the iFix!=0 then the BTS_PAGESIZE_FIXED flag is set so that the page size
 70759  //  ** and autovacuum mode can no longer be changed.
 70760  //  */
 70761  func _sqlite3BtreeSetPageSize(tls *crt.TLS, _p *XBtree, _pageSize int32, _nReserve int32, _iFix int32) (r0 int32) {
 70762  	var _rc int32
 70763  	var _pBt *XBtShared
 70764  	_rc = int32(0)
 70765  	_pBt = (*XBtShared)(_p.XpBt)
 70766  	func() {
 70767  		if _nReserve < int32(-1) || _nReserve > int32(255) {
 70768  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61749), unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000), unsafe.Pointer(str(90765)))
 70769  			crt.X__builtin_abort(tls)
 70770  		}
 70771  	}()
 70772  	_sqlite3BtreeEnter(tls, _p)
 70773  	if (int32(_pBt.XbtsFlags) & int32(2)) != 0 {
 70774  		_sqlite3BtreeLeave(tls, _p)
 70775  		return int32(8)
 70776  	}
 70777  	if _nReserve < int32(0) {
 70778  		_nReserve = int32(_pBt.XpageSize - _pBt.XusableSize)
 70779  	}
 70780  	func() {
 70781  		if _nReserve < int32(0) || _nReserve > int32(255) {
 70782  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61761), unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000), unsafe.Pointer(str(90795)))
 70783  			crt.X__builtin_abort(tls)
 70784  		}
 70785  	}()
 70786  	if ((_pageSize >= int32(512)) && (_pageSize <= int32(65536))) && (((_pageSize - int32(1)) & _pageSize) == int32(0)) {
 70787  		func() {
 70788  			if (_pageSize & int32(7)) != int32(0) {
 70789  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61764), unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000), unsafe.Pointer(str(51364)))
 70790  				crt.X__builtin_abort(tls)
 70791  			}
 70792  		}()
 70793  		func() {
 70794  			if _pBt.XpCursor != nil {
 70795  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61765), unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000), unsafe.Pointer(str(22064)))
 70796  				crt.X__builtin_abort(tls)
 70797  			}
 70798  		}()
 70799  		_pBt.XpageSize = uint32(_pageSize)
 70800  		_freeTempSpace(tls, _pBt)
 70801  	}
 70802  	_rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.XpPager), &_pBt.XpageSize, _nReserve)
 70803  	_pBt.XusableSize = _pBt.XpageSize - uint32(uint16(_nReserve))
 70804  	if _iFix != 0 {
 70805  		{
 70806  			p := &_pBt.XbtsFlags
 70807  			*p = uint16(int32(*p) | int32(2))
 70808  		}
 70809  	}
 70810  	_sqlite3BtreeLeave(tls, _p)
 70811  	return _rc
 70812  }
 70813  
 70814  var _sqlite3BtreeSetPageSizeØ00__func__Ø000 [24]int8
 70815  
 70816  func init() {
 70817  	crt.Xstrncpy(nil, &_sqlite3BtreeSetPageSizeØ00__func__Ø000[0], str(90824), 24)
 70818  }
 70819  
 70820  // C comment
 70821  //  /*
 70822  //  ** Change the 'auto-vacuum' property of the database. If the 'autoVacuum'
 70823  //  ** parameter is non-zero, then auto-vacuum mode is enabled. If zero, it
 70824  //  ** is disabled. The default value for the auto-vacuum property is
 70825  //  ** determined by the SQLITE_DEFAULT_AUTOVACUUM macro.
 70826  //  */
 70827  func _sqlite3BtreeSetAutoVacuum(tls *crt.TLS, _p *XBtree, _autoVacuum int32) (r0 int32) {
 70828  	var _rc int32
 70829  	var _av uint8
 70830  	var _pBt *XBtShared
 70831  	_pBt = (*XBtShared)(_p.XpBt)
 70832  	_rc = int32(0)
 70833  	_av = uint8(_autoVacuum)
 70834  	_sqlite3BtreeEnter(tls, _p)
 70835  	if ((int32(_pBt.XbtsFlags) & int32(2)) != int32(0)) && (func() int32 {
 70836  		if _av != 0 {
 70837  			return int32(1)
 70838  		}
 70839  		return int32(0)
 70840  	}() != int32(_pBt.XautoVacuum)) {
 70841  		_rc = int32(8)
 70842  		goto _4
 70843  	}
 70844  	_pBt.XautoVacuum = uint8(func() int32 {
 70845  		if _av != 0 {
 70846  			return int32(1)
 70847  		}
 70848  		return int32(0)
 70849  	}())
 70850  	_pBt.XincrVacuum = uint8(func() int32 {
 70851  		if int32(_av) == int32(2) {
 70852  			return int32(1)
 70853  		}
 70854  		return int32(0)
 70855  	}())
 70856  _4:
 70857  	_sqlite3BtreeLeave(tls, _p)
 70858  	return _rc
 70859  }
 70860  
 70861  // C comment
 70862  //  /*
 70863  //  ** Return the value of the 'auto-vacuum' property. If auto-vacuum is
 70864  //  ** enabled 1 is returned. Otherwise 0.
 70865  //  */
 70866  func _sqlite3BtreeGetAutoVacuum(tls *crt.TLS, _p *XBtree) (r0 int32) {
 70867  	var _rc int32
 70868  	_sqlite3BtreeEnter(tls, _p)
 70869  	_rc = func() int32 {
 70870  		if ((*XBtShared)(_p.XpBt).XautoVacuum) == 0 {
 70871  			return int32(0)
 70872  		}
 70873  		return func() int32 {
 70874  			if ((*XBtShared)(_p.XpBt).XincrVacuum) == 0 {
 70875  				return int32(1)
 70876  			}
 70877  			return int32(2)
 70878  		}()
 70879  	}()
 70880  	_sqlite3BtreeLeave(tls, _p)
 70881  	return _rc
 70882  }
 70883  
 70884  func _execSqlF(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8, _zSql *int8, args ...interface{}) (r0 int32) {
 70885  	var _rc int32
 70886  	var _z *int8
 70887  	var _ap []interface{}
 70888  	_ap = args
 70889  	_z = _sqlite3VMPrintf(tls, _db, _zSql, _ap)
 70890  	_ap = nil
 70891  	if _z == nil {
 70892  		return int32(7)
 70893  	}
 70894  	_rc = _execSql(tls, _db, _pzErrMsg, _z)
 70895  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
 70896  	return _rc
 70897  }
 70898  
 70899  var _sqlite3RunVacuumØ00aCopyØ001 [10]uint8
 70900  
 70901  func init() {
 70902  	_sqlite3RunVacuumØ00aCopyØ001 = [10]uint8{1, 1, 3, 0, 5, 0, 6, 0, 8, 0}
 70903  }
 70904  
 70905  // C comment
 70906  //  /*
 70907  //  ** Copy the complete content of pBtFrom into pBtTo.  A transaction
 70908  //  ** must be active for both files.
 70909  //  **
 70910  //  ** The size of file pTo may be reduced by this operation. If anything
 70911  //  ** goes wrong, the transaction on pTo is rolled back. If successful, the
 70912  //  ** transaction is committed before returning.
 70913  //  */
 70914  func _sqlite3BtreeCopyFile(tls *crt.TLS, _pTo *XBtree, _pFrom *XBtree) (r0 int32) {
 70915  	var _rc int32
 70916  	var _1_nByte int64
 70917  	var _pFd *Xsqlite3_file
 70918  	var _b Xsqlite3_backup
 70919  	_sqlite3BtreeEnter(tls, _pTo)
 70920  	_sqlite3BtreeEnter(tls, _pFrom)
 70921  	func() {
 70922  		if _sqlite3BtreeIsInTrans(tls, _pTo) == 0 {
 70923  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69652), unsafe.Pointer(&_sqlite3BtreeCopyFileØ00__func__Ø000), unsafe.Pointer(str(90848)))
 70924  			crt.X__builtin_abort(tls)
 70925  		}
 70926  	}()
 70927  	_pFd = _sqlite3PagerFile(tls, _sqlite3BtreePager(tls, _pTo))
 70928  	if _pFd.XpMethods == nil {
 70929  		goto _2
 70930  	}
 70931  	_1_nByte = int64(_sqlite3BtreeGetPageSize(tls, _pFrom)) * int64(_sqlite3BtreeLastPage(tls, _pFrom))
 70932  	_rc = _sqlite3OsFileControl(tls, _pFd, int32(11), unsafe.Pointer(&_1_nByte))
 70933  	if _rc == int32(12) {
 70934  		_rc = int32(0)
 70935  	}
 70936  	if _rc != 0 {
 70937  		goto _copy_finished
 70938  	}
 70939  _2:
 70940  	crt.Xmemset(tls, unsafe.Pointer(&_b), int32(0), uint64(72))
 70941  	*(**Xsqlite3)(unsafe.Pointer(&_b.XpSrcDb)) = (*Xsqlite3)(_pFrom.Xdb)
 70942  	*(**XBtree)(unsafe.Pointer(&_b.XpSrc)) = _pFrom
 70943  	*(**XBtree)(unsafe.Pointer(&_b.XpDest)) = _pTo
 70944  	_b.XiNext = uint32(1)
 70945  	Xsqlite3_backup_step(tls, &_b, int32(2147483647))
 70946  	func() {
 70947  		if _b.Xrc == int32(0) {
 70948  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69683), unsafe.Pointer(&_sqlite3BtreeCopyFileØ00__func__Ø000), unsafe.Pointer(str(90875)))
 70949  			crt.X__builtin_abort(tls)
 70950  		}
 70951  	}()
 70952  	_rc = Xsqlite3_backup_finish(tls, &_b)
 70953  	if _rc == int32(0) {
 70954  		{
 70955  			p := &((*XBtShared)(_pTo.XpBt).XbtsFlags)
 70956  			*p = uint16(int32(*p) & int32(-3))
 70957  		}
 70958  		goto _8
 70959  	}
 70960  	_sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*XBtree)(_b.XpDest)))
 70961  _8:
 70962  	func() {
 70963  		if _sqlite3BtreeIsInTrans(tls, _pTo) != int32(0) {
 70964  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69692), unsafe.Pointer(&_sqlite3BtreeCopyFileØ00__func__Ø000), unsafe.Pointer(str(90891)))
 70965  			crt.X__builtin_abort(tls)
 70966  		}
 70967  	}()
 70968  _copy_finished:
 70969  	_sqlite3BtreeLeave(tls, _pFrom)
 70970  	_sqlite3BtreeLeave(tls, _pTo)
 70971  	return _rc
 70972  
 70973  	_ = _1_nByte
 70974  	panic(0)
 70975  }
 70976  
 70977  var _sqlite3BtreeCopyFileØ00__func__Ø000 [21]int8
 70978  
 70979  func init() {
 70980  	crt.Xstrncpy(nil, &_sqlite3BtreeCopyFileØ00__func__Ø000[0], str(90921), 21)
 70981  }
 70982  
 70983  // C comment
 70984  //  /*
 70985  //  ** Copy nPage pages from the source b-tree to the destination.
 70986  //  */
 70987  func Xsqlite3_backup_step(tls *crt.TLS, _p *Xsqlite3_backup, _nPage int32) (r0 int32) {
 70988  	var _rc, _destMode, _pgszSrc, _pgszDest, _2_ii, _2_nSrcPage, _2_bCloseTrans, _21_nDestTruncate, _22_ratio, _25_nDstPage, _36_rc2 int32
 70989  	var _25_iSize, _25_iOff, _25_iEnd int64
 70990  	var _9_iSrcPg, _25_iPg, _30_iSrcPg uint32
 70991  	var _31_zData *uint8
 70992  	var _2_pSrcPager, _2_pDestPager *XPager
 70993  	var _25_pFile *Xsqlite3_file
 70994  	var _10_pSrcPg, _27_pPg, _30_pSrcPg *XPgHdr
 70995  	_pgszSrc = int32(0)
 70996  	_pgszDest = int32(0)
 70997  	if _p == nil {
 70998  		return _sqlite3MisuseError(tls, int32(69253))
 70999  	}
 71000  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpSrcDb).Xmutex))
 71001  	_sqlite3BtreeEnter(tls, (*XBtree)(_p.XpSrc))
 71002  	if _p.XpDestDb != nil {
 71003  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpDestDb).Xmutex))
 71004  	}
 71005  	_rc = _p.Xrc
 71006  	if _isFatalError(tls, _rc) != 0 {
 71007  		goto _2
 71008  	}
 71009  	_2_pSrcPager = _sqlite3BtreePager(tls, (*XBtree)(_p.XpSrc))
 71010  	_2_pDestPager = _sqlite3BtreePager(tls, (*XBtree)(_p.XpDest))
 71011  	_2_nSrcPage = int32(-1)
 71012  	_2_bCloseTrans = int32(0)
 71013  	if (_p.XpDestDb != nil) && (int32((*XBtShared)((*XBtree)(_p.XpSrc).XpBt).XinTransaction) == int32(2)) {
 71014  		_rc = int32(5)
 71015  		goto _5
 71016  	}
 71017  	_rc = int32(0)
 71018  _5:
 71019  	if (_rc == int32(0)) && (int32(0) == _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(_p.XpSrc))) {
 71020  		_rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_p.XpSrc), int32(0))
 71021  		_2_bCloseTrans = int32(1)
 71022  	}
 71023  	if ((_p.XbDestLocked == int32(0)) && (_rc == int32(0))) && (_setDestPgsz(tls, _p) == int32(7)) {
 71024  		_rc = int32(7)
 71025  	}
 71026  	if ((int32(0) == _rc) && (_p.XbDestLocked == int32(0))) && (int32(0) == store2(&_rc, _sqlite3BtreeBeginTrans(tls, (*XBtree)(_p.XpDest), int32(2)))) {
 71027  		_p.XbDestLocked = int32(1)
 71028  		_sqlite3BtreeGetMeta(tls, (*XBtree)(_p.XpDest), int32(1), &_p.XiDestSchema)
 71029  	}
 71030  	_pgszSrc = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpSrc))
 71031  	_pgszDest = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpDest))
 71032  	_destMode = _sqlite3PagerGetJournalMode(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.XpDest)))
 71033  	if ((int32(0) == _rc) && (_destMode == int32(5))) && (_pgszSrc != _pgszDest) {
 71034  		_rc = int32(8)
 71035  	}
 71036  	_2_nSrcPage = int32(_sqlite3BtreeLastPage(tls, (*XBtree)(_p.XpSrc)))
 71037  	func() {
 71038  		if _2_nSrcPage < int32(0) {
 71039  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69318), unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000), unsafe.Pointer(str(90942)))
 71040  			crt.X__builtin_abort(tls)
 71041  		}
 71042  	}()
 71043  	_2_ii = int32(0)
 71044  _19:
 71045  	if _nPage >= int32(0) && _2_ii >= _nPage || _p.XiNext > uint32(_2_nSrcPage) || _rc != 0 {
 71046  		goto _25
 71047  	}
 71048  	_9_iSrcPg = _p.XiNext
 71049  	if _9_iSrcPg == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.XpSrc).XpBt).XpageSize)) + uint32(1)) {
 71050  		goto _26
 71051  	}
 71052  	_rc = _sqlite3PagerGet(tls, _2_pSrcPager, _9_iSrcPg, &_10_pSrcPg, int32(2))
 71053  	if _rc == int32(0) {
 71054  		_rc = _backupOnePage(tls, _p, _9_iSrcPg, (*uint8)(_sqlite3PagerGetData(tls, _10_pSrcPg)), int32(0))
 71055  		_sqlite3PagerUnref(tls, _10_pSrcPg)
 71056  	}
 71057  _26:
 71058  	_p.XiNext += 1
 71059  	_2_ii += 1
 71060  	goto _19
 71061  _25:
 71062  	if _rc != int32(0) {
 71063  		goto _28
 71064  	}
 71065  	_p.XnPagecount = uint32(_2_nSrcPage)
 71066  	_p.XnRemaining = uint32(_2_nSrcPage+int32(1)) - _p.XiNext
 71067  	if _p.XiNext > uint32(_2_nSrcPage) {
 71068  		_rc = int32(101)
 71069  		goto _31
 71070  	}
 71071  	if _p.XisAttached == 0 {
 71072  		_attachBackupObject(tls, _p)
 71073  	}
 71074  _31:
 71075  _28:
 71076  	if _rc != int32(101) {
 71077  		goto _32
 71078  	}
 71079  	if _2_nSrcPage == int32(0) {
 71080  		_rc = _sqlite3BtreeNewDb(tls, (*XBtree)(_p.XpDest))
 71081  		_2_nSrcPage = int32(1)
 71082  	}
 71083  	if (_rc == int32(0)) || (_rc == int32(101)) {
 71084  		_rc = _sqlite3BtreeUpdateMeta(tls, (*XBtree)(_p.XpDest), int32(1), _p.XiDestSchema+uint32(1))
 71085  	}
 71086  	if _rc != int32(0) {
 71087  		goto _36
 71088  	}
 71089  	if _p.XpDestDb != nil {
 71090  		_sqlite3ResetAllSchemasOfConnection(tls, (*Xsqlite3)(_p.XpDestDb))
 71091  	}
 71092  	if _destMode == int32(5) {
 71093  		_rc = _sqlite3BtreeSetVersion(tls, (*XBtree)(_p.XpDest), int32(2))
 71094  	}
 71095  _36:
 71096  	if _rc != int32(0) {
 71097  		goto _39
 71098  	}
 71099  	func() {
 71100  		if _pgszSrc != _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpSrc)) {
 71101  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69376), unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000), unsafe.Pointer(str(90954)))
 71102  			crt.X__builtin_abort(tls)
 71103  		}
 71104  	}()
 71105  	func() {
 71106  		if _pgszDest != _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpDest)) {
 71107  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69377), unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000), unsafe.Pointer(str(90996)))
 71108  			crt.X__builtin_abort(tls)
 71109  		}
 71110  	}()
 71111  	if _pgszSrc >= _pgszDest {
 71112  		goto _44
 71113  	}
 71114  	_22_ratio = _pgszDest / _pgszSrc
 71115  	_21_nDestTruncate = ((_2_nSrcPage + _22_ratio) - int32(1)) / _22_ratio
 71116  	if _21_nDestTruncate == int32((uint32(_sqlite3PendingByte)/((*XBtShared)((*XBtree)(_p.XpDest).XpBt).XpageSize))+uint32(1)) {
 71117  		_21_nDestTruncate -= 1
 71118  	}
 71119  	goto _46
 71120  _44:
 71121  	_21_nDestTruncate = _2_nSrcPage * (_pgszSrc / _pgszDest)
 71122  _46:
 71123  	func() {
 71124  		if _21_nDestTruncate <= int32(0) {
 71125  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69387), unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000), unsafe.Pointer(str(91040)))
 71126  			crt.X__builtin_abort(tls)
 71127  		}
 71128  	}()
 71129  	if _pgszSrc >= _pgszDest {
 71130  		goto _49
 71131  	}
 71132  	_25_iSize = int64(_pgszSrc) * int64(_2_nSrcPage)
 71133  	_25_pFile = _sqlite3PagerFile(tls, _2_pDestPager)
 71134  	func() {
 71135  		if _25_pFile == nil {
 71136  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69406), unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000), unsafe.Pointer(str(58022)))
 71137  			crt.X__builtin_abort(tls)
 71138  		}
 71139  	}()
 71140  	func() {
 71141  		if _21_nDestTruncate != int32(0) && (int64(_21_nDestTruncate)*int64(_pgszDest)) < _25_iSize && (_21_nDestTruncate != int32(((uint32(_sqlite3PendingByte)/((*XBtShared)((*XBtree)(_p.XpDest).XpBt).XpageSize))+uint32(1))-uint32(1)) || _25_iSize < int64(_sqlite3PendingByte) || _25_iSize > int64(_sqlite3PendingByte+_pgszDest)) {
 71142  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69407), unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000), unsafe.Pointer(str(91056)))
 71143  			crt.X__builtin_abort(tls)
 71144  		}
 71145  	}()
 71146  	_sqlite3PagerPagecount(tls, _2_pDestPager, &_25_nDstPage)
 71147  	_25_iPg = uint32(_21_nDestTruncate)
 71148  _58:
 71149  	if _rc != int32(0) || _25_iPg > uint32(_25_nDstPage) {
 71150  		goto _62
 71151  	}
 71152  	if _25_iPg == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.XpDest).XpBt).XpageSize)) + uint32(1)) {
 71153  		goto _63
 71154  	}
 71155  	_rc = _sqlite3PagerGet(tls, _2_pDestPager, _25_iPg, &_27_pPg, int32(0))
 71156  	if _rc == int32(0) {
 71157  		_rc = _sqlite3PagerWrite(tls, _27_pPg)
 71158  		_sqlite3PagerUnref(tls, _27_pPg)
 71159  	}
 71160  _63:
 71161  	_25_iPg += 1
 71162  	goto _58
 71163  _62:
 71164  	if _rc == int32(0) {
 71165  		_rc = _sqlite3PagerCommitPhaseOne(tls, _2_pDestPager, nil, int32(1))
 71166  	}
 71167  	_25_iEnd = func() int64 {
 71168  		if int64(_sqlite3PendingByte+_pgszDest) < _25_iSize {
 71169  			return int64(_sqlite3PendingByte + _pgszDest)
 71170  		}
 71171  		return _25_iSize
 71172  	}()
 71173  	_25_iOff = int64(_sqlite3PendingByte + _pgszSrc)
 71174  _68:
 71175  	if _rc != int32(0) || _25_iOff >= _25_iEnd {
 71176  		goto _72
 71177  	}
 71178  	_30_pSrcPg = nil
 71179  	_30_iSrcPg = uint32((_25_iOff / int64(_pgszSrc)) + int64(1))
 71180  	_rc = _sqlite3PagerGet(tls, _2_pSrcPager, _30_iSrcPg, &_30_pSrcPg, int32(0))
 71181  	if _rc == int32(0) {
 71182  		_31_zData = (*uint8)(_sqlite3PagerGetData(tls, _30_pSrcPg))
 71183  		_rc = _sqlite3OsWrite(tls, _25_pFile, unsafe.Pointer(_31_zData), _pgszSrc, _25_iOff)
 71184  	}
 71185  	_sqlite3PagerUnref(tls, _30_pSrcPg)
 71186  	_25_iOff += int64(_pgszSrc)
 71187  	goto _68
 71188  _72:
 71189  	if _rc == int32(0) {
 71190  		_rc = _backupTruncateFile(tls, _25_pFile, _25_iSize)
 71191  	}
 71192  	if _rc == int32(0) {
 71193  		_rc = _sqlite3PagerSync(tls, _2_pDestPager, nil)
 71194  	}
 71195  	goto _76
 71196  _49:
 71197  	_sqlite3PagerTruncateImage(tls, _2_pDestPager, uint32(_21_nDestTruncate))
 71198  	_rc = _sqlite3PagerCommitPhaseOne(tls, _2_pDestPager, nil, int32(0))
 71199  _76:
 71200  	if (int32(0) == _rc) && (int32(0) == store2(&_rc, _sqlite3BtreeCommitPhaseTwo(tls, (*XBtree)(_p.XpDest), int32(0)))) {
 71201  		_rc = int32(101)
 71202  	}
 71203  _39:
 71204  _32:
 71205  	if _2_bCloseTrans != 0 {
 71206  		_36_rc2 = _sqlite3BtreeCommitPhaseOne(tls, (*XBtree)(_p.XpSrc), nil)
 71207  		_36_rc2 |= _sqlite3BtreeCommitPhaseTwo(tls, (*XBtree)(_p.XpSrc), int32(0))
 71208  		func() {
 71209  			if _36_rc2 != int32(0) {
 71210  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69481), unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000), unsafe.Pointer(str(18828)))
 71211  				crt.X__builtin_abort(tls)
 71212  			}
 71213  		}()
 71214  	}
 71215  	if _rc == int32(3082) {
 71216  		_rc = _sqlite3NomemError(tls, int32(69485))
 71217  	}
 71218  	_p.Xrc = _rc
 71219  _2:
 71220  	if _p.XpDestDb != nil {
 71221  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpDestDb).Xmutex))
 71222  	}
 71223  	_sqlite3BtreeLeave(tls, (*XBtree)(_p.XpSrc))
 71224  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpSrcDb).Xmutex))
 71225  	return _rc
 71226  }
 71227  
 71228  // C comment
 71229  //  /*
 71230  //  ** Attempt to set the page size of the destination to match the page size
 71231  //  ** of the source.
 71232  //  */
 71233  func _setDestPgsz(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) {
 71234  	var _rc int32
 71235  	_rc = _sqlite3BtreeSetPageSize(tls, (*XBtree)(_p.XpDest), _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpSrc)), int32(-1), int32(0))
 71236  	return _rc
 71237  }
 71238  
 71239  var _sqlite3_backup_stepØ00__func__Ø000 [20]int8
 71240  
 71241  func init() {
 71242  	crt.Xstrncpy(nil, &_sqlite3_backup_stepØ00__func__Ø000[0], str(91237), 20)
 71243  }
 71244  
 71245  // C comment
 71246  //  /*
 71247  //  ** Register this backup object with the associated source pager for
 71248  //  ** callbacks when pages are changed or the cache invalidated.
 71249  //  */
 71250  func _attachBackupObject(tls *crt.TLS, _p *Xsqlite3_backup) {
 71251  	var _pp **Xsqlite3_backup
 71252  	func() {
 71253  		if _sqlite3BtreeHoldsMutex(tls, (*XBtree)(_p.XpSrc)) == 0 {
 71254  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69236), unsafe.Pointer(&_attachBackupObjectØ00__func__Ø000), unsafe.Pointer(str(91257)))
 71255  			crt.X__builtin_abort(tls)
 71256  		}
 71257  	}()
 71258  	_pp = _sqlite3PagerBackupPtr(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.XpSrc)))
 71259  	*(**Xsqlite3_backup)(unsafe.Pointer(&_p.XpNext)) = *_pp
 71260  	*_pp = _p
 71261  	_p.XisAttached = int32(1)
 71262  }
 71263  
 71264  var _attachBackupObjectØ00__func__Ø000 [19]int8
 71265  
 71266  func init() {
 71267  	crt.Xstrncpy(nil, &_attachBackupObjectØ00__func__Ø000[0], str(91289), 19)
 71268  }
 71269  
 71270  // C comment
 71271  //  /*
 71272  //  ** Return a pointer to the pPager->pBackup variable. The backup module
 71273  //  ** in backup.c maintains the content of this variable. This module
 71274  //  ** uses it opaquely as an argument to sqlite3BackupRestart() and
 71275  //  ** sqlite3BackupUpdate() only.
 71276  //  */
 71277  func _sqlite3PagerBackupPtr(tls *crt.TLS, _pPager *XPager) (r0 **Xsqlite3_backup) {
 71278  	return (**Xsqlite3_backup)(unsafe.Pointer(&_pPager.XpBackup))
 71279  }
 71280  
 71281  // C comment
 71282  //  /*
 71283  //  ** Initialize the first page of the database file (creating a database
 71284  //  ** consisting of a single page and no schema objects). Return SQLITE_OK
 71285  //  ** if successful, or an SQLite error code otherwise.
 71286  //  */
 71287  func _sqlite3BtreeNewDb(tls *crt.TLS, _p *XBtree) (r0 int32) {
 71288  	var _rc int32
 71289  	_sqlite3BtreeEnter(tls, _p)
 71290  	(*XBtShared)(_p.XpBt).XnPage = 0
 71291  	_rc = _newDatabase(tls, (*XBtShared)(_p.XpBt))
 71292  	_sqlite3BtreeLeave(tls, _p)
 71293  	return _rc
 71294  }
 71295  
 71296  // C comment
 71297  //  /*
 71298  //  ** If pFile is currently larger than iSize bytes, then truncate it to
 71299  //  ** exactly iSize bytes. If pFile is not larger than iSize bytes, then
 71300  //  ** this function is a no-op.
 71301  //  **
 71302  //  ** Return SQLITE_OK if everything is successful, or an SQLite error
 71303  //  ** code if an error occurs.
 71304  //  */
 71305  func _backupTruncateFile(tls *crt.TLS, _pFile *Xsqlite3_file, _iSize int64) (r0 int32) {
 71306  	var _rc int32
 71307  	var _iCurrent int64
 71308  	_rc = _sqlite3OsFileSize(tls, _pFile, &_iCurrent)
 71309  	if (_rc == int32(0)) && (_iCurrent > _iSize) {
 71310  		_rc = _sqlite3OsTruncate(tls, _pFile, _iSize)
 71311  	}
 71312  	return _rc
 71313  }
 71314  
 71315  // C comment
 71316  //  /*
 71317  //  ** Release all resources associated with an sqlite3_backup* handle.
 71318  //  */
 71319  func Xsqlite3_backup_finish(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) {
 71320  	var _rc int32
 71321  	var _pSrcDb *Xsqlite3
 71322  	var _pp **Xsqlite3_backup
 71323  	if _p == nil {
 71324  		return int32(0)
 71325  	}
 71326  	_pSrcDb = (*Xsqlite3)(_p.XpSrcDb)
 71327  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pSrcDb.Xmutex))
 71328  	_sqlite3BtreeEnter(tls, (*XBtree)(_p.XpSrc))
 71329  	if _p.XpDestDb != nil {
 71330  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpDestDb).Xmutex))
 71331  	}
 71332  	if _p.XpDestDb != nil {
 71333  		(*XBtree)(_p.XpSrc).XnBackup -= 1
 71334  	}
 71335  	if _p.XisAttached == 0 {
 71336  		goto _3
 71337  	}
 71338  	_pp = _sqlite3PagerBackupPtr(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.XpSrc)))
 71339  _4:
 71340  	if (*_pp) != _p {
 71341  		_pp = (**Xsqlite3_backup)(unsafe.Pointer(&((*_pp).XpNext)))
 71342  		goto _4
 71343  	}
 71344  	*_pp = (*Xsqlite3_backup)(_p.XpNext)
 71345  _3:
 71346  	_sqlite3BtreeRollback(tls, (*XBtree)(_p.XpDest), int32(0), int32(0))
 71347  	_rc = func() int32 {
 71348  		if _p.Xrc == int32(101) {
 71349  			return int32(0)
 71350  		}
 71351  		return _p.Xrc
 71352  	}()
 71353  	if _p.XpDestDb != nil {
 71354  		_sqlite3Error(tls, (*Xsqlite3)(_p.XpDestDb), _rc)
 71355  		_sqlite3LeaveMutexAndCloseZombie(tls, (*Xsqlite3)(_p.XpDestDb))
 71356  	}
 71357  	_sqlite3BtreeLeave(tls, (*XBtree)(_p.XpSrc))
 71358  	if _p.XpDestDb != nil {
 71359  		Xsqlite3_free(tls, unsafe.Pointer(_p))
 71360  	}
 71361  	_sqlite3LeaveMutexAndCloseZombie(tls, _pSrcDb)
 71362  	return _rc
 71363  }
 71364  
 71365  // C comment
 71366  //  /*
 71367  //  ** Unless this is an in-memory or temporary database, clear the pager cache.
 71368  //  */
 71369  func _sqlite3PagerClearCache(tls *crt.TLS, _pPager *XPager) {
 71370  	func() {
 71371  		if int32(_pPager.XmemDb) != int32(0) && _pPager.XtempFile == 0 {
 71372  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54222), unsafe.Pointer(&_sqlite3PagerClearCacheØ00__func__Ø000), unsafe.Pointer(str(55874)))
 71373  			crt.X__builtin_abort(tls)
 71374  		}
 71375  	}()
 71376  	if int32(_pPager.XtempFile) == int32(0) {
 71377  		_pager_reset(tls, _pPager)
 71378  	}
 71379  }
 71380  
 71381  var _sqlite3PagerClearCacheØ00__func__Ø000 [23]int8
 71382  
 71383  func init() {
 71384  	crt.Xstrncpy(nil, &_sqlite3PagerClearCacheØ00__func__Ø000[0], str(91308), 23)
 71385  }
 71386  
 71387  // C comment
 71388  //  /*
 71389  //  ** A write-transaction must be opened before calling this function.
 71390  //  ** It performs a single unit of work towards an incremental vacuum.
 71391  //  **
 71392  //  ** If the incremental vacuum is finished after this function has run,
 71393  //  ** SQLITE_DONE is returned. If it is not finished, but no error occurred,
 71394  //  ** SQLITE_OK is returned. Otherwise an SQLite error code.
 71395  //  */
 71396  func _sqlite3BtreeIncrVacuum(tls *crt.TLS, _p *XBtree) (r0 int32) {
 71397  	var _rc int32
 71398  	var _2_nOrig, _2_nFree, _2_nFin uint32
 71399  	var _pBt *XBtShared
 71400  	_pBt = (*XBtShared)(_p.XpBt)
 71401  	_sqlite3BtreeEnter(tls, _p)
 71402  	func() {
 71403  		if int32(_pBt.XinTransaction) != int32(2) || int32(_p.XinTrans) != int32(2) {
 71404  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62715), unsafe.Pointer(&_sqlite3BtreeIncrVacuumØ00__func__Ø000), unsafe.Pointer(str(91331)))
 71405  			crt.X__builtin_abort(tls)
 71406  		}
 71407  	}()
 71408  	if _pBt.XautoVacuum == 0 {
 71409  		_rc = int32(101)
 71410  		goto _4
 71411  	}
 71412  	_2_nOrig = _btreePagecount(tls, _pBt)
 71413  	_2_nFree = _sqlite3Get4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(36)))
 71414  	_2_nFin = _finalDbSize(tls, _pBt, _2_nOrig, _2_nFree)
 71415  	if _2_nOrig < _2_nFin {
 71416  		_rc = _sqlite3CorruptError(tls, int32(62724))
 71417  		goto _10
 71418  	}
 71419  	if _2_nFree <= (0) {
 71420  		goto _7
 71421  	}
 71422  	_rc = _saveAllCursors(tls, _pBt, 0, nil)
 71423  	if _rc == int32(0) {
 71424  		_invalidateAllOverflowCache(tls, _pBt)
 71425  		_rc = _incrVacuumStep(tls, _pBt, _2_nFin, _2_nOrig, int32(0))
 71426  	}
 71427  	if _rc == int32(0) {
 71428  		_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage))
 71429  		_sqlite3Put4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(28)), _pBt.XnPage)
 71430  	}
 71431  	goto _10
 71432  _7:
 71433  	_rc = int32(101)
 71434  _10:
 71435  _4:
 71436  	_sqlite3BtreeLeave(tls, _p)
 71437  	return _rc
 71438  }
 71439  
 71440  var _sqlite3BtreeIncrVacuumØ00__func__Ø000 [23]int8
 71441  
 71442  func init() {
 71443  	crt.Xstrncpy(nil, &_sqlite3BtreeIncrVacuumØ00__func__Ø000[0], str(91390), 23)
 71444  }
 71445  
 71446  // C comment
 71447  //  /*
 71448  //  ** Obtain a lock on the table whose root page is iTab.  The
 71449  //  ** lock is a write lock if isWritelock is true or a read lock
 71450  //  ** if it is false.
 71451  //  */
 71452  func _sqlite3BtreeLockTable(tls *crt.TLS, _p *XBtree, _iTab int32, _isWriteLock uint8) (r0 int32) {
 71453  	var _rc int32
 71454  	var _1_lockType uint8
 71455  	_rc = int32(0)
 71456  	func() {
 71457  		if int32(_p.XinTrans) == int32(0) {
 71458  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68740), unsafe.Pointer(&_sqlite3BtreeLockTableØ00__func__Ø000), unsafe.Pointer(str(91413)))
 71459  			crt.X__builtin_abort(tls)
 71460  		}
 71461  	}()
 71462  	if _p.Xsharable == 0 {
 71463  		goto _2
 71464  	}
 71465  	_1_lockType = uint8(int32(1) + int32(_isWriteLock))
 71466  
 71467  	func() {
 71468  		if int32(_isWriteLock) != int32(0) && int32(_isWriteLock) != int32(1) {
 71469  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68744), unsafe.Pointer(&_sqlite3BtreeLockTableØ00__func__Ø000), unsafe.Pointer(str(69953)))
 71470  			crt.X__builtin_abort(tls)
 71471  		}
 71472  	}()
 71473  	_sqlite3BtreeEnter(tls, _p)
 71474  	_rc = _querySharedCacheTableLock(tls, _p, uint32(_iTab), _1_lockType)
 71475  	if _rc == int32(0) {
 71476  		_rc = _setSharedCacheTableLock(tls, _p, uint32(_iTab), _1_lockType)
 71477  	}
 71478  	_sqlite3BtreeLeave(tls, _p)
 71479  _2:
 71480  	return _rc
 71481  }
 71482  
 71483  var _sqlite3BtreeLockTableØ00__func__Ø000 [22]int8
 71484  
 71485  func init() {
 71486  	crt.Xstrncpy(nil, &_sqlite3BtreeLockTableØ00__func__Ø000[0], str(91436), 22)
 71487  }
 71488  
 71489  // C comment
 71490  //  /*
 71491  //  ** Add a lock on the table with root-page iTable to the shared-btree used
 71492  //  ** by Btree handle p. Parameter eLock must be either READ_LOCK or
 71493  //  ** WRITE_LOCK.
 71494  //  **
 71495  //  ** This function assumes the following:
 71496  //  **
 71497  //  **   (a) The specified Btree object p is connected to a sharable
 71498  //  **       database (one with the BtShared.sharable flag set), and
 71499  //  **
 71500  //  **   (b) No other Btree objects hold a lock that conflicts
 71501  //  **       with the requested lock (i.e. querySharedCacheTableLock() has
 71502  //  **       already been called and returned SQLITE_OK).
 71503  //  **
 71504  //  ** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM
 71505  //  ** is returned if a malloc attempt fails.
 71506  //  */
 71507  func _setSharedCacheTableLock(tls *crt.TLS, _p *XBtree, _iTable uint32, _eLock uint8) (r0 int32) {
 71508  	var _pBt *XBtShared
 71509  	var _pLock, _pIter *XBtLock
 71510  	_pBt = (*XBtShared)(_p.XpBt)
 71511  	_pLock = nil
 71512  	func() {
 71513  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 71514  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59358), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(17442)))
 71515  			crt.X__builtin_abort(tls)
 71516  		}
 71517  	}()
 71518  	func() {
 71519  		if int32(_eLock) != int32(1) && int32(_eLock) != int32(2) {
 71520  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59359), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50726)))
 71521  			crt.X__builtin_abort(tls)
 71522  		}
 71523  	}()
 71524  	func() {
 71525  		if (*Xsqlite3)(_p.Xdb) == nil {
 71526  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59360), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(23631)))
 71527  			crt.X__builtin_abort(tls)
 71528  		}
 71529  	}()
 71530  	func() {
 71531  		if int32(0) != (((*Xsqlite3)(_p.Xdb).Xflags)&int32(16384)) && int32(_eLock) != int32(2) {
 71532  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59366), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(91458)))
 71533  			crt.X__builtin_abort(tls)
 71534  		}
 71535  	}()
 71536  	func() {
 71537  		if _p.Xsharable == 0 {
 71538  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59370), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(91520)))
 71539  			crt.X__builtin_abort(tls)
 71540  		}
 71541  	}()
 71542  	func() {
 71543  		if int32(0) != _querySharedCacheTableLock(tls, _p, _iTable, _eLock) {
 71544  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59371), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(91532)))
 71545  			crt.X__builtin_abort(tls)
 71546  		}
 71547  	}()
 71548  	_pIter = (*XBtLock)(_pBt.XpLock)
 71549  _14:
 71550  	if _pIter == nil {
 71551  		goto _17
 71552  	}
 71553  	if (_pIter.XiTable == _iTable) && ((*XBtree)(_pIter.XpBtree) == _p) {
 71554  		_pLock = _pIter
 71555  		goto _17
 71556  	}
 71557  	_pIter = (*XBtLock)(_pIter.XpNext)
 71558  	goto _14
 71559  _17:
 71560  	if _pLock != nil {
 71561  		goto _20
 71562  	}
 71563  	_pLock = (*XBtLock)(_sqlite3MallocZero(tls, uint64(24)))
 71564  	if _pLock == nil {
 71565  		return _sqlite3NomemError(tls, int32(59387))
 71566  	}
 71567  	_pLock.XiTable = _iTable
 71568  	*(**XBtree)(unsafe.Pointer(&_pLock.XpBtree)) = _p
 71569  	*(**XBtLock)(unsafe.Pointer(&_pLock.XpNext)) = (*XBtLock)(_pBt.XpLock)
 71570  	*(**XBtLock)(unsafe.Pointer(&_pBt.XpLock)) = _pLock
 71571  _20:
 71572  
 71573  	if int32(_eLock) > int32(_pLock.XeLock) {
 71574  		_pLock.XeLock = _eLock
 71575  	}
 71576  	return int32(0)
 71577  }
 71578  
 71579  var _setSharedCacheTableLockØ00__func__Ø000 [24]int8
 71580  
 71581  func init() {
 71582  	crt.Xstrncpy(nil, &_setSharedCacheTableLockØ00__func__Ø000[0], str(91587), 24)
 71583  }
 71584  
 71585  // C comment
 71586  //  /*
 71587  //  ** If the virtual table pVtab supports the transaction interface
 71588  //  ** (xBegin/xRollback/xCommit and optionally xSync) and a transaction is
 71589  //  ** not currently open, invoke the xBegin method now.
 71590  //  **
 71591  //  ** If the xBegin call is successful, place the sqlite3_vtab pointer
 71592  //  ** in the sqlite3.aVTrans array.
 71593  //  */
 71594  func _sqlite3VtabBegin(tls *crt.TLS, _db *Xsqlite3, _pVTab *XVTable) (r0 int32) {
 71595  	var _rc, _3_i, _7_iSvpt int32
 71596  	var _pModule *Xsqlite3_module
 71597  	_rc = int32(0)
 71598  	if (_db.XnVTrans > int32(0)) && ((**XVTable)(unsafe.Pointer(_db.XaVTrans)) == nil) {
 71599  		return int32(6)
 71600  	}
 71601  	if _pVTab == nil {
 71602  		return int32(0)
 71603  	}
 71604  	_pModule = (*Xsqlite3_module)((*Xsqlite3_vtab)(_pVTab.XpVtab).XpModule)
 71605  	if _pModule.XxBegin == nil {
 71606  		goto _3
 71607  	}
 71608  	_3_i = int32(0)
 71609  _4:
 71610  	if _3_i >= _db.XnVTrans {
 71611  		goto _7
 71612  	}
 71613  	if (*elem28((**XVTable)(unsafe.Pointer(_db.XaVTrans)), uintptr(_3_i))) == _pVTab {
 71614  		return int32(0)
 71615  	}
 71616  	_3_i += 1
 71617  	goto _4
 71618  _7:
 71619  	_rc = _growVTrans(tls, _db)
 71620  	if _rc != int32(0) {
 71621  		goto _9
 71622  	}
 71623  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab) int32 {
 71624  		v := _pModule.XxBegin
 71625  		return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v))
 71626  	}()(tls, (*Xsqlite3_vtab)(_pVTab.XpVtab))
 71627  	if _rc != int32(0) {
 71628  		goto _10
 71629  	}
 71630  	_7_iSvpt = _db.XnStatement + _db.XnSavepoint
 71631  	_addToVTrans(tls, _db, _pVTab)
 71632  	if _7_iSvpt != 0 && (_pModule.XxSavepoint != nil) {
 71633  		_pVTab.XiSavepoint = _7_iSvpt
 71634  		_rc = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 {
 71635  			v := _pModule.XxSavepoint
 71636  			return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v))
 71637  		}()(tls, (*Xsqlite3_vtab)(_pVTab.XpVtab), _7_iSvpt-int32(1))
 71638  	}
 71639  _10:
 71640  _9:
 71641  _3:
 71642  	return _rc
 71643  }
 71644  
 71645  // C comment
 71646  //  /*
 71647  //  ** Grow the db->aVTrans[] array so that there is room for at least one
 71648  //  ** more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise.
 71649  //  */
 71650  func _growVTrans(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 71651  	var _ARRAY_INCR, _1_nBytes int32
 71652  	var _1_aVTrans **XVTable
 71653  	_ARRAY_INCR = int32(5)
 71654  	if (_db.XnVTrans % _ARRAY_INCR) != int32(0) {
 71655  		goto _0
 71656  	}
 71657  	_1_nBytes = int32(uint64(8) * uint64(_db.XnVTrans+_ARRAY_INCR))
 71658  	_1_aVTrans = (**XVTable)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_db.XaVTrans), uint64(_1_nBytes)))
 71659  	if _1_aVTrans == nil {
 71660  		return _sqlite3NomemError(tls, int32(125653))
 71661  	}
 71662  	crt.Xmemset(tls, unsafe.Pointer(elem28(_1_aVTrans, uintptr(_db.XnVTrans))), int32(0), uint64(8)*uint64(_ARRAY_INCR))
 71663  	*(***XVTable)(unsafe.Pointer(&_db.XaVTrans)) = _1_aVTrans
 71664  _0:
 71665  	return int32(0)
 71666  }
 71667  
 71668  // C comment
 71669  //  /*
 71670  //  ** Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should
 71671  //  ** have already been reserved using growVTrans().
 71672  //  */
 71673  func _addToVTrans(tls *crt.TLS, _db *Xsqlite3, _pVTab *XVTable) {
 71674  	*elem28((**XVTable)(unsafe.Pointer(_db.XaVTrans)), uintptr(postInc2(&_db.XnVTrans, 1))) = _pVTab
 71675  	_sqlite3VtabLock(tls, _pVTab)
 71676  }
 71677  
 71678  // C comment
 71679  //  /*
 71680  //  ** Make a full copy of pFrom into pTo.  Prior contents of pTo are
 71681  //  ** freed before the copy is made.
 71682  //  */
 71683  func _sqlite3VdbeMemCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) (r0 int32) {
 71684  	var _rc int32
 71685  	_rc = int32(0)
 71686  	func() {
 71687  		if (int32(_pFrom.Xflags) & int32(32)) != int32(0) {
 71688  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70514), unsafe.Pointer(&_sqlite3VdbeMemCopyØ00__func__Ø000), unsafe.Pointer(str(71149)))
 71689  			crt.X__builtin_abort(tls)
 71690  		}
 71691  	}()
 71692  	if (int32(_pTo.Xflags) & int32(9312)) != int32(0) {
 71693  		_vdbeMemClearExternAndSetNull(tls, _pTo)
 71694  	}
 71695  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), uint64(24))
 71696  	{
 71697  		p := &_pTo.Xflags
 71698  		*p = uint16(int32(*p) & int32(-1025))
 71699  	}
 71700  	if (int32(_pTo.Xflags) & int32(18)) == 0 {
 71701  		goto _3
 71702  	}
 71703  	if int32(0) == (int32(_pFrom.Xflags) & int32(2048)) {
 71704  		{
 71705  			p := &_pTo.Xflags
 71706  			*p = uint16(int32(*p) | int32(4096))
 71707  		}
 71708  		_rc = _sqlite3VdbeMemMakeWriteable(tls, _pTo)
 71709  	}
 71710  _3:
 71711  	return _rc
 71712  }
 71713  
 71714  var _sqlite3VdbeMemCopyØ00__func__Ø000 [19]int8
 71715  
 71716  func init() {
 71717  	crt.Xstrncpy(nil, &_sqlite3VdbeMemCopyØ00__func__Ø000[0], str(91611), 19)
 71718  }
 71719  
 71720  // C comment
 71721  //  /*
 71722  //  ** This function is invoked by the vdbe to call the xCreate method
 71723  //  ** of the virtual table named zTab in database iDb.
 71724  //  **
 71725  //  ** If an error occurs, *pzErr is set to point to an English language
 71726  //  ** description of the error and an SQLITE_XXX error code is returned.
 71727  //  ** In this case the caller must call sqlite3DbFree(db, ) on *pzErr.
 71728  //  */
 71729  func _sqlite3VtabCallCreate(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab *int8, _pzErr **int8) (r0 int32) {
 71730  	var _rc int32
 71731  	var _zMod *int8
 71732  	var _pTab *XTable
 71733  	var _pMod *XModule
 71734  	_rc = int32(0)
 71735  	_pTab = _sqlite3FindTable(tls, _db, _zTab, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 71736  	func() {
 71737  		if _pTab == nil || _pTab.XnModuleArg == 0 || _pTab.XpVTable != nil {
 71738  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125687), unsafe.Pointer(&_sqlite3VtabCallCreateØ00__func__Ø000), unsafe.Pointer(str(91630)))
 71739  			crt.X__builtin_abort(tls)
 71740  		}
 71741  	}()
 71742  	_zMod = *elem0(_pTab.XazModuleArg, 0)
 71743  	_pMod = (*XModule)(_sqlite3HashFind(tls, &_db.XaModule, _zMod))
 71744  	if ((_pMod == nil) || (func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 71745  		v := (*Xsqlite3_module)(_pMod.XpModule).XxCreate
 71746  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 71747  	}() == nil)) || (func() func(*crt.TLS, *Xsqlite3_vtab) int32 {
 71748  		v := (*Xsqlite3_module)(_pMod.XpModule).XxDestroy
 71749  		return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v))
 71750  	}() == nil) {
 71751  		*_pzErr = _sqlite3MPrintf(tls, _db, str(91672), unsafe.Pointer(_zMod))
 71752  		_rc = int32(1)
 71753  		goto _7
 71754  	}
 71755  	_rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 71756  		v := (*Xsqlite3_module)(_pMod.XpModule).XxCreate
 71757  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 71758  	}(), _pzErr)
 71759  _7:
 71760  	if _rc != int32(0) || func() int32 {
 71761  		if _sqlite3GetVTable(tls, _db, _pTab) != nil {
 71762  			return int32(1)
 71763  		}
 71764  		return func() int32 {
 71765  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125706), unsafe.Pointer(&_sqlite3VtabCallCreateØ00__func__Ø000), unsafe.Pointer(str(4809)))
 71766  			crt.X__builtin_abort(tls)
 71767  			return int32(0)
 71768  		}()
 71769  	}() == 0 {
 71770  		goto _11
 71771  	}
 71772  	_rc = _growVTrans(tls, _db)
 71773  	if _rc == int32(0) {
 71774  		_addToVTrans(tls, _db, _sqlite3GetVTable(tls, _db, _pTab))
 71775  	}
 71776  _11:
 71777  	return _rc
 71778  }
 71779  
 71780  var _sqlite3VtabCallCreateØ00__func__Ø000 [22]int8
 71781  
 71782  func init() {
 71783  	crt.Xstrncpy(nil, &_sqlite3VtabCallCreateØ00__func__Ø000[0], str(91691), 22)
 71784  }
 71785  
 71786  // C comment
 71787  //  /*
 71788  //  ** Invoke a virtual table constructor (either xCreate or xConnect). The
 71789  //  ** pointer to the function to invoke is passed as the fourth parameter
 71790  //  ** to this procedure.
 71791  //  */
 71792  func _vtabCallConstructor(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable, _pMod *XModule, _xConstruct func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32, _pzErr **int8) (r0 int32) {
 71793  	var _rc, _nArg, _iDb, _10_iCol, _11_nType, _11_i, _14_j, _14_nDel int32
 71794  	var _zErr, _zModuleName, _9_zFormat, _11_zType *int8
 71795  	var _10_oooHidden uint8
 71796  	var _azArg **int8
 71797  	var _pVTable *XVTable
 71798  	var _sCtx XVtabCtx
 71799  	var _pCtx *XVtabCtx
 71800  	_azArg = _pTab.XazModuleArg
 71801  	_nArg = _pTab.XnModuleArg
 71802  	_zErr = nil
 71803  	_pCtx = (*XVtabCtx)(_db.XpVtabCtx)
 71804  _0:
 71805  	if _pCtx == nil {
 71806  		goto _3
 71807  	}
 71808  	if (*XTable)(_pCtx.XpTab) == _pTab {
 71809  		*_pzErr = _sqlite3MPrintf(tls, _db, str(91713), unsafe.Pointer(_pTab.XzName))
 71810  		return int32(6)
 71811  	}
 71812  	_pCtx = (*XVtabCtx)(_pCtx.XpPrior)
 71813  	goto _0
 71814  _3:
 71815  	_zModuleName = _sqlite3MPrintf(tls, _db, str(24531), unsafe.Pointer(_pTab.XzName))
 71816  	if _zModuleName == nil {
 71817  		return _sqlite3NomemError(tls, int32(125510))
 71818  	}
 71819  	_pVTable = (*XVTable)(_sqlite3DbMallocZero(tls, _db, uint64(48)))
 71820  	if _pVTable == nil {
 71821  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zModuleName))
 71822  		return _sqlite3NomemError(tls, int32(125516))
 71823  	}
 71824  	*(**Xsqlite3)(unsafe.Pointer(&_pVTable.Xdb)) = _db
 71825  	*(**XModule)(unsafe.Pointer(&_pVTable.XpMod)) = _pMod
 71826  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
 71827  	*elem0(_pTab.XazModuleArg, uintptr(1)) = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 71828  	func() {
 71829  		if &_db.XpVtabCtx == nil {
 71830  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125525), unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000), unsafe.Pointer(str(91755)))
 71831  			crt.X__builtin_abort(tls)
 71832  		}
 71833  	}()
 71834  	func() {
 71835  		if _xConstruct == nil {
 71836  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125526), unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000), unsafe.Pointer(str(91769)))
 71837  			crt.X__builtin_abort(tls)
 71838  		}
 71839  	}()
 71840  	*(**XTable)(unsafe.Pointer(&_sCtx.XpTab)) = _pTab
 71841  	*(**XVTable)(unsafe.Pointer(&_sCtx.XpVTable)) = _pVTable
 71842  	*(**XVtabCtx)(unsafe.Pointer(&_sCtx.XpPrior)) = (*XVtabCtx)(_db.XpVtabCtx)
 71843  	_sCtx.XbDeclared = int32(0)
 71844  	*(**XVtabCtx)(unsafe.Pointer(&_db.XpVtabCtx)) = &_sCtx
 71845  	_rc = _xConstruct(tls, _db, _pMod.XpAux, _nArg, _azArg, (**Xsqlite3_vtab)(unsafe.Pointer(&_pVTable.XpVtab)), &_zErr)
 71846  	*(**XVtabCtx)(unsafe.Pointer(&_db.XpVtabCtx)) = (*XVtabCtx)(_sCtx.XpPrior)
 71847  	if _rc == int32(7) {
 71848  		_sqlite3OomFault(tls, _db)
 71849  	}
 71850  	func() {
 71851  		if (*XTable)(_sCtx.XpTab) != _pTab {
 71852  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125535), unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000), unsafe.Pointer(str(91780)))
 71853  			crt.X__builtin_abort(tls)
 71854  		}
 71855  	}()
 71856  	if int32(0) == _rc {
 71857  		goto _14
 71858  	}
 71859  	if _zErr == nil {
 71860  		*_pzErr = _sqlite3MPrintf(tls, _db, str(91796), unsafe.Pointer(_zModuleName))
 71861  		goto _16
 71862  	}
 71863  	*_pzErr = _sqlite3MPrintf(tls, _db, str(24531), unsafe.Pointer(_zErr))
 71864  	Xsqlite3_free(tls, unsafe.Pointer(_zErr))
 71865  _16:
 71866  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pVTable))
 71867  	goto _20
 71868  _14:
 71869  	if func() int32 {
 71870  		if _pVTable.XpVtab != nil {
 71871  			return int32(1)
 71872  		}
 71873  		return func() int32 {
 71874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125545), unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000), unsafe.Pointer(str(4809)))
 71875  			crt.X__builtin_abort(tls)
 71876  			return int32(0)
 71877  		}()
 71878  	}() == 0 {
 71879  		goto _20
 71880  	}
 71881  	crt.Xmemset(tls, _pVTable.XpVtab, int32(0), uint64(24))
 71882  	*(**Xsqlite3_module)(unsafe.Pointer(&((*Xsqlite3_vtab)(_pVTable.XpVtab).XpModule))) = (*Xsqlite3_module)(_pMod.XpModule)
 71883  	_pVTable.XnRef = int32(1)
 71884  	if _sCtx.XbDeclared == int32(0) {
 71885  		_9_zFormat = str(91826)
 71886  		*_pzErr = _sqlite3MPrintf(tls, _db, _9_zFormat, unsafe.Pointer(_pTab.XzName))
 71887  		_sqlite3VtabUnlock(tls, _pVTable)
 71888  		_rc = int32(1)
 71889  		goto _22
 71890  	}
 71891  	_10_oooHidden = uint8(0)
 71892  	*(**XVTable)(unsafe.Pointer(&_pVTable.XpNext)) = (*XVTable)(_pTab.XpVTable)
 71893  	*(**XVTable)(unsafe.Pointer(&_pTab.XpVTable)) = _pVTable
 71894  	_10_iCol = int32(0)
 71895  _23:
 71896  	if _10_iCol >= int32(_pTab.XnCol) {
 71897  		goto _26
 71898  	}
 71899  	_11_zType = _sqlite3ColumnType(tls, elem43((*XColumn)(_pTab.XaCol), uintptr(_10_iCol)), str(284))
 71900  	_11_i = int32(0)
 71901  	_11_nType = _sqlite3Strlen30(tls, _11_zType)
 71902  	_11_i = int32(0)
 71903  _27:
 71904  	if _11_i >= _11_nType {
 71905  		goto _30
 71906  	}
 71907  	if ((int32(0) == Xsqlite3_strnicmp(tls, str(91872), elem1(_11_zType, uintptr(_11_i)), int32(6))) && ((_11_i == int32(0)) || (int32(*elem1(_11_zType, uintptr(_11_i-int32(1)))) == int32(32)))) && ((int32(*elem1(_11_zType, uintptr(_11_i+int32(6)))) == int32(0)) || (int32(*elem1(_11_zType, uintptr(_11_i+int32(6)))) == int32(32))) {
 71908  		goto _30
 71909  	}
 71910  	_11_i += 1
 71911  	goto _27
 71912  _30:
 71913  	if _11_i >= _11_nType {
 71914  		goto _36
 71915  	}
 71916  	_14_nDel = int32(6) + func() int32 {
 71917  		if (*elem1(_11_zType, uintptr(_11_i+int32(6)))) != 0 {
 71918  			return int32(1)
 71919  		}
 71920  		return int32(0)
 71921  	}()
 71922  	_14_j = _11_i
 71923  _39:
 71924  	if (_14_j + _14_nDel) > _11_nType {
 71925  		goto _42
 71926  	}
 71927  	*elem1(_11_zType, uintptr(_14_j)) = *elem1(_11_zType, uintptr(_14_j+_14_nDel))
 71928  	_14_j += 1
 71929  	goto _39
 71930  _42:
 71931  	if (int32(*elem1(_11_zType, uintptr(_11_i))) == int32(0)) && (_11_i > int32(0)) {
 71932  		func() {
 71933  			if int32(*elem1(_11_zType, uintptr(_11_i-int32(1)))) != int32(32) {
 71934  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125587), unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000), unsafe.Pointer(str(91879)))
 71935  				crt.X__builtin_abort(tls)
 71936  			}
 71937  		}()
 71938  		*elem1(_11_zType, uintptr(_11_i-int32(1))) = 0
 71939  	}
 71940  	{
 71941  		p := &(elem43((*XColumn)(_pTab.XaCol), uintptr(_10_iCol)).XcolFlags)
 71942  		*p = uint8(int32(*p) | int32(2))
 71943  	}
 71944  	_10_oooHidden = uint8(128)
 71945  	goto _47
 71946  _36:
 71947  	_pTab.XtabFlags |= uint32(_10_oooHidden)
 71948  _47:
 71949  	_10_iCol += 1
 71950  	goto _23
 71951  _26:
 71952  _22:
 71953  _20:
 71954  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zModuleName))
 71955  	return _rc
 71956  }
 71957  
 71958  var _vtabCallConstructorØ00__func__Ø000 [20]int8
 71959  
 71960  func init() {
 71961  	crt.Xstrncpy(nil, &_vtabCallConstructorØ00__func__Ø000[0], str(91895), 20)
 71962  }
 71963  
 71964  // C comment
 71965  //  /*
 71966  //  ** Return the declared type of a column.  Or return zDflt if the column
 71967  //  ** has no declared type.
 71968  //  **
 71969  //  ** The column type is an extra string stored after the zero-terminator on
 71970  //  ** the column name if and only if the COLFLAG_HASTYPE flag is set.
 71971  //  */
 71972  func _sqlite3ColumnType(tls *crt.TLS, _pCol *XColumn, _zDflt *int8) (r0 *int8) {
 71973  	if (int32(_pCol.XcolFlags) & int32(4)) == int32(0) {
 71974  		return _zDflt
 71975  	}
 71976  	return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCol.XzName))+uintptr(crt.Xstrlen(tls, _pCol.XzName)))))) + uintptr(int32(1))))
 71977  }
 71978  
 71979  // C comment
 71980  //  /*
 71981  //  ** This function is invoked by the vdbe to call the xDestroy method
 71982  //  ** of the virtual table named zTab in database iDb. This occurs
 71983  //  ** when a DROP TABLE is mentioned.
 71984  //  **
 71985  //  ** This call is a no-op if zTab is not a virtual table.
 71986  //  */
 71987  func _sqlite3VtabCallDestroy(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab *int8) (r0 int32) {
 71988  	var _rc int32
 71989  	var _pTab *XTable
 71990  	var _1_p *XVTable
 71991  	var _1_xDestroy func(*crt.TLS, *Xsqlite3_vtab) int32
 71992  	_rc = int32(0)
 71993  	_pTab = _sqlite3FindTable(tls, _db, _zTab, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 71994  	if _pTab == nil || func() int32 {
 71995  		if (*XVTable)(_pTab.XpVTable) != nil {
 71996  			return int32(1)
 71997  		}
 71998  		return func() int32 {
 71999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125811), unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000), unsafe.Pointer(str(4809)))
 72000  			crt.X__builtin_abort(tls)
 72001  			return int32(0)
 72002  		}()
 72003  	}() == 0 {
 72004  		goto _3
 72005  	}
 72006  	_1_p = (*XVTable)(_pTab.XpVTable)
 72007  _4:
 72008  	if _1_p == nil {
 72009  		goto _7
 72010  	}
 72011  	func() {
 72012  		if _1_p.XpVtab == nil {
 72013  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125815), unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000), unsafe.Pointer(str(91915)))
 72014  			crt.X__builtin_abort(tls)
 72015  		}
 72016  	}()
 72017  	if ((*Xsqlite3_vtab)(_1_p.XpVtab).XnRef) > int32(0) {
 72018  		return int32(6)
 72019  	}
 72020  	_1_p = (*XVTable)(_1_p.XpNext)
 72021  	goto _4
 72022  _7:
 72023  	_1_p = _vtabDisconnectAll(tls, _db, _pTab)
 72024  	_1_xDestroy = func() func(*crt.TLS, *Xsqlite3_vtab) int32 {
 72025  		v := (*Xsqlite3_module)((*XModule)(_1_p.XpMod).XpModule).XxDestroy
 72026  		return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v))
 72027  	}()
 72028  	func() {
 72029  		if _1_xDestroy == nil {
 72030  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125822), unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000), unsafe.Pointer(str(91924)))
 72031  			crt.X__builtin_abort(tls)
 72032  		}
 72033  	}()
 72034  	_rc = _1_xDestroy(tls, (*Xsqlite3_vtab)(_1_p.XpVtab))
 72035  	if _rc == int32(0) {
 72036  		func() {
 72037  			if (*XVTable)(_pTab.XpVTable) != _1_p || (*XVTable)(_1_p.XpNext) != nil {
 72038  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125826), unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000), unsafe.Pointer(str(91936)))
 72039  				crt.X__builtin_abort(tls)
 72040  			}
 72041  		}()
 72042  		*(**Xsqlite3_vtab)(unsafe.Pointer(&_1_p.XpVtab)) = nil
 72043  		*(**XVTable)(unsafe.Pointer(&_pTab.XpVTable)) = nil
 72044  		_sqlite3VtabUnlock(tls, _1_p)
 72045  	}
 72046  _3:
 72047  	return _rc
 72048  }
 72049  
 72050  var _sqlite3VtabCallDestroyØ00__func__Ø000 [23]int8
 72051  
 72052  func init() {
 72053  	crt.Xstrncpy(nil, &_sqlite3VtabCallDestroyØ00__func__Ø000[0], str(91968), 23)
 72054  }
 72055  
 72056  // C comment
 72057  //  /*
 72058  //  ** Set the maximum page count for a database if mxPage is positive.
 72059  //  ** No changes are made if mxPage is 0 or negative.
 72060  //  ** Regardless of the value of mxPage, return the maximum page count.
 72061  //  */
 72062  func _sqlite3BtreeMaxPageCount(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) {
 72063  	var _n int32
 72064  	_sqlite3BtreeEnter(tls, _p)
 72065  	_n = _sqlite3PagerMaxPageCount(tls, (*XPager)((*XBtShared)(_p.XpBt).XpPager), _mxPage)
 72066  	_sqlite3BtreeLeave(tls, _p)
 72067  	return _n
 72068  }
 72069  
 72070  // C comment
 72071  //  /*
 72072  //  ** Attempt to set the maximum database page count if mxPage is positive.
 72073  //  ** Make no changes if mxPage is zero or negative.  And never reduce the
 72074  //  ** maximum page count below the current size of the database.
 72075  //  **
 72076  //  ** Regardless of mxPage, return the current maximum page count.
 72077  //  */
 72078  func _sqlite3PagerMaxPageCount(tls *crt.TLS, _pPager *XPager, _mxPage int32) (r0 int32) {
 72079  	if _mxPage > int32(0) {
 72080  		_pPager.XmxPgno = uint32(_mxPage)
 72081  	}
 72082  	func() {
 72083  		if int32(_pPager.XeState) == int32(0) {
 72084  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50719), unsafe.Pointer(&_sqlite3PagerMaxPageCountØ00__func__Ø000), unsafe.Pointer(str(91991)))
 72085  			crt.X__builtin_abort(tls)
 72086  		}
 72087  	}()
 72088  	func() {
 72089  		if _pPager.XmxPgno < _pPager.XdbSize {
 72090  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50720), unsafe.Pointer(&_sqlite3PagerMaxPageCountØ00__func__Ø000), unsafe.Pointer(str(92018)))
 72091  			crt.X__builtin_abort(tls)
 72092  		}
 72093  	}()
 72094  	return int32(_pPager.XmxPgno)
 72095  }
 72096  
 72097  var _sqlite3PagerMaxPageCountØ00__func__Ø000 [25]int8
 72098  
 72099  func init() {
 72100  	crt.Xstrncpy(nil, &_sqlite3PagerMaxPageCountØ00__func__Ø000[0], str(92049), 25)
 72101  }
 72102  
 72103  // C comment
 72104  //  /*
 72105  //  ** This function returns a pointer to a nul-terminated string in memory
 72106  //  ** obtained from sqlite3DbMalloc(). If sqlite3.nVdbeExec is 1, then the
 72107  //  ** string contains a copy of zRawSql but with host parameters expanded to
 72108  //  ** their current bindings. Or, if sqlite3.nVdbeExec is greater than 1,
 72109  //  ** then the returned string holds a copy of zRawSql with "-- " prepended
 72110  //  ** to each line of text.
 72111  //  **
 72112  //  ** If the SQLITE_TRACE_SIZE_LIMIT macro is defined to an integer, then
 72113  //  ** then long strings and blobs are truncated to that many bytes.  This
 72114  //  ** can be used to prevent unreasonably large trace strings when dealing
 72115  //  ** with large (multi-megabyte) strings and blobs.
 72116  //  **
 72117  //  ** The calling function is responsible for making sure the memory returned
 72118  //  ** is eventually freed.
 72119  //  **
 72120  //  ** ALGORITHM:  Scan the input string looking for host parameters in any of
 72121  //  ** these forms:  ?, ?N, $A, @A, :A.  Take care to avoid text within
 72122  //  ** string literals, quoted identifier names, and comments.  For text forms,
 72123  //  ** the host parameter index is found by scanning the prepared
 72124  //  ** statement for the corresponding OP_Variable opcode.  Once the host
 72125  //  ** parameter index is known, locate the value in p->aVar[].  Then render
 72126  //  ** the value as a literal in place of the host parameter name.
 72127  //  */
 72128  func _sqlite3VdbeExpandSql(tls *crt.TLS, _p *TVdbe, _zRawSql *int8) (r0 *int8) {
 72129  	var _idx, _nextIndex, _n, _nToken, _i, _13_nOut, _17_nOut int32
 72130  	var _2_zStart *int8
 72131  	var _13_enc uint8
 72132  	var _db *Xsqlite3
 72133  	var _utf8 XMem
 72134  	var _pVar *XMem
 72135  	var _zBase [100]int8
 72136  	var _out XStrAccum
 72137  	_idx = int32(0)
 72138  	_nextIndex = int32(1)
 72139  	_db = (*Xsqlite3)(_p.Xdb)
 72140  	_sqlite3StrAccumInit(tls, &_out, nil, (*int8)(unsafe.Pointer(&_zBase)), int32(100), *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0))
 72141  	if _db.XnVdbeExec <= int32(1) {
 72142  		goto _0
 72143  	}
 72144  _1:
 72145  	if (*_zRawSql) == 0 {
 72146  		goto _2
 72147  	}
 72148  	_2_zStart = _zRawSql
 72149  _3:
 72150  	if (int32(*postInc1(&_zRawSql, 1)) != int32(10)) && ((*_zRawSql) != 0) {
 72151  		goto _3
 72152  	}
 72153  	_sqlite3StrAccumAppend(tls, &_out, str(70516), int32(3))
 72154  	func() {
 72155  		if int64(uintptr(unsafe.Pointer(_zRawSql))-uintptr(unsafe.Pointer(_2_zStart))) <= (0) {
 72156  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78101), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92074)))
 72157  			crt.X__builtin_abort(tls)
 72158  		}
 72159  	}()
 72160  	_sqlite3StrAccumAppend(tls, &_out, _2_zStart, int32(int64(uintptr(unsafe.Pointer(_zRawSql))-uintptr(unsafe.Pointer(_2_zStart)))))
 72161  	goto _1
 72162  _2:
 72163  	goto _10
 72164  _0:
 72165  	if int32(_p.XnVar) == int32(0) {
 72166  		_sqlite3StrAccumAppend(tls, &_out, _zRawSql, _sqlite3Strlen30(tls, _zRawSql))
 72167  		goto _10
 72168  	}
 72169  _11:
 72170  	if (*elem1(_zRawSql, 0)) == 0 {
 72171  		goto _12
 72172  	}
 72173  	_n = _findNextHostParameter(tls, _zRawSql, &_nToken)
 72174  	func() {
 72175  		if _n <= int32(0) {
 72176  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78109), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(1376)))
 72177  			crt.X__builtin_abort(tls)
 72178  		}
 72179  	}()
 72180  	_sqlite3StrAccumAppend(tls, &_out, _zRawSql, _n)
 72181  	*(*uintptr)(unsafe.Pointer(&_zRawSql)) += uintptr(_n)
 72182  	func() {
 72183  		if (*elem1(_zRawSql, 0)) == 0 && _nToken != int32(0) {
 72184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78112), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92097)))
 72185  			crt.X__builtin_abort(tls)
 72186  		}
 72187  	}()
 72188  	if _nToken == int32(0) {
 72189  		goto _12
 72190  	}
 72191  	if int32(*elem1(_zRawSql, 0)) != int32(63) {
 72192  		goto _19
 72193  	}
 72194  	if _nToken > int32(1) {
 72195  		func() {
 72196  			if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zRawSql, uintptr(1)))))) & int32(4)) == 0 {
 72197  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78116), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92121)))
 72198  				crt.X__builtin_abort(tls)
 72199  			}
 72200  		}()
 72201  		_sqlite3GetInt32(tls, elem1(_zRawSql, uintptr(1)), &_idx)
 72202  		goto _23
 72203  	}
 72204  	_idx = _nextIndex
 72205  _23:
 72206  	goto _24
 72207  _19:
 72208  	func() {
 72209  		if int32(*elem1(_zRawSql, 0)) != int32(58) && int32(*elem1(_zRawSql, 0)) != int32(36) && int32(*elem1(_zRawSql, 0)) != int32(64) && int32(*elem1(_zRawSql, 0)) != int32(35) {
 72210  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78122), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92148)))
 72211  			crt.X__builtin_abort(tls)
 72212  		}
 72213  	}()
 72214  	_idx = _sqlite3VdbeParameterIndex(tls, _p, _zRawSql, _nToken)
 72215  	func() {
 72216  		if _idx <= int32(0) {
 72217  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78129), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92221)))
 72218  			crt.X__builtin_abort(tls)
 72219  		}
 72220  	}()
 72221  _24:
 72222  	*(*uintptr)(unsafe.Pointer(&_zRawSql)) += uintptr(_nToken)
 72223  	_nextIndex = _idx + int32(1)
 72224  	func() {
 72225  		if _idx <= int32(0) || _idx > int32(_p.XnVar) {
 72226  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78133), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92227)))
 72227  			crt.X__builtin_abort(tls)
 72228  		}
 72229  	}()
 72230  	_pVar = elem25((*XMem)(_p.XaVar), uintptr(_idx-int32(1)))
 72231  	if (int32(_pVar.Xflags) & int32(1)) != 0 {
 72232  		_sqlite3StrAccumAppend(tls, &_out, str(285), int32(4))
 72233  		goto _47
 72234  	}
 72235  	if (int32(_pVar.Xflags) & int32(4)) != 0 {
 72236  		_sqlite3XPrintf(tls, &_out, str(6249), *(*int64)(unsafe.Pointer(&_pVar.Xu)))
 72237  		goto _47
 72238  	}
 72239  	if (int32(_pVar.Xflags) & int32(8)) != 0 {
 72240  		_sqlite3XPrintf(tls, &_out, str(6268), *(*float64)(unsafe.Pointer(&_pVar.Xu)))
 72241  		goto _47
 72242  	}
 72243  	if (int32(_pVar.Xflags) & int32(2)) == 0 {
 72244  		goto _41
 72245  	}
 72246  	_13_enc = _db.Xenc
 72247  	if int32(_13_enc) == int32(1) {
 72248  		goto _42
 72249  	}
 72250  	crt.Xmemset(tls, unsafe.Pointer(&_utf8), int32(0), uint64(72))
 72251  	*(**Xsqlite3)(unsafe.Pointer(&_utf8.Xdb)) = _db
 72252  	_sqlite3VdbeMemSetStr(tls, &_utf8, _pVar.Xz, _pVar.Xn, _13_enc, nil)
 72253  	if int32(7) == _sqlite3VdbeChangeEncoding(tls, &_utf8, int32(1)) {
 72254  		_out.XaccError = uint8(1)
 72255  		_out.XnAlloc = 0
 72256  	}
 72257  	_pVar = &_utf8
 72258  _42:
 72259  	_13_nOut = _pVar.Xn
 72260  	_sqlite3XPrintf(tls, &_out, str(92249), _13_nOut, unsafe.Pointer(_pVar.Xz))
 72261  	if int32(_13_enc) != int32(1) {
 72262  		_sqlite3VdbeMemRelease(tls, &_utf8)
 72263  	}
 72264  	goto _47
 72265  _41:
 72266  	if (int32(_pVar.Xflags) & int32(16384)) != 0 {
 72267  		_sqlite3XPrintf(tls, &_out, str(92256), *(*int32)(unsafe.Pointer(&_pVar.Xu)))
 72268  		goto _47
 72269  	}
 72270  	func() {
 72271  		if (int32(_pVar.Xflags) & int32(16)) == 0 {
 72272  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78176), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92269)))
 72273  			crt.X__builtin_abort(tls)
 72274  		}
 72275  	}()
 72276  	_sqlite3StrAccumAppend(tls, &_out, str(92292), int32(2))
 72277  	_17_nOut = _pVar.Xn
 72278  	_i = int32(0)
 72279  _50:
 72280  	if _i >= _17_nOut {
 72281  		goto _53
 72282  	}
 72283  	_sqlite3XPrintf(tls, &_out, str(92295), int32(*elem1(_pVar.Xz, uintptr(_i)))&int32(255))
 72284  	_i += 1
 72285  	goto _50
 72286  _53:
 72287  	_sqlite3StrAccumAppend(tls, &_out, str(92300), int32(1))
 72288  _47:
 72289  	goto _11
 72290  _12:
 72291  _10:
 72292  	if _out.XaccError != 0 {
 72293  		_sqlite3StrAccumReset(tls, &_out)
 72294  	}
 72295  	return _sqlite3StrAccumFinish(tls, &_out)
 72296  
 72297  	_ = _zBase
 72298  	panic(0)
 72299  }
 72300  
 72301  var _sqlite3VdbeExpandSqlØ00__func__Ø000 [21]int8
 72302  
 72303  func init() {
 72304  	crt.Xstrncpy(nil, &_sqlite3VdbeExpandSqlØ00__func__Ø000[0], str(92302), 21)
 72305  }
 72306  
 72307  // C comment
 72308  //  /*
 72309  //  ** zSql is a zero-terminated string of UTF-8 SQL text.  Return the number of
 72310  //  ** bytes in this text up to but excluding the first character in
 72311  //  ** a host parameter.  If the text contains no host parameters, return
 72312  //  ** the total number of bytes in the text.
 72313  //  */
 72314  func _findNextHostParameter(tls *crt.TLS, _zSql *int8, _pnToken *int32) (r0 int32) {
 72315  	var _tokenType, _nTotal, _n int32
 72316  	_nTotal = int32(0)
 72317  	*_pnToken = int32(0)
 72318  _0:
 72319  	if (*elem1(_zSql, 0)) == 0 {
 72320  		goto _1
 72321  	}
 72322  	_n = _sqlite3GetToken(tls, (*uint8)(unsafe.Pointer(_zSql)), &_tokenType)
 72323  	func() {
 72324  		if _n <= int32(0) || _tokenType == int32(164) {
 72325  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78041), unsafe.Pointer(&_findNextHostParameterØ00__func__Ø000), unsafe.Pointer(str(92323)))
 72326  			crt.X__builtin_abort(tls)
 72327  		}
 72328  	}()
 72329  	if _tokenType == int32(135) {
 72330  		*_pnToken = _n
 72331  		goto _1
 72332  	}
 72333  	_nTotal += _n
 72334  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(_n)
 72335  	goto _0
 72336  _1:
 72337  	return _nTotal
 72338  }
 72339  
 72340  var _findNextHostParameterØ00__func__Ø000 [22]int8
 72341  
 72342  func init() {
 72343  	crt.Xstrncpy(nil, &_findNextHostParameterØ00__func__Ø000[0], str(92352), 22)
 72344  }
 72345  
 72346  // C comment
 72347  //  /*
 72348  //  ** The sqlite3_strlike() interface.  Return 0 on a match and non-zero for
 72349  //  ** a miss - like strcmp().
 72350  //  */
 72351  func Xsqlite3_strlike(tls *crt.TLS, _zPattern *int8, _zStr *int8, _esc uint32) (r0 int32) {
 72352  	return _patternCompare(tls, (*uint8)(unsafe.Pointer(_zPattern)), (*uint8)(unsafe.Pointer(_zStr)), &_likeInfoNorm, _esc)
 72353  }
 72354  
 72355  // C comment
 72356  //  /* The correct SQL-92 behavior is for the LIKE operator to ignore
 72357  //  ** case.  Thus  'a' LIKE 'A' would be true. */
 72358  var _likeInfoNorm TcompareInfo
 72359  
 72360  func init() {
 72361  	_likeInfoNorm = TcompareInfo{XmatchAll: uint8(37), XmatchOne: uint8(95), XnoCase: uint8(1)}
 72362  }
 72363  
 72364  // C comment
 72365  //  /*
 72366  //  ** This function is called after a transaction has been committed. It
 72367  //  ** invokes callbacks registered with sqlite3_wal_hook() as required.
 72368  //  */
 72369  func _doWalCallbacks(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 72370  	var _rc, _i, _2_nEntry int32
 72371  	var _1_pBt *XBtree
 72372  	_rc = int32(0)
 72373  	_i = int32(0)
 72374  _0:
 72375  	if _i >= _db.XnDb {
 72376  		goto _3
 72377  	}
 72378  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 72379  	if _1_pBt == nil {
 72380  		goto _4
 72381  	}
 72382  	_sqlite3BtreeEnter(tls, _1_pBt)
 72383  	_2_nEntry = _sqlite3PagerWalCallback(tls, _sqlite3BtreePager(tls, _1_pBt))
 72384  	_sqlite3BtreeLeave(tls, _1_pBt)
 72385  	if ((_db.XxWalCallback != nil) && (_2_nEntry > int32(0))) && (_rc == int32(0)) {
 72386  		_rc = func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32 {
 72387  			v := _db.XxWalCallback
 72388  			return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&v))
 72389  		}()(tls, _db.XpWalArg, _db, elem27((*XDb)(_db.XaDb), uintptr(_i)).XzDbSName, _2_nEntry)
 72390  	}
 72391  _4:
 72392  	_i += 1
 72393  	goto _0
 72394  _3:
 72395  	return _rc
 72396  }
 72397  
 72398  func _sqlite3PagerWalCallback(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 72399  	return _sqlite3WalCallback(tls, (*XWal)(_pPager.XpWal))
 72400  }
 72401  
 72402  // C comment
 72403  //  /* Return the value to pass to a sqlite3_wal_hook callback, the
 72404  //  ** number of frames in the WAL at the point of the last commit since
 72405  //  ** sqlite3WalCallback() was called.  If no commits have occurred since
 72406  //  ** the last call, then return 0.
 72407  //  */
 72408  func _sqlite3WalCallback(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 72409  	var _ret uint32
 72410  	_ret = uint32(0)
 72411  	if _pWal != nil {
 72412  		_ret = _pWal.XiCallback
 72413  		_pWal.XiCallback = 0
 72414  	}
 72415  	return int32(_ret)
 72416  }
 72417  
 72418  // C comment
 72419  //  /*
 72420  //  ** Rerun the compilation of a statement after a schema change.
 72421  //  **
 72422  //  ** If the statement is successfully recompiled, return SQLITE_OK. Otherwise,
 72423  //  ** if the statement cannot be recompiled because another connection has
 72424  //  ** locked the sqlite3_master table, return SQLITE_LOCKED. If any other error
 72425  //  ** occurs, return SQLITE_SCHEMA.
 72426  //  */
 72427  func _sqlite3Reprepare(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 72428  	var _rc int32
 72429  	var _zSql *int8
 72430  	var _pNew unsafe.Pointer
 72431  	var _db *Xsqlite3
 72432  	func() {
 72433  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_sqlite3VdbeDb(tls, _p).Xmutex)) == 0 {
 72434  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116374), unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000), unsafe.Pointer(str(92374)))
 72435  			crt.X__builtin_abort(tls)
 72436  		}
 72437  	}()
 72438  	_zSql = Xsqlite3_sql(tls, unsafe.Pointer(_p))
 72439  	func() {
 72440  		if _zSql == nil {
 72441  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116376), unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000), unsafe.Pointer(str(24569)))
 72442  			crt.X__builtin_abort(tls)
 72443  		}
 72444  	}()
 72445  	_db = _sqlite3VdbeDb(tls, _p)
 72446  	func() {
 72447  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 72448  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116378), unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000), unsafe.Pointer(str(881)))
 72449  			crt.X__builtin_abort(tls)
 72450  		}
 72451  	}()
 72452  	_rc = _sqlite3LockAndPrepare(tls, _db, _zSql, int32(-1), int32(0), _p, &_pNew, nil)
 72453  	if _rc == 0 {
 72454  		goto _6
 72455  	}
 72456  	if _rc == int32(7) {
 72457  		_sqlite3OomFault(tls, _db)
 72458  	}
 72459  	func() {
 72460  		if _pNew != nil {
 72461  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116384), unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000), unsafe.Pointer(str(92418)))
 72462  			crt.X__builtin_abort(tls)
 72463  		}
 72464  	}()
 72465  	return _rc
 72466  
 72467  _6:
 72468  	func() {
 72469  		if _pNew == nil {
 72470  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116387), unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000), unsafe.Pointer(str(21101)))
 72471  			crt.X__builtin_abort(tls)
 72472  		}
 72473  	}()
 72474  	_sqlite3VdbeSwap(tls, (*TVdbe)(_pNew), _p)
 72475  	_sqlite3TransferBindings(tls, _pNew, unsafe.Pointer(_p))
 72476  	_sqlite3VdbeResetStepResult(tls, (*TVdbe)(_pNew))
 72477  	_sqlite3VdbeFinalize(tls, (*TVdbe)(_pNew))
 72478  	return int32(0)
 72479  }
 72480  
 72481  var _sqlite3ReprepareØ00__func__Ø000 [17]int8
 72482  
 72483  func init() {
 72484  	crt.Xstrncpy(nil, &_sqlite3ReprepareØ00__func__Ø000[0], str(92426), 17)
 72485  }
 72486  
 72487  // C comment
 72488  //  /*
 72489  //  ** Return the SQL associated with a prepared statement
 72490  //  */
 72491  func Xsqlite3_sql(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *int8) {
 72492  	var _p *TVdbe
 72493  	_p = (*TVdbe)(_pStmt)
 72494  	return func() *int8 {
 72495  		if _p != nil {
 72496  			return _p.XzSql
 72497  		}
 72498  		return nil
 72499  	}()
 72500  }
 72501  
 72502  // C comment
 72503  //  /*
 72504  //  ** Swap all content between two VDBE structures.
 72505  //  */
 72506  func _sqlite3VdbeSwap(tls *crt.TLS, _pA *TVdbe, _pB *TVdbe) {
 72507  	var _zTmp *int8
 72508  	var _pTmp *TVdbe
 72509  	var _tmp TVdbe
 72510  	func() {
 72511  		if (*Xsqlite3)(_pA.Xdb) != (*Xsqlite3)(_pB.Xdb) {
 72512  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71495), unsafe.Pointer(&_sqlite3VdbeSwapØ00__func__Ø000), unsafe.Pointer(str(92443)))
 72513  			crt.X__builtin_abort(tls)
 72514  		}
 72515  	}()
 72516  	_tmp = *_pA
 72517  	*_pA = *_pB
 72518  	*_pB = _tmp
 72519  	_pTmp = (*TVdbe)(_pA.XpNext)
 72520  	*(**TVdbe)(unsafe.Pointer(&_pA.XpNext)) = (*TVdbe)(_pB.XpNext)
 72521  	*(**TVdbe)(unsafe.Pointer(&_pB.XpNext)) = _pTmp
 72522  	_pTmp = (*TVdbe)(_pA.XpPrev)
 72523  	*(**TVdbe)(unsafe.Pointer(&_pA.XpPrev)) = (*TVdbe)(_pB.XpPrev)
 72524  	*(**TVdbe)(unsafe.Pointer(&_pB.XpPrev)) = _pTmp
 72525  	_zTmp = _pA.XzSql
 72526  	_pA.XzSql = _pB.XzSql
 72527  	_pB.XzSql = _zTmp
 72528  	storebits26(&_pB.Xexpired, int16((uint32(_pA.Xexpired>>9)<<31)>>31), 512, 9)
 72529  	_pB.Xexpmask = _pA.Xexpmask
 72530  }
 72531  
 72532  var _sqlite3VdbeSwapØ00__func__Ø000 [16]int8
 72533  
 72534  func init() {
 72535  	crt.Xstrncpy(nil, &_sqlite3VdbeSwapØ00__func__Ø000[0], str(92458), 16)
 72536  }
 72537  
 72538  // C comment
 72539  //  /*
 72540  //  ** Transfer all bindings from the first statement over to the second.
 72541  //  */
 72542  func _sqlite3TransferBindings(tls *crt.TLS, _pFromStmt unsafe.Pointer, _pToStmt unsafe.Pointer) (r0 int32) {
 72543  	var _i int32
 72544  	var _pFrom, _pTo *TVdbe
 72545  	_pFrom = (*TVdbe)(_pFromStmt)
 72546  	_pTo = (*TVdbe)(_pToStmt)
 72547  	func() {
 72548  		if (*Xsqlite3)(_pTo.Xdb) != (*Xsqlite3)(_pFrom.Xdb) {
 72549  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77607), unsafe.Pointer(&_sqlite3TransferBindingsØ00__func__Ø000), unsafe.Pointer(str(71180)))
 72550  			crt.X__builtin_abort(tls)
 72551  		}
 72552  	}()
 72553  	func() {
 72554  		if int32(_pTo.XnVar) != int32(_pFrom.XnVar) {
 72555  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77608), unsafe.Pointer(&_sqlite3TransferBindingsØ00__func__Ø000), unsafe.Pointer(str(92474)))
 72556  			crt.X__builtin_abort(tls)
 72557  		}
 72558  	}()
 72559  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pTo.Xdb).Xmutex))
 72560  	_i = int32(0)
 72561  _4:
 72562  	if _i >= int32(_pFrom.XnVar) {
 72563  		goto _7
 72564  	}
 72565  	_sqlite3VdbeMemMove(tls, elem25((*XMem)(_pTo.XaVar), uintptr(_i)), elem25((*XMem)(_pFrom.XaVar), uintptr(_i)))
 72566  	_i += 1
 72567  	goto _4
 72568  _7:
 72569  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pTo.Xdb).Xmutex))
 72570  	return int32(0)
 72571  }
 72572  
 72573  var _sqlite3TransferBindingsØ00__func__Ø000 [24]int8
 72574  
 72575  func init() {
 72576  	crt.Xstrncpy(nil, &_sqlite3TransferBindingsØ00__func__Ø000[0], str(92497), 24)
 72577  }
 72578  
 72579  // C comment
 72580  //  /*
 72581  //  ** Each VDBE holds the result of the most recent sqlite3_step() call
 72582  //  ** in p->rc.  This routine sets that result back to SQLITE_OK.
 72583  //  */
 72584  func _sqlite3VdbeResetStepResult(tls *crt.TLS, _p *TVdbe) {
 72585  	_p.Xrc = int32(0)
 72586  }
 72587  
 72588  var _sqlite3_stepØ00__func__Ø000 [13]int8
 72589  
 72590  func init() {
 72591  	crt.Xstrncpy(nil, &_sqlite3_stepØ00__func__Ø000[0], str(92521), 13)
 72592  }
 72593  
 72594  // C comment
 72595  //  /*
 72596  //  ** Parameter zName points to a nul-terminated buffer containing the name
 72597  //  ** of a database ("main", "temp" or the name of an attached db). This
 72598  //  ** function returns the index of the named database in db->aDb[], or
 72599  //  ** -1 if the named db cannot be found.
 72600  //  */
 72601  func _sqlite3FindDbName(tls *crt.TLS, _db *Xsqlite3, _zName *int8) (r0 int32) {
 72602  	var _i int32
 72603  	var _1_pDb *XDb
 72604  	_i = int32(-1)
 72605  	if _zName == nil {
 72606  		goto _0
 72607  	}
 72608  	*func() **XDb { _i = _db.XnDb - int32(1); return &_1_pDb }() = elem27((*XDb)(_db.XaDb), uintptr(_i))
 72609  _1:
 72610  	if _i < int32(0) {
 72611  		goto _4
 72612  	}
 72613  	if int32(0) == Xsqlite3_stricmp(tls, _1_pDb.XzDbSName, _zName) {
 72614  		goto _4
 72615  	}
 72616  	if (_i == int32(0)) && (int32(0) == Xsqlite3_stricmp(tls, str(92534), _zName)) {
 72617  		goto _4
 72618  	}
 72619  	*(*uintptr)(unsafe.Pointer(func() **XDb { _i -= 1; return &_1_pDb }())) += uintptr(18446744073709551584)
 72620  	goto _1
 72621  _4:
 72622  _0:
 72623  	return _i
 72624  }
 72625  
 72626  // C comment
 72627  //  /*
 72628  //  ** Check to see if zTabName is really the name of a pragma.  If it is,
 72629  //  ** then register an eponymous virtual table for that pragma and return
 72630  //  ** a pointer to the Module object for the new virtual table.
 72631  //  */
 72632  func _sqlite3PragmaVtabRegister(tls *crt.TLS, _db *Xsqlite3, _zName *int8) (r0 *XModule) {
 72633  	var _pName *XPragmaName
 72634  	func() {
 72635  		if Xsqlite3_strnicmp(tls, _zName, str(49769), int32(7)) != int32(0) {
 72636  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115653), unsafe.Pointer(&_sqlite3PragmaVtabRegisterØ00__func__Ø000), unsafe.Pointer(str(92539)))
 72637  			crt.X__builtin_abort(tls)
 72638  		}
 72639  	}()
 72640  	_pName = _pragmaLocate(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zName))+uintptr(int32(7)))))
 72641  	if _pName == nil {
 72642  		return nil
 72643  	}
 72644  	if (int32(_pName.XmPragFlg) & int32(48)) == int32(0) {
 72645  		return nil
 72646  	}
 72647  	func() {
 72648  		if _sqlite3HashFind(tls, &_db.XaModule, _zName) != nil {
 72649  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115657), unsafe.Pointer(&_sqlite3PragmaVtabRegisterØ00__func__Ø000), unsafe.Pointer(str(92580)))
 72650  			crt.X__builtin_abort(tls)
 72651  		}
 72652  	}()
 72653  	return _sqlite3VtabCreateModule(tls, _db, _zName, &_pragmaVtabModule, unsafe.Pointer(_pName), nil)
 72654  }
 72655  
 72656  var _sqlite3PragmaVtabRegisterØ00__func__Ø000 [26]int8
 72657  
 72658  func init() {
 72659  	crt.Xstrncpy(nil, &_sqlite3PragmaVtabRegisterØ00__func__Ø000[0], str(92620), 26)
 72660  }
 72661  
 72662  // C comment
 72663  //  /*
 72664  //  ** Locate a pragma in the aPragmaName[] array.
 72665  //  */
 72666  func _pragmaLocate(tls *crt.TLS, _zName *int8) (r0 *XPragmaName) {
 72667  	var _upr, _lwr, _mid, _rc int32
 72668  	_mid = int32(0)
 72669  	_lwr = int32(0)
 72670  	_upr = int32(66)
 72671  _0:
 72672  	if _lwr > _upr {
 72673  		goto _1
 72674  	}
 72675  	_mid = (_lwr + _upr) / int32(2)
 72676  	_rc = Xsqlite3_stricmp(tls, _zName, elem96((*XPragmaName)(unsafe.Pointer(&_aPragmaName)), uintptr(_mid)).XzName)
 72677  	if _rc == int32(0) {
 72678  		goto _1
 72679  	}
 72680  	if _rc < int32(0) {
 72681  		_upr = _mid - int32(1)
 72682  		goto _4
 72683  	}
 72684  	_lwr = _mid + int32(1)
 72685  _4:
 72686  	goto _0
 72687  _1:
 72688  	return func() *XPragmaName {
 72689  		if _lwr > _upr {
 72690  			return nil
 72691  		}
 72692  		return elem96((*XPragmaName)(unsafe.Pointer(&_aPragmaName)), uintptr(_mid))
 72693  	}()
 72694  }
 72695  
 72696  var _aPragmaName [67]XPragmaName
 72697  
 72698  func init() {
 72699  	_aPragmaName = [67]XPragmaName{XPragmaName{XzName: str(92646), XmPragFlg: uint8(20), XiArg: uint32(8)}, XPragmaName{XzName: str(92661), XePragTyp: uint8(1), XmPragFlg: uint8(149)}, XPragmaName{XzName: str(92673), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(1048576)}, XPragmaName{XzName: str(92689), XePragTyp: uint8(3), XmPragFlg: uint8(16), XiPragCName: uint8(46), XnPragCName: uint8(1)}, XPragmaName{XzName: str(92702), XePragTyp: uint8(4), XmPragFlg: uint8(149)}, XPragmaName{XzName: str(92713), XePragTyp: uint8(5), XmPragFlg: uint8(148)}, XPragmaName{XzName: str(92725), XePragTyp: uint8(6), XmPragFlg: uint8(2)}, XPragmaName{XzName: str(92745), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(536870912)}, XPragmaName{XzName: str(92761), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(16)}, XPragmaName{XzName: str(92782), XePragTyp: uint8(7), XmPragFlg: uint8(16), XiPragCName: uint8(29), XnPragCName: uint8(2)}, XPragmaName{XzName: str(92797), XePragTyp: uint8(8), XmPragFlg: uint8(16)}, XPragmaName{XzName: str(92813), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(128)}, XPragmaName{XzName: str(92827), XmPragFlg: uint8(24), XiArg: uint32(15)}, XPragmaName{XzName: str(92840), XePragTyp: uint8(10), XmPragFlg: uint8(17), XiPragCName: uint8(26), XnPragCName: uint8(3)}, XPragmaName{XzName: str(92854), XePragTyp: uint8(11), XmPragFlg: uint8(149), XnPragCName: uint8(1)}, XPragmaName{XzName: str(92873), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(33554432)}, XPragmaName{XzName: str(92892), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(256)}, XPragmaName{XzName: str(92915), XePragTyp: uint8(12), XmPragFlg: uint8(20)}, XPragmaName{XzName: str(92924), XePragTyp: uint8(13), XmPragFlg: uint8(1), XiPragCName: uint8(39), XnPragCName: uint8(4)}, XPragmaName{XzName: str(92942), XePragTyp: uint8(14), XmPragFlg: uint8(97), XiPragCName: uint8(31), XnPragCName: uint8(8)}, XPragmaName{XzName: str(92959), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(524288)}, XPragmaName{XzName: str(92972), XmPragFlg: uint8(24)}, XPragmaName{XzName: str(92987), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(4)}, XPragmaName{XzName: str(93005), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(8)}, XPragmaName{XzName: str(93015), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(8192)}, XPragmaName{XzName: str(93040), XePragTyp: uint8(15), XmPragFlg: uint8(3)}, XPragmaName{XzName: str(93059), XePragTyp: uint8(16), XmPragFlg: uint8(97), XiPragCName: uint8(12), XnPragCName: uint8(3)}, XPragmaName{XzName: str(93070), XePragTyp: uint8(17), XmPragFlg: uint8(97), XiPragCName: uint8(21), XnPragCName: uint8(5)}, XPragmaName{XzName: str(93081), XePragTyp: uint8(16), XmPragFlg: uint8(97), XiPragCName: uint8(15), XnPragCName: uint8(6), XiArg: uint32(1)}, XPragmaName{XzName: str(93093), XePragTyp: uint8(18), XmPragFlg: uint8(1)}, XPragmaName{XzName: str(93109), XePragTyp: uint8(19), XmPragFlg: uint8(145)}, XPragmaName{XzName: str(93122), XePragTyp: uint8(20), XmPragFlg: uint8(144)}, XPragmaName{XzName: str(93141), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(32768)}, XPragmaName{XzName: str(93160), XePragTyp: uint8(41), XmPragFlg: uint8(16), XiPragCName: uint8(47), XnPragCName: uint8(2)}, XPragmaName{XzName: str(93172), XePragTyp: uint8(22), XmPragFlg: uint8(144)}, XPragmaName{XzName: str(93185), XePragTyp: uint8(23), XmPragFlg: uint8(145)}, XPragmaName{XzName: str(93200), XePragTyp: uint8(24)}, XPragmaName{XzName: str(93210), XePragTyp: uint8(25), XmPragFlg: uint8(33)}, XPragmaName{XzName: str(93219), XePragTyp: uint8(23), XmPragFlg: uint8(145)}, XPragmaName{XzName: str(93230), XePragTyp: uint8(26), XmPragFlg: uint8(148)}, XPragmaName{XzName: str(93240), XePragTyp: uint8(42)}, XPragmaName{XzName: str(93253), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(67108864)}, XPragmaName{XzName: str(93264), XePragTyp: uint8(18), XmPragFlg: uint8(1)}, XPragmaName{XzName: str(93276), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(16384)}, XPragmaName{XzName: str(93293), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(262144)}, XPragmaName{XzName: str(93312), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(131072)}, XPragmaName{XzName: str(93338), XmPragFlg: uint8(20), XiArg: uint32(1)}, XPragmaName{XzName: str(93353), XePragTyp: uint8(27), XmPragFlg: uint8(16)}, XPragmaName{XzName: str(93367), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(64)}, XPragmaName{XzName: str(93386), XePragTyp: uint8(28), XmPragFlg: uint8(2)}, XPragmaName{XzName: str(93400), XePragTyp: uint8(29), XmPragFlg: uint8(16)}, XPragmaName{XzName: str(93416), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(512)}, XPragmaName{XzName: str(93426), XePragTyp: uint8(43), XmPragFlg: uint8(145), XiPragCName: uint8(7), XnPragCName: uint8(5)}, XPragmaName{XzName: str(93432), XePragTyp: uint8(30), XmPragFlg: uint8(149)}, XPragmaName{XzName: str(93444), XePragTyp: uint8(31), XmPragFlg: uint8(97), XiPragCName: uint8(1), XnPragCName: uint8(6)}, XPragmaName{XzName: str(93455), XePragTyp: uint8(32), XmPragFlg: uint8(20)}, XPragmaName{XzName: str(93466), XePragTyp: uint8(33), XmPragFlg: uint8(4)}, XPragmaName{XzName: str(93487), XePragTyp: uint8(34), XmPragFlg: uint8(16)}, XPragmaName{XzName: str(93495), XmPragFlg: uint8(20), XiArg: uint32(6)}, XPragmaName{XzName: str(93508), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(4096)}, XPragmaName{XzName: str(93524), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(1537)}, XPragmaName{XzName: str(93535), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(134217728)}, XPragmaName{XzName: str(93544), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(1024)}, XPragmaName{XzName: str(93557), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(1)}, XPragmaName{XzName: str(93568), XePragTyp: uint8(35)}, XPragmaName{XzName: str(93587), XePragTyp: uint8(36), XmPragFlg: uint8(1), XiPragCName: uint8(43), XnPragCName: uint8(3)}, XPragmaName{XzName: str(93602), XePragTyp: uint8(2), XmPragFlg: uint8(20), XiArg: uint32(67584)}}
 72700  }
 72701  
 72702  // C comment
 72703  //  /* The pragma virtual table object */
 72704  var _pragmaVtabModule Xsqlite3_module
 72705  
 72706  func init() {
 72707  	_pragmaVtabModule = Xsqlite3_module{XxConnect: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
 72708  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
 72709  	}{_pragmaVtabConnect})), XxBestIndex: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72710  		f func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32
 72711  	}{_pragmaVtabBestIndex})), XxDisconnect: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72712  		f func(*crt.TLS, *Xsqlite3_vtab) int32
 72713  	}{_pragmaVtabDisconnect})), XxOpen: *(*func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72714  		f func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_vtab_cursor) int32
 72715  	}{_pragmaVtabOpen})), XxClose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72716  		f func(*crt.TLS, *Xsqlite3_vtab_cursor) int32
 72717  	}{_pragmaVtabClose})), XxFilter: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72718  		f func(*crt.TLS, *Xsqlite3_vtab_cursor, int32, *int8, int32, **XMem) int32
 72719  	}{_pragmaVtabFilter})), XxNext: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72720  		f func(*crt.TLS, *Xsqlite3_vtab_cursor) int32
 72721  	}{_pragmaVtabNext})), XxEof: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72722  		f func(*crt.TLS, *Xsqlite3_vtab_cursor) int32
 72723  	}{_pragmaVtabEof})), XxColumn: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 72724  		f func(*crt.TLS, *Xsqlite3_vtab_cursor, *Xsqlite3_context, int32) int32
 72725  	}{_pragmaVtabColumn})), XxRowid: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
 72726  		f func(*crt.TLS, *Xsqlite3_vtab_cursor, *int64) int32
 72727  	}{_pragmaVtabRowid}))}
 72728  }
 72729  
 72730  // C comment
 72731  //  /*
 72732  //  ** Pragma virtual table module xConnect method.
 72733  //  */
 72734  func _pragmaVtabConnect(tls *crt.TLS, _db *Xsqlite3, _pAux unsafe.Pointer, _argc int32, _argv **int8, _ppVtab **Xsqlite3_vtab, _pzErr **int8) (r0 int32) {
 72735  	var _rc, _i, _j int32
 72736  	var _cSep int8
 72737  	var _acc XStrAccum
 72738  	var _zBuf [200]int8
 72739  	var _pPragma *XPragmaName
 72740  	var _pTab *XPragmaVtab
 72741  	_pPragma = (*XPragmaName)(_pAux)
 72742  	_pTab = nil
 72743  	_cSep = int8(40)
 72744  
 72745  	_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBuf)), int32(200), int32(0))
 72746  	_sqlite3StrAccumAppendAll(tls, &_acc, str(93618))
 72747  	*func() *int32 { _i = int32(0); return &_j }() = int32(_pPragma.XiPragCName)
 72748  _0:
 72749  	if _i >= int32(_pPragma.XnPragCName) {
 72750  		goto _3
 72751  	}
 72752  	_sqlite3XPrintf(tls, &_acc, str(93633), int32(_cSep), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_pragCName)), uintptr(_j))))
 72753  	_cSep = int8(44)
 72754  	*func() *int32 { _i += 1; return &_j }() += 1
 72755  	goto _0
 72756  _3:
 72757  	if _i == int32(0) {
 72758  		_sqlite3XPrintf(tls, &_acc, str(93640), unsafe.Pointer(_pPragma.XzName))
 72759  		_cSep = int8(44)
 72760  		_i += 1
 72761  	}
 72762  	_j = int32(0)
 72763  	if (int32(_pPragma.XmPragFlg) & int32(32)) != 0 {
 72764  		_sqlite3StrAccumAppendAll(tls, &_acc, str(93646))
 72765  		_j += 1
 72766  	}
 72767  	if (int32(_pPragma.XmPragFlg) & int32(192)) != 0 {
 72768  		_sqlite3StrAccumAppendAll(tls, &_acc, str(93658))
 72769  		_j += 1
 72770  	}
 72771  	_sqlite3StrAccumAppend(tls, &_acc, str(37853), int32(1))
 72772  	_sqlite3StrAccumFinish(tls, &_acc)
 72773  	func() {
 72774  		if crt.Xstrlen(tls, (*int8)(unsafe.Pointer(&_zBuf))) >= uint64(199) {
 72775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115419), unsafe.Pointer(&_pragmaVtabConnectØ00__func__Ø000), unsafe.Pointer(str(93673)))
 72776  			crt.X__builtin_abort(tls)
 72777  		}
 72778  	}()
 72779  	_rc = Xsqlite3_declare_vtab(tls, _db, (*int8)(unsafe.Pointer(&_zBuf)))
 72780  	if _rc != int32(0) {
 72781  		goto _9
 72782  	}
 72783  	_pTab = (*XPragmaVtab)(Xsqlite3_malloc(tls, int32(48)))
 72784  	if _pTab == nil {
 72785  		_rc = int32(7)
 72786  		goto _11
 72787  	}
 72788  	crt.Xmemset(tls, unsafe.Pointer(_pTab), int32(0), uint64(48))
 72789  	*(**XPragmaName)(unsafe.Pointer(&_pTab.XpName)) = _pPragma
 72790  	*(**Xsqlite3)(unsafe.Pointer(&_pTab.Xdb)) = _db
 72791  	_pTab.XiHidden = uint8(_i)
 72792  	_pTab.XnHidden = uint8(_j)
 72793  _11:
 72794  	goto _12
 72795  _9:
 72796  	*_pzErr = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(Xsqlite3_errmsg(tls, _db)))
 72797  _12:
 72798  	*_ppVtab = (*Xsqlite3_vtab)(unsafe.Pointer(_pTab))
 72799  	return _rc
 72800  
 72801  	_ = _zBuf
 72802  	panic(0)
 72803  }
 72804  
 72805  // C comment
 72806  //  /*
 72807  //  ** Append the complete text of zero-terminated string z[] to the p string.
 72808  //  */
 72809  func _sqlite3StrAccumAppendAll(tls *crt.TLS, _p *XStrAccum, _z *int8) {
 72810  	_sqlite3StrAccumAppend(tls, _p, _z, _sqlite3Strlen30(tls, _z))
 72811  }
 72812  
 72813  // C comment
 72814  //  /* Names of columns for pragmas that return multi-column result
 72815  //  ** or that return single-column results where the name of the
 72816  //  ** result column is different from the name of the pragma
 72817  //  */
 72818  var _pragCName [49]*int8
 72819  
 72820  func init() {
 72821  	_pragCName = [49]*int8{str(92702), str(93703), str(93707), str(93712), str(93717), str(93725), str(93736), str(93739), str(93743), str(93747), str(93752), str(93757), str(93762), str(93703), str(93707), str(93762), str(93703), str(93707), str(93768), str(93773), str(93778), str(93782), str(93707), str(93786), str(93793), str(93800), str(93782), str(93707), str(93808), str(93782), str(93707), str(93813), str(93782), str(93816), str(26325), str(93822), str(93825), str(93835), str(93845), str(93816), str(27182), str(93851), str(93858), str(93863), str(93868), str(93872), str(93885), str(93893), str(93902)}
 72822  }
 72823  
 72824  var _pragmaVtabConnectØ00__func__Ø000 [18]int8
 72825  
 72826  func init() {
 72827  	crt.Xstrncpy(nil, &_pragmaVtabConnectØ00__func__Ø000[0], str(93909), 18)
 72828  }
 72829  
 72830  // C comment
 72831  //  /* Figure out the best index to use to search a pragma virtual table.
 72832  //  **
 72833  //  ** There are not really any index choices.  But we want to encourage the
 72834  //  ** query planner to give == constraints on as many hidden parameters as
 72835  //  ** possible, and especially on the first hidden parameter.  So return a
 72836  //  ** high cost if hidden parameters are unconstrained.
 72837  //  */
 72838  func _pragmaVtabBestIndex(tls *crt.TLS, _tab *Xsqlite3_vtab, _pIdxInfo *Xsqlite3_index_info) (r0 int32) {
 72839  	var _i, _j int32
 72840  	var _seen [2]int32
 72841  	var _pTab *XPragmaVtab
 72842  	var _pConstraint *Tsqlite3_index_constraint
 72843  	_pTab = (*XPragmaVtab)(unsafe.Pointer(_tab))
 72844  	_pIdxInfo.XestimatedCost = float64(1)
 72845  	if int32(_pTab.XnHidden) == int32(0) {
 72846  		return int32(0)
 72847  	}
 72848  	_pConstraint = (*Tsqlite3_index_constraint)(_pIdxInfo.XaConstraint)
 72849  	*elem8((*int32)(unsafe.Pointer(&_seen)), 0) = int32(0)
 72850  	*elem8((*int32)(unsafe.Pointer(&_seen)), uintptr(1)) = int32(0)
 72851  	_i = int32(0)
 72852  _1:
 72853  	if _i >= _pIdxInfo.XnConstraint {
 72854  		goto _4
 72855  	}
 72856  	if int32(_pConstraint.Xusable) == int32(0) {
 72857  		goto _2
 72858  	}
 72859  	if int32(_pConstraint.Xop) != int32(2) {
 72860  		goto _2
 72861  	}
 72862  	if _pConstraint.XiColumn < int32(_pTab.XiHidden) {
 72863  		goto _2
 72864  	}
 72865  	_j = _pConstraint.XiColumn - int32(_pTab.XiHidden)
 72866  	func() {
 72867  		if _j >= int32(2) {
 72868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115472), unsafe.Pointer(&_pragmaVtabBestIndexØ00__func__Ø000), unsafe.Pointer(str(93927)))
 72869  			crt.X__builtin_abort(tls)
 72870  		}
 72871  	}()
 72872  	*elem8((*int32)(unsafe.Pointer(&_seen)), uintptr(_j)) = _i + int32(1)
 72873  _2:
 72874  	*(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pConstraint }())) += uintptr(12)
 72875  	goto _1
 72876  _4:
 72877  	if (*elem8((*int32)(unsafe.Pointer(&_seen)), 0)) == int32(0) {
 72878  		_pIdxInfo.XestimatedCost = 2.147483647e+09
 72879  		_pIdxInfo.XestimatedRows = int64(2147483647)
 72880  		return int32(0)
 72881  	}
 72882  	_j = (*elem8((*int32)(unsafe.Pointer(&_seen)), 0)) - int32(1)
 72883  	elem97((*Tsqlite3_index_constraint_usage)(_pIdxInfo.XaConstraintUsage), uintptr(_j)).XargvIndex = int32(1)
 72884  	elem97((*Tsqlite3_index_constraint_usage)(_pIdxInfo.XaConstraintUsage), uintptr(_j)).Xomit = uint8(1)
 72885  	if (*elem8((*int32)(unsafe.Pointer(&_seen)), uintptr(1))) == int32(0) {
 72886  		return int32(0)
 72887  	}
 72888  	_pIdxInfo.XestimatedCost = float64(20)
 72889  	_pIdxInfo.XestimatedRows = int64(20)
 72890  	_j = (*elem8((*int32)(unsafe.Pointer(&_seen)), uintptr(1))) - int32(1)
 72891  	elem97((*Tsqlite3_index_constraint_usage)(_pIdxInfo.XaConstraintUsage), uintptr(_j)).XargvIndex = int32(2)
 72892  	elem97((*Tsqlite3_index_constraint_usage)(_pIdxInfo.XaConstraintUsage), uintptr(_j)).Xomit = uint8(1)
 72893  	return int32(0)
 72894  
 72895  	_ = _seen
 72896  	panic(0)
 72897  }
 72898  
 72899  var _pragmaVtabBestIndexØ00__func__Ø000 [20]int8
 72900  
 72901  func init() {
 72902  	crt.Xstrncpy(nil, &_pragmaVtabBestIndexØ00__func__Ø000[0], str(93933), 20)
 72903  }
 72904  
 72905  // C comment
 72906  //  /*
 72907  //  ** Pragma virtual table module xDisconnect method.
 72908  //  */
 72909  func _pragmaVtabDisconnect(tls *crt.TLS, _pVtab *Xsqlite3_vtab) (r0 int32) {
 72910  	var _pTab *XPragmaVtab
 72911  	_pTab = (*XPragmaVtab)(unsafe.Pointer(_pVtab))
 72912  	Xsqlite3_free(tls, unsafe.Pointer(_pTab))
 72913  	return int32(0)
 72914  }
 72915  
 72916  // C comment
 72917  //  /* Create a new cursor for the pragma virtual table */
 72918  func _pragmaVtabOpen(tls *crt.TLS, _pVtab *Xsqlite3_vtab, _ppCursor **Xsqlite3_vtab_cursor) (r0 int32) {
 72919  	var _pCsr *XPragmaVtabCursor
 72920  	_pCsr = (*XPragmaVtabCursor)(Xsqlite3_malloc(tls, int32(40)))
 72921  	if _pCsr == nil {
 72922  		return int32(7)
 72923  	}
 72924  	crt.Xmemset(tls, unsafe.Pointer(_pCsr), int32(0), uint64(40))
 72925  	*(**Xsqlite3_vtab)(unsafe.Pointer(&(_pCsr.Xbase.XpVtab))) = _pVtab
 72926  	*_ppCursor = &_pCsr.Xbase
 72927  	return int32(0)
 72928  }
 72929  
 72930  // C comment
 72931  //  /* Close a pragma virtual table cursor */
 72932  func _pragmaVtabClose(tls *crt.TLS, _cur *Xsqlite3_vtab_cursor) (r0 int32) {
 72933  	var _pCsr *XPragmaVtabCursor
 72934  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_cur))
 72935  	_pragmaVtabCursorClear(tls, _pCsr)
 72936  	Xsqlite3_free(tls, unsafe.Pointer(_pCsr))
 72937  	return int32(0)
 72938  }
 72939  
 72940  // C comment
 72941  //  /* Clear all content from pragma virtual table cursor. */
 72942  func _pragmaVtabCursorClear(tls *crt.TLS, _pCsr *XPragmaVtabCursor) {
 72943  	var _i int32
 72944  	Xsqlite3_finalize(tls, _pCsr.XpPragma)
 72945  	_pCsr.XpPragma = nil
 72946  	_i = int32(0)
 72947  _0:
 72948  	if _i >= int32(2) {
 72949  		goto _3
 72950  	}
 72951  	Xsqlite3_free(tls, unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(_i))))
 72952  	*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(_i)) = nil
 72953  	_i += 1
 72954  	goto _0
 72955  _3:
 72956  }
 72957  
 72958  // C comment
 72959  //  /*
 72960  //  ** Pragma virtual table module xFilter method.
 72961  //  */
 72962  func _pragmaVtabFilter(tls *crt.TLS, _pVtabCursor *Xsqlite3_vtab_cursor, _idxNum int32, _idxStr *int8, _argc int32, _argv **XMem) (r0 int32) {
 72963  	var _rc, _i, _j int32
 72964  	var _zSql *int8
 72965  	var _acc XStrAccum
 72966  	var _pTab *XPragmaVtab
 72967  	var _pCsr *XPragmaVtabCursor
 72968  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
 72969  	_pTab = (*XPragmaVtab)(unsafe.Pointer((*Xsqlite3_vtab)(_pVtabCursor.XpVtab)))
 72970  
 72971  	_pragmaVtabCursorClear(tls, _pCsr)
 72972  	_j = func() int32 {
 72973  		if (int32((*XPragmaName)(_pTab.XpName).XmPragFlg) & int32(32)) != int32(0) {
 72974  			return int32(0)
 72975  		}
 72976  		return int32(1)
 72977  	}()
 72978  	_i = int32(0)
 72979  _2:
 72980  	if _i >= _argc {
 72981  		goto _5
 72982  	}
 72983  	func() {
 72984  		if _j >= int32(2) {
 72985  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115558), unsafe.Pointer(&_pragmaVtabFilterØ00__func__Ø000), unsafe.Pointer(str(93953)))
 72986  			crt.X__builtin_abort(tls)
 72987  		}
 72988  	}()
 72989  	*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(_j)) = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, uintptr(_i)))))
 72990  	if (*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(_j))) == nil {
 72991  		return int32(7)
 72992  	}
 72993  	*func() *int32 { _i += 1; return &_j }() += 1
 72994  	goto _2
 72995  _5:
 72996  	_sqlite3StrAccumInit(tls, &_acc, nil, nil, int32(0), *elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pTab.Xdb).XaLimit))), uintptr(1)))
 72997  	_sqlite3StrAccumAppendAll(tls, &_acc, str(93978))
 72998  	if (*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(1))) != nil {
 72999  		_sqlite3XPrintf(tls, &_acc, str(93986), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(1))))
 73000  	}
 73001  	_sqlite3StrAccumAppendAll(tls, &_acc, (*XPragmaName)(_pTab.XpName).XzName)
 73002  	if (*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), 0)) != nil {
 73003  		_sqlite3XPrintf(tls, &_acc, str(93990), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), 0)))
 73004  	}
 73005  	_zSql = _sqlite3StrAccumFinish(tls, &_acc)
 73006  	if _zSql == nil {
 73007  		return int32(7)
 73008  	}
 73009  	_rc = Xsqlite3_prepare_v2(tls, (*Xsqlite3)(_pTab.Xdb), _zSql, int32(-1), &_pCsr.XpPragma, nil)
 73010  	Xsqlite3_free(tls, unsafe.Pointer(_zSql))
 73011  	if _rc != int32(0) {
 73012  		_pTab.Xbase.XzErrMsg = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(Xsqlite3_errmsg(tls, (*Xsqlite3)(_pTab.Xdb))))
 73013  		return _rc
 73014  	}
 73015  	return _pragmaVtabNext(tls, _pVtabCursor)
 73016  }
 73017  
 73018  var _pragmaVtabFilterØ00__func__Ø000 [17]int8
 73019  
 73020  func init() {
 73021  	crt.Xstrncpy(nil, &_pragmaVtabFilterØ00__func__Ø000[0], str(93994), 17)
 73022  }
 73023  
 73024  // C comment
 73025  //  /* Advance the pragma virtual table cursor to the next row */
 73026  func _pragmaVtabNext(tls *crt.TLS, _pVtabCursor *Xsqlite3_vtab_cursor) (r0 int32) {
 73027  	var _rc int32
 73028  	var _pCsr *XPragmaVtabCursor
 73029  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
 73030  	_rc = int32(0)
 73031  	_pCsr.XiRowid += 1
 73032  	func() {
 73033  		if _pCsr.XpPragma == nil {
 73034  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115529), unsafe.Pointer(&_pragmaVtabNextØ00__func__Ø000), unsafe.Pointer(str(94011)))
 73035  			crt.X__builtin_abort(tls)
 73036  		}
 73037  	}()
 73038  	if int32(100) != Xsqlite3_step(tls, _pCsr.XpPragma) {
 73039  		_rc = Xsqlite3_finalize(tls, _pCsr.XpPragma)
 73040  		_pCsr.XpPragma = nil
 73041  		_pragmaVtabCursorClear(tls, _pCsr)
 73042  	}
 73043  	return _rc
 73044  }
 73045  
 73046  var _pragmaVtabNextØ00__func__Ø000 [15]int8
 73047  
 73048  func init() {
 73049  	crt.Xstrncpy(nil, &_pragmaVtabNextØ00__func__Ø000[0], str(94025), 15)
 73050  }
 73051  
 73052  // C comment
 73053  //  /*
 73054  //  ** Pragma virtual table module xEof method.
 73055  //  */
 73056  func _pragmaVtabEof(tls *crt.TLS, _pVtabCursor *Xsqlite3_vtab_cursor) (r0 int32) {
 73057  	var _pCsr *XPragmaVtabCursor
 73058  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
 73059  	return bool2int(_pCsr.XpPragma == nil)
 73060  }
 73061  
 73062  // C comment
 73063  //  /* The xColumn method simply returns the corresponding column from
 73064  //  ** the PRAGMA.
 73065  //  */
 73066  func _pragmaVtabColumn(tls *crt.TLS, _pVtabCursor *Xsqlite3_vtab_cursor, _ctx *Xsqlite3_context, _i int32) (r0 int32) {
 73067  	var _pTab *XPragmaVtab
 73068  	var _pCsr *XPragmaVtabCursor
 73069  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
 73070  	_pTab = (*XPragmaVtab)(unsafe.Pointer((*Xsqlite3_vtab)(_pVtabCursor.XpVtab)))
 73071  	if _i < int32(_pTab.XiHidden) {
 73072  		Xsqlite3_result_value(tls, _ctx, Xsqlite3_column_value(tls, _pCsr.XpPragma, _i))
 73073  		goto _1
 73074  	}
 73075  	Xsqlite3_result_text(tls, _ctx, *elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(_i-int32(_pTab.XiHidden))), int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
 73076  		v := uint64(18446744073709551615)
 73077  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 73078  	}())
 73079  _1:
 73080  	return int32(0)
 73081  }
 73082  
 73083  // C comment
 73084  //  /* SQLITE_OMIT_UTF16 */
 73085  func Xsqlite3_result_value(tls *crt.TLS, _pCtx *Xsqlite3_context, _pValue *XMem) {
 73086  	func() {
 73087  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
 73088  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76537), unsafe.Pointer(&_sqlite3_result_valueØ00__func__Ø000), unsafe.Pointer(str(6567)))
 73089  			crt.X__builtin_abort(tls)
 73090  		}
 73091  	}()
 73092  	_sqlite3VdbeMemCopy(tls, (*XMem)(_pCtx.XpOut), _pValue)
 73093  }
 73094  
 73095  var _sqlite3_result_valueØ00__func__Ø000 [21]int8
 73096  
 73097  func init() {
 73098  	crt.Xstrncpy(nil, &_sqlite3_result_valueØ00__func__Ø000[0], str(94040), 21)
 73099  }
 73100  
 73101  // C comment
 73102  //  /*
 73103  //  ** Pragma virtual table module xRowid method.
 73104  //  */
 73105  func _pragmaVtabRowid(tls *crt.TLS, _pVtabCursor *Xsqlite3_vtab_cursor, _p *int64) (r0 int32) {
 73106  	var _pCsr *XPragmaVtabCursor
 73107  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
 73108  	*_p = _pCsr.XiRowid
 73109  	return int32(0)
 73110  }
 73111  
 73112  // C comment
 73113  //  /*
 73114  //  ** Check to see if virtual table module pMod can be have an eponymous
 73115  //  ** virtual table instance.  If it can, create one if one does not already
 73116  //  ** exist. Return non-zero if the eponymous virtual table instance exists
 73117  //  ** when this routine returns, and return zero if it does not exist.
 73118  //  **
 73119  //  ** An eponymous virtual table instance is one that is named after its
 73120  //  ** module, and more importantly, does not require a CREATE VIRTUAL TABLE
 73121  //  ** statement in order to come into existance.  Eponymous virtual table
 73122  //  ** instances always exist.  They cannot be DROP-ed.
 73123  //  **
 73124  //  ** Any virtual table module for which xConnect and xCreate are the same
 73125  //  ** method can have an eponymous virtual table instance.
 73126  //  */
 73127  func _sqlite3VtabEponymousTableInit(tls *crt.TLS, _pParse *XParse, _pMod *XModule) (r0 int32) {
 73128  	var _rc int32
 73129  	var _zErr *int8
 73130  	var _db *Xsqlite3
 73131  	var _pTab *XTable
 73132  	var _pModule *Xsqlite3_module
 73133  	_pModule = (*Xsqlite3_module)(_pMod.XpModule)
 73134  	_zErr = nil
 73135  	_db = (*Xsqlite3)(_pParse.Xdb)
 73136  	if _pMod.XpEpoTab != nil {
 73137  		return int32(1)
 73138  	}
 73139  	if (func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 73140  		v := _pModule.XxCreate
 73141  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 73142  	}() != nil) && (*(*uintptr)(unsafe.Pointer(&struct {
 73143  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
 73144  	}{func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 73145  		v := _pModule.XxCreate
 73146  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 73147  	}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 73148  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
 73149  	}{func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 73150  		v := _pModule.XxConnect
 73151  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 73152  	}()}))) {
 73153  		return int32(0)
 73154  	}
 73155  	_pTab = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(128)))
 73156  	if _pTab == nil {
 73157  		return int32(0)
 73158  	}
 73159  	_pTab.XzName = _sqlite3DbStrDup(tls, _db, _pMod.XzName)
 73160  	if _pTab.XzName == nil {
 73161  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTab))
 73162  		return int32(0)
 73163  	}
 73164  	*(**XTable)(unsafe.Pointer(&_pMod.XpEpoTab)) = _pTab
 73165  	_pTab.XnTabRef = uint32(1)
 73166  	*(**XSchema)(unsafe.Pointer(&_pTab.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema)
 73167  	func() {
 73168  		if _pTab.XnModuleArg != int32(0) {
 73169  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126139), unsafe.Pointer(&_sqlite3VtabEponymousTableInitØ00__func__Ø000), unsafe.Pointer(str(94061)))
 73170  			crt.X__builtin_abort(tls)
 73171  		}
 73172  	}()
 73173  	_pTab.XiPKey = int16(-1)
 73174  	_addModuleArgument(tls, _db, _pTab, _sqlite3DbStrDup(tls, _db, _pTab.XzName))
 73175  	_addModuleArgument(tls, _db, _pTab, nil)
 73176  	_addModuleArgument(tls, _db, _pTab, _sqlite3DbStrDup(tls, _db, _pTab.XzName))
 73177  	_rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 73178  		v := _pModule.XxConnect
 73179  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 73180  	}(), &_zErr)
 73181  	if _rc != 0 {
 73182  		_sqlite3ErrorMsg(tls, _pParse, str(24531), unsafe.Pointer(_zErr))
 73183  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
 73184  		_sqlite3VtabEponymousTableClear(tls, _db, _pMod)
 73185  		return int32(0)
 73186  	}
 73187  	return int32(1)
 73188  }
 73189  
 73190  var _sqlite3VtabEponymousTableInitØ00__func__Ø000 [30]int8
 73191  
 73192  func init() {
 73193  	crt.Xstrncpy(nil, &_sqlite3VtabEponymousTableInitØ00__func__Ø000[0], str(94081), 30)
 73194  }
 73195  
 73196  // C comment
 73197  //  /*
 73198  //  ** Add a new module argument to pTable->azModuleArg[].
 73199  //  ** The string is not copied - the pointer is stored.  The
 73200  //  ** string will be freed automatically when the table is
 73201  //  ** deleted.
 73202  //  */
 73203  func _addModuleArgument(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable, _zArg *int8) {
 73204  	var _nBytes, _2_i int32
 73205  	var _azModuleArg **int8
 73206  	_nBytes = int32(uint64(8) * uint64(int32(2)+_pTable.XnModuleArg))
 73207  	_azModuleArg = (**int8)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pTable.XazModuleArg), uint64(_nBytes)))
 73208  	if _azModuleArg == nil {
 73209  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zArg))
 73210  		goto _1
 73211  	}
 73212  	_2_i = postInc2(&_pTable.XnModuleArg, 1)
 73213  	*elem0(_azModuleArg, uintptr(_2_i)) = _zArg
 73214  	*elem0(_azModuleArg, uintptr(_2_i+int32(1))) = nil
 73215  	_pTable.XazModuleArg = _azModuleArg
 73216  _1:
 73217  }
 73218  
 73219  // C comment
 73220  //  /*
 73221  //  ** The Table structure pTable is really a VIEW.  Fill in the names of
 73222  //  ** the columns of the view in the pTable structure.  Return the number
 73223  //  ** of errors.  If an error is seen leave an error message in pParse->zErrMsg.
 73224  //  */
 73225  func _sqlite3ViewGetColumnNames(tls *crt.TLS, _pParse *XParse, _pTable *XTable) (r0 int32) {
 73226  	var _nErr, _n int32
 73227  	var _xAuth func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
 73228  	var _db *Xsqlite3
 73229  	var _pSelTab *XTable
 73230  	var _pSel *XSelect
 73231  	_nErr = int32(0)
 73232  	_db = (*Xsqlite3)(_pParse.Xdb)
 73233  	func() {
 73234  		if _pTable == nil {
 73235  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101853), unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94111)))
 73236  			crt.X__builtin_abort(tls)
 73237  		}
 73238  	}()
 73239  	if _sqlite3VtabCallConnect(tls, _pParse, _pTable) != 0 {
 73240  		return int32(1)
 73241  	}
 73242  	if _pTable.XnModuleArg != 0 {
 73243  		return int32(0)
 73244  	}
 73245  	if int32(_pTable.XnCol) > int32(0) {
 73246  		return int32(0)
 73247  	}
 73248  	if int32(_pTable.XnCol) < int32(0) {
 73249  		_sqlite3ErrorMsg(tls, _pParse, str(94118), unsafe.Pointer(_pTable.XzName))
 73250  		return int32(1)
 73251  	}
 73252  	func() {
 73253  		if int32(_pTable.XnCol) < int32(0) {
 73254  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101887), unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94148)))
 73255  			crt.X__builtin_abort(tls)
 73256  		}
 73257  	}()
 73258  	func() {
 73259  		if _pTable.XpSelect == nil {
 73260  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101896), unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94164)))
 73261  			crt.X__builtin_abort(tls)
 73262  		}
 73263  	}()
 73264  	_pSel = _sqlite3SelectDup(tls, _db, (*XSelect)(_pTable.XpSelect), int32(0))
 73265  	if _pSel == nil {
 73266  		goto _10
 73267  	}
 73268  	_n = _pParse.XnTab
 73269  	_sqlite3SrcListAssignCursors(tls, _pParse, (*XSrcList)(_pSel.XpSrc))
 73270  	_pTable.XnCol = int16(-1)
 73271  	_db.Xlookaside.XbDisable += 1
 73272  	_xAuth = _db.XxAuth
 73273  	_db.XxAuth = nil
 73274  	_pSelTab = _sqlite3ResultSetOfSelect(tls, _pParse, _pSel)
 73275  	_db.XxAuth = _xAuth
 73276  	_pParse.XnTab = _n
 73277  	if _pTable.XpCheck == nil {
 73278  		goto _11
 73279  	}
 73280  	_sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_pTable.XpCheck), &_pTable.XnCol, (**XColumn)(unsafe.Pointer(&_pTable.XaCol)))
 73281  	if ((int32(_db.XmallocFailed) == int32(0)) && (_pParse.XnErr == int32(0))) && (int32(_pTable.XnCol) == ((*XExprList)(_pSel.XpEList).XnExpr)) {
 73282  		_sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _pTable, _pSel)
 73283  	}
 73284  	goto _21
 73285  _11:
 73286  	if _pSelTab != nil {
 73287  		func() {
 73288  			if (*XColumn)(_pTable.XaCol) != nil {
 73289  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101931), unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94180)))
 73290  				crt.X__builtin_abort(tls)
 73291  			}
 73292  		}()
 73293  		_pTable.XnCol = _pSelTab.XnCol
 73294  		*(**XColumn)(unsafe.Pointer(&_pTable.XaCol)) = (*XColumn)(_pSelTab.XaCol)
 73295  		_pSelTab.XnCol = 0
 73296  		*(**XColumn)(unsafe.Pointer(&_pSelTab.XaCol)) = nil
 73297  		func() {
 73298  			if _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_pTable.XpSchema)) == 0 {
 73299  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101936), unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94196)))
 73300  				crt.X__builtin_abort(tls)
 73301  			}
 73302  		}()
 73303  		goto _21
 73304  	}
 73305  	_pTable.XnCol = 0
 73306  	_nErr += 1
 73307  _21:
 73308  	_sqlite3DeleteTable(tls, _db, _pSelTab)
 73309  	_sqlite3SelectDelete(tls, _db, _pSel)
 73310  	_db.Xlookaside.XbDisable -= 1
 73311  	goto _22
 73312  _10:
 73313  	_nErr += 1
 73314  _22:
 73315  	{
 73316  		p := &((*XSchema)(_pTable.XpSchema).XschemaFlags)
 73317  		*p = uint16(int32(*p) | int32(2))
 73318  	}
 73319  	return _nErr
 73320  }
 73321  
 73322  var _sqlite3ViewGetColumnNamesØ00__func__Ø000 [26]int8
 73323  
 73324  func init() {
 73325  	crt.Xstrncpy(nil, &_sqlite3ViewGetColumnNamesØ00__func__Ø000[0], str(94243), 26)
 73326  }
 73327  
 73328  // C comment
 73329  //  /*
 73330  //  ** This function is invoked by the parser to call the xConnect() method
 73331  //  ** of the virtual table pTab. If an error occurs, an error code is returned
 73332  //  ** and an error left in pParse.
 73333  //  **
 73334  //  ** This call is a no-op if table pTab is not a virtual table.
 73335  //  */
 73336  func _sqlite3VtabCallConnect(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 int32) {
 73337  	var _rc int32
 73338  	var _zMod, _2_zModule, _3_zErr *int8
 73339  	var _db *Xsqlite3
 73340  	var _pMod *XModule
 73341  	_db = (*Xsqlite3)(_pParse.Xdb)
 73342  	func() {
 73343  		if _pTab == nil {
 73344  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125616), unsafe.Pointer(&_sqlite3VtabCallConnectØ00__func__Ø000), unsafe.Pointer(str(94269)))
 73345  			crt.X__builtin_abort(tls)
 73346  		}
 73347  	}()
 73348  	if (_pTab.XnModuleArg == 0) || (_sqlite3GetVTable(tls, _db, _pTab) != nil) {
 73349  		return int32(0)
 73350  	}
 73351  	_zMod = *elem0(_pTab.XazModuleArg, 0)
 73352  	_pMod = (*XModule)(_sqlite3HashFind(tls, &_db.XaModule, _zMod))
 73353  	if _pMod == nil {
 73354  		_2_zModule = *elem0(_pTab.XazModuleArg, 0)
 73355  		_sqlite3ErrorMsg(tls, _pParse, str(91672), unsafe.Pointer(_2_zModule))
 73356  		_rc = int32(1)
 73357  		goto _5
 73358  	}
 73359  	_3_zErr = nil
 73360  	_rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 73361  		v := (*Xsqlite3_module)(_pMod.XpModule).XxConnect
 73362  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 73363  	}(), &_3_zErr)
 73364  	if _rc != int32(0) {
 73365  		_sqlite3ErrorMsg(tls, _pParse, str(24531), unsafe.Pointer(_3_zErr))
 73366  	}
 73367  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_3_zErr))
 73368  _5:
 73369  	return _rc
 73370  }
 73371  
 73372  var _sqlite3VtabCallConnectØ00__func__Ø000 [23]int8
 73373  
 73374  func init() {
 73375  	crt.Xstrncpy(nil, &_sqlite3VtabCallConnectØ00__func__Ø000[0], str(94274), 23)
 73376  }
 73377  
 73378  // C comment
 73379  //  /*
 73380  //  ** Given a SELECT statement, generate a Table structure that describes
 73381  //  ** the result set of that SELECT.
 73382  //  */
 73383  func _sqlite3ResultSetOfSelect(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) (r0 *XTable) {
 73384  	var _savedFlags int32
 73385  	var _db *Xsqlite3
 73386  	var _pTab *XTable
 73387  	_db = (*Xsqlite3)(_pParse.Xdb)
 73388  	_savedFlags = _db.Xflags
 73389  	_db.Xflags &= int32(-5)
 73390  	_db.Xflags |= int32(64)
 73391  	_sqlite3SelectPrep(tls, _pParse, _pSelect, nil)
 73392  	if _pParse.XnErr != 0 {
 73393  		return nil
 73394  	}
 73395  _0:
 73396  	if _pSelect.XpPrior != nil {
 73397  		_pSelect = (*XSelect)(_pSelect.XpPrior)
 73398  		goto _0
 73399  	}
 73400  	_db.Xflags = _savedFlags
 73401  	_pTab = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(128)))
 73402  	if _pTab == nil {
 73403  		return nil
 73404  	}
 73405  	func() {
 73406  		if (_db.Xlookaside.XbDisable) == 0 {
 73407  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118340), unsafe.Pointer(&_sqlite3ResultSetOfSelectØ00__func__Ø000), unsafe.Pointer(str(94297)))
 73408  			crt.X__builtin_abort(tls)
 73409  		}
 73410  	}()
 73411  	_pTab.XnTabRef = uint32(1)
 73412  	_pTab.XzName = nil
 73413  	_pTab.XnRowLogEst = int16(200)
 73414  	func() {
 73415  		if int32(200) != int32(_sqlite3LogEst(tls, uint64(1048576))) {
 73416  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118343), unsafe.Pointer(&_sqlite3ResultSetOfSelectØ00__func__Ø000), unsafe.Pointer(str(48082)))
 73417  			crt.X__builtin_abort(tls)
 73418  		}
 73419  	}()
 73420  	_sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_pSelect.XpEList), &_pTab.XnCol, (**XColumn)(unsafe.Pointer(&_pTab.XaCol)))
 73421  	_sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _pTab, _pSelect)
 73422  	_pTab.XiPKey = int16(-1)
 73423  	if _db.XmallocFailed != 0 {
 73424  		_sqlite3DeleteTable(tls, _db, _pTab)
 73425  		return nil
 73426  	}
 73427  	return _pTab
 73428  }
 73429  
 73430  var _sqlite3ResultSetOfSelectØ00__func__Ø000 [25]int8
 73431  
 73432  func init() {
 73433  	crt.Xstrncpy(nil, &_sqlite3ResultSetOfSelectØ00__func__Ø000[0], str(94320), 25)
 73434  }
 73435  
 73436  // C comment
 73437  //  /*
 73438  //  ** Add type and collation information to a column list based on
 73439  //  ** a SELECT statement.
 73440  //  **
 73441  //  ** The column list presumably came from selectColumnNamesFromExprList().
 73442  //  ** The column list has only names, not types or collations.  This
 73443  //  ** routine goes through and adds the types and collations.
 73444  //  **
 73445  //  ** This routine requires that all identifiers in the SELECT
 73446  //  ** statement be resolved.
 73447  //  */
 73448  func _sqlite3SelectAddColumnTypeAndCollation(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pSelect *XSelect) {
 73449  	var _i, _1_n, _1_m int32
 73450  	var _szAll uint64
 73451  	var _1_zType *int8
 73452  	var _db *Xsqlite3
 73453  	var _a *TExprList_item
 73454  	var _p *XExpr
 73455  	var _pCol *XColumn
 73456  	var _pColl *XCollSeq
 73457  	var _sNC XNameContext
 73458  	_db = (*Xsqlite3)(_pParse.Xdb)
 73459  	_szAll = uint64(0)
 73460  	func() {
 73461  		if _pSelect == nil {
 73462  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118287), unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000), unsafe.Pointer(str(94345)))
 73463  			crt.X__builtin_abort(tls)
 73464  		}
 73465  	}()
 73466  	func() {
 73467  		if (_pSelect.XselFlags & uint32(4)) == (0) {
 73468  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118288), unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000), unsafe.Pointer(str(94356)))
 73469  			crt.X__builtin_abort(tls)
 73470  		}
 73471  	}()
 73472  	func() {
 73473  		if int32(_pTab.XnCol) != ((*XExprList)(_pSelect.XpEList).XnExpr) && _db.XmallocFailed == 0 {
 73474  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118289), unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000), unsafe.Pointer(str(94393)))
 73475  			crt.X__builtin_abort(tls)
 73476  		}
 73477  	}()
 73478  	if _db.XmallocFailed != 0 {
 73479  		return
 73480  	}
 73481  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint64(56))
 73482  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = (*XSrcList)(_pSelect.XpSrc)
 73483  	_a = (*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.XpEList).Xa)))
 73484  	*func() **XColumn { _i = int32(0); return &_pCol }() = (*XColumn)(_pTab.XaCol)
 73485  _8:
 73486  	if _i >= int32(_pTab.XnCol) {
 73487  		goto _11
 73488  	}
 73489  	_p = (*XExpr)(elem59(_a, uintptr(_i)).XpExpr)
 73490  	_1_zType = _columnTypeImpl(tls, &_sNC, _p, &_pCol.XszEst)
 73491  	_szAll += uint64(_pCol.XszEst)
 73492  	_pCol.Xaffinity = _sqlite3ExprAffinity(tls, _p)
 73493  	if _1_zType == nil || store2(&_1_m, _sqlite3Strlen30(tls, _1_zType)) <= int32(0) {
 73494  		goto _13
 73495  	}
 73496  	_1_n = _sqlite3Strlen30(tls, _pCol.XzName)
 73497  	_pCol.XzName = (*int8)(_sqlite3DbReallocOrFree(tls, _db, unsafe.Pointer(_pCol.XzName), uint64((_1_n+_1_m)+int32(2))))
 73498  	if _pCol.XzName != nil {
 73499  		crt.Xmemcpy(tls, unsafe.Pointer(elem1(_pCol.XzName, uintptr(_1_n+int32(1)))), unsafe.Pointer(_1_zType), uint64(_1_m+int32(1)))
 73500  		{
 73501  			p := &_pCol.XcolFlags
 73502  			*p = uint8(int32(*p) | int32(4))
 73503  		}
 73504  	}
 73505  _13:
 73506  	if int32(_pCol.Xaffinity) == int32(0) {
 73507  		_pCol.Xaffinity = int8(65)
 73508  	}
 73509  	_pColl = _sqlite3ExprCollSeq(tls, _pParse, _p)
 73510  	if (_pColl != nil) && (_pCol.XzColl == nil) {
 73511  		_pCol.XzColl = _sqlite3DbStrDup(tls, _db, _pColl.XzName)
 73512  	}
 73513  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(32)
 73514  	goto _8
 73515  _11:
 73516  	_pTab.XszTabRow = _sqlite3LogEst(tls, _szAll*uint64(4))
 73517  }
 73518  
 73519  var _sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000 [39]int8
 73520  
 73521  func init() {
 73522  	crt.Xstrncpy(nil, &_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000[0], str(94448), 39)
 73523  }
 73524  
 73525  func _columnTypeImpl(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr, _pEstWidth *uint8) (r0 *int8) {
 73526  	var _j, _2_iCol int32
 73527  	var _zType *int8
 73528  	var _estWidth uint8
 73529  	var _2_pTab *XTable
 73530  	var _3_pTabList *XSrcList
 73531  	var _2_pS, _12_pS *XSelect
 73532  	var _8_p, _12_p *XExpr
 73533  	var _8_sNC, _12_sNC XNameContext
 73534  	_zType = nil
 73535  	_estWidth = uint8(1)
 73536  	func() {
 73537  		if _pExpr == nil {
 73538  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117910), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(43591)))
 73539  			crt.X__builtin_abort(tls)
 73540  		}
 73541  	}()
 73542  	func() {
 73543  		if (*XSrcList)(_pNC.XpSrcList) == nil {
 73544  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117911), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(94487)))
 73545  			crt.X__builtin_abort(tls)
 73546  		}
 73547  	}()
 73548  	switch int32(_pExpr.Xop) {
 73549  	case int32(119):
 73550  		goto _7
 73551  	case int32(152):
 73552  		goto _5
 73553  	case int32(154):
 73554  		goto _5
 73555  	default:
 73556  		goto _8
 73557  	}
 73558  
 73559  _5:
 73560  	_2_pTab = nil
 73561  	_2_pS = nil
 73562  	_2_iCol = int32(_pExpr.XiColumn)
 73563  _9:
 73564  	if _pNC == nil || _2_pTab != nil {
 73565  		goto _10
 73566  	}
 73567  	_3_pTabList = (*XSrcList)(_pNC.XpSrcList)
 73568  	_j = int32(0)
 73569  _12:
 73570  	if _j >= _3_pTabList.XnSrc || (elem6((*TSrcList_item)(unsafe.Pointer(&_3_pTabList.Xa)), uintptr(_j)).XiCursor) == _pExpr.XiTable {
 73571  		goto _16
 73572  	}
 73573  	_j += 1
 73574  	goto _12
 73575  _16:
 73576  	if _j < _3_pTabList.XnSrc {
 73577  		_2_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_3_pTabList.Xa)), uintptr(_j)).XpTab)
 73578  		_2_pS = (*XSelect)(elem6((*TSrcList_item)(unsafe.Pointer(&_3_pTabList.Xa)), uintptr(_j)).XpSelect)
 73579  		goto _18
 73580  	}
 73581  	_pNC = (*XNameContext)(_pNC.XpNext)
 73582  _18:
 73583  	goto _9
 73584  _10:
 73585  	if _2_pTab == nil {
 73586  		goto _8
 73587  	}
 73588  	func() {
 73589  		if _2_pTab == nil || (*XTable)(_pExpr.XpTab) != _2_pTab {
 73590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117956), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(94504)))
 73591  			crt.X__builtin_abort(tls)
 73592  		}
 73593  	}()
 73594  	if _2_pS == nil {
 73595  		goto _23
 73596  	}
 73597  	if (_2_iCol >= int32(0)) && func() int32 {
 73598  		if _2_iCol < ((*XExprList)(_2_pS.XpEList).XnExpr) {
 73599  			return int32(1)
 73600  		}
 73601  		return func() int32 {
 73602  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117962), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(4809)))
 73603  			crt.X__builtin_abort(tls)
 73604  			return int32(0)
 73605  		}()
 73606  	}() != 0 {
 73607  		_8_p = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_2_pS.XpEList).Xa))), uintptr(_2_iCol)).XpExpr)
 73608  		*(**XSrcList)(unsafe.Pointer(&_8_sNC.XpSrcList)) = (*XSrcList)(_2_pS.XpSrc)
 73609  		*(**XNameContext)(unsafe.Pointer(&_8_sNC.XpNext)) = _pNC
 73610  		*(**XParse)(unsafe.Pointer(&_8_sNC.XpParse)) = (*XParse)(_pNC.XpParse)
 73611  		_zType = _columnTypeImpl(tls, &_8_sNC, _8_p, &_estWidth)
 73612  	}
 73613  	goto _29
 73614  _23:
 73615  	if _2_pTab.XpSchema == nil {
 73616  		goto _29
 73617  	}
 73618  	func() {
 73619  		if _2_pS != nil {
 73620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117979), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(94530)))
 73621  			crt.X__builtin_abort(tls)
 73622  		}
 73623  	}()
 73624  	if _2_iCol < int32(0) {
 73625  		_2_iCol = int32(_2_pTab.XiPKey)
 73626  	}
 73627  	func() {
 73628  		if _2_iCol != int32(-1) && (_2_iCol < int32(0) || _2_iCol >= int32(_2_pTab.XnCol)) {
 73629  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117981), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(94534)))
 73630  			crt.X__builtin_abort(tls)
 73631  		}
 73632  	}()
 73633  	if _2_iCol < int32(0) {
 73634  		_zType = str(25747)
 73635  		goto _38
 73636  	}
 73637  	_zType = _sqlite3ColumnType(tls, elem43((*XColumn)(_2_pTab.XaCol), uintptr(_2_iCol)), nil)
 73638  	_estWidth = elem43((*XColumn)(_2_pTab.XaCol), uintptr(_2_iCol)).XszEst
 73639  _38:
 73640  _29:
 73641  	goto _8
 73642  _7:
 73643  	_12_pS = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 73644  	_12_p = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_12_pS.XpEList).Xa))), 0).XpExpr)
 73645  	func() {
 73646  		if (_pExpr.Xflags & uint32(2048)) == (0) {
 73647  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118016), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(45114)))
 73648  			crt.X__builtin_abort(tls)
 73649  		}
 73650  	}()
 73651  	*(**XSrcList)(unsafe.Pointer(&_12_sNC.XpSrcList)) = (*XSrcList)(_12_pS.XpSrc)
 73652  	*(**XNameContext)(unsafe.Pointer(&_12_sNC.XpNext)) = _pNC
 73653  	*(**XParse)(unsafe.Pointer(&_12_sNC.XpParse)) = (*XParse)(_pNC.XpParse)
 73654  	_zType = _columnTypeImpl(tls, &_12_sNC, _12_p, &_estWidth)
 73655  	goto _8
 73656  _8:
 73657  	if _pEstWidth != nil {
 73658  		*_pEstWidth = _estWidth
 73659  	}
 73660  	return _zType
 73661  }
 73662  
 73663  var _columnTypeImplØ00__func__Ø000 [15]int8
 73664  
 73665  func init() {
 73666  	crt.Xstrncpy(nil, &_columnTypeImplØ00__func__Ø000[0], str(94575), 15)
 73667  }
 73668  
 73669  // C comment
 73670  //  /*
 73671  //  ** Return the collation sequence for the expression pExpr. If
 73672  //  ** there is no defined collating sequence, return NULL.
 73673  //  **
 73674  //  ** The collating sequence might be determined by a COLLATE operator
 73675  //  ** or by the presence of a column with a defined collating sequence.
 73676  //  ** COLLATE operators take first precedence.  Left operands take
 73677  //  ** precedence over right operands.
 73678  //  */
 73679  func _sqlite3ExprCollSeq(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 *XCollSeq) {
 73680  	var _1_op, _4_j, _9_i int32
 73681  	var _5_zColl *int8
 73682  	var _db *Xsqlite3
 73683  	var _p, _8_pNext *XExpr
 73684  	var _pColl *XCollSeq
 73685  	_db = (*Xsqlite3)(_pParse.Xdb)
 73686  	_pColl = nil
 73687  	_p = _pExpr
 73688  _0:
 73689  	if _p == nil {
 73690  		goto _1
 73691  	}
 73692  	_1_op = int32(_p.Xop)
 73693  	if (_p.Xflags & uint32(512)) != 0 {
 73694  		goto _1
 73695  	}
 73696  	if (_1_op == int32(37)) || (_1_op == int32(156)) {
 73697  		_p = (*XExpr)(_p.XpLeft)
 73698  		goto _0
 73699  	}
 73700  	if (_1_op == int32(94)) || ((_1_op == int32(157)) && (int32(_p.Xop2) == int32(94))) {
 73701  		_pColl = _sqlite3GetCollSeq(tls, _pParse, _db.Xenc, nil, *(**int8)(unsafe.Pointer(&_p.Xu)))
 73702  		goto _1
 73703  	}
 73704  	if _1_op != int32(154) && _1_op != int32(152) && _1_op != int32(157) && _1_op != int32(61) || (*XTable)(_p.XpTab) == nil {
 73705  		goto _12
 73706  	}
 73707  	_4_j = int32(_p.XiColumn)
 73708  	if _4_j >= int32(0) {
 73709  		_5_zColl = elem43((*XColumn)((*XTable)(_p.XpTab).XaCol), uintptr(_4_j)).XzColl
 73710  		_pColl = _sqlite3FindCollSeq(tls, _db, _db.Xenc, _5_zColl, int32(0))
 73711  	}
 73712  	goto _1
 73713  _12:
 73714  	if (_p.Xflags & uint32(256)) == 0 {
 73715  		goto _14
 73716  	}
 73717  	if (_p.XpLeft != nil) && ((((*XExpr)(_p.XpLeft).Xflags) & uint32(256)) != (0)) {
 73718  		_p = (*XExpr)(_p.XpLeft)
 73719  		goto _17
 73720  	}
 73721  	_8_pNext = (*XExpr)(_p.XpRight)
 73722  	func() {
 73723  		if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil && (*XExpr)(_p.XpRight) != nil {
 73724  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91064), unsafe.Pointer(&_sqlite3ExprCollSeqØ00__func__Ø000), unsafe.Pointer(str(21240)))
 73725  			crt.X__builtin_abort(tls)
 73726  		}
 73727  	}()
 73728  	if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) == nil || func() int32 {
 73729  		if (_p.Xflags & uint32(2048)) == (0) {
 73730  			return int32(1)
 73731  		}
 73732  		return func() int32 {
 73733  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91068), unsafe.Pointer(&_sqlite3ExprCollSeqØ00__func__Ø000), unsafe.Pointer(str(4809)))
 73734  			crt.X__builtin_abort(tls)
 73735  			return int32(0)
 73736  		}()
 73737  	}() == 0 {
 73738  		goto _24
 73739  	}
 73740  	_9_i = int32(0)
 73741  _25:
 73742  	if func() int32 {
 73743  		if _9_i < ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).XnExpr) {
 73744  			return int32(1)
 73745  		}
 73746  		return func() int32 {
 73747  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91070), unsafe.Pointer(&_sqlite3ExprCollSeqØ00__func__Ø000), unsafe.Pointer(str(4809)))
 73748  			crt.X__builtin_abort(tls)
 73749  			return int32(0)
 73750  		}()
 73751  	}() == 0 {
 73752  		goto _30
 73753  	}
 73754  	if (((*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).Xa))), uintptr(_9_i)).XpExpr).Xflags) & uint32(256)) != (0) {
 73755  		_8_pNext = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).Xa))), uintptr(_9_i)).XpExpr)
 73756  		goto _30
 73757  	}
 73758  	_9_i += 1
 73759  	goto _25
 73760  _30:
 73761  _24:
 73762  	_p = _8_pNext
 73763  _17:
 73764  	goto _32
 73765  _14:
 73766  	goto _1
 73767  _32:
 73768  	goto _0
 73769  _1:
 73770  	if _sqlite3CheckCollSeq(tls, _pParse, _pColl) != 0 {
 73771  		_pColl = nil
 73772  	}
 73773  	return _pColl
 73774  }
 73775  
 73776  var _sqlite3ExprCollSeqØ00__func__Ø000 [19]int8
 73777  
 73778  func init() {
 73779  	crt.Xstrncpy(nil, &_sqlite3ExprCollSeqØ00__func__Ø000[0], str(94590), 19)
 73780  }
 73781  
 73782  // C comment
 73783  //  /*
 73784  //  ** This routine is called on a collation sequence before it is used to
 73785  //  ** check that it is defined. An undefined collation sequence exists when
 73786  //  ** a database is loaded that contains references to collation sequences
 73787  //  ** that have not been defined by sqlite3_create_collation() etc.
 73788  //  **
 73789  //  ** If required, this routine calls the 'collation needed' callback to
 73790  //  ** request a definition of the collating sequence. If this doesn't work,
 73791  //  ** an equivalent collating sequence that uses a text encoding different
 73792  //  ** from the main database is substituted, if one is available.
 73793  //  */
 73794  func _sqlite3CheckCollSeq(tls *crt.TLS, _pParse *XParse, _pColl *XCollSeq) (r0 int32) {
 73795  	var _1_zName *int8
 73796  	var _1_db *Xsqlite3
 73797  	var _1_p *XCollSeq
 73798  	if _pColl == nil {
 73799  		goto _0
 73800  	}
 73801  	_1_zName = _pColl.XzName
 73802  	_1_db = (*Xsqlite3)(_pParse.Xdb)
 73803  	_1_p = _sqlite3GetCollSeq(tls, _pParse, _1_db.Xenc, _pColl, _1_zName)
 73804  	if _1_p == nil {
 73805  		return int32(1)
 73806  	}
 73807  	func() {
 73808  		if _1_p != _pColl {
 73809  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104276), unsafe.Pointer(&_sqlite3CheckCollSeqØ00__func__Ø000), unsafe.Pointer(str(94609)))
 73810  			crt.X__builtin_abort(tls)
 73811  		}
 73812  	}()
 73813  _0:
 73814  	return int32(0)
 73815  }
 73816  
 73817  var _sqlite3CheckCollSeqØ00__func__Ø000 [20]int8
 73818  
 73819  func init() {
 73820  	crt.Xstrncpy(nil, &_sqlite3CheckCollSeqØ00__func__Ø000[0], str(94618), 20)
 73821  }
 73822  
 73823  // C comment
 73824  //  /*
 73825  //  ** If the source-list item passed as an argument was augmented with an
 73826  //  ** INDEXED BY clause, then try to locate the specified index. If there
 73827  //  ** was such a clause and the named index cannot be found, return
 73828  //  ** SQLITE_ERROR and leave an error in pParse. Otherwise, populate
 73829  //  ** pFrom->pIndex and return SQLITE_OK.
 73830  //  */
 73831  func _sqlite3IndexedByLookup(tls *crt.TLS, _pParse *XParse, _pFrom *TSrcList_item) (r0 int32) {
 73832  	var _1_zIndexedBy *int8
 73833  	var _1_pTab *XTable
 73834  	var _1_pIdx *XIndex
 73835  	if _pFrom.XpTab == nil || ((uint32((_pFrom.Xfg.XnotIndexed)>>1)<<31)>>31) == 0 {
 73836  		goto _1
 73837  	}
 73838  	_1_pTab = (*XTable)(_pFrom.XpTab)
 73839  	_1_zIndexedBy = *(**int8)(unsafe.Pointer(&_pFrom.Xu1))
 73840  	_1_pIdx = (*XIndex)(_1_pTab.XpIndex)
 73841  _2:
 73842  	if _1_pIdx == nil || _sqlite3StrICmp(tls, _1_pIdx.XzName, _1_zIndexedBy) == 0 {
 73843  		goto _6
 73844  	}
 73845  	_1_pIdx = (*XIndex)(_1_pIdx.XpNext)
 73846  	goto _2
 73847  _6:
 73848  	if _1_pIdx == nil {
 73849  		_sqlite3ErrorMsg(tls, _pParse, str(94638), unsafe.Pointer(_1_zIndexedBy), int32(0))
 73850  		_pParse.XcheckSchema = uint8(1)
 73851  		return int32(1)
 73852  	}
 73853  	*(**XIndex)(unsafe.Pointer(&_pFrom.XpIBIndex)) = _1_pIdx
 73854  _1:
 73855  	return int32(0)
 73856  }
 73857  
 73858  // C comment
 73859  //  /*
 73860  //  ** This routine processes the join information for a SELECT statement.
 73861  //  ** ON and USING clauses are converted into extra terms of the WHERE clause.
 73862  //  ** NATURAL joins also create extra WHERE clause terms.
 73863  //  **
 73864  //  ** The terms of a FROM clause are contained in the Select.pSrc structure.
 73865  //  ** The left most table is the first entry in Select.pSrc.  The right-most
 73866  //  ** table is the last entry.  The join operator is held in the entry to
 73867  //  ** the left.  Thus entry 0 contains the join operator for the join between
 73868  //  ** entries 0 and 1.  Any ON or USING clauses associated with the join are
 73869  //  ** also attached to the left entry.
 73870  //  **
 73871  //  ** This routine returns the number of errors encountered.
 73872  //  */
 73873  func _sqliteProcessJoin(tls *crt.TLS, _pParse *XParse, _p *XSelect) (r0 int32) {
 73874  	var _i, _j, _1_isOuter, _4_iLeft, _4_iLeftCol, _9_iLeft, _9_iLeftCol, _9_iRightCol int32
 73875  	var _4_zName, _9_zName *int8
 73876  	var _1_pLeftTab, _1_pRightTab *XTable
 73877  	var _pSrc *XSrcList
 73878  	var _pLeft, _pRight *TSrcList_item
 73879  	var _8_pList *XIdList
 73880  	_pSrc = (*XSrcList)(_p.XpSrc)
 73881  	_pLeft = elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0)
 73882  	_pRight = elem6(_pLeft, uintptr(1))
 73883  	_i = int32(0)
 73884  _0:
 73885  	if _i >= (_pSrc.XnSrc - int32(1)) {
 73886  		goto _3
 73887  	}
 73888  	_1_pLeftTab = (*XTable)(_pLeft.XpTab)
 73889  	_1_pRightTab = (*XTable)(_pRight.XpTab)
 73890  	if func() int32 {
 73891  		if (_1_pLeftTab == nil) || (_1_pRightTab == nil) {
 73892  			return func() int32 {
 73893  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116938), unsafe.Pointer(&_sqliteProcessJoinØ00__func__Ø000), unsafe.Pointer(str(4809)))
 73894  				crt.X__builtin_abort(tls)
 73895  				return int32(1)
 73896  			}()
 73897  		}
 73898  		return int32(0)
 73899  	}() != 0 {
 73900  		goto _1
 73901  	}
 73902  	_1_isOuter = bool2int((int32(_pRight.Xfg.Xjointype) & int32(32)) != int32(0))
 73903  	if (int32(_pRight.Xfg.Xjointype) & int32(4)) == 0 {
 73904  		goto _8
 73905  	}
 73906  	if (_pRight.XpOn != nil) || (_pRight.XpUsing != nil) {
 73907  		_sqlite3ErrorMsg(tls, _pParse, str(94656), int32(0))
 73908  		return int32(1)
 73909  	}
 73910  	_j = int32(0)
 73911  _11:
 73912  	if _j >= int32(_1_pRightTab.XnCol) {
 73913  		goto _14
 73914  	}
 73915  	_4_zName = elem43((*XColumn)(_1_pRightTab.XaCol), uintptr(_j)).XzName
 73916  	if _tableAndColumnIndex(tls, _pSrc, _i+int32(1), _4_zName, &_4_iLeft, &_4_iLeftCol) != 0 {
 73917  		_addWhereTerm(tls, _pParse, _pSrc, _4_iLeft, _4_iLeftCol, _i+int32(1), _j, _1_isOuter, (**XExpr)(unsafe.Pointer(&_p.XpWhere)))
 73918  	}
 73919  	_j += 1
 73920  	goto _11
 73921  _14:
 73922  _8:
 73923  	if (_pRight.XpOn != nil) && (_pRight.XpUsing != nil) {
 73924  		_sqlite3ErrorMsg(tls, _pParse, str(94706))
 73925  		return int32(1)
 73926  	}
 73927  	if _pRight.XpOn == nil {
 73928  		goto _18
 73929  	}
 73930  	if _1_isOuter != 0 {
 73931  		_setJoinExpr(tls, (*XExpr)(_pRight.XpOn), _pRight.XiCursor)
 73932  	}
 73933  	*(**XExpr)(unsafe.Pointer(&_p.XpWhere)) = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(_p.XpWhere), (*XExpr)(_pRight.XpOn))
 73934  	*(**XExpr)(unsafe.Pointer(&_pRight.XpOn)) = nil
 73935  _18:
 73936  	if _pRight.XpUsing == nil {
 73937  		goto _20
 73938  	}
 73939  	_8_pList = (*XIdList)(_pRight.XpUsing)
 73940  	_j = int32(0)
 73941  _21:
 73942  	if _j >= _8_pList.XnId {
 73943  		goto _24
 73944  	}
 73945  	_9_zName = elem44((*TIdList_item)(_8_pList.Xa), uintptr(_j)).XzName
 73946  	_9_iRightCol = _columnIndex(tls, _1_pRightTab, _9_zName)
 73947  	if (_9_iRightCol < int32(0)) || (_tableAndColumnIndex(tls, _pSrc, _i+int32(1), _9_zName, &_9_iLeft, &_9_iLeftCol) == 0) {
 73948  		_sqlite3ErrorMsg(tls, _pParse, str(94761), unsafe.Pointer(_9_zName))
 73949  		return int32(1)
 73950  	}
 73951  	_addWhereTerm(tls, _pParse, _pSrc, _9_iLeft, _9_iLeftCol, _i+int32(1), _9_iRightCol, _1_isOuter, (**XExpr)(unsafe.Pointer(&_p.XpWhere)))
 73952  	_j += 1
 73953  	goto _21
 73954  _24:
 73955  _20:
 73956  _1:
 73957  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item {
 73958  		*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pRight }())) += uintptr(112)
 73959  		return &_pLeft
 73960  	}())) += uintptr(112)
 73961  	goto _0
 73962  _3:
 73963  	return int32(0)
 73964  }
 73965  
 73966  var _sqliteProcessJoinØ00__func__Ø000 [18]int8
 73967  
 73968  func init() {
 73969  	crt.Xstrncpy(nil, &_sqliteProcessJoinØ00__func__Ø000[0], str(94825), 18)
 73970  }
 73971  
 73972  // C comment
 73973  //  /*
 73974  //  ** Search the first N tables in pSrc, from left to right, looking for a
 73975  //  ** table that has a column named zCol.
 73976  //  **
 73977  //  ** When found, set *piTab and *piCol to the table index and column index
 73978  //  ** of the matching column and return TRUE.
 73979  //  **
 73980  //  ** If not found, return FALSE.
 73981  //  */
 73982  func _tableAndColumnIndex(tls *crt.TLS, _pSrc *XSrcList, _N int32, _zCol *int8, _piTab *int32, _piCol *int32) (r0 int32) {
 73983  	var _i, _iCol int32
 73984  	func() {
 73985  		if (_piTab == nil) != (_piCol == nil) {
 73986  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116809), unsafe.Pointer(&_tableAndColumnIndexØ00__func__Ø000), unsafe.Pointer(str(94843)))
 73987  			crt.X__builtin_abort(tls)
 73988  		}
 73989  	}()
 73990  	_i = int32(0)
 73991  _2:
 73992  	if _i >= _N {
 73993  		goto _5
 73994  	}
 73995  	_iCol = _columnIndex(tls, (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i)).XpTab), _zCol)
 73996  	if _iCol < int32(0) {
 73997  		goto _6
 73998  	}
 73999  	if _piTab != nil {
 74000  		*_piTab = _i
 74001  		*_piCol = _iCol
 74002  	}
 74003  	return int32(1)
 74004  
 74005  _6:
 74006  	_i += 1
 74007  	goto _2
 74008  _5:
 74009  	return int32(0)
 74010  }
 74011  
 74012  var _tableAndColumnIndexØ00__func__Ø000 [20]int8
 74013  
 74014  func init() {
 74015  	crt.Xstrncpy(nil, &_tableAndColumnIndexØ00__func__Ø000[0], str(94866), 20)
 74016  }
 74017  
 74018  // C comment
 74019  //  /*
 74020  //  ** Return the index of a column in a table.  Return -1 if the column
 74021  //  ** is not contained in the table.
 74022  //  */
 74023  func _columnIndex(tls *crt.TLS, _pTab *XTable, _zCol *int8) (r0 int32) {
 74024  	var _i int32
 74025  	_i = int32(0)
 74026  _0:
 74027  	if _i >= int32(_pTab.XnCol) {
 74028  		goto _3
 74029  	}
 74030  	if _sqlite3StrICmp(tls, elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XzName, _zCol) == int32(0) {
 74031  		return _i
 74032  	}
 74033  	_i += 1
 74034  	goto _0
 74035  _3:
 74036  	return int32(-1)
 74037  }
 74038  
 74039  // C comment
 74040  //  /*
 74041  //  ** This function is used to add terms implied by JOIN syntax to the
 74042  //  ** WHERE clause expression of a SELECT statement. The new term, which
 74043  //  ** is ANDed with the existing WHERE clause, is of the form:
 74044  //  **
 74045  //  **    (tab1.col1 = tab2.col2)
 74046  //  **
 74047  //  ** where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the
 74048  //  ** (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is
 74049  //  ** column iColRight of tab2.
 74050  //  */
 74051  func _addWhereTerm(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _iLeft int32, _iColLeft int32, _iRight int32, _iColRight int32, _isOuterJoin int32, _ppWhere **XExpr) {
 74052  	var _db *Xsqlite3
 74053  	var _pE1, _pE2, _pEq *XExpr
 74054  	_db = (*Xsqlite3)(_pParse.Xdb)
 74055  	func() {
 74056  		if _iLeft >= _iRight {
 74057  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116849), unsafe.Pointer(&_addWhereTermØ00__func__Ø000), unsafe.Pointer(str(94886)))
 74058  			crt.X__builtin_abort(tls)
 74059  		}
 74060  	}()
 74061  	func() {
 74062  		if _pSrc.XnSrc <= _iRight {
 74063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116850), unsafe.Pointer(&_addWhereTermØ00__func__Ø000), unsafe.Pointer(str(94899)))
 74064  			crt.X__builtin_abort(tls)
 74065  		}
 74066  	}()
 74067  	func() {
 74068  		if (elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iLeft)).XpTab) == nil {
 74069  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116851), unsafe.Pointer(&_addWhereTermØ00__func__Ø000), unsafe.Pointer(str(94917)))
 74070  			crt.X__builtin_abort(tls)
 74071  		}
 74072  	}()
 74073  	func() {
 74074  		if (elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iRight)).XpTab) == nil {
 74075  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116852), unsafe.Pointer(&_addWhereTermØ00__func__Ø000), unsafe.Pointer(str(94937)))
 74076  			crt.X__builtin_abort(tls)
 74077  		}
 74078  	}()
 74079  	_pE1 = _sqlite3CreateColumnExpr(tls, _db, _pSrc, _iLeft, _iColLeft)
 74080  	_pE2 = _sqlite3CreateColumnExpr(tls, _db, _pSrc, _iRight, _iColRight)
 74081  	_pEq = _sqlite3PExpr(tls, _pParse, int32(78), _pE1, _pE2)
 74082  	if (_pEq != nil) && _isOuterJoin != 0 {
 74083  		_pEq.Xflags |= uint32(1)
 74084  		func() {
 74085  			if (_pEq.Xflags & uint32(24576)) != (0) {
 74086  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116860), unsafe.Pointer(&_addWhereTermØ00__func__Ø000), unsafe.Pointer(str(94958)))
 74087  				crt.X__builtin_abort(tls)
 74088  			}
 74089  		}()
 74090  		_pEq.Xflags |= uint32(131072)
 74091  		_pEq.XiRightJoinTable = int16(_pE2.XiTable)
 74092  	}
 74093  	*_ppWhere = _sqlite3ExprAnd(tls, _db, *_ppWhere, _pEq)
 74094  }
 74095  
 74096  var _addWhereTermØ00__func__Ø000 [13]int8
 74097  
 74098  func init() {
 74099  	crt.Xstrncpy(nil, &_addWhereTermØ00__func__Ø000[0], str(95005), 13)
 74100  }
 74101  
 74102  // C comment
 74103  //  /*
 74104  //  ** Allocate and return a pointer to an expression to load the column iCol
 74105  //  ** from datasource iSrc in SrcList pSrc.
 74106  //  */
 74107  func _sqlite3CreateColumnExpr(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _iSrc int32, _iCol int32) (r0 *XExpr) {
 74108  	var _1_pItem *TSrcList_item
 74109  	var _p *XExpr
 74110  	_p = _sqlite3ExprAlloc(tls, _db, int32(152), nil, int32(0))
 74111  	if _p == nil {
 74112  		goto _0
 74113  	}
 74114  	_1_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iSrc))
 74115  	*(**XTable)(unsafe.Pointer(&_p.XpTab)) = (*XTable)(_1_pItem.XpTab)
 74116  	_p.XiTable = _1_pItem.XiCursor
 74117  	if int32((*XTable)(_p.XpTab).XiPKey) == _iCol {
 74118  		_p.XiColumn = int16(-1)
 74119  		goto _2
 74120  	}
 74121  	_p.XiColumn = int16(_iCol)
 74122  	_1_pItem.XcolUsed |= uint64(1) << uint(func() int32 {
 74123  		if _iCol >= int32(64) {
 74124  			return int32(63)
 74125  		}
 74126  		return _iCol
 74127  	}())
 74128  _2:
 74129  	_p.Xflags |= uint32(4)
 74130  _0:
 74131  	return _p
 74132  }
 74133  
 74134  // C comment
 74135  //  /*
 74136  //  ** Allocate an Expr node which joins as many as two subtrees.
 74137  //  **
 74138  //  ** One or both of the subtrees can be NULL.  Return a pointer to the new
 74139  //  ** Expr node.  Or, if an OOM error occurs, set pParse->db->mallocFailed,
 74140  //  ** free the subtrees and return NULL.
 74141  //  */
 74142  func _sqlite3PExpr(tls *crt.TLS, _pParse *XParse, _op int32, _pLeft *XExpr, _pRight *XExpr) (r0 *XExpr) {
 74143  	var _p *XExpr
 74144  	if (_op == int32(71)) && (_pParse.XnErr == int32(0)) {
 74145  		_p = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.Xdb), _pLeft, _pRight)
 74146  		goto _2
 74147  	}
 74148  	_p = (*XExpr)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.Xdb), uint64(72)))
 74149  	if _p != nil {
 74150  		crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(72))
 74151  		_p.Xop = uint8(_op & int32(255))
 74152  		_p.XiAgg = int16(-1)
 74153  	}
 74154  	_sqlite3ExprAttachSubtrees(tls, (*Xsqlite3)(_pParse.Xdb), _p, _pLeft, _pRight)
 74155  _2:
 74156  	if _p != nil {
 74157  		_sqlite3ExprCheckHeight(tls, _pParse, _p.XnHeight)
 74158  	}
 74159  	return _p
 74160  }
 74161  
 74162  // C comment
 74163  //  /*
 74164  //  ** Join two expressions using an AND operator.  If either expression is
 74165  //  ** NULL, then just return the other expression.
 74166  //  **
 74167  //  ** If one side or the other of the AND is known to be false, then instead
 74168  //  ** of returning an AND expression, just return a constant expression with
 74169  //  ** a value of false.
 74170  //  */
 74171  func _sqlite3ExprAnd(tls *crt.TLS, _db *Xsqlite3, _pLeft *XExpr, _pRight *XExpr) (r0 *XExpr) {
 74172  	var _4_pNew *XExpr
 74173  	if _pLeft == nil {
 74174  		return _pRight
 74175  	}
 74176  	if _pRight == nil {
 74177  		return _pLeft
 74178  	}
 74179  	if _exprAlwaysFalse(tls, _pLeft) != 0 || _exprAlwaysFalse(tls, _pRight) != 0 {
 74180  		_sqlite3ExprDelete(tls, _db, _pLeft)
 74181  		_sqlite3ExprDelete(tls, _db, _pRight)
 74182  		return _sqlite3ExprAlloc(tls, _db, int32(134), elem58((*XToken)(unsafe.Pointer(&_sqlite3IntTokens)), 0), int32(0))
 74183  	}
 74184  	_4_pNew = _sqlite3ExprAlloc(tls, _db, int32(71), nil, int32(0))
 74185  	_sqlite3ExprAttachSubtrees(tls, _db, _4_pNew, _pLeft, _pRight)
 74186  	return _4_pNew
 74187  }
 74188  
 74189  func _exprAlwaysFalse(tls *crt.TLS, _p *XExpr) (r0 int32) {
 74190  	var _v int32
 74191  	_v = int32(0)
 74192  	if (_p.Xflags & uint32(1)) != (0) {
 74193  		return int32(0)
 74194  	}
 74195  	if _sqlite3ExprIsInteger(tls, _p, &_v) == 0 {
 74196  		return int32(0)
 74197  	}
 74198  	return bool2int(_v == int32(0))
 74199  }
 74200  
 74201  // C comment
 74202  //  /*
 74203  //  ** If the expression p codes a constant integer that is small enough
 74204  //  ** to fit in a 32-bit integer, return 1 and put the value of the integer
 74205  //  ** in *pValue.  If the expression is not an integer or if it is too big
 74206  //  ** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.
 74207  //  */
 74208  func _sqlite3ExprIsInteger(tls *crt.TLS, _p *XExpr, _pValue *int32) (r0 int32) {
 74209  	var _rc, _4_v int32
 74210  	_rc = int32(0)
 74211  	if _p == nil {
 74212  		return int32(0)
 74213  	}
 74214  	func() {
 74215  		if int32(_p.Xop) == int32(134) && (_p.Xflags&uint32(1024)) == (0) && _sqlite3GetInt32(tls, *(**int8)(unsafe.Pointer(&_p.Xu)), &_rc) != int32(0) {
 74216  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92815), unsafe.Pointer(&_sqlite3ExprIsIntegerØ00__func__Ø000), unsafe.Pointer(str(95018)))
 74217  			crt.X__builtin_abort(tls)
 74218  		}
 74219  	}()
 74220  	if (_p.Xflags & uint32(1024)) != 0 {
 74221  		*_pValue = *(*int32)(unsafe.Pointer(&_p.Xu))
 74222  		return int32(1)
 74223  	}
 74224  	switch int32(_p.Xop) {
 74225  	case int32(155):
 74226  		goto _8
 74227  	case int32(156):
 74228  		goto _7
 74229  	default:
 74230  		goto _9
 74231  	}
 74232  
 74233  _7:
 74234  	_rc = _sqlite3ExprIsInteger(tls, (*XExpr)(_p.XpLeft), _pValue)
 74235  	goto _10
 74236  _8:
 74237  	if _sqlite3ExprIsInteger(tls, (*XExpr)(_p.XpLeft), &_4_v) != 0 {
 74238  		func() {
 74239  			if _4_v == int32(-2147483648) {
 74240  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92830), unsafe.Pointer(&_sqlite3ExprIsIntegerØ00__func__Ø000), unsafe.Pointer(str(95107)))
 74241  				crt.X__builtin_abort(tls)
 74242  			}
 74243  		}()
 74244  		*_pValue = -_4_v
 74245  		_rc = int32(1)
 74246  	}
 74247  	goto _10
 74248  _9:
 74249  	goto _10
 74250  _10:
 74251  	return _rc
 74252  }
 74253  
 74254  var _sqlite3ExprIsIntegerØ00__func__Ø000 [21]int8
 74255  
 74256  func init() {
 74257  	crt.Xstrncpy(nil, &_sqlite3ExprIsIntegerØ00__func__Ø000[0], str(95126), 21)
 74258  }
 74259  
 74260  // C comment
 74261  //  /*
 74262  //  ** Constant tokens for values 0 and 1.
 74263  //  */
 74264  var _sqlite3IntTokens [2]XToken
 74265  
 74266  func init() {
 74267  	_sqlite3IntTokens = [2]XToken{XToken{Xz: str(4809), Xn: uint32(1)}, XToken{Xz: str(49995), Xn: uint32(1)}}
 74268  }
 74269  
 74270  // C comment
 74271  //  /*
 74272  //  ** Attach subtrees pLeft and pRight to the Expr node pRoot.
 74273  //  **
 74274  //  ** If pRoot==NULL that means that a memory allocation error has occurred.
 74275  //  ** In that case, delete the subtrees pLeft and pRight.
 74276  //  */
 74277  func _sqlite3ExprAttachSubtrees(tls *crt.TLS, _db *Xsqlite3, _pRoot *XExpr, _pLeft *XExpr, _pRight *XExpr) {
 74278  	if _pRoot == nil {
 74279  		func() {
 74280  			if _db.XmallocFailed == 0 {
 74281  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91693), unsafe.Pointer(&_sqlite3ExprAttachSubtreesØ00__func__Ø000), unsafe.Pointer(str(47803)))
 74282  				crt.X__builtin_abort(tls)
 74283  			}
 74284  		}()
 74285  		_sqlite3ExprDelete(tls, _db, _pLeft)
 74286  		_sqlite3ExprDelete(tls, _db, _pRight)
 74287  		goto _3
 74288  	}
 74289  	if _pRight != nil {
 74290  		*(**XExpr)(unsafe.Pointer(&_pRoot.XpRight)) = _pRight
 74291  		_pRoot.Xflags |= uint32(2097408) & _pRight.Xflags
 74292  	}
 74293  	if _pLeft != nil {
 74294  		*(**XExpr)(unsafe.Pointer(&_pRoot.XpLeft)) = _pLeft
 74295  		_pRoot.Xflags |= uint32(2097408) & _pLeft.Xflags
 74296  	}
 74297  	_exprSetHeight(tls, _pRoot)
 74298  _3:
 74299  }
 74300  
 74301  var _sqlite3ExprAttachSubtreesØ00__func__Ø000 [26]int8
 74302  
 74303  func init() {
 74304  	crt.Xstrncpy(nil, &_sqlite3ExprAttachSubtreesØ00__func__Ø000[0], str(95147), 26)
 74305  }
 74306  
 74307  // C comment
 74308  //  /*
 74309  //  ** Set the Expr.nHeight variable in the structure passed as an
 74310  //  ** argument. An expression with no children, Expr.pList or
 74311  //  ** Expr.pSelect member has a height of 1. Any other expression
 74312  //  ** has a height equal to the maximum height of any other
 74313  //  ** referenced Expr plus one.
 74314  //  **
 74315  //  ** Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags,
 74316  //  ** if appropriate.
 74317  //  */
 74318  func _exprSetHeight(tls *crt.TLS, _p *XExpr) {
 74319  	var _nHeight int32
 74320  	_nHeight = int32(0)
 74321  	_heightOfExpr(tls, (*XExpr)(_p.XpLeft), &_nHeight)
 74322  	_heightOfExpr(tls, (*XExpr)(_p.XpRight), &_nHeight)
 74323  	if (_p.Xflags & uint32(2048)) != (0) {
 74324  		_heightOfSelect(tls, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))), &_nHeight)
 74325  		goto _2
 74326  	}
 74327  	if (*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil {
 74328  		_heightOfExprList(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))), &_nHeight)
 74329  		_p.Xflags |= uint32(2097408) & _sqlite3ExprListFlags(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))))
 74330  	}
 74331  _2:
 74332  	_p.XnHeight = _nHeight + int32(1)
 74333  }
 74334  
 74335  // C comment
 74336  //  /* The following three functions, heightOfExpr(), heightOfExprList()
 74337  //  ** and heightOfSelect(), are used to determine the maximum height
 74338  //  ** of any expression tree referenced by the structure passed as the
 74339  //  ** first argument.
 74340  //  **
 74341  //  ** If this maximum height is greater than the current value pointed
 74342  //  ** to by pnHeight, the second parameter, then set *pnHeight to that
 74343  //  ** value.
 74344  //  */
 74345  func _heightOfExpr(tls *crt.TLS, _p *XExpr, _pnHeight *int32) {
 74346  	if _p == nil {
 74347  		goto _0
 74348  	}
 74349  	if _p.XnHeight > (*_pnHeight) {
 74350  		*_pnHeight = _p.XnHeight
 74351  	}
 74352  _0:
 74353  }
 74354  
 74355  func _heightOfSelect(tls *crt.TLS, _p *XSelect, _pnHeight *int32) {
 74356  	if _p != nil {
 74357  		_heightOfExpr(tls, (*XExpr)(_p.XpWhere), _pnHeight)
 74358  		_heightOfExpr(tls, (*XExpr)(_p.XpHaving), _pnHeight)
 74359  		_heightOfExpr(tls, (*XExpr)(_p.XpLimit), _pnHeight)
 74360  		_heightOfExpr(tls, (*XExpr)(_p.XpOffset), _pnHeight)
 74361  		_heightOfExprList(tls, (*XExprList)(_p.XpEList), _pnHeight)
 74362  		_heightOfExprList(tls, (*XExprList)(_p.XpGroupBy), _pnHeight)
 74363  		_heightOfExprList(tls, (*XExprList)(_p.XpOrderBy), _pnHeight)
 74364  		_heightOfSelect(tls, (*XSelect)(_p.XpPrior), _pnHeight)
 74365  	}
 74366  }
 74367  
 74368  func _heightOfExprList(tls *crt.TLS, _p *XExprList, _pnHeight *int32) {
 74369  	var _1_i int32
 74370  	if _p == nil {
 74371  		goto _0
 74372  	}
 74373  	_1_i = int32(0)
 74374  _1:
 74375  	if _1_i >= _p.XnExpr {
 74376  		goto _4
 74377  	}
 74378  	_heightOfExpr(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_1_i)).XpExpr), _pnHeight)
 74379  	_1_i += 1
 74380  	goto _1
 74381  _4:
 74382  _0:
 74383  }
 74384  
 74385  // C comment
 74386  //  /*
 74387  //  ** Return the bitwise-OR of all Expr.flags fields in the given
 74388  //  ** ExprList.
 74389  //  */
 74390  func _sqlite3ExprListFlags(tls *crt.TLS, _pList *XExprList) (r0 uint32) {
 74391  	var _i int32
 74392  	var _m uint32
 74393  	var _2_pExpr *XExpr
 74394  	_m = uint32(0)
 74395  	if _pList == nil {
 74396  		goto _0
 74397  	}
 74398  	_i = int32(0)
 74399  _1:
 74400  	if _i >= _pList.XnExpr {
 74401  		goto _4
 74402  	}
 74403  	_2_pExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr)
 74404  	func() {
 74405  		if _2_pExpr == nil {
 74406  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92578), unsafe.Pointer(&_sqlite3ExprListFlagsØ00__func__Ø000), unsafe.Pointer(str(43591)))
 74407  			crt.X__builtin_abort(tls)
 74408  		}
 74409  	}()
 74410  	_m |= _2_pExpr.Xflags
 74411  	_i += 1
 74412  	goto _1
 74413  _4:
 74414  _0:
 74415  	return _m
 74416  }
 74417  
 74418  var _sqlite3ExprListFlagsØ00__func__Ø000 [21]int8
 74419  
 74420  func init() {
 74421  	crt.Xstrncpy(nil, &_sqlite3ExprListFlagsØ00__func__Ø000[0], str(95173), 21)
 74422  }
 74423  
 74424  // C comment
 74425  //  /*
 74426  //  ** Check that argument nHeight is less than or equal to the maximum
 74427  //  ** expression depth allowed. If it is not, leave an error message in
 74428  //  ** pParse.
 74429  //  */
 74430  func _sqlite3ExprCheckHeight(tls *crt.TLS, _pParse *XParse, _nHeight int32) (r0 int32) {
 74431  	var _rc, _mxHeight int32
 74432  	_rc = int32(0)
 74433  	_mxHeight = *elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.Xdb).XaLimit))), uintptr(3))
 74434  	if _nHeight > _mxHeight {
 74435  		_sqlite3ErrorMsg(tls, _pParse, str(95194), _mxHeight)
 74436  		_rc = int32(1)
 74437  	}
 74438  	return _rc
 74439  }
 74440  
 74441  // C comment
 74442  //  /*
 74443  //  ** Set the EP_FromJoin property on all terms of the given expression.
 74444  //  ** And set the Expr.iRightJoinTable to iTable for every term in the
 74445  //  ** expression.
 74446  //  **
 74447  //  ** The EP_FromJoin property is used on terms of an expression to tell
 74448  //  ** the LEFT OUTER JOIN processing logic that this term is part of the
 74449  //  ** join restriction specified in the ON or USING clause and not a part
 74450  //  ** of the more general WHERE clause.  These terms are moved over to the
 74451  //  ** WHERE clause during join processing but we need to remember that they
 74452  //  ** originated in the ON or USING clause.
 74453  //  **
 74454  //  ** The Expr.iRightJoinTable tells the WHERE clause processing that the
 74455  //  ** expression depends on table iRightJoinTable even if that table is not
 74456  //  ** explicitly mentioned in the expression.  That information is needed
 74457  //  ** for cases like this:
 74458  //  **
 74459  //  **    SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5
 74460  //  **
 74461  //  ** The where clause needs to defer the handling of the t1.x=5
 74462  //  ** term until after the t2 loop of the join.  In that way, a
 74463  //  ** NULL t2 row will be inserted whenever t1.x!=5.  If we do not
 74464  //  ** defer the handling of t1.x=5, it will be processed immediately
 74465  //  ** after the t1 loop and rows with t1.x!=5 will never appear in
 74466  //  ** the output, which is incorrect.
 74467  //  */
 74468  func _setJoinExpr(tls *crt.TLS, _p *XExpr, _iTable int32) {
 74469  	var _2_i int32
 74470  _0:
 74471  	if _p == nil {
 74472  		goto _1
 74473  	}
 74474  	_p.Xflags |= uint32(1)
 74475  	func() {
 74476  		if (_p.Xflags & uint32(24576)) != (0) {
 74477  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116896), unsafe.Pointer(&_setJoinExprØ00__func__Ø000), unsafe.Pointer(str(49384)))
 74478  			crt.X__builtin_abort(tls)
 74479  		}
 74480  	}()
 74481  	_p.Xflags |= uint32(131072)
 74482  	_p.XiRightJoinTable = int16(_iTable)
 74483  	if int32(_p.Xop) != int32(151) || (*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) == nil {
 74484  		goto _5
 74485  	}
 74486  	_2_i = int32(0)
 74487  _6:
 74488  	if _2_i >= ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).XnExpr) {
 74489  		goto _9
 74490  	}
 74491  	_setJoinExpr(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).Xa))), uintptr(_2_i)).XpExpr), _iTable)
 74492  	_2_i += 1
 74493  	goto _6
 74494  _9:
 74495  _5:
 74496  	_setJoinExpr(tls, (*XExpr)(_p.XpLeft), _iTable)
 74497  	_p = (*XExpr)(_p.XpRight)
 74498  	goto _0
 74499  _1:
 74500  }
 74501  
 74502  var _setJoinExprØ00__func__Ø000 [12]int8
 74503  
 74504  func init() {
 74505  	crt.Xstrncpy(nil, &_setJoinExprØ00__func__Ø000[0], str(95242), 12)
 74506  }
 74507  
 74508  // C comment
 74509  //  /*
 74510  //  ** Subqueries stores the original database, table and column names for their
 74511  //  ** result sets in ExprList.a[].zSpan, in the form "DATABASE.TABLE.COLUMN".
 74512  //  ** Check to see if the zSpan given to this routine matches the zDb, zTab,
 74513  //  ** and zCol.  If any of zDb, zTab, and zCol are NULL then those fields will
 74514  //  ** match anything.
 74515  //  */
 74516  func _sqlite3MatchSpanName(tls *crt.TLS, _zSpan *int8, _zCol *int8, _zTab *int8, _zDb *int8) (r0 int32) {
 74517  	var _n int32
 74518  	_n = int32(0)
 74519  _0:
 74520  	if func() int32 {
 74521  		if (*elem1(_zSpan, uintptr(_n))) != 0 {
 74522  			return int32(1)
 74523  		}
 74524  		return func() int32 {
 74525  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89484), unsafe.Pointer(&_sqlite3MatchSpanNameØ00__func__Ø000), unsafe.Pointer(str(4809)))
 74526  			crt.X__builtin_abort(tls)
 74527  			return int32(0)
 74528  		}()
 74529  	}() == 0 || int32(*elem1(_zSpan, uintptr(_n))) == int32(46) {
 74530  		goto _6
 74531  	}
 74532  	_n += 1
 74533  	goto _0
 74534  _6:
 74535  	if (_zDb != nil) && ((Xsqlite3_strnicmp(tls, _zSpan, _zDb, _n) != int32(0)) || (int32(*elem1(_zDb, uintptr(_n))) != int32(0))) {
 74536  		return int32(0)
 74537  	}
 74538  	*(*uintptr)(unsafe.Pointer(&_zSpan)) += uintptr(_n + int32(1))
 74539  	_n = int32(0)
 74540  _10:
 74541  	if func() int32 {
 74542  		if (*elem1(_zSpan, uintptr(_n))) != 0 {
 74543  			return int32(1)
 74544  		}
 74545  		return func() int32 {
 74546  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89489), unsafe.Pointer(&_sqlite3MatchSpanNameØ00__func__Ø000), unsafe.Pointer(str(4809)))
 74547  			crt.X__builtin_abort(tls)
 74548  			return int32(0)
 74549  		}()
 74550  	}() == 0 || int32(*elem1(_zSpan, uintptr(_n))) == int32(46) {
 74551  		goto _16
 74552  	}
 74553  	_n += 1
 74554  	goto _10
 74555  _16:
 74556  	if (_zTab != nil) && ((Xsqlite3_strnicmp(tls, _zSpan, _zTab, _n) != int32(0)) || (int32(*elem1(_zTab, uintptr(_n))) != int32(0))) {
 74557  		return int32(0)
 74558  	}
 74559  	*(*uintptr)(unsafe.Pointer(&_zSpan)) += uintptr(_n + int32(1))
 74560  	if (_zCol != nil) && (_sqlite3StrICmp(tls, _zSpan, _zCol) != int32(0)) {
 74561  		return int32(0)
 74562  	}
 74563  	return int32(1)
 74564  }
 74565  
 74566  var _sqlite3MatchSpanNameØ00__func__Ø000 [21]int8
 74567  
 74568  func init() {
 74569  	crt.Xstrncpy(nil, &_sqlite3MatchSpanNameØ00__func__Ø000[0], str(95254), 21)
 74570  }
 74571  
 74572  // C comment
 74573  //  /*
 74574  //  ** Return the index in pList of the identifier named zId.  Return -1
 74575  //  ** if not found.
 74576  //  */
 74577  func _sqlite3IdListIndex(tls *crt.TLS, _pList *XIdList, _zName *int8) (r0 int32) {
 74578  	var _i int32
 74579  	if _pList == nil {
 74580  		return int32(-1)
 74581  	}
 74582  	_i = int32(0)
 74583  _1:
 74584  	if _i >= _pList.XnId {
 74585  		goto _4
 74586  	}
 74587  	if _sqlite3StrICmp(tls, elem44((*TIdList_item)(_pList.Xa), uintptr(_i)).XzName, _zName) == int32(0) {
 74588  		return _i
 74589  	}
 74590  	_i += 1
 74591  	goto _1
 74592  _4:
 74593  	return int32(-1)
 74594  }
 74595  
 74596  // C comment
 74597  //  /*
 74598  //  ** Generate a Token object from a string
 74599  //  */
 74600  func _sqlite3TokenInit(tls *crt.TLS, _p *XToken, _z *int8) {
 74601  	_p.Xz = _z
 74602  	_p.Xn = uint32(_sqlite3Strlen30(tls, _z))
 74603  }
 74604  
 74605  // C comment
 74606  //  /*
 74607  //  ** Set the ExprList.a[].zName element of the most recently added item
 74608  //  ** on the expression list.
 74609  //  **
 74610  //  ** pList might be NULL following an OOM error.  But pName should never be
 74611  //  ** NULL.  If a memory allocation fails, the pParse->db->mallocFailed flag
 74612  //  ** is set.
 74613  //  */
 74614  func _sqlite3ExprListSetName(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pName *XToken, _dequote int32) {
 74615  	var _1_pItem *TExprList_item
 74616  	func() {
 74617  		if _pList == nil && int32((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == int32(0) {
 74618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92496), unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000), unsafe.Pointer(str(95275)))
 74619  			crt.X__builtin_abort(tls)
 74620  		}
 74621  	}()
 74622  	if _pList == nil {
 74623  		goto _3
 74624  	}
 74625  	func() {
 74626  		if _pList.XnExpr <= int32(0) {
 74627  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92499), unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000), unsafe.Pointer(str(21290)))
 74628  			crt.X__builtin_abort(tls)
 74629  		}
 74630  	}()
 74631  	_1_pItem = elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_pList.XnExpr-int32(1)))
 74632  	func() {
 74633  		if _1_pItem.XzName != nil {
 74634  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92501), unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000), unsafe.Pointer(str(95315)))
 74635  			crt.X__builtin_abort(tls)
 74636  		}
 74637  	}()
 74638  	_1_pItem.XzName = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_pParse.Xdb), _pName.Xz, uint64(_pName.Xn))
 74639  	if _dequote != 0 {
 74640  		_sqlite3Dequote(tls, _1_pItem.XzName)
 74641  	}
 74642  _3:
 74643  }
 74644  
 74645  var _sqlite3ExprListSetNameØ00__func__Ø000 [23]int8
 74646  
 74647  func init() {
 74648  	crt.Xstrncpy(nil, &_sqlite3ExprListSetNameØ00__func__Ø000[0], str(95331), 23)
 74649  }
 74650  
 74651  // C comment
 74652  //  /*
 74653  //  ** If the SELECT passed as the second argument has an associated WITH
 74654  //  ** clause, pop it from the stack stored as part of the Parse object.
 74655  //  **
 74656  //  ** This function is used as the xSelectCallback2() callback by
 74657  //  ** sqlite3SelectExpand() when walking a SELECT tree to resolve table
 74658  //  ** names and other FROM clause elements.
 74659  //  */
 74660  func _selectPopWith(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) {
 74661  	var _1_pWith *XWith
 74662  	var _pParse *XParse
 74663  	_pParse = (*XParse)(_pWalker.XpParse)
 74664  	if _pParse.XpWith == nil || (*XSelect)(_p.XpPrior) != nil {
 74665  		goto _1
 74666  	}
 74667  	_1_pWith = (*XWith)(_findRightmost(tls, _p).XpWith)
 74668  	if _1_pWith != nil {
 74669  		func() {
 74670  			if (*XWith)(_pParse.XpWith) != _1_pWith {
 74671  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120817), unsafe.Pointer(&_selectPopWithØ00__func__Ø000), unsafe.Pointer(str(95354)))
 74672  				crt.X__builtin_abort(tls)
 74673  			}
 74674  		}()
 74675  		*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = (*XWith)(_1_pWith.XpOuter)
 74676  	}
 74677  _1:
 74678  }
 74679  
 74680  // C comment
 74681  //  /*
 74682  //  ** Return a pointer to the right-most SELECT statement in a compound.
 74683  //  */
 74684  func _findRightmost(tls *crt.TLS, _p *XSelect) (r0 *XSelect) {
 74685  _0:
 74686  	if _p.XpNext != nil {
 74687  		_p = (*XSelect)(_p.XpNext)
 74688  		goto _0
 74689  	}
 74690  	return _p
 74691  }
 74692  
 74693  var _selectPopWithØ00__func__Ø000 [14]int8
 74694  
 74695  func init() {
 74696  	crt.Xstrncpy(nil, &_selectPopWithØ00__func__Ø000[0], str(95375), 14)
 74697  }
 74698  
 74699  // C comment
 74700  //  /*
 74701  //  ** Resolve all names in all expressions of a SELECT and in all
 74702  //  ** decendents of the SELECT, including compounds off of p->pPrior,
 74703  //  ** subqueries in expressions, and subqueries used as FROM clause
 74704  //  ** terms.
 74705  //  **
 74706  //  ** See sqlite3ResolveExprNames() for a description of the kinds of
 74707  //  ** transformations that occur.
 74708  //  **
 74709  //  ** All SELECT statements should have been expanded using
 74710  //  ** sqlite3SelectExpand() prior to invoking this routine.
 74711  //  */
 74712  func _sqlite3ResolveSelectNames(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pOuterNC *XNameContext) {
 74713  	var _w XWalker
 74714  	func() {
 74715  		if _p == nil {
 74716  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90853), unsafe.Pointer(&_sqlite3ResolveSelectNamesØ00__func__Ø000), unsafe.Pointer(str(807)))
 74717  			crt.X__builtin_abort(tls)
 74718  		}
 74719  	}()
 74720  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint64(48))
 74721  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _resolveExprStep
 74722  	*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _resolveSelectStep
 74723  	*(**XParse)(unsafe.Pointer(&_w.XpParse)) = _pParse
 74724  	*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = _pOuterNC
 74725  	_sqlite3WalkSelect(tls, &_w, _p)
 74726  }
 74727  
 74728  var _sqlite3ResolveSelectNamesØ00__func__Ø000 [26]int8
 74729  
 74730  func init() {
 74731  	crt.Xstrncpy(nil, &_sqlite3ResolveSelectNamesØ00__func__Ø000[0], str(95389), 26)
 74732  }
 74733  
 74734  // C comment
 74735  //  /*
 74736  //  ** This routine is callback for sqlite3WalkExpr().
 74737  //  **
 74738  //  ** Resolve symbolic names into TK_COLUMN operators for the current
 74739  //  ** node in the expression tree.  Return 0 to continue the search down
 74740  //  ** the tree or 2 to abort the tree walk.
 74741  //  **
 74742  //  ** This routine also does error checking and name resolution for
 74743  //  ** function names.  The operator for aggregate functions is changed
 74744  //  ** to TK_AGG_FUNCTION.
 74745  //  */
 74746  func _resolveExprStep(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 74747  	var _1_i, _9_n, _9_no_such_func, _9_wrong_num_args, _9_is_agg, _9_nId, _18_auth, _30_nRef, _33_nLeft, _33_nRight int32
 74748  	var _4_zColumn, _4_zTable, _4_zDb, _9_zId *int8
 74749  	var _9_enc uint8
 74750  	var _9_pDef *XFuncDef
 74751  	var _1_pSrcList *XSrcList
 74752  	var _9_pList *XExprList
 74753  	var _4_pRight *XExpr
 74754  	var _pParse *XParse
 74755  	var _pNC, _26_pNC2 *XNameContext
 74756  	_pNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 74757  	func() {
 74758  		if _pNC == nil {
 74759  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89925), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95415)))
 74760  			crt.X__builtin_abort(tls)
 74761  		}
 74762  	}()
 74763  	_pParse = (*XParse)(_pNC.XpParse)
 74764  	func() {
 74765  		if _pParse != (*XParse)(_pWalker.XpParse) {
 74766  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89927), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95422)))
 74767  			crt.X__builtin_abort(tls)
 74768  		}
 74769  	}()
 74770  	if (_pExpr.Xflags & uint32(4)) != (0) {
 74771  		return int32(1)
 74772  	}
 74773  	_pExpr.Xflags |= uint32(4)
 74774  	if _pNC.XpSrcList == nil || ((*XSrcList)(_pNC.XpSrcList).XnAlloc) <= (0) {
 74775  		goto _6
 74776  	}
 74777  	_1_pSrcList = (*XSrcList)(_pNC.XpSrcList)
 74778  	_1_i = int32(0)
 74779  _7:
 74780  	if _1_i >= ((*XSrcList)(_pNC.XpSrcList).XnSrc) {
 74781  		goto _10
 74782  	}
 74783  	func() {
 74784  		if (elem6((*TSrcList_item)(unsafe.Pointer(&_1_pSrcList.Xa)), uintptr(_1_i)).XiCursor) < int32(0) || (elem6((*TSrcList_item)(unsafe.Pointer(&_1_pSrcList.Xa)), uintptr(_1_i)).XiCursor) >= _pParse.XnTab {
 74785  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89936), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95446)))
 74786  			crt.X__builtin_abort(tls)
 74787  		}
 74788  	}()
 74789  	_1_i += 1
 74790  	goto _7
 74791  _10:
 74792  _6:
 74793  	switch int32(_pExpr.Xop) {
 74794  	case int32(20):
 74795  		goto _18
 74796  	case int32(27):
 74797  		goto _15
 74798  	case int32(72):
 74799  		goto _22
 74800  	case int32(73):
 74801  		goto _22
 74802  	case int32(74):
 74803  		goto _18
 74804  	case int32(77):
 74805  		goto _22
 74806  	case int32(78):
 74807  		goto _22
 74808  	case int32(79):
 74809  		goto _22
 74810  	case int32(80):
 74811  		goto _22
 74812  	case int32(81):
 74813  		goto _22
 74814  	case int32(82):
 74815  		goto _22
 74816  	case int32(119):
 74817  		goto _18
 74818  	case int32(122):
 74819  		goto _15
 74820  	case int32(135):
 74821  		goto _21
 74822  	case int32(148):
 74823  		goto _22
 74824  	case int32(151):
 74825  		goto _17
 74826  	default:
 74827  		goto _31
 74828  	}
 74829  
 74830  _15:
 74831  	if int32(_pExpr.Xop) == int32(27) {
 74832  		_4_zDb = nil
 74833  		_4_zTable = nil
 74834  		_4_zColumn = *(**int8)(unsafe.Pointer(&_pExpr.Xu))
 74835  		goto _33
 74836  	}
 74837  	_notValid(tls, _pParse, _pNC, str(95511), int32(32))
 74838  	_4_pRight = (*XExpr)(_pExpr.XpRight)
 74839  	if int32(_4_pRight.Xop) == int32(27) {
 74840  		_4_zDb = nil
 74841  		_4_zTable = *(**int8)(unsafe.Pointer(&((*XExpr)(_pExpr.XpLeft).Xu)))
 74842  		_4_zColumn = *(**int8)(unsafe.Pointer(&_4_pRight.Xu))
 74843  		goto _35
 74844  	}
 74845  	func() {
 74846  		if int32(_4_pRight.Xop) != int32(122) {
 74847  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89989), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95528)))
 74848  			crt.X__builtin_abort(tls)
 74849  		}
 74850  	}()
 74851  	_4_zDb = *(**int8)(unsafe.Pointer(&((*XExpr)(_pExpr.XpLeft).Xu)))
 74852  	_4_zTable = *(**int8)(unsafe.Pointer(&((*XExpr)(_4_pRight.XpLeft).Xu)))
 74853  	_4_zColumn = *(**int8)(unsafe.Pointer(&((*XExpr)(_4_pRight.XpRight).Xu)))
 74854  _35:
 74855  _33:
 74856  	return _lookupName(tls, _pParse, _4_zDb, _4_zTable, _4_zColumn, _pNC, _pExpr)
 74857  
 74858  _17:
 74859  	_9_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 74860  	_9_n = func() int32 {
 74861  		if _9_pList != nil {
 74862  			return _9_pList.XnExpr
 74863  		}
 74864  		return int32(0)
 74865  	}()
 74866  	_9_no_such_func = int32(0)
 74867  	_9_wrong_num_args = int32(0)
 74868  	_9_is_agg = int32(0)
 74869  	_9_enc = (*Xsqlite3)(_pParse.Xdb).Xenc
 74870  	func() {
 74871  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 74872  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90011), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(42733)))
 74873  			crt.X__builtin_abort(tls)
 74874  		}
 74875  	}()
 74876  	_9_zId = *(**int8)(unsafe.Pointer(&_pExpr.Xu))
 74877  	_9_nId = _sqlite3Strlen30(tls, _9_zId)
 74878  	_9_pDef = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.Xdb), _9_zId, _9_n, _9_enc, 0)
 74879  	if _9_pDef != nil {
 74880  		goto _42
 74881  	}
 74882  	_9_pDef = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.Xdb), _9_zId, int32(-2), _9_enc, 0)
 74883  	if _9_pDef == nil {
 74884  		_9_no_such_func = int32(1)
 74885  		goto _44
 74886  	}
 74887  	_9_wrong_num_args = int32(1)
 74888  _44:
 74889  	goto _45
 74890  _42:
 74891  	_9_is_agg = bool2int(func() func(*crt.TLS, *Xsqlite3_context) {
 74892  		v := _9_pDef.XxFinalize
 74893  		return *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&v))
 74894  	}() != nil)
 74895  	if (int32(_9_pDef.XfuncFlags) & int32(1024)) == 0 {
 74896  		goto _46
 74897  	}
 74898  	_pExpr.Xflags |= uint32(266240)
 74899  	if _9_n != int32(2) {
 74900  		goto _47
 74901  	}
 74902  	_pExpr.XiTable = _exprProbability(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_9_pList.Xa)), uintptr(1)).XpExpr))
 74903  	if _pExpr.XiTable < int32(0) {
 74904  		_sqlite3ErrorMsg(tls, _pParse, str(95547))
 74905  		_pNC.XnErr += 1
 74906  	}
 74907  	goto _49
 74908  _47:
 74909  	_pExpr.XiTable = func() int32 {
 74910  		if int32(*elem1(_9_pDef.XzName, 0)) == int32(117) {
 74911  			return int32(8388608)
 74912  		}
 74913  		return int32(125829120)
 74914  	}()
 74915  _49:
 74916  _46:
 74917  	_18_auth = _sqlite3AuthCheck(tls, _pParse, int32(31), nil, _9_pDef.XzName, nil)
 74918  	if _18_auth == int32(0) {
 74919  		goto _52
 74920  	}
 74921  	if _18_auth == int32(1) {
 74922  		_sqlite3ErrorMsg(tls, _pParse, str(95618), unsafe.Pointer(_9_pDef.XzName))
 74923  		_pNC.XnErr += 1
 74924  	}
 74925  	_pExpr.Xop = uint8(101)
 74926  	return int32(1)
 74927  
 74928  _52:
 74929  	if (int32(_9_pDef.XfuncFlags) & int32(10240)) != 0 {
 74930  		_pExpr.Xflags |= uint32(524288)
 74931  	}
 74932  	if (int32(_9_pDef.XfuncFlags) & int32(2048)) == int32(0) {
 74933  		_notValid(tls, _pParse, _pNC, str(95653), int32(34))
 74934  	}
 74935  _45:
 74936  	if _9_is_agg != 0 && ((int32(_pNC.XncFlags) & int32(1)) == int32(0)) {
 74937  		_sqlite3ErrorMsg(tls, _pParse, str(95681), _9_nId, unsafe.Pointer(_9_zId))
 74938  		_pNC.XnErr += 1
 74939  		_9_is_agg = int32(0)
 74940  		goto _62
 74941  	}
 74942  	if _9_no_such_func != 0 && (int32(((*Xsqlite3)(_pParse.Xdb).Xinit).Xbusy) == int32(0)) {
 74943  		_sqlite3ErrorMsg(tls, _pParse, str(95717), _9_nId, unsafe.Pointer(_9_zId))
 74944  		_pNC.XnErr += 1
 74945  		goto _62
 74946  	}
 74947  	if _9_wrong_num_args != 0 {
 74948  		_sqlite3ErrorMsg(tls, _pParse, str(95740), _9_nId, unsafe.Pointer(_9_zId))
 74949  		_pNC.XnErr += 1
 74950  	}
 74951  _62:
 74952  	if _9_is_agg != 0 {
 74953  		{
 74954  			p := &_pNC.XncFlags
 74955  			*p = uint16(int32(*p) & int32(-2))
 74956  		}
 74957  	}
 74958  	_sqlite3WalkExprList(tls, _pWalker, _9_pList)
 74959  	if _9_is_agg == 0 {
 74960  		goto _64
 74961  	}
 74962  	_26_pNC2 = _pNC
 74963  	_pExpr.Xop = uint8(153)
 74964  	_pExpr.Xop2 = 0
 74965  _65:
 74966  	if (_26_pNC2 != nil) && (_sqlite3FunctionUsesThisSrc(tls, _pExpr, (*XSrcList)(_26_pNC2.XpSrcList)) == 0) {
 74967  		_pExpr.Xop2 += 1
 74968  		_26_pNC2 = (*XNameContext)(_26_pNC2.XpNext)
 74969  		goto _65
 74970  	}
 74971  	func() {
 74972  		if _9_pDef == nil {
 74973  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90101), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95785)))
 74974  			crt.X__builtin_abort(tls)
 74975  		}
 74976  	}()
 74977  	if _26_pNC2 != nil {
 74978  		{
 74979  			p := &_26_pNC2.XncFlags
 74980  			*p = uint16(int32(*p) | (int32(16) | (int32(_9_pDef.XfuncFlags) & int32(4096))))
 74981  		}
 74982  	}
 74983  	{
 74984  		p := &_pNC.XncFlags
 74985  		*p = uint16(int32(*p) | int32(1))
 74986  	}
 74987  _64:
 74988  	return int32(1)
 74989  
 74990  _18:
 74991  	if (_pExpr.Xflags & uint32(2048)) == (0) {
 74992  		goto _71
 74993  	}
 74994  	_30_nRef = _pNC.XnRef
 74995  	_notValid(tls, _pParse, _pNC, str(95793), int32(38))
 74996  	_sqlite3WalkSelect(tls, _pWalker, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))))
 74997  	func() {
 74998  		if _pNC.XnRef < _30_nRef {
 74999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90125), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95804)))
 75000  			crt.X__builtin_abort(tls)
 75001  		}
 75002  	}()
 75003  	if _30_nRef != _pNC.XnRef {
 75004  		_pExpr.Xflags |= uint32(32)
 75005  		{
 75006  			p := &_pNC.XncFlags
 75007  			*p = uint16(int32(*p) | int32(64))
 75008  		}
 75009  	}
 75010  _71:
 75011  	goto _31
 75012  _21:
 75013  	_notValid(tls, _pParse, _pNC, str(95820), int32(38))
 75014  	goto _31
 75015  _22:
 75016  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 75017  		goto _31
 75018  	}
 75019  	func() {
 75020  		if (*XExpr)(_pExpr.XpLeft) == nil {
 75021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90148), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95831)))
 75022  			crt.X__builtin_abort(tls)
 75023  		}
 75024  	}()
 75025  	_33_nLeft = _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpLeft))
 75026  	if int32(_pExpr.Xop) != int32(73) {
 75027  		goto _78
 75028  	}
 75029  	_33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr))
 75030  	if _33_nRight == _33_nLeft {
 75031  		_33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), uintptr(1)).XpExpr))
 75032  	}
 75033  	goto _80
 75034  _78:
 75035  	func() {
 75036  		if (*XExpr)(_pExpr.XpRight) == nil {
 75037  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90156), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95847)))
 75038  			crt.X__builtin_abort(tls)
 75039  		}
 75040  	}()
 75041  	_33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpRight))
 75042  _80:
 75043  	if _33_nLeft != _33_nRight {
 75044  		_sqlite3ErrorMsg(tls, _pParse, str(43136))
 75045  	}
 75046  	goto _31
 75047  _31:
 75048  	return func() int32 {
 75049  		if _pParse.XnErr != 0 || (((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0) {
 75050  			return int32(2)
 75051  		}
 75052  		return int32(0)
 75053  	}()
 75054  }
 75055  
 75056  var _resolveExprStepØ00__func__Ø000 [16]int8
 75057  
 75058  func init() {
 75059  	crt.Xstrncpy(nil, &_resolveExprStepØ00__func__Ø000[0], str(95864), 16)
 75060  }
 75061  
 75062  // C comment
 75063  //  /*
 75064  //  ** Report an error that an expression is not valid for some set of
 75065  //  ** pNC->ncFlags values determined by validMask.
 75066  //  */
 75067  func _notValid(tls *crt.TLS, _pParse *XParse, _pNC *XNameContext, _zMsg *int8, _validMask int32) {
 75068  	var _1_zIn *int8
 75069  	func() {
 75070  		if (_validMask & int32(-39)) != int32(0) {
 75071  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89884), unsafe.Pointer(&_notValidØ00__func__Ø000), unsafe.Pointer(str(95880)))
 75072  			crt.X__builtin_abort(tls)
 75073  		}
 75074  	}()
 75075  	if (int32(_pNC.XncFlags) & _validMask) == int32(0) {
 75076  		goto _2
 75077  	}
 75078  	_1_zIn = str(95931)
 75079  	if (int32(_pNC.XncFlags) & int32(32)) != 0 {
 75080  		_1_zIn = str(95959)
 75081  		goto _5
 75082  	}
 75083  	if (int32(_pNC.XncFlags) & int32(4)) != 0 {
 75084  		_1_zIn = str(95977)
 75085  	}
 75086  _5:
 75087  	_sqlite3ErrorMsg(tls, _pParse, str(95995), unsafe.Pointer(_zMsg), unsafe.Pointer(_1_zIn))
 75088  _2:
 75089  }
 75090  
 75091  var _notValidØ00__func__Ø000 [9]int8
 75092  
 75093  func init() {
 75094  	crt.Xstrncpy(nil, &_notValidØ00__func__Ø000[0], str(96015), 9)
 75095  }
 75096  
 75097  // C comment
 75098  //  /*
 75099  //  ** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up
 75100  //  ** that name in the set of source tables in pSrcList and make the pExpr
 75101  //  ** expression node refer back to that source column.  The following changes
 75102  //  ** are made to pExpr:
 75103  //  **
 75104  //  **    pExpr->iDb           Set the index in db->aDb[] of the database X
 75105  //  **                         (even if X is implied).
 75106  //  **    pExpr->iTable        Set to the cursor number for the table obtained
 75107  //  **                         from pSrcList.
 75108  //  **    pExpr->pTab          Points to the Table structure of X.Y (even if
 75109  //  **                         X and/or Y are implied.)
 75110  //  **    pExpr->iColumn       Set to the column number within the table.
 75111  //  **    pExpr->op            Set to TK_COLUMN.
 75112  //  **    pExpr->pLeft         Any expression this points to is deleted
 75113  //  **    pExpr->pRight        Any expression this points to is deleted.
 75114  //  **
 75115  //  ** The zDb variable is the name of the database (the "X").  This value may be
 75116  //  ** NULL meaning that name is of the form Y.Z or Z.  Any available database
 75117  //  ** can be used.  The zTable variable is the name of the table (the "Y").  This
 75118  //  ** value can be NULL if zDb is also NULL.  If zTable is NULL it
 75119  //  ** means that the form of the name is Z and that columns from any table
 75120  //  ** can be used.
 75121  //  **
 75122  //  ** If the name cannot be resolved unambiguously, leave an error message
 75123  //  ** in pParse and return WRC_Abort.  Return WRC_Prune on success.
 75124  //  */
 75125  func _lookupName(tls *crt.TLS, _pParse *XParse, _zDb *int8, _zTab *int8, _zCol *int8, _pNC *XNameContext, _pExpr *XExpr) (r0 int32) {
 75126  	var _i, _j, _cnt, _cntTab, _nSubquery, _isTrigger, _9_hit, _21_op, _25_iCol, _45_n int32
 75127  	var _13_zTabName, _36_zAs, _41_zErr *int8
 75128  	var _db *Xsqlite3
 75129  	var _pSchema *XSchema
 75130  	var _pTab *XTable
 75131  	var _6_pSrcList *XSrcList
 75132  	var _pItem, _pMatch *TSrcList_item
 75133  	var _6_pEList *XExprList
 75134  	var _37_pOrig *XExpr
 75135  	var _pCol *XColumn
 75136  	var _pTopNC *XNameContext
 75137  	_cnt = int32(0)
 75138  	_cntTab = int32(0)
 75139  	_nSubquery = int32(0)
 75140  	_db = (*Xsqlite3)(_pParse.Xdb)
 75141  	_pMatch = nil
 75142  	_pTopNC = _pNC
 75143  	_pSchema = nil
 75144  	_isTrigger = int32(0)
 75145  	_pTab = nil
 75146  	func() {
 75147  		if _pNC == nil {
 75148  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89548), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96024)))
 75149  			crt.X__builtin_abort(tls)
 75150  		}
 75151  	}()
 75152  	func() {
 75153  		if _zCol == nil {
 75154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89549), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96028)))
 75155  			crt.X__builtin_abort(tls)
 75156  		}
 75157  	}()
 75158  	func() {
 75159  		if (_pExpr.Xflags & uint32(24576)) != (0) {
 75160  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89550), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96033)))
 75161  			crt.X__builtin_abort(tls)
 75162  		}
 75163  	}()
 75164  	_pExpr.XiTable = int32(-1)
 75165  	*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = nil
 75166  	_pExpr.Xflags |= uint32(131072)
 75167  	if _zDb == nil {
 75168  		goto _6
 75169  	}
 75170  	if (int32(_pNC.XncFlags) & int32(6)) != int32(0) {
 75171  		_zDb = nil
 75172  		goto _8
 75173  	}
 75174  	_i = int32(0)
 75175  _9:
 75176  	if _i >= _db.XnDb {
 75177  		goto _12
 75178  	}
 75179  	func() {
 75180  		if (elem27((*XDb)(_db.XaDb), uintptr(_i)).XzDbSName) == nil {
 75181  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89572), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96082)))
 75182  			crt.X__builtin_abort(tls)
 75183  		}
 75184  	}()
 75185  	if _sqlite3StrICmp(tls, elem27((*XDb)(_db.XaDb), uintptr(_i)).XzDbSName, _zDb) == int32(0) {
 75186  		_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpSchema)
 75187  		goto _12
 75188  	}
 75189  	_i += 1
 75190  	goto _9
 75191  _12:
 75192  _8:
 75193  _6:
 75194  	func() {
 75195  		if _pNC == nil || _cnt != int32(0) {
 75196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89582), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96102)))
 75197  			crt.X__builtin_abort(tls)
 75198  		}
 75199  	}()
 75200  _19:
 75201  	_6_pSrcList = (*XSrcList)(_pNC.XpSrcList)
 75202  	if _6_pSrcList == nil {
 75203  		goto _20
 75204  	}
 75205  	*func() **TSrcList_item { _i = int32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_6_pSrcList.Xa))
 75206  _21:
 75207  	if _i >= _6_pSrcList.XnSrc {
 75208  		goto _24
 75209  	}
 75210  	_pTab = (*XTable)(_pItem.XpTab)
 75211  	func() {
 75212  		if _pTab == nil || _pTab.XzName == nil {
 75213  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89590), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96116)))
 75214  			crt.X__builtin_abort(tls)
 75215  		}
 75216  	}()
 75217  	func() {
 75218  		if int32(_pTab.XnCol) <= int32(0) {
 75219  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89591), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96142)))
 75220  			crt.X__builtin_abort(tls)
 75221  		}
 75222  	}()
 75223  	if _pItem.XpSelect == nil || (((*XSelect)(_pItem.XpSelect).XselFlags)&uint32(2048)) == (0) {
 75224  		goto _31
 75225  	}
 75226  	_9_hit = int32(0)
 75227  	_6_pEList = (*XExprList)((*XSelect)(_pItem.XpSelect).XpEList)
 75228  	_j = int32(0)
 75229  _32:
 75230  	if _j >= _6_pEList.XnExpr {
 75231  		goto _35
 75232  	}
 75233  	if _sqlite3MatchSpanName(tls, elem59((*TExprList_item)(unsafe.Pointer(&_6_pEList.Xa)), uintptr(_j)).XzSpan, _zCol, _zTab, _zDb) != 0 {
 75234  		_cnt += 1
 75235  		_cntTab = int32(2)
 75236  		_pMatch = _pItem
 75237  		_pExpr.XiColumn = int16(_j)
 75238  		_9_hit = int32(1)
 75239  	}
 75240  	_j += 1
 75241  	goto _32
 75242  _35:
 75243  	if _9_hit != 0 || (_zTab == nil) {
 75244  		goto _22
 75245  	}
 75246  _31:
 75247  	if (_zDb != nil) && ((*XSchema)(_pTab.XpSchema) != _pSchema) {
 75248  		goto _22
 75249  	}
 75250  	if _zTab == nil {
 75251  		goto _41
 75252  	}
 75253  	_13_zTabName = func() *int8 {
 75254  		if _pItem.XzAlias != nil {
 75255  			return _pItem.XzAlias
 75256  		}
 75257  		return _pTab.XzName
 75258  	}()
 75259  	func() {
 75260  		if _13_zTabName == nil {
 75261  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89611), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96155)))
 75262  			crt.X__builtin_abort(tls)
 75263  		}
 75264  	}()
 75265  	if _sqlite3StrICmp(tls, _13_zTabName, _zTab) != int32(0) {
 75266  		goto _22
 75267  	}
 75268  _41:
 75269  	if int32(0) == postInc2(&_cntTab, 1) {
 75270  		_pMatch = _pItem
 75271  	}
 75272  	*func() **XColumn { _j = int32(0); return &_pCol }() = (*XColumn)(_pTab.XaCol)
 75273  _48:
 75274  	if _j >= int32(_pTab.XnCol) {
 75275  		goto _51
 75276  	}
 75277  	if _sqlite3StrICmp(tls, _pCol.XzName, _zCol) != int32(0) {
 75278  		goto _52
 75279  	}
 75280  	if _cnt != int32(1) {
 75281  		goto _53
 75282  	}
 75283  	if (int32(_pItem.Xfg.Xjointype) & int32(4)) != 0 {
 75284  		goto _49
 75285  	}
 75286  	if _nameInUsingClause(tls, (*XIdList)(_pItem.XpUsing), _zCol) != 0 {
 75287  		goto _49
 75288  	}
 75289  _53:
 75290  	_cnt += 1
 75291  	_pMatch = _pItem
 75292  	_pExpr.XiColumn = int16(func() int32 {
 75293  		if _j == int32(_pTab.XiPKey) {
 75294  			return int32(-1)
 75295  		}
 75296  		return int32(int16(_j))
 75297  	}())
 75298  	goto _51
 75299  _52:
 75300  _49:
 75301  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _j += 1; return &_pCol }())) += uintptr(32)
 75302  	goto _48
 75303  _51:
 75304  _22:
 75305  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(112)
 75306  	goto _21
 75307  _24:
 75308  	if _pMatch == nil {
 75309  		goto _58
 75310  	}
 75311  	_pExpr.XiTable = _pMatch.XiCursor
 75312  	*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = (*XTable)(_pMatch.XpTab)
 75313  	func() {
 75314  		if (int32(_pMatch.Xfg.Xjointype) & int32(16)) != int32(0) {
 75315  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89641), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96167)))
 75316  			crt.X__builtin_abort(tls)
 75317  		}
 75318  	}()
 75319  	if (int32(_pMatch.Xfg.Xjointype) & int32(8)) != int32(0) {
 75320  		_pExpr.Xflags |= uint32(1048576)
 75321  	}
 75322  	_pSchema = (*XSchema)((*XTable)(_pExpr.XpTab).XpSchema)
 75323  _58:
 75324  _20:
 75325  	if _zDb != nil || _zTab == nil || _cntTab != int32(0) || (*XTable)(_pParse.XpTriggerTab) == nil {
 75326  		goto _65
 75327  	}
 75328  	_21_op = int32(_pParse.XeTriggerOp)
 75329  	func() {
 75330  		if _21_op != int32(109) && _21_op != int32(110) && _21_op != int32(108) {
 75331  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89655), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96203)))
 75332  			crt.X__builtin_abort(tls)
 75333  		}
 75334  	}()
 75335  	if (_21_op != int32(109)) && (_sqlite3StrICmp(tls, str(43128), _zTab) == int32(0)) {
 75336  		_pExpr.XiTable = int32(1)
 75337  		_pTab = (*XTable)(_pParse.XpTriggerTab)
 75338  		goto _75
 75339  	}
 75340  	if (_21_op != int32(108)) && (_sqlite3StrICmp(tls, str(43132), _zTab) == int32(0)) {
 75341  		_pExpr.XiTable = int32(0)
 75342  		_pTab = (*XTable)(_pParse.XpTriggerTab)
 75343  		goto _75
 75344  	}
 75345  	_pTab = nil
 75346  _75:
 75347  	if _pTab == nil {
 75348  		goto _76
 75349  	}
 75350  	_pSchema = (*XSchema)(_pTab.XpSchema)
 75351  	_cntTab += 1
 75352  	*func() **XColumn { _25_iCol = int32(0); return &_pCol }() = (*XColumn)(_pTab.XaCol)
 75353  _77:
 75354  	if _25_iCol >= int32(_pTab.XnCol) {
 75355  		goto _80
 75356  	}
 75357  	if _sqlite3StrICmp(tls, _pCol.XzName, _zCol) != int32(0) {
 75358  		goto _81
 75359  	}
 75360  	if _25_iCol == int32(_pTab.XiPKey) {
 75361  		_25_iCol = int32(-1)
 75362  	}
 75363  	goto _80
 75364  _81:
 75365  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _25_iCol += 1; return &_pCol }())) += uintptr(32)
 75366  	goto _77
 75367  _80:
 75368  	if ((_25_iCol >= int32(_pTab.XnCol)) && _sqlite3IsRowid(tls, _zCol) != 0) && ((_pTab.XtabFlags & uint32(64)) == (0)) {
 75369  		_25_iCol = int32(-1)
 75370  	}
 75371  	if _25_iCol >= int32(_pTab.XnCol) {
 75372  		goto _86
 75373  	}
 75374  	_cnt += 1
 75375  	if _25_iCol < int32(0) {
 75376  		_pExpr.Xaffinity = int8(68)
 75377  		goto _92
 75378  	}
 75379  	if _pExpr.XiTable == int32(0) {
 75380  		_pParse.Xoldmask |= func() uint32 {
 75381  			if _25_iCol >= int32(32) {
 75382  				return uint32(4294967295)
 75383  			}
 75384  			return (uint32(1) << uint(_25_iCol))
 75385  		}()
 75386  		goto _92
 75387  	}
 75388  	_pParse.Xnewmask |= func() uint32 {
 75389  		if _25_iCol >= int32(32) {
 75390  			return uint32(4294967295)
 75391  		}
 75392  		return (uint32(1) << uint(_25_iCol))
 75393  	}()
 75394  _92:
 75395  	_pExpr.XiColumn = int16(_25_iCol)
 75396  	*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = _pTab
 75397  	_isTrigger = int32(1)
 75398  _86:
 75399  _76:
 75400  _65:
 75401  	if (((((_cnt == int32(0)) && (_cntTab == int32(1))) && (_pMatch != nil)) && ((int32(_pNC.XncFlags) & int32(32)) == int32(0))) && _sqlite3IsRowid(tls, _zCol) != 0) && ((((*XTable)(_pMatch.XpTab).XtabFlags) & uint32(64)) == (0)) {
 75402  		_cnt = int32(1)
 75403  		_pExpr.XiColumn = int16(-1)
 75404  		_pExpr.Xaffinity = int8(68)
 75405  	}
 75406  	if store72(&_6_pEList, (*XExprList)(_pNC.XpEList)) == nil || _zTab != nil || _cnt != int32(0) {
 75407  		goto _103
 75408  	}
 75409  	_j = int32(0)
 75410  _104:
 75411  	if _j >= _6_pEList.XnExpr {
 75412  		goto _107
 75413  	}
 75414  	_36_zAs = elem59((*TExprList_item)(unsafe.Pointer(&_6_pEList.Xa)), uintptr(_j)).XzName
 75415  	if _36_zAs == nil || _sqlite3StrICmp(tls, _36_zAs, _zCol) != int32(0) {
 75416  		goto _109
 75417  	}
 75418  	func() {
 75419  		if (*XExpr)(_pExpr.XpLeft) != nil || (*XExpr)(_pExpr.XpRight) != nil {
 75420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89744), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96251)))
 75421  			crt.X__builtin_abort(tls)
 75422  		}
 75423  	}()
 75424  	func() {
 75425  		if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) != nil {
 75426  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89745), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96287)))
 75427  			crt.X__builtin_abort(tls)
 75428  		}
 75429  	}()
 75430  	func() {
 75431  		if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) != nil {
 75432  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89746), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96305)))
 75433  			crt.X__builtin_abort(tls)
 75434  		}
 75435  	}()
 75436  	_37_pOrig = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_6_pEList.Xa)), uintptr(_j)).XpExpr)
 75437  	if ((int32(_pNC.XncFlags) & int32(1)) == int32(0)) && ((_37_pOrig.Xflags & uint32(2)) != (0)) {
 75438  		_sqlite3ErrorMsg(tls, _pParse, str(96325), unsafe.Pointer(_36_zAs))
 75439  		return int32(2)
 75440  	}
 75441  	if _sqlite3ExprVectorSize(tls, _37_pOrig) != int32(1) {
 75442  		_sqlite3ErrorMsg(tls, _pParse, str(43136))
 75443  		return int32(2)
 75444  	}
 75445  	_resolveAlias(tls, _pParse, _6_pEList, _j, _pExpr, str(284), _nSubquery)
 75446  	_cnt = int32(1)
 75447  	_pMatch = nil
 75448  	func() {
 75449  		if _zTab != nil || _zDb != nil {
 75450  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89759), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96356)))
 75451  			crt.X__builtin_abort(tls)
 75452  		}
 75453  	}()
 75454  	goto _lookupname_end
 75455  _109:
 75456  	_j += 1
 75457  	goto _104
 75458  _107:
 75459  _103:
 75460  	if _cnt != 0 {
 75461  		goto _124
 75462  	}
 75463  	_pNC = (*XNameContext)(_pNC.XpNext)
 75464  	_nSubquery += 1
 75465  	if _pNC != nil {
 75466  		goto _19
 75467  	}
 75468  _124:
 75469  	if ((_cnt == int32(0)) && (_zTab == nil)) && ((_pExpr.Xflags & uint32(64)) != (0)) {
 75470  		_pExpr.Xop = uint8(97)
 75471  		*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = nil
 75472  		return int32(1)
 75473  	}
 75474  	if _cnt == int32(1) {
 75475  		goto _128
 75476  	}
 75477  	_41_zErr = func() *int8 {
 75478  		if _cnt == int32(0) {
 75479  			return str(96374)
 75480  		}
 75481  		return str(96389)
 75482  	}()
 75483  	if _zDb != nil {
 75484  		_sqlite3ErrorMsg(tls, _pParse, str(96411), unsafe.Pointer(_41_zErr), unsafe.Pointer(_zDb), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
 75485  		goto _134
 75486  	}
 75487  	if _zTab != nil {
 75488  		_sqlite3ErrorMsg(tls, _pParse, str(49777), unsafe.Pointer(_41_zErr), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
 75489  		goto _134
 75490  	}
 75491  	_sqlite3ErrorMsg(tls, _pParse, str(49787), unsafe.Pointer(_41_zErr), unsafe.Pointer(_zCol))
 75492  _134:
 75493  	_pParse.XcheckSchema = uint8(1)
 75494  	_pTopNC.XnErr += 1
 75495  _128:
 75496  	if int32(_pExpr.XiColumn) < int32(0) || _pMatch == nil {
 75497  		goto _136
 75498  	}
 75499  	_45_n = int32(_pExpr.XiColumn)
 75500  	if _45_n >= int32(64) {
 75501  		_45_n = int32(63)
 75502  	}
 75503  	func() {
 75504  		if _pMatch.XiCursor != _pExpr.XiTable {
 75505  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89820), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96424)))
 75506  			crt.X__builtin_abort(tls)
 75507  		}
 75508  	}()
 75509  	_pMatch.XcolUsed |= uint64(1) << uint(_45_n)
 75510  _136:
 75511  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pExpr.XpLeft))
 75512  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpLeft)) = nil
 75513  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pExpr.XpRight))
 75514  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpRight)) = nil
 75515  	_pExpr.Xop = uint8(func() int32 {
 75516  		if _isTrigger != 0 {
 75517  			return int32(61)
 75518  		}
 75519  		return int32(152)
 75520  	}())
 75521  _lookupname_end:
 75522  	if _cnt != int32(1) {
 75523  		goto _142
 75524  	}
 75525  	func() {
 75526  		if _pNC == nil {
 75527  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89833), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(95415)))
 75528  			crt.X__builtin_abort(tls)
 75529  		}
 75530  	}()
 75531  	if (_pExpr.Xflags & uint32(4194304)) == (0) {
 75532  		_sqlite3AuthRead(tls, _pParse, _pExpr, _pSchema, (*XSrcList)(_pNC.XpSrcList))
 75533  	}
 75534  _145:
 75535  	func() {
 75536  		if _pTopNC == nil {
 75537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89840), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96455)))
 75538  			crt.X__builtin_abort(tls)
 75539  		}
 75540  	}()
 75541  	_pTopNC.XnRef += 1
 75542  	if _pTopNC == _pNC {
 75543  		goto _148
 75544  	}
 75545  	_pTopNC = (*XNameContext)(_pTopNC.XpNext)
 75546  	goto _145
 75547  _148:
 75548  	return int32(1)
 75549  
 75550  _142:
 75551  	return int32(2)
 75552  }
 75553  
 75554  var _lookupNameØ00__func__Ø000 [11]int8
 75555  
 75556  func init() {
 75557  	crt.Xstrncpy(nil, &_lookupNameØ00__func__Ø000[0], str(96465), 11)
 75558  }
 75559  
 75560  // C comment
 75561  //  /*
 75562  //  ** Return TRUE if the name zCol occurs anywhere in the USING clause.
 75563  //  **
 75564  //  ** Return FALSE if the USING clause is NULL or if it does not contain
 75565  //  ** zCol.
 75566  //  */
 75567  func _nameInUsingClause(tls *crt.TLS, _pUsing *XIdList, _zCol *int8) (r0 int32) {
 75568  	var _1_k int32
 75569  	if _pUsing == nil {
 75570  		goto _0
 75571  	}
 75572  	_1_k = int32(0)
 75573  _1:
 75574  	if _1_k >= _pUsing.XnId {
 75575  		goto _4
 75576  	}
 75577  	if _sqlite3StrICmp(tls, elem44((*TIdList_item)(_pUsing.Xa), uintptr(_1_k)).XzName, _zCol) == int32(0) {
 75578  		return int32(1)
 75579  	}
 75580  	_1_k += 1
 75581  	goto _1
 75582  _4:
 75583  _0:
 75584  	return int32(0)
 75585  }
 75586  
 75587  // C comment
 75588  //  /*
 75589  //  ** Return TRUE if the given string is a row-id column name.
 75590  //  */
 75591  func _sqlite3IsRowid(tls *crt.TLS, _z *int8) (r0 int32) {
 75592  	if _sqlite3StrICmp(tls, _z, str(96476)) == int32(0) {
 75593  		return int32(1)
 75594  	}
 75595  	if _sqlite3StrICmp(tls, _z, str(96484)) == int32(0) {
 75596  		return int32(1)
 75597  	}
 75598  	if _sqlite3StrICmp(tls, _z, str(96490)) == int32(0) {
 75599  		return int32(1)
 75600  	}
 75601  	return int32(0)
 75602  }
 75603  
 75604  // C comment
 75605  //  /*
 75606  //  ** Turn the pExpr expression into an alias for the iCol-th column of the
 75607  //  ** result set in pEList.
 75608  //  **
 75609  //  ** If the reference is followed by a COLLATE operator, then make sure
 75610  //  ** the COLLATE operator is preserved.  For example:
 75611  //  **
 75612  //  **     SELECT a+b, c+d FROM t1 ORDER BY 1 COLLATE nocase;
 75613  //  **
 75614  //  ** Should be transformed into:
 75615  //  **
 75616  //  **     SELECT a+b, c+d FROM t1 ORDER BY (a+b) COLLATE nocase;
 75617  //  **
 75618  //  ** The nSubquery parameter specifies how many levels of subquery the
 75619  //  ** alias is removed from the original expression.  The usual value is
 75620  //  ** zero but it might be more if the alias is contained within a subquery
 75621  //  ** of the original expression.  The Expr.op2 field of TK_AGG_FUNCTION
 75622  //  ** structures must be increased by the nSubquery amount.
 75623  //  */
 75624  func _resolveAlias(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _iCol int32, _pExpr *XExpr, _zType *int8, _nSubquery int32) {
 75625  	var _db *Xsqlite3
 75626  	var _pOrig, _pDup *XExpr
 75627  	func() {
 75628  		if _iCol < int32(0) || _iCol >= _pEList.XnExpr {
 75629  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89423), unsafe.Pointer(&_resolveAliasØ00__func__Ø000), unsafe.Pointer(str(96494)))
 75630  			crt.X__builtin_abort(tls)
 75631  		}
 75632  	}()
 75633  	_pOrig = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_iCol)).XpExpr)
 75634  	func() {
 75635  		if _pOrig == nil {
 75636  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89425), unsafe.Pointer(&_resolveAliasØ00__func__Ø000), unsafe.Pointer(str(96524)))
 75637  			crt.X__builtin_abort(tls)
 75638  		}
 75639  	}()
 75640  	_db = (*Xsqlite3)(_pParse.Xdb)
 75641  	_pDup = _sqlite3ExprDup(tls, _db, _pOrig, int32(0))
 75642  	if _pDup == nil {
 75643  		return
 75644  	}
 75645  	if int32(*elem1(_zType, 0)) != int32(71) {
 75646  		_incrAggFunctionDepth(tls, _pDup, _nSubquery)
 75647  	}
 75648  	if int32(_pExpr.Xop) == int32(94) {
 75649  		_pDup = _sqlite3ExprAddCollateString(tls, _pParse, _pDup, *(**int8)(unsafe.Pointer(&_pExpr.Xu)))
 75650  	}
 75651  	_pDup.Xflags |= uint32(4194304)
 75652  	_pExpr.Xflags |= uint32(32768)
 75653  	_sqlite3ExprDelete(tls, _db, _pExpr)
 75654  	crt.Xmemcpy(tls, unsafe.Pointer(_pExpr), unsafe.Pointer(_pDup), uint64(72))
 75655  	if ((_pExpr.Xflags & uint32(1024)) == (0)) && ((*(**int8)(unsafe.Pointer(&_pExpr.Xu))) != nil) {
 75656  		func() {
 75657  			if (_pExpr.Xflags & uint32(24576)) != (0) {
 75658  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89446), unsafe.Pointer(&_resolveAliasØ00__func__Ø000), unsafe.Pointer(str(96533)))
 75659  				crt.X__builtin_abort(tls)
 75660  			}
 75661  		}()
 75662  		*(**int8)(unsafe.Pointer(&_pExpr.Xu)) = _sqlite3DbStrDup(tls, _db, *(**int8)(unsafe.Pointer(&_pExpr.Xu)))
 75663  		_pExpr.Xflags |= uint32(65536)
 75664  	}
 75665  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pDup))
 75666  }
 75667  
 75668  var _resolveAliasØ00__func__Ø000 [13]int8
 75669  
 75670  func init() {
 75671  	crt.Xstrncpy(nil, &_resolveAliasØ00__func__Ø000[0], str(96579), 13)
 75672  }
 75673  
 75674  func _incrAggFunctionDepth(tls *crt.TLS, _pExpr *XExpr, _N int32) {
 75675  	var _1_w XWalker
 75676  	if _N > int32(0) {
 75677  		crt.Xmemset(tls, unsafe.Pointer(&_1_w), int32(0), uint64(48))
 75678  		*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_1_w.XxExprCallback)) = _incrAggDepth
 75679  		*(*int32)(unsafe.Pointer(&_1_w.Xu)) = _N
 75680  		_sqlite3WalkExpr(tls, &_1_w, _pExpr)
 75681  	}
 75682  }
 75683  
 75684  // C comment
 75685  //  /*
 75686  //  ** Walk the expression tree pExpr and increase the aggregate function
 75687  //  ** depth (the Expr.op2 field) by N on every TK_AGG_FUNCTION node.
 75688  //  ** This needs to occur when copying a TK_AGG_FUNCTION node from an
 75689  //  ** outer query into an inner subquery.
 75690  //  **
 75691  //  ** incrAggFunctionDepth(pExpr,n) is the main routine.  incrAggDepth(..)
 75692  //  ** is a helper function - a callback for the tree walker.
 75693  //  */
 75694  func _incrAggDepth(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 75695  	if int32(_pExpr.Xop) == int32(153) {
 75696  		{
 75697  			p := &_pExpr.Xop2
 75698  			*p = uint8(int32(*p) + (*(*int32)(unsafe.Pointer(&_pWalker.Xu))))
 75699  		}
 75700  	}
 75701  	return int32(0)
 75702  }
 75703  
 75704  func _sqlite3ExprAddCollateString(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _zC *int8) (r0 *XExpr) {
 75705  	var _s XToken
 75706  	func() {
 75707  		if _zC == nil {
 75708  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90997), unsafe.Pointer(&_sqlite3ExprAddCollateStringØ00__func__Ø000), unsafe.Pointer(str(96592)))
 75709  			crt.X__builtin_abort(tls)
 75710  		}
 75711  	}()
 75712  	_sqlite3TokenInit(tls, &_s, _zC)
 75713  	return _sqlite3ExprAddCollateToken(tls, _pParse, _pExpr, &_s, int32(0))
 75714  }
 75715  
 75716  var _sqlite3ExprAddCollateStringØ00__func__Ø000 [28]int8
 75717  
 75718  func init() {
 75719  	crt.Xstrncpy(nil, &_sqlite3ExprAddCollateStringØ00__func__Ø000[0], str(96598), 28)
 75720  }
 75721  
 75722  // C comment
 75723  //  /*
 75724  //  ** Set the collating sequence for expression pExpr to be the collating
 75725  //  ** sequence named by pToken.   Return a pointer to a new Expr node that
 75726  //  ** implements the COLLATE operator.
 75727  //  **
 75728  //  ** If a memory allocation error occurs, that fact is recorded in pParse->db
 75729  //  ** and the pExpr parameter is returned unchanged.
 75730  //  */
 75731  func _sqlite3ExprAddCollateToken(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pCollName *XToken, _dequote int32) (r0 *XExpr) {
 75732  	var _1_pNew *XExpr
 75733  	if _pCollName.Xn <= (0) {
 75734  		goto _0
 75735  	}
 75736  	_1_pNew = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(94), _pCollName, _dequote)
 75737  	if _1_pNew != nil {
 75738  		*(**XExpr)(unsafe.Pointer(&_1_pNew.XpLeft)) = _pExpr
 75739  		_1_pNew.Xflags |= uint32(4352)
 75740  		_pExpr = _1_pNew
 75741  	}
 75742  _0:
 75743  	return _pExpr
 75744  }
 75745  
 75746  // C comment
 75747  //  /*
 75748  //  ** The pExpr should be a TK_COLUMN expression.  The table referred to
 75749  //  ** is in pTabList or else it is the NEW or OLD table of a trigger.
 75750  //  ** Check to see if it is OK to read this particular column.
 75751  //  **
 75752  //  ** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN
 75753  //  ** instruction into a TK_NULL.  If the auth function returns SQLITE_DENY,
 75754  //  ** then generate an error.
 75755  //  */
 75756  func _sqlite3AuthRead(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pSchema *XSchema, _pTabList *XSrcList) {
 75757  	var _iSrc, _iDb, _iCol int32
 75758  	var _zCol *int8
 75759  	var _db *Xsqlite3
 75760  	var _pTab *XTable
 75761  	_db = (*Xsqlite3)(_pParse.Xdb)
 75762  	_pTab = nil
 75763  	if _db.XxAuth == nil {
 75764  		return
 75765  	}
 75766  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), _pSchema)
 75767  	if _iDb < int32(0) {
 75768  		return
 75769  	}
 75770  	func() {
 75771  		if int32(_pExpr.Xop) != int32(152) && int32(_pExpr.Xop) != int32(61) {
 75772  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99583), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(96626)))
 75773  			crt.X__builtin_abort(tls)
 75774  		}
 75775  	}()
 75776  	if int32(_pExpr.Xop) == int32(61) {
 75777  		_pTab = (*XTable)(_pParse.XpTriggerTab)
 75778  		goto _6
 75779  	}
 75780  	func() {
 75781  		if _pTabList == nil {
 75782  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99587), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(96672)))
 75783  			crt.X__builtin_abort(tls)
 75784  		}
 75785  	}()
 75786  	_iSrc = int32(0)
 75787  _9:
 75788  	if func() int32 {
 75789  		if _iSrc < _pTabList.XnSrc {
 75790  			return int32(1)
 75791  		}
 75792  		return func() int32 {
 75793  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99588), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(4809)))
 75794  			crt.X__builtin_abort(tls)
 75795  			return int32(0)
 75796  		}()
 75797  	}() == 0 {
 75798  		goto _14
 75799  	}
 75800  	if _pExpr.XiTable == (elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_iSrc)).XiCursor) {
 75801  		_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_iSrc)).XpTab)
 75802  		goto _14
 75803  	}
 75804  	_iSrc += 1
 75805  	goto _9
 75806  _14:
 75807  _6:
 75808  	_iCol = int32(_pExpr.XiColumn)
 75809  	if func() int32 {
 75810  		if _pTab == nil {
 75811  			return func() int32 {
 75812  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99596), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(4809)))
 75813  				crt.X__builtin_abort(tls)
 75814  				return int32(1)
 75815  			}()
 75816  		}
 75817  		return int32(0)
 75818  	}() != 0 {
 75819  		return
 75820  	}
 75821  	if _iCol >= int32(0) {
 75822  		func() {
 75823  			if _iCol >= int32(_pTab.XnCol) {
 75824  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99599), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(45530)))
 75825  				crt.X__builtin_abort(tls)
 75826  			}
 75827  		}()
 75828  		_zCol = elem43((*XColumn)(_pTab.XaCol), uintptr(_iCol)).XzName
 75829  		goto _26
 75830  	}
 75831  	if int32(_pTab.XiPKey) >= int32(0) {
 75832  		func() {
 75833  			if int32(_pTab.XiPKey) >= int32(_pTab.XnCol) {
 75834  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99602), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(96681)))
 75835  				crt.X__builtin_abort(tls)
 75836  			}
 75837  		}()
 75838  		_zCol = elem43((*XColumn)(_pTab.XaCol), uintptr(_pTab.XiPKey)).XzName
 75839  		goto _26
 75840  	}
 75841  	_zCol = str(96484)
 75842  _26:
 75843  	func() {
 75844  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 75845  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99607), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(21693)))
 75846  			crt.X__builtin_abort(tls)
 75847  		}
 75848  	}()
 75849  	if int32(2) == _sqlite3AuthReadCol(tls, _pParse, _pTab.XzName, _zCol, _iDb) {
 75850  		_pExpr.Xop = uint8(101)
 75851  	}
 75852  }
 75853  
 75854  var _sqlite3AuthReadØ00__func__Ø000 [16]int8
 75855  
 75856  func init() {
 75857  	crt.Xstrncpy(nil, &_sqlite3AuthReadØ00__func__Ø000[0], str(96704), 16)
 75858  }
 75859  
 75860  // C comment
 75861  //  /*
 75862  //  ** Invoke the authorization callback for permission to read column zCol from
 75863  //  ** table zTab in database zDb. This function assumes that an authorization
 75864  //  ** callback has been registered (i.e. that sqlite3.xAuth is not NULL).
 75865  //  **
 75866  //  ** If SQLITE_IGNORE is returned and pExpr is not NULL, then pExpr is changed
 75867  //  ** to an SQL NULL expression. Otherwise, if pExpr is NULL, then SQLITE_IGNORE
 75868  //  ** is treated as SQLITE_DENY. In this case an error is left in pParse.
 75869  //  */
 75870  func _sqlite3AuthReadCol(tls *crt.TLS, _pParse *XParse, _zTab *int8, _zCol *int8, _iDb int32) (r0 int32) {
 75871  	var _rc int32
 75872  	var _zDb *int8
 75873  	var _db *Xsqlite3
 75874  	_db = (*Xsqlite3)(_pParse.Xdb)
 75875  	_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 75876  	if (_db.Xinit.Xbusy) != 0 {
 75877  		return int32(0)
 75878  	}
 75879  	_rc = _db.XxAuth(tls, _db.XpAuthArg, int32(20), _zTab, _zCol, _zDb, _pParse.XzAuthContext)
 75880  	if _rc != int32(1) {
 75881  		goto _1
 75882  	}
 75883  	if (_db.XnDb > int32(2)) || (_iDb != int32(0)) {
 75884  		_sqlite3ErrorMsg(tls, _pParse, str(96720), unsafe.Pointer(_zDb), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
 75885  		goto _4
 75886  	}
 75887  	_sqlite3ErrorMsg(tls, _pParse, str(96753), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
 75888  _4:
 75889  	_pParse.Xrc = int32(23)
 75890  	goto _7
 75891  _1:
 75892  	if (_rc != int32(2)) && (_rc != int32(0)) {
 75893  		_sqliteAuthBadReturnCode(tls, _pParse)
 75894  	}
 75895  _7:
 75896  	return _rc
 75897  }
 75898  
 75899  // C comment
 75900  //  /*
 75901  //  ** Expression p should encode a floating point value between 1.0 and 0.0.
 75902  //  ** Return 1024 times this value.  Or return -1 if p is not a floating point
 75903  //  ** value between 1.0 and 0.0.
 75904  //  */
 75905  func _exprProbability(tls *crt.TLS, _p *XExpr) (r0 int32) {
 75906  	var _r float64
 75907  	_r = -1
 75908  	if int32(_p.Xop) != int32(132) {
 75909  		return int32(-1)
 75910  	}
 75911  	_sqlite3AtoF(tls, *(**int8)(unsafe.Pointer(&_p.Xu)), &_r, _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_p.Xu))), uint8(1))
 75912  	func() {
 75913  		if _r < float64(0) {
 75914  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89904), unsafe.Pointer(&_exprProbabilityØ00__func__Ø000), unsafe.Pointer(str(96783)))
 75915  			crt.X__builtin_abort(tls)
 75916  		}
 75917  	}()
 75918  	if _r > float64(1) {
 75919  		return int32(-1)
 75920  	}
 75921  	return int32(_r * (1.34217728e+08))
 75922  }
 75923  
 75924  var _exprProbabilityØ00__func__Ø000 [16]int8
 75925  
 75926  func init() {
 75927  	crt.Xstrncpy(nil, &_exprProbabilityØ00__func__Ø000[0], str(96790), 16)
 75928  }
 75929  
 75930  // C comment
 75931  //  /*
 75932  //  ** Determine if any of the arguments to the pExpr Function reference
 75933  //  ** pSrcList.  Return true if they do.  Also return true if the function
 75934  //  ** has no arguments or has only constant arguments.  Return false if pExpr
 75935  //  ** references columns but not columns of tables found in pSrcList.
 75936  //  */
 75937  func _sqlite3FunctionUsesThisSrc(tls *crt.TLS, _pExpr *XExpr, _pSrcList *XSrcList) (r0 int32) {
 75938  	var _w XWalker
 75939  	var _cnt TSrcCount
 75940  	func() {
 75941  		if int32(_pExpr.Xop) != int32(153) {
 75942  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95801), unsafe.Pointer(&_sqlite3FunctionUsesThisSrcØ00__func__Ø000), unsafe.Pointer(str(96806)))
 75943  			crt.X__builtin_abort(tls)
 75944  		}
 75945  	}()
 75946  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint64(48))
 75947  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _exprSrcCount
 75948  	*(**TSrcCount)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = &_cnt
 75949  	*(**XSrcList)(unsafe.Pointer(&_cnt.XpSrc)) = _pSrcList
 75950  	_cnt.XnThis = int32(0)
 75951  	_cnt.XnOther = int32(0)
 75952  	_sqlite3WalkExprList(tls, &_w, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))))
 75953  	return bool2int((_cnt.XnThis > int32(0)) || (_cnt.XnOther == int32(0)))
 75954  }
 75955  
 75956  var _sqlite3FunctionUsesThisSrcØ00__func__Ø000 [27]int8
 75957  
 75958  func init() {
 75959  	crt.Xstrncpy(nil, &_sqlite3FunctionUsesThisSrcØ00__func__Ø000[0], str(96833), 27)
 75960  }
 75961  
 75962  // C comment
 75963  //  /*
 75964  //  ** Count the number of references to columns.
 75965  //  */
 75966  func _exprSrcCount(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 75967  	var _1_i, _1_nSrc int32
 75968  	var _1_pSrc *XSrcList
 75969  	var _1_p *TSrcCount
 75970  	if int32(_pExpr.Xop) != int32(152) && func() int32 {
 75971  		if int32(_pExpr.Xop) == int32(154) {
 75972  			return func() int32 {
 75973  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95775), unsafe.Pointer(&_exprSrcCountØ00__func__Ø000), unsafe.Pointer(str(4809)))
 75974  				crt.X__builtin_abort(tls)
 75975  				return int32(1)
 75976  			}()
 75977  		}
 75978  		return int32(0)
 75979  	}() == 0 {
 75980  		goto _3
 75981  	}
 75982  	_1_p = (*TSrcCount)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 75983  	_1_pSrc = (*XSrcList)(_1_p.XpSrc)
 75984  	_1_nSrc = func() int32 {
 75985  		if _1_pSrc != nil {
 75986  			return _1_pSrc.XnSrc
 75987  		}
 75988  		return int32(0)
 75989  	}()
 75990  	_1_i = int32(0)
 75991  _6:
 75992  	if _1_i >= _1_nSrc {
 75993  		goto _9
 75994  	}
 75995  	if _pExpr.XiTable == (elem6((*TSrcList_item)(unsafe.Pointer(&_1_pSrc.Xa)), uintptr(_1_i)).XiCursor) {
 75996  		goto _9
 75997  	}
 75998  	_1_i += 1
 75999  	goto _6
 76000  _9:
 76001  	if _1_i < _1_nSrc {
 76002  		_1_p.XnThis += 1
 76003  		goto _12
 76004  	}
 76005  	_1_p.XnOther += 1
 76006  _12:
 76007  _3:
 76008  	return int32(0)
 76009  }
 76010  
 76011  var _exprSrcCountØ00__func__Ø000 [13]int8
 76012  
 76013  func init() {
 76014  	crt.Xstrncpy(nil, &_exprSrcCountØ00__func__Ø000[0], str(96860), 13)
 76015  }
 76016  
 76017  // C comment
 76018  //  /*
 76019  //  ** Resolve names in the SELECT statement p and all of its descendants.
 76020  //  */
 76021  func _resolveSelectStep(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 76022  	var _isCompound, _nCompound, _i, _7_nRef int32
 76023  	var _7_zSavedContext *int8
 76024  	var _db *Xsqlite3
 76025  	var _6_pItem, _11_pItem *TSrcList_item
 76026  	var _pGroupBy *XExprList
 76027  	var _16_pItem *TExprList_item
 76028  	var _pLeftmost, _5_pSub, _13_pSub *XSelect
 76029  	var _pParse *XParse
 76030  	var _sNC XNameContext
 76031  	var _pOuterNC, _7_pNC *XNameContext
 76032  	func() {
 76033  		if _p == nil {
 76034  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90520), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(807)))
 76035  			crt.X__builtin_abort(tls)
 76036  		}
 76037  	}()
 76038  	if (_p.XselFlags & uint32(4)) != 0 {
 76039  		return int32(1)
 76040  	}
 76041  	_pOuterNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 76042  	_pParse = (*XParse)(_pWalker.XpParse)
 76043  	_db = (*Xsqlite3)(_pParse.Xdb)
 76044  	if (_p.XselFlags & uint32(64)) == (0) {
 76045  		_sqlite3SelectPrep(tls, _pParse, _p, _pOuterNC)
 76046  		return func() int32 {
 76047  			if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 76048  				return int32(2)
 76049  			}
 76050  			return int32(1)
 76051  		}()
 76052  	}
 76053  	_isCompound = bool2int((*XSelect)(_p.XpPrior) != nil)
 76054  	_nCompound = int32(0)
 76055  	_pLeftmost = _p
 76056  _7:
 76057  	if _p == nil {
 76058  		goto _8
 76059  	}
 76060  	func() {
 76061  		if (_p.XselFlags & uint32(64)) == (0) {
 76062  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90545), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(96873)))
 76063  			crt.X__builtin_abort(tls)
 76064  		}
 76065  	}()
 76066  	func() {
 76067  		if (_p.XselFlags & uint32(4)) != (0) {
 76068  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90546), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(96904)))
 76069  			crt.X__builtin_abort(tls)
 76070  		}
 76071  	}()
 76072  	_p.XselFlags |= uint32(4)
 76073  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint64(56))
 76074  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pParse
 76075  	if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.XpLimit)) != 0 || _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.XpOffset)) != 0 {
 76076  		return int32(2)
 76077  	}
 76078  	if (_p.XselFlags & uint32(65536)) != 0 {
 76079  		_5_pSub = (*XSelect)(elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), 0).XpSelect)
 76080  		func() {
 76081  			if ((*XSrcList)(_p.XpSrc).XnSrc) != int32(1) || _p.XpOrderBy == nil {
 76082  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90567), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(96935)))
 76083  				crt.X__builtin_abort(tls)
 76084  			}
 76085  		}()
 76086  		func() {
 76087  			if _5_pSub.XpPrior == nil || (*XExprList)(_5_pSub.XpOrderBy) != nil {
 76088  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90568), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(96967)))
 76089  				crt.X__builtin_abort(tls)
 76090  			}
 76091  		}()
 76092  		*(**XExprList)(unsafe.Pointer(&_5_pSub.XpOrderBy)) = (*XExprList)(_p.XpOrderBy)
 76093  		*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = nil
 76094  	}
 76095  	_i = int32(0)
 76096  _22:
 76097  	if _i >= ((*XSrcList)(_p.XpSrc).XnSrc) {
 76098  		goto _25
 76099  	}
 76100  	_6_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), uintptr(_i))
 76101  	if _6_pItem.XpSelect == nil {
 76102  		goto _26
 76103  	}
 76104  	_7_nRef = int32(0)
 76105  	_7_zSavedContext = _pParse.XzAuthContext
 76106  	_7_pNC = _pOuterNC
 76107  _27:
 76108  	if _7_pNC == nil {
 76109  		goto _30
 76110  	}
 76111  	_7_nRef += _7_pNC.XnRef
 76112  	_7_pNC = (*XNameContext)(_7_pNC.XpNext)
 76113  	goto _27
 76114  _30:
 76115  	if _6_pItem.XzName != nil {
 76116  		_pParse.XzAuthContext = _6_pItem.XzName
 76117  	}
 76118  	_sqlite3ResolveSelectNames(tls, _pParse, (*XSelect)(_6_pItem.XpSelect), _pOuterNC)
 76119  	_pParse.XzAuthContext = _7_zSavedContext
 76120  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 76121  		return int32(2)
 76122  	}
 76123  	_7_pNC = _pOuterNC
 76124  _34:
 76125  	if _7_pNC == nil {
 76126  		goto _37
 76127  	}
 76128  	_7_nRef -= _7_pNC.XnRef
 76129  	_7_pNC = (*XNameContext)(_7_pNC.XpNext)
 76130  	goto _34
 76131  _37:
 76132  	func() {
 76133  		if int32((uint32((_6_pItem.Xfg.XnotIndexed)>>3)<<31)>>31) != int32(0) || _7_nRef > int32(0) {
 76134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90595), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(97001)))
 76135  			crt.X__builtin_abort(tls)
 76136  		}
 76137  	}()
 76138  	storebits5(&(_6_pItem.Xfg.XnotIndexed), int8(bool2int(_7_nRef != int32(0))), 8, 3)
 76139  _26:
 76140  	_i += 1
 76141  	goto _22
 76142  _25:
 76143  	_sNC.XncFlags = uint16(1)
 76144  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = (*XSrcList)(_p.XpSrc)
 76145  	*(**XNameContext)(unsafe.Pointer(&_sNC.XpNext)) = _pOuterNC
 76146  	if _sqlite3ResolveExprListNames(tls, &_sNC, (*XExprList)(_p.XpEList)) != 0 {
 76147  		return int32(2)
 76148  	}
 76149  	func() {
 76150  		if (_p.XselFlags & uint32(8)) != (0) {
 76151  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90613), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(97038)))
 76152  			crt.X__builtin_abort(tls)
 76153  		}
 76154  	}()
 76155  	_pGroupBy = (*XExprList)(_p.XpGroupBy)
 76156  	if (_pGroupBy != nil) || ((int32(_sNC.XncFlags) & int32(16)) != int32(0)) {
 76157  		_p.XselFlags |= uint32(int32(8) | (int32(_sNC.XncFlags) & int32(4096)))
 76158  		goto _46
 76159  	}
 76160  	{
 76161  		p := &_sNC.XncFlags
 76162  		*p = uint16(int32(*p) & int32(-2))
 76163  	}
 76164  _46:
 76165  	if (_p.XpHaving != nil) && (_pGroupBy == nil) {
 76166  		_sqlite3ErrorMsg(tls, _pParse, str(97070))
 76167  		return int32(2)
 76168  	}
 76169  	*(**XExprList)(unsafe.Pointer(&_sNC.XpEList)) = (*XExprList)(_p.XpEList)
 76170  	if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.XpHaving)) != 0 {
 76171  		return int32(2)
 76172  	}
 76173  	if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.XpWhere)) != 0 {
 76174  		return int32(2)
 76175  	}
 76176  	_i = int32(0)
 76177  _51:
 76178  	if _i >= ((*XSrcList)(_p.XpSrc).XnSrc) {
 76179  		goto _54
 76180  	}
 76181  	_11_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), uintptr(_i))
 76182  	if (((uint32((_11_pItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0) && _sqlite3ResolveExprListNames(tls, &_sNC, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_11_pItem.Xu1)))) != 0 {
 76183  		return int32(2)
 76184  	}
 76185  	_i += 1
 76186  	goto _51
 76187  _54:
 76188  	*(**XNameContext)(unsafe.Pointer(&_sNC.XpNext)) = nil
 76189  	{
 76190  		p := &_sNC.XncFlags
 76191  		*p = uint16(int32(*p) | int32(1))
 76192  	}
 76193  	if (_p.XselFlags & uint32(65536)) != 0 {
 76194  		_13_pSub = (*XSelect)(elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), 0).XpSelect)
 76195  		*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = (*XExprList)(_13_pSub.XpOrderBy)
 76196  		*(**XExprList)(unsafe.Pointer(&_13_pSub.XpOrderBy)) = nil
 76197  	}
 76198  	if (_isCompound <= _nCompound) && _resolveOrderGroupBy(tls, &_sNC, _p, (*XExprList)(_p.XpOrderBy), str(25700)) != 0 {
 76199  		return int32(2)
 76200  	}
 76201  	if _db.XmallocFailed != 0 {
 76202  		return int32(2)
 76203  	}
 76204  	if _pGroupBy == nil {
 76205  		goto _61
 76206  	}
 76207  	if _resolveOrderGroupBy(tls, &_sNC, _p, _pGroupBy, str(25706)) != 0 || (_db.XmallocFailed != 0) {
 76208  		return int32(2)
 76209  	}
 76210  	*func() **TExprList_item { _i = int32(0); return &_16_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pGroupBy.Xa))
 76211  _64:
 76212  	if _i >= _pGroupBy.XnExpr {
 76213  		goto _67
 76214  	}
 76215  	if (((*XExpr)(_16_pItem.XpExpr).Xflags) & uint32(2)) != (0) {
 76216  		_sqlite3ErrorMsg(tls, _pParse, str(97114))
 76217  		return int32(2)
 76218  	}
 76219  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_16_pItem }())) += uintptr(32)
 76220  	goto _64
 76221  _67:
 76222  _61:
 76223  	if (_p.XpNext != nil) && (((*XExprList)(_p.XpEList).XnExpr) != ((*XExprList)((*XSelect)(_p.XpNext).XpEList).XnExpr)) {
 76224  		_sqlite3SelectWrongNumTermsError(tls, _pParse, (*XSelect)(_p.XpNext))
 76225  		return int32(2)
 76226  	}
 76227  	_p = (*XSelect)(_p.XpPrior)
 76228  	_nCompound += 1
 76229  	goto _7
 76230  _8:
 76231  	if _isCompound != 0 && _resolveCompoundOrderBy(tls, _pParse, _pLeftmost) != 0 {
 76232  		return int32(2)
 76233  	}
 76234  	return int32(1)
 76235  }
 76236  
 76237  var _resolveSelectStepØ00__func__Ø000 [18]int8
 76238  
 76239  func init() {
 76240  	crt.Xstrncpy(nil, &_resolveSelectStepØ00__func__Ø000[0], str(97173), 18)
 76241  }
 76242  
 76243  // C comment
 76244  //  /*
 76245  //  ** This routine walks an expression tree and resolves references to
 76246  //  ** table columns and result-set columns.  At the same time, do error
 76247  //  ** checking on function usage and set a flag if any aggregate functions
 76248  //  ** are seen.
 76249  //  **
 76250  //  ** To resolve table columns references we look for nodes (or subtrees) of the
 76251  //  ** form X.Y.Z or Y.Z or just Z where
 76252  //  **
 76253  //  **      X:   The name of a database.  Ex:  "main" or "temp" or
 76254  //  **           the symbolic name assigned to an ATTACH-ed database.
 76255  //  **
 76256  //  **      Y:   The name of a table in a FROM clause.  Or in a trigger
 76257  //  **           one of the special names "old" or "new".
 76258  //  **
 76259  //  **      Z:   The name of a column in table Y.
 76260  //  **
 76261  //  ** The node at the root of the subtree is modified as follows:
 76262  //  **
 76263  //  **    Expr.op        Changed to TK_COLUMN
 76264  //  **    Expr.pTab      Points to the Table object for X.Y
 76265  //  **    Expr.iColumn   The column index in X.Y.  -1 for the rowid.
 76266  //  **    Expr.iTable    The VDBE cursor number for X.Y
 76267  //  **
 76268  //  **
 76269  //  ** To resolve result-set references, look for expression nodes of the
 76270  //  ** form Z (with no X and Y prefix) where the Z matches the right-hand
 76271  //  ** size of an AS clause in the result-set of a SELECT.  The Z expression
 76272  //  ** is replaced by a copy of the left-hand side of the result-set expression.
 76273  //  ** Table-name and function resolution occurs on the substituted expression
 76274  //  ** tree.  For example, in:
 76275  //  **
 76276  //  **      SELECT a+b AS x, c+d AS y FROM t1 ORDER BY x;
 76277  //  **
 76278  //  ** The "x" term of the order by is replaced by "a+b" to render:
 76279  //  **
 76280  //  **      SELECT a+b AS x, c+d AS y FROM t1 ORDER BY a+b;
 76281  //  **
 76282  //  ** Function calls are checked to make sure that the function is
 76283  //  ** defined and that the correct number of arguments are specified.
 76284  //  ** If the function is an aggregate function, then the NC_HasAgg flag is
 76285  //  ** set and the opcode is changed from TK_FUNCTION to TK_AGG_FUNCTION.
 76286  //  ** If an expression contains aggregate functions then the EP_Agg
 76287  //  ** property on the expression is set.
 76288  //  **
 76289  //  ** An error message is left in pParse if anything is amiss.  The number
 76290  //  ** if errors is returned.
 76291  //  */
 76292  func _sqlite3ResolveExprNames(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr) (r0 int32) {
 76293  	var _savedHasAgg uint16
 76294  	var _1_pParse *XParse
 76295  	var _w XWalker
 76296  	if _pExpr == nil {
 76297  		return int32(0)
 76298  	}
 76299  	_1_pParse = (*XParse)(_pNC.XpParse)
 76300  	if _sqlite3ExprCheckHeight(tls, _1_pParse, _pExpr.XnHeight+((*XParse)(_pNC.XpParse).XnHeight)) != 0 {
 76301  		return int32(1)
 76302  	}
 76303  	_1_pParse.XnHeight += _pExpr.XnHeight
 76304  	_savedHasAgg = uint16(int32(_pNC.XncFlags) & int32(4112))
 76305  	{
 76306  		p := &_pNC.XncFlags
 76307  		*p = uint16(int32(*p) & int32(-4113))
 76308  	}
 76309  	*(**XParse)(unsafe.Pointer(&_w.XpParse)) = (*XParse)(_pNC.XpParse)
 76310  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _resolveExprStep
 76311  	*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _resolveSelectStep
 76312  	*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&_w.XxSelectCallback2)) = nil
 76313  	_w.XwalkerDepth = int32(0)
 76314  	_w.XeCode = 0
 76315  	*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = _pNC
 76316  	_sqlite3WalkExpr(tls, &_w, _pExpr)
 76317  	(*XParse)(_pNC.XpParse).XnHeight -= _pExpr.XnHeight
 76318  	if (_pNC.XnErr > int32(0)) || (((*XParse)(_w.XpParse).XnErr) > int32(0)) {
 76319  		_pExpr.Xflags |= uint32(8)
 76320  	}
 76321  	if (int32(_pNC.XncFlags) & int32(16)) != 0 {
 76322  		_pExpr.Xflags |= uint32(2)
 76323  	}
 76324  	{
 76325  		p := &_pNC.XncFlags
 76326  		*p = uint16(int32(*p) | int32(_savedHasAgg))
 76327  	}
 76328  	return bool2int((_pExpr.Xflags & uint32(8)) != (0))
 76329  }
 76330  
 76331  // C comment
 76332  //  /*
 76333  //  ** Resolve all names for all expression in an expression list.  This is
 76334  //  ** just like sqlite3ResolveExprNames() except that it works for an expression
 76335  //  ** list rather than a single expression.
 76336  //  */
 76337  func _sqlite3ResolveExprListNames(tls *crt.TLS, _pNC *XNameContext, _pList *XExprList) (r0 int32) {
 76338  	var _i int32
 76339  	if _pList == nil {
 76340  		goto _0
 76341  	}
 76342  	_i = int32(0)
 76343  _1:
 76344  	if _i >= _pList.XnExpr {
 76345  		goto _4
 76346  	}
 76347  	if _sqlite3ResolveExprNames(tls, _pNC, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr)) != 0 {
 76348  		return int32(2)
 76349  	}
 76350  	_i += 1
 76351  	goto _1
 76352  _4:
 76353  _0:
 76354  	return int32(0)
 76355  }
 76356  
 76357  // C comment
 76358  //  /*
 76359  //  ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
 76360  //  ** The Name context of the SELECT statement is pNC.  zType is either
 76361  //  ** "ORDER" or "GROUP" depending on which type of clause pOrderBy is.
 76362  //  **
 76363  //  ** This routine resolves each term of the clause into an expression.
 76364  //  ** If the order-by term is an integer I between 1 and N (where N is the
 76365  //  ** number of columns in the result set of the SELECT) then the expression
 76366  //  ** in the resolution is a copy of the I-th result-set expression.  If
 76367  //  ** the order-by term is an identifier that corresponds to the AS-name of
 76368  //  ** a result-set expression, then the term resolves to a copy of the
 76369  //  ** result-set expression.  Otherwise, the expression is resolved in
 76370  //  ** the usual way - using sqlite3ResolveExprNames().
 76371  //  **
 76372  //  ** This routine returns the number of errors.  If errors occur, then
 76373  //  ** an appropriate error message might be left in pParse.  (OOM errors
 76374  //  ** excepted.)
 76375  //  */
 76376  func _resolveOrderGroupBy(tls *crt.TLS, _pNC *XNameContext, _pSelect *XSelect, _pOrderBy *XExprList, _zType *int8) (r0 int32) {
 76377  	var _i, _j, _iCol, _nResult int32
 76378  	var _pItem *TExprList_item
 76379  	var _1_pE, _1_pE2 *XExpr
 76380  	var _pParse *XParse
 76381  	if _pOrderBy == nil {
 76382  		return int32(0)
 76383  	}
 76384  	_nResult = (*XExprList)(_pSelect.XpEList).XnExpr
 76385  	_pParse = (*XParse)(_pNC.XpParse)
 76386  	*func() **TExprList_item { _i = int32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa))
 76387  _1:
 76388  	if _i >= _pOrderBy.XnExpr {
 76389  		goto _4
 76390  	}
 76391  	_1_pE = (*XExpr)(_pItem.XpExpr)
 76392  	_1_pE2 = _sqlite3ExprSkipCollate(tls, _1_pE)
 76393  	if int32(*elem1(_zType, 0)) == int32(71) {
 76394  		goto _5
 76395  	}
 76396  	_iCol = _resolveAsName(tls, _pParse, (*XExprList)(_pSelect.XpEList), _1_pE2)
 76397  	if _iCol > int32(0) {
 76398  		(*t73)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol = uint16(_iCol)
 76399  		goto _2
 76400  	}
 76401  _5:
 76402  	if _sqlite3ExprIsInteger(tls, _1_pE2, &_iCol) == 0 {
 76403  		goto _7
 76404  	}
 76405  	if (_iCol < int32(1)) || (_iCol > int32(65535)) {
 76406  		_resolveOutOfRangeError(tls, _pParse, _zType, _i+int32(1), _nResult)
 76407  		return int32(1)
 76408  	}
 76409  	(*t73)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol = uint16(_iCol)
 76410  	goto _2
 76411  _7:
 76412  	(*t73)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol = 0
 76413  	if _sqlite3ResolveExprNames(tls, _pNC, _1_pE) != 0 {
 76414  		return int32(1)
 76415  	}
 76416  	_j = int32(0)
 76417  _11:
 76418  	if _j >= ((*XExprList)(_pSelect.XpEList).XnExpr) {
 76419  		goto _14
 76420  	}
 76421  	if _sqlite3ExprCompare(tls, _1_pE, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.XpEList).Xa))), uintptr(_j)).XpExpr), int32(-1)) == int32(0) {
 76422  		(*t73)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol = uint16(_j + int32(1))
 76423  	}
 76424  	_j += 1
 76425  	goto _11
 76426  _14:
 76427  _2:
 76428  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(32)
 76429  	goto _1
 76430  _4:
 76431  	return _sqlite3ResolveOrderGroupBy(tls, _pParse, _pSelect, _pOrderBy, _zType)
 76432  }
 76433  
 76434  // C comment
 76435  //  /*
 76436  //  ** pEList is a list of expressions which are really the result set of the
 76437  //  ** a SELECT statement.  pE is a term in an ORDER BY or GROUP BY clause.
 76438  //  ** This routine checks to see if pE is a simple identifier which corresponds
 76439  //  ** to the AS-name of one of the terms of the expression list.  If it is,
 76440  //  ** this routine return an integer between 1 and N where N is the number of
 76441  //  ** elements in pEList, corresponding to the matching entry.  If there is
 76442  //  ** no match, or if pE is not a simple identifier, then this routine
 76443  //  ** return 0.
 76444  //  **
 76445  //  ** pEList has been resolved.  pE has not.
 76446  //  */
 76447  func _resolveAsName(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pE *XExpr) (r0 int32) {
 76448  	var _i int32
 76449  	var _1_zCol, _2_zAs *int8
 76450  
 76451  	if int32(_pE.Xop) != int32(27) {
 76452  		goto _0
 76453  	}
 76454  	_1_zCol = *(**int8)(unsafe.Pointer(&_pE.Xu))
 76455  	_i = int32(0)
 76456  _1:
 76457  	if _i >= _pEList.XnExpr {
 76458  		goto _4
 76459  	}
 76460  	_2_zAs = elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzName
 76461  	if (_2_zAs != nil) && (_sqlite3StrICmp(tls, _2_zAs, _1_zCol) == int32(0)) {
 76462  		return _i + int32(1)
 76463  	}
 76464  	_i += 1
 76465  	goto _1
 76466  _4:
 76467  _0:
 76468  	return int32(0)
 76469  }
 76470  
 76471  // C comment
 76472  //  /*
 76473  //  ** Generate an ORDER BY or GROUP BY term out-of-range error.
 76474  //  */
 76475  func _resolveOutOfRangeError(tls *crt.TLS, _pParse *XParse, _zType *int8, _i int32, _mx int32) {
 76476  	_sqlite3ErrorMsg(tls, _pParse, str(97191), _i, unsafe.Pointer(_zType), _mx)
 76477  }
 76478  
 76479  // C comment
 76480  //  /*
 76481  //  ** Do a deep comparison of two expression trees.  Return 0 if the two
 76482  //  ** expressions are completely identical.  Return 1 if they differ only
 76483  //  ** by a COLLATE operator at the top level.  Return 2 if there are differences
 76484  //  ** other than the top-level COLLATE operator.
 76485  //  **
 76486  //  ** If any subelement of pB has Expr.iTable==(-1) then it is allowed
 76487  //  ** to compare equal to an equivalent element in pA with Expr.iTable==iTab.
 76488  //  **
 76489  //  ** The pA side might be using TK_REGISTER.  If that is the case and pB is
 76490  //  ** not using TK_REGISTER but is otherwise equivalent, then still return 0.
 76491  //  **
 76492  //  ** Sometimes this routine will return 2 even if the two expressions
 76493  //  ** really are equivalent.  If we cannot prove that the expressions are
 76494  //  ** identical, we return 2 just to be safe.  So if this routine
 76495  //  ** returns 2, then you do not really know for certain if the two
 76496  //  ** expressions are the same.  But if you get a 0 or 1 return, then you
 76497  //  ** can be sure the expressions are the same.  In the places where
 76498  //  ** this routine is used, it does not hurt to get an extra 2 - that
 76499  //  ** just might result in some slightly slower code.  But returning
 76500  //  ** an incorrect 0 or 1 could lead to a malfunction.
 76501  //  */
 76502  func _sqlite3ExprCompare(tls *crt.TLS, _pA *XExpr, _pB *XExpr, _iTab int32) (r0 int32) {
 76503  	var _combinedFlags uint32
 76504  	if (_pA == nil) || (_pB == nil) {
 76505  		return func() int32 {
 76506  			if _pB == _pA {
 76507  				return int32(0)
 76508  			}
 76509  			return int32(2)
 76510  		}()
 76511  	}
 76512  	_combinedFlags = _pA.Xflags | _pB.Xflags
 76513  	if (_combinedFlags & uint32(1024)) == 0 {
 76514  		goto _4
 76515  	}
 76516  	if (((_pA.Xflags & _pB.Xflags) & uint32(1024)) != (0)) && ((*(*int32)(unsafe.Pointer(&_pA.Xu))) == (*(*int32)(unsafe.Pointer(&_pB.Xu)))) {
 76517  		return int32(0)
 76518  	}
 76519  	return int32(2)
 76520  
 76521  _4:
 76522  	if int32(_pA.Xop) == int32(_pB.Xop) {
 76523  		goto _7
 76524  	}
 76525  	if (int32(_pA.Xop) == int32(94)) && (_sqlite3ExprCompare(tls, (*XExpr)(_pA.XpLeft), _pB, _iTab) < int32(2)) {
 76526  		return int32(1)
 76527  	}
 76528  	if (int32(_pB.Xop) == int32(94)) && (_sqlite3ExprCompare(tls, _pA, (*XExpr)(_pB.XpLeft), _iTab) < int32(2)) {
 76529  		return int32(1)
 76530  	}
 76531  	return int32(2)
 76532  
 76533  _7:
 76534  	if int32(_pA.Xop) == int32(152) || int32(_pA.Xop) == int32(154) || (*(**int8)(unsafe.Pointer(&_pA.Xu))) == nil {
 76535  		goto _14
 76536  	}
 76537  	if int32(_pA.Xop) != int32(151) {
 76538  		goto _15
 76539  	}
 76540  	if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer(&_pA.Xu)), *(**int8)(unsafe.Pointer(&_pB.Xu))) != int32(0) {
 76541  		return int32(2)
 76542  	}
 76543  	goto _18
 76544  _15:
 76545  	if crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer(&_pA.Xu)), *(**int8)(unsafe.Pointer(&_pB.Xu))) != int32(0) {
 76546  		return func() int32 {
 76547  			if int32(_pA.Xop) == int32(94) {
 76548  				return int32(1)
 76549  			}
 76550  			return int32(2)
 76551  		}()
 76552  	}
 76553  _18:
 76554  _14:
 76555  	if (_pA.Xflags & uint32(16)) != (_pB.Xflags & uint32(16)) {
 76556  		return int32(2)
 76557  	}
 76558  	if func() int32 {
 76559  		if (_combinedFlags & uint32(16384)) == (0) {
 76560  			return int32(1)
 76561  		}
 76562  		return func() int32 {
 76563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95607), unsafe.Pointer(&_sqlite3ExprCompareØ00__func__Ø000), unsafe.Pointer(str(4809)))
 76564  			crt.X__builtin_abort(tls)
 76565  			return int32(0)
 76566  		}()
 76567  	}() == 0 {
 76568  		goto _24
 76569  	}
 76570  	if (_combinedFlags & uint32(2048)) != 0 {
 76571  		return int32(2)
 76572  	}
 76573  	if _sqlite3ExprCompare(tls, (*XExpr)(_pA.XpLeft), (*XExpr)(_pB.XpLeft), _iTab) != 0 {
 76574  		return int32(2)
 76575  	}
 76576  	if _sqlite3ExprCompare(tls, (*XExpr)(_pA.XpRight), (*XExpr)(_pB.XpRight), _iTab) != 0 {
 76577  		return int32(2)
 76578  	}
 76579  	if _sqlite3ExprListCompare(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pA.Xx))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pB.Xx))), _iTab) != 0 {
 76580  		return int32(2)
 76581  	}
 76582  	if func() int32 {
 76583  		if (_combinedFlags & uint32(8192)) == (0) {
 76584  			return int32(1)
 76585  		}
 76586  		return func() int32 {
 76587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95612), unsafe.Pointer(&_sqlite3ExprCompareØ00__func__Ø000), unsafe.Pointer(str(4809)))
 76588  			crt.X__builtin_abort(tls)
 76589  			return int32(0)
 76590  		}()
 76591  	}() == 0 || int32(_pA.Xop) == int32(97) {
 76592  		goto _32
 76593  	}
 76594  	if int32(_pA.XiColumn) != int32(_pB.XiColumn) {
 76595  		return int32(2)
 76596  	}
 76597  	if (_pA.XiTable != _pB.XiTable) && ((_pA.XiTable != _iTab) || func() int32 {
 76598  		if _pB.XiTable >= int32(0) {
 76599  			return func() int32 {
 76600  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95615), unsafe.Pointer(&_sqlite3ExprCompareØ00__func__Ø000), unsafe.Pointer(str(4809)))
 76601  				crt.X__builtin_abort(tls)
 76602  				return int32(1)
 76603  			}()
 76604  		}
 76605  		return int32(0)
 76606  	}() != 0) {
 76607  		return int32(2)
 76608  	}
 76609  _32:
 76610  _24:
 76611  	return int32(0)
 76612  }
 76613  
 76614  var _sqlite3ExprCompareØ00__func__Ø000 [19]int8
 76615  
 76616  func init() {
 76617  	crt.Xstrncpy(nil, &_sqlite3ExprCompareØ00__func__Ø000[0], str(97247), 19)
 76618  }
 76619  
 76620  // C comment
 76621  //  /*
 76622  //  ** Compare two ExprList objects.  Return 0 if they are identical and
 76623  //  ** non-zero if they differ in any way.
 76624  //  **
 76625  //  ** If any subelement of pB has Expr.iTable==(-1) then it is allowed
 76626  //  ** to compare equal to an equivalent element in pA with Expr.iTable==iTab.
 76627  //  **
 76628  //  ** This routine might return non-zero for equivalent ExprLists.  The
 76629  //  ** only consequence will be disabled optimizations.  But this routine
 76630  //  ** must never return 0 if the two ExprList objects are different, or
 76631  //  ** a malfunction will result.
 76632  //  **
 76633  //  ** Two NULL pointers are considered to be the same.  But a NULL pointer
 76634  //  ** always differs from a non-NULL pointer.
 76635  //  */
 76636  func _sqlite3ExprListCompare(tls *crt.TLS, _pA *XExprList, _pB *XExprList, _iTab int32) (r0 int32) {
 76637  	var _i int32
 76638  	var _1_pExprA, _1_pExprB *XExpr
 76639  	if (_pA == nil) && (_pB == nil) {
 76640  		return int32(0)
 76641  	}
 76642  	if (_pA == nil) || (_pB == nil) {
 76643  		return int32(1)
 76644  	}
 76645  	if _pA.XnExpr != _pB.XnExpr {
 76646  		return int32(1)
 76647  	}
 76648  	_i = int32(0)
 76649  _5:
 76650  	if _i >= _pA.XnExpr {
 76651  		goto _8
 76652  	}
 76653  	_1_pExprA = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pA.Xa)), uintptr(_i)).XpExpr)
 76654  	_1_pExprB = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pB.Xa)), uintptr(_i)).XpExpr)
 76655  	if int32(elem59((*TExprList_item)(unsafe.Pointer(&_pA.Xa)), uintptr(_i)).XsortOrder) != int32(elem59((*TExprList_item)(unsafe.Pointer(&_pB.Xa)), uintptr(_i)).XsortOrder) {
 76656  		return int32(1)
 76657  	}
 76658  	if _sqlite3ExprCompare(tls, _1_pExprA, _1_pExprB, _iTab) != 0 {
 76659  		return int32(1)
 76660  	}
 76661  	_i += 1
 76662  	goto _5
 76663  _8:
 76664  	return int32(0)
 76665  }
 76666  
 76667  // C comment
 76668  //  /*
 76669  //  ** Check every term in the ORDER BY or GROUP BY clause pOrderBy of
 76670  //  ** the SELECT statement pSelect.  If any term is reference to a
 76671  //  ** result set expression (as determined by the ExprList.a.u.x.iOrderByCol
 76672  //  ** field) then convert that term into a copy of the corresponding result set
 76673  //  ** column.
 76674  //  **
 76675  //  ** If any errors are detected, add an error message to pParse and
 76676  //  ** return non-zero.  Return zero if no errors are seen.
 76677  //  */
 76678  func _sqlite3ResolveOrderGroupBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect, _pOrderBy *XExprList, _zType *int8) (r0 int32) {
 76679  	var _i int32
 76680  	var _db *Xsqlite3
 76681  	var _pEList *XExprList
 76682  	var _pItem *TExprList_item
 76683  	_db = (*Xsqlite3)(_pParse.Xdb)
 76684  	if (_pOrderBy == nil) || (((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0) {
 76685  		return int32(0)
 76686  	}
 76687  	if _pOrderBy.XnExpr > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(2))) {
 76688  		_sqlite3ErrorMsg(tls, _pParse, str(97266), unsafe.Pointer(_zType))
 76689  		return int32(1)
 76690  	}
 76691  	_pEList = (*XExprList)(_pSelect.XpEList)
 76692  	func() {
 76693  		if _pEList == nil {
 76694  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90418), unsafe.Pointer(&_sqlite3ResolveOrderGroupByØ00__func__Ø000), unsafe.Pointer(str(45007)))
 76695  			crt.X__builtin_abort(tls)
 76696  		}
 76697  	}()
 76698  	*func() **TExprList_item { _i = int32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa))
 76699  _5:
 76700  	if _i >= _pOrderBy.XnExpr {
 76701  		goto _8
 76702  	}
 76703  	if ((*t73)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol) == 0 {
 76704  		goto _9
 76705  	}
 76706  	if int32((*t73)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol) > _pEList.XnExpr {
 76707  		_resolveOutOfRangeError(tls, _pParse, _zType, _i+int32(1), _pEList.XnExpr)
 76708  		return int32(1)
 76709  	}
 76710  	_resolveAlias(tls, _pParse, _pEList, int32((*t73)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol)-int32(1), (*XExpr)(_pItem.XpExpr), _zType, int32(0))
 76711  _9:
 76712  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(32)
 76713  	goto _5
 76714  _8:
 76715  	return int32(0)
 76716  }
 76717  
 76718  var _sqlite3ResolveOrderGroupByØ00__func__Ø000 [27]int8
 76719  
 76720  func init() {
 76721  	crt.Xstrncpy(nil, &_sqlite3ResolveOrderGroupByØ00__func__Ø000[0], str(97297), 27)
 76722  }
 76723  
 76724  // C comment
 76725  //  /*
 76726  //  ** Error message for when two or more terms of a compound select have different
 76727  //  ** size result sets.
 76728  //  */
 76729  func _sqlite3SelectWrongNumTermsError(tls *crt.TLS, _pParse *XParse, _p *XSelect) {
 76730  	if (_p.XselFlags & uint32(512)) != 0 {
 76731  		_sqlite3ErrorMsg(tls, _pParse, str(97324))
 76732  		goto _1
 76733  	}
 76734  	_sqlite3ErrorMsg(tls, _pParse, str(97370), unsafe.Pointer(_selectOpName(tls, int32(_p.Xop))))
 76735  _1:
 76736  }
 76737  
 76738  // C comment
 76739  //  /*
 76740  //  ** Name of the connection operator, used for error messages.
 76741  //  */
 76742  func _selectOpName(tls *crt.TLS, _id int32) (r0 *int8) {
 76743  	var _z *int8
 76744  	switch _id {
 76745  	case int32(116):
 76746  		goto _1
 76747  	case int32(117):
 76748  		goto _3
 76749  	case int32(118):
 76750  		goto _2
 76751  	default:
 76752  		goto _4
 76753  	}
 76754  
 76755  _1:
 76756  	_z = str(47055)
 76757  	goto _5
 76758  _2:
 76759  	_z = str(25647)
 76760  	goto _5
 76761  _3:
 76762  	_z = str(25640)
 76763  	goto _5
 76764  _4:
 76765  	_z = str(25630)
 76766  	goto _5
 76767  _5:
 76768  	return _z
 76769  }
 76770  
 76771  // C comment
 76772  //  /*
 76773  //  ** Analyze the ORDER BY clause in a compound SELECT statement.   Modify
 76774  //  ** each term of the ORDER BY clause is a constant integer between 1
 76775  //  ** and N where N is the number of columns in the compound SELECT.
 76776  //  **
 76777  //  ** ORDER BY terms that are already an integer between 1 and N are
 76778  //  ** unmodified.  ORDER BY terms that are integers outside the range of
 76779  //  ** 1 through N generate an error.  ORDER BY terms that are expressions
 76780  //  ** are matched against result set expressions of compound SELECT
 76781  //  ** beginning with the left-most SELECT and working toward the right.
 76782  //  ** At the first match, the ORDER BY expression is transformed into
 76783  //  ** the integer column number.
 76784  //  **
 76785  //  ** Return the number of errors seen.
 76786  //  */
 76787  func _resolveCompoundOrderBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) (r0 int32) {
 76788  	var _i, _moreToDo, _5_iCol int32
 76789  	var _db *Xsqlite3
 76790  	var _pOrderBy, _pEList *XExprList
 76791  	var _4_pItem *TExprList_item
 76792  	var _5_pE, _5_pDup, _11_pNew, _13_pParent *XExpr
 76793  	_moreToDo = int32(1)
 76794  	_pOrderBy = (*XExprList)(_pSelect.XpOrderBy)
 76795  	if _pOrderBy == nil {
 76796  		return int32(0)
 76797  	}
 76798  	_db = (*Xsqlite3)(_pParse.Xdb)
 76799  	if _pOrderBy.XnExpr > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(2))) {
 76800  		_sqlite3ErrorMsg(tls, _pParse, str(97452))
 76801  		return int32(1)
 76802  	}
 76803  	_i = int32(0)
 76804  _2:
 76805  	if _i >= _pOrderBy.XnExpr {
 76806  		goto _5
 76807  	}
 76808  	storebits5(&(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).Xdone), 0, 1, 0)
 76809  	_i += 1
 76810  	goto _2
 76811  _5:
 76812  	*(**XSelect)(unsafe.Pointer(&_pSelect.XpNext)) = nil
 76813  _6:
 76814  	if _pSelect.XpPrior != nil {
 76815  		*(**XSelect)(unsafe.Pointer(&((*XSelect)(_pSelect.XpPrior).XpNext))) = _pSelect
 76816  		_pSelect = (*XSelect)(_pSelect.XpPrior)
 76817  		goto _6
 76818  	}
 76819  _7:
 76820  	if _pSelect == nil || _moreToDo == 0 {
 76821  		goto _9
 76822  	}
 76823  	_moreToDo = int32(0)
 76824  	_pEList = (*XExprList)(_pSelect.XpEList)
 76825  	func() {
 76826  		if _pEList == nil {
 76827  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90332), unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000), unsafe.Pointer(str(45007)))
 76828  			crt.X__builtin_abort(tls)
 76829  		}
 76830  	}()
 76831  	*func() **TExprList_item { _i = int32(0); return &_4_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa))
 76832  _13:
 76833  	if _i >= _pOrderBy.XnExpr {
 76834  		goto _16
 76835  	}
 76836  	_5_iCol = int32(-1)
 76837  	if ((uint32(_4_pItem.Xdone) << 31) >> 31) != 0 {
 76838  		goto _14
 76839  	}
 76840  	_5_pE = _sqlite3ExprSkipCollate(tls, (*XExpr)(_4_pItem.XpExpr))
 76841  	if _sqlite3ExprIsInteger(tls, _5_pE, &_5_iCol) == 0 {
 76842  		goto _18
 76843  	}
 76844  	if (_5_iCol <= int32(0)) || (_5_iCol > _pEList.XnExpr) {
 76845  		_resolveOutOfRangeError(tls, _pParse, str(25700), _i+int32(1), _pEList.XnExpr)
 76846  		return int32(1)
 76847  	}
 76848  	goto _21
 76849  _18:
 76850  	_5_iCol = _resolveAsName(tls, _pParse, _pEList, _5_pE)
 76851  	if _5_iCol != int32(0) {
 76852  		goto _22
 76853  	}
 76854  	_5_pDup = _sqlite3ExprDup(tls, _db, _5_pE, int32(0))
 76855  	if _db.XmallocFailed == 0 {
 76856  		func() {
 76857  			if _5_pDup == nil {
 76858  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90348), unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000), unsafe.Pointer(str(97486)))
 76859  				crt.X__builtin_abort(tls)
 76860  			}
 76861  		}()
 76862  		_5_iCol = _resolveOrderByTermToExprList(tls, _pParse, _pSelect, _5_pDup)
 76863  	}
 76864  	_sqlite3ExprDelete(tls, _db, _5_pDup)
 76865  _22:
 76866  _21:
 76867  	if _5_iCol <= int32(0) {
 76868  		goto _26
 76869  	}
 76870  	_11_pNew = _sqlite3Expr(tls, _db, int32(134), nil)
 76871  	if _11_pNew == nil {
 76872  		return int32(1)
 76873  	}
 76874  	_11_pNew.Xflags |= uint32(1024)
 76875  	*(*int32)(unsafe.Pointer(&_11_pNew.Xu)) = _5_iCol
 76876  	if (*XExpr)(_4_pItem.XpExpr) == _5_pE {
 76877  		*(**XExpr)(unsafe.Pointer(&_4_pItem.XpExpr)) = _11_pNew
 76878  		goto _29
 76879  	}
 76880  	_13_pParent = (*XExpr)(_4_pItem.XpExpr)
 76881  	func() {
 76882  		if int32(_13_pParent.Xop) != int32(94) {
 76883  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90365), unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000), unsafe.Pointer(str(97491)))
 76884  			crt.X__builtin_abort(tls)
 76885  		}
 76886  	}()
 76887  _32:
 76888  	if int32((*XExpr)(_13_pParent.XpLeft).Xop) == int32(94) {
 76889  		_13_pParent = (*XExpr)(_13_pParent.XpLeft)
 76890  		goto _32
 76891  	}
 76892  	func() {
 76893  		if (*XExpr)(_13_pParent.XpLeft) != _5_pE {
 76894  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90367), unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000), unsafe.Pointer(str(97515)))
 76895  			crt.X__builtin_abort(tls)
 76896  		}
 76897  	}()
 76898  	*(**XExpr)(unsafe.Pointer(&_13_pParent.XpLeft)) = _11_pNew
 76899  _29:
 76900  	_sqlite3ExprDelete(tls, _db, _5_pE)
 76901  	(*t73)(unsafe.Pointer(&_4_pItem.Xu)).XiOrderByCol = uint16(_5_iCol)
 76902  	storebits5(&_4_pItem.Xdone, int8(1), 1, 0)
 76903  	goto _36
 76904  _26:
 76905  	_moreToDo = int32(1)
 76906  _36:
 76907  _14:
 76908  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_4_pItem }())) += uintptr(32)
 76909  	goto _13
 76910  _16:
 76911  	_pSelect = (*XSelect)(_pSelect.XpNext)
 76912  	goto _7
 76913  _9:
 76914  	_i = int32(0)
 76915  _37:
 76916  	if _i >= _pOrderBy.XnExpr {
 76917  		goto _40
 76918  	}
 76919  	if int32((uint32(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).Xdone)<<31)>>31) == int32(0) {
 76920  		_sqlite3ErrorMsg(tls, _pParse, str(97534), _i+int32(1))
 76921  		return int32(1)
 76922  	}
 76923  	_i += 1
 76924  	goto _37
 76925  _40:
 76926  	return int32(0)
 76927  }
 76928  
 76929  var _resolveCompoundOrderByØ00__func__Ø000 [23]int8
 76930  
 76931  func init() {
 76932  	crt.Xstrncpy(nil, &_resolveCompoundOrderByØ00__func__Ø000[0], str(97595), 23)
 76933  }
 76934  
 76935  // C comment
 76936  //  /*
 76937  //  ** pE is a pointer to an expression which is a single term in the
 76938  //  ** ORDER BY of a compound SELECT.  The expression has not been
 76939  //  ** name resolved.
 76940  //  **
 76941  //  ** At the point this routine is called, we already know that the
 76942  //  ** ORDER BY term is not an integer index into the result set.  That
 76943  //  ** case is handled by the calling routine.
 76944  //  **
 76945  //  ** Attempt to match pE against result set columns in the left-most
 76946  //  ** SELECT statement.  Return the index i of the matching column,
 76947  //  ** as an indication to the caller that it should sort by the i-th column.
 76948  //  ** The left-most column is 1.  In other words, the value returned is the
 76949  //  ** same integer value that would be used in the SQL statement to indicate
 76950  //  ** the column.
 76951  //  **
 76952  //  ** If there is no match, return 0.  Return -1 if an error occurs.
 76953  //  */
 76954  func _resolveOrderByTermToExprList(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect, _pE *XExpr) (r0 int32) {
 76955  	var _i, _rc int32
 76956  	var _savedSuppErr uint8
 76957  	var _db *Xsqlite3
 76958  	var _pEList *XExprList
 76959  	var _nc XNameContext
 76960  	func() {
 76961  		if _sqlite3ExprIsInteger(tls, _pE, &_i) != int32(0) {
 76962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90240), unsafe.Pointer(&_resolveOrderByTermToExprListØ00__func__Ø000), unsafe.Pointer(str(97618)))
 76963  			crt.X__builtin_abort(tls)
 76964  		}
 76965  	}()
 76966  	_pEList = (*XExprList)(_pSelect.XpEList)
 76967  	crt.Xmemset(tls, unsafe.Pointer(&_nc), int32(0), uint64(56))
 76968  	*(**XParse)(unsafe.Pointer(&_nc.XpParse)) = _pParse
 76969  	*(**XSrcList)(unsafe.Pointer(&_nc.XpSrcList)) = (*XSrcList)(_pSelect.XpSrc)
 76970  	*(**XExprList)(unsafe.Pointer(&_nc.XpEList)) = _pEList
 76971  	_nc.XncFlags = uint16(1)
 76972  	_nc.XnErr = int32(0)
 76973  	_db = (*Xsqlite3)(_pParse.Xdb)
 76974  	_savedSuppErr = _db.XsuppressErr
 76975  	_db.XsuppressErr = uint8(1)
 76976  	_rc = _sqlite3ResolveExprNames(tls, &_nc, _pE)
 76977  	_db.XsuppressErr = _savedSuppErr
 76978  	if _rc != 0 {
 76979  		return int32(0)
 76980  	}
 76981  	_i = int32(0)
 76982  _3:
 76983  	if _i >= _pEList.XnExpr {
 76984  		goto _6
 76985  	}
 76986  	if _sqlite3ExprCompare(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr), _pE, int32(-1)) < int32(2) {
 76987  		return _i + int32(1)
 76988  	}
 76989  	_i += 1
 76990  	goto _3
 76991  _6:
 76992  	return int32(0)
 76993  }
 76994  
 76995  var _resolveOrderByTermToExprListØ00__func__Ø000 [29]int8
 76996  
 76997  func init() {
 76998  	crt.Xstrncpy(nil, &_resolveOrderByTermToExprListØ00__func__Ø000[0], str(97650), 29)
 76999  }
 77000  
 77001  // C comment
 77002  //  /*
 77003  //  ** This routine adds datatype and collating sequence information to
 77004  //  ** the Table structures of all FROM-clause subqueries in a
 77005  //  ** SELECT statement.
 77006  //  **
 77007  //  ** Use this routine after name resolution.
 77008  //  */
 77009  func _sqlite3SelectAddTypeInfo(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) {
 77010  	var _w XWalker
 77011  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint64(48))
 77012  	*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&_w.XxSelectCallback2)) = _selectAddSubqueryTypeInfo
 77013  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _sqlite3ExprWalkNoop
 77014  	*(**XParse)(unsafe.Pointer(&_w.XpParse)) = _pParse
 77015  	_sqlite3WalkSelect(tls, &_w, _pSelect)
 77016  }
 77017  
 77018  // C comment
 77019  //  /*
 77020  //  ** This is a Walker.xSelectCallback callback for the sqlite3SelectTypeInfo()
 77021  //  ** interface.
 77022  //  **
 77023  //  ** For each FROM-clause subquery, add Column.zType and Column.zColl
 77024  //  ** information to the Table structure that represents the result set
 77025  //  ** of that subquery.
 77026  //  **
 77027  //  ** The Table structure that represents the result set was constructed
 77028  //  ** by selectExpander() but the type and collation information was omitted
 77029  //  ** at that point because identifiers had not yet been resolved.  This
 77030  //  ** routine is called after identifier resolution.
 77031  //  */
 77032  func _selectAddSubqueryTypeInfo(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) {
 77033  	var _i int32
 77034  	var _1_pTab *XTable
 77035  	var _pTabList *XSrcList
 77036  	var _pFrom *TSrcList_item
 77037  	var _2_pSel *XSelect
 77038  	var _pParse *XParse
 77039  	func() {
 77040  		if (_p.XselFlags & uint32(4)) == 0 {
 77041  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121182), unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000), unsafe.Pointer(str(97679)))
 77042  			crt.X__builtin_abort(tls)
 77043  		}
 77044  	}()
 77045  	func() {
 77046  		if (_p.XselFlags & uint32(128)) != (0) {
 77047  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121183), unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000), unsafe.Pointer(str(97705)))
 77048  			crt.X__builtin_abort(tls)
 77049  		}
 77050  	}()
 77051  	_p.XselFlags |= uint32(128)
 77052  	_pParse = (*XParse)(_pWalker.XpParse)
 77053  	_pTabList = (*XSrcList)(_p.XpSrc)
 77054  	*func() **TSrcList_item { _i = int32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa))
 77055  _4:
 77056  	if _i >= _pTabList.XnSrc {
 77057  		goto _7
 77058  	}
 77059  	_1_pTab = (*XTable)(_pFrom.XpTab)
 77060  	func() {
 77061  		if _1_pTab == nil {
 77062  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121189), unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000), unsafe.Pointer(str(43549)))
 77063  			crt.X__builtin_abort(tls)
 77064  		}
 77065  	}()
 77066  	if (_1_pTab.XtabFlags & uint32(2)) == (0) {
 77067  		goto _10
 77068  	}
 77069  	_2_pSel = (*XSelect)(_pFrom.XpSelect)
 77070  	if _2_pSel == nil {
 77071  		goto _11
 77072  	}
 77073  _12:
 77074  	if _2_pSel.XpPrior != nil {
 77075  		_2_pSel = (*XSelect)(_2_pSel.XpPrior)
 77076  		goto _12
 77077  	}
 77078  	_sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _1_pTab, _2_pSel)
 77079  _11:
 77080  _10:
 77081  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pFrom }())) += uintptr(112)
 77082  	goto _4
 77083  _7:
 77084  }
 77085  
 77086  var _selectAddSubqueryTypeInfoØ00__func__Ø000 [26]int8
 77087  
 77088  func init() {
 77089  	crt.Xstrncpy(nil, &_selectAddSubqueryTypeInfoØ00__func__Ø000[0], str(97739), 26)
 77090  }
 77091  
 77092  // C comment
 77093  //  /*
 77094  //  ** This routine attempts to flatten subqueries as a performance optimization.
 77095  //  ** This routine returns 1 if it makes changes and 0 if no flattening occurs.
 77096  //  **
 77097  //  ** To understand the concept of flattening, consider the following
 77098  //  ** query:
 77099  //  **
 77100  //  **     SELECT a FROM (SELECT x+y AS a FROM t1 WHERE z<100) WHERE a>5
 77101  //  **
 77102  //  ** The default way of implementing this query is to execute the
 77103  //  ** subquery first and store the results in a temporary table, then
 77104  //  ** run the outer query on that temporary table.  This requires two
 77105  //  ** passes over the data.  Furthermore, because the temporary table
 77106  //  ** has no indices, the WHERE clause on the outer query cannot be
 77107  //  ** optimized.
 77108  //  **
 77109  //  ** This routine attempts to rewrite queries such as the above into
 77110  //  ** a single flat select, like this:
 77111  //  **
 77112  //  **     SELECT x+y AS a FROM t1 WHERE z<100 AND a>5
 77113  //  **
 77114  //  ** The code generated for this simplification gives the same result
 77115  //  ** but only has to scan the data once.  And because indices might
 77116  //  ** exist on the table t1, a complete scan of the data might be
 77117  //  ** avoided.
 77118  //  **
 77119  //  ** Flattening is only attempted if all of the following are true:
 77120  //  **
 77121  //  **   (1)  The subquery and the outer query do not both use aggregates.
 77122  //  **
 77123  //  **   (2)  The subquery is not an aggregate or (2a) the outer query is not a join
 77124  //  **        and (2b) the outer query does not use subqueries other than the one
 77125  //  **        FROM-clause subquery that is a candidate for flattening.  (2b is
 77126  //  **        due to ticket [2f7170d73bf9abf80] from 2015-02-09.)
 77127  //  **
 77128  //  **   (3)  The subquery is not the right operand of a LEFT JOIN
 77129  //  **        or the subquery is not itself a join and the outer query is not
 77130  //  **        an aggregate.
 77131  //  **
 77132  //  **   (4)  The subquery is not DISTINCT.
 77133  //  **
 77134  //  **  (**)  At one point restrictions (4) and (5) defined a subset of DISTINCT
 77135  //  **        sub-queries that were excluded from this optimization. Restriction
 77136  //  **        (4) has since been expanded to exclude all DISTINCT subqueries.
 77137  //  **
 77138  //  **   (6)  The subquery does not use aggregates or the outer query is not
 77139  //  **        DISTINCT.
 77140  //  **
 77141  //  **   (7)  The subquery has a FROM clause.  TODO:  For subqueries without
 77142  //  **        A FROM clause, consider adding a FROM clause with the special
 77143  //  **        table sqlite_once that consists of a single row containing a
 77144  //  **        single NULL.
 77145  //  **
 77146  //  **   (8)  The subquery does not use LIMIT or the outer query is not a join.
 77147  //  **
 77148  //  **   (9)  The subquery does not use LIMIT or the outer query does not use
 77149  //  **        aggregates.
 77150  //  **
 77151  //  **  (**)  Restriction (10) was removed from the code on 2005-02-05 but we
 77152  //  **        accidently carried the comment forward until 2014-09-15.  Original
 77153  //  **        text: "The subquery does not use aggregates or the outer query
 77154  //  **        does not use LIMIT."
 77155  //  **
 77156  //  **  (11)  The subquery and the outer query do not both have ORDER BY clauses.
 77157  //  **
 77158  //  **  (**)  Not implemented.  Subsumed into restriction (3).  Was previously
 77159  //  **        a separate restriction deriving from ticket #350.
 77160  //  **
 77161  //  **  (13)  The subquery and outer query do not both use LIMIT.
 77162  //  **
 77163  //  **  (14)  The subquery does not use OFFSET.
 77164  //  **
 77165  //  **  (15)  The outer query is not part of a compound select or the
 77166  //  **        subquery does not have a LIMIT clause.
 77167  //  **        (See ticket #2339 and ticket [02a8e81d44]).
 77168  //  **
 77169  //  **  (16)  The outer query is not an aggregate or the subquery does
 77170  //  **        not contain ORDER BY.  (Ticket #2942)  This used to not matter
 77171  //  **        until we introduced the group_concat() function.
 77172  //  **
 77173  //  **  (17)  The sub-query is not a compound select, or it is a UNION ALL
 77174  //  **        compound clause made up entirely of non-aggregate queries, and
 77175  //  **        the parent query:
 77176  //  **
 77177  //  **          * is not itself part of a compound select,
 77178  //  **          * is not an aggregate or DISTINCT query, and
 77179  //  **          * is not a join
 77180  //  **
 77181  //  **        The parent and sub-query may contain WHERE clauses. Subject to
 77182  //  **        rules (11), (13) and (14), they may also contain ORDER BY,
 77183  //  **        LIMIT and OFFSET clauses.  The subquery cannot use any compound
 77184  //  **        operator other than UNION ALL because all the other compound
 77185  //  **        operators have an implied DISTINCT which is disallowed by
 77186  //  **        restriction (4).
 77187  //  **
 77188  //  **        Also, each component of the sub-query must return the same number
 77189  //  **        of result columns. This is actually a requirement for any compound
 77190  //  **        SELECT statement, but all the code here does is make sure that no
 77191  //  **        such (illegal) sub-query is flattened. The caller will detect the
 77192  //  **        syntax error and return a detailed message.
 77193  //  **
 77194  //  **  (18)  If the sub-query is a compound select, then all terms of the
 77195  //  **        ORDER by clause of the parent must be simple references to
 77196  //  **        columns of the sub-query.
 77197  //  **
 77198  //  **  (19)  The subquery does not use LIMIT or the outer query does not
 77199  //  **        have a WHERE clause.
 77200  //  **
 77201  //  **  (20)  If the sub-query is a compound select, then it must not use
 77202  //  **        an ORDER BY clause.  Ticket #3773.  We could relax this constraint
 77203  //  **        somewhat by saying that the terms of the ORDER BY clause must
 77204  //  **        appear as unmodified result columns in the outer query.  But we
 77205  //  **        have other optimizations in mind to deal with that case.
 77206  //  **
 77207  //  **  (21)  The subquery does not use LIMIT or the outer query is not
 77208  //  **        DISTINCT.  (See ticket [752e1646fc]).
 77209  //  **
 77210  //  **  (22)  The subquery is not a recursive CTE.
 77211  //  **
 77212  //  **  (23)  The parent is not a recursive CTE, or the sub-query is not a
 77213  //  **        compound query. This restriction is because transforming the
 77214  //  **        parent to a compound query confuses the code that handles
 77215  //  **        recursive queries in multiSelect().
 77216  //  **
 77217  //  **  (24)  The subquery is not an aggregate that uses the built-in min() or
 77218  //  **        or max() functions.  (Without this restriction, a query like:
 77219  //  **        "SELECT x FROM (SELECT max(y), x FROM t1)" would not necessarily
 77220  //  **        return the value X for which Y was maximal.)
 77221  //  **
 77222  //  **
 77223  //  ** In this routine, the "p" parameter is a pointer to the outer query.
 77224  //  ** The subquery is p->pSrc->a[iFrom].  isAgg is true if the outer query
 77225  //  ** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates.
 77226  //  **
 77227  //  ** If flattening is not attempted, this routine is a no-op and returns 0.
 77228  //  ** If flattening is attempted this routine returns 1.
 77229  //  **
 77230  //  ** All of the expression analysis must occur on both the outer query and
 77231  //  ** the subquery before this routine runs.
 77232  //  */
 77233  func _flattenSubquery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iFrom int32, _isAgg int32, _subqueryIsAgg int32) (r0 int32) {
 77234  	var _iParent, _iNewParent, _isLeftJoin, _i, _17_ii, _25_nSubSrc int32
 77235  	var _zSavedAuthContext, _33_zName *int8
 77236  	var _25_jointype uint8
 77237  	var _db *Xsqlite3
 77238  	var _22_pTabToDel *XTable
 77239  	var _pSrc, _pSubSrc *XSrcList
 77240  	var _pSubitem *TSrcList_item
 77241  	var _pList, _19_pOrderBy, _34_pOrderBy *XExprList
 77242  	var _pParent, _pSub, _pSub1, _19_pNew, _19_pPrior *XSelect
 77243  	var _pWhere, _19_pLimit, _19_pOffset *XExpr
 77244  	var _23_pToplevel *XParse
 77245  	var _39_x XSubstContext
 77246  	_zSavedAuthContext = _pParse.XzAuthContext
 77247  	_iNewParent = int32(-1)
 77248  	_isLeftJoin = int32(0)
 77249  	_db = (*Xsqlite3)(_pParse.Xdb)
 77250  	func() {
 77251  		if _p == nil {
 77252  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119953), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(807)))
 77253  			crt.X__builtin_abort(tls)
 77254  		}
 77255  	}()
 77256  	func() {
 77257  		if (*XSelect)(_p.XpPrior) != nil {
 77258  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119954), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97765)))
 77259  			crt.X__builtin_abort(tls)
 77260  		}
 77261  	}()
 77262  	if (int32(_db.XdbOptFlags) & int32(1)) != int32(0) {
 77263  		return int32(0)
 77264  	}
 77265  	_pSrc = (*XSrcList)(_p.XpSrc)
 77266  	func() {
 77267  		if _pSrc == nil || _iFrom < int32(0) || _iFrom >= _pSrc.XnSrc {
 77268  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119957), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97778)))
 77269  			crt.X__builtin_abort(tls)
 77270  		}
 77271  	}()
 77272  	_pSubitem = elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iFrom))
 77273  	_iParent = _pSubitem.XiCursor
 77274  	_pSub = (*XSelect)(_pSubitem.XpSelect)
 77275  	func() {
 77276  		if _pSub == nil {
 77277  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119961), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97815)))
 77278  			crt.X__builtin_abort(tls)
 77279  		}
 77280  	}()
 77281  	if _subqueryIsAgg == 0 {
 77282  		goto _11
 77283  	}
 77284  	if _isAgg != 0 {
 77285  		return int32(0)
 77286  	}
 77287  	if _pSrc.XnSrc > int32(1) {
 77288  		return int32(0)
 77289  	}
 77290  	if (((_p.XpWhere != nil) && ((((*XExpr)(_p.XpWhere).Xflags) & uint32(2097152)) != (0))) || ((_sqlite3ExprListFlags(tls, (*XExprList)(_p.XpEList)) & uint32(2097152)) != (0))) || ((_sqlite3ExprListFlags(tls, (*XExprList)(_p.XpOrderBy)) & uint32(2097152)) != (0)) {
 77291  		return int32(0)
 77292  	}
 77293  _11:
 77294  	_pSubSrc = (*XSrcList)(_pSub.XpSrc)
 77295  	func() {
 77296  		if _pSubSrc == nil {
 77297  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119974), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97823)))
 77298  			crt.X__builtin_abort(tls)
 77299  		}
 77300  	}()
 77301  	if (_pSub.XpLimit != nil) && (_p.XpLimit != nil) {
 77302  		return int32(0)
 77303  	}
 77304  	if _pSub.XpOffset != nil {
 77305  		return int32(0)
 77306  	}
 77307  	if ((_p.XselFlags & uint32(256)) != (0)) && (_pSub.XpLimit != nil) {
 77308  		return int32(0)
 77309  	}
 77310  	if _pSubSrc.XnSrc == int32(0) {
 77311  		return int32(0)
 77312  	}
 77313  	if (_pSub.XselFlags & uint32(1)) != 0 {
 77314  		return int32(0)
 77315  	}
 77316  	if (_pSub.XpLimit != nil) && ((_pSrc.XnSrc > int32(1)) || _isAgg != 0) {
 77317  		return int32(0)
 77318  	}
 77319  	if ((_p.XselFlags & uint32(1)) != (0)) && _subqueryIsAgg != 0 {
 77320  		return int32(0)
 77321  	}
 77322  	if (_p.XpOrderBy != nil) && (_pSub.XpOrderBy != nil) {
 77323  		return int32(0)
 77324  	}
 77325  	if _isAgg != 0 && (_pSub.XpOrderBy != nil) {
 77326  		return int32(0)
 77327  	}
 77328  	if (_pSub.XpLimit != nil) && (_p.XpWhere != nil) {
 77329  		return int32(0)
 77330  	}
 77331  	if (_pSub.XpLimit != nil) && ((_p.XselFlags & uint32(1)) != (0)) {
 77332  		return int32(0)
 77333  	}
 77334  	if (_pSub.XselFlags & uint32(12288)) != 0 {
 77335  		return int32(0)
 77336  	}
 77337  	if ((_p.XselFlags & uint32(8192)) != 0) && (_pSub.XpPrior != nil) {
 77338  		return int32(0)
 77339  	}
 77340  	if (int32(_pSubitem.Xfg.Xjointype) & int32(32)) == int32(0) {
 77341  		goto _43
 77342  	}
 77343  	_isLeftJoin = int32(1)
 77344  	if (_pSubSrc.XnSrc > int32(1)) || _isAgg != 0 {
 77345  		return int32(0)
 77346  	}
 77347  _43:
 77348  	if _pSub.XpPrior == nil {
 77349  		goto _46
 77350  	}
 77351  	if _pSub.XpOrderBy != nil {
 77352  		return int32(0)
 77353  	}
 77354  	if (_isAgg != 0 || ((_p.XselFlags & uint32(1)) != (0))) || (_pSrc.XnSrc != int32(1)) {
 77355  		return int32(0)
 77356  	}
 77357  	_pSub1 = _pSub
 77358  _51:
 77359  	if _pSub1 == nil {
 77360  		goto _54
 77361  	}
 77362  	func() {
 77363  		if (*XSrcList)(_pSub.XpSrc) == nil {
 77364  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120059), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97831)))
 77365  			crt.X__builtin_abort(tls)
 77366  		}
 77367  	}()
 77368  	func() {
 77369  		if ((*XExprList)(_pSub.XpEList).XnExpr) != ((*XExprList)(_pSub1.XpEList).XnExpr) {
 77370  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120060), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97845)))
 77371  			crt.X__builtin_abort(tls)
 77372  		}
 77373  	}()
 77374  	if (((_pSub1.XselFlags & uint32(9)) != (0)) || ((_pSub1.XpPrior != nil) && (int32(_pSub1.Xop) != int32(116)))) || (((*XSrcList)(_pSub1.XpSrc).XnSrc) < int32(1)) {
 77375  		return int32(0)
 77376  	}
 77377  	_pSub1 = (*XSelect)(_pSub1.XpPrior)
 77378  	goto _51
 77379  _54:
 77380  	if _p.XpOrderBy == nil {
 77381  		goto _63
 77382  	}
 77383  	_17_ii = int32(0)
 77384  _64:
 77385  	if _17_ii >= ((*XExprList)(_p.XpOrderBy).XnExpr) {
 77386  		goto _67
 77387  	}
 77388  	if int32((*t73)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpOrderBy).Xa))), uintptr(_17_ii)).Xu))).XiOrderByCol) == int32(0) {
 77389  		return int32(0)
 77390  	}
 77391  	_17_ii += 1
 77392  	goto _64
 77393  _67:
 77394  _63:
 77395  _46:
 77396  	if (Xsqlite3SelectTrace & int32(1)) != 0 {
 77397  		_sqlite3DebugPrintf(tls, func() *int8 {
 77398  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 77399  			return str(97887)
 77400  		}(), unsafe.Pointer(&_pSub.XzSelName), unsafe.Pointer(_pSub), _iFrom)
 77401  	}
 77402  	_pParse.XzAuthContext = _pSubitem.XzName
 77403  	_i = _sqlite3AuthCheck(tls, _pParse, int32(21), nil, nil, nil)
 77404  	_pParse.XzAuthContext = _zSavedAuthContext
 77405  	_pSub = (*XSelect)(_pSub.XpPrior)
 77406  _70:
 77407  	if _pSub == nil {
 77408  		goto _73
 77409  	}
 77410  	_19_pOrderBy = (*XExprList)(_p.XpOrderBy)
 77411  	_19_pLimit = (*XExpr)(_p.XpLimit)
 77412  	_19_pOffset = (*XExpr)(_p.XpOffset)
 77413  	_19_pPrior = (*XSelect)(_p.XpPrior)
 77414  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = nil
 77415  	*(**XSrcList)(unsafe.Pointer(&_p.XpSrc)) = nil
 77416  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 77417  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = nil
 77418  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = nil
 77419  	_19_pNew = _sqlite3SelectDup(tls, _db, _p, int32(0))
 77420  	_sqlite3SelectSetName(tls, _19_pNew, (*int8)(unsafe.Pointer(&_pSub.XzSelName)))
 77421  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = _19_pOffset
 77422  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = _19_pLimit
 77423  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = _19_pOrderBy
 77424  	*(**XSrcList)(unsafe.Pointer(&_p.XpSrc)) = _pSrc
 77425  	_p.Xop = uint8(116)
 77426  	if _19_pNew == nil {
 77427  		*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _19_pPrior
 77428  		goto _75
 77429  	}
 77430  	*(**XSelect)(unsafe.Pointer(&_19_pNew.XpPrior)) = _19_pPrior
 77431  	if _19_pPrior != nil {
 77432  		*(**XSelect)(unsafe.Pointer(&_19_pPrior.XpNext)) = _19_pNew
 77433  	}
 77434  	*(**XSelect)(unsafe.Pointer(&_19_pNew.XpNext)) = _p
 77435  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _19_pNew
 77436  	if (Xsqlite3SelectTrace & int32(2)) != 0 {
 77437  		_sqlite3DebugPrintf(tls, func() *int8 {
 77438  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 77439  			return str(97915)
 77440  		}(), unsafe.Pointer(&_19_pNew.XzSelName), unsafe.Pointer(_19_pNew))
 77441  	}
 77442  _75:
 77443  	if _db.XmallocFailed != 0 {
 77444  		return int32(1)
 77445  	}
 77446  	_pSub = (*XSelect)(_pSub.XpPrior)
 77447  	goto _70
 77448  _73:
 77449  	_pSub = store98(&_pSub1, (*XSelect)(_pSubitem.XpSelect))
 77450  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubitem.XzDatabase))
 77451  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubitem.XzName))
 77452  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubitem.XzAlias))
 77453  	_pSubitem.XzDatabase = nil
 77454  	_pSubitem.XzName = nil
 77455  	_pSubitem.XzAlias = nil
 77456  	*(**XSelect)(unsafe.Pointer(&_pSubitem.XpSelect)) = nil
 77457  	if func() int32 {
 77458  		if (*XTable)(_pSubitem.XpTab) != nil {
 77459  			return int32(1)
 77460  		}
 77461  		return func() int32 {
 77462  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120177), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(4809)))
 77463  			crt.X__builtin_abort(tls)
 77464  			return int32(0)
 77465  		}()
 77466  	}() == 0 {
 77467  		goto _81
 77468  	}
 77469  	_22_pTabToDel = (*XTable)(_pSubitem.XpTab)
 77470  	if _22_pTabToDel.XnTabRef == uint32(1) {
 77471  		_23_pToplevel = func() *XParse {
 77472  			if _pParse.XpToplevel != nil {
 77473  				return (*XParse)(_pParse.XpToplevel)
 77474  			}
 77475  			return _pParse
 77476  		}()
 77477  		*(**XTable)(unsafe.Pointer(&_22_pTabToDel.XpNextZombie)) = (*XTable)(_23_pToplevel.XpZombieTab)
 77478  		*(**XTable)(unsafe.Pointer(&_23_pToplevel.XpZombieTab)) = _22_pTabToDel
 77479  		goto _85
 77480  	}
 77481  	_22_pTabToDel.XnTabRef -= 1
 77482  _85:
 77483  	*(**XTable)(unsafe.Pointer(&_pSubitem.XpTab)) = nil
 77484  _81:
 77485  	_pParent = _p
 77486  _86:
 77487  	if _pParent == nil {
 77488  		goto _89
 77489  	}
 77490  	_25_jointype = 0
 77491  	_pSubSrc = (*XSrcList)(_pSub.XpSrc)
 77492  	_25_nSubSrc = _pSubSrc.XnSrc
 77493  	_pSrc = (*XSrcList)(_pParent.XpSrc)
 77494  	if _pSrc != nil {
 77495  		func() {
 77496  			if _pParent != _p {
 77497  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120210), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97966)))
 77498  				crt.X__builtin_abort(tls)
 77499  			}
 77500  		}()
 77501  		_25_jointype = _pSubitem.Xfg.Xjointype
 77502  		goto _93
 77503  	}
 77504  	func() {
 77505  		if _pParent == _p {
 77506  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120213), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97977)))
 77507  			crt.X__builtin_abort(tls)
 77508  		}
 77509  	}()
 77510  	_pSrc = store99((**XSrcList)(unsafe.Pointer(&_pParent.XpSrc)), _sqlite3SrcListAppend(tls, _db, nil, nil, nil))
 77511  	if _pSrc == nil {
 77512  		func() {
 77513  			if _db.XmallocFailed == 0 {
 77514  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120216), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(47803)))
 77515  				crt.X__builtin_abort(tls)
 77516  			}
 77517  		}()
 77518  		goto _89
 77519  	}
 77520  _93:
 77521  	if _25_nSubSrc <= int32(1) {
 77522  		goto _99
 77523  	}
 77524  	*(**XSrcList)(unsafe.Pointer(&_pParent.XpSrc)) = store99(&_pSrc, _sqlite3SrcListEnlarge(tls, _db, _pSrc, _25_nSubSrc-int32(1), _iFrom+int32(1)))
 77525  	if _db.XmallocFailed != 0 {
 77526  		goto _89
 77527  	}
 77528  _99:
 77529  	_i = int32(0)
 77530  _101:
 77531  	if _i >= _25_nSubSrc {
 77532  		goto _104
 77533  	}
 77534  	_sqlite3IdListDelete(tls, _db, (*XIdList)(elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i+_iFrom)).XpUsing))
 77535  	func() {
 77536  		if int32((uint32(((elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i+_iFrom)).Xfg).XnotIndexed)>>2)<<31)>>31) != int32(0) {
 77537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120248), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97988)))
 77538  			crt.X__builtin_abort(tls)
 77539  		}
 77540  	}()
 77541  	*elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i+_iFrom)) = *elem6((*TSrcList_item)(unsafe.Pointer(&_pSubSrc.Xa)), uintptr(_i))
 77542  	_iNewParent = elem6((*TSrcList_item)(unsafe.Pointer(&_pSubSrc.Xa)), uintptr(_i)).XiCursor
 77543  	crt.Xmemset(tls, unsafe.Pointer(elem6((*TSrcList_item)(unsafe.Pointer(&_pSubSrc.Xa)), uintptr(_i))), int32(0), uint64(112))
 77544  	_i += 1
 77545  	goto _101
 77546  _104:
 77547  	(elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iFrom)).Xfg).Xjointype = _25_jointype
 77548  	_pList = (*XExprList)(_pParent.XpEList)
 77549  	_i = int32(0)
 77550  _107:
 77551  	if _i >= _pList.XnExpr {
 77552  		goto _110
 77553  	}
 77554  	if (elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XzName) == nil {
 77555  		_33_zName = _sqlite3DbStrDup(tls, _db, elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XzSpan)
 77556  		_sqlite3Dequote(tls, _33_zName)
 77557  		elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XzName = _33_zName
 77558  	}
 77559  	_i += 1
 77560  	goto _107
 77561  _110:
 77562  	if _pSub.XpOrderBy == nil {
 77563  		goto _112
 77564  	}
 77565  	_34_pOrderBy = (*XExprList)(_pSub.XpOrderBy)
 77566  	_i = int32(0)
 77567  _113:
 77568  	if _i >= _34_pOrderBy.XnExpr {
 77569  		goto _116
 77570  	}
 77571  	(*t73)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&_34_pOrderBy.Xa)), uintptr(_i)).Xu))).XiOrderByCol = 0
 77572  	_i += 1
 77573  	goto _113
 77574  _116:
 77575  	func() {
 77576  		if (*XExprList)(_pParent.XpOrderBy) != nil {
 77577  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120290), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(98021)))
 77578  			crt.X__builtin_abort(tls)
 77579  		}
 77580  	}()
 77581  	func() {
 77582  		if (*XSelect)(_pSub.XpPrior) != nil {
 77583  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120291), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(98042)))
 77584  			crt.X__builtin_abort(tls)
 77585  		}
 77586  	}()
 77587  	*(**XExprList)(unsafe.Pointer(&_pParent.XpOrderBy)) = _34_pOrderBy
 77588  	*(**XExprList)(unsafe.Pointer(&_pSub.XpOrderBy)) = nil
 77589  _112:
 77590  	_pWhere = _sqlite3ExprDup(tls, _db, (*XExpr)(_pSub.XpWhere), int32(0))
 77591  	if _isLeftJoin > int32(0) {
 77592  		_setJoinExpr(tls, _pWhere, _iNewParent)
 77593  	}
 77594  	if _subqueryIsAgg != 0 {
 77595  		func() {
 77596  			if (*XExpr)(_pParent.XpHaving) != nil {
 77597  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120300), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(98058)))
 77598  				crt.X__builtin_abort(tls)
 77599  			}
 77600  		}()
 77601  		*(**XExpr)(unsafe.Pointer(&_pParent.XpHaving)) = (*XExpr)(_pParent.XpWhere)
 77602  		*(**XExpr)(unsafe.Pointer(&_pParent.XpWhere)) = _pWhere
 77603  		*(**XExpr)(unsafe.Pointer(&_pParent.XpHaving)) = _sqlite3ExprAnd(tls, _db, _sqlite3ExprDup(tls, _db, (*XExpr)(_pSub.XpHaving), int32(0)), (*XExpr)(_pParent.XpHaving))
 77604  		func() {
 77605  			if (*XExprList)(_pParent.XpGroupBy) != nil {
 77606  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120306), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(98078)))
 77607  				crt.X__builtin_abort(tls)
 77608  			}
 77609  		}()
 77610  		*(**XExprList)(unsafe.Pointer(&_pParent.XpGroupBy)) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_pSub.XpGroupBy), int32(0))
 77611  		goto _127
 77612  	}
 77613  	*(**XExpr)(unsafe.Pointer(&_pParent.XpWhere)) = _sqlite3ExprAnd(tls, _db, _pWhere, (*XExpr)(_pParent.XpWhere))
 77614  _127:
 77615  	if int32(_db.XmallocFailed) == int32(0) {
 77616  		*(**XParse)(unsafe.Pointer(&_39_x.XpParse)) = _pParse
 77617  		_39_x.XiTable = _iParent
 77618  		_39_x.XiNewTable = _iNewParent
 77619  		_39_x.XisLeftJoin = _isLeftJoin
 77620  		*(**XExprList)(unsafe.Pointer(&_39_x.XpEList)) = (*XExprList)(_pSub.XpEList)
 77621  		_substSelect(tls, &_39_x, _pParent, int32(0))
 77622  	}
 77623  	_pParent.XselFlags |= _pSub.XselFlags & uint32(1)
 77624  	if _pSub.XpLimit != nil {
 77625  		*(**XExpr)(unsafe.Pointer(&_pParent.XpLimit)) = (*XExpr)(_pSub.XpLimit)
 77626  		*(**XExpr)(unsafe.Pointer(&_pSub.XpLimit)) = nil
 77627  	}
 77628  	*func() **XSelect { _pParent = (*XSelect)(_pParent.XpPrior); return &_pSub }() = (*XSelect)(_pSub.XpPrior)
 77629  	goto _86
 77630  _89:
 77631  	_sqlite3SelectDelete(tls, _db, _pSub1)
 77632  	if (Xsqlite3SelectTrace & int32(256)) == 0 {
 77633  		goto _130
 77634  	}
 77635  	if (Xsqlite3SelectTrace & int32(256)) != 0 {
 77636  		_sqlite3DebugPrintf(tls, func() *int8 {
 77637  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 77638  			return str(98099)
 77639  		}())
 77640  	}
 77641  	_sqlite3TreeViewSelect(tls, nil, _p, 0)
 77642  _130:
 77643  	return int32(1)
 77644  }
 77645  
 77646  var _flattenSubqueryØ00__func__Ø000 [16]int8
 77647  
 77648  func init() {
 77649  	crt.Xstrncpy(nil, &_flattenSubqueryØ00__func__Ø000[0], str(98118), 16)
 77650  }
 77651  
 77652  func _substSelect(tls *crt.TLS, _pSubst *XSubstContext, _p *XSelect, _doPrior int32) {
 77653  	var _i int32
 77654  	var _pSrc *XSrcList
 77655  	var _pItem *TSrcList_item
 77656  	if _p == nil {
 77657  		return
 77658  	}
 77659  _0:
 77660  	_substExprList(tls, _pSubst, (*XExprList)(_p.XpEList))
 77661  	_substExprList(tls, _pSubst, (*XExprList)(_p.XpGroupBy))
 77662  	_substExprList(tls, _pSubst, (*XExprList)(_p.XpOrderBy))
 77663  	*(**XExpr)(unsafe.Pointer(&_p.XpHaving)) = _substExpr(tls, _pSubst, (*XExpr)(_p.XpHaving))
 77664  	*(**XExpr)(unsafe.Pointer(&_p.XpWhere)) = _substExpr(tls, _pSubst, (*XExpr)(_p.XpWhere))
 77665  	_pSrc = (*XSrcList)(_p.XpSrc)
 77666  	func() {
 77667  		if _pSrc == nil {
 77668  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119777), unsafe.Pointer(&_substSelectØ00__func__Ø000), unsafe.Pointer(str(47776)))
 77669  			crt.X__builtin_abort(tls)
 77670  		}
 77671  	}()
 77672  	*func() **TSrcList_item { _i = _pSrc.XnSrc; return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa))
 77673  _4:
 77674  	if _i <= int32(0) {
 77675  		goto _7
 77676  	}
 77677  	_substSelect(tls, _pSubst, (*XSelect)(_pItem.XpSelect), int32(1))
 77678  	if ((uint32((_pItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0 {
 77679  		_substExprList(tls, _pSubst, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pItem.Xu1))))
 77680  	}
 77681  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i -= 1; return &_pItem }())) += uintptr(112)
 77682  	goto _4
 77683  _7:
 77684  	if _doPrior != 0 && (store98(&_p, (*XSelect)(_p.XpPrior)) != nil) {
 77685  		goto _0
 77686  	}
 77687  }
 77688  
 77689  // C comment
 77690  //  /* Forward Declarations */
 77691  func _substExprList(tls *crt.TLS, _pSubst *XSubstContext, _pList *XExprList) {
 77692  	var _i int32
 77693  	if _pList == nil {
 77694  		return
 77695  	}
 77696  	_i = int32(0)
 77697  _1:
 77698  	if _i >= _pList.XnExpr {
 77699  		goto _4
 77700  	}
 77701  	*(**XExpr)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))) = _substExpr(tls, _pSubst, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))
 77702  	_i += 1
 77703  	goto _1
 77704  _4:
 77705  }
 77706  
 77707  // C comment
 77708  //  /*
 77709  //  ** Scan through the expression pExpr.  Replace every reference to
 77710  //  ** a column in table number iTable with a copy of the iColumn-th
 77711  //  ** entry in pEList.  (But leave references to the ROWID column
 77712  //  ** unchanged.)
 77713  //  **
 77714  //  ** This routine is part of the flattening procedure.  A subquery
 77715  //  ** whose result set is defined by pEList appears as entry in the
 77716  //  ** FROM clause of a SELECT such that the VDBE cursor assigned to that
 77717  //  ** FORM clause entry is iTable.  This routine makes the necessary
 77718  //  ** changes to pExpr so that it refers directly to the source table
 77719  //  ** of the subquery rather the result set of the subquery.
 77720  //  */
 77721  func _substExpr(tls *crt.TLS, _pSubst *XSubstContext, _pExpr *XExpr) (r0 *XExpr) {
 77722  	var _6_db *Xsqlite3
 77723  	var _4_pNew, _4_pCopy *XExpr
 77724  	var _4_ifNullRow XExpr
 77725  	if _pExpr == nil {
 77726  		return nil
 77727  	}
 77728  	if ((_pExpr.Xflags & uint32(1)) != (0)) && (int32(_pExpr.XiRightJoinTable) == _pSubst.XiTable) {
 77729  		_pExpr.XiRightJoinTable = int16(_pSubst.XiNewTable)
 77730  	}
 77731  	if int32(_pExpr.Xop) != int32(152) || _pExpr.XiTable != _pSubst.XiTable {
 77732  		goto _4
 77733  	}
 77734  	if int32(_pExpr.XiColumn) < int32(0) {
 77735  		_pExpr.Xop = uint8(101)
 77736  		goto _6
 77737  	}
 77738  	_4_pCopy = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSubst.XpEList).Xa))), uintptr(_pExpr.XiColumn)).XpExpr)
 77739  	func() {
 77740  		if (*XExprList)(_pSubst.XpEList) == nil || int32(_pExpr.XiColumn) >= ((*XExprList)(_pSubst.XpEList).XnExpr) {
 77741  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119715), unsafe.Pointer(&_substExprØ00__func__Ø000), unsafe.Pointer(str(98134)))
 77742  			crt.X__builtin_abort(tls)
 77743  		}
 77744  	}()
 77745  	func() {
 77746  		if (*XExpr)(_pExpr.XpLeft) != nil || (*XExpr)(_pExpr.XpRight) != nil {
 77747  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119716), unsafe.Pointer(&_substExprØ00__func__Ø000), unsafe.Pointer(str(96251)))
 77748  			crt.X__builtin_abort(tls)
 77749  		}
 77750  	}()
 77751  	if _sqlite3ExprIsVector(tls, _4_pCopy) != 0 {
 77752  		_sqlite3VectorErrorMsg(tls, (*XParse)(_pSubst.XpParse), _4_pCopy)
 77753  		goto _14
 77754  	}
 77755  	_6_db = (*Xsqlite3)((*XParse)(_pSubst.XpParse).Xdb)
 77756  	if _pSubst.XisLeftJoin != 0 && (int32(_4_pCopy.Xop) != int32(152)) {
 77757  		crt.Xmemset(tls, unsafe.Pointer(&_4_ifNullRow), int32(0), uint64(72))
 77758  		_4_ifNullRow.Xop = uint8(160)
 77759  		*(**XExpr)(unsafe.Pointer(&_4_ifNullRow.XpLeft)) = _4_pCopy
 77760  		_4_ifNullRow.XiTable = _pSubst.XiNewTable
 77761  		_4_pCopy = &_4_ifNullRow
 77762  	}
 77763  	_4_pNew = _sqlite3ExprDup(tls, _6_db, _4_pCopy, int32(0))
 77764  	if (_4_pNew != nil) && ((_pExpr.Xflags & uint32(1)) != 0) {
 77765  		_4_pNew.XiRightJoinTable = _pExpr.XiRightJoinTable
 77766  		_4_pNew.Xflags |= uint32(1)
 77767  	}
 77768  	_sqlite3ExprDelete(tls, _6_db, _pExpr)
 77769  	_pExpr = _4_pNew
 77770  _14:
 77771  _6:
 77772  	goto _19
 77773  _4:
 77774  	if (int32(_pExpr.Xop) == int32(160)) && (_pExpr.XiTable == _pSubst.XiTable) {
 77775  		_pExpr.XiTable = _pSubst.XiNewTable
 77776  	}
 77777  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpLeft)) = _substExpr(tls, _pSubst, (*XExpr)(_pExpr.XpLeft))
 77778  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpRight)) = _substExpr(tls, _pSubst, (*XExpr)(_pExpr.XpRight))
 77779  	if (_pExpr.Xflags & uint32(2048)) != (0) {
 77780  		_substSelect(tls, _pSubst, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), int32(1))
 77781  		goto _23
 77782  	}
 77783  	_substExprList(tls, _pSubst, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))))
 77784  _23:
 77785  _19:
 77786  	return _pExpr
 77787  }
 77788  
 77789  var _substExprØ00__func__Ø000 [10]int8
 77790  
 77791  func init() {
 77792  	crt.Xstrncpy(nil, &_substExprØ00__func__Ø000[0], str(98192), 10)
 77793  }
 77794  
 77795  func _sqlite3VectorErrorMsg(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) {
 77796  	if (_pExpr.Xflags & uint32(2048)) != 0 {
 77797  		_sqlite3SubselectError(tls, _pParse, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpEList).XnExpr, int32(1))
 77798  		goto _1
 77799  	}
 77800  	_sqlite3ErrorMsg(tls, _pParse, str(43136))
 77801  _1:
 77802  }
 77803  
 77804  func _sqlite3SubselectError(tls *crt.TLS, _pParse *XParse, _nActual int32, _nExpect int32) {
 77805  	var _zFmt *int8
 77806  	_zFmt = str(98202)
 77807  	_sqlite3ErrorMsg(tls, _pParse, _zFmt, _nActual, _nExpect)
 77808  }
 77809  
 77810  var _substSelectØ00__func__Ø000 [12]int8
 77811  
 77812  func init() {
 77813  	crt.Xstrncpy(nil, &_substSelectØ00__func__Ø000[0], str(98246), 12)
 77814  }
 77815  
 77816  // C comment
 77817  //  /*
 77818  //  ** This routine is called to process a compound query form from
 77819  //  ** two or more separate queries using UNION, UNION ALL, EXCEPT, or
 77820  //  ** INTERSECT
 77821  //  **
 77822  //  ** "p" points to the right-most of the two queries.  the query on the
 77823  //  ** left is p->pPrior.  The left query could also be a compound query
 77824  //  ** in which case this routine will be called recursively.
 77825  //  **
 77826  //  ** The results of the total query are to be written into a destination
 77827  //  ** of type eDest with parameter iParm.
 77828  //  **
 77829  //  ** Example 1:  Consider a three-way compound SQL statement.
 77830  //  **
 77831  //  **     SELECT a FROM t1 UNION SELECT b FROM t2 UNION SELECT c FROM t3
 77832  //  **
 77833  //  ** This statement is parsed up as follows:
 77834  //  **
 77835  //  **     SELECT c FROM t3
 77836  //  **      |
 77837  //  **      `----->  SELECT b FROM t2
 77838  //  **                |
 77839  //  **                `------>  SELECT a FROM t1
 77840  //  **
 77841  //  ** The arrows in the diagram above represent the Select.pPrior pointer.
 77842  //  ** So if this routine is called with p equal to the t3 query, then
 77843  //  ** pPrior will be the t2 query.  p->op will be TK_UNION in this case.
 77844  //  **
 77845  //  ** Notice that because of the way SQLite parses compound SELECTs, the
 77846  //  ** individual selects always group from left to right.
 77847  //  */
 77848  func _multiSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
 77849  	var _rc, _iSub1, _iSub2, _8_addr, _8_nLimit, _14_unionTab, _14_priorOp, _14_addr, _21_iCont, _21_iBreak, _21_iStart, _23_tab1, _23_tab2, _23_iCont, _23_iBreak, _23_iStart, _23_addr, _23_r1, _26_i, _26_nCol, _31_addr int32
 77850  	var _14_op uint8
 77851  	var _db *Xsqlite3
 77852  	var _v *TVdbe
 77853  	var _pPrior, _pDelete, _22_pFirst, _25_pFirst, _26_pLoop *XSelect
 77854  	var _14_pLimit, _14_pOffset, _23_pLimit, _23_pOffset *XExpr
 77855  	var _26_pKeyInfo *XKeyInfo
 77856  	var _26_apColl **XCollSeq
 77857  	var _dest, _14_uniondest, _23_intersectdest XSelectDest
 77858  	_rc = int32(0)
 77859  	_pDelete = nil
 77860  	_iSub1 = int32(0)
 77861  	_iSub2 = int32(0)
 77862  	func() {
 77863  		if _p == nil || _p.XpPrior == nil {
 77864  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118776), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98258)))
 77865  			crt.X__builtin_abort(tls)
 77866  		}
 77867  	}()
 77868  	func() {
 77869  		if (_p.XselFlags&uint32(8192)) != (0) && int32(_p.Xop) != int32(116) && int32(_p.Xop) != int32(115) {
 77870  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118777), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98273)))
 77871  			crt.X__builtin_abort(tls)
 77872  		}
 77873  	}()
 77874  	_db = (*Xsqlite3)(_pParse.Xdb)
 77875  	_pPrior = (*XSelect)(_p.XpPrior)
 77876  	_dest = *_pDest
 77877  	if _pPrior.XpOrderBy != nil {
 77878  		_sqlite3ErrorMsg(tls, _pParse, str(98341), unsafe.Pointer(_selectOpName(tls, int32(_p.Xop))))
 77879  		_rc = int32(1)
 77880  		goto _multi_select_end
 77881  	}
 77882  	if _pPrior.XpLimit != nil {
 77883  		_sqlite3ErrorMsg(tls, _pParse, str(98389), unsafe.Pointer(_selectOpName(tls, int32(_p.Xop))))
 77884  		_rc = int32(1)
 77885  		goto _multi_select_end
 77886  	}
 77887  	_v = _sqlite3GetVdbe(tls, _pParse)
 77888  	func() {
 77889  		if _v == nil {
 77890  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118795), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(42019)))
 77891  			crt.X__builtin_abort(tls)
 77892  		}
 77893  	}()
 77894  	if int32(_dest.XeDest) == int32(12) {
 77895  		func() {
 77896  			if _p.XpEList == nil {
 77897  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118800), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98434)))
 77898  				crt.X__builtin_abort(tls)
 77899  			}
 77900  		}()
 77901  		_sqlite3VdbeAddOp2(tls, _v, int32(110), _dest.XiSDParm, (*XExprList)(_p.XpEList).XnExpr)
 77902  		_dest.XeDest = uint8(14)
 77903  	}
 77904  	if (_p.XselFlags & uint32(1024)) != 0 {
 77905  		_rc = _multiSelectValues(tls, _pParse, _p, &_dest)
 77906  		goto _multi_select_end
 77907  	}
 77908  	func() {
 77909  		if _p.XpEList == nil || _pPrior.XpEList == nil {
 77910  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118815), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98444)))
 77911  			crt.X__builtin_abort(tls)
 77912  		}
 77913  	}()
 77914  	func() {
 77915  		if ((*XExprList)(_p.XpEList).XnExpr) != ((*XExprList)(_pPrior.XpEList).XnExpr) {
 77916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118816), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98472)))
 77917  			crt.X__builtin_abort(tls)
 77918  		}
 77919  	}()
 77920  	if (_p.XselFlags & uint32(8192)) != 0 {
 77921  		_generateWithRecursiveQuery(tls, _pParse, _p, &_dest)
 77922  		goto _39
 77923  	}
 77924  	if _p.XpOrderBy != nil {
 77925  		return _multiSelectOrderBy(tls, _pParse, _p, _pDest)
 77926  	}
 77927  	switch int32(_p.Xop) {
 77928  	case int32(115):
 77929  		goto _26
 77930  	case int32(116):
 77931  		goto _25
 77932  	case int32(117):
 77933  		goto _26
 77934  	default:
 77935  		goto _28
 77936  	}
 77937  
 77938  _25:
 77939  	_8_addr = int32(0)
 77940  	func() {
 77941  		if _pPrior.XpLimit != nil {
 77942  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118836), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98512)))
 77943  			crt.X__builtin_abort(tls)
 77944  		}
 77945  	}()
 77946  	_pPrior.XiLimit = _p.XiLimit
 77947  	_pPrior.XiOffset = _p.XiOffset
 77948  	*(**XExpr)(unsafe.Pointer(&_pPrior.XpLimit)) = (*XExpr)(_p.XpLimit)
 77949  	*(**XExpr)(unsafe.Pointer(&_pPrior.XpOffset)) = (*XExpr)(_p.XpOffset)
 77950  	_iSub1 = _pParse.XiNextSelectId
 77951  	_rc = _sqlite3Select(tls, _pParse, _pPrior, &_dest)
 77952  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = nil
 77953  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = nil
 77954  	if _rc != 0 {
 77955  		goto _multi_select_end
 77956  	}
 77957  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 77958  	_p.XiLimit = _pPrior.XiLimit
 77959  	_p.XiOffset = _pPrior.XiOffset
 77960  	if _p.XiLimit == 0 {
 77961  		goto _32
 77962  	}
 77963  	_8_addr = _sqlite3VdbeAddOp1(tls, _v, int32(22), _p.XiLimit)
 77964  	_sqlite3VdbeComment(tls, _v, str(98528))
 77965  	if _p.XiOffset != 0 {
 77966  		_sqlite3VdbeAddOp3(tls, _v, int32(149), _p.XiLimit, _p.XiOffset+int32(1), _p.XiOffset)
 77967  	}
 77968  _32:
 77969  	_iSub2 = _pParse.XiNextSelectId
 77970  	_rc = _sqlite3Select(tls, _pParse, _p, &_dest)
 77971  	_pDelete = (*XSelect)(_p.XpPrior)
 77972  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pPrior
 77973  	_p.XnSelectRow = _sqlite3LogEstAdd(tls, _p.XnSelectRow, _pPrior.XnSelectRow)
 77974  	if (((_pPrior.XpLimit != nil) && _sqlite3ExprIsInteger(tls, (*XExpr)(_pPrior.XpLimit), &_8_nLimit) != 0) && (_8_nLimit > int32(0))) && (int32(_p.XnSelectRow) > int32(_sqlite3LogEst(tls, uint64(_8_nLimit)))) {
 77975  		_p.XnSelectRow = _sqlite3LogEst(tls, uint64(_8_nLimit))
 77976  	}
 77977  	if _8_addr != 0 {
 77978  		_sqlite3VdbeJumpHere(tls, _v, _8_addr)
 77979  	}
 77980  	goto _39
 77981  _26:
 77982  	_14_op = uint8(0)
 77983  	_14_priorOp = int32(1)
 77984  	if int32(_dest.XeDest) == _14_priorOp {
 77985  		func() {
 77986  			if (*XExpr)(_p.XpLimit) != nil {
 77987  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118892), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98556)))
 77988  				crt.X__builtin_abort(tls)
 77989  			}
 77990  		}()
 77991  		func() {
 77992  			if (*XExpr)(_p.XpOffset) != nil {
 77993  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118893), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98569)))
 77994  				crt.X__builtin_abort(tls)
 77995  			}
 77996  		}()
 77997  		_14_unionTab = _dest.XiSDParm
 77998  		goto _45
 77999  	}
 78000  	_14_unionTab = postInc2(&_pParse.XnTab, 1)
 78001  	func() {
 78002  		if (*XExprList)(_p.XpOrderBy) != nil {
 78003  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118900), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98583)))
 78004  			crt.X__builtin_abort(tls)
 78005  		}
 78006  	}()
 78007  	_14_addr = _sqlite3VdbeAddOp2(tls, _v, int32(110), _14_unionTab, int32(0))
 78008  	func() {
 78009  		if (*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), 0)) != int32(-1) {
 78010  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118902), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98598)))
 78011  			crt.X__builtin_abort(tls)
 78012  		}
 78013  	}()
 78014  	*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), 0) = _14_addr
 78015  	_findRightmost(tls, _p).XselFlags |= uint32(32)
 78016  	func() {
 78017  		if _p.XpEList == nil {
 78018  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118905), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98434)))
 78019  			crt.X__builtin_abort(tls)
 78020  		}
 78021  	}()
 78022  _45:
 78023  	func() {
 78024  		if _pPrior.XpOrderBy != nil {
 78025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118910), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98623)))
 78026  			crt.X__builtin_abort(tls)
 78027  		}
 78028  	}()
 78029  	_sqlite3SelectDestInit(tls, &_14_uniondest, _14_priorOp, _14_unionTab)
 78030  	_iSub1 = _pParse.XiNextSelectId
 78031  	_rc = _sqlite3Select(tls, _pParse, _pPrior, &_14_uniondest)
 78032  	if _rc != 0 {
 78033  		goto _multi_select_end
 78034  	}
 78035  	if int32(_p.Xop) == int32(117) {
 78036  		_14_op = uint8(2)
 78037  		goto _56
 78038  	}
 78039  	func() {
 78040  		if int32(_p.Xop) != int32(115) {
 78041  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118923), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98641)))
 78042  			crt.X__builtin_abort(tls)
 78043  		}
 78044  	}()
 78045  	_14_op = uint8(1)
 78046  _56:
 78047  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 78048  	_14_pLimit = (*XExpr)(_p.XpLimit)
 78049  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = nil
 78050  	_14_pOffset = (*XExpr)(_p.XpOffset)
 78051  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = nil
 78052  	_14_uniondest.XeDest = _14_op
 78053  	_iSub2 = _pParse.XiNextSelectId
 78054  	_rc = _sqlite3Select(tls, _pParse, _p, &_14_uniondest)
 78055  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XpOrderBy))
 78056  	_pDelete = (*XSelect)(_p.XpPrior)
 78057  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pPrior
 78058  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = nil
 78059  	if int32(_p.Xop) == int32(115) {
 78060  		_p.XnSelectRow = _sqlite3LogEstAdd(tls, _p.XnSelectRow, _pPrior.XnSelectRow)
 78061  	}
 78062  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpLimit))
 78063  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = _14_pLimit
 78064  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = _14_pOffset
 78065  	_p.XiLimit = int32(0)
 78066  	_p.XiOffset = int32(0)
 78067  	func() {
 78068  		if _14_unionTab != _dest.XiSDParm && int32(_dest.XeDest) == _14_priorOp {
 78069  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118953), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98657)))
 78070  			crt.X__builtin_abort(tls)
 78071  		}
 78072  	}()
 78073  	if int32(_dest.XeDest) == _14_priorOp {
 78074  		goto _63
 78075  	}
 78076  	func() {
 78077  		if _p.XpEList == nil {
 78078  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118956), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98434)))
 78079  			crt.X__builtin_abort(tls)
 78080  		}
 78081  	}()
 78082  	if int32(_dest.XeDest) != int32(9) {
 78083  		goto _66
 78084  	}
 78085  	_22_pFirst = _p
 78086  _67:
 78087  	if _22_pFirst.XpPrior != nil {
 78088  		_22_pFirst = (*XSelect)(_22_pFirst.XpPrior)
 78089  		goto _67
 78090  	}
 78091  	_generateColumnNames(tls, _pParse, (*XSrcList)(_22_pFirst.XpSrc), (*XExprList)(_22_pFirst.XpEList))
 78092  _66:
 78093  	_21_iBreak = _sqlite3VdbeMakeLabel(tls, _v)
 78094  	_21_iCont = _sqlite3VdbeMakeLabel(tls, _v)
 78095  	_computeLimitRegisters(tls, _pParse, _p, _21_iBreak)
 78096  	_sqlite3VdbeAddOp2(tls, _v, int32(37), _14_unionTab, _21_iBreak)
 78097  	_21_iStart = _sqlite3VdbeCurrentAddr(tls, _v)
 78098  	_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.XpEList), _14_unionTab, nil, nil, &_dest, _21_iCont, _21_iBreak)
 78099  	_sqlite3VdbeResolveLabel(tls, _v, _21_iCont)
 78100  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _14_unionTab, _21_iStart)
 78101  	_sqlite3VdbeResolveLabel(tls, _v, _21_iBreak)
 78102  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _14_unionTab, int32(0))
 78103  _63:
 78104  	goto _39
 78105  _28:
 78106  	func() {
 78107  		if int32(_p.Xop) != int32(118) {
 78108  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118976), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98703)))
 78109  			crt.X__builtin_abort(tls)
 78110  		}
 78111  	}()
 78112  	_23_tab1 = postInc2(&_pParse.XnTab, 1)
 78113  	_23_tab2 = postInc2(&_pParse.XnTab, 1)
 78114  	func() {
 78115  		if (*XExprList)(_p.XpOrderBy) != nil {
 78116  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118990), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98583)))
 78117  			crt.X__builtin_abort(tls)
 78118  		}
 78119  	}()
 78120  	_23_addr = _sqlite3VdbeAddOp2(tls, _v, int32(110), _23_tab1, int32(0))
 78121  	func() {
 78122  		if (*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), 0)) != int32(-1) {
 78123  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118993), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98598)))
 78124  			crt.X__builtin_abort(tls)
 78125  		}
 78126  	}()
 78127  	*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), 0) = _23_addr
 78128  	_findRightmost(tls, _p).XselFlags |= uint32(32)
 78129  	func() {
 78130  		if _p.XpEList == nil {
 78131  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118996), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98434)))
 78132  			crt.X__builtin_abort(tls)
 78133  		}
 78134  	}()
 78135  	_sqlite3SelectDestInit(tls, &_23_intersectdest, int32(1), _23_tab1)
 78136  	_iSub1 = _pParse.XiNextSelectId
 78137  	_rc = _sqlite3Select(tls, _pParse, _pPrior, &_23_intersectdest)
 78138  	if _rc != 0 {
 78139  		goto _multi_select_end
 78140  	}
 78141  	_23_addr = _sqlite3VdbeAddOp2(tls, _v, int32(110), _23_tab2, int32(0))
 78142  	func() {
 78143  		if (*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), uintptr(1))) != int32(-1) {
 78144  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119010), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98723)))
 78145  			crt.X__builtin_abort(tls)
 78146  		}
 78147  	}()
 78148  	*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), uintptr(1)) = _23_addr
 78149  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 78150  	_23_pLimit = (*XExpr)(_p.XpLimit)
 78151  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = nil
 78152  	_23_pOffset = (*XExpr)(_p.XpOffset)
 78153  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = nil
 78154  	_23_intersectdest.XiSDParm = _23_tab2
 78155  	_iSub2 = _pParse.XiNextSelectId
 78156  	_rc = _sqlite3Select(tls, _pParse, _p, &_23_intersectdest)
 78157  	_pDelete = (*XSelect)(_p.XpPrior)
 78158  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pPrior
 78159  	if int32(_p.XnSelectRow) > int32(_pPrior.XnSelectRow) {
 78160  		_p.XnSelectRow = _pPrior.XnSelectRow
 78161  	}
 78162  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpLimit))
 78163  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = _23_pLimit
 78164  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = _23_pOffset
 78165  	func() {
 78166  		if _p.XpEList == nil {
 78167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119031), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98434)))
 78168  			crt.X__builtin_abort(tls)
 78169  		}
 78170  	}()
 78171  	if int32(_dest.XeDest) != int32(9) {
 78172  		goto _83
 78173  	}
 78174  	_25_pFirst = _p
 78175  _84:
 78176  	if _25_pFirst.XpPrior != nil {
 78177  		_25_pFirst = (*XSelect)(_25_pFirst.XpPrior)
 78178  		goto _84
 78179  	}
 78180  	_generateColumnNames(tls, _pParse, (*XSrcList)(_25_pFirst.XpSrc), (*XExprList)(_25_pFirst.XpEList))
 78181  _83:
 78182  	_23_iBreak = _sqlite3VdbeMakeLabel(tls, _v)
 78183  	_23_iCont = _sqlite3VdbeMakeLabel(tls, _v)
 78184  	_computeLimitRegisters(tls, _pParse, _p, _23_iBreak)
 78185  	_sqlite3VdbeAddOp2(tls, _v, int32(37), _23_tab1, _23_iBreak)
 78186  	_23_r1 = _sqlite3GetTempReg(tls, _pParse)
 78187  	_23_iStart = _sqlite3VdbeAddOp2(tls, _v, int32(124), _23_tab1, _23_r1)
 78188  	_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _23_tab2, _23_iCont, _23_r1, int32(0))
 78189  	_sqlite3ReleaseTempReg(tls, _pParse, _23_r1)
 78190  	_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.XpEList), _23_tab1, nil, nil, &_dest, _23_iCont, _23_iBreak)
 78191  	_sqlite3VdbeResolveLabel(tls, _v, _23_iCont)
 78192  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _23_tab1, _23_iStart)
 78193  	_sqlite3VdbeResolveLabel(tls, _v, _23_iBreak)
 78194  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _23_tab2, int32(0))
 78195  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _23_tab1, int32(0))
 78196  	goto _39
 78197  _39:
 78198  	_explainComposite(tls, _pParse, int32(_p.Xop), _iSub1, _iSub2, bool2int(int32(_p.Xop) != int32(116)))
 78199  	if (_p.XselFlags & uint32(32)) == 0 {
 78200  		goto _multi_select_end
 78201  	}
 78202  	func() {
 78203  		if (*XSelect)(_p.XpNext) != nil {
 78204  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119074), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98748)))
 78205  			crt.X__builtin_abort(tls)
 78206  		}
 78207  	}()
 78208  	_26_nCol = (*XExprList)(_p.XpEList).XnExpr
 78209  	_26_pKeyInfo = _sqlite3KeyInfoAlloc(tls, _db, _26_nCol, int32(1))
 78210  	if _26_pKeyInfo == nil {
 78211  		_rc = _sqlite3NomemError(tls, int32(119078))
 78212  		goto _multi_select_end
 78213  	}
 78214  	*func() ***XCollSeq { _26_i = int32(0); return &_26_apColl }() = (**XCollSeq)(unsafe.Pointer(&_26_pKeyInfo.XaColl))
 78215  _90:
 78216  	if _26_i >= _26_nCol {
 78217  		goto _93
 78218  	}
 78219  	*_26_apColl = _multiSelectCollSeq(tls, _pParse, _p, _26_i)
 78220  	if nil == (*_26_apColl) {
 78221  		*_26_apColl = (*XCollSeq)(_db.XpDfltColl)
 78222  	}
 78223  	*(*uintptr)(unsafe.Pointer(func() ***XCollSeq { _26_i += 1; return &_26_apColl }())) += uintptr(8)
 78224  	goto _90
 78225  _93:
 78226  	_26_pLoop = _p
 78227  _95:
 78228  	if _26_pLoop == nil {
 78229  		goto _98
 78230  	}
 78231  	_26_i = int32(0)
 78232  _99:
 78233  	if _26_i >= int32(2) {
 78234  		goto _102
 78235  	}
 78236  	_31_addr = *elem8((*int32)(unsafe.Pointer(&_26_pLoop.XaddrOpenEphm)), uintptr(_26_i))
 78237  	if _31_addr < int32(0) {
 78238  		func() {
 78239  			if (*elem8((*int32)(unsafe.Pointer(&_26_pLoop.XaddrOpenEphm)), uintptr(1))) >= int32(0) {
 78240  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119094), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98760)))
 78241  				crt.X__builtin_abort(tls)
 78242  			}
 78243  		}()
 78244  		goto _102
 78245  	}
 78246  	_sqlite3VdbeChangeP2(tls, _v, uint32(_31_addr), _26_nCol)
 78247  	_sqlite3VdbeChangeP4(tls, _v, _31_addr, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _26_pKeyInfo))), int32(-5))
 78248  	*elem8((*int32)(unsafe.Pointer(&_26_pLoop.XaddrOpenEphm)), uintptr(_26_i)) = int32(-1)
 78249  	_26_i += 1
 78250  	goto _99
 78251  _102:
 78252  	_26_pLoop = (*XSelect)(_26_pLoop.XpPrior)
 78253  	goto _95
 78254  _98:
 78255  	_sqlite3KeyInfoUnref(tls, _26_pKeyInfo)
 78256  _multi_select_end:
 78257  	_pDest.XiSdst = _dest.XiSdst
 78258  	_pDest.XnSdst = _dest.XnSdst
 78259  	_sqlite3SelectDelete(tls, _db, _pDelete)
 78260  	return _rc
 78261  }
 78262  
 78263  var _multiSelectØ00__func__Ø000 [12]int8
 78264  
 78265  func init() {
 78266  	crt.Xstrncpy(nil, &_multiSelectØ00__func__Ø000[0], str(98785), 12)
 78267  }
 78268  
 78269  // C comment
 78270  //  /*
 78271  //  ** Handle the special case of a compound-select that originates from a
 78272  //  ** VALUES clause.  By handling this as a special case, we avoid deep
 78273  //  ** recursion, and thus do not need to enforce the SQLITE_LIMIT_COMPOUND_SELECT
 78274  //  ** on a VALUES clause.
 78275  //  **
 78276  //  ** Because the Select object originates from a VALUES clause:
 78277  //  **   (1) It has no LIMIT or OFFSET
 78278  //  **   (2) All terms are UNION ALL
 78279  //  **   (3) There is no ORDER BY clause
 78280  //  */
 78281  func _multiSelectValues(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
 78282  	var _nRow, _rc int32
 78283  	var _pPrior *XSelect
 78284  	_nRow = int32(1)
 78285  	_rc = int32(0)
 78286  	func() {
 78287  		if (_p.XselFlags & uint32(1024)) == 0 {
 78288  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118702), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98797)))
 78289  			crt.X__builtin_abort(tls)
 78290  		}
 78291  	}()
 78292  _2:
 78293  	func() {
 78294  		if (_p.XselFlags & uint32(512)) == 0 {
 78295  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118704), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98825)))
 78296  			crt.X__builtin_abort(tls)
 78297  		}
 78298  	}()
 78299  	func() {
 78300  		if int32(_p.Xop) != int32(116) && (int32(_p.Xop) != int32(119) || (*XSelect)(_p.XpPrior) != nil) {
 78301  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118705), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98849)))
 78302  			crt.X__builtin_abort(tls)
 78303  		}
 78304  	}()
 78305  	func() {
 78306  		if (*XExpr)(_p.XpLimit) != nil {
 78307  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118706), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98556)))
 78308  			crt.X__builtin_abort(tls)
 78309  		}
 78310  	}()
 78311  	func() {
 78312  		if (*XExpr)(_p.XpOffset) != nil {
 78313  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118707), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98569)))
 78314  			crt.X__builtin_abort(tls)
 78315  		}
 78316  	}()
 78317  	func() {
 78318  		if (*XSelect)(_p.XpNext) != nil && ((*XExprList)(_p.XpEList).XnExpr) != ((*XExprList)((*XSelect)(_p.XpNext).XpEList).XnExpr) {
 78319  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118708), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98901)))
 78320  			crt.X__builtin_abort(tls)
 78321  		}
 78322  	}()
 78323  	if (*XSelect)(_p.XpPrior) == nil {
 78324  		goto _17
 78325  	}
 78326  	func() {
 78327  		if (*XSelect)((*XSelect)(_p.XpPrior).XpNext) != _p {
 78328  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118710), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98958)))
 78329  			crt.X__builtin_abort(tls)
 78330  		}
 78331  	}()
 78332  	_p = (*XSelect)(_p.XpPrior)
 78333  	_nRow += 1
 78334  	goto _2
 78335  _17:
 78336  	if _p == nil {
 78337  		goto _21
 78338  	}
 78339  	_pPrior = (*XSelect)(_p.XpPrior)
 78340  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 78341  	_rc = _sqlite3Select(tls, _pParse, _p, _pDest)
 78342  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pPrior
 78343  	if _rc != 0 {
 78344  		goto _21
 78345  	}
 78346  	_p.XnSelectRow = int16(_nRow)
 78347  	_p = (*XSelect)(_p.XpNext)
 78348  	goto _17
 78349  _21:
 78350  	return _rc
 78351  }
 78352  
 78353  var _multiSelectValuesØ00__func__Ø000 [18]int8
 78354  
 78355  func init() {
 78356  	crt.Xstrncpy(nil, &_multiSelectValuesØ00__func__Ø000[0], str(98978), 18)
 78357  }
 78358  
 78359  // C comment
 78360  //  /*
 78361  //  ** This routine generates VDBE code to compute the content of a WITH RECURSIVE
 78362  //  ** query of the form:
 78363  //  **
 78364  //  **   <recursive-table> AS (<setup-query> UNION [ALL] <recursive-query>)
 78365  //  **                         \___________/             \_______________/
 78366  //  **                           p->pPrior                      p
 78367  //  **
 78368  //  **
 78369  //  ** There is exactly one reference to the recursive-table in the FROM clause
 78370  //  ** of recursive-query, marked with the SrcList->a[].fg.isRecursive flag.
 78371  //  **
 78372  //  ** The setup-query runs once to generate an initial set of rows that go
 78373  //  ** into a Queue table.  Rows are extracted from the Queue table one by
 78374  //  ** one.  Each row extracted from Queue is output to pDest.  Then the single
 78375  //  ** extracted row (now in the iCurrent table) becomes the content of the
 78376  //  ** recursive-table for a recursive-query run.  The output of the recursive-query
 78377  //  ** is added back into the Queue table.  Then another row is extracted from Queue
 78378  //  ** and the iteration continues until the Queue table is empty.
 78379  //  **
 78380  //  ** If the compound query operator is UNION then no duplicate rows are ever
 78381  //  ** inserted into the Queue table.  The iDistinct table keeps a copy of all rows
 78382  //  ** that have ever been inserted into Queue and causes duplicates to be
 78383  //  ** discarded.  If the operator is UNION ALL, then duplicates are allowed.
 78384  //  **
 78385  //  ** If the query has an ORDER BY, then entries in the Queue table are kept in
 78386  //  ** ORDER BY order and the first entry is extracted for each cycle.  Without
 78387  //  ** an ORDER BY, the Queue table is just a FIFO.
 78388  //  **
 78389  //  ** If a LIMIT clause is provided, then the iteration stops after LIMIT rows
 78390  //  ** have been output to pDest.  A LIMIT of zero means to output no rows and a
 78391  //  ** negative LIMIT means to output all rows.  If there is also an OFFSET clause
 78392  //  ** with a positive value, then the first OFFSET outputs are discarded rather
 78393  //  ** than being sent to pDest.  The LIMIT count does not begin until after OFFSET
 78394  //  ** rows have been skipped.
 78395  //  */
 78396  func _generateWithRecursiveQuery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) {
 78397  	var _nCol, _addrTop, _addrCont, _addrBreak, _iCurrent, _regCurrent, _iQueue, _iDistinct, _eDest, _i, _rc, _regLimit, _regOffset int32
 78398  	var _v *TVdbe
 78399  	var _pSrc *XSrcList
 78400  	var _pOrderBy *XExprList
 78401  	var _pSetup *XSelect
 78402  	var _pLimit, _pOffset *XExpr
 78403  	var _5_pKeyInfo *XKeyInfo
 78404  	var _destQueue XSelectDest
 78405  	_pSrc = (*XSrcList)(_p.XpSrc)
 78406  	_nCol = (*XExprList)(_p.XpEList).XnExpr
 78407  	_v = (*TVdbe)(_pParse.XpVdbe)
 78408  	_pSetup = (*XSelect)(_p.XpPrior)
 78409  	_iCurrent = int32(0)
 78410  	_iDistinct = int32(0)
 78411  	_eDest = int32(5)
 78412  	if _sqlite3AuthCheck(tls, _pParse, int32(33), nil, nil, nil) != 0 {
 78413  		return
 78414  	}
 78415  	_addrBreak = _sqlite3VdbeMakeLabel(tls, _v)
 78416  	_p.XnSelectRow = int16(320)
 78417  	_computeLimitRegisters(tls, _pParse, _p, _addrBreak)
 78418  	_pLimit = (*XExpr)(_p.XpLimit)
 78419  	_pOffset = (*XExpr)(_p.XpOffset)
 78420  	_regLimit = _p.XiLimit
 78421  	_regOffset = _p.XiOffset
 78422  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = store60((**XExpr)(unsafe.Pointer(&_p.XpOffset)), nil)
 78423  	_p.XiLimit = store2(&_p.XiOffset, int32(0))
 78424  	_pOrderBy = (*XExprList)(_p.XpOrderBy)
 78425  	_i = int32(0)
 78426  _1:
 78427  	if func() int32 {
 78428  		if _i < _pSrc.XnSrc {
 78429  			return int32(1)
 78430  		}
 78431  		return func() int32 {
 78432  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118583), unsafe.Pointer(&_generateWithRecursiveQueryØ00__func__Ø000), unsafe.Pointer(str(4809)))
 78433  			crt.X__builtin_abort(tls)
 78434  			return int32(0)
 78435  		}()
 78436  	}() == 0 {
 78437  		goto _6
 78438  	}
 78439  	if ((uint32(((elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i)).Xfg).XnotIndexed)>>5) << 31) >> 31) != 0 {
 78440  		_iCurrent = elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i)).XiCursor
 78441  		goto _6
 78442  	}
 78443  	_i += 1
 78444  	goto _1
 78445  _6:
 78446  	_iQueue = postInc2(&_pParse.XnTab, 1)
 78447  	if int32(_p.Xop) == int32(115) {
 78448  		_eDest = func() int32 {
 78449  			if _pOrderBy != nil {
 78450  				return int32(8)
 78451  			}
 78452  			return int32(6)
 78453  		}()
 78454  		_iDistinct = postInc2(&_pParse.XnTab, 1)
 78455  		goto _11
 78456  	}
 78457  	_eDest = func() int32 {
 78458  		if _pOrderBy != nil {
 78459  			return int32(7)
 78460  		}
 78461  		return int32(5)
 78462  	}()
 78463  _11:
 78464  	_sqlite3SelectDestInit(tls, &_destQueue, _eDest, _iQueue)
 78465  	_regCurrent = preInc2(&_pParse.XnMem, 1)
 78466  	_sqlite3VdbeAddOp3(tls, _v, int32(113), _iCurrent, _regCurrent, _nCol)
 78467  	if _pOrderBy != nil {
 78468  		_5_pKeyInfo = _multiSelectOrderByKeyInfo(tls, _pParse, _p, int32(1))
 78469  		_sqlite3VdbeAddOp4(tls, _v, int32(110), _iQueue, _pOrderBy.XnExpr+int32(2), int32(0), (*int8)(unsafe.Pointer(_5_pKeyInfo)), int32(-5))
 78470  		*(**XExprList)(unsafe.Pointer(&_destQueue.XpOrderBy)) = _pOrderBy
 78471  		goto _15
 78472  	}
 78473  	_sqlite3VdbeAddOp2(tls, _v, int32(110), _iQueue, _nCol)
 78474  _15:
 78475  	_sqlite3VdbeComment(tls, _v, str(98996))
 78476  	if _iDistinct != 0 {
 78477  		*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), 0) = _sqlite3VdbeAddOp2(tls, _v, int32(110), _iDistinct, int32(0))
 78478  		_p.XselFlags |= uint32(32)
 78479  	}
 78480  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = nil
 78481  	*(**XSelect)(unsafe.Pointer(&_pSetup.XpNext)) = nil
 78482  	_rc = _sqlite3Select(tls, _pParse, _pSetup, &_destQueue)
 78483  	*(**XSelect)(unsafe.Pointer(&_pSetup.XpNext)) = _p
 78484  	if _rc != 0 {
 78485  		goto _end_of_recursive_query
 78486  	}
 78487  	_addrTop = _sqlite3VdbeAddOp2(tls, _v, int32(37), _iQueue, _addrBreak)
 78488  	_sqlite3VdbeAddOp1(tls, _v, int32(126), _iCurrent)
 78489  	if _pOrderBy != nil {
 78490  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _iQueue, _pOrderBy.XnExpr+int32(1), _regCurrent)
 78491  		goto _19
 78492  	}
 78493  	_sqlite3VdbeAddOp2(tls, _v, int32(124), _iQueue, _regCurrent)
 78494  _19:
 78495  	_sqlite3VdbeAddOp1(tls, _v, int32(120), _iQueue)
 78496  	_addrCont = _sqlite3VdbeMakeLabel(tls, _v)
 78497  	_codeOffset(tls, _v, _regOffset, _addrCont)
 78498  	_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.XpEList), _iCurrent, nil, nil, _pDest, _addrCont, _addrBreak)
 78499  	if _regLimit != 0 {
 78500  		_sqlite3VdbeAddOp2(tls, _v, int32(48), _regLimit, _addrBreak)
 78501  	}
 78502  	_sqlite3VdbeResolveLabel(tls, _v, _addrCont)
 78503  	if (_p.XselFlags & uint32(8)) != 0 {
 78504  		_sqlite3ErrorMsg(tls, _pParse, str(99008))
 78505  		goto _22
 78506  	}
 78507  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 78508  	_sqlite3Select(tls, _pParse, _p, &_destQueue)
 78509  	func() {
 78510  		if (*XSelect)(_p.XpPrior) != nil {
 78511  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118659), unsafe.Pointer(&_generateWithRecursiveQueryØ00__func__Ø000), unsafe.Pointer(str(97765)))
 78512  			crt.X__builtin_abort(tls)
 78513  		}
 78514  	}()
 78515  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pSetup
 78516  _22:
 78517  	_sqlite3VdbeGoto(tls, _v, _addrTop)
 78518  	_sqlite3VdbeResolveLabel(tls, _v, _addrBreak)
 78519  _end_of_recursive_query:
 78520  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExprList)(_p.XpOrderBy))
 78521  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = _pOrderBy
 78522  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = _pLimit
 78523  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = _pOffset
 78524  }
 78525  
 78526  // C comment
 78527  //  /*
 78528  //  ** Compute the iLimit and iOffset fields of the SELECT based on the
 78529  //  ** pLimit and pOffset expressions.  pLimit and pOffset hold the expressions
 78530  //  ** that appear in the original SQL statement after the LIMIT and OFFSET
 78531  //  ** keywords.  Or NULL if those keywords are omitted. iLimit and iOffset
 78532  //  ** are the integer memory register numbers for counters used to compute
 78533  //  ** the limit and offset.  If there is no limit and/or offset, then
 78534  //  ** iLimit and iOffset are negative.
 78535  //  **
 78536  //  ** This routine changes the values of iLimit and iOffset only if
 78537  //  ** a limit or offset is defined by pLimit and pOffset.  iLimit and
 78538  //  ** iOffset should have been preset to appropriate default values (zero)
 78539  //  ** prior to calling this routine.
 78540  //  **
 78541  //  ** The iOffset register (if it exists) is initialized to the value
 78542  //  ** of the OFFSET.  The iLimit register is initialized to LIMIT.  Register
 78543  //  ** iOffset+1 is initialized to LIMIT+OFFSET.
 78544  //  **
 78545  //  ** Only if pLimit!=0 or pOffset!=0 do the limit registers get
 78546  //  ** redefined.  The UNION ALL operator uses this property to force
 78547  //  ** the reuse of the same limit and offset registers across multiple
 78548  //  ** SELECT statements.
 78549  //  */
 78550  func _computeLimitRegisters(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iBreak int32) {
 78551  	var _iLimit, _iOffset, _n int32
 78552  	var _v *TVdbe
 78553  	_v = nil
 78554  	_iLimit = int32(0)
 78555  	if _p.XiLimit != 0 {
 78556  		return
 78557  	}
 78558  	_sqlite3ExprCacheClear(tls, _pParse)
 78559  	func() {
 78560  		if (*XExpr)(_p.XpOffset) != nil && (*XExpr)(_p.XpLimit) == nil {
 78561  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118411), unsafe.Pointer(&_computeLimitRegistersØ00__func__Ø000), unsafe.Pointer(str(99050)))
 78562  			crt.X__builtin_abort(tls)
 78563  		}
 78564  	}()
 78565  	if _p.XpLimit == nil {
 78566  		goto _4
 78567  	}
 78568  	_p.XiLimit = store2(&_iLimit, preInc2(&_pParse.XnMem, 1))
 78569  	_v = _sqlite3GetVdbe(tls, _pParse)
 78570  	func() {
 78571  		if _v == nil {
 78572  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118415), unsafe.Pointer(&_computeLimitRegistersØ00__func__Ø000), unsafe.Pointer(str(42019)))
 78573  			crt.X__builtin_abort(tls)
 78574  		}
 78575  	}()
 78576  	if _sqlite3ExprIsInteger(tls, (*XExpr)(_p.XpLimit), &_n) == 0 {
 78577  		goto _7
 78578  	}
 78579  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _n, _iLimit)
 78580  	_sqlite3VdbeComment(tls, _v, str(99080))
 78581  	if _n == int32(0) {
 78582  		_sqlite3VdbeGoto(tls, _v, _iBreak)
 78583  		goto _11
 78584  	}
 78585  	if (_n >= int32(0)) && (int32(_p.XnSelectRow) > int32(_sqlite3LogEst(tls, uint64(_n)))) {
 78586  		_p.XnSelectRow = _sqlite3LogEst(tls, uint64(_n))
 78587  		_p.XselFlags |= uint32(16384)
 78588  	}
 78589  _11:
 78590  	goto _12
 78591  _7:
 78592  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(_p.XpLimit), _iLimit)
 78593  	_sqlite3VdbeAddOp1(tls, _v, int32(17), _iLimit)
 78594  	_sqlite3VdbeComment(tls, _v, str(99080))
 78595  	_sqlite3VdbeAddOp2(tls, _v, int32(22), _iLimit, _iBreak)
 78596  _12:
 78597  	if _p.XpOffset != nil {
 78598  		_p.XiOffset = store2(&_iOffset, preInc2(&_pParse.XnMem, 1))
 78599  		_pParse.XnMem += 1
 78600  		_sqlite3ExprCode(tls, _pParse, (*XExpr)(_p.XpOffset), _iOffset)
 78601  		_sqlite3VdbeAddOp1(tls, _v, int32(17), _iOffset)
 78602  		_sqlite3VdbeComment(tls, _v, str(99094))
 78603  		_sqlite3VdbeAddOp3(tls, _v, int32(149), _iLimit, _iOffset+int32(1), _iOffset)
 78604  		_sqlite3VdbeComment(tls, _v, str(99109))
 78605  	}
 78606  _4:
 78607  }
 78608  
 78609  // C comment
 78610  //  /*
 78611  //  ** Clear all column cache entries.
 78612  //  */
 78613  func _sqlite3ExprCacheClear(tls *crt.TLS, _pParse *XParse) {
 78614  	var _i int32
 78615  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(4096)) != 0 {
 78616  		crt.Xprintf(tls, str(99122))
 78617  	}
 78618  	_i = int32(0)
 78619  _1:
 78620  	if _i >= int32(_pParse.XnColCache) {
 78621  		goto _4
 78622  	}
 78623  	if ((elem71((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)).XtempReg) != 0) && (int32(_pParse.XnTempReg) < int32(8)) {
 78624  		*elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(postInc3(&_pParse.XnTempReg, byte(1)))) = elem71((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)).XiReg
 78625  	}
 78626  	_i += 1
 78627  	goto _1
 78628  _4:
 78629  	_pParse.XnColCache = 0
 78630  }
 78631  
 78632  var _computeLimitRegistersØ00__func__Ø000 [22]int8
 78633  
 78634  func init() {
 78635  	crt.Xstrncpy(nil, &_computeLimitRegistersØ00__func__Ø000[0], str(99129), 22)
 78636  }
 78637  
 78638  // C comment
 78639  //  /* Generate code for an unconditional jump to instruction iDest
 78640  //  */
 78641  func _sqlite3VdbeGoto(tls *crt.TLS, _p *TVdbe, _iDest int32) (r0 int32) {
 78642  	return _sqlite3VdbeAddOp3(tls, _p, int32(13), int32(0), _iDest, int32(0))
 78643  }
 78644  
 78645  var _generateWithRecursiveQueryØ00__func__Ø000 [27]int8
 78646  
 78647  func init() {
 78648  	crt.Xstrncpy(nil, &_generateWithRecursiveQueryØ00__func__Ø000[0], str(99151), 27)
 78649  }
 78650  
 78651  // C comment
 78652  //  /*
 78653  //  ** The select statement passed as the second parameter is a compound SELECT
 78654  //  ** with an ORDER BY clause. This function allocates and returns a KeyInfo
 78655  //  ** structure suitable for implementing the ORDER BY.
 78656  //  **
 78657  //  ** Space to hold the KeyInfo structure is obtained from malloc. The calling
 78658  //  ** function is responsible for ensuring that this structure is eventually
 78659  //  ** freed.
 78660  //  */
 78661  func _multiSelectOrderByKeyInfo(tls *crt.TLS, _pParse *XParse, _p *XSelect, _nExtra int32) (r0 *XKeyInfo) {
 78662  	var _nOrderBy, _1_i int32
 78663  	var _db *Xsqlite3
 78664  	var _pOrderBy *XExprList
 78665  	var _2_pItem *TExprList_item
 78666  	var _2_pTerm *XExpr
 78667  	var _pRet *XKeyInfo
 78668  	var _2_pColl *XCollSeq
 78669  	_pOrderBy = (*XExprList)(_p.XpOrderBy)
 78670  	_nOrderBy = (*XExprList)(_p.XpOrderBy).XnExpr
 78671  	_db = (*Xsqlite3)(_pParse.Xdb)
 78672  	_pRet = _sqlite3KeyInfoAlloc(tls, _db, _nOrderBy+_nExtra, int32(1))
 78673  	if _pRet == nil {
 78674  		goto _0
 78675  	}
 78676  	_1_i = int32(0)
 78677  _1:
 78678  	if _1_i >= _nOrderBy {
 78679  		goto _4
 78680  	}
 78681  	_2_pItem = elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_1_i))
 78682  	_2_pTerm = (*XExpr)(_2_pItem.XpExpr)
 78683  	if (_2_pTerm.Xflags & uint32(256)) != 0 {
 78684  		_2_pColl = _sqlite3ExprCollSeq(tls, _pParse, _2_pTerm)
 78685  		goto _6
 78686  	}
 78687  	_2_pColl = _multiSelectCollSeq(tls, _pParse, _p, int32((*t73)(unsafe.Pointer(&_2_pItem.Xu)).XiOrderByCol)-int32(1))
 78688  	if _2_pColl == nil {
 78689  		_2_pColl = (*XCollSeq)(_db.XpDfltColl)
 78690  	}
 78691  	*(**XExpr)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_1_i)).XpExpr))) = _sqlite3ExprAddCollateString(tls, _pParse, _2_pTerm, _2_pColl.XzName)
 78692  _6:
 78693  	func() {
 78694  		if _sqlite3KeyInfoIsWriteable(tls, _pRet) == 0 {
 78695  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118498), unsafe.Pointer(&_multiSelectOrderByKeyInfoØ00__func__Ø000), unsafe.Pointer(str(99178)))
 78696  			crt.X__builtin_abort(tls)
 78697  		}
 78698  	}()
 78699  	*elem64((**XCollSeq)(unsafe.Pointer(&_pRet.XaColl)), uintptr(_1_i)) = _2_pColl
 78700  	*elem15(_pRet.XaSortOrder, uintptr(_1_i)) = elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_1_i)).XsortOrder
 78701  	_1_i += 1
 78702  	goto _1
 78703  _4:
 78704  _0:
 78705  	return _pRet
 78706  }
 78707  
 78708  // C comment
 78709  //  /*
 78710  //  ** Return the appropriate collating sequence for the iCol-th column of
 78711  //  ** the result set for the compound-select statement "p".  Return NULL if
 78712  //  ** the column has no default collating sequence.
 78713  //  **
 78714  //  ** The collating sequence for the compound select is taken from the
 78715  //  ** left-most term of the select that has a collating sequence.
 78716  //  */
 78717  func _multiSelectCollSeq(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iCol int32) (r0 *XCollSeq) {
 78718  	var _pRet *XCollSeq
 78719  	if _p.XpPrior != nil {
 78720  		_pRet = _multiSelectCollSeq(tls, _pParse, (*XSelect)(_p.XpPrior), _iCol)
 78721  		goto _1
 78722  	}
 78723  	_pRet = nil
 78724  _1:
 78725  	func() {
 78726  		if _iCol < int32(0) {
 78727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118459), unsafe.Pointer(&_multiSelectCollSeqØ00__func__Ø000), unsafe.Pointer(str(99210)))
 78728  			crt.X__builtin_abort(tls)
 78729  		}
 78730  	}()
 78731  	if (_pRet == nil) && func() int32 {
 78732  		if _iCol < ((*XExprList)(_p.XpEList).XnExpr) {
 78733  			return int32(1)
 78734  		}
 78735  		return func() int32 {
 78736  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118463), unsafe.Pointer(&_multiSelectCollSeqØ00__func__Ø000), unsafe.Pointer(str(4809)))
 78737  			crt.X__builtin_abort(tls)
 78738  			return int32(0)
 78739  		}()
 78740  	}() != 0 {
 78741  		_pRet = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpEList).Xa))), uintptr(_iCol)).XpExpr))
 78742  	}
 78743  	return _pRet
 78744  }
 78745  
 78746  var _multiSelectCollSeqØ00__func__Ø000 [19]int8
 78747  
 78748  func init() {
 78749  	crt.Xstrncpy(nil, &_multiSelectCollSeqØ00__func__Ø000[0], str(99218), 19)
 78750  }
 78751  
 78752  var _multiSelectOrderByKeyInfoØ00__func__Ø000 [26]int8
 78753  
 78754  func init() {
 78755  	crt.Xstrncpy(nil, &_multiSelectOrderByKeyInfoØ00__func__Ø000[0], str(99237), 26)
 78756  }
 78757  
 78758  // C comment
 78759  //  /*
 78760  //  ** Add code to implement the OFFSET
 78761  //  */
 78762  func _codeOffset(tls *crt.TLS, _v *TVdbe, _iOffset int32, _iContinue int32) {
 78763  	if _iOffset > int32(0) {
 78764  		_sqlite3VdbeAddOp3(tls, _v, int32(46), _iOffset, _iContinue, int32(1))
 78765  		_sqlite3VdbeComment(tls, _v, str(25247))
 78766  	}
 78767  }
 78768  
 78769  // C comment
 78770  //  /*
 78771  //  ** This routine generates the code for the inside of the inner loop
 78772  //  ** of a SELECT.
 78773  //  **
 78774  //  ** If srcTab is negative, then the pEList expressions
 78775  //  ** are evaluated in order to get the data for this row.  If srcTab is
 78776  //  ** zero or more, then data is pulled from srcTab and pEList is used only
 78777  //  ** to get the number of columns and the collation sequence for each column.
 78778  //  */
 78779  func _selectInnerLoop(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pEList *XExprList, _srcTab int32, _pSort *XSortCtx, _pDistinct *XDistinctCtx, _pDest *XSelectDest, _iContinue int32, _iBreak int32) {
 78780  	var _i, _hasDistinct, _eDest, _iParm, _nResultCol, _nPrefixReg, _regResult, _regOrig, _11_j, _15_iJump, _15_regPrev, _23_r1, _25_r1, _26_addr, _28_r2, _31_r1, _40_nKey, _40_r1, _40_r2, _40_r3, _40_addrTest int32
 78781  	var _7_ecelFlags uint8
 78782  	var _v *TVdbe
 78783  	var _40_pSO *XExprList
 78784  	var _15_pOp *XVdbeOp
 78785  	var _16_pColl *XCollSeq
 78786  	_v = (*TVdbe)(_pParse.XpVdbe)
 78787  	_eDest = int32(_pDest.XeDest)
 78788  	_iParm = _pDest.XiSDParm
 78789  	_nPrefixReg = int32(0)
 78790  	func() {
 78791  		if _v == nil {
 78792  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117220), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(41816)))
 78793  			crt.X__builtin_abort(tls)
 78794  		}
 78795  	}()
 78796  	func() {
 78797  		if _pEList == nil {
 78798  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117221), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(45007)))
 78799  			crt.X__builtin_abort(tls)
 78800  		}
 78801  	}()
 78802  	_hasDistinct = func() int32 {
 78803  		if _pDistinct != nil {
 78804  			return int32(_pDistinct.XeTnctType)
 78805  		}
 78806  		return int32(0)
 78807  	}()
 78808  	if (_pSort != nil) && ((*XExprList)(_pSort.XpOrderBy) == nil) {
 78809  		_pSort = nil
 78810  	}
 78811  	if (_pSort == nil) && (_hasDistinct == 0) {
 78812  		func() {
 78813  			if _iContinue == int32(0) {
 78814  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117225), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99263)))
 78815  				crt.X__builtin_abort(tls)
 78816  			}
 78817  		}()
 78818  		_codeOffset(tls, _v, _p.XiOffset, _iContinue)
 78819  	}
 78820  	_nResultCol = _pEList.XnExpr
 78821  	if _pDest.XiSdst != int32(0) {
 78822  		goto _12
 78823  	}
 78824  	if _pSort == nil {
 78825  		goto _13
 78826  	}
 78827  	_nPrefixReg = (*XExprList)(_pSort.XpOrderBy).XnExpr
 78828  	if (int32(_pSort.XsortFlags) & int32(1)) == 0 {
 78829  		_nPrefixReg += 1
 78830  	}
 78831  	_pParse.XnMem += _nPrefixReg
 78832  _13:
 78833  	_pDest.XiSdst = _pParse.XnMem + int32(1)
 78834  	_pParse.XnMem += _nResultCol
 78835  	goto _16
 78836  _12:
 78837  	if (_pDest.XiSdst + _nResultCol) > _pParse.XnMem {
 78838  		_pParse.XnMem += _nResultCol
 78839  	}
 78840  _16:
 78841  	_pDest.XnSdst = _nResultCol
 78842  	_regOrig = store2(&_regResult, _pDest.XiSdst)
 78843  	if _srcTab < int32(0) {
 78844  		goto _17
 78845  	}
 78846  	_i = int32(0)
 78847  _18:
 78848  	if _i >= _nResultCol {
 78849  		goto _21
 78850  	}
 78851  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _srcTab, _i, _regResult+_i)
 78852  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzName))
 78853  	_i += 1
 78854  	goto _18
 78855  _21:
 78856  	goto _23
 78857  _17:
 78858  	if _eDest == int32(3) {
 78859  		goto _23
 78860  	}
 78861  	if ((_eDest == int32(10)) || (_eDest == int32(9))) || (_eDest == int32(13)) {
 78862  		_7_ecelFlags = uint8(1)
 78863  		goto _27
 78864  	}
 78865  	_7_ecelFlags = 0
 78866  _27:
 78867  	if _pSort == nil || _hasDistinct != int32(0) || _eDest == int32(12) || _eDest == int32(14) {
 78868  		goto _31
 78869  	}
 78870  	{
 78871  		p := &_7_ecelFlags
 78872  		*p = uint8(int32(*p) | int32(12))
 78873  	}
 78874  	_i = _pSort.XnOBSat
 78875  _32:
 78876  	if _i >= ((*XExprList)(_pSort.XpOrderBy).XnExpr) {
 78877  		goto _35
 78878  	}
 78879  	if store2(&_11_j, int32((*t73)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSort.XpOrderBy).Xa))), uintptr(_i)).Xu))).XiOrderByCol)) > int32(0) {
 78880  		(*t73)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_11_j-int32(1))).Xu))).XiOrderByCol = uint16((_i + int32(1)) - _pSort.XnOBSat)
 78881  	}
 78882  	_i += 1
 78883  	goto _32
 78884  _35:
 78885  	_regOrig = int32(0)
 78886  	func() {
 78887  		if _eDest != int32(11) && _eDest != int32(10) && _eDest != int32(13) && _eDest != int32(9) {
 78888  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117281), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99276)))
 78889  			crt.X__builtin_abort(tls)
 78890  		}
 78891  	}()
 78892  _31:
 78893  	_nResultCol = _sqlite3ExprCodeExprList(tls, _pParse, _pEList, _regResult, int32(0), _7_ecelFlags)
 78894  _23:
 78895  	if _hasDistinct == 0 {
 78896  		goto _42
 78897  	}
 78898  	switch int32(_pDistinct.XeTnctType) {
 78899  	case int32(1):
 78900  		goto _45
 78901  	case int32(2):
 78902  		goto _44
 78903  	default:
 78904  		goto _46
 78905  	}
 78906  
 78907  _44:
 78908  	_15_regPrev = _pParse.XnMem + int32(1)
 78909  	_pParse.XnMem += _nResultCol
 78910  	_sqlite3VdbeChangeToNoop(tls, _v, _pDistinct.XaddrTnct)
 78911  	_15_pOp = _sqlite3VdbeGetOp(tls, _v, _pDistinct.XaddrTnct)
 78912  	_15_pOp.Xopcode = uint8(59)
 78913  	_15_pOp.Xp1 = int32(1)
 78914  	_15_pOp.Xp2 = _15_regPrev
 78915  	_15_iJump = _sqlite3VdbeCurrentAddr(tls, _v) + _nResultCol
 78916  	_i = int32(0)
 78917  _47:
 78918  	if _i >= _nResultCol {
 78919  		goto _50
 78920  	}
 78921  	_16_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr))
 78922  	if _i < (_nResultCol - int32(1)) {
 78923  		_sqlite3VdbeAddOp3(tls, _v, int32(77), _regResult+_i, _15_iJump, _15_regPrev+_i)
 78924  		goto _52
 78925  	}
 78926  	_sqlite3VdbeAddOp3(tls, _v, int32(78), _regResult+_i, _iContinue, _15_regPrev+_i)
 78927  _52:
 78928  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), (*int8)(unsafe.Pointer(_16_pColl)), int32(-3))
 78929  	_sqlite3VdbeChangeP5(tls, _v, uint16(128))
 78930  	_i += 1
 78931  	goto _47
 78932  _50:
 78933  	func() {
 78934  		if _sqlite3VdbeCurrentAddr(tls, _v) != _15_iJump && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 78935  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117327), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99354)))
 78936  			crt.X__builtin_abort(tls)
 78937  		}
 78938  	}()
 78939  	_sqlite3VdbeAddOp3(tls, _v, int32(64), _regResult, _15_regPrev, _nResultCol-int32(1))
 78940  	goto _56
 78941  _45:
 78942  	_sqlite3VdbeChangeToNoop(tls, _v, _pDistinct.XaddrTnct)
 78943  	goto _56
 78944  _46:
 78945  	func() {
 78946  		if int32(_pDistinct.XeTnctType) != int32(3) {
 78947  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117338), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99415)))
 78948  			crt.X__builtin_abort(tls)
 78949  		}
 78950  	}()
 78951  	_codeDistinct(tls, _pParse, _pDistinct.XtabTnct, _iContinue, _nResultCol, _regResult)
 78952  	goto _56
 78953  _56:
 78954  	if _pSort == nil {
 78955  		_codeOffset(tls, _v, _p.XiOffset, _iContinue)
 78956  	}
 78957  _42:
 78958  	switch _eDest {
 78959  	case int32(1):
 78960  		goto _61
 78961  	case int32(2):
 78962  		goto _62
 78963  	case int32(3):
 78964  		goto _68
 78965  	case int32(5):
 78966  		goto _63
 78967  	case int32(6):
 78968  		goto _63
 78969  	case int32(7):
 78970  		goto _72
 78971  	case int32(8):
 78972  		goto _72
 78973  	case int32(9):
 78974  		goto _70
 78975  	case int32(10):
 78976  		goto _69
 78977  	case int32(11):
 78978  		goto _67
 78979  	case int32(12):
 78980  		goto _63
 78981  	case int32(13):
 78982  		goto _70
 78983  	case int32(14):
 78984  		goto _63
 78985  	default:
 78986  		goto _74
 78987  	}
 78988  
 78989  _61:
 78990  	_23_r1 = _sqlite3GetTempReg(tls, _pParse)
 78991  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regResult, _nResultCol, _23_r1)
 78992  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iParm, _23_r1, _regResult, _nResultCol)
 78993  	_sqlite3ReleaseTempReg(tls, _pParse, _23_r1)
 78994  	goto _75
 78995  _62:
 78996  	_sqlite3VdbeAddOp3(tls, _v, int32(129), _iParm, _regResult, _nResultCol)
 78997  	goto _75
 78998  _63:
 78999  	_25_r1 = _sqlite3GetTempRange(tls, _pParse, _nPrefixReg+int32(1))
 79000  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regResult, _nResultCol, _25_r1+_nPrefixReg)
 79001  	if _eDest == int32(6) {
 79002  		_26_addr = _sqlite3VdbeCurrentAddr(tls, _v) + int32(4)
 79003  		_sqlite3VdbeAddOp4Int(tls, _v, int32(30), _iParm+int32(1), _26_addr, _25_r1, int32(0))
 79004  		_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iParm+int32(1), _25_r1, _regResult, _nResultCol)
 79005  		func() {
 79006  			if _pSort != nil {
 79007  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117396), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99462)))
 79008  				crt.X__builtin_abort(tls)
 79009  			}
 79010  		}()
 79011  	}
 79012  	if _pSort != nil {
 79013  		_pushOntoSorter(tls, _pParse, _pSort, _p, _25_r1+_nPrefixReg, _regResult, int32(1), _nPrefixReg)
 79014  		goto _80
 79015  	}
 79016  	_28_r2 = _sqlite3GetTempReg(tls, _pParse)
 79017  	_sqlite3VdbeAddOp2(tls, _v, int32(117), _iParm, _28_r2)
 79018  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _iParm, _25_r1, _28_r2)
 79019  	_sqlite3VdbeChangeP5(tls, _v, uint16(8))
 79020  	_sqlite3ReleaseTempReg(tls, _pParse, _28_r2)
 79021  _80:
 79022  	_sqlite3ReleaseTempRange(tls, _pParse, _25_r1, _nPrefixReg+int32(1))
 79023  	goto _75
 79024  _67:
 79025  	if _pSort != nil {
 79026  		_pushOntoSorter(tls, _pParse, _pSort, _p, _regResult, _regOrig, _nResultCol, _nPrefixReg)
 79027  		goto _82
 79028  	}
 79029  	_31_r1 = _sqlite3GetTempReg(tls, _pParse)
 79030  	func() {
 79031  		if _sqlite3Strlen30(tls, _pDest.XzAffSdst) != _nResultCol {
 79032  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117427), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99471)))
 79033  			crt.X__builtin_abort(tls)
 79034  		}
 79035  	}()
 79036  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _regResult, _nResultCol, _31_r1, _pDest.XzAffSdst, _nResultCol)
 79037  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _regResult, _nResultCol)
 79038  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iParm, _31_r1, _regResult, _nResultCol)
 79039  	_sqlite3ReleaseTempReg(tls, _pParse, _31_r1)
 79040  _82:
 79041  	goto _75
 79042  _68:
 79043  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _iParm)
 79044  	goto _75
 79045  _69:
 79046  	if _pSort != nil {
 79047  		func() {
 79048  			if _nResultCol > _pDest.XnSdst {
 79049  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117451), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99516)))
 79050  				crt.X__builtin_abort(tls)
 79051  			}
 79052  		}()
 79053  		_pushOntoSorter(tls, _pParse, _pSort, _p, _regResult, _regOrig, _nResultCol, _nPrefixReg)
 79054  		goto _88
 79055  	}
 79056  	func() {
 79057  		if _nResultCol != _pDest.XnSdst {
 79058  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117455), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99541)))
 79059  			crt.X__builtin_abort(tls)
 79060  		}
 79061  	}()
 79062  	func() {
 79063  		if _regResult != _iParm {
 79064  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117456), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99566)))
 79065  			crt.X__builtin_abort(tls)
 79066  		}
 79067  	}()
 79068  _88:
 79069  	goto _75
 79070  _70:
 79071  	if _pSort != nil {
 79072  		_pushOntoSorter(tls, _pParse, _pSort, _p, _regResult, _regOrig, _nResultCol, _nPrefixReg)
 79073  		goto _96
 79074  	}
 79075  	if _eDest == int32(13) {
 79076  		_sqlite3VdbeAddOp1(tls, _v, int32(16), _pDest.XiSDParm)
 79077  		goto _96
 79078  	}
 79079  	_sqlite3VdbeAddOp2(tls, _v, int32(67), _regResult, _nResultCol)
 79080  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _regResult, _nResultCol)
 79081  _96:
 79082  	goto _75
 79083  _72:
 79084  	_40_addrTest = int32(0)
 79085  	_40_pSO = (*XExprList)(_pDest.XpOrderBy)
 79086  	func() {
 79087  		if _40_pSO == nil {
 79088  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117493), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99583)))
 79089  			crt.X__builtin_abort(tls)
 79090  		}
 79091  	}()
 79092  	_40_nKey = _40_pSO.XnExpr
 79093  	_40_r1 = _sqlite3GetTempReg(tls, _pParse)
 79094  	_40_r2 = _sqlite3GetTempRange(tls, _pParse, _40_nKey+int32(2))
 79095  	_40_r3 = (_40_r2 + _40_nKey) + int32(1)
 79096  	if _eDest == int32(8) {
 79097  		_40_addrTest = _sqlite3VdbeAddOp4Int(tls, _v, int32(30), _iParm+int32(1), int32(0), _regResult, _nResultCol)
 79098  	}
 79099  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regResult, _nResultCol, _40_r3)
 79100  	if _eDest == int32(8) {
 79101  		_sqlite3VdbeAddOp2(tls, _v, int32(128), _iParm+int32(1), _40_r3)
 79102  		_sqlite3VdbeChangeP5(tls, _v, uint16(16))
 79103  	}
 79104  	_i = int32(0)
 79105  _101:
 79106  	if _i >= _40_nKey {
 79107  		goto _104
 79108  	}
 79109  	_sqlite3VdbeAddOp2(tls, _v, int32(65), (_regResult+int32((*t73)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&_40_pSO.Xa)), uintptr(_i)).Xu))).XiOrderByCol))-int32(1), _40_r2+_i)
 79110  	_i += 1
 79111  	goto _101
 79112  _104:
 79113  	_sqlite3VdbeAddOp2(tls, _v, int32(116), _iParm, _40_r2+_40_nKey)
 79114  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _40_r2, _40_nKey+int32(2), _40_r1)
 79115  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iParm, _40_r1, _40_r2, _40_nKey+int32(2))
 79116  	if _40_addrTest != 0 {
 79117  		_sqlite3VdbeJumpHere(tls, _v, _40_addrTest)
 79118  	}
 79119  	_sqlite3ReleaseTempReg(tls, _pParse, _40_r1)
 79120  	_sqlite3ReleaseTempRange(tls, _pParse, _40_r2, _40_nKey+int32(2))
 79121  	goto _75
 79122  _74:
 79123  	func() {
 79124  		if _eDest != int32(4) {
 79125  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117535), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99587)))
 79126  			crt.X__builtin_abort(tls)
 79127  		}
 79128  	}()
 79129  	goto _75
 79130  _75:
 79131  	if (_pSort == nil) && _p.XiLimit != 0 {
 79132  		_sqlite3VdbeAddOp2(tls, _v, int32(48), _p.XiLimit, _iBreak)
 79133  	}
 79134  }
 79135  
 79136  var _selectInnerLoopØ00__func__Ø000 [16]int8
 79137  
 79138  func init() {
 79139  	crt.Xstrncpy(nil, &_selectInnerLoopØ00__func__Ø000[0], str(99606), 16)
 79140  }
 79141  
 79142  // C comment
 79143  //  /*
 79144  //  ** Generate code that pushes the value of every element of the given
 79145  //  ** expression list into a sequence of registers beginning at target.
 79146  //  **
 79147  //  ** Return the number of elements evaluated.
 79148  //  **
 79149  //  ** The SQLITE_ECEL_DUP flag prevents the arguments from being
 79150  //  ** filled using OP_SCopy.  OP_Copy must be used instead.
 79151  //  **
 79152  //  ** The SQLITE_ECEL_FACTOR argument allows constant arguments to be
 79153  //  ** factored out into initialization code.
 79154  //  **
 79155  //  ** The SQLITE_ECEL_REF flag means that expressions in the list with
 79156  //  ** ExprList.a[].u.x.iOrderByCol>0 have already been evaluated and stored
 79157  //  ** in registers at srcReg, and so the value can be copied from there.
 79158  //  */
 79159  func _sqlite3ExprCodeExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _target int32, _srcReg int32, _flags uint8) (r0 int32) {
 79160  	var _i, _j, _n, _6_inReg int32
 79161  	var _copyOp uint8
 79162  	var _v *TVdbe
 79163  	var _pItem *TExprList_item
 79164  	var _1_pExpr *XExpr
 79165  	var _7_pOp *XVdbeOp
 79166  	_copyOp = uint8(func() int32 {
 79167  		if (int32(_flags) & int32(1)) != 0 {
 79168  			return int32(64)
 79169  		}
 79170  		return int32(65)
 79171  	}())
 79172  	_v = (*TVdbe)(_pParse.XpVdbe)
 79173  	func() {
 79174  		if _pList == nil {
 79175  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95149), unsafe.Pointer(&_sqlite3ExprCodeExprListØ00__func__Ø000), unsafe.Pointer(str(88609)))
 79176  			crt.X__builtin_abort(tls)
 79177  		}
 79178  	}()
 79179  	func() {
 79180  		if _target <= int32(0) {
 79181  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95150), unsafe.Pointer(&_sqlite3ExprCodeExprListØ00__func__Ø000), unsafe.Pointer(str(99622)))
 79182  			crt.X__builtin_abort(tls)
 79183  		}
 79184  	}()
 79185  	func() {
 79186  		if (*TVdbe)(_pParse.XpVdbe) == nil {
 79187  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95151), unsafe.Pointer(&_sqlite3ExprCodeExprListØ00__func__Ø000), unsafe.Pointer(str(99631)))
 79188  			crt.X__builtin_abort(tls)
 79189  		}
 79190  	}()
 79191  	_n = _pList.XnExpr
 79192  	if _pParse.XokConstFactor == 0 {
 79193  		{
 79194  			p := &_flags
 79195  			*p = uint8(int32(*p) & int32(-3))
 79196  		}
 79197  	}
 79198  	*func() *int32 { _pItem = (*TExprList_item)(unsafe.Pointer(&_pList.Xa)); return &_i }() = int32(0)
 79199  _9:
 79200  	if _i >= _n {
 79201  		goto _12
 79202  	}
 79203  	_1_pExpr = (*XExpr)(_pItem.XpExpr)
 79204  	if (int32(_flags)&int32(4)) == int32(0) || store2(&_j, int32((*t73)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol)) <= int32(0) {
 79205  		goto _14
 79206  	}
 79207  	if (int32(_flags) & int32(8)) != 0 {
 79208  		_i -= 1
 79209  		_n -= 1
 79210  		goto _16
 79211  	}
 79212  	_sqlite3VdbeAddOp2(tls, _v, int32(_copyOp), (_j+_srcReg)-int32(1), _target+_i)
 79213  _16:
 79214  	goto _20
 79215  _14:
 79216  	if ((int32(_flags) & int32(2)) != int32(0)) && _sqlite3ExprIsConstant(tls, _1_pExpr) != 0 {
 79217  		_sqlite3ExprCodeAtInit(tls, _pParse, _1_pExpr, _target+_i)
 79218  		goto _20
 79219  	}
 79220  	_6_inReg = _sqlite3ExprCodeTarget(tls, _pParse, _1_pExpr, _target+_i)
 79221  	if _6_inReg == (_target + _i) {
 79222  		goto _21
 79223  	}
 79224  	if (((int32(_copyOp) == int32(64)) && (int32(store63(&_7_pOp, _sqlite3VdbeGetOp(tls, _v, int32(-1))).Xopcode) == int32(64))) && (((_7_pOp.Xp1 + _7_pOp.Xp3) + int32(1)) == _6_inReg)) && (((_7_pOp.Xp2 + _7_pOp.Xp3) + int32(1)) == (_target + _i)) {
 79225  		_7_pOp.Xp3 += 1
 79226  		goto _26
 79227  	}
 79228  	_sqlite3VdbeAddOp2(tls, _v, int32(_copyOp), _6_inReg, _target+_i)
 79229  _26:
 79230  _21:
 79231  _20:
 79232  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(32)
 79233  	goto _9
 79234  _12:
 79235  	return _n
 79236  }
 79237  
 79238  var _sqlite3ExprCodeExprListØ00__func__Ø000 [24]int8
 79239  
 79240  func init() {
 79241  	crt.Xstrncpy(nil, &_sqlite3ExprCodeExprListØ00__func__Ø000[0], str(99648), 24)
 79242  }
 79243  
 79244  // C comment
 79245  //  /*
 79246  //  ** Walk an expression tree.  Return non-zero if the expression is constant
 79247  //  ** and 0 if it involves variables or function calls.
 79248  //  **
 79249  //  ** For the purposes of this function, a double-quoted string (ex: "abc")
 79250  //  ** is considered a variable but a single-quoted string (ex: 'abc') is
 79251  //  ** a constant.
 79252  //  */
 79253  func _sqlite3ExprIsConstant(tls *crt.TLS, _p *XExpr) (r0 int32) {
 79254  	return _exprIsConst(tls, _p, int32(1), int32(0))
 79255  }
 79256  
 79257  func _exprIsConst(tls *crt.TLS, _p *XExpr, _initFlag int32, _iCur int32) (r0 int32) {
 79258  	var _w XWalker
 79259  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint64(48))
 79260  	_w.XeCode = uint8(_initFlag)
 79261  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _exprNodeIsConstant
 79262  	*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _selectNodeIsConstant
 79263  	*(*int32)(unsafe.Pointer(&_w.Xu)) = _iCur
 79264  	_sqlite3WalkExpr(tls, &_w, _p)
 79265  	return int32(_w.XeCode)
 79266  }
 79267  
 79268  // C comment
 79269  //  /*
 79270  //  ** These routines are Walker callbacks used to check expressions to
 79271  //  ** see if they are "constant" for some definition of constant.  The
 79272  //  ** Walker.eCode value determines the type of "constant" we are looking
 79273  //  ** for.
 79274  //  **
 79275  //  ** These callback routines are used to implement the following:
 79276  //  **
 79277  //  **     sqlite3ExprIsConstant()                  pWalker->eCode==1
 79278  //  **     sqlite3ExprIsConstantNotJoin()           pWalker->eCode==2
 79279  //  **     sqlite3ExprIsTableConstant()             pWalker->eCode==3
 79280  //  **     sqlite3ExprIsConstantOrFunction()        pWalker->eCode==4 or 5
 79281  //  **
 79282  //  ** In all cases, the callbacks set Walker.eCode=0 and abort if the expression
 79283  //  ** is found to not be a constant.
 79284  //  **
 79285  //  ** The sqlite3ExprIsConstantOrFunction() is used for evaluating expressions
 79286  //  ** in a CREATE TABLE statement.  The Walker.eCode value is 5 when parsing
 79287  //  ** an existing schema and 4 when processing a new statement.  A bound
 79288  //  ** parameter raises an error for new statements, but is silently converted
 79289  //  ** to NULL for existing schemas.  This allows sqlite_master tables that
 79290  //  ** contain a bound parameter because they were generated by older versions
 79291  //  ** of SQLite to be parsed by newer versions of SQLite without raising a
 79292  //  ** malformed schema error.
 79293  //  */
 79294  func _exprNodeIsConstant(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 79295  	if (int32(_pWalker.XeCode) == int32(2)) && ((_pExpr.Xflags & uint32(1)) != (0)) {
 79296  		_pWalker.XeCode = 0
 79297  		return int32(2)
 79298  	}
 79299  	switch int32(_pExpr.Xop) {
 79300  	case int32(27):
 79301  		goto _4
 79302  	case int32(135):
 79303  		goto _9
 79304  	case int32(151):
 79305  		goto _3
 79306  	case int32(152):
 79307  		goto _4
 79308  	case int32(153):
 79309  		goto _4
 79310  	case int32(154):
 79311  		goto _4
 79312  	case int32(160):
 79313  		goto _15
 79314  	default:
 79315  		goto _18
 79316  	}
 79317  
 79318  _3:
 79319  	if (int32(_pWalker.XeCode) >= int32(4)) || ((_pExpr.Xflags & uint32(524288)) != (0)) {
 79320  		return int32(0)
 79321  	}
 79322  	_pWalker.XeCode = 0
 79323  	return int32(2)
 79324  
 79325  _4:
 79326  	if (int32(_pWalker.XeCode) == int32(3)) && (_pExpr.XiTable == (*(*int32)(unsafe.Pointer(&_pWalker.Xu)))) {
 79327  		return int32(0)
 79328  	}
 79329  _15:
 79330  	_pWalker.XeCode = 0
 79331  	return int32(2)
 79332  
 79333  _9:
 79334  	if int32(_pWalker.XeCode) == int32(5) {
 79335  		_pExpr.Xop = uint8(101)
 79336  		goto _18
 79337  	}
 79338  	if int32(_pWalker.XeCode) == int32(4) {
 79339  		_pWalker.XeCode = 0
 79340  		return int32(2)
 79341  	}
 79342  _18:
 79343  	return int32(0)
 79344  }
 79345  
 79346  func _selectNodeIsConstant(tls *crt.TLS, _pWalker *XWalker, _NotUsed *XSelect) (r0 int32) {
 79347  	_pWalker.XeCode = 0
 79348  	return int32(2)
 79349  }
 79350  
 79351  // C comment
 79352  //  /*
 79353  //  ** Factor out the code of the given expression to initialization time.
 79354  //  **
 79355  //  ** If regDest>=0 then the result is always stored in that register and the
 79356  //  ** result is not reusable.  If regDest<0 then this routine is free to
 79357  //  ** store the value whereever it wants.  The register where the expression
 79358  //  ** is stored is returned.  When regDest<0, two identical expressions will
 79359  //  ** code to the same register.
 79360  //  */
 79361  func _sqlite3ExprCodeAtInit(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _regDest int32) (r0 int32) {
 79362  	var _1_i int32
 79363  	var _p *XExprList
 79364  	var _1_pItem, _4_pItem *TExprList_item
 79365  	func() {
 79366  		if _pParse.XokConstFactor == 0 {
 79367  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94994), unsafe.Pointer(&_sqlite3ExprCodeAtInitØ00__func__Ø000), unsafe.Pointer(str(99672)))
 79368  			crt.X__builtin_abort(tls)
 79369  		}
 79370  	}()
 79371  	_p = (*XExprList)(_pParse.XpConstExpr)
 79372  	if _regDest >= int32(0) || _p == nil {
 79373  		goto _3
 79374  	}
 79375  	*func() *int32 { _1_pItem = (*TExprList_item)(unsafe.Pointer(&_p.Xa)); return &_1_i }() = _p.XnExpr
 79376  _4:
 79377  	if _1_i <= int32(0) {
 79378  		goto _7
 79379  	}
 79380  	if (((uint32(_1_pItem.Xdone>>2) << 31) >> 31) != 0) && (_sqlite3ExprCompare(tls, (*XExpr)(_1_pItem.XpExpr), _pExpr, int32(-1)) == int32(0)) {
 79381  		return *(*int32)(unsafe.Pointer(&_1_pItem.Xu))
 79382  	}
 79383  	*func() *int32 { *(*uintptr)(unsafe.Pointer(&_1_pItem)) += uintptr(32); return &_1_i }() -= 1
 79384  	goto _4
 79385  _7:
 79386  _3:
 79387  	_pExpr = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.Xdb), _pExpr, int32(0))
 79388  	_p = _sqlite3ExprListAppend(tls, _pParse, _p, _pExpr)
 79389  	if _p == nil {
 79390  		goto _10
 79391  	}
 79392  	_4_pItem = elem59((*TExprList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnExpr-int32(1)))
 79393  	storebits5(&_4_pItem.Xdone, int8(bool2int(_regDest < int32(0))), 4, 2)
 79394  	if _regDest < int32(0) {
 79395  		_regDest = preInc2(&_pParse.XnMem, 1)
 79396  	}
 79397  	*(*int32)(unsafe.Pointer(&_4_pItem.Xu)) = _regDest
 79398  _10:
 79399  	*(**XExprList)(unsafe.Pointer(&_pParse.XpConstExpr)) = _p
 79400  	return _regDest
 79401  }
 79402  
 79403  var _sqlite3ExprCodeAtInitØ00__func__Ø000 [22]int8
 79404  
 79405  func init() {
 79406  	crt.Xstrncpy(nil, &_sqlite3ExprCodeAtInitØ00__func__Ø000[0], str(99694), 22)
 79407  }
 79408  
 79409  // C comment
 79410  //  /*
 79411  //  ** Change the opcode at addr into OP_Noop
 79412  //  */
 79413  func _sqlite3VdbeChangeToNoop(tls *crt.TLS, _p *TVdbe, _addr int32) (r0 int32) {
 79414  	var _pOp *XVdbeOp
 79415  	if ((*Xsqlite3)(_p.Xdb).XmallocFailed) != 0 {
 79416  		return int32(0)
 79417  	}
 79418  	func() {
 79419  		if _addr < int32(0) || _addr >= _p.XnOp {
 79420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72328), unsafe.Pointer(&_sqlite3VdbeChangeToNoopØ00__func__Ø000), unsafe.Pointer(str(99716)))
 79421  			crt.X__builtin_abort(tls)
 79422  		}
 79423  	}()
 79424  	_pOp = elem63((*XVdbeOp)(_p.XaOp), uintptr(_addr))
 79425  	_freeP4(tls, (*Xsqlite3)(_p.Xdb), int32(_pOp.Xp4type), *(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 79426  	_pOp.Xp4type = 0
 79427  	*(**int8)(unsafe.Pointer(&_pOp.Xp4)) = nil
 79428  	_pOp.Xopcode = uint8(164)
 79429  	return int32(1)
 79430  }
 79431  
 79432  var _sqlite3VdbeChangeToNoopØ00__func__Ø000 [24]int8
 79433  
 79434  func init() {
 79435  	crt.Xstrncpy(nil, &_sqlite3VdbeChangeToNoopØ00__func__Ø000[0], str(99739), 24)
 79436  }
 79437  
 79438  // C comment
 79439  //  /*
 79440  //  ** Return the address of the next instruction to be inserted.
 79441  //  */
 79442  func _sqlite3VdbeCurrentAddr(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 79443  	func() {
 79444  		if _p.Xmagic != uint32(381479589) {
 79445  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72061), unsafe.Pointer(&_sqlite3VdbeCurrentAddrØ00__func__Ø000), unsafe.Pointer(str(37597)))
 79446  			crt.X__builtin_abort(tls)
 79447  		}
 79448  	}()
 79449  	return _p.XnOp
 79450  }
 79451  
 79452  var _sqlite3VdbeCurrentAddrØ00__func__Ø000 [23]int8
 79453  
 79454  func init() {
 79455  	crt.Xstrncpy(nil, &_sqlite3VdbeCurrentAddrØ00__func__Ø000[0], str(99763), 23)
 79456  }
 79457  
 79458  // C comment
 79459  //  /*
 79460  //  ** Add code that will check to make sure the N registers starting at iMem
 79461  //  ** form a distinct entry.  iTab is a sorting index that holds previously
 79462  //  ** seen combinations of the N values.  A new entry is made in iTab
 79463  //  ** if the current N values are new.
 79464  //  **
 79465  //  ** A jump to addrRepeat is made and the N+1 values are popped from the
 79466  //  ** stack if the top N elements are not distinct.
 79467  //  */
 79468  func _codeDistinct(tls *crt.TLS, _pParse *XParse, _iTab int32, _addrRepeat int32, _N int32, _iMem int32) {
 79469  	var _r1 int32
 79470  	var _v *TVdbe
 79471  	_v = (*TVdbe)(_pParse.XpVdbe)
 79472  	_r1 = _sqlite3GetTempReg(tls, _pParse)
 79473  	_sqlite3VdbeAddOp4Int(tls, _v, int32(30), _iTab, _addrRepeat, _iMem, _N)
 79474  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _iMem, _N, _r1)
 79475  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iTab, _r1, _iMem, _N)
 79476  	_sqlite3VdbeChangeP5(tls, _v, uint16(16))
 79477  	_sqlite3ReleaseTempReg(tls, _pParse, _r1)
 79478  }
 79479  
 79480  // C comment
 79481  //  /*
 79482  //  ** Allocate a single new register for use to hold some intermediate result.
 79483  //  */
 79484  func _sqlite3GetTempReg(tls *crt.TLS, _pParse *XParse) (r0 int32) {
 79485  	if int32(_pParse.XnTempReg) == int32(0) {
 79486  		return preInc2(&_pParse.XnMem, 1)
 79487  	}
 79488  	return *elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(preInc3(&_pParse.XnTempReg, byte(255))))
 79489  }
 79490  
 79491  // C comment
 79492  //  /*
 79493  //  ** Deallocate a register, making available for reuse for some other
 79494  //  ** purpose.
 79495  //  **
 79496  //  ** If a register is currently being used by the column cache, then
 79497  //  ** the deallocation is deferred until the column cache line that uses
 79498  //  ** the register becomes stale.
 79499  //  */
 79500  func _sqlite3ReleaseTempReg(tls *crt.TLS, _pParse *XParse, _iReg int32) {
 79501  	var _1_i int32
 79502  	var _1_p *TyColCache
 79503  	if _iReg == 0 || int32(_pParse.XnTempReg) >= int32(8) {
 79504  		goto _1
 79505  	}
 79506  	*func() **TyColCache { _1_i = int32(0); return &_1_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 79507  _2:
 79508  	if _1_i >= int32(_pParse.XnColCache) {
 79509  		goto _5
 79510  	}
 79511  	if _1_p.XiReg == _iReg {
 79512  		_1_p.XtempReg = uint8(1)
 79513  		return
 79514  	}
 79515  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _1_i += 1; return &_1_p }())) += uintptr(20)
 79516  	goto _2
 79517  _5:
 79518  	*elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(postInc3(&_pParse.XnTempReg, byte(1)))) = _iReg
 79519  _1:
 79520  }
 79521  
 79522  // C comment
 79523  //  /*
 79524  //  ** Allocate or deallocate a block of nReg consecutive registers.
 79525  //  */
 79526  func _sqlite3GetTempRange(tls *crt.TLS, _pParse *XParse, _nReg int32) (r0 int32) {
 79527  	var _i, _n int32
 79528  	if _nReg == int32(1) {
 79529  		return _sqlite3GetTempReg(tls, _pParse)
 79530  	}
 79531  	_i = _pParse.XiRangeReg
 79532  	_n = _pParse.XnRangeReg
 79533  	if _nReg <= _n {
 79534  		func() {
 79535  			if _usedAsColumnCache(tls, _pParse, _i, (_i+_n)-int32(1)) != 0 {
 79536  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96056), unsafe.Pointer(&_sqlite3GetTempRangeØ00__func__Ø000), unsafe.Pointer(str(99786)))
 79537  				crt.X__builtin_abort(tls)
 79538  			}
 79539  		}()
 79540  		_pParse.XiRangeReg += _nReg
 79541  		_pParse.XnRangeReg -= _nReg
 79542  		goto _4
 79543  	}
 79544  	_i = _pParse.XnMem + int32(1)
 79545  	_pParse.XnMem += _nReg
 79546  _4:
 79547  	return _i
 79548  }
 79549  
 79550  // C comment
 79551  //  /*
 79552  //  ** Return true if any register in the range iFrom..iTo (inclusive)
 79553  //  ** is used as part of the column cache.
 79554  //  **
 79555  //  ** This routine is used within assert() and testcase() macros only
 79556  //  ** and does not appear in a normal build.
 79557  //  */
 79558  func _usedAsColumnCache(tls *crt.TLS, _pParse *XParse, _iFrom int32, _iTo int32) (r0 int32) {
 79559  	var _i, _1_r int32
 79560  	var _p *TyColCache
 79561  	*func() **TyColCache { _i = int32(0); return &_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 79562  _0:
 79563  	if _i >= int32(_pParse.XnColCache) {
 79564  		goto _3
 79565  	}
 79566  	_1_r = _p.XiReg
 79567  	if (_1_r >= _iFrom) && (_1_r <= _iTo) {
 79568  		return int32(1)
 79569  	}
 79570  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
 79571  	goto _0
 79572  _3:
 79573  	return int32(0)
 79574  }
 79575  
 79576  var _sqlite3GetTempRangeØ00__func__Ø000 [20]int8
 79577  
 79578  func init() {
 79579  	crt.Xstrncpy(nil, &_sqlite3GetTempRangeØ00__func__Ø000[0], str(99823), 20)
 79580  }
 79581  
 79582  // C comment
 79583  //  /*
 79584  //  ** Generate code that will push the record in registers regData
 79585  //  ** through regData+nData-1 onto the sorter.
 79586  //  */
 79587  func _pushOntoSorter(tls *crt.TLS, _pParse *XParse, _pSort *XSortCtx, _pSelect *XSelect, _regData int32, _regOrigData int32, _nData int32, _nPrefixReg int32) {
 79588  	var _bSeq, _nExpr, _nBase, _regBase, _regRecord, _nOBSat, _op, _iLimit, _5_regPrevKey, _5_addrFirst, _5_addrJmp, _5_nKey, _11_addr, _11_r1, _13_iBrk int32
 79589  	var _v *TVdbe
 79590  	var _5_pKI *XKeyInfo
 79591  	var _5_pOp *XVdbeOp
 79592  	_v = (*TVdbe)(_pParse.XpVdbe)
 79593  	_bSeq = bool2int((int32(_pSort.XsortFlags) & int32(1)) == int32(0))
 79594  	_nExpr = (*XExprList)(_pSort.XpOrderBy).XnExpr
 79595  	_nBase = (_nExpr + _bSeq) + _nData
 79596  	_regRecord = preInc2(&_pParse.XnMem, 1)
 79597  	_nOBSat = _pSort.XnOBSat
 79598  	func() {
 79599  		if _bSeq != int32(0) && _bSeq != int32(1) {
 79600  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117043), unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000), unsafe.Pointer(str(99843)))
 79601  			crt.X__builtin_abort(tls)
 79602  		}
 79603  	}()
 79604  	func() {
 79605  		if _nData != int32(1) && _regData != _regOrigData && _regOrigData != int32(0) {
 79606  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117044), unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000), unsafe.Pointer(str(99862)))
 79607  			crt.X__builtin_abort(tls)
 79608  		}
 79609  	}()
 79610  	if _nPrefixReg != 0 {
 79611  		func() {
 79612  			if _nPrefixReg != (_nExpr + _bSeq) {
 79613  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117046), unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000), unsafe.Pointer(str(99913)))
 79614  				crt.X__builtin_abort(tls)
 79615  			}
 79616  		}()
 79617  		_regBase = (_regData - _nExpr) - _bSeq
 79618  		goto _10
 79619  	}
 79620  	_regBase = _pParse.XnMem + int32(1)
 79621  	_pParse.XnMem += _nBase
 79622  _10:
 79623  	func() {
 79624  		if _pSelect.XiOffset != int32(0) && _pSelect.XiLimit == int32(0) {
 79625  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117052), unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000), unsafe.Pointer(str(99936)))
 79626  			crt.X__builtin_abort(tls)
 79627  		}
 79628  	}()
 79629  	_iLimit = func() int32 {
 79630  		if _pSelect.XiOffset != 0 {
 79631  			return (_pSelect.XiOffset + int32(1))
 79632  		}
 79633  		return _pSelect.XiLimit
 79634  	}()
 79635  	_pSort.XlabelDone = _sqlite3VdbeMakeLabel(tls, _v)
 79636  	_sqlite3ExprCodeExprList(tls, _pParse, (*XExprList)(_pSort.XpOrderBy), _regBase, _regOrigData, uint8(int32(1)|func() int32 {
 79637  		if _regOrigData != 0 {
 79638  			return int32(4)
 79639  		}
 79640  		return int32(0)
 79641  	}()))
 79642  	if _bSeq != 0 {
 79643  		_sqlite3VdbeAddOp2(tls, _v, int32(116), _pSort.XiECursor, _regBase+_nExpr)
 79644  	}
 79645  	if (_nPrefixReg == int32(0)) && (_nData > int32(0)) {
 79646  		_sqlite3ExprCodeMove(tls, _pParse, _regData, (_regBase+_nExpr)+_bSeq, _nData)
 79647  	}
 79648  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regBase+_nOBSat, _nBase-_nOBSat, _regRecord)
 79649  	if _nOBSat <= int32(0) {
 79650  		goto _21
 79651  	}
 79652  	_5_regPrevKey = _pParse.XnMem + int32(1)
 79653  	_pParse.XnMem += _pSort.XnOBSat
 79654  	_5_nKey = (_nExpr - _pSort.XnOBSat) + _bSeq
 79655  	if _bSeq != 0 {
 79656  		_5_addrFirst = _sqlite3VdbeAddOp1(tls, _v, int32(22), _regBase+_nExpr)
 79657  		goto _23
 79658  	}
 79659  	_5_addrFirst = _sqlite3VdbeAddOp1(tls, _v, int32(112), _pSort.XiECursor)
 79660  _23:
 79661  	_sqlite3VdbeAddOp3(tls, _v, int32(98), _5_regPrevKey, _regBase, _pSort.XnOBSat)
 79662  	_5_pOp = _sqlite3VdbeGetOp(tls, _v, _pSort.XaddrSortIndex)
 79663  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 79664  		return
 79665  	}
 79666  	_5_pOp.Xp2 = _5_nKey + _nData
 79667  	_5_pKI = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_5_pOp.Xp4)))
 79668  	crt.Xmemset(tls, unsafe.Pointer(_5_pKI.XaSortOrder), int32(0), uint64(_5_pKI.XnField))
 79669  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), (*int8)(unsafe.Pointer(_5_pKI)), int32(-5))
 79670  	*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_5_pOp.Xp4)))) = _keyInfoFromExprList(tls, _pParse, (*XExprList)(_pSort.XpOrderBy), _nOBSat, int32(_5_pKI.XnXField)-int32(1))
 79671  	_5_addrJmp = _sqlite3VdbeCurrentAddr(tls, _v)
 79672  	_sqlite3VdbeAddOp3(tls, _v, int32(18), _5_addrJmp+int32(1), int32(0), _5_addrJmp+int32(1))
 79673  	_pSort.XlabelBkOut = _sqlite3VdbeMakeLabel(tls, _v)
 79674  	_pSort.XregReturn = preInc2(&_pParse.XnMem, 1)
 79675  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _pSort.XregReturn, _pSort.XlabelBkOut)
 79676  	_sqlite3VdbeAddOp1(tls, _v, int32(135), _pSort.XiECursor)
 79677  	if _iLimit != 0 {
 79678  		_sqlite3VdbeAddOp2(tls, _v, int32(22), _iLimit, _pSort.XlabelDone)
 79679  	}
 79680  	_sqlite3VdbeJumpHere(tls, _v, _5_addrFirst)
 79681  	_sqlite3ExprCodeMove(tls, _pParse, _regBase, _5_regPrevKey, _pSort.XnOBSat)
 79682  	_sqlite3VdbeJumpHere(tls, _v, _5_addrJmp)
 79683  _21:
 79684  	if (int32(_pSort.XsortFlags) & int32(1)) != 0 {
 79685  		_op = int32(127)
 79686  		goto _27
 79687  	}
 79688  	_op = int32(128)
 79689  _27:
 79690  	_sqlite3VdbeAddOp4Int(tls, _v, _op, _pSort.XiECursor, _regRecord, _regBase+_nOBSat, _nBase-_nOBSat)
 79691  	if _iLimit == 0 {
 79692  		goto _28
 79693  	}
 79694  	_11_r1 = int32(0)
 79695  	_11_addr = _sqlite3VdbeAddOp1(tls, _v, int32(47), _iLimit)
 79696  	_sqlite3VdbeAddOp1(tls, _v, int32(33), _pSort.XiECursor)
 79697  	if _pSort.XbOrderedInnerLoop != 0 {
 79698  		_11_r1 = preInc2(&_pParse.XnMem, 1)
 79699  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _pSort.XiECursor, _nExpr, _11_r1)
 79700  		_sqlite3VdbeComment(tls, _v, str(93782))
 79701  	}
 79702  	_sqlite3VdbeAddOp1(tls, _v, int32(120), _pSort.XiECursor)
 79703  	if _pSort.XbOrderedInnerLoop != 0 {
 79704  		_13_iBrk = _sqlite3VdbeCurrentAddr(tls, _v) + int32(2)
 79705  		_sqlite3VdbeAddOp3(tls, _v, int32(78), _regBase+_nExpr, _13_iBrk, _11_r1)
 79706  		_sqlite3VdbeChangeP5(tls, _v, uint16(128))
 79707  	}
 79708  	_sqlite3VdbeJumpHere(tls, _v, _11_addr)
 79709  _28:
 79710  }
 79711  
 79712  var _pushOntoSorterØ00__func__Ø000 [15]int8
 79713  
 79714  func init() {
 79715  	crt.Xstrncpy(nil, &_pushOntoSorterØ00__func__Ø000[0], str(99978), 15)
 79716  }
 79717  
 79718  // C comment
 79719  //  /*
 79720  //  ** Generate code to move content from registers iFrom...iFrom+nReg-1
 79721  //  ** over to iTo..iTo+nReg-1. Keep the column cache up-to-date.
 79722  //  */
 79723  func _sqlite3ExprCodeMove(tls *crt.TLS, _pParse *XParse, _iFrom int32, _iTo int32, _nReg int32) {
 79724  	func() {
 79725  		if _iFrom < (_iTo+_nReg) && (_iFrom+_nReg) > _iTo {
 79726  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94255), unsafe.Pointer(&_sqlite3ExprCodeMoveØ00__func__Ø000), unsafe.Pointer(str(99993)))
 79727  			crt.X__builtin_abort(tls)
 79728  		}
 79729  	}()
 79730  	_sqlite3VdbeAddOp3(tls, (*TVdbe)(_pParse.XpVdbe), int32(63), _iFrom, _iTo, _nReg)
 79731  	_sqlite3ExprCacheRemove(tls, _pParse, _iFrom, _nReg)
 79732  }
 79733  
 79734  var _sqlite3ExprCodeMoveØ00__func__Ø000 [20]int8
 79735  
 79736  func init() {
 79737  	crt.Xstrncpy(nil, &_sqlite3ExprCodeMoveØ00__func__Ø000[0], str(100028), 20)
 79738  }
 79739  
 79740  // C comment
 79741  //  /*
 79742  //  ** Given an expression list, generate a KeyInfo structure that records
 79743  //  ** the collating sequence for each expression in that expression list.
 79744  //  **
 79745  //  ** If the ExprList is an ORDER BY or GROUP BY clause then the resulting
 79746  //  ** KeyInfo structure is appropriate for initializing a virtual index to
 79747  //  ** implement that clause.  If the ExprList is the result set of a SELECT
 79748  //  ** then the KeyInfo structure is appropriate for initializing a virtual
 79749  //  ** index to implement a DISTINCT test.
 79750  //  **
 79751  //  ** Space to hold the KeyInfo structure is obtained from malloc.  The calling
 79752  //  ** function is responsible for seeing that this structure is eventually
 79753  //  ** freed.
 79754  //  */
 79755  func _keyInfoFromExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _iStart int32, _nExtra int32) (r0 *XKeyInfo) {
 79756  	var _nExpr, _i int32
 79757  	var _db *Xsqlite3
 79758  	var _pItem *TExprList_item
 79759  	var _pInfo *XKeyInfo
 79760  	var _2_pColl *XCollSeq
 79761  	_db = (*Xsqlite3)(_pParse.Xdb)
 79762  	_nExpr = _pList.XnExpr
 79763  	_pInfo = _sqlite3KeyInfoAlloc(tls, _db, _nExpr-_iStart, _nExtra+int32(1))
 79764  	if _pInfo == nil {
 79765  		goto _0
 79766  	}
 79767  	func() {
 79768  		if _sqlite3KeyInfoIsWriteable(tls, _pInfo) == 0 {
 79769  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117632), unsafe.Pointer(&_keyInfoFromExprListØ00__func__Ø000), unsafe.Pointer(str(100048)))
 79770  			crt.X__builtin_abort(tls)
 79771  		}
 79772  	}()
 79773  	*func() **TExprList_item { _i = _iStart; return &_pItem }() = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pList.Xa)) + uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(_iStart)*uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(32)))))))))))
 79774  _3:
 79775  	if _i >= _nExpr {
 79776  		goto _6
 79777  	}
 79778  	_2_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pItem.XpExpr))
 79779  	if _2_pColl == nil {
 79780  		_2_pColl = (*XCollSeq)(_db.XpDfltColl)
 79781  	}
 79782  	*elem64((**XCollSeq)(unsafe.Pointer(&_pInfo.XaColl)), uintptr(_i-_iStart)) = _2_pColl
 79783  	*elem15(_pInfo.XaSortOrder, uintptr(_i-_iStart)) = _pItem.XsortOrder
 79784  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(32)
 79785  	goto _3
 79786  _6:
 79787  _0:
 79788  	return _pInfo
 79789  }
 79790  
 79791  var _keyInfoFromExprListØ00__func__Ø000 [20]int8
 79792  
 79793  func init() {
 79794  	crt.Xstrncpy(nil, &_keyInfoFromExprListØ00__func__Ø000[0], str(100081), 20)
 79795  }
 79796  
 79797  func _sqlite3ReleaseTempRange(tls *crt.TLS, _pParse *XParse, _iReg int32, _nReg int32) {
 79798  	if _nReg == int32(1) {
 79799  		_sqlite3ReleaseTempReg(tls, _pParse, _iReg)
 79800  		return
 79801  	}
 79802  	_sqlite3ExprCacheRemove(tls, _pParse, _iReg, _nReg)
 79803  	if _nReg > _pParse.XnRangeReg {
 79804  		_pParse.XnRangeReg = _nReg
 79805  		_pParse.XiRangeReg = _iReg
 79806  	}
 79807  }
 79808  
 79809  // C comment
 79810  //  /*
 79811  //  ** Resolve label "x" to be the address of the next instruction to
 79812  //  ** be inserted.  The parameter "x" must have been obtained from
 79813  //  ** a prior call to sqlite3VdbeMakeLabel().
 79814  //  */
 79815  func _sqlite3VdbeResolveLabel(tls *crt.TLS, _v *TVdbe, _x int32) {
 79816  	var _j int32
 79817  	var _p *XParse
 79818  	_p = (*XParse)(_v.XpParse)
 79819  	_j = int32(-1) - _x
 79820  	func() {
 79821  		if _v.Xmagic != uint32(381479589) {
 79822  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71803), unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000), unsafe.Pointer(str(44852)))
 79823  			crt.X__builtin_abort(tls)
 79824  		}
 79825  	}()
 79826  	func() {
 79827  		if _j >= _p.XnLabel {
 79828  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71804), unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000), unsafe.Pointer(str(100101)))
 79829  			crt.X__builtin_abort(tls)
 79830  		}
 79831  	}()
 79832  	func() {
 79833  		if _j < int32(0) {
 79834  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71805), unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000), unsafe.Pointer(str(100113)))
 79835  			crt.X__builtin_abort(tls)
 79836  		}
 79837  	}()
 79838  	if _p.XaLabel != nil {
 79839  		*elem8(_p.XaLabel, uintptr(_j)) = _v.XnOp
 79840  	}
 79841  }
 79842  
 79843  var _sqlite3VdbeResolveLabelØ00__func__Ø000 [24]int8
 79844  
 79845  func init() {
 79846  	crt.Xstrncpy(nil, &_sqlite3VdbeResolveLabelØ00__func__Ø000[0], str(100118), 24)
 79847  }
 79848  
 79849  // C comment
 79850  //  /* Forward references */
 79851  func _multiSelectOrderBy(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
 79852  	var _i, _j, _regAddrA, _regAddrB, _addrSelectA, _addrSelectB, _regOutA, _regOutB, _addrOutA, _addrOutB, _addrEofA, _addrEofA_noB, _addrEofB, _addrAltB, _addrAeqB, _addrAgtB, _regLimitA, _regLimitB, _regPrev, _savedLimit, _savedOffset, _labelCmpr, _labelEnd, _addr1, _op, _nOrderBy, _iSub1, _iSub2, _9_nExpr int32
 79853  	var _aPermute *int32
 79854  	var _db *Xsqlite3
 79855  	var _v *TVdbe
 79856  	var _pOrderBy *XExprList
 79857  	var _2_pItem, _5_pItem *TExprList_item
 79858  	var _pPrior, _24_pFirst *XSelect
 79859  	var _4_pNew *XExpr
 79860  	var _pKeyDup, _pKeyMerge *XKeyInfo
 79861  	var _destA, _destB XSelectDest
 79862  	_addrOutB = int32(0)
 79863  	_pKeyDup = nil
 79864  	func() {
 79865  		if (*XExprList)(_p.XpOrderBy) == nil {
 79866  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119400), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100142)))
 79867  			crt.X__builtin_abort(tls)
 79868  		}
 79869  	}()
 79870  	func() {
 79871  		if _pKeyDup != nil {
 79872  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119401), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100157)))
 79873  			crt.X__builtin_abort(tls)
 79874  		}
 79875  	}()
 79876  	_db = (*Xsqlite3)(_pParse.Xdb)
 79877  	_v = (*TVdbe)(_pParse.XpVdbe)
 79878  	func() {
 79879  		if _v == nil {
 79880  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119404), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(42019)))
 79881  			crt.X__builtin_abort(tls)
 79882  		}
 79883  	}()
 79884  	_labelEnd = _sqlite3VdbeMakeLabel(tls, _v)
 79885  	_labelCmpr = _sqlite3VdbeMakeLabel(tls, _v)
 79886  	_op = int32(_p.Xop)
 79887  	_pPrior = (*XSelect)(_p.XpPrior)
 79888  	func() {
 79889  		if (*XExprList)(_pPrior.XpOrderBy) != nil {
 79890  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119413), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100168)))
 79891  			crt.X__builtin_abort(tls)
 79892  		}
 79893  	}()
 79894  	_pOrderBy = (*XExprList)(_p.XpOrderBy)
 79895  	func() {
 79896  		if _pOrderBy == nil {
 79897  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119415), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100188)))
 79898  			crt.X__builtin_abort(tls)
 79899  		}
 79900  	}()
 79901  	_nOrderBy = _pOrderBy.XnExpr
 79902  	if _op == int32(116) {
 79903  		goto _10
 79904  	}
 79905  	_i = int32(1)
 79906  _11:
 79907  	if int32(_db.XmallocFailed) != int32(0) || _i > ((*XExprList)(_p.XpEList).XnExpr) {
 79908  		goto _15
 79909  	}
 79910  	*func() **TExprList_item { _j = int32(0); return &_2_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa))
 79911  _16:
 79912  	if _j >= _nOrderBy {
 79913  		goto _19
 79914  	}
 79915  	func() {
 79916  		if int32((*t73)(unsafe.Pointer(&_2_pItem.Xu)).XiOrderByCol) <= int32(0) {
 79917  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119426), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100197)))
 79918  			crt.X__builtin_abort(tls)
 79919  		}
 79920  	}()
 79921  	if int32((*t73)(unsafe.Pointer(&_2_pItem.Xu)).XiOrderByCol) == _i {
 79922  		goto _19
 79923  	}
 79924  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _j += 1; return &_2_pItem }())) += uintptr(32)
 79925  	goto _16
 79926  _19:
 79927  	if _j != _nOrderBy {
 79928  		goto _23
 79929  	}
 79930  	_4_pNew = _sqlite3Expr(tls, _db, int32(134), nil)
 79931  	if _4_pNew == nil {
 79932  		return _sqlite3NomemError(tls, int32(119431))
 79933  	}
 79934  	_4_pNew.Xflags |= uint32(1024)
 79935  	*(*int32)(unsafe.Pointer(&_4_pNew.Xu)) = _i
 79936  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = store72(&_pOrderBy, _sqlite3ExprListAppend(tls, _pParse, _pOrderBy, _4_pNew))
 79937  	if _pOrderBy != nil {
 79938  		(*t73)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(postInc2(&_nOrderBy, 1))).Xu))).XiOrderByCol = uint16(_i)
 79939  	}
 79940  _23:
 79941  	_i += 1
 79942  	goto _11
 79943  _15:
 79944  _10:
 79945  	_aPermute = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(4)*uint64(_nOrderBy+int32(1))))
 79946  	if _aPermute == nil {
 79947  		goto _26
 79948  	}
 79949  	*elem8(_aPermute, 0) = _nOrderBy
 79950  	*func() **TExprList_item { _i = int32(1); return &_5_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa))
 79951  _27:
 79952  	if _i > _nOrderBy {
 79953  		goto _30
 79954  	}
 79955  	func() {
 79956  		if int32((*t73)(unsafe.Pointer(&_5_pItem.Xu)).XiOrderByCol) <= int32(0) {
 79957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119452), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100197)))
 79958  			crt.X__builtin_abort(tls)
 79959  		}
 79960  	}()
 79961  	func() {
 79962  		if int32((*t73)(unsafe.Pointer(&_5_pItem.Xu)).XiOrderByCol) > ((*XExprList)(_p.XpEList).XnExpr) {
 79963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119453), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100222)))
 79964  			crt.X__builtin_abort(tls)
 79965  		}
 79966  	}()
 79967  	*elem8(_aPermute, uintptr(_i)) = int32((*t73)(unsafe.Pointer(&_5_pItem.Xu)).XiOrderByCol) - int32(1)
 79968  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_5_pItem }())) += uintptr(32)
 79969  	goto _27
 79970  _30:
 79971  	_pKeyMerge = _multiSelectOrderByKeyInfo(tls, _pParse, _p, int32(1))
 79972  	goto _35
 79973  _26:
 79974  	_pKeyMerge = nil
 79975  _35:
 79976  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = _pOrderBy
 79977  	*(**XExprList)(unsafe.Pointer(&_pPrior.XpOrderBy)) = _sqlite3ExprListDup(tls, (*Xsqlite3)(_pParse.Xdb), _pOrderBy, int32(0))
 79978  	if _op == int32(116) {
 79979  		_regPrev = int32(0)
 79980  		goto _37
 79981  	}
 79982  	_9_nExpr = (*XExprList)(_p.XpEList).XnExpr
 79983  	func() {
 79984  		if _nOrderBy < _9_nExpr && _db.XmallocFailed == 0 {
 79985  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119474), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100263)))
 79986  			crt.X__builtin_abort(tls)
 79987  		}
 79988  	}()
 79989  	_regPrev = _pParse.XnMem + int32(1)
 79990  	_pParse.XnMem += _9_nExpr + int32(1)
 79991  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _regPrev)
 79992  	_pKeyDup = _sqlite3KeyInfoAlloc(tls, _db, _9_nExpr, int32(1))
 79993  	if _pKeyDup == nil {
 79994  		goto _41
 79995  	}
 79996  	func() {
 79997  		if _sqlite3KeyInfoIsWriteable(tls, _pKeyDup) == 0 {
 79998  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119480), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100299)))
 79999  			crt.X__builtin_abort(tls)
 80000  		}
 80001  	}()
 80002  	_i = int32(0)
 80003  _44:
 80004  	if _i >= _9_nExpr {
 80005  		goto _47
 80006  	}
 80007  	*elem64((**XCollSeq)(unsafe.Pointer(&_pKeyDup.XaColl)), uintptr(_i)) = _multiSelectCollSeq(tls, _pParse, _p, _i)
 80008  	*elem15(_pKeyDup.XaSortOrder, uintptr(_i)) = 0
 80009  	_i += 1
 80010  	goto _44
 80011  _47:
 80012  _41:
 80013  _37:
 80014  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 80015  	*(**XSelect)(unsafe.Pointer(&_pPrior.XpNext)) = nil
 80016  	_sqlite3ResolveOrderGroupBy(tls, _pParse, _p, (*XExprList)(_p.XpOrderBy), str(25700))
 80017  	if (*XSelect)(_pPrior.XpPrior) == nil {
 80018  		_sqlite3ResolveOrderGroupBy(tls, _pParse, _pPrior, (*XExprList)(_pPrior.XpOrderBy), str(25700))
 80019  	}
 80020  	_computeLimitRegisters(tls, _pParse, _p, _labelEnd)
 80021  	if _p.XiLimit != 0 && (_op == int32(116)) {
 80022  		_regLimitA = preInc2(&_pParse.XnMem, 1)
 80023  		_regLimitB = preInc2(&_pParse.XnMem, 1)
 80024  		_sqlite3VdbeAddOp2(tls, _v, int32(64), func() int32 {
 80025  			if _p.XiOffset != 0 {
 80026  				return (_p.XiOffset + int32(1))
 80027  			}
 80028  			return _p.XiLimit
 80029  		}(), _regLimitA)
 80030  		_sqlite3VdbeAddOp2(tls, _v, int32(64), _regLimitA, _regLimitB)
 80031  		goto _53
 80032  	}
 80033  	_regLimitA = store2(&_regLimitB, int32(0))
 80034  _53:
 80035  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpLimit))
 80036  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = nil
 80037  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpOffset))
 80038  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = nil
 80039  	_regAddrA = preInc2(&_pParse.XnMem, 1)
 80040  	_regAddrB = preInc2(&_pParse.XnMem, 1)
 80041  	_regOutA = preInc2(&_pParse.XnMem, 1)
 80042  	_regOutB = preInc2(&_pParse.XnMem, 1)
 80043  	_sqlite3SelectDestInit(tls, &_destA, int32(13), _regAddrA)
 80044  	_sqlite3SelectDestInit(tls, &_destB, int32(13), _regAddrB)
 80045  	_addrSelectA = _sqlite3VdbeCurrentAddr(tls, _v) + int32(1)
 80046  	_addr1 = _sqlite3VdbeAddOp3(tls, _v, int32(15), _regAddrA, int32(0), _addrSelectA)
 80047  	_sqlite3VdbeComment(tls, _v, str(100334))
 80048  	_pPrior.XiLimit = _regLimitA
 80049  	_iSub1 = _pParse.XiNextSelectId
 80050  	_sqlite3Select(tls, _pParse, _pPrior, &_destA)
 80051  	_sqlite3VdbeEndCoroutine(tls, _v, _regAddrA)
 80052  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 80053  	_addrSelectB = _sqlite3VdbeCurrentAddr(tls, _v) + int32(1)
 80054  	_addr1 = _sqlite3VdbeAddOp3(tls, _v, int32(15), _regAddrB, int32(0), _addrSelectB)
 80055  	_sqlite3VdbeComment(tls, _v, str(100346))
 80056  	_savedLimit = _p.XiLimit
 80057  	_savedOffset = _p.XiOffset
 80058  	_p.XiLimit = _regLimitB
 80059  	_p.XiOffset = int32(0)
 80060  	_iSub2 = _pParse.XiNextSelectId
 80061  	_sqlite3Select(tls, _pParse, _p, &_destB)
 80062  	_p.XiLimit = _savedLimit
 80063  	_p.XiOffset = _savedOffset
 80064  	_sqlite3VdbeEndCoroutine(tls, _v, _regAddrB)
 80065  	_sqlite3VdbeNoopComment(tls, _v, str(100359))
 80066  	_addrOutA = _generateOutputSubroutine(tls, _pParse, _p, &_destA, _pDest, _regOutA, _regPrev, _pKeyDup, _labelEnd)
 80067  	if (_op == int32(116)) || (_op == int32(115)) {
 80068  		_sqlite3VdbeNoopComment(tls, _v, str(100380))
 80069  		_addrOutB = _generateOutputSubroutine(tls, _pParse, _p, &_destB, _pDest, _regOutB, _regPrev, _pKeyDup, _labelEnd)
 80070  	}
 80071  	_sqlite3KeyInfoUnref(tls, _pKeyDup)
 80072  	if (_op == int32(117)) || (_op == int32(118)) {
 80073  		_addrEofA_noB = store2(&_addrEofA, _labelEnd)
 80074  		goto _58
 80075  	}
 80076  	_sqlite3VdbeNoopComment(tls, _v, str(100401))
 80077  	_addrEofA = _sqlite3VdbeAddOp2(tls, _v, int32(14), _regOutB, _addrOutB)
 80078  	_addrEofA_noB = _sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrB, _labelEnd)
 80079  	_sqlite3VdbeGoto(tls, _v, _addrEofA)
 80080  	_p.XnSelectRow = _sqlite3LogEstAdd(tls, _p.XnSelectRow, _pPrior.XnSelectRow)
 80081  _58:
 80082  	if _op != int32(118) {
 80083  		goto _59
 80084  	}
 80085  	_addrEofB = _addrEofA
 80086  	if int32(_p.XnSelectRow) > int32(_pPrior.XnSelectRow) {
 80087  		_p.XnSelectRow = _pPrior.XnSelectRow
 80088  	}
 80089  	goto _61
 80090  _59:
 80091  	_sqlite3VdbeNoopComment(tls, _v, str(100418))
 80092  	_addrEofB = _sqlite3VdbeAddOp2(tls, _v, int32(14), _regOutA, _addrOutA)
 80093  	_sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrA, _labelEnd)
 80094  	_sqlite3VdbeGoto(tls, _v, _addrEofB)
 80095  _61:
 80096  	_sqlite3VdbeNoopComment(tls, _v, str(100435))
 80097  	_addrAltB = _sqlite3VdbeAddOp2(tls, _v, int32(14), _regOutA, _addrOutA)
 80098  	_sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrA, _addrEofA)
 80099  	_sqlite3VdbeGoto(tls, _v, _labelCmpr)
 80100  	if _op == int32(116) {
 80101  		_addrAeqB = _addrAltB
 80102  		goto _65
 80103  	}
 80104  	if _op == int32(118) {
 80105  		_addrAeqB = _addrAltB
 80106  		_addrAltB += 1
 80107  		goto _65
 80108  	}
 80109  	_sqlite3VdbeNoopComment(tls, _v, str(100453))
 80110  	_addrAeqB = _sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrA, _addrEofA)
 80111  	_sqlite3VdbeGoto(tls, _v, _labelCmpr)
 80112  _65:
 80113  	_sqlite3VdbeNoopComment(tls, _v, str(100471))
 80114  	_addrAgtB = _sqlite3VdbeCurrentAddr(tls, _v)
 80115  	if (_op == int32(116)) || (_op == int32(115)) {
 80116  		_sqlite3VdbeAddOp2(tls, _v, int32(14), _regOutB, _addrOutB)
 80117  	}
 80118  	_sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrB, _addrEofB)
 80119  	_sqlite3VdbeGoto(tls, _v, _labelCmpr)
 80120  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 80121  	_sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrA, _addrEofA_noB)
 80122  	_sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrB, _addrEofB)
 80123  	_sqlite3VdbeResolveLabel(tls, _v, _labelCmpr)
 80124  	_sqlite3VdbeAddOp4(tls, _v, int32(96), int32(0), int32(0), int32(0), (*int8)(unsafe.Pointer(_aPermute)), int32(-12))
 80125  	_sqlite3VdbeAddOp4(tls, _v, int32(98), _destA.XiSdst, _destB.XiSdst, _nOrderBy, (*int8)(unsafe.Pointer(_pKeyMerge)), int32(-5))
 80126  	_sqlite3VdbeChangeP5(tls, _v, uint16(1))
 80127  	_sqlite3VdbeAddOp3(tls, _v, int32(18), _addrAltB, _addrAeqB, _addrAgtB)
 80128  	_sqlite3VdbeResolveLabel(tls, _v, _labelEnd)
 80129  	if int32(_pDest.XeDest) != int32(9) {
 80130  		goto _68
 80131  	}
 80132  	_24_pFirst = _pPrior
 80133  _69:
 80134  	if _24_pFirst.XpPrior != nil {
 80135  		_24_pFirst = (*XSelect)(_24_pFirst.XpPrior)
 80136  		goto _69
 80137  	}
 80138  	_generateColumnNames(tls, _pParse, (*XSrcList)(_24_pFirst.XpSrc), (*XExprList)(_24_pFirst.XpEList))
 80139  _68:
 80140  	if _p.XpPrior != nil {
 80141  		_sqlite3SelectDelete(tls, _db, (*XSelect)(_p.XpPrior))
 80142  	}
 80143  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pPrior
 80144  	*(**XSelect)(unsafe.Pointer(&_pPrior.XpNext)) = _p
 80145  	_explainComposite(tls, _pParse, int32(_p.Xop), _iSub1, _iSub2, int32(0))
 80146  	return bool2int(_pParse.XnErr != int32(0))
 80147  }
 80148  
 80149  var _multiSelectOrderByØ00__func__Ø000 [19]int8
 80150  
 80151  func init() {
 80152  	crt.Xstrncpy(nil, &_multiSelectOrderByØ00__func__Ø000[0], str(100489), 19)
 80153  }
 80154  
 80155  // C comment
 80156  //  /* Insert the end of a co-routine
 80157  //  */
 80158  func _sqlite3VdbeEndCoroutine(tls *crt.TLS, _v *TVdbe, _regYield int32) {
 80159  	_sqlite3VdbeAddOp1(tls, _v, int32(53), _regYield)
 80160  	(*XParse)(_v.XpParse).XnTempReg = 0
 80161  	(*XParse)(_v.XpParse).XnRangeReg = int32(0)
 80162  }
 80163  
 80164  func _sqlite3VdbeNoopComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interface{}) {
 80165  	var _ap []interface{}
 80166  	if _p != nil {
 80167  		_sqlite3VdbeAddOp0(tls, _p, int32(164))
 80168  		_ap = args
 80169  		_vdbeVComment(tls, _p, _zFormat, _ap)
 80170  		_ap = nil
 80171  	}
 80172  }
 80173  
 80174  // C comment
 80175  //  /*
 80176  //  ** Code an output subroutine for a coroutine implementation of a
 80177  //  ** SELECT statment.
 80178  //  **
 80179  //  ** The data to be output is contained in pIn->iSdst.  There are
 80180  //  ** pIn->nSdst columns to be output.  pDest is where the output should
 80181  //  ** be sent.
 80182  //  **
 80183  //  ** regReturn is the number of the register holding the subroutine
 80184  //  ** return address.
 80185  //  **
 80186  //  ** If regPrev>0 then it is the first register in a vector that
 80187  //  ** records the previous output.  mem[regPrev] is a flag that is false
 80188  //  ** if there has been no previous output.  If regPrev>0 then code is
 80189  //  ** generated to suppress duplicates.  pKeyInfo is used for comparing
 80190  //  ** keys.
 80191  //  **
 80192  //  ** If the LIMIT found in p->iLimit is reached, jump immediately to
 80193  //  ** iBreak.
 80194  //  */
 80195  func _generateOutputSubroutine(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pIn *XSelectDest, _pDest *XSelectDest, _regReturn int32, _regPrev int32, _pKeyInfo *XKeyInfo, _iBreak int32) (r0 int32) {
 80196  	var _iContinue, _addr, _1_addr1, _1_addr2, _3_r1, _3_r2, _4_r1 int32
 80197  	var _v *TVdbe
 80198  	_v = (*TVdbe)(_pParse.XpVdbe)
 80199  	_addr = _sqlite3VdbeCurrentAddr(tls, _v)
 80200  	_iContinue = _sqlite3VdbeMakeLabel(tls, _v)
 80201  	if _regPrev != 0 {
 80202  		_1_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(22), _regPrev)
 80203  		_1_addr2 = _sqlite3VdbeAddOp4(tls, _v, int32(98), _pIn.XiSdst, _regPrev+int32(1), _pIn.XnSdst, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _pKeyInfo))), int32(-5))
 80204  		_sqlite3VdbeAddOp3(tls, _v, int32(18), _1_addr2+int32(2), _iContinue, _1_addr2+int32(2))
 80205  		_sqlite3VdbeJumpHere(tls, _v, _1_addr1)
 80206  		_sqlite3VdbeAddOp3(tls, _v, int32(64), _pIn.XiSdst, _regPrev+int32(1), _pIn.XnSdst-int32(1))
 80207  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _regPrev)
 80208  	}
 80209  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 80210  		return int32(0)
 80211  	}
 80212  	_codeOffset(tls, _v, _p.XiOffset, _iContinue)
 80213  	func() {
 80214  		if int32(_pDest.XeDest) == int32(3) {
 80215  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119182), unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000), unsafe.Pointer(str(100508)))
 80216  			crt.X__builtin_abort(tls)
 80217  		}
 80218  	}()
 80219  	func() {
 80220  		if int32(_pDest.XeDest) == int32(14) {
 80221  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119183), unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000), unsafe.Pointer(str(100533)))
 80222  			crt.X__builtin_abort(tls)
 80223  		}
 80224  	}()
 80225  	switch int32(_pDest.XeDest) {
 80226  	case int32(10):
 80227  		goto _9
 80228  	case int32(11):
 80229  		goto _8
 80230  	case int32(12):
 80231  		goto _7
 80232  	case int32(13):
 80233  		goto _10
 80234  	default:
 80235  		goto _11
 80236  	}
 80237  
 80238  _7:
 80239  	_3_r1 = _sqlite3GetTempReg(tls, _pParse)
 80240  	_3_r2 = _sqlite3GetTempReg(tls, _pParse)
 80241  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _pIn.XiSdst, _pIn.XnSdst, _3_r1)
 80242  	_sqlite3VdbeAddOp2(tls, _v, int32(117), _pDest.XiSDParm, _3_r2)
 80243  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _pDest.XiSDParm, _3_r1, _3_r2)
 80244  	_sqlite3VdbeChangeP5(tls, _v, uint16(8))
 80245  	_sqlite3ReleaseTempReg(tls, _pParse, _3_r2)
 80246  	_sqlite3ReleaseTempReg(tls, _pParse, _3_r1)
 80247  	goto _12
 80248  _8:
 80249  	_4_r1 = _sqlite3GetTempReg(tls, _pParse)
 80250  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _pIn.XiSdst, _pIn.XnSdst, _4_r1, _pDest.XzAffSdst, _pIn.XnSdst)
 80251  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _pIn.XiSdst, _pIn.XnSdst)
 80252  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _pDest.XiSDParm, _4_r1, _pIn.XiSdst, _pIn.XnSdst)
 80253  	_sqlite3ReleaseTempReg(tls, _pParse, _4_r1)
 80254  	goto _12
 80255  _9:
 80256  	func() {
 80257  		if _pIn.XnSdst != int32(1) && _pParse.XnErr <= int32(0) {
 80258  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119220), unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000), unsafe.Pointer(str(100557)))
 80259  			crt.X__builtin_abort(tls)
 80260  		}
 80261  	}()
 80262  	_sqlite3ExprCodeMove(tls, _pParse, _pIn.XiSdst, _pDest.XiSDParm, int32(1))
 80263  	goto _12
 80264  _10:
 80265  	if _pDest.XiSdst == int32(0) {
 80266  		_pDest.XiSdst = _sqlite3GetTempRange(tls, _pParse, _pIn.XnSdst)
 80267  		_pDest.XnSdst = _pIn.XnSdst
 80268  	}
 80269  	_sqlite3ExprCodeMove(tls, _pParse, _pIn.XiSdst, _pDest.XiSdst, _pIn.XnSdst)
 80270  	_sqlite3VdbeAddOp1(tls, _v, int32(16), _pDest.XiSDParm)
 80271  	goto _12
 80272  _11:
 80273  	func() {
 80274  		if int32(_pDest.XeDest) != int32(9) {
 80275  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119249), unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000), unsafe.Pointer(str(100589)))
 80276  			crt.X__builtin_abort(tls)
 80277  		}
 80278  	}()
 80279  	_sqlite3VdbeAddOp2(tls, _v, int32(67), _pIn.XiSdst, _pIn.XnSdst)
 80280  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _pIn.XiSdst, _pIn.XnSdst)
 80281  	goto _12
 80282  _12:
 80283  	if _p.XiLimit != 0 {
 80284  		_sqlite3VdbeAddOp2(tls, _v, int32(48), _p.XiLimit, _iBreak)
 80285  	}
 80286  	_sqlite3VdbeResolveLabel(tls, _v, _iContinue)
 80287  	_sqlite3VdbeAddOp1(tls, _v, int32(52), _regReturn)
 80288  	return _addr
 80289  }
 80290  
 80291  // C comment
 80292  //  /*
 80293  //  ** Make a new pointer to a KeyInfo object
 80294  //  */
 80295  func _sqlite3KeyInfoRef(tls *crt.TLS, _p *XKeyInfo) (r0 *XKeyInfo) {
 80296  	if _p != nil {
 80297  		func() {
 80298  			if _p.XnRef <= (0) {
 80299  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117587), unsafe.Pointer(&_sqlite3KeyInfoRefØ00__func__Ø000), unsafe.Pointer(str(13812)))
 80300  				crt.X__builtin_abort(tls)
 80301  			}
 80302  		}()
 80303  		_p.XnRef += 1
 80304  	}
 80305  	return _p
 80306  }
 80307  
 80308  var _sqlite3KeyInfoRefØ00__func__Ø000 [18]int8
 80309  
 80310  func init() {
 80311  	crt.Xstrncpy(nil, &_sqlite3KeyInfoRefØ00__func__Ø000[0], str(100614), 18)
 80312  }
 80313  
 80314  var _generateOutputSubroutineØ00__func__Ø000 [25]int8
 80315  
 80316  func init() {
 80317  	crt.Xstrncpy(nil, &_generateOutputSubroutineØ00__func__Ø000[0], str(100632), 25)
 80318  }
 80319  
 80320  // C comment
 80321  //  /*
 80322  //  ** Find (an approximate) sum of two LogEst values.  This computation is
 80323  //  ** not a simple "+" operator because LogEst is stored as a logarithmic
 80324  //  ** value.
 80325  //  **
 80326  //  */
 80327  func _sqlite3LogEstAdd(tls *crt.TLS, _a int16, _b int16) (r0 int16) {
 80328  	if int32(_a) < int32(_b) {
 80329  		goto _0
 80330  	}
 80331  	if int32(_a) > (int32(_b) + int32(49)) {
 80332  		return _a
 80333  	}
 80334  	if int32(_a) > (int32(_b) + int32(31)) {
 80335  		return int16(int32(_a) + int32(1))
 80336  	}
 80337  	return int16(int32(_a) + int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3LogEstAddØ00xØ001)), uintptr(int32(_a)-int32(_b)))))
 80338  
 80339  _0:
 80340  	if int32(_b) > (int32(_a) + int32(49)) {
 80341  		return _b
 80342  	}
 80343  	if int32(_b) > (int32(_a) + int32(31)) {
 80344  		return int16(int32(_b) + int32(1))
 80345  	}
 80346  	return int16(int32(_b) + int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3LogEstAddØ00xØ001)), uintptr(int32(_b)-int32(_a)))))
 80347  }
 80348  
 80349  var _sqlite3LogEstAddØ00xØ001 [32]uint8
 80350  
 80351  func init() {
 80352  	_sqlite3LogEstAddØ00xØ001 = [32]uint8{10, 10, 9, 9, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2}
 80353  }
 80354  
 80355  // C comment
 80356  //  /*
 80357  //  ** Generate code that will tell the VDBE the names of columns
 80358  //  ** in the result set.  This information is used to provide the
 80359  //  ** azCol[] values in the callback.
 80360  //  */
 80361  func _generateColumnNames(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pEList *XExprList) {
 80362  	var _i, _fullNames, _shortNames, _4_iCol int32
 80363  	var _3_zName, _4_zCol, _8_zName, _10_z *int8
 80364  	var _db *Xsqlite3
 80365  	var _pTab *XTable
 80366  	var _v *TVdbe
 80367  	var _2_p *XExpr
 80368  	_v = (*TVdbe)(_pParse.XpVdbe)
 80369  	_db = (*Xsqlite3)(_pParse.Xdb)
 80370  	if _pParse.Xexplain != 0 {
 80371  		return
 80372  	}
 80373  	if (_pParse.XcolNamesSet != 0) || (_db.XmallocFailed != 0) {
 80374  		return
 80375  	}
 80376  	func() {
 80377  		if _v == nil {
 80378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118115), unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000), unsafe.Pointer(str(42019)))
 80379  			crt.X__builtin_abort(tls)
 80380  		}
 80381  	}()
 80382  	func() {
 80383  		if _pTabList == nil {
 80384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118116), unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000), unsafe.Pointer(str(100657)))
 80385  			crt.X__builtin_abort(tls)
 80386  		}
 80387  	}()
 80388  	_pParse.XcolNamesSet = uint8(1)
 80389  	_fullNames = bool2int((_db.Xflags & int32(4)) != int32(0))
 80390  	_shortNames = bool2int((_db.Xflags & int32(64)) != int32(0))
 80391  	_sqlite3VdbeSetNumCols(tls, _v, _pEList.XnExpr)
 80392  	_i = int32(0)
 80393  _7:
 80394  	if _i >= _pEList.XnExpr {
 80395  		goto _10
 80396  	}
 80397  	_2_p = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr)
 80398  	if func() int32 {
 80399  		if _2_p == nil {
 80400  			return func() int32 {
 80401  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118124), unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000), unsafe.Pointer(str(4809)))
 80402  				crt.X__builtin_abort(tls)
 80403  				return int32(1)
 80404  			}()
 80405  		}
 80406  		return int32(0)
 80407  	}() != 0 {
 80408  		goto _8
 80409  	}
 80410  	if (elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzName) != nil {
 80411  		_3_zName = elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzName
 80412  		_sqlite3VdbeSetColName(tls, _v, _i, int32(0), _3_zName, func() func(*crt.TLS, unsafe.Pointer) {
 80413  			v := uint64(18446744073709551615)
 80414  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 80415  		}())
 80416  		goto _31
 80417  	}
 80418  	if int32(_2_p.Xop) != int32(152) && int32(_2_p.Xop) != int32(154) || store74(&_pTab, _tableWithCursor(tls, _pTabList, _2_p.XiTable)) == nil {
 80419  		goto _18
 80420  	}
 80421  	_4_iCol = int32(_2_p.XiColumn)
 80422  	if _4_iCol < int32(0) {
 80423  		_4_iCol = int32(_pTab.XiPKey)
 80424  	}
 80425  	func() {
 80426  		if _4_iCol != int32(-1) && (_4_iCol < int32(0) || _4_iCol >= int32(_pTab.XnCol)) {
 80427  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118134), unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94534)))
 80428  			crt.X__builtin_abort(tls)
 80429  		}
 80430  	}()
 80431  	if _4_iCol < int32(0) {
 80432  		_4_zCol = str(27182)
 80433  		goto _25
 80434  	}
 80435  	_4_zCol = elem43((*XColumn)(_pTab.XaCol), uintptr(_4_iCol)).XzName
 80436  _25:
 80437  	if (_shortNames == 0) && (_fullNames == 0) {
 80438  		_sqlite3VdbeSetColName(tls, _v, _i, int32(0), _sqlite3DbStrDup(tls, _db, elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzSpan), func() func(*crt.TLS, unsafe.Pointer) {
 80439  			v := _sqlite3MallocSize
 80440  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 80441  		}())
 80442  		goto _30
 80443  	}
 80444  	if _fullNames != 0 {
 80445  		_8_zName = nil
 80446  		_8_zName = _sqlite3MPrintf(tls, _db, str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(_4_zCol))
 80447  		_sqlite3VdbeSetColName(tls, _v, _i, int32(0), _8_zName, func() func(*crt.TLS, unsafe.Pointer) {
 80448  			v := _sqlite3MallocSize
 80449  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 80450  		}())
 80451  		goto _30
 80452  	}
 80453  	_sqlite3VdbeSetColName(tls, _v, _i, int32(0), _4_zCol, func() func(*crt.TLS, unsafe.Pointer) {
 80454  		v := uint64(18446744073709551615)
 80455  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 80456  	}())
 80457  _30:
 80458  	goto _31
 80459  _18:
 80460  	_10_z = elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzSpan
 80461  	_10_z = func() *int8 {
 80462  		if _10_z == nil {
 80463  			return _sqlite3MPrintf(tls, _db, str(100669), _i+int32(1))
 80464  		}
 80465  		return _sqlite3DbStrDup(tls, _db, _10_z)
 80466  	}()
 80467  	_sqlite3VdbeSetColName(tls, _v, _i, int32(0), _10_z, func() func(*crt.TLS, unsafe.Pointer) {
 80468  		v := _sqlite3MallocSize
 80469  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 80470  	}())
 80471  _31:
 80472  _8:
 80473  	_i += 1
 80474  	goto _7
 80475  _10:
 80476  	_generateColumnTypes(tls, _pParse, _pTabList, _pEList)
 80477  }
 80478  
 80479  var _generateColumnNamesØ00__func__Ø000 [20]int8
 80480  
 80481  func init() {
 80482  	crt.Xstrncpy(nil, &_generateColumnNamesØ00__func__Ø000[0], str(100678), 20)
 80483  }
 80484  
 80485  // C comment
 80486  //  /*
 80487  //  ** Return the Table objecct in the SrcList that has cursor iCursor.
 80488  //  ** Or return NULL if no such Table object exists in the SrcList.
 80489  //  */
 80490  func _tableWithCursor(tls *crt.TLS, _pList *XSrcList, _iCursor int32) (r0 *XTable) {
 80491  	var _j int32
 80492  	_j = int32(0)
 80493  _0:
 80494  	if _j >= _pList.XnSrc {
 80495  		goto _3
 80496  	}
 80497  	if (elem6((*TSrcList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_j)).XiCursor) == _iCursor {
 80498  		return (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_j)).XpTab)
 80499  	}
 80500  	_j += 1
 80501  	goto _0
 80502  _3:
 80503  	return nil
 80504  }
 80505  
 80506  // C comment
 80507  //  /*
 80508  //  ** Generate code that will tell the VDBE the declaration types of columns
 80509  //  ** in the result set.
 80510  //  */
 80511  func _generateColumnTypes(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pEList *XExprList) {
 80512  	var _i int32
 80513  	var _1_zType *int8
 80514  	var _v *TVdbe
 80515  	var _1_p *XExpr
 80516  	var _sNC XNameContext
 80517  	_v = (*TVdbe)(_pParse.XpVdbe)
 80518  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = _pTabList
 80519  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pParse
 80520  	*(**XNameContext)(unsafe.Pointer(&_sNC.XpNext)) = nil
 80521  	_i = int32(0)
 80522  _0:
 80523  	if _i >= _pEList.XnExpr {
 80524  		goto _3
 80525  	}
 80526  	_1_p = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr)
 80527  	_1_zType = _columnTypeImpl(tls, &_sNC, _1_p, nil)
 80528  	_sqlite3VdbeSetColName(tls, _v, _i, int32(1), _1_zType, func() func(*crt.TLS, unsafe.Pointer) {
 80529  		v := uint64(18446744073709551615)
 80530  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 80531  	}())
 80532  	_i += 1
 80533  	goto _0
 80534  _3:
 80535  }
 80536  
 80537  // C comment
 80538  //  /*
 80539  //  ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
 80540  //  ** is a no-op. Otherwise, it adds a single row of output to the EQP result,
 80541  //  ** where the caption is of one of the two forms:
 80542  //  **
 80543  //  **   "COMPOSITE SUBQUERIES iSub1 and iSub2 (op)"
 80544  //  **   "COMPOSITE SUBQUERIES iSub1 and iSub2 USING TEMP B-TREE (op)"
 80545  //  **
 80546  //  ** where iSub1 and iSub2 are the integers passed as the corresponding
 80547  //  ** function parameters, and op is the text representation of the parameter
 80548  //  ** of the same name. The parameter "op" must be one of TK_UNION, TK_EXCEPT,
 80549  //  ** TK_INTERSECT or TK_ALL. The first form is used if argument bUseTmp is
 80550  //  ** false, or the second form if it is true.
 80551  //  */
 80552  func _explainComposite(tls *crt.TLS, _pParse *XParse, _op int32, _iSub1 int32, _iSub2 int32, _bUseTmp int32) {
 80553  	var _1_zMsg *int8
 80554  	var _1_v *TVdbe
 80555  	func() {
 80556  		if _op != int32(115) && _op != int32(117) && _op != int32(118) && _op != int32(116) {
 80557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117714), unsafe.Pointer(&_explainCompositeØ00__func__Ø000), unsafe.Pointer(str(100698)))
 80558  			crt.X__builtin_abort(tls)
 80559  		}
 80560  	}()
 80561  	if int32(_pParse.Xexplain) == int32(2) {
 80562  		_1_v = (*TVdbe)(_pParse.XpVdbe)
 80563  		_1_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(100762), _iSub1, _iSub2, unsafe.Pointer(func() *int8 {
 80564  			if _bUseTmp != 0 {
 80565  				return str(100799)
 80566  			}
 80567  			return str(284)
 80568  		}()), unsafe.Pointer(_selectOpName(tls, _op)))
 80569  		_sqlite3VdbeAddOp4(tls, _1_v, int32(165), _pParse.XiSelectId, int32(0), int32(0), _1_zMsg, int32(-1))
 80570  	}
 80571  }
 80572  
 80573  var _explainCompositeØ00__func__Ø000 [17]int8
 80574  
 80575  func init() {
 80576  	crt.Xstrncpy(nil, &_explainCompositeØ00__func__Ø000[0], str(100818), 17)
 80577  }
 80578  
 80579  // C comment
 80580  //  /*
 80581  //  ** Return the maximum height of any expression tree referenced
 80582  //  ** by the select statement passed as an argument.
 80583  //  */
 80584  func _sqlite3SelectExprHeight(tls *crt.TLS, _p *XSelect) (r0 int32) {
 80585  	var _nHeight int32
 80586  	_nHeight = int32(0)
 80587  	_heightOfSelect(tls, _p, &_nHeight)
 80588  	return _nHeight
 80589  }
 80590  
 80591  // C comment
 80592  //  /*
 80593  //  ** Make copies of relevant WHERE clause terms of the outer query into
 80594  //  ** the WHERE clause of subquery.  Example:
 80595  //  **
 80596  //  **    SELECT * FROM (SELECT a AS x, c-d AS y FROM t1) WHERE x=5 AND y=10;
 80597  //  **
 80598  //  ** Transformed into:
 80599  //  **
 80600  //  **    SELECT * FROM (SELECT a AS x, c-d AS y FROM t1 WHERE a=5 AND c-d=10)
 80601  //  **     WHERE x=5 AND y=10;
 80602  //  **
 80603  //  ** The hope is that the terms added to the inner query will make it more
 80604  //  ** efficient.
 80605  //  **
 80606  //  ** Do not attempt this optimization if:
 80607  //  **
 80608  //  **   (1) The inner query is an aggregate.  (In that case, we'd really want
 80609  //  **       to copy the outer WHERE-clause terms onto the HAVING clause of the
 80610  //  **       inner query.  But they probably won't help there so do not bother.)
 80611  //  **
 80612  //  **   (2) The inner query is the recursive part of a common table expression.
 80613  //  **
 80614  //  **   (3) The inner query has a LIMIT clause (since the changes to the WHERE
 80615  //  **       close would change the meaning of the LIMIT).
 80616  //  **
 80617  //  **   (4) The inner query is the right operand of a LEFT JOIN.  (The caller
 80618  //  **       enforces this restriction since this routine does not have enough
 80619  //  **       information to know.)
 80620  //  **
 80621  //  **   (5) The WHERE clause expression originates in the ON or USING clause
 80622  //  **       of a LEFT JOIN.
 80623  //  **
 80624  //  ** Return 0 if no changes are made and non-zero if one or more WHERE clause
 80625  //  ** terms are duplicated into the subquery.
 80626  //  */
 80627  func _pushDownWhereTerms(tls *crt.TLS, _pParse *XParse, _pSubq *XSelect, _pWhere *XExpr, _iCursor int32) (r0 int32) {
 80628  	var _nChng int32
 80629  	var _pX *XSelect
 80630  	var _pNew *XExpr
 80631  	var _6_x XSubstContext
 80632  	_nChng = int32(0)
 80633  	if _pWhere == nil {
 80634  		return int32(0)
 80635  	}
 80636  	_pX = _pSubq
 80637  _1:
 80638  	if _pX == nil {
 80639  		goto _4
 80640  	}
 80641  	if (_pX.XselFlags & uint32(8200)) != (0) {
 80642  		return int32(0)
 80643  	}
 80644  	_pX = (*XSelect)(_pX.XpPrior)
 80645  	goto _1
 80646  _4:
 80647  	if (*XExpr)(_pSubq.XpLimit) != nil {
 80648  		return int32(0)
 80649  	}
 80650  _6:
 80651  	if int32(_pWhere.Xop) == int32(71) {
 80652  		_nChng += _pushDownWhereTerms(tls, _pParse, _pSubq, (*XExpr)(_pWhere.XpRight), _iCursor)
 80653  		_pWhere = (*XExpr)(_pWhere.XpLeft)
 80654  		goto _6
 80655  	}
 80656  	if (_pWhere.Xflags & uint32(1)) != (0) {
 80657  		return int32(0)
 80658  	}
 80659  	if _sqlite3ExprIsTableConstant(tls, _pWhere, _iCursor) == 0 {
 80660  		goto _10
 80661  	}
 80662  	_nChng += 1
 80663  _11:
 80664  	if _pSubq != nil {
 80665  		_pNew = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.Xdb), _pWhere, int32(0))
 80666  		*(**XParse)(unsafe.Pointer(&_6_x.XpParse)) = _pParse
 80667  		_6_x.XiTable = _iCursor
 80668  		_6_x.XiNewTable = _iCursor
 80669  		_6_x.XisLeftJoin = int32(0)
 80670  		*(**XExprList)(unsafe.Pointer(&_6_x.XpEList)) = (*XExprList)(_pSubq.XpEList)
 80671  		_pNew = _substExpr(tls, &_6_x, _pNew)
 80672  		*(**XExpr)(unsafe.Pointer(&_pSubq.XpWhere)) = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(_pSubq.XpWhere), _pNew)
 80673  		_pSubq = (*XSelect)(_pSubq.XpPrior)
 80674  		goto _11
 80675  	}
 80676  _10:
 80677  	return _nChng
 80678  }
 80679  
 80680  // C comment
 80681  //  /*
 80682  //  ** Walk an expression tree.  Return non-zero if the expression is constant
 80683  //  ** for any single row of the table with cursor iCur.  In other words, the
 80684  //  ** expression must not refer to any non-deterministic function nor any
 80685  //  ** table other than iCur.
 80686  //  */
 80687  func _sqlite3ExprIsTableConstant(tls *crt.TLS, _p *XExpr, _iCur int32) (r0 int32) {
 80688  	return _exprIsConst(tls, _p, int32(3), _iCur)
 80689  }
 80690  
 80691  // C comment
 80692  //  /*
 80693  //  ** Mark all temporary registers as being unavailable for reuse.
 80694  //  */
 80695  func _sqlite3ClearTempRegCache(tls *crt.TLS, _pParse *XParse) {
 80696  	_pParse.XnTempReg = 0
 80697  	_pParse.XnRangeReg = int32(0)
 80698  }
 80699  
 80700  // C comment
 80701  //  /*
 80702  //  ** Check to see if the pThis entry of pTabList is a self-join of a prior view.
 80703  //  ** If it is, then return the SrcList_item for the prior view.  If it is not,
 80704  //  ** then return 0.
 80705  //  */
 80706  func _isSelfJoinView(tls *crt.TLS, _pTabList *XSrcList, _pThis *TSrcList_item) (r0 *TSrcList_item) {
 80707  	var _pItem *TSrcList_item
 80708  	_pItem = (*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa))
 80709  _0:
 80710  	if crt.P2U(unsafe.Pointer(_pItem)) >= crt.P2U(unsafe.Pointer(_pThis)) {
 80711  		goto _3
 80712  	}
 80713  	if (*XSelect)(_pItem.XpSelect) == nil {
 80714  		goto _1
 80715  	}
 80716  	if ((uint32((_pItem.Xfg.XnotIndexed)>>4) << 31) >> 31) != 0 {
 80717  		goto _1
 80718  	}
 80719  	if _pItem.XzName == nil {
 80720  		goto _1
 80721  	}
 80722  	if Xsqlite3_stricmp(tls, _pItem.XzDatabase, _pThis.XzDatabase) != int32(0) {
 80723  		goto _1
 80724  	}
 80725  	if Xsqlite3_stricmp(tls, _pItem.XzName, _pThis.XzName) != int32(0) {
 80726  		goto _1
 80727  	}
 80728  	if _sqlite3ExprCompare(tls, (*XExpr)((*XSelect)(_pThis.XpSelect).XpWhere), (*XExpr)((*XSelect)(_pItem.XpSelect).XpWhere), int32(-1)) != 0 {
 80729  		goto _1
 80730  	}
 80731  	return _pItem
 80732  
 80733  _1:
 80734  	*(*uintptr)(unsafe.Pointer(&_pItem)) += uintptr(112)
 80735  	goto _0
 80736  _3:
 80737  	return nil
 80738  }
 80739  
 80740  func _sqlite3VdbeChangeP1(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) {
 80741  	_sqlite3VdbeGetOp(tls, _p, int32(_addr)).Xp1 = _val
 80742  }
 80743  
 80744  // C comment
 80745  //  /*
 80746  //  ** Change the value of the opcode, or P1, P2, P3, or P5 operands
 80747  //  ** for a specific instruction.
 80748  //  */
 80749  func _sqlite3VdbeChangeOpcode(tls *crt.TLS, _p *TVdbe, _addr uint32, _iNewOpcode uint8) {
 80750  	_sqlite3VdbeGetOp(tls, _p, int32(_addr)).Xopcode = _iNewOpcode
 80751  }
 80752  
 80753  // C comment
 80754  //  /*
 80755  //  ** Generate the beginning of the loop used for WHERE clause processing.
 80756  //  ** The return value is a pointer to an opaque structure that contains
 80757  //  ** information needed to terminate the loop.  Later, the calling routine
 80758  //  ** should invoke sqlite3WhereEnd() with the return value of this function
 80759  //  ** in order to complete the WHERE clause processing.
 80760  //  **
 80761  //  ** If an error occurs, this routine returns NULL.
 80762  //  **
 80763  //  ** The basic idea is to do a nested loop, one loop for each table in
 80764  //  ** the FROM clause of a select.  (INSERT and UPDATE statements are the
 80765  //  ** same as a SELECT with only a single table in the FROM clause.)  For
 80766  //  ** example, if the SQL is this:
 80767  //  **
 80768  //  **       SELECT * FROM t1, t2, t3 WHERE ...;
 80769  //  **
 80770  //  ** Then the code generated is conceptually like the following:
 80771  //  **
 80772  //  **      foreach row1 in t1 do       \    Code generated
 80773  //  **        foreach row2 in t2 do      |-- by sqlite3WhereBegin()
 80774  //  **          foreach row3 in t3 do   /
 80775  //  **            ...
 80776  //  **          end                     \    Code generated
 80777  //  **        end                        |-- by sqlite3WhereEnd()
 80778  //  **      end                         /
 80779  //  **
 80780  //  ** Note that the loops might not be nested in the order in which they
 80781  //  ** appear in the FROM clause if a different order is better able to make
 80782  //  ** use of indices.  Note also that when the IN operator appears in
 80783  //  ** the WHERE clause, it might result in additional nested loops for
 80784  //  ** scanning through all values on the right-hand side of the IN.
 80785  //  **
 80786  //  ** There are Btree cursors associated with each table.  t1 uses cursor
 80787  //  ** number pTabList->a[0].iCursor.  t2 uses the cursor pTabList->a[1].iCursor.
 80788  //  ** And so forth.  This routine generates code to open those VDBE cursors
 80789  //  ** and sqlite3WhereEnd() generates the code to close them.
 80790  //  **
 80791  //  ** The code that sqlite3WhereBegin() generates leaves the cursors named
 80792  //  ** in pTabList pointing at their appropriate entries.  The [...] code
 80793  //  ** can use OP_Column and OP_Rowid opcodes on these cursors to extract
 80794  //  ** data from the various tables of the loop.
 80795  //  **
 80796  //  ** If the WHERE clause is empty, the foreach loops must each scan their
 80797  //  ** entire tables.  Thus a three-way join is an O(N^3) operation.  But if
 80798  //  ** the tables have indices and there are terms in the WHERE clause that
 80799  //  ** refer to those indices, a complete table scan can be avoided and the
 80800  //  ** code will run much faster.  Most of the work of this routine is checking
 80801  //  ** to see if there are indices that can be used to speed up the loop.
 80802  //  **
 80803  //  ** Terms of the WHERE clause are also used to limit which rows actually
 80804  //  ** make it to the "..." in the middle of the loop.  After each "foreach",
 80805  //  ** terms of the WHERE clause that use only terms in that loop and outer
 80806  //  ** loops are evaluated and if false a jump is made around all subsequent
 80807  //  ** inner loops (or around the "..." if the test occurs within the inner-
 80808  //  ** most loop)
 80809  //  **
 80810  //  ** OUTER JOINS
 80811  //  **
 80812  //  ** An outer join of tables t1 and t2 is conceptally coded as follows:
 80813  //  **
 80814  //  **    foreach row1 in t1 do
 80815  //  **      flag = 0
 80816  //  **      foreach row2 in t2 do
 80817  //  **        start:
 80818  //  **          ...
 80819  //  **          flag = 1
 80820  //  **      end
 80821  //  **      if flag==0 then
 80822  //  **        move the row2 cursor to a null row
 80823  //  **        goto start
 80824  //  **      fi
 80825  //  **    end
 80826  //  **
 80827  //  ** ORDER BY CLAUSE PROCESSING
 80828  //  **
 80829  //  ** pOrderBy is a pointer to the ORDER BY clause (or the GROUP BY clause
 80830  //  ** if the WHERE_GROUPBY flag is set in wctrlFlags) of a SELECT statement
 80831  //  ** if there is one.  If there is no ORDER BY clause or if this routine
 80832  //  ** is called from an UPDATE or DELETE statement, then pOrderBy is NULL.
 80833  //  **
 80834  //  ** The iIdxCur parameter is the cursor number of an index.  If
 80835  //  ** WHERE_OR_SUBCLAUSE is set, iIdxCur is the cursor number of an index
 80836  //  ** to use for OR clause processing.  The WHERE clause should use this
 80837  //  ** specific cursor.  If WHERE_ONEPASS_DESIRED is set, then iIdxCur is
 80838  //  ** the first cursor in an array of cursors for all indices.  iIdxCur should
 80839  //  ** be used to compute the appropriate cursor depending on which index is
 80840  //  ** used.
 80841  //  */
 80842  func _sqlite3WhereBegin(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWhere *XExpr, _pOrderBy *XExprList, _pResultSet *XExprList, _wctrlFlags uint16, _iAuxArg int32) (r0 *XWhereInfo) {
 80843  	var _nByteWInfo, _nTabList, _ii, _rc, _23_wsFlags, _23_bOnerow, _27_iDb, _29_iCur, _31_op, _33_n, _37_iIndexCur, _37_op, _45_addrExplain, _45_wsFlags int32
 80844  	var _notReady, _9_m, _17_tabUsed, _33_b uint64
 80845  	var _29_pVTab *int8
 80846  	var _bFordelete uint8
 80847  	var _db *Xsqlite3
 80848  	var _27_pTab *XTable
 80849  	var _v *TVdbe
 80850  	var _27_pTabItem *TSrcList_item
 80851  	var _37_pIx, _39_pJ *XIndex
 80852  	var _pWInfo *XWhereInfo
 80853  	var _pLoop *XWhereLoop
 80854  	var _pLevel *XWhereLevel
 80855  	var _19_pTerm, _19_pEnd *XWhereTerm
 80856  	var _pMaskSet *XWhereMaskSet
 80857  	var _sWLB XWhereLoopBuilder
 80858  	_v = (*TVdbe)(_pParse.XpVdbe)
 80859  	_bFordelete = uint8(0)
 80860  	func() {
 80861  		if (int32(_wctrlFlags)&int32(8)) != int32(0) && ((int32(_wctrlFlags)&int32(4)) == int32(0) || (int32(_wctrlFlags)&int32(32)) != int32(0)) {
 80862  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134785), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(100835)))
 80863  			crt.X__builtin_abort(tls)
 80864  		}
 80865  	}()
 80866  	func() {
 80867  		if (int32(_wctrlFlags)&int32(32)) != int32(0) && (int32(_wctrlFlags)&int32(16384)) != int32(0) {
 80868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134791), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(100963)))
 80869  			crt.X__builtin_abort(tls)
 80870  		}
 80871  	}()
 80872  	_db = (*Xsqlite3)(_pParse.Xdb)
 80873  	crt.Xmemset(tls, unsafe.Pointer(&_sWLB), int32(0), uint64(48))
 80874  	if (_pOrderBy != nil) && (_pOrderBy.XnExpr >= int32(64)) {
 80875  		_pOrderBy = nil
 80876  	}
 80877  	*(**XExprList)(unsafe.Pointer(&_sWLB.XpOrderBy)) = _pOrderBy
 80878  	if (int32(_db.XdbOptFlags) & int32(32)) != int32(0) {
 80879  		{
 80880  			p := &_wctrlFlags
 80881  			*p = uint16(int32(*p) & int32(-257))
 80882  		}
 80883  	}
 80884  	if _pTabList.XnSrc > int32(64) {
 80885  		_sqlite3ErrorMsg(tls, _pParse, str(101037), int32(64))
 80886  		return nil
 80887  	}
 80888  	_nTabList = func() int32 {
 80889  		if (int32(_wctrlFlags) & int32(32)) != 0 {
 80890  			return int32(1)
 80891  		}
 80892  		return _pTabList.XnSrc
 80893  	}()
 80894  	_nByteWInfo = int32(((uint64(1008) + (uint64(_nTabList-int32(1)) * uint64(88))) + uint64(7)) & uint64(18446744073709551608))
 80895  	_pWInfo = (*XWhereInfo)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nByteWInfo)+uint64(104)))
 80896  	if _db.XmallocFailed != 0 {
 80897  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pWInfo))
 80898  		_pWInfo = nil
 80899  		goto _whereBeginError
 80900  	}
 80901  	*(**XParse)(unsafe.Pointer(&_pWInfo.XpParse)) = _pParse
 80902  	*(**XSrcList)(unsafe.Pointer(&_pWInfo.XpTabList)) = _pTabList
 80903  	*(**XExprList)(unsafe.Pointer(&_pWInfo.XpOrderBy)) = _pOrderBy
 80904  	*(**XExpr)(unsafe.Pointer(&_pWInfo.XpWhere)) = _pWhere
 80905  	*(**XExprList)(unsafe.Pointer(&_pWInfo.XpResultSet)) = _pResultSet
 80906  	*elem8((*int32)(unsafe.Pointer(&_pWInfo.XaiCurOnePass)), 0) = store2(elem8((*int32)(unsafe.Pointer(&_pWInfo.XaiCurOnePass)), uintptr(1)), int32(-1))
 80907  	_pWInfo.XnLevel = uint8(_nTabList)
 80908  	_pWInfo.XiBreak = store2(&_pWInfo.XiContinue, _sqlite3VdbeMakeLabel(tls, _v))
 80909  	_pWInfo.XwctrlFlags = _wctrlFlags
 80910  	_pWInfo.XiLimit = int16(_iAuxArg)
 80911  	_pWInfo.XsavedNQueryLoop = int32(_pParse.XnQueryLoop)
 80912  	crt.Xmemset(tls, unsafe.Pointer(&_pWInfo.XnOBSat), int32(0), uint64(37))
 80913  	crt.Xmemset(tls, unsafe.Pointer(elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), 0)), int32(0), uint64(104)+(uint64(_nTabList)*uint64(88)))
 80914  	func() {
 80915  		if int32(_pWInfo.XeOnePass) != int32(0) {
 80916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134853), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101065)))
 80917  			crt.X__builtin_abort(tls)
 80918  		}
 80919  	}()
 80920  	_pMaskSet = &_pWInfo.XsMaskSet
 80921  	*(**XWhereInfo)(unsafe.Pointer(&_sWLB.XpWInfo)) = _pWInfo
 80922  	*(**XWhereClause)(unsafe.Pointer(&_sWLB.XpWC)) = &_pWInfo.XsWC
 80923  	*(**XWhereLoop)(unsafe.Pointer(&_sWLB.XpNew)) = (*XWhereLoop)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWInfo)) + uintptr(_nByteWInfo)))))
 80924  	func() {
 80925  		if (int64(uintptr(_sWLB.XpNew)) & int64(7)) != (0) {
 80926  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134858), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101095)))
 80927  			crt.X__builtin_abort(tls)
 80928  		}
 80929  	}()
 80930  	_whereLoopInit(tls, (*XWhereLoop)(_sWLB.XpNew))
 80931  	(*XWhereLoop)(_sWLB.XpNew).XcId = int8(42)
 80932  	_pMaskSet.Xn = int32(0)
 80933  	_sqlite3WhereClauseInit(tls, &_pWInfo.XsWC, _pWInfo)
 80934  	_sqlite3WhereSplit(tls, &_pWInfo.XsWC, _pWhere, uint8(71))
 80935  	_ii = int32(0)
 80936  _18:
 80937  	if _ii >= ((*XWhereClause)(_sWLB.XpWC).XnTerm) {
 80938  		goto _21
 80939  	}
 80940  	if (_nTabList == int32(0)) || _sqlite3ExprIsConstantNotJoin(tls, (*XExpr)(elem101((*XWhereTerm)((*XWhereClause)(_sWLB.XpWC).Xa), uintptr(_ii)).XpExpr)) != 0 {
 80941  		_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(elem101((*XWhereTerm)((*XWhereClause)(_sWLB.XpWC).Xa), uintptr(_ii)).XpExpr), _pWInfo.XiBreak, int32(16))
 80942  		{
 80943  			p := &(elem101((*XWhereTerm)((*XWhereClause)(_sWLB.XpWC).Xa), uintptr(_ii)).XwtFlags)
 80944  			*p = uint16(int32(*p) | int32(4))
 80945  		}
 80946  	}
 80947  	_ii += 1
 80948  	goto _18
 80949  _21:
 80950  	if _nTabList != int32(0) {
 80951  		goto _24
 80952  	}
 80953  	if _pOrderBy != nil {
 80954  		_pWInfo.XnOBSat = int8(_pOrderBy.XnExpr)
 80955  	}
 80956  	if (int32(_wctrlFlags) & int32(256)) != 0 {
 80957  		_pWInfo.XeDistinct = uint8(1)
 80958  	}
 80959  _24:
 80960  	_ii = int32(0)
 80961  _27:
 80962  	if _ii >= _pTabList.XnSrc {
 80963  		goto _30
 80964  	}
 80965  	_createMask(tls, _pMaskSet, elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_ii)).XiCursor)
 80966  	_sqlite3WhereTabFuncArgs(tls, _pParse, elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_ii)), &_pWInfo.XsWC)
 80967  	_ii += 1
 80968  	goto _27
 80969  _30:
 80970  	_ii = int32(0)
 80971  _31:
 80972  	if _ii >= _pTabList.XnSrc {
 80973  		goto _34
 80974  	}
 80975  	_9_m = _sqlite3WhereGetMask(tls, _pMaskSet, elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_ii)).XiCursor)
 80976  	func() {
 80977  		if _9_m != (uint64(1) << uint(_ii)) {
 80978  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134912), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101127)))
 80979  			crt.X__builtin_abort(tls)
 80980  		}
 80981  	}()
 80982  	_ii += 1
 80983  	goto _31
 80984  _34:
 80985  	_sqlite3WhereExprAnalyze(tls, _pTabList, &_pWInfo.XsWC)
 80986  	if _db.XmallocFailed != 0 {
 80987  		goto _whereBeginError
 80988  	}
 80989  	if (int32(_wctrlFlags) & int32(256)) == 0 {
 80990  		goto _38
 80991  	}
 80992  	if _isDistinctRedundant(tls, _pParse, _pTabList, &_pWInfo.XsWC, _pResultSet) != 0 {
 80993  		_pWInfo.XeDistinct = uint8(1)
 80994  		goto _41
 80995  	}
 80996  	if _pOrderBy == nil {
 80997  		{
 80998  			p := &_pWInfo.XwctrlFlags
 80999  			*p = uint16(int32(*p) | int32(128))
 81000  		}
 81001  		*(**XExprList)(unsafe.Pointer(&_pWInfo.XpOrderBy)) = _pResultSet
 81002  	}
 81003  _41:
 81004  _38:
 81005  	if _nTabList == int32(1) && _whereShortCut(tls, &_sWLB) != int32(0) {
 81006  		goto _43
 81007  	}
 81008  	_rc = _whereLoopAddAll(tls, &_sWLB)
 81009  	if _rc != 0 {
 81010  		goto _whereBeginError
 81011  	}
 81012  	_wherePathSolver(tls, _pWInfo, 0)
 81013  	if _db.XmallocFailed != 0 {
 81014  		goto _whereBeginError
 81015  	}
 81016  	if _pWInfo.XpOrderBy == nil {
 81017  		goto _46
 81018  	}
 81019  	_wherePathSolver(tls, _pWInfo, int16(int32(_pWInfo.XnRowOut)+int32(1)))
 81020  	if _db.XmallocFailed != 0 {
 81021  		goto _whereBeginError
 81022  	}
 81023  _46:
 81024  _43:
 81025  	if ((*XExprList)(_pWInfo.XpOrderBy) == nil) && ((_db.Xflags & int32(131072)) != int32(0)) {
 81026  		_pWInfo.XrevMask = uint64(18446744073709551615)
 81027  	}
 81028  	if _pParse.XnErr != 0 || func() int32 {
 81029  		if _db.XmallocFailed != 0 {
 81030  			return func() int32 {
 81031  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134972), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(4809)))
 81032  				crt.X__builtin_abort(tls)
 81033  				return int32(1)
 81034  			}()
 81035  		}
 81036  		return int32(0)
 81037  	}() != 0 {
 81038  		goto _whereBeginError
 81039  	}
 81040  	if int32(_pWInfo.XnLevel) < int32(2) || _pResultSet == nil || (int32(_db.XdbOptFlags)&int32(1024)) != int32(0) {
 81041  		goto _56
 81042  	}
 81043  	_17_tabUsed = _sqlite3WhereExprListUsage(tls, _pMaskSet, _pResultSet)
 81044  	if _sWLB.XpOrderBy != nil {
 81045  		_17_tabUsed |= _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_sWLB.XpOrderBy))
 81046  	}
 81047  _57:
 81048  	if int32(_pWInfo.XnLevel) < int32(2) {
 81049  		goto _59
 81050  	}
 81051  	_pLoop = (*XWhereLoop)(elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(int32(_pWInfo.XnLevel)-int32(1))).XpWLoop)
 81052  	if (int32((elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))), uintptr(_pLoop.XiTab)).Xfg).Xjointype) & int32(8)) == int32(0) {
 81053  		goto _59
 81054  	}
 81055  	if ((int32(_wctrlFlags) & int32(256)) == int32(0)) && ((_pLoop.XwsFlags & uint32(4096)) == (0)) {
 81056  		goto _59
 81057  	}
 81058  	if (_17_tabUsed & _pLoop.XmaskSelf) != (0) {
 81059  		goto _59
 81060  	}
 81061  	_19_pEnd = (*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(_sWLB.XpWC).Xa) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(_sWLB.XpWC).XnTerm)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(64)))))))))))
 81062  	_19_pTerm = (*XWhereTerm)((*XWhereClause)(_sWLB.XpWC).Xa)
 81063  _64:
 81064  	if crt.P2U(unsafe.Pointer(_19_pTerm)) >= crt.P2U(unsafe.Pointer(_19_pEnd)) {
 81065  		goto _67
 81066  	}
 81067  	if ((_19_pTerm.XprereqAll & _pLoop.XmaskSelf) != (0)) && ((((*XExpr)(_19_pTerm.XpExpr).Xflags) & uint32(1)) == (0)) {
 81068  		goto _67
 81069  	}
 81070  	*(*uintptr)(unsafe.Pointer(&_19_pTerm)) += uintptr(64)
 81071  	goto _64
 81072  _67:
 81073  	if crt.P2U(unsafe.Pointer(_19_pTerm)) < crt.P2U(unsafe.Pointer(_19_pEnd)) {
 81074  		goto _59
 81075  	}
 81076  	_pWInfo.XnLevel -= 1
 81077  	_nTabList -= 1
 81078  	goto _57
 81079  _59:
 81080  _56:
 81081  	(*XParse)(_pWInfo.XpParse).XnQueryLoop += uint32(_pWInfo.XnRowOut)
 81082  	func() {
 81083  		if (int32(_wctrlFlags)&int32(4)) != int32(0) && int32(_pWInfo.XnLevel) != int32(1) {
 81084  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135040), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101142)))
 81085  			crt.X__builtin_abort(tls)
 81086  		}
 81087  	}()
 81088  	if (int32(_wctrlFlags) & int32(4)) == int32(0) {
 81089  		goto _74
 81090  	}
 81091  	_23_wsFlags = int32((*XWhereLoop)(elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), 0).XpWLoop).XwsFlags)
 81092  	_23_bOnerow = bool2int((_23_wsFlags & int32(4096)) != int32(0))
 81093  	if _23_bOnerow == 0 && ((int32(_wctrlFlags)&int32(8)) == int32(0) || int32(0) != (_23_wsFlags&int32(1024))) {
 81094  		goto _77
 81095  	}
 81096  	_pWInfo.XeOnePass = uint8(func() int32 {
 81097  		if _23_bOnerow != 0 {
 81098  			return int32(1)
 81099  		}
 81100  		return int32(2)
 81101  	}())
 81102  	if (((*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XpTab).XtabFlags)&uint32(32)) != (0) || (_23_wsFlags&int32(64)) == 0 {
 81103  		goto _81
 81104  	}
 81105  	if (int32(_wctrlFlags) & int32(8)) != 0 {
 81106  		_bFordelete = uint8(8)
 81107  	}
 81108  	(*XWhereLoop)(elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), 0).XpWLoop).XwsFlags = uint32(_23_wsFlags & int32(-65))
 81109  _81:
 81110  _77:
 81111  _74:
 81112  	*func() **XWhereLevel { _ii = int32(0); return &_pLevel }() = (*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa))
 81113  _83:
 81114  	if _ii >= _nTabList {
 81115  		goto _86
 81116  	}
 81117  	_27_pTabItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_pLevel.XiFrom))
 81118  	_27_pTab = (*XTable)(_27_pTabItem.XpTab)
 81119  	_27_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_27_pTab.XpSchema))
 81120  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 81121  	if ((_27_pTab.XtabFlags & uint32(2)) != (0)) || (_27_pTab.XpSelect != nil) {
 81122  		goto _108
 81123  	}
 81124  	if (_pLoop.XwsFlags & uint32(1024)) != (0) {
 81125  		_29_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _27_pTab)))
 81126  		_29_iCur = _27_pTabItem.XiCursor
 81127  		_sqlite3VdbeAddOp4(tls, _v, int32(158), _29_iCur, int32(0), int32(0), _29_pVTab, int32(-8))
 81128  		goto _108
 81129  	}
 81130  	if _27_pTab.XnModuleArg != 0 {
 81131  		goto _108
 81132  	}
 81133  	if (_pLoop.XwsFlags&uint32(64)) != (0) || (int32(_wctrlFlags)&int32(32)) != int32(0) {
 81134  		goto _95
 81135  	}
 81136  	_31_op = int32(106)
 81137  	if int32(_pWInfo.XeOnePass) != int32(0) {
 81138  		_31_op = int32(107)
 81139  		*elem8((*int32)(unsafe.Pointer(&_pWInfo.XaiCurOnePass)), 0) = _27_pTabItem.XiCursor
 81140  	}
 81141  	_sqlite3OpenTable(tls, _pParse, _27_pTabItem.XiCursor, _27_iDb, _27_pTab, _31_op)
 81142  	func() {
 81143  		if _27_pTabItem.XiCursor != _pLevel.XiTabCur {
 81144  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135090), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101203)))
 81145  			crt.X__builtin_abort(tls)
 81146  		}
 81147  	}()
 81148  	if int32(_pWInfo.XeOnePass) != int32(0) || int32(_27_pTab.XnCol) >= int32(64) || (_27_pTab.XtabFlags&uint32(32)) != (0) {
 81149  		goto _101
 81150  	}
 81151  	_33_b = _27_pTabItem.XcolUsed
 81152  	_33_n = int32(0)
 81153  _102:
 81154  	if _33_b == 0 {
 81155  		goto _105
 81156  	}
 81157  	*func() *int32 { _33_b = _33_b >> 1; return &_33_n }() += 1
 81158  	goto _102
 81159  _105:
 81160  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), (*int8)(crt.U2P(uintptr(int64(_33_n)))), int32(-11))
 81161  	func() {
 81162  		if _33_n > int32(_27_pTab.XnCol) {
 81163  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135098), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101238)))
 81164  			crt.X__builtin_abort(tls)
 81165  		}
 81166  	}()
 81167  _101:
 81168  	_sqlite3VdbeChangeP5(tls, _v, uint16(_bFordelete))
 81169  	goto _108
 81170  _95:
 81171  	_sqlite3TableLock(tls, _pParse, _27_iDb, _27_pTab.Xtnum, 0, _27_pTab.XzName)
 81172  _108:
 81173  	if (_pLoop.XwsFlags & uint32(512)) == 0 {
 81174  		goto _109
 81175  	}
 81176  	_37_pIx = (*XIndex)((*t102)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)
 81177  	_37_op = int32(106)
 81178  	func() {
 81179  		if _iAuxArg == int32(0) && (int32(_pWInfo.XwctrlFlags)&int32(4)) != int32(0) {
 81180  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135120), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101252)))
 81181  			crt.X__builtin_abort(tls)
 81182  		}
 81183  	}()
 81184  	if (((_27_pTab.XtabFlags & uint32(32)) != (0)) && (int32((uint32(_37_pIx.XidxType)<<30)>>30) == int32(2))) && ((int32(_wctrlFlags) & int32(32)) != int32(0)) {
 81185  		_37_iIndexCur = _pLevel.XiTabCur
 81186  		_37_op = int32(0)
 81187  		goto _128
 81188  	}
 81189  	if int32(_pWInfo.XeOnePass) == int32(0) {
 81190  		goto _117
 81191  	}
 81192  	_39_pJ = (*XIndex)((*XTable)(_27_pTabItem.XpTab).XpIndex)
 81193  	_37_iIndexCur = _iAuxArg
 81194  	func() {
 81195  		if (int32(_wctrlFlags) & int32(4)) == 0 {
 81196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135131), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101314)))
 81197  			crt.X__builtin_abort(tls)
 81198  		}
 81199  	}()
 81200  _120:
 81201  	if func() int32 {
 81202  		if _39_pJ != nil {
 81203  			return int32(1)
 81204  		}
 81205  		return func() int32 {
 81206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135132), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(4809)))
 81207  			crt.X__builtin_abort(tls)
 81208  			return int32(0)
 81209  		}()
 81210  	}() != 0 && (_39_pJ != _37_pIx) {
 81211  		_37_iIndexCur += 1
 81212  		_39_pJ = (*XIndex)(_39_pJ.XpNext)
 81213  		goto _120
 81214  	}
 81215  	_37_op = int32(107)
 81216  	*elem8((*int32)(unsafe.Pointer(&_pWInfo.XaiCurOnePass)), uintptr(1)) = _37_iIndexCur
 81217  	goto _128
 81218  _117:
 81219  	if _iAuxArg != 0 && ((int32(_wctrlFlags) & int32(32)) != int32(0)) {
 81220  		_37_iIndexCur = _iAuxArg
 81221  		_37_op = int32(105)
 81222  		goto _128
 81223  	}
 81224  	_37_iIndexCur = postInc2(&_pParse.XnTab, 1)
 81225  _128:
 81226  	_pLevel.XiIdxCur = _37_iIndexCur
 81227  	func() {
 81228  		if (*XSchema)(_37_pIx.XpSchema) != (*XSchema)(_27_pTab.XpSchema) {
 81229  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135145), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101349)))
 81230  			crt.X__builtin_abort(tls)
 81231  		}
 81232  	}()
 81233  	func() {
 81234  		if _37_iIndexCur < int32(0) {
 81235  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135146), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101377)))
 81236  			crt.X__builtin_abort(tls)
 81237  		}
 81238  	}()
 81239  	if _37_op == 0 {
 81240  		goto _133
 81241  	}
 81242  	_sqlite3VdbeAddOp3(tls, _v, _37_op, _37_iIndexCur, _37_pIx.Xtnum, _27_iDb)
 81243  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _37_pIx)
 81244  	if ((((_pLoop.XwsFlags & uint32(15)) != (0)) && ((_pLoop.XwsFlags & uint32(32770)) == (0))) && ((int32(_pWInfo.XwctrlFlags) & int32(1)) == int32(0))) && (int32(_pWInfo.XeDistinct) != int32(2)) {
 81245  		_sqlite3VdbeChangeP5(tls, _v, uint16(2))
 81246  	}
 81247  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_37_pIx.XzName))
 81248  _133:
 81249  _109:
 81250  	if _27_iDb >= int32(0) {
 81251  		_sqlite3CodeVerifySchema(tls, _pParse, _27_iDb)
 81252  	}
 81253  	*(*uintptr)(unsafe.Pointer(func() **XWhereLevel { _ii += 1; return &_pLevel }())) += uintptr(88)
 81254  	goto _83
 81255  _86:
 81256  	_pWInfo.XiTop = _sqlite3VdbeCurrentAddr(tls, _v)
 81257  	if _db.XmallocFailed != 0 {
 81258  		goto _whereBeginError
 81259  	}
 81260  	_notReady = uint64(18446744073709551615)
 81261  	_ii = int32(0)
 81262  _140:
 81263  	if _ii >= _nTabList {
 81264  		goto _143
 81265  	}
 81266  	_pLevel = elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_ii))
 81267  	_45_wsFlags = int32((*XWhereLoop)(_pLevel.XpWLoop).XwsFlags)
 81268  	if (((*XWhereLoop)(_pLevel.XpWLoop).XwsFlags) & uint32(16384)) == (0) {
 81269  		goto _144
 81270  	}
 81271  	_constructAutomaticIndex(tls, _pParse, &_pWInfo.XsWC, elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_pLevel.XiFrom)), _notReady, _pLevel)
 81272  	if _db.XmallocFailed != 0 {
 81273  		goto _whereBeginError
 81274  	}
 81275  _144:
 81276  	_45_addrExplain = _sqlite3WhereExplainOneScan(tls, _pParse, _pTabList, _pLevel, _ii, int32(_pLevel.XiFrom), _wctrlFlags)
 81277  	_pLevel.XaddrBody = _sqlite3VdbeCurrentAddr(tls, _v)
 81278  	_notReady = _sqlite3WhereCodeOneLoopStart(tls, _pWInfo, _ii, _notReady)
 81279  	_pWInfo.XiContinue = _pLevel.XaddrCont
 81280  	if ((_45_wsFlags & int32(8192)) == int32(0)) && ((int32(_wctrlFlags) & int32(32)) == int32(0)) {
 81281  	}
 81282  	_ii += 1
 81283  	goto _140
 81284  _143:
 81285  	return _pWInfo
 81286  
 81287  _whereBeginError:
 81288  	if _pWInfo != nil {
 81289  		_pParse.XnQueryLoop = uint32(_pWInfo.XsavedNQueryLoop)
 81290  		_whereInfoFree(tls, _db, _pWInfo)
 81291  	}
 81292  	return nil
 81293  
 81294  	_ = _45_addrExplain
 81295  	panic(0)
 81296  }
 81297  
 81298  var _sqlite3WhereBeginØ00__func__Ø000 [18]int8
 81299  
 81300  func init() {
 81301  	crt.Xstrncpy(nil, &_sqlite3WhereBeginØ00__func__Ø000[0], str(101390), 18)
 81302  }
 81303  
 81304  // C comment
 81305  //  /*
 81306  //  ** Convert bulk memory into a valid WhereLoop that can be passed
 81307  //  ** to whereLoopClear harmlessly.
 81308  //  */
 81309  func _whereLoopInit(tls *crt.TLS, _p *XWhereLoop) {
 81310  	*(***XWhereTerm)(unsafe.Pointer(&_p.XaLTerm)) = (**XWhereTerm)(unsafe.Pointer(&_p.XaLTermSpace))
 81311  	_p.XnLTerm = 0
 81312  	_p.XnLSlot = uint16(3)
 81313  	_p.XwsFlags = 0
 81314  }
 81315  
 81316  // C comment
 81317  //  /*
 81318  //  ** Initialize a preallocated WhereClause structure.
 81319  //  */
 81320  func _sqlite3WhereClauseInit(tls *crt.TLS, _pWC *XWhereClause, _pWInfo *XWhereInfo) {
 81321  	*(**XWhereInfo)(unsafe.Pointer(&_pWC.XpWInfo)) = _pWInfo
 81322  	*(**XWhereClause)(unsafe.Pointer(&_pWC.XpOuter)) = nil
 81323  	_pWC.XnTerm = int32(0)
 81324  	_pWC.XnSlot = int32(8)
 81325  	*(**XWhereTerm)(unsafe.Pointer(&_pWC.Xa)) = (*XWhereTerm)(unsafe.Pointer(&_pWC.XaStatic))
 81326  }
 81327  
 81328  // C comment
 81329  //  /*
 81330  //  ** This routine identifies subexpressions in the WHERE clause where
 81331  //  ** each subexpression is separated by the AND operator or some other
 81332  //  ** operator specified in the op parameter.  The WhereClause structure
 81333  //  ** is filled with pointers to subexpressions.  For example:
 81334  //  **
 81335  //  **    WHERE  a=='hello' AND coalesce(b,11)<10 AND (c+12!=d OR c==22)
 81336  //  **           \________/     \_______________/     \________________/
 81337  //  **            slot[0]            slot[1]               slot[2]
 81338  //  **
 81339  //  ** The original WHERE clause in pExpr is unaltered.  All this routine
 81340  //  ** does is make slot[] entries point to substructure within pExpr.
 81341  //  **
 81342  //  ** In the previous sentence and in the diagram, "slot[]" refers to
 81343  //  ** the WhereClause.a[] array.  The slot[] array grows as needed to contain
 81344  //  ** all terms of the WHERE clause.
 81345  //  */
 81346  func _sqlite3WhereSplit(tls *crt.TLS, _pWC *XWhereClause, _pExpr *XExpr, _op uint8) {
 81347  	var _pE2 *XExpr
 81348  	_pE2 = _sqlite3ExprSkipCollate(tls, _pExpr)
 81349  	_pWC.Xop = _op
 81350  	if _pE2 == nil {
 81351  		return
 81352  	}
 81353  	if int32(_pE2.Xop) != int32(_op) {
 81354  		_whereClauseInsert(tls, _pWC, _pExpr, 0)
 81355  		goto _2
 81356  	}
 81357  	_sqlite3WhereSplit(tls, _pWC, (*XExpr)(_pE2.XpLeft), _op)
 81358  	_sqlite3WhereSplit(tls, _pWC, (*XExpr)(_pE2.XpRight), _op)
 81359  _2:
 81360  }
 81361  
 81362  // C comment
 81363  //  /*
 81364  //  ** Add a single new WhereTerm entry to the WhereClause object pWC.
 81365  //  ** The new WhereTerm object is constructed from Expr p and with wtFlags.
 81366  //  ** The index in pWC->a[] of the new WhereTerm is returned on success.
 81367  //  ** 0 is returned if the new WhereTerm could not be added due to a memory
 81368  //  ** allocation error.  The memory allocation failure will be recorded in
 81369  //  ** the db->mallocFailed flag so that higher-level functions can detect it.
 81370  //  **
 81371  //  ** This routine will increase the size of the pWC->a[] array as necessary.
 81372  //  **
 81373  //  ** If the wtFlags argument includes TERM_DYNAMIC, then responsibility
 81374  //  ** for freeing the expression p is assumed by the WhereClause object pWC.
 81375  //  ** This is true even if this routine fails to allocate a new WhereTerm.
 81376  //  **
 81377  //  ** WARNING:  This routine might reallocate the space used to store
 81378  //  ** WhereTerms.  All pointers to WhereTerms should be invalidated after
 81379  //  ** calling this routine.  Such pointers may be reinitialized by referencing
 81380  //  ** the pWC->a[] array.
 81381  //  */
 81382  func _whereClauseInsert(tls *crt.TLS, _pWC *XWhereClause, _p *XExpr, _wtFlags uint16) (r0 int32) {
 81383  	var _idx int32
 81384  	var _1_db *Xsqlite3
 81385  	var _pTerm, _1_pOld *XWhereTerm
 81386  	if _pWC.XnTerm < _pWC.XnSlot {
 81387  		goto _0
 81388  	}
 81389  	_1_pOld = (*XWhereTerm)(_pWC.Xa)
 81390  	_1_db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.XpWInfo).XpParse).Xdb)
 81391  	*(**XWhereTerm)(unsafe.Pointer(&_pWC.Xa)) = (*XWhereTerm)(_sqlite3DbMallocRawNN(tls, _1_db, (uint64(64)*uint64(_pWC.XnSlot))*uint64(2)))
 81392  	if (*XWhereTerm)(_pWC.Xa) != nil {
 81393  		goto _1
 81394  	}
 81395  	if (int32(_wtFlags) & int32(1)) != 0 {
 81396  		_sqlite3ExprDelete(tls, _1_db, _p)
 81397  	}
 81398  	*(**XWhereTerm)(unsafe.Pointer(&_pWC.Xa)) = _1_pOld
 81399  	return int32(0)
 81400  
 81401  _1:
 81402  	crt.Xmemcpy(tls, _pWC.Xa, unsafe.Pointer(_1_pOld), uint64(64)*uint64(_pWC.XnTerm))
 81403  	if _1_pOld != (*XWhereTerm)(unsafe.Pointer(&_pWC.XaStatic)) {
 81404  		_sqlite3DbFree(tls, _1_db, unsafe.Pointer(_1_pOld))
 81405  	}
 81406  	_pWC.XnSlot = int32(uint64(_sqlite3DbMallocSize(tls, _1_db, _pWC.Xa)) / uint64(64))
 81407  _0:
 81408  	_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(store2(&_idx, postInc2(&_pWC.XnTerm, 1))))
 81409  	if (_p != nil) && ((_p.Xflags & uint32(262144)) != (0)) {
 81410  		_pTerm.XtruthProb = int16(int32(_sqlite3LogEst(tls, uint64(_p.XiTable))) - int32(270))
 81411  		goto _6
 81412  	}
 81413  	_pTerm.XtruthProb = int16(1)
 81414  _6:
 81415  	*(**XExpr)(unsafe.Pointer(&_pTerm.XpExpr)) = _sqlite3ExprSkipCollate(tls, _p)
 81416  	_pTerm.XwtFlags = _wtFlags
 81417  	*(**XWhereClause)(unsafe.Pointer(&_pTerm.XpWC)) = _pWC
 81418  	_pTerm.XiParent = int32(-1)
 81419  	crt.Xmemset(tls, unsafe.Pointer(&_pTerm.XeOperator), int32(0), uint64(44))
 81420  	return _idx
 81421  }
 81422  
 81423  // C comment
 81424  //  /*
 81425  //  ** Walk an expression tree.  Return non-zero if the expression is constant
 81426  //  ** that does no originate from the ON or USING clauses of a join.
 81427  //  ** Return 0 if it involves variables or function calls or terms from
 81428  //  ** an ON or USING clause.
 81429  //  */
 81430  func _sqlite3ExprIsConstantNotJoin(tls *crt.TLS, _p *XExpr) (r0 int32) {
 81431  	return _exprIsConst(tls, _p, int32(2), int32(0))
 81432  }
 81433  
 81434  // C comment
 81435  //  /*
 81436  //  ** Generate code for a boolean expression such that a jump is made
 81437  //  ** to the label "dest" if the expression is false but execution
 81438  //  ** continues straight thru if the expression is true.
 81439  //  **
 81440  //  ** If the expression evaluates to NULL (neither true nor false) then
 81441  //  ** jump if jumpIfNull is SQLITE_JUMPIFNULL or fall through if jumpIfNull
 81442  //  ** is 0.
 81443  //  */
 81444  func _sqlite3ExprIfFalse(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) {
 81445  	var _op, _regFree1, _regFree2, _r1, _r2, _3_d2, _10_destIfNull int32
 81446  	var _v *TVdbe
 81447  	_v = (*TVdbe)(_pParse.XpVdbe)
 81448  	_op = int32(0)
 81449  	_regFree1 = int32(0)
 81450  	_regFree2 = int32(0)
 81451  	func() {
 81452  		if _jumpIfNull != int32(16) && _jumpIfNull != int32(0) {
 81453  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95403), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101408)))
 81454  			crt.X__builtin_abort(tls)
 81455  		}
 81456  	}()
 81457  	if func() int32 {
 81458  		if _v == nil {
 81459  			return func() int32 {
 81460  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95404), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(4809)))
 81461  				crt.X__builtin_abort(tls)
 81462  				return int32(1)
 81463  			}()
 81464  		}
 81465  		return int32(0)
 81466  	}() != 0 {
 81467  		return
 81468  	}
 81469  	if _pExpr == nil {
 81470  		return
 81471  	}
 81472  	_op = ((int32(_pExpr.Xop) + int32(1)) ^ int32(1)) - int32(1)
 81473  	func() {
 81474  		if int32(_pExpr.Xop) == int32(75) && _op != int32(76) {
 81475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95429), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101455)))
 81476  			crt.X__builtin_abort(tls)
 81477  		}
 81478  	}()
 81479  	func() {
 81480  		if int32(_pExpr.Xop) == int32(76) && _op != int32(75) {
 81481  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95430), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101494)))
 81482  			crt.X__builtin_abort(tls)
 81483  		}
 81484  	}()
 81485  	func() {
 81486  		if int32(_pExpr.Xop) == int32(77) && _op != int32(78) {
 81487  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95431), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101533)))
 81488  			crt.X__builtin_abort(tls)
 81489  		}
 81490  	}()
 81491  	func() {
 81492  		if int32(_pExpr.Xop) == int32(78) && _op != int32(77) {
 81493  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95432), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101563)))
 81494  			crt.X__builtin_abort(tls)
 81495  		}
 81496  	}()
 81497  	func() {
 81498  		if int32(_pExpr.Xop) == int32(81) && _op != int32(82) {
 81499  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95433), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101593)))
 81500  			crt.X__builtin_abort(tls)
 81501  		}
 81502  	}()
 81503  	func() {
 81504  		if int32(_pExpr.Xop) == int32(80) && _op != int32(79) {
 81505  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95434), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101623)))
 81506  			crt.X__builtin_abort(tls)
 81507  		}
 81508  	}()
 81509  	func() {
 81510  		if int32(_pExpr.Xop) == int32(79) && _op != int32(80) {
 81511  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95435), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101653)))
 81512  			crt.X__builtin_abort(tls)
 81513  		}
 81514  	}()
 81515  	func() {
 81516  		if int32(_pExpr.Xop) == int32(82) && _op != int32(81) {
 81517  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95436), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101683)))
 81518  			crt.X__builtin_abort(tls)
 81519  		}
 81520  	}()
 81521  	switch int32(_pExpr.Xop) {
 81522  	case int32(19):
 81523  		goto _34
 81524  	case int32(70):
 81525  		goto _33
 81526  	case int32(71):
 81527  		goto _32
 81528  	case int32(72):
 81529  		goto _35
 81530  	case int32(73):
 81531  		goto _45
 81532  	case int32(74):
 81533  		goto _46
 81534  	case int32(75):
 81535  		goto _43
 81536  	case int32(76):
 81537  		goto _43
 81538  	case int32(77):
 81539  		goto _37
 81540  	case int32(78):
 81541  		goto _37
 81542  	case int32(79):
 81543  		goto _37
 81544  	case int32(80):
 81545  		goto _37
 81546  	case int32(81):
 81547  		goto _37
 81548  	case int32(82):
 81549  		goto _37
 81550  	case int32(148):
 81551  		goto _35
 81552  	default:
 81553  		goto _47
 81554  	}
 81555  
 81556  _32:
 81557  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _dest, _jumpIfNull)
 81558  	_sqlite3ExprCachePush(tls, _pParse)
 81559  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.XpRight), _dest, _jumpIfNull)
 81560  	_sqlite3ExprCachePop(tls, _pParse)
 81561  	goto _48
 81562  _33:
 81563  	_3_d2 = _sqlite3VdbeMakeLabel(tls, _v)
 81564  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _3_d2, _jumpIfNull^int32(16))
 81565  	_sqlite3ExprCachePush(tls, _pParse)
 81566  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.XpRight), _dest, _jumpIfNull)
 81567  	_sqlite3VdbeResolveLabel(tls, _v, _3_d2)
 81568  	_sqlite3ExprCachePop(tls, _pParse)
 81569  	goto _48
 81570  _34:
 81571  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _dest, _jumpIfNull)
 81572  	goto _48
 81573  _35:
 81574  	_op = func() int32 {
 81575  		if int32(_pExpr.Xop) == int32(72) {
 81576  			return int32(77)
 81577  		}
 81578  		return int32(78)
 81579  	}()
 81580  	_jumpIfNull = int32(128)
 81581  _37:
 81582  	if _sqlite3ExprIsVector(tls, (*XExpr)(_pExpr.XpLeft)) != 0 {
 81583  		goto _default_expr
 81584  	}
 81585  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 81586  	_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpRight), &_regFree2)
 81587  	_codeCompare(tls, _pParse, (*XExpr)(_pExpr.XpLeft), (*XExpr)(_pExpr.XpRight), _op, _r1, _r2, _dest, _jumpIfNull)
 81588  
 81589  	goto _48
 81590  _43:
 81591  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 81592  	_sqlite3VdbeAddOp2(tls, _v, _op, _r1, _dest)
 81593  	goto _48
 81594  _45:
 81595  	_exprCodeBetween(tls, _pParse, _pExpr, _dest, _sqlite3ExprIfFalse, _jumpIfNull)
 81596  	goto _48
 81597  _46:
 81598  	if _jumpIfNull != 0 {
 81599  		_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _dest, _dest)
 81600  		goto _53
 81601  	}
 81602  	_10_destIfNull = _sqlite3VdbeMakeLabel(tls, _v)
 81603  	_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _dest, _10_destIfNull)
 81604  	_sqlite3VdbeResolveLabel(tls, _v, _10_destIfNull)
 81605  _53:
 81606  	goto _48
 81607  _47:
 81608  _default_expr:
 81609  	if _exprAlwaysFalse(tls, _pExpr) != 0 {
 81610  		_sqlite3VdbeGoto(tls, _v, _dest)
 81611  		goto _57
 81612  	}
 81613  	if _exprAlwaysTrue(tls, _pExpr) != 0 {
 81614  		goto _57
 81615  	}
 81616  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, _pExpr, &_regFree1)
 81617  	_sqlite3VdbeAddOp3(tls, _v, int32(22), _r1, _dest, bool2int(_jumpIfNull != int32(0)))
 81618  _57:
 81619  	goto _48
 81620  _48:
 81621  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
 81622  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree2)
 81623  }
 81624  
 81625  var _sqlite3ExprIfFalseØ00__func__Ø000 [19]int8
 81626  
 81627  func init() {
 81628  	crt.Xstrncpy(nil, &_sqlite3ExprIfFalseØ00__func__Ø000[0], str(101713), 19)
 81629  }
 81630  
 81631  // C comment
 81632  //  /*
 81633  //  ** Remove from the column cache any entries that were added since the
 81634  //  ** the previous sqlite3ExprCachePush operation.  In other words, restore
 81635  //  ** the cache to the state it was in prior the most recent Push.
 81636  //  */
 81637  func _sqlite3ExprCachePop(tls *crt.TLS, _pParse *XParse) {
 81638  	var _i int32
 81639  	_i = int32(0)
 81640  	func() {
 81641  		if _pParse.XiCacheLevel < int32(1) {
 81642  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94086), unsafe.Pointer(&_sqlite3ExprCachePopØ00__func__Ø000), unsafe.Pointer(str(101732)))
 81643  			crt.X__builtin_abort(tls)
 81644  		}
 81645  	}()
 81646  	_pParse.XiCacheLevel -= 1
 81647  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(4096)) != 0 {
 81648  		crt.Xprintf(tls, str(101755), _pParse.XiCacheLevel)
 81649  	}
 81650  _2:
 81651  	if _i >= int32(_pParse.XnColCache) {
 81652  		goto _4
 81653  	}
 81654  	if (elem71((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)).XiLevel) > _pParse.XiCacheLevel {
 81655  		_cacheEntryClear(tls, _pParse, _i)
 81656  		goto _6
 81657  	}
 81658  	_i += 1
 81659  _6:
 81660  	goto _2
 81661  _4:
 81662  }
 81663  
 81664  var _sqlite3ExprCachePopØ00__func__Ø000 [20]int8
 81665  
 81666  func init() {
 81667  	crt.Xstrncpy(nil, &_sqlite3ExprCachePopØ00__func__Ø000[0], str(101767), 20)
 81668  }
 81669  
 81670  // C comment
 81671  //  /*
 81672  //  ** Generate code for a boolean expression such that a jump is made
 81673  //  ** to the label "dest" if the expression is true but execution
 81674  //  ** continues straight thru if the expression is false.
 81675  //  **
 81676  //  ** If the expression evaluates to NULL (neither true nor false), then
 81677  //  ** take the jump if the jumpIfNull flag is SQLITE_JUMPIFNULL.
 81678  //  **
 81679  //  ** This code depends on the fact that certain token values (ex: TK_EQ)
 81680  //  ** are the same as opcode values (ex: OP_Eq) that implement the corresponding
 81681  //  ** operation.  Special comments in vdbe.c and the mkopcodeh.awk script in
 81682  //  ** the make process cause these values to align.  Assert()s in the code
 81683  //  ** below verify that the numbers are aligned correctly.
 81684  //  */
 81685  func _sqlite3ExprIfTrue(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) {
 81686  	var _op, _regFree1, _regFree2, _r1, _r2, _2_d2, _8_destIfFalse, _8_destIfNull int32
 81687  	var _v *TVdbe
 81688  	_v = (*TVdbe)(_pParse.XpVdbe)
 81689  	_op = int32(0)
 81690  	_regFree1 = int32(0)
 81691  	_regFree2 = int32(0)
 81692  	func() {
 81693  		if _jumpIfNull != int32(16) && _jumpIfNull != int32(0) {
 81694  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95280), unsafe.Pointer(&_sqlite3ExprIfTrueØ00__func__Ø000), unsafe.Pointer(str(101408)))
 81695  			crt.X__builtin_abort(tls)
 81696  		}
 81697  	}()
 81698  	if func() int32 {
 81699  		if _v == nil {
 81700  			return func() int32 {
 81701  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95281), unsafe.Pointer(&_sqlite3ExprIfTrueØ00__func__Ø000), unsafe.Pointer(str(4809)))
 81702  				crt.X__builtin_abort(tls)
 81703  				return int32(1)
 81704  			}()
 81705  		}
 81706  		return int32(0)
 81707  	}() != 0 {
 81708  		return
 81709  	}
 81710  	if func() int32 {
 81711  		if _pExpr == nil {
 81712  			return func() int32 {
 81713  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95282), unsafe.Pointer(&_sqlite3ExprIfTrueØ00__func__Ø000), unsafe.Pointer(str(4809)))
 81714  				crt.X__builtin_abort(tls)
 81715  				return int32(1)
 81716  			}()
 81717  		}
 81718  		return int32(0)
 81719  	}() != 0 {
 81720  		return
 81721  	}
 81722  	_op = int32(_pExpr.Xop)
 81723  	switch _op {
 81724  	case int32(19):
 81725  		goto _12
 81726  	case int32(70):
 81727  		goto _11
 81728  	case int32(71):
 81729  		goto _10
 81730  	case int32(72):
 81731  		goto _13
 81732  	case int32(73):
 81733  		goto _23
 81734  	case int32(74):
 81735  		goto _24
 81736  	case int32(75):
 81737  		goto _21
 81738  	case int32(76):
 81739  		goto _21
 81740  	case int32(77):
 81741  		goto _15
 81742  	case int32(78):
 81743  		goto _15
 81744  	case int32(79):
 81745  		goto _15
 81746  	case int32(80):
 81747  		goto _15
 81748  	case int32(81):
 81749  		goto _15
 81750  	case int32(82):
 81751  		goto _15
 81752  	case int32(148):
 81753  		goto _13
 81754  	default:
 81755  		goto _25
 81756  	}
 81757  
 81758  _10:
 81759  	_2_d2 = _sqlite3VdbeMakeLabel(tls, _v)
 81760  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _2_d2, _jumpIfNull^int32(16))
 81761  	_sqlite3ExprCachePush(tls, _pParse)
 81762  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.XpRight), _dest, _jumpIfNull)
 81763  	_sqlite3VdbeResolveLabel(tls, _v, _2_d2)
 81764  	_sqlite3ExprCachePop(tls, _pParse)
 81765  	goto _26
 81766  _11:
 81767  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _dest, _jumpIfNull)
 81768  	_sqlite3ExprCachePush(tls, _pParse)
 81769  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.XpRight), _dest, _jumpIfNull)
 81770  	_sqlite3ExprCachePop(tls, _pParse)
 81771  	goto _26
 81772  _12:
 81773  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _dest, _jumpIfNull)
 81774  	goto _26
 81775  _13:
 81776  	_op = func() int32 {
 81777  		if _op == int32(72) {
 81778  			return int32(78)
 81779  		}
 81780  		return int32(77)
 81781  	}()
 81782  	_jumpIfNull = int32(128)
 81783  _15:
 81784  	if _sqlite3ExprIsVector(tls, (*XExpr)(_pExpr.XpLeft)) != 0 {
 81785  		goto _default_expr
 81786  	}
 81787  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 81788  	_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpRight), &_regFree2)
 81789  	_codeCompare(tls, _pParse, (*XExpr)(_pExpr.XpLeft), (*XExpr)(_pExpr.XpRight), _op, _r1, _r2, _dest, _jumpIfNull)
 81790  
 81791  	goto _26
 81792  _21:
 81793  
 81794  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 81795  	_sqlite3VdbeAddOp2(tls, _v, _op, _r1, _dest)
 81796  	goto _26
 81797  _23:
 81798  	_exprCodeBetween(tls, _pParse, _pExpr, _dest, _sqlite3ExprIfTrue, _jumpIfNull)
 81799  	goto _26
 81800  _24:
 81801  	_8_destIfFalse = _sqlite3VdbeMakeLabel(tls, _v)
 81802  	_8_destIfNull = func() int32 {
 81803  		if _jumpIfNull != 0 {
 81804  			return _dest
 81805  		}
 81806  		return _8_destIfFalse
 81807  	}()
 81808  	_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _8_destIfFalse, _8_destIfNull)
 81809  	_sqlite3VdbeGoto(tls, _v, _dest)
 81810  	_sqlite3VdbeResolveLabel(tls, _v, _8_destIfFalse)
 81811  	goto _26
 81812  _25:
 81813  _default_expr:
 81814  	if _exprAlwaysTrue(tls, _pExpr) != 0 {
 81815  		_sqlite3VdbeGoto(tls, _v, _dest)
 81816  		goto _35
 81817  	}
 81818  	if _exprAlwaysFalse(tls, _pExpr) != 0 {
 81819  		goto _35
 81820  	}
 81821  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, _pExpr, &_regFree1)
 81822  	_sqlite3VdbeAddOp3(tls, _v, int32(21), _r1, _dest, bool2int(_jumpIfNull != int32(0)))
 81823  _35:
 81824  	goto _26
 81825  _26:
 81826  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
 81827  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree2)
 81828  }
 81829  
 81830  var _sqlite3ExprIfTrueØ00__func__Ø000 [18]int8
 81831  
 81832  func init() {
 81833  	crt.Xstrncpy(nil, &_sqlite3ExprIfTrueØ00__func__Ø000[0], str(101787), 18)
 81834  }
 81835  
 81836  // C comment
 81837  //  /*
 81838  //  ** Generate code to evaluate an expression and store the results
 81839  //  ** into a register.  Return the register number where the results
 81840  //  ** are stored.
 81841  //  **
 81842  //  ** If the register is a temporary register that can be deallocated,
 81843  //  ** then write its number into *pReg.  If the result register is not
 81844  //  ** a temporary, then set *pReg to zero.
 81845  //  **
 81846  //  ** If pExpr is a constant, then this routine might generate this
 81847  //  ** code to fill the register in the initialization section of the
 81848  //  ** VDBE program, in order to factor it out of the evaluation loop.
 81849  //  */
 81850  func _sqlite3ExprCodeTemp(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pReg *int32) (r0 int32) {
 81851  	var _r2, _2_r1 int32
 81852  	_pExpr = _sqlite3ExprSkipCollate(tls, _pExpr)
 81853  	if ((_pParse.XokConstFactor != 0) && (int32(_pExpr.Xop) != int32(157))) && _sqlite3ExprIsConstantNotJoin(tls, _pExpr) != 0 {
 81854  		*_pReg = int32(0)
 81855  		_r2 = _sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, int32(-1))
 81856  		goto _3
 81857  	}
 81858  	_2_r1 = _sqlite3GetTempReg(tls, _pParse)
 81859  	_r2 = _sqlite3ExprCodeTarget(tls, _pParse, _pExpr, _2_r1)
 81860  	if _r2 == _2_r1 {
 81861  		*_pReg = _2_r1
 81862  		goto _5
 81863  	}
 81864  	_sqlite3ReleaseTempReg(tls, _pParse, _2_r1)
 81865  	*_pReg = int32(0)
 81866  _5:
 81867  _3:
 81868  	return _r2
 81869  }
 81870  
 81871  // C comment
 81872  //  /*
 81873  //  ** Generate code for a comparison operator.
 81874  //  */
 81875  func _codeCompare(tls *crt.TLS, _pParse *XParse, _pLeft *XExpr, _pRight *XExpr, _opcode int32, _in1 int32, _in2 int32, _dest int32, _jumpIfNull int32) (r0 int32) {
 81876  	var _p5, _addr int32
 81877  	var _p4 *XCollSeq
 81878  	_p4 = _sqlite3BinaryCompareCollSeq(tls, _pParse, _pLeft, _pRight)
 81879  	_p5 = int32(_binaryCompareP5(tls, _pLeft, _pRight, _jumpIfNull))
 81880  	_addr = _sqlite3VdbeAddOp4(tls, (*TVdbe)(_pParse.XpVdbe), _opcode, _in2, _dest, _in1, (*int8)(unsafe.Pointer(_p4)), int32(-3))
 81881  	_sqlite3VdbeChangeP5(tls, (*TVdbe)(_pParse.XpVdbe), uint16(uint8(_p5)))
 81882  	return _addr
 81883  }
 81884  
 81885  // C comment
 81886  //  /*
 81887  //  ** Return a pointer to the collation sequence that should be used by
 81888  //  ** a binary comparison operator comparing pLeft and pRight.
 81889  //  **
 81890  //  ** If the left hand expression has a collating sequence type, then it is
 81891  //  ** used. Otherwise the collation sequence for the right hand expression
 81892  //  ** is used, or the default (BINARY) if neither expression has a collating
 81893  //  ** type.
 81894  //  **
 81895  //  ** Argument pRight (but not pLeft) may be a null pointer. In this case,
 81896  //  ** it is not considered.
 81897  //  */
 81898  func _sqlite3BinaryCompareCollSeq(tls *crt.TLS, _pParse *XParse, _pLeft *XExpr, _pRight *XExpr) (r0 *XCollSeq) {
 81899  	var _pColl *XCollSeq
 81900  	func() {
 81901  		if _pLeft == nil {
 81902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91184), unsafe.Pointer(&_sqlite3BinaryCompareCollSeqØ00__func__Ø000), unsafe.Pointer(str(42701)))
 81903  			crt.X__builtin_abort(tls)
 81904  		}
 81905  	}()
 81906  	if (_pLeft.Xflags & uint32(256)) != 0 {
 81907  		_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pLeft)
 81908  		goto _6
 81909  	}
 81910  	if (_pRight != nil) && ((_pRight.Xflags & uint32(256)) != (0)) {
 81911  		_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pRight)
 81912  		goto _6
 81913  	}
 81914  	_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pLeft)
 81915  	if _pColl == nil {
 81916  		_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pRight)
 81917  	}
 81918  _6:
 81919  	return _pColl
 81920  }
 81921  
 81922  var _sqlite3BinaryCompareCollSeqØ00__func__Ø000 [28]int8
 81923  
 81924  func init() {
 81925  	crt.Xstrncpy(nil, &_sqlite3BinaryCompareCollSeqØ00__func__Ø000[0], str(101805), 28)
 81926  }
 81927  
 81928  // C comment
 81929  //  /*
 81930  //  ** Return the P5 value that should be used for a binary comparison
 81931  //  ** opcode (OP_Eq, OP_Ge etc.) used to compare pExpr1 and pExpr2.
 81932  //  */
 81933  func _binaryCompareP5(tls *crt.TLS, _pExpr1 *XExpr, _pExpr2 *XExpr, _jumpIfNull int32) (r0 uint8) {
 81934  	var _aff uint8
 81935  	_aff = uint8(_sqlite3ExprAffinity(tls, _pExpr2))
 81936  	_aff = uint8(int32(uint8(_sqlite3CompareAffinity(tls, _pExpr1, int8(_aff)))) | int32(uint8(_jumpIfNull)))
 81937  	return _aff
 81938  }
 81939  
 81940  // C comment
 81941  //  /*
 81942  //  ** Generate code for a BETWEEN operator.
 81943  //  **
 81944  //  **    x BETWEEN y AND z
 81945  //  **
 81946  //  ** The above is equivalent to
 81947  //  **
 81948  //  **    x>=y AND x<=z
 81949  //  **
 81950  //  ** Code it as such, taking care to do the common subexpression
 81951  //  ** elimination of x.
 81952  //  **
 81953  //  ** The xJumpIf parameter determines details:
 81954  //  **
 81955  //  **    NULL:                   Store the boolean result in reg[dest]
 81956  //  **    sqlite3ExprIfTrue:      Jump to dest if true
 81957  //  **    sqlite3ExprIfFalse:     Jump to dest if false
 81958  //  **
 81959  //  ** The jumpIfNull parameter is ignored if xJumpIf is NULL.
 81960  //  */
 81961  func _exprCodeBetween(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _xJump func(*crt.TLS, *XParse, *XExpr, int32, int32), _jumpIfNull int32) {
 81962  	var _regFree1 int32
 81963  	var _exprAnd, _compLeft, _compRight, _exprX XExpr
 81964  	_regFree1 = int32(0)
 81965  	crt.Xmemset(tls, unsafe.Pointer(&_compLeft), int32(0), uint64(72))
 81966  	crt.Xmemset(tls, unsafe.Pointer(&_compRight), int32(0), uint64(72))
 81967  	crt.Xmemset(tls, unsafe.Pointer(&_exprAnd), int32(0), uint64(72))
 81968  	func() {
 81969  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 81970  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95222), unsafe.Pointer(&_exprCodeBetweenØ00__func__Ø000), unsafe.Pointer(str(42733)))
 81971  			crt.X__builtin_abort(tls)
 81972  		}
 81973  	}()
 81974  	_exprX = *(*XExpr)(_pExpr.XpLeft)
 81975  	_exprAnd.Xop = uint8(71)
 81976  	*(**XExpr)(unsafe.Pointer(&_exprAnd.XpLeft)) = &_compLeft
 81977  	*(**XExpr)(unsafe.Pointer(&_exprAnd.XpRight)) = &_compRight
 81978  	_compLeft.Xop = uint8(82)
 81979  	*(**XExpr)(unsafe.Pointer(&_compLeft.XpLeft)) = &_exprX
 81980  	*(**XExpr)(unsafe.Pointer(&_compLeft.XpRight)) = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr)
 81981  	_compRight.Xop = uint8(80)
 81982  	*(**XExpr)(unsafe.Pointer(&_compRight.XpLeft)) = &_exprX
 81983  	*(**XExpr)(unsafe.Pointer(&_compRight.XpRight)) = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), uintptr(1)).XpExpr)
 81984  	_exprToRegister(tls, &_exprX, _exprCodeVector(tls, _pParse, &_exprX, &_regFree1))
 81985  	if _xJump != nil {
 81986  		_xJump(tls, _pParse, &_exprAnd, _dest, _jumpIfNull)
 81987  		goto _3
 81988  	}
 81989  	_exprX.Xflags |= uint32(1)
 81990  	_sqlite3ExprCodeTarget(tls, _pParse, &_exprAnd, _dest)
 81991  _3:
 81992  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
 81993  }
 81994  
 81995  var _exprCodeBetweenØ00__func__Ø000 [16]int8
 81996  
 81997  func init() {
 81998  	crt.Xstrncpy(nil, &_exprCodeBetweenØ00__func__Ø000[0], str(101833), 16)
 81999  }
 82000  
 82001  // C comment
 82002  //  /*
 82003  //  ** Convert a scalar expression node to a TK_REGISTER referencing
 82004  //  ** register iReg.  The caller must ensure that iReg already contains
 82005  //  ** the correct value for the expression.
 82006  //  */
 82007  func _exprToRegister(tls *crt.TLS, _p *XExpr, _iReg int32) {
 82008  	_p.Xop2 = _p.Xop
 82009  	_p.Xop = uint8(157)
 82010  	_p.XiTable = _iReg
 82011  	_p.Xflags &= uint32(4294963199)
 82012  }
 82013  
 82014  // C comment
 82015  //  /*
 82016  //  ** Evaluate an expression (either a vector or a scalar expression) and store
 82017  //  ** the result in continguous temporary registers.  Return the index of
 82018  //  ** the first register used to store the result.
 82019  //  **
 82020  //  ** If the returned result register is a temporary scalar, then also write
 82021  //  ** that register number into *piFreeable.  If the returned result register
 82022  //  ** is not a temporary or if the expression is a vector set *piFreeable
 82023  //  ** to 0.
 82024  //  */
 82025  func _exprCodeVector(tls *crt.TLS, _pParse *XParse, _p *XExpr, _piFreeable *int32) (r0 int32) {
 82026  	var _iResult, _nResult, _4_i int32
 82027  	_nResult = _sqlite3ExprVectorSize(tls, _p)
 82028  	if _nResult == int32(1) {
 82029  		_iResult = _sqlite3ExprCodeTemp(tls, _pParse, _p, _piFreeable)
 82030  		goto _1
 82031  	}
 82032  	*_piFreeable = int32(0)
 82033  	if int32(_p.Xop) == int32(119) {
 82034  		_iResult = _sqlite3CodeSubselect(tls, _pParse, _p, int32(0), int32(0))
 82035  		goto _3
 82036  	}
 82037  	_iResult = _pParse.XnMem + int32(1)
 82038  	_pParse.XnMem += _nResult
 82039  	_4_i = int32(0)
 82040  _4:
 82041  	if _4_i >= _nResult {
 82042  		goto _7
 82043  	}
 82044  	_sqlite3ExprCodeFactorable(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).Xa))), uintptr(_4_i)).XpExpr), _4_i+_iResult)
 82045  	_4_i += 1
 82046  	goto _4
 82047  _7:
 82048  _3:
 82049  _1:
 82050  	return _iResult
 82051  }
 82052  
 82053  // C comment
 82054  //  /*
 82055  //  ** Generate code that will evaluate expression pExpr and store the
 82056  //  ** results in register target.  The results are guaranteed to appear
 82057  //  ** in register target.  If the expression is constant, then this routine
 82058  //  ** might choose to code the expression at initialization time.
 82059  //  */
 82060  func _sqlite3ExprCodeFactorable(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
 82061  	if (_pParse.XokConstFactor != 0) && _sqlite3ExprIsConstant(tls, _pExpr) != 0 {
 82062  		_sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, _target)
 82063  		goto _2
 82064  	}
 82065  	_sqlite3ExprCode(tls, _pParse, _pExpr, _target)
 82066  _2:
 82067  }
 82068  
 82069  // C comment
 82070  //  /*
 82071  //  ** Generate code for an IN expression.
 82072  //  **
 82073  //  **      x IN (SELECT ...)
 82074  //  **      x IN (value, value, ...)
 82075  //  **
 82076  //  ** The left-hand side (LHS) is a scalar or vector expression.  The
 82077  //  ** right-hand side (RHS) is an array of zero or more scalar values, or a
 82078  //  ** subquery.  If the RHS is a subquery, the number of result columns must
 82079  //  ** match the number of columns in the vector on the LHS.  If the RHS is
 82080  //  ** a list of values, the LHS must be a scalar.
 82081  //  **
 82082  //  ** The IN operator is true if the LHS value is contained within the RHS.
 82083  //  ** The result is false if the LHS is definitely not in the RHS.  The
 82084  //  ** result is NULL if the presence of the LHS in the RHS cannot be
 82085  //  ** determined due to NULLs.
 82086  //  **
 82087  //  ** This routine generates code that jumps to destIfFalse if the LHS is not
 82088  //  ** contained within the RHS.  If due to NULLs we cannot determine if the LHS
 82089  //  ** is contained in the RHS then jump to destIfNull.  If the LHS is contained
 82090  //  ** within the RHS then fall through.
 82091  //  **
 82092  //  ** See the separate in-operator.md documentation file in the canonical
 82093  //  ** SQLite source tree for additional information.
 82094  //  */
 82095  func _sqlite3ExprCodeIN(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _destIfFalse int32, _destIfNull int32) {
 82096  	var _rRhsHasNull, _eType, _rLhs, _rLhsOrig, _nVector, _iDummy, _i, _destStep2, _destStep6, _addrTruthOp, _destNotNull, _addrTop, _1_j, _1_cnt, _6_labelOk, _6_r2, _6_regToFree, _6_regCkNull, _6_ii, _23_r3 int32
 82097  	var _aiMap *int32
 82098  	var _zAff *int8
 82099  	var _v *TVdbe
 82100  	var _6_pList *XExprList
 82101  	var _pLeft, _15_p, _23_p *XExpr
 82102  	var _6_pColl, _23_pColl *XCollSeq
 82103  	_rRhsHasNull = int32(0)
 82104  	_aiMap = nil
 82105  	_zAff = nil
 82106  	_destStep6 = int32(0)
 82107  	_pLeft = (*XExpr)(_pExpr.XpLeft)
 82108  	if _sqlite3ExprCheckIN(tls, _pParse, _pExpr) != 0 {
 82109  		return
 82110  	}
 82111  	_zAff = _exprINAffinity(tls, _pParse, _pExpr)
 82112  	_nVector = _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpLeft))
 82113  	_aiMap = (*int32)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), (uint64(_nVector)*uint64(5))+uint64(1)))
 82114  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 82115  		goto _sqlite3ExprCodeIN_oom_error
 82116  	}
 82117  	_v = (*TVdbe)(_pParse.XpVdbe)
 82118  	func() {
 82119  		if _v == nil {
 82120  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93723), unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000), unsafe.Pointer(str(42019)))
 82121  			crt.X__builtin_abort(tls)
 82122  		}
 82123  	}()
 82124  	_sqlite3VdbeNoopComment(tls, _v, str(101849))
 82125  	_eType = _sqlite3FindInIndex(tls, _pParse, _pExpr, uint32(3), func() *int32 {
 82126  		if _destIfFalse == _destIfNull {
 82127  			return nil
 82128  		}
 82129  		return &_rRhsHasNull
 82130  	}(), _aiMap)
 82131  	func() {
 82132  		if _pParse.XnErr == 0 && _nVector != int32(1) && _eType != int32(2) && _eType != int32(3) && _eType != int32(4) {
 82133  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93729), unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000), unsafe.Pointer(str(101863)))
 82134  			crt.X__builtin_abort(tls)
 82135  		}
 82136  	}()
 82137  	_i = int32(0)
 82138  _12:
 82139  	if _i >= _nVector {
 82140  		goto _15
 82141  	}
 82142  	_1_cnt = store2(&_1_j, int32(0))
 82143  _16:
 82144  	if _1_j >= _nVector {
 82145  		goto _19
 82146  	}
 82147  	if (*elem8(_aiMap, uintptr(_1_j))) == _i {
 82148  		_1_cnt += 1
 82149  	}
 82150  	_1_j += 1
 82151  	goto _16
 82152  _19:
 82153  	func() {
 82154  		if _1_cnt != int32(1) {
 82155  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93738), unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000), unsafe.Pointer(str(101972)))
 82156  			crt.X__builtin_abort(tls)
 82157  		}
 82158  	}()
 82159  	_i += 1
 82160  	goto _12
 82161  _15:
 82162  	_sqlite3ExprCachePush(tls, _pParse)
 82163  	_rLhsOrig = _exprCodeVector(tls, _pParse, _pLeft, &_iDummy)
 82164  	_i = int32(0)
 82165  _23:
 82166  	if _i >= _nVector || (*elem8(_aiMap, uintptr(_i))) != _i {
 82167  		goto _27
 82168  	}
 82169  	_i += 1
 82170  	goto _23
 82171  _27:
 82172  	if _i == _nVector {
 82173  		_rLhs = _rLhsOrig
 82174  		goto _29
 82175  	}
 82176  	_rLhs = _sqlite3GetTempRange(tls, _pParse, _nVector)
 82177  	_i = int32(0)
 82178  _30:
 82179  	if _i >= _nVector {
 82180  		goto _33
 82181  	}
 82182  	_sqlite3VdbeAddOp3(tls, _v, int32(64), _rLhsOrig+_i, _rLhs+(*elem8(_aiMap, uintptr(_i))), int32(0))
 82183  	_i += 1
 82184  	goto _30
 82185  _33:
 82186  _29:
 82187  	if _eType != int32(5) {
 82188  		goto _34
 82189  	}
 82190  	_6_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 82191  	_6_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpLeft))
 82192  	_6_labelOk = _sqlite3VdbeMakeLabel(tls, _v)
 82193  	_6_regCkNull = int32(0)
 82194  	func() {
 82195  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 82196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93778), unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000), unsafe.Pointer(str(42733)))
 82197  			crt.X__builtin_abort(tls)
 82198  		}
 82199  	}()
 82200  	if _destIfNull != _destIfFalse {
 82201  		_6_regCkNull = _sqlite3GetTempReg(tls, _pParse)
 82202  		_sqlite3VdbeAddOp3(tls, _v, int32(84), _rLhs, _rLhs, _6_regCkNull)
 82203  	}
 82204  	_6_ii = int32(0)
 82205  _38:
 82206  	if _6_ii >= _6_pList.XnExpr {
 82207  		goto _41
 82208  	}
 82209  	_6_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_6_pList.Xa)), uintptr(_6_ii)).XpExpr), &_6_regToFree)
 82210  	if _6_regCkNull != 0 && _sqlite3ExprCanBeNull(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_6_pList.Xa)), uintptr(_6_ii)).XpExpr)) != 0 {
 82211  		_sqlite3VdbeAddOp3(tls, _v, int32(84), _6_regCkNull, _6_r2, _6_regCkNull)
 82212  	}
 82213  	if (_6_ii < (_6_pList.XnExpr - int32(1))) || (_destIfNull != _destIfFalse) {
 82214  		_sqlite3VdbeAddOp4(tls, _v, int32(78), _rLhs, _6_labelOk, _6_r2, (*int8)(unsafe.Pointer(_6_pColl)), int32(-3))
 82215  		_sqlite3VdbeChangeP5(tls, _v, uint16(*elem1(_zAff, 0)))
 82216  		goto _46
 82217  	}
 82218  	func() {
 82219  		if _destIfNull != _destIfFalse {
 82220  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93795), unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000), unsafe.Pointer(str(101979)))
 82221  			crt.X__builtin_abort(tls)
 82222  		}
 82223  	}()
 82224  	_sqlite3VdbeAddOp4(tls, _v, int32(77), _rLhs, _destIfFalse, _6_r2, (*int8)(unsafe.Pointer(_6_pColl)), int32(-3))
 82225  	_sqlite3VdbeChangeP5(tls, _v, uint16(int32(*elem1(_zAff, 0))|int32(16)))
 82226  _46:
 82227  	_sqlite3ReleaseTempReg(tls, _pParse, _6_regToFree)
 82228  	_6_ii += 1
 82229  	goto _38
 82230  _41:
 82231  	if _6_regCkNull != 0 {
 82232  		_sqlite3VdbeAddOp2(tls, _v, int32(75), _6_regCkNull, _destIfNull)
 82233  		_sqlite3VdbeGoto(tls, _v, _destIfFalse)
 82234  	}
 82235  	_sqlite3VdbeResolveLabel(tls, _v, _6_labelOk)
 82236  	_sqlite3ReleaseTempReg(tls, _pParse, _6_regCkNull)
 82237  	goto _sqlite3ExprCodeIN_finished
 82238  _34:
 82239  	if _destIfNull == _destIfFalse {
 82240  		_destStep2 = _destIfFalse
 82241  		goto _51
 82242  	}
 82243  	_destStep2 = store2(&_destStep6, _sqlite3VdbeMakeLabel(tls, _v))
 82244  _51:
 82245  	_i = int32(0)
 82246  _52:
 82247  	if _i >= _nVector {
 82248  		goto _55
 82249  	}
 82250  	_15_p = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pExpr.XpLeft), _i)
 82251  	if _sqlite3ExprCanBeNull(tls, _15_p) != 0 {
 82252  		_sqlite3VdbeAddOp2(tls, _v, int32(75), _rLhs+_i, _destStep2)
 82253  	}
 82254  	_i += 1
 82255  	goto _52
 82256  _55:
 82257  	if _eType == int32(1) {
 82258  		_sqlite3VdbeAddOp3(tls, _v, int32(31), _pExpr.XiTable, _destIfFalse, _rLhs)
 82259  		_addrTruthOp = _sqlite3VdbeAddOp0(tls, _v, int32(13))
 82260  		goto _58
 82261  	}
 82262  	_sqlite3VdbeAddOp4(tls, _v, int32(100), _rLhs, _nVector, int32(0), _zAff, _nVector)
 82263  	if _destIfFalse == _destIfNull {
 82264  		_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _pExpr.XiTable, _destIfFalse, _rLhs, _nVector)
 82265  		goto _sqlite3ExprCodeIN_finished
 82266  	}
 82267  	_addrTruthOp = _sqlite3VdbeAddOp4Int(tls, _v, int32(30), _pExpr.XiTable, int32(0), _rLhs, _nVector)
 82268  _58:
 82269  	if _rRhsHasNull != 0 && (_nVector == int32(1)) {
 82270  		_sqlite3VdbeAddOp2(tls, _v, int32(76), _rRhsHasNull, _destIfFalse)
 82271  	}
 82272  	if _destIfFalse == _destIfNull {
 82273  		_sqlite3VdbeGoto(tls, _v, _destIfFalse)
 82274  	}
 82275  	if _destStep6 != 0 {
 82276  		_sqlite3VdbeResolveLabel(tls, _v, _destStep6)
 82277  	}
 82278  	_addrTop = _sqlite3VdbeAddOp2(tls, _v, int32(37), _pExpr.XiTable, _destIfFalse)
 82279  	if _nVector > int32(1) {
 82280  		_destNotNull = _sqlite3VdbeMakeLabel(tls, _v)
 82281  		goto _65
 82282  	}
 82283  	_destNotNull = _destIfFalse
 82284  _65:
 82285  	_i = int32(0)
 82286  _66:
 82287  	if _i >= _nVector {
 82288  		goto _69
 82289  	}
 82290  	_23_r3 = _sqlite3GetTempReg(tls, _pParse)
 82291  	_23_p = _sqlite3VectorFieldSubexpr(tls, _pLeft, _i)
 82292  	_23_pColl = _sqlite3ExprCollSeq(tls, _pParse, _23_p)
 82293  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _pExpr.XiTable, _i, _23_r3)
 82294  	_sqlite3VdbeAddOp4(tls, _v, int32(77), _rLhs+_i, _destNotNull, _23_r3, (*int8)(unsafe.Pointer(_23_pColl)), int32(-3))
 82295  	_sqlite3ReleaseTempReg(tls, _pParse, _23_r3)
 82296  	_i += 1
 82297  	goto _66
 82298  _69:
 82299  	_sqlite3VdbeAddOp2(tls, _v, int32(13), int32(0), _destIfNull)
 82300  	if _nVector > int32(1) {
 82301  		_sqlite3VdbeResolveLabel(tls, _v, _destNotNull)
 82302  		_sqlite3VdbeAddOp2(tls, _v, int32(7), _pExpr.XiTable, _addrTop+int32(1))
 82303  		_sqlite3VdbeAddOp2(tls, _v, int32(13), int32(0), _destIfFalse)
 82304  	}
 82305  	_sqlite3VdbeJumpHere(tls, _v, _addrTruthOp)
 82306  _sqlite3ExprCodeIN_finished:
 82307  	if _rLhs != _rLhsOrig {
 82308  		_sqlite3ReleaseTempReg(tls, _pParse, _rLhs)
 82309  	}
 82310  	_sqlite3ExprCachePop(tls, _pParse)
 82311  	_sqlite3VdbeComment(tls, _v, str(102003))
 82312  _sqlite3ExprCodeIN_oom_error:
 82313  	_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_aiMap))
 82314  	_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_zAff))
 82315  }
 82316  
 82317  // C comment
 82318  //  /*
 82319  //  ** Expr pIn is an IN(...) expression. This function checks that the
 82320  //  ** sub-select on the RHS of the IN() operator has the same number of
 82321  //  ** columns as the vector on the LHS. Or, if the RHS of the IN() is not
 82322  //  ** a sub-query, that the LHS is a vector of size 1.
 82323  //  */
 82324  func _sqlite3ExprCheckIN(tls *crt.TLS, _pParse *XParse, _pIn *XExpr) (r0 int32) {
 82325  	var _nVector int32
 82326  	_nVector = _sqlite3ExprVectorSize(tls, (*XExpr)(_pIn.XpLeft))
 82327  	if (_pIn.Xflags & uint32(2048)) == 0 {
 82328  		goto _0
 82329  	}
 82330  	if _nVector != ((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn.Xx))).XpEList).XnExpr) {
 82331  		_sqlite3SubselectError(tls, _pParse, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn.Xx))).XpEList).XnExpr, _nVector)
 82332  		return int32(1)
 82333  	}
 82334  	goto _3
 82335  _0:
 82336  	if _nVector != int32(1) {
 82337  		_sqlite3VectorErrorMsg(tls, _pParse, (*XExpr)(_pIn.XpLeft))
 82338  		return int32(1)
 82339  	}
 82340  _3:
 82341  	return int32(0)
 82342  }
 82343  
 82344  var _sqlite3ExprCodeINØ00__func__Ø000 [18]int8
 82345  
 82346  func init() {
 82347  	crt.Xstrncpy(nil, &_sqlite3ExprCodeINØ00__func__Ø000[0], str(102015), 18)
 82348  }
 82349  
 82350  // C comment
 82351  //  /* IN operator used as a loop */
 82352  func _sqlite3FindInIndex(tls *crt.TLS, _pParse *XParse, _pX *XExpr, _inFlags uint32, _prRhsHasNull *int32, _aiMap *int32) (r0 int32) {
 82353  	var _4_iDb int16
 82354  	var _eType, _iTab, _mustBeUnique, _1_i, _4_nExpr, _5_iAddr, _6_affinity_ok, _6_i, _7_iCol, _13_j, _16_iAddr, _20_rMayHaveNull, _25_i, _25_n int32
 82355  	var _7_idxaff, _7_cmpaff int8
 82356  	var _20_savedNQueryLoop uint32
 82357  	var _10_colUsed, _10_mCol uint64
 82358  	var _4_db *Xsqlite3
 82359  	var _4_pTab *XTable
 82360  	var _v *TVdbe
 82361  	var _1_pEList, _4_pEList *XExprList
 82362  	var _p *XSelect
 82363  	var _7_pLhs, _13_pLhs, _13_pRhs *XExpr
 82364  	var _6_pIdx *XIndex
 82365  	var _13_pReq *XCollSeq
 82366  	_eType = int32(0)
 82367  	_iTab = postInc2(&_pParse.XnTab, 1)
 82368  	_v = _sqlite3GetVdbe(tls, _pParse)
 82369  	func() {
 82370  		if int32(_pX.Xop) != int32(74) {
 82371  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93103), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102033)))
 82372  			crt.X__builtin_abort(tls)
 82373  		}
 82374  	}()
 82375  	_mustBeUnique = bool2int((_inFlags & uint32(4)) != (0))
 82376  	if _prRhsHasNull == nil || (_pX.Xflags&uint32(2048)) == 0 {
 82377  		goto _3
 82378  	}
 82379  	_1_pEList = (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pX.Xx))).XpEList)
 82380  	_1_i = int32(0)
 82381  _4:
 82382  	if _1_i >= _1_pEList.XnExpr {
 82383  		goto _7
 82384  	}
 82385  	if _sqlite3ExprCanBeNull(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_1_pEList.Xa)), uintptr(_1_i)).XpExpr)) != 0 {
 82386  		goto _7
 82387  	}
 82388  	_1_i += 1
 82389  	goto _4
 82390  _7:
 82391  	if _1_i == _1_pEList.XnExpr {
 82392  		_prRhsHasNull = nil
 82393  	}
 82394  _3:
 82395  	if _pParse.XnErr != int32(0) || store98(&_p, _isCandidateForInOpt(tls, _pX)) == nil {
 82396  		goto _11
 82397  	}
 82398  	_4_db = (*Xsqlite3)(_pParse.Xdb)
 82399  	_4_pEList = (*XExprList)(_p.XpEList)
 82400  	_4_nExpr = _4_pEList.XnExpr
 82401  	func() {
 82402  		if (*XExprList)(_p.XpEList) == nil {
 82403  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93132), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(46042)))
 82404  			crt.X__builtin_abort(tls)
 82405  		}
 82406  	}()
 82407  	func() {
 82408  		if (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpEList).Xa))), 0).XpExpr) == nil {
 82409  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93133), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102047)))
 82410  			crt.X__builtin_abort(tls)
 82411  		}
 82412  	}()
 82413  	func() {
 82414  		if (*XSrcList)(_p.XpSrc) == nil {
 82415  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93134), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102072)))
 82416  			crt.X__builtin_abort(tls)
 82417  		}
 82418  	}()
 82419  	_4_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), 0).XpTab)
 82420  	_4_iDb = int16(_sqlite3SchemaToIndex(tls, _4_db, (*XSchema)(_4_pTab.XpSchema)))
 82421  	_sqlite3CodeVerifySchema(tls, _pParse, int32(_4_iDb))
 82422  	_sqlite3TableLock(tls, _pParse, int32(_4_iDb), _4_pTab.Xtnum, 0, _4_pTab.XzName)
 82423  	func() {
 82424  		if _v == nil {
 82425  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93142), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(41816)))
 82426  			crt.X__builtin_abort(tls)
 82427  		}
 82428  	}()
 82429  	if (_4_nExpr == int32(1)) && (int32((*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_4_pEList.Xa)), 0).XpExpr).XiColumn) < int32(0)) {
 82430  		_5_iAddr = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 82431  		_sqlite3OpenTable(tls, _pParse, _iTab, int32(_4_iDb), _4_pTab, int32(106))
 82432  		_eType = int32(1)
 82433  		_sqlite3VdbeJumpHere(tls, _v, _5_iAddr)
 82434  		goto _22
 82435  	}
 82436  	_6_affinity_ok = int32(1)
 82437  	_6_i = int32(0)
 82438  _23:
 82439  	if _6_i >= _4_nExpr || _6_affinity_ok == 0 {
 82440  		goto _27
 82441  	}
 82442  	_7_pLhs = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pX.XpLeft), _6_i)
 82443  	_7_iCol = int32((*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_4_pEList.Xa)), uintptr(_6_i)).XpExpr).XiColumn)
 82444  	_7_idxaff = _sqlite3TableColumnAffinity(tls, _4_pTab, _7_iCol)
 82445  	_7_cmpaff = _sqlite3CompareAffinity(tls, _7_pLhs, _7_idxaff)
 82446  	switch int32(_7_cmpaff) {
 82447  	case int32(65):
 82448  		goto _29
 82449  	case int32(66):
 82450  		goto _30
 82451  	default:
 82452  		goto _31
 82453  	}
 82454  
 82455  _29:
 82456  	goto _32
 82457  _30:
 82458  	func() {
 82459  		if int32(_7_idxaff) != int32(66) {
 82460  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93176), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102083)))
 82461  			crt.X__builtin_abort(tls)
 82462  		}
 82463  	}()
 82464  	goto _32
 82465  _31:
 82466  	_6_affinity_ok = bool2int(int32(_7_idxaff) >= int32(67))
 82467  _32:
 82468  	_6_i += 1
 82469  	goto _23
 82470  _27:
 82471  	if _6_affinity_ok == 0 {
 82472  		goto _35
 82473  	}
 82474  	_6_pIdx = (*XIndex)(_4_pTab.XpIndex)
 82475  _36:
 82476  	if _6_pIdx == nil || _eType != int32(0) {
 82477  		goto _40
 82478  	}
 82479  	if int32(_6_pIdx.XnColumn) < _4_nExpr {
 82480  		goto _37
 82481  	}
 82482  	if int32(_6_pIdx.XnColumn) >= int32(63) {
 82483  		goto _37
 82484  	}
 82485  	if _mustBeUnique == 0 {
 82486  		goto _43
 82487  	}
 82488  	if (int32(_6_pIdx.XnKeyCol) > _4_nExpr) || ((int32(_6_pIdx.XnColumn) > _4_nExpr) && (int32(_6_pIdx.XonError) == int32(0))) {
 82489  		goto _37
 82490  	}
 82491  _43:
 82492  	_10_colUsed = 0
 82493  	_6_i = int32(0)
 82494  _47:
 82495  	if _6_i >= _4_nExpr {
 82496  		goto _50
 82497  	}
 82498  	_13_pLhs = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pX.XpLeft), _6_i)
 82499  	_13_pRhs = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_4_pEList.Xa)), uintptr(_6_i)).XpExpr)
 82500  	_13_pReq = _sqlite3BinaryCompareCollSeq(tls, _pParse, _13_pLhs, _13_pRhs)
 82501  	func() {
 82502  		if _13_pReq == nil && int32(_13_pRhs.XiColumn) != int32(-1) && _pParse.XnErr == 0 {
 82503  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93209), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102107)))
 82504  			crt.X__builtin_abort(tls)
 82505  		}
 82506  	}()
 82507  	_13_j = int32(0)
 82508  _55:
 82509  	if _13_j >= _4_nExpr {
 82510  		goto _58
 82511  	}
 82512  	if int32(*elem52(_6_pIdx.XaiColumn, uintptr(_13_j))) != int32(_13_pRhs.XiColumn) {
 82513  		goto _56
 82514  	}
 82515  	func() {
 82516  		if (*elem0(_6_pIdx.XazColl, uintptr(_13_j))) == nil {
 82517  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93212), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102158)))
 82518  			crt.X__builtin_abort(tls)
 82519  		}
 82520  	}()
 82521  	if (_13_pReq != nil) && (_sqlite3StrICmp(tls, _13_pReq.XzName, *elem0(_6_pIdx.XazColl, uintptr(_13_j))) != int32(0)) {
 82522  		goto _56
 82523  	}
 82524  	goto _58
 82525  _56:
 82526  	_13_j += 1
 82527  	goto _55
 82528  _58:
 82529  	if _13_j == _4_nExpr {
 82530  		goto _50
 82531  	}
 82532  	_10_mCol = uint64(1) << uint(_13_j)
 82533  	if (_10_mCol & _10_colUsed) != 0 {
 82534  		goto _50
 82535  	}
 82536  	_10_colUsed |= _10_mCol
 82537  	if _aiMap != nil {
 82538  		*elem8(_aiMap, uintptr(_6_i)) = _13_j
 82539  	}
 82540  	_6_i += 1
 82541  	goto _47
 82542  _50:
 82543  	func() {
 82544  		if _6_i != _4_nExpr && _10_colUsed == ((uint64(1)<<uint(_4_nExpr))-uint64(1)) {
 82545  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93225), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102174)))
 82546  			crt.X__builtin_abort(tls)
 82547  		}
 82548  	}()
 82549  	if _10_colUsed != ((uint64(1) << uint(_4_nExpr)) - uint64(1)) {
 82550  		goto _70
 82551  	}
 82552  	_16_iAddr = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 82553  	_sqlite3VdbeAddOp4(tls, _v, int32(165), int32(0), int32(0), int32(0), _sqlite3MPrintf(tls, _4_db, str(102214), unsafe.Pointer(_6_pIdx.XzName)), int32(-1))
 82554  	_sqlite3VdbeAddOp3(tls, _v, int32(106), _iTab, _6_pIdx.Xtnum, int32(_4_iDb))
 82555  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _6_pIdx)
 82556  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_6_pIdx.XzName))
 82557  
 82558  	_eType = int32(3) + int32(*elem15(_6_pIdx.XaSortOrder, 0))
 82559  	if _prRhsHasNull == nil {
 82560  		goto _71
 82561  	}
 82562  	*_prRhsHasNull = preInc2(&_pParse.XnMem, 1)
 82563  	if _4_nExpr == int32(1) {
 82564  		_sqlite3SetHasNullFlag(tls, _v, _iTab, *_prRhsHasNull)
 82565  	}
 82566  _71:
 82567  	_sqlite3VdbeJumpHere(tls, _v, _16_iAddr)
 82568  _70:
 82569  _37:
 82570  	_6_pIdx = (*XIndex)(_6_pIdx.XpNext)
 82571  	goto _36
 82572  _40:
 82573  _35:
 82574  _22:
 82575  _11:
 82576  	if (((_eType == int32(0)) && ((_inFlags & uint32(1)) != 0)) && ((_pX.Xflags & uint32(2048)) == (0))) && ((_sqlite3InRhsIsConstant(tls, _pX) == 0) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pX.Xx))).XnExpr) <= int32(2))) {
 82577  		_eType = int32(5)
 82578  	}
 82579  	if _eType != int32(0) {
 82580  		goto _78
 82581  	}
 82582  	_20_savedNQueryLoop = _pParse.XnQueryLoop
 82583  	_20_rMayHaveNull = int32(0)
 82584  	_eType = int32(2)
 82585  	if (_inFlags & uint32(4)) == 0 {
 82586  		goto _79
 82587  	}
 82588  	_pParse.XnQueryLoop = 0
 82589  	if (int32((*XExpr)(_pX.XpLeft).XiColumn) < int32(0)) && ((_pX.Xflags & uint32(2048)) == (0)) {
 82590  		_eType = int32(1)
 82591  	}
 82592  	goto _83
 82593  _79:
 82594  	if _prRhsHasNull != nil {
 82595  		*_prRhsHasNull = store2(&_20_rMayHaveNull, preInc2(&_pParse.XnMem, 1))
 82596  	}
 82597  _83:
 82598  	_sqlite3CodeSubselect(tls, _pParse, _pX, _20_rMayHaveNull, bool2int(_eType == int32(1)))
 82599  	_pParse.XnQueryLoop = _20_savedNQueryLoop
 82600  	goto _84
 82601  _78:
 82602  	_pX.XiTable = _iTab
 82603  _84:
 82604  	if _aiMap == nil || _eType == int32(3) || _eType == int32(4) {
 82605  		goto _87
 82606  	}
 82607  	_25_n = _sqlite3ExprVectorSize(tls, (*XExpr)(_pX.XpLeft))
 82608  	_25_i = int32(0)
 82609  _88:
 82610  	if _25_i >= _25_n {
 82611  		goto _91
 82612  	}
 82613  	*elem8(_aiMap, uintptr(_25_i)) = _25_i
 82614  	_25_i += 1
 82615  	goto _88
 82616  _91:
 82617  _87:
 82618  	return _eType
 82619  }
 82620  
 82621  var _sqlite3FindInIndexØ00__func__Ø000 [19]int8
 82622  
 82623  func init() {
 82624  	crt.Xstrncpy(nil, &_sqlite3FindInIndexØ00__func__Ø000[0], str(102245), 19)
 82625  }
 82626  
 82627  // C comment
 82628  //  /*
 82629  //  ** Return FALSE if there is no chance that the expression can be NULL.
 82630  //  **
 82631  //  ** If the expression might be NULL or if the expression is too complex
 82632  //  ** to tell return TRUE.
 82633  //  **
 82634  //  ** This routine is used as an optimization, to skip OP_IsNull opcodes
 82635  //  ** when we know that a value cannot be NULL.  Hence, a false positive
 82636  //  ** (returning TRUE when in fact the expression can never be NULL) might
 82637  //  ** be a small performance hit but is otherwise harmless.  On the other
 82638  //  ** hand, a false negative (returning FALSE when the result could be NULL)
 82639  //  ** will likely result in an incorrect answer.  So when in doubt, return
 82640  //  ** TRUE.
 82641  //  */
 82642  func _sqlite3ExprCanBeNull(tls *crt.TLS, _p *XExpr) (r0 int32) {
 82643  	var _op uint8
 82644  _0:
 82645  	if (int32(_p.Xop) == int32(156)) || (int32(_p.Xop) == int32(155)) {
 82646  		_p = (*XExpr)(_p.XpLeft)
 82647  		goto _0
 82648  	}
 82649  	_op = _p.Xop
 82650  	if int32(_op) == int32(157) {
 82651  		_op = _p.Xop2
 82652  	}
 82653  	switch int32(_op) {
 82654  	case int32(97):
 82655  		goto _5
 82656  	case int32(132):
 82657  		goto _5
 82658  	case int32(133):
 82659  		goto _5
 82660  	case int32(134):
 82661  		goto _5
 82662  	case int32(152):
 82663  		goto _9
 82664  	default:
 82665  		goto _10
 82666  	}
 82667  
 82668  _5:
 82669  	return int32(0)
 82670  
 82671  _9:
 82672  	func() {
 82673  		if (*XTable)(_p.XpTab) == nil {
 82674  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92867), unsafe.Pointer(&_sqlite3ExprCanBeNullØ00__func__Ø000), unsafe.Pointer(str(102264)))
 82675  			crt.X__builtin_abort(tls)
 82676  		}
 82677  	}()
 82678  	return bool2int(((_p.Xflags & uint32(1048576)) != (0)) || ((int32(_p.XiColumn) >= int32(0)) && (int32(elem43((*XColumn)((*XTable)(_p.XpTab).XaCol), uintptr(_p.XiColumn)).XnotNull) == int32(0))))
 82679  
 82680  _10:
 82681  	return int32(1)
 82682  }
 82683  
 82684  var _sqlite3ExprCanBeNullØ00__func__Ø000 [21]int8
 82685  
 82686  func init() {
 82687  	crt.Xstrncpy(nil, &_sqlite3ExprCanBeNullØ00__func__Ø000[0], str(102275), 21)
 82688  }
 82689  
 82690  func _isCandidateForInOpt(tls *crt.TLS, _pX *XExpr) (r0 *XSelect) {
 82691  	var _i int32
 82692  	var _pTab *XTable
 82693  	var _pSrc *XSrcList
 82694  	var _pEList *XExprList
 82695  	var _p *XSelect
 82696  	var _2_pRes *XExpr
 82697  	if (_pX.Xflags & uint32(2048)) == (0) {
 82698  		return nil
 82699  	}
 82700  	if (_pX.Xflags & uint32(32)) != (0) {
 82701  		return nil
 82702  	}
 82703  	_p = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pX.Xx)))
 82704  	if _p.XpPrior != nil {
 82705  		return nil
 82706  	}
 82707  	if (_p.XselFlags & uint32(9)) != 0 {
 82708  		return nil
 82709  	}
 82710  	func() {
 82711  		if (*XExprList)(_p.XpGroupBy) != nil {
 82712  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92948), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(46674)))
 82713  			crt.X__builtin_abort(tls)
 82714  		}
 82715  	}()
 82716  	if _p.XpLimit != nil {
 82717  		return nil
 82718  	}
 82719  	func() {
 82720  		if (*XExpr)(_p.XpOffset) != nil {
 82721  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92950), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(98569)))
 82722  			crt.X__builtin_abort(tls)
 82723  		}
 82724  	}()
 82725  	if _p.XpWhere != nil {
 82726  		return nil
 82727  	}
 82728  	_pSrc = (*XSrcList)(_p.XpSrc)
 82729  	func() {
 82730  		if _pSrc == nil {
 82731  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92953), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(47776)))
 82732  			crt.X__builtin_abort(tls)
 82733  		}
 82734  	}()
 82735  	if _pSrc.XnSrc != int32(1) {
 82736  		return nil
 82737  	}
 82738  	if (elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XpSelect) != nil {
 82739  		return nil
 82740  	}
 82741  	_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XpTab)
 82742  	func() {
 82743  		if _pTab == nil {
 82744  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92957), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(43549)))
 82745  			crt.X__builtin_abort(tls)
 82746  		}
 82747  	}()
 82748  	func() {
 82749  		if (*XSelect)(_pTab.XpSelect) != nil {
 82750  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92958), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(102296)))
 82751  			crt.X__builtin_abort(tls)
 82752  		}
 82753  	}()
 82754  	if _pTab.XnModuleArg != 0 {
 82755  		return nil
 82756  	}
 82757  	_pEList = (*XExprList)(_p.XpEList)
 82758  	func() {
 82759  		if _pEList == nil {
 82760  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92961), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(45007)))
 82761  			crt.X__builtin_abort(tls)
 82762  		}
 82763  	}()
 82764  	_i = int32(0)
 82765  _21:
 82766  	if _i >= _pEList.XnExpr {
 82767  		goto _24
 82768  	}
 82769  	_2_pRes = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr)
 82770  	if int32(_2_pRes.Xop) != int32(152) {
 82771  		return nil
 82772  	}
 82773  	func() {
 82774  		if _2_pRes.XiTable != (elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XiCursor) {
 82775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92966), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(102313)))
 82776  			crt.X__builtin_abort(tls)
 82777  		}
 82778  	}()
 82779  	_i += 1
 82780  	goto _21
 82781  _24:
 82782  	return _p
 82783  }
 82784  
 82785  var _isCandidateForInOptØ00__func__Ø000 [20]int8
 82786  
 82787  func init() {
 82788  	crt.Xstrncpy(nil, &_isCandidateForInOptØ00__func__Ø000[0], str(102346), 20)
 82789  }
 82790  
 82791  // C comment
 82792  //  /*
 82793  //  ** Record the fact that the schema cookie will need to be verified
 82794  //  ** for database iDb.  The code to actually verify the schema cookie
 82795  //  ** will occur at the end of the top-level VDBE and will be generated
 82796  //  ** later, by sqlite3FinishCoding().
 82797  //  */
 82798  func _sqlite3CodeVerifySchema(tls *crt.TLS, _pParse *XParse, _iDb int32) {
 82799  	var _pToplevel *XParse
 82800  	_pToplevel = func() *XParse {
 82801  		if _pParse.XpToplevel != nil {
 82802  			return (*XParse)(_pParse.XpToplevel)
 82803  		}
 82804  		return _pParse
 82805  	}()
 82806  	func() {
 82807  		if _iDb < int32(0) || _iDb >= ((*Xsqlite3)(_pParse.Xdb).XnDb) {
 82808  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103756), unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000), unsafe.Pointer(str(102366)))
 82809  			crt.X__builtin_abort(tls)
 82810  		}
 82811  	}()
 82812  	func() {
 82813  		if (*XBtree)(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_iDb)).XpBt) == nil && _iDb != int32(1) {
 82814  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103757), unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000), unsafe.Pointer(str(102396)))
 82815  			crt.X__builtin_abort(tls)
 82816  		}
 82817  	}()
 82818  	func() {
 82819  		if _iDb >= int32(12) {
 82820  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103758), unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000), unsafe.Pointer(str(102434)))
 82821  			crt.X__builtin_abort(tls)
 82822  		}
 82823  	}()
 82824  	func() {
 82825  		if _sqlite3SchemaMutexHeld(tls, (*Xsqlite3)(_pParse.Xdb), _iDb, nil) == 0 {
 82826  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103759), unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000), unsafe.Pointer(str(102460)))
 82827  			crt.X__builtin_abort(tls)
 82828  		}
 82829  	}()
 82830  	if bool2int((_pToplevel.XcookieMask&(uint32(1)<<uint(_iDb))) != (0)) != int32(0) {
 82831  		goto _12
 82832  	}
 82833  	_pToplevel.XcookieMask |= uint32(1) << uint(_iDb)
 82834  	if int32(1) != 0 && (_iDb == int32(1)) {
 82835  		_sqlite3OpenTempDatabase(tls, _pToplevel)
 82836  	}
 82837  _12:
 82838  }
 82839  
 82840  var _sqlite3CodeVerifySchemaØ00__func__Ø000 [24]int8
 82841  
 82842  func init() {
 82843  	crt.Xstrncpy(nil, &_sqlite3CodeVerifySchemaØ00__func__Ø000[0], str(102503), 24)
 82844  }
 82845  
 82846  // C comment
 82847  //  /*
 82848  //  ** Make sure the TEMP database is open and available for use.  Return
 82849  //  ** the number of errors.  Leave any error messages in the pParse structure.
 82850  //  */
 82851  func _sqlite3OpenTempDatabase(tls *crt.TLS, _pParse *XParse) (r0 int32) {
 82852  	var _1_rc int32
 82853  	var _db *Xsqlite3
 82854  	var _1_pBt *XBtree
 82855  	_db = (*Xsqlite3)(_pParse.Xdb)
 82856  	if (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt) != nil || _pParse.Xexplain != 0 {
 82857  		goto _1
 82858  	}
 82859  	_1_rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.XpVfs), nil, _db, &_1_pBt, int32(0), _sqlite3OpenTempDatabaseØ00flagsØ001)
 82860  	if _1_rc != int32(0) {
 82861  		_sqlite3ErrorMsg(tls, _pParse, str(102527))
 82862  		_pParse.Xrc = _1_rc
 82863  		return int32(1)
 82864  	}
 82865  	*(**XBtree)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt))) = _1_pBt
 82866  	func() {
 82867  		if (elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema) == nil {
 82868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103738), unsafe.Pointer(&_sqlite3OpenTempDatabaseØ00__func__Ø000), unsafe.Pointer(str(102597)))
 82869  			crt.X__builtin_abort(tls)
 82870  		}
 82871  	}()
 82872  	if int32(7) == _sqlite3BtreeSetPageSize(tls, _1_pBt, _db.XnextPagesize, int32(-1), int32(0)) {
 82873  		_sqlite3OomFault(tls, _db)
 82874  		return int32(1)
 82875  	}
 82876  _1:
 82877  	return int32(0)
 82878  }
 82879  
 82880  var _sqlite3OpenTempDatabaseØ00flagsØ001 int32
 82881  
 82882  func init() {
 82883  	_sqlite3OpenTempDatabaseØ00flagsØ001 = int32(542)
 82884  }
 82885  
 82886  var _sqlite3OpenTempDatabaseØ00__func__Ø000 [24]int8
 82887  
 82888  func init() {
 82889  	crt.Xstrncpy(nil, &_sqlite3OpenTempDatabaseØ00__func__Ø000[0], str(102616), 24)
 82890  }
 82891  
 82892  // C comment
 82893  //  /*
 82894  //  ** Generate code that checks the left-most column of index table iCur to see if
 82895  //  ** it contains any NULL entries.  Cause the register at regHasNull to be set
 82896  //  ** to a non-NULL value if iCur contains no NULLs.  Cause register regHasNull
 82897  //  ** to be set to NULL if iCur contains one or more NULL values.
 82898  //  */
 82899  func _sqlite3SetHasNullFlag(tls *crt.TLS, _v *TVdbe, _iCur int32, _regHasNull int32) {
 82900  	var _addr1 int32
 82901  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _regHasNull)
 82902  	_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(37), _iCur)
 82903  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _iCur, int32(0), _regHasNull)
 82904  	_sqlite3VdbeChangeP5(tls, _v, uint16(128))
 82905  	_sqlite3VdbeComment(tls, _v, str(102640), _iCur)
 82906  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 82907  }
 82908  
 82909  // C comment
 82910  //  /*
 82911  //  ** The argument is an IN operator with a list (not a subquery) on the
 82912  //  ** right-hand side.  Return TRUE if that list is constant.
 82913  //  */
 82914  func _sqlite3InRhsIsConstant(tls *crt.TLS, _pIn *XExpr) (r0 int32) {
 82915  	var _res int32
 82916  	var _pLHS *XExpr
 82917  	func() {
 82918  		if (_pIn.Xflags & uint32(2048)) != (0) {
 82919  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92999), unsafe.Pointer(&_sqlite3InRhsIsConstantØ00__func__Ø000), unsafe.Pointer(str(102659)))
 82920  			crt.X__builtin_abort(tls)
 82921  		}
 82922  	}()
 82923  	_pLHS = (*XExpr)(_pIn.XpLeft)
 82924  	*(**XExpr)(unsafe.Pointer(&_pIn.XpLeft)) = nil
 82925  	_res = _sqlite3ExprIsConstant(tls, _pIn)
 82926  	*(**XExpr)(unsafe.Pointer(&_pIn.XpLeft)) = _pLHS
 82927  	return _res
 82928  }
 82929  
 82930  var _sqlite3InRhsIsConstantØ00__func__Ø000 [23]int8
 82931  
 82932  func init() {
 82933  	crt.Xstrncpy(nil, &_sqlite3InRhsIsConstantØ00__func__Ø000[0], str(102695), 23)
 82934  }
 82935  
 82936  // C comment
 82937  //  /*
 82938  //  ** If the expression is always either TRUE or FALSE (respectively),
 82939  //  ** then return 1.  If one cannot determine the truth value of the
 82940  //  ** expression at compile-time return 0.
 82941  //  **
 82942  //  ** This is an optimization.  If is OK to return 0 here even if
 82943  //  ** the expression really is always false or false (a false negative).
 82944  //  ** But it is a bug to return 1 if the expression might have different
 82945  //  ** boolean values in different circumstances (a false positive.)
 82946  //  **
 82947  //  ** Note that if the expression is part of conditional for a
 82948  //  ** LEFT JOIN, then we cannot determine at compile-time whether or not
 82949  //  ** is it true or false, so always return 0.
 82950  //  */
 82951  func _exprAlwaysTrue(tls *crt.TLS, _p *XExpr) (r0 int32) {
 82952  	var _v int32
 82953  	_v = int32(0)
 82954  	if (_p.Xflags & uint32(1)) != (0) {
 82955  		return int32(0)
 82956  	}
 82957  	if _sqlite3ExprIsInteger(tls, _p, &_v) == 0 {
 82958  		return int32(0)
 82959  	}
 82960  	return bool2int(_v != int32(0))
 82961  }
 82962  
 82963  // C comment
 82964  //  /*
 82965  //  ** Create a new mask for cursor iCursor.
 82966  //  **
 82967  //  ** There is one cursor per table in the FROM clause.  The number of
 82968  //  ** tables in the FROM clause is limited by a test early in the
 82969  //  ** sqlite3WhereBegin() routine.  So we know that the pMaskSet->ix[]
 82970  //  ** array will never overflow.
 82971  //  */
 82972  func _createMask(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _iCursor int32) {
 82973  	func() {
 82974  		if _pMaskSet.Xn >= int32(64) {
 82975  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130573), unsafe.Pointer(&_createMaskØ00__func__Ø000), unsafe.Pointer(str(102718)))
 82976  			crt.X__builtin_abort(tls)
 82977  		}
 82978  	}()
 82979  	*elem8((*int32)(unsafe.Pointer(&_pMaskSet.Xix)), uintptr(postInc2(&_pMaskSet.Xn, 1))) = _iCursor
 82980  }
 82981  
 82982  var _createMaskØ00__func__Ø000 [11]int8
 82983  
 82984  func init() {
 82985  	crt.Xstrncpy(nil, &_createMaskØ00__func__Ø000[0], str(102756), 11)
 82986  }
 82987  
 82988  // C comment
 82989  //  /*
 82990  //  ** For table-valued-functions, transform the function arguments into
 82991  //  ** new WHERE clause terms.
 82992  //  **
 82993  //  ** Each function argument translates into an equality constraint against
 82994  //  ** a HIDDEN column in the table.
 82995  //  */
 82996  func _sqlite3WhereTabFuncArgs(tls *crt.TLS, _pParse *XParse, _pItem *TSrcList_item, _pWC *XWhereClause) {
 82997  	var _j, _k int32
 82998  	var _pTab *XTable
 82999  	var _pArgs *XExprList
 83000  	var _pColRef, _pTerm *XExpr
 83001  	if int32((uint32((_pItem.Xfg.XnotIndexed)>>2)<<31)>>31) == int32(0) {
 83002  		return
 83003  	}
 83004  	_pTab = (*XTable)(_pItem.XpTab)
 83005  	func() {
 83006  		if _pTab == nil {
 83007  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130367), unsafe.Pointer(&_sqlite3WhereTabFuncArgsØ00__func__Ø000), unsafe.Pointer(str(43549)))
 83008  			crt.X__builtin_abort(tls)
 83009  		}
 83010  	}()
 83011  	_pArgs = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pItem.Xu1)))
 83012  	if _pArgs == nil {
 83013  		return
 83014  	}
 83015  	_j = store2(&_k, int32(0))
 83016  _4:
 83017  	if _j >= _pArgs.XnExpr {
 83018  		goto _7
 83019  	}
 83020  _8:
 83021  	if (_k < int32(_pTab.XnCol)) && ((int32(elem43((*XColumn)(_pTab.XaCol), uintptr(_k)).XcolFlags) & int32(2)) == int32(0)) {
 83022  		_k += 1
 83023  		goto _8
 83024  	}
 83025  	if _k >= int32(_pTab.XnCol) {
 83026  		_sqlite3ErrorMsg(tls, _pParse, str(102767), unsafe.Pointer(_pTab.XzName), _j)
 83027  		return
 83028  	}
 83029  	_pColRef = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(152), nil, int32(0))
 83030  	if _pColRef == nil {
 83031  		return
 83032  	}
 83033  	_pColRef.XiTable = _pItem.XiCursor
 83034  	_pColRef.XiColumn = int16(postInc2(&_k, 1))
 83035  	*(**XTable)(unsafe.Pointer(&_pColRef.XpTab)) = _pTab
 83036  	_pTerm = _sqlite3PExpr(tls, _pParse, int32(78), _pColRef, _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pArgs.Xa)), uintptr(_j)).XpExpr), int32(0)))
 83037  	_whereClauseInsert(tls, _pWC, _pTerm, uint16(1))
 83038  	_j += 1
 83039  	goto _4
 83040  _7:
 83041  }
 83042  
 83043  var _sqlite3WhereTabFuncArgsØ00__func__Ø000 [24]int8
 83044  
 83045  func init() {
 83046  	crt.Xstrncpy(nil, &_sqlite3WhereTabFuncArgsØ00__func__Ø000[0], str(102803), 24)
 83047  }
 83048  
 83049  // C comment
 83050  //  /*
 83051  //  ** Return the bitmask for the given cursor number.  Return 0 if
 83052  //  ** iCursor is not in the set.
 83053  //  */
 83054  func _sqlite3WhereGetMask(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _iCursor int32) (r0 uint64) {
 83055  	var _i int32
 83056  	func() {
 83057  		if _pMaskSet.Xn > int32(64) {
 83058  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130555), unsafe.Pointer(&_sqlite3WhereGetMaskØ00__func__Ø000), unsafe.Pointer(str(102827)))
 83059  			crt.X__builtin_abort(tls)
 83060  		}
 83061  	}()
 83062  	_i = int32(0)
 83063  _2:
 83064  	if _i >= _pMaskSet.Xn {
 83065  		goto _5
 83066  	}
 83067  	if (*elem8((*int32)(unsafe.Pointer(&_pMaskSet.Xix)), uintptr(_i))) == _iCursor {
 83068  		return uint64(1) << uint(_i)
 83069  	}
 83070  	_i += 1
 83071  	goto _2
 83072  _5:
 83073  	return 0
 83074  }
 83075  
 83076  var _sqlite3WhereGetMaskØ00__func__Ø000 [20]int8
 83077  
 83078  func init() {
 83079  	crt.Xstrncpy(nil, &_sqlite3WhereGetMaskØ00__func__Ø000[0], str(102863), 20)
 83080  }
 83081  
 83082  // C comment
 83083  //  /*
 83084  //  ** Call exprAnalyze on all terms in a WHERE clause.
 83085  //  **
 83086  //  ** Note that exprAnalyze() might add new virtual terms onto the
 83087  //  ** end of the WHERE clause.  We do not want to analyze these new
 83088  //  ** virtual terms, so start analyzing at the end and work forward
 83089  //  ** so that the added virtual terms are never processed.
 83090  //  */
 83091  func _sqlite3WhereExprAnalyze(tls *crt.TLS, _pTabList *XSrcList, _pWC *XWhereClause) {
 83092  	var _i int32
 83093  	_i = _pWC.XnTerm - int32(1)
 83094  _0:
 83095  	if _i < int32(0) {
 83096  		goto _3
 83097  	}
 83098  	_exprAnalyze(tls, _pTabList, _pWC, _i)
 83099  	_i -= 1
 83100  	goto _0
 83101  _3:
 83102  }
 83103  
 83104  // C comment
 83105  //  /*
 83106  //  ** The input to this routine is an WhereTerm structure with only the
 83107  //  ** "pExpr" field filled in.  The job of this routine is to analyze the
 83108  //  ** subexpression and populate all the other fields of the WhereTerm
 83109  //  ** structure.
 83110  //  **
 83111  //  ** If the expression is of the form "<expr> <op> X" it gets commuted
 83112  //  ** to the standard form of "X <op> <expr>".
 83113  //  **
 83114  //  ** If the expression is of the form "X <op> Y" where both X and Y are
 83115  //  ** columns, then the original expression is unchanged and a new virtual
 83116  //  ** term of the form "Y <op> X" is added to the WHERE clause and
 83117  //  ** analyzed separately.  The original term is marked with TERM_COPIED
 83118  //  ** and the new term is marked with TERM_DYNAMIC (because it's pExpr
 83119  //  ** needs to be freed with the WhereClause) and TERM_VIRTUAL (because it
 83120  //  ** is a commuted copy of a prior term.)  The original term has nChild=1
 83121  //  ** and the copy has idxParent set to the index of the original term.
 83122  //  */
 83123  func _exprAnalyze(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxTerm int32) {
 83124  	var _isComplete, _noCase, _op, _nLeft, _13_idxNew, _17_i, _18_idxNew, _20_idxNew1, _20_idxNew2, _21_i, _26_idxNew, _28_i, _29_idxNew, _30_i, _31_idxNew int32
 83125  	var _21_c int8
 83126  	var _prereqLeft, _prereqAll, _extraRight, _7_x, _26_prereqColumn, _26_prereqExpr uint64
 83127  	var _20_zCollSeqName *int8
 83128  	var _9_opMask, _12_eExtraOp, _20_wtFlags uint16
 83129  	var _eOp2, _23_c uint8
 83130  	var _23_pC *uint8
 83131  	var _db *Xsqlite3
 83132  	var _17_pList *XExprList
 83133  	var _9_aiCurCol [2]int32
 83134  	var _pExpr, _pStr1, _9_pLeft, _9_pRight, _12_pDup, _18_pNewExpr, _20_pLeft, _20_pStr2, _20_pNewExpr1, _20_pNewExpr2, _26_pRight, _26_pLeft, _27_pNewExpr, _29_pNew, _29_pLeft, _29_pRight *XExpr
 83135  	var _pParse *XParse
 83136  	var _pWInfo *XWhereInfo
 83137  	var _pTerm, _12_pNew, _26_pNewTerm *XWhereTerm
 83138  	var _pMaskSet *XWhereMaskSet
 83139  	_pWInfo = (*XWhereInfo)(_pWC.XpWInfo)
 83140  	_extraRight = uint64(0)
 83141  	_pStr1 = nil
 83142  	_isComplete = int32(0)
 83143  	_noCase = int32(0)
 83144  	_pParse = (*XParse)(_pWInfo.XpParse)
 83145  	_db = (*Xsqlite3)(_pParse.Xdb)
 83146  	if _db.XmallocFailed != 0 {
 83147  		return
 83148  	}
 83149  	_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83150  	_pMaskSet = &_pWInfo.XsMaskSet
 83151  	_pExpr = (*XExpr)(_pTerm.XpExpr)
 83152  	func() {
 83153  		if int32(_pExpr.Xop) == int32(24) || int32(_pExpr.Xop) == int32(94) {
 83154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129865), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(102883)))
 83155  			crt.X__builtin_abort(tls)
 83156  		}
 83157  	}()
 83158  	_prereqLeft = _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pExpr.XpLeft))
 83159  	_op = int32(_pExpr.Xop)
 83160  	if _op != int32(74) {
 83161  		goto _4
 83162  	}
 83163  	func() {
 83164  		if (*XExpr)(_pExpr.XpRight) != nil {
 83165  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129869), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(102925)))
 83166  			crt.X__builtin_abort(tls)
 83167  		}
 83168  	}()
 83169  	if _sqlite3ExprCheckIN(tls, _pParse, _pExpr) != 0 {
 83170  		return
 83171  	}
 83172  	if (_pExpr.Xflags & uint32(2048)) != (0) {
 83173  		_pTerm.XprereqRight = _exprSelectUsage(tls, _pMaskSet, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))))
 83174  		goto _9
 83175  	}
 83176  	_pTerm.XprereqRight = _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))))
 83177  _9:
 83178  	goto _12
 83179  _4:
 83180  	if _op == int32(75) {
 83181  		_pTerm.XprereqRight = 0
 83182  		goto _12
 83183  	}
 83184  	_pTerm.XprereqRight = _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pExpr.XpRight))
 83185  _12:
 83186  	_prereqAll = _sqlite3WhereExprUsage(tls, _pMaskSet, _pExpr)
 83187  	if (_pExpr.Xflags & uint32(1)) == (0) {
 83188  		goto _13
 83189  	}
 83190  	_7_x = _sqlite3WhereGetMask(tls, _pMaskSet, int32(_pExpr.XiRightJoinTable))
 83191  	_prereqAll |= _7_x
 83192  	_extraRight = _7_x - uint64(1)
 83193  	if (_prereqAll >> 1) >= _7_x {
 83194  		_sqlite3ErrorMsg(tls, _pParse, str(102942))
 83195  		return
 83196  	}
 83197  _13:
 83198  	_pTerm.XprereqAll = _prereqAll
 83199  	_pTerm.XleftCursor = int32(-1)
 83200  	_pTerm.XiParent = int32(-1)
 83201  	_pTerm.XeOperator = 0
 83202  	if _allowedOp(tls, _op) == 0 {
 83203  		goto _15
 83204  	}
 83205  	_9_pLeft = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pExpr.XpLeft))
 83206  	_9_pRight = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pExpr.XpRight))
 83207  	_9_opMask = uint16(func() int32 {
 83208  		if (_pTerm.XprereqRight & _prereqLeft) == (0) {
 83209  			return int32(8191)
 83210  		}
 83211  		return int32(2048)
 83212  	}())
 83213  	if _pTerm.XiField > int32(0) {
 83214  		func() {
 83215  			if _op != int32(74) {
 83216  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129903), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(102983)))
 83217  				crt.X__builtin_abort(tls)
 83218  			}
 83219  		}()
 83220  		func() {
 83221  			if int32(_9_pLeft.Xop) != int32(158) {
 83222  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129904), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(102993)))
 83223  				crt.X__builtin_abort(tls)
 83224  			}
 83225  		}()
 83226  		_9_pLeft = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_9_pLeft.Xx))).Xa))), uintptr(_pTerm.XiField-int32(1))).XpExpr)
 83227  	}
 83228  	if _exprMightBeIndexed(tls, _pSrc, _prereqLeft, (*int32)(unsafe.Pointer(&_9_aiCurCol)), _9_pLeft, _op) != 0 {
 83229  		_pTerm.XleftCursor = *elem8((*int32)(unsafe.Pointer(&_9_aiCurCol)), 0)
 83230  		*(*int32)(unsafe.Pointer(&_pTerm.Xu)) = *elem8((*int32)(unsafe.Pointer(&_9_aiCurCol)), uintptr(1))
 83231  		_pTerm.XeOperator = uint16(int32(_operatorMask(tls, _op)) & int32(_9_opMask))
 83232  	}
 83233  	if _op == int32(72) {
 83234  		{
 83235  			p := &_pTerm.XwtFlags
 83236  			*p = uint16(int32(*p) | int32(2048))
 83237  		}
 83238  	}
 83239  	if _9_pRight == nil || _exprMightBeIndexed(tls, _pSrc, _pTerm.XprereqRight, (*int32)(unsafe.Pointer(&_9_aiCurCol)), _9_pRight, _op) == 0 {
 83240  		goto _26
 83241  	}
 83242  	_12_eExtraOp = uint16(0)
 83243  	func() {
 83244  		if _pTerm.XiField != int32(0) {
 83245  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129920), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(103014)))
 83246  			crt.X__builtin_abort(tls)
 83247  		}
 83248  	}()
 83249  	if _pTerm.XleftCursor < int32(0) {
 83250  		goto _29
 83251  	}
 83252  	_12_pDup = _sqlite3ExprDup(tls, _db, _pExpr, int32(0))
 83253  	if _db.XmallocFailed != 0 {
 83254  		_sqlite3ExprDelete(tls, _db, _12_pDup)
 83255  		return
 83256  	}
 83257  	_13_idxNew = _whereClauseInsert(tls, _pWC, _12_pDup, uint16(3))
 83258  	if _13_idxNew == int32(0) {
 83259  		return
 83260  	}
 83261  	_12_pNew = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_13_idxNew))
 83262  	_markTermAsChild(tls, _pWC, _13_idxNew, _idxTerm)
 83263  	if _op == int32(72) {
 83264  		{
 83265  			p := &_12_pNew.XwtFlags
 83266  			*p = uint16(int32(*p) | int32(2048))
 83267  		}
 83268  	}
 83269  	_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83270  	{
 83271  		p := &_pTerm.XwtFlags
 83272  		*p = uint16(int32(*p) | int32(8))
 83273  	}
 83274  	if _termIsEquivalence(tls, _pParse, _12_pDup) != 0 {
 83275  		{
 83276  			p := &_pTerm.XeOperator
 83277  			*p = uint16(int32(*p) | int32(2048))
 83278  		}
 83279  		_12_eExtraOp = uint16(2048)
 83280  	}
 83281  	goto _34
 83282  _29:
 83283  	_12_pDup = _pExpr
 83284  	_12_pNew = _pTerm
 83285  _34:
 83286  	_exprCommute(tls, _pParse, _12_pDup)
 83287  	_12_pNew.XleftCursor = *elem8((*int32)(unsafe.Pointer(&_9_aiCurCol)), 0)
 83288  	*(*int32)(unsafe.Pointer(&_12_pNew.Xu)) = *elem8((*int32)(unsafe.Pointer(&_9_aiCurCol)), uintptr(1))
 83289  	_12_pNew.XprereqRight = _prereqLeft | _extraRight
 83290  	_12_pNew.XprereqAll = _prereqAll
 83291  	_12_pNew.XeOperator = uint16((int32(_operatorMask(tls, int32(_12_pDup.Xop))) + int32(_12_eExtraOp)) & int32(_9_opMask))
 83292  _26:
 83293  	goto _47
 83294  _15:
 83295  	if int32(_pExpr.Xop) != int32(73) || int32(_pWC.Xop) != int32(71) {
 83296  		goto _37
 83297  	}
 83298  	_17_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 83299  	func() {
 83300  		if _17_pList == nil {
 83301  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129974), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(88609)))
 83302  			crt.X__builtin_abort(tls)
 83303  		}
 83304  	}()
 83305  	func() {
 83306  		if _17_pList.XnExpr != int32(2) {
 83307  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129975), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(103031)))
 83308  			crt.X__builtin_abort(tls)
 83309  		}
 83310  	}()
 83311  	_17_i = int32(0)
 83312  _42:
 83313  	if _17_i >= int32(2) {
 83314  		goto _45
 83315  	}
 83316  	_18_pNewExpr = _sqlite3PExpr(tls, _pParse, int32(*elem15((*uint8)(unsafe.Pointer(&_exprAnalyzeØ00opsØ001)), uintptr(_17_i))), _sqlite3ExprDup(tls, _db, (*XExpr)(_pExpr.XpLeft), int32(0)), _sqlite3ExprDup(tls, _db, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_17_pList.Xa)), uintptr(_17_i)).XpExpr), int32(0)))
 83317  	_transferJoinMarkings(tls, _18_pNewExpr, _pExpr)
 83318  	_18_idxNew = _whereClauseInsert(tls, _pWC, _18_pNewExpr, uint16(3))
 83319  	_exprAnalyze(tls, _pSrc, _pWC, _18_idxNew)
 83320  	_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83321  	_markTermAsChild(tls, _pWC, _18_idxNew, _idxTerm)
 83322  	_17_i += 1
 83323  	goto _42
 83324  _45:
 83325  	goto _47
 83326  _37:
 83327  	if int32(_pExpr.Xop) == int32(70) {
 83328  		func() {
 83329  			if int32(_pWC.Xop) != int32(71) {
 83330  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129997), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(103047)))
 83331  				crt.X__builtin_abort(tls)
 83332  			}
 83333  		}()
 83334  		_exprAnalyzeOrTerm(tls, _pSrc, _pWC, _idxTerm)
 83335  		_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83336  	}
 83337  _47:
 83338  	if int32(_pWC.Xop) != int32(71) || _isLikeOrGlob(tls, _pParse, _pExpr, &_pStr1, &_isComplete, &_noCase) == 0 {
 83339  		goto _51
 83340  	}
 83341  	_20_wtFlags = uint16(259)
 83342  	_20_pLeft = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), uintptr(1)).XpExpr)
 83343  	_20_pStr2 = _sqlite3ExprDup(tls, _db, _pStr1, int32(0))
 83344  	if _noCase == 0 || ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 83345  		goto _53
 83346  	}
 83347  	{
 83348  		p := &_pTerm.XwtFlags
 83349  		*p = uint16(int32(*p) | int32(1024))
 83350  	}
 83351  	_21_i = int32(0)
 83352  _54:
 83353  	if int32(store5(&_21_c, *elem1(*(**int8)(unsafe.Pointer(&_pStr1.Xu)), uintptr(_21_i)))) == int32(0) {
 83354  		goto _57
 83355  	}
 83356  	*elem1(*(**int8)(unsafe.Pointer(&_pStr1.Xu)), uintptr(_21_i)) = int8(int32(_21_c) & (^(int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(_21_c)))) & int32(32))))
 83357  	*elem1(*(**int8)(unsafe.Pointer(&_20_pStr2.Xu)), uintptr(_21_i)) = int8(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(_21_c))))
 83358  	_21_i += 1
 83359  	goto _54
 83360  _57:
 83361  _53:
 83362  	if _db.XmallocFailed != 0 {
 83363  		goto _58
 83364  	}
 83365  	_23_pC = (*uint8)(unsafe.Pointer(elem1(*(**int8)(unsafe.Pointer(&_20_pStr2.Xu)), uintptr(_sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_20_pStr2.Xu)))-int32(1)))))
 83366  	_23_c = *_23_pC
 83367  	if _noCase == 0 {
 83368  		goto _59
 83369  	}
 83370  	if int32(_23_c) == int32(64) {
 83371  		_isComplete = int32(0)
 83372  	}
 83373  	_23_c = *elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(_23_c))
 83374  _59:
 83375  	*_23_pC = uint8(int32(_23_c) + int32(1))
 83376  _58:
 83377  	_20_zCollSeqName = func() *int8 {
 83378  		if _noCase != 0 {
 83379  			return str(103063)
 83380  		}
 83381  		return str(37836)
 83382  	}()
 83383  	_20_pNewExpr1 = _sqlite3ExprDup(tls, _db, _20_pLeft, int32(0))
 83384  	_20_pNewExpr1 = _sqlite3PExpr(tls, _pParse, int32(82), _sqlite3ExprAddCollateString(tls, _pParse, _20_pNewExpr1, _20_zCollSeqName), _pStr1)
 83385  	_transferJoinMarkings(tls, _20_pNewExpr1, _pExpr)
 83386  	_20_idxNew1 = _whereClauseInsert(tls, _pWC, _20_pNewExpr1, _20_wtFlags)
 83387  	_exprAnalyze(tls, _pSrc, _pWC, _20_idxNew1)
 83388  	_20_pNewExpr2 = _sqlite3ExprDup(tls, _db, _20_pLeft, int32(0))
 83389  	_20_pNewExpr2 = _sqlite3PExpr(tls, _pParse, int32(81), _sqlite3ExprAddCollateString(tls, _pParse, _20_pNewExpr2, _20_zCollSeqName), _20_pStr2)
 83390  	_transferJoinMarkings(tls, _20_pNewExpr2, _pExpr)
 83391  	_20_idxNew2 = _whereClauseInsert(tls, _pWC, _20_pNewExpr2, _20_wtFlags)
 83392  	_exprAnalyze(tls, _pSrc, _pWC, _20_idxNew2)
 83393  	_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83394  	if _isComplete != 0 {
 83395  		_markTermAsChild(tls, _pWC, _20_idxNew1, _idxTerm)
 83396  		_markTermAsChild(tls, _pWC, _20_idxNew2, _idxTerm)
 83397  	}
 83398  _51:
 83399  	if int32(_pWC.Xop) != int32(71) || _isMatchOfColumn(tls, _pExpr, &_eOp2) == 0 {
 83400  		goto _65
 83401  	}
 83402  	_26_pRight = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr)
 83403  	_26_pLeft = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), uintptr(1)).XpExpr)
 83404  	_26_prereqExpr = _sqlite3WhereExprUsage(tls, _pMaskSet, _26_pRight)
 83405  	_26_prereqColumn = _sqlite3WhereExprUsage(tls, _pMaskSet, _26_pLeft)
 83406  	if (_26_prereqExpr & _26_prereqColumn) == (0) {
 83407  		_27_pNewExpr = _sqlite3PExpr(tls, _pParse, int32(50), nil, _sqlite3ExprDup(tls, _db, _26_pRight, int32(0)))
 83408  		_26_idxNew = _whereClauseInsert(tls, _pWC, _27_pNewExpr, uint16(3))
 83409  		_26_pNewTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_26_idxNew))
 83410  		_26_pNewTerm.XprereqRight = _26_prereqExpr
 83411  		_26_pNewTerm.XleftCursor = _26_pLeft.XiTable
 83412  		*(*int32)(unsafe.Pointer(&_26_pNewTerm.Xu)) = int32(_26_pLeft.XiColumn)
 83413  		_26_pNewTerm.XeOperator = uint16(64)
 83414  		_26_pNewTerm.XeMatchOp = _eOp2
 83415  		_markTermAsChild(tls, _pWC, _26_idxNew, _idxTerm)
 83416  		_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83417  		{
 83418  			p := &_pTerm.XwtFlags
 83419  			*p = uint16(int32(*p) | int32(8))
 83420  		}
 83421  		_26_pNewTerm.XprereqAll = _pTerm.XprereqAll
 83422  	}
 83423  _65:
 83424  	if int32(_pWC.Xop) != int32(71) || int32(_pExpr.Xop) != int32(78) && int32(_pExpr.Xop) != int32(72) || store2(&_nLeft, _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpLeft))) <= int32(1) || _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpRight)) != _nLeft || (((*XExpr)(_pExpr.XpLeft).Xflags)&uint32(2048)) != (0) && (((*XExpr)(_pExpr.XpRight).Xflags)&uint32(2048)) != (0) {
 83425  		goto _73
 83426  	}
 83427  	_28_i = int32(0)
 83428  _74:
 83429  	if _28_i >= _nLeft {
 83430  		goto _77
 83431  	}
 83432  	_29_pLeft = _sqlite3ExprForVectorField(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _28_i)
 83433  	_29_pRight = _sqlite3ExprForVectorField(tls, _pParse, (*XExpr)(_pExpr.XpRight), _28_i)
 83434  	_29_pNew = _sqlite3PExpr(tls, _pParse, int32(_pExpr.Xop), _29_pLeft, _29_pRight)
 83435  	_transferJoinMarkings(tls, _29_pNew, _pExpr)
 83436  	_29_idxNew = _whereClauseInsert(tls, _pWC, _29_pNew, uint16(1))
 83437  	_exprAnalyze(tls, _pSrc, _pWC, _29_idxNew)
 83438  	_28_i += 1
 83439  	goto _74
 83440  _77:
 83441  	_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83442  	_pTerm.XwtFlags = uint16(6)
 83443  	_pTerm.XeOperator = 0
 83444  _73:
 83445  	if int32(_pWC.Xop) != int32(71) || int32(_pExpr.Xop) != int32(74) || _pTerm.XiField != int32(0) || int32((*XExpr)(_pExpr.XpLeft).Xop) != int32(158) || (*XSelect)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpPrior) != nil {
 83446  		goto _82
 83447  	}
 83448  	_30_i = int32(0)
 83449  _83:
 83450  	if _30_i >= _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpLeft)) {
 83451  		goto _86
 83452  	}
 83453  	_31_idxNew = _whereClauseInsert(tls, _pWC, _pExpr, uint16(2))
 83454  	elem101((*XWhereTerm)(_pWC.Xa), uintptr(_31_idxNew)).XiField = _30_i + int32(1)
 83455  	_exprAnalyze(tls, _pSrc, _pWC, _31_idxNew)
 83456  	_markTermAsChild(tls, _pWC, _31_idxNew, _idxTerm)
 83457  	_30_i += 1
 83458  	goto _83
 83459  _86:
 83460  _82:
 83461  	_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83462  	_pTerm.XprereqRight |= _extraRight
 83463  	_ = _9_aiCurCol
 83464  }
 83465  
 83466  var _exprAnalyzeØ00__func__Ø000 [12]int8
 83467  
 83468  func init() {
 83469  	crt.Xstrncpy(nil, &_exprAnalyzeØ00__func__Ø000[0], str(103070), 12)
 83470  }
 83471  
 83472  // C comment
 83473  //  /*
 83474  //  ** These routines walk (recursively) an expression tree and generate
 83475  //  ** a bitmask indicating which tables are used in that expression
 83476  //  ** tree.
 83477  //  */
 83478  func _sqlite3WhereExprUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _p *XExpr) (r0 uint64) {
 83479  	var _mask uint64
 83480  	if _p == nil {
 83481  		return 0
 83482  	}
 83483  	if int32(_p.Xop) == int32(152) {
 83484  		return _sqlite3WhereGetMask(tls, _pMaskSet, _p.XiTable)
 83485  	}
 83486  	_mask = func() uint64 {
 83487  		if int32(_p.Xop) == int32(160) {
 83488  			return _sqlite3WhereGetMask(tls, _pMaskSet, _p.XiTable)
 83489  		}
 83490  		return (0)
 83491  	}()
 83492  	func() {
 83493  		if (_p.Xflags & uint32(16384)) != (0) {
 83494  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130308), unsafe.Pointer(&_sqlite3WhereExprUsageØ00__func__Ø000), unsafe.Pointer(str(103082)))
 83495  			crt.X__builtin_abort(tls)
 83496  		}
 83497  	}()
 83498  	if _p.XpRight != nil {
 83499  		_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_p.XpRight))
 83500  	}
 83501  	if _p.XpLeft != nil {
 83502  		_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_p.XpLeft))
 83503  	}
 83504  	if (_p.Xflags & uint32(2048)) != (0) {
 83505  		_mask |= _exprSelectUsage(tls, _pMaskSet, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))))
 83506  		goto _10
 83507  	}
 83508  	if (*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil {
 83509  		_mask |= _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))))
 83510  	}
 83511  _10:
 83512  	return _mask
 83513  }
 83514  
 83515  var _sqlite3WhereExprUsageØ00__func__Ø000 [22]int8
 83516  
 83517  func init() {
 83518  	crt.Xstrncpy(nil, &_sqlite3WhereExprUsageØ00__func__Ø000[0], str(103116), 22)
 83519  }
 83520  
 83521  // C comment
 83522  //  /*
 83523  //  ** Recursively walk the expressions of a SELECT statement and generate
 83524  //  ** a bitmask indicating which tables are used in that expression
 83525  //  ** tree.
 83526  //  */
 83527  func _exprSelectUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _pS *XSelect) (r0 uint64) {
 83528  	var _2_i int32
 83529  	var _mask uint64
 83530  	var _1_pSrc *XSrcList
 83531  	_mask = uint64(0)
 83532  _0:
 83533  	if _pS == nil {
 83534  		goto _1
 83535  	}
 83536  	_1_pSrc = (*XSrcList)(_pS.XpSrc)
 83537  	_mask |= _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_pS.XpEList))
 83538  	_mask |= _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_pS.XpGroupBy))
 83539  	_mask |= _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_pS.XpOrderBy))
 83540  	_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pS.XpWhere))
 83541  	_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pS.XpHaving))
 83542  	if func() int32 {
 83543  		if _1_pSrc != nil {
 83544  			return int32(1)
 83545  		}
 83546  		return func() int32 {
 83547  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129744), unsafe.Pointer(&_exprSelectUsageØ00__func__Ø000), unsafe.Pointer(str(4809)))
 83548  			crt.X__builtin_abort(tls)
 83549  			return int32(0)
 83550  		}()
 83551  	}() == 0 {
 83552  		goto _4
 83553  	}
 83554  	_2_i = int32(0)
 83555  _5:
 83556  	if _2_i >= _1_pSrc.XnSrc {
 83557  		goto _8
 83558  	}
 83559  	_mask |= _exprSelectUsage(tls, _pMaskSet, (*XSelect)(elem6((*TSrcList_item)(unsafe.Pointer(&_1_pSrc.Xa)), uintptr(_2_i)).XpSelect))
 83560  	_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(elem6((*TSrcList_item)(unsafe.Pointer(&_1_pSrc.Xa)), uintptr(_2_i)).XpOn))
 83561  	_2_i += 1
 83562  	goto _5
 83563  _8:
 83564  _4:
 83565  	_pS = (*XSelect)(_pS.XpPrior)
 83566  	goto _0
 83567  _1:
 83568  	return _mask
 83569  }
 83570  
 83571  func _sqlite3WhereExprListUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _pList *XExprList) (r0 uint64) {
 83572  	var _i int32
 83573  	var _mask uint64
 83574  	_mask = uint64(0)
 83575  	if _pList == nil {
 83576  		goto _0
 83577  	}
 83578  	_i = int32(0)
 83579  _1:
 83580  	if _i >= _pList.XnExpr {
 83581  		goto _4
 83582  	}
 83583  	_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))
 83584  	_i += 1
 83585  	goto _1
 83586  _4:
 83587  _0:
 83588  	return _mask
 83589  }
 83590  
 83591  var _exprSelectUsageØ00__func__Ø000 [16]int8
 83592  
 83593  func init() {
 83594  	crt.Xstrncpy(nil, &_exprSelectUsageØ00__func__Ø000[0], str(103138), 16)
 83595  }
 83596  
 83597  // C comment
 83598  //  /*
 83599  //  ** Return TRUE if the given operator is one of the operators that is
 83600  //  ** allowed for an indexable WHERE clause term.  The allowed operators are
 83601  //  ** "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL"
 83602  //  */
 83603  func _allowedOp(tls *crt.TLS, _op int32) (r0 int32) {
 83604  	return bool2int((((_op == int32(74)) || ((_op >= int32(78)) && (_op <= int32(82)))) || (_op == int32(75))) || (_op == int32(72)))
 83605  }
 83606  
 83607  func _exprMightBeIndexed(tls *crt.TLS, _pFrom *XSrcList, _mPrereq uint64, _aiCurCol *int32, _pExpr *XExpr, _op int32) (r0 int32) {
 83608  	func() {
 83609  		if _op > int32(82) {
 83610  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129805), unsafe.Pointer(&_exprMightBeIndexedØ00__func__Ø000), unsafe.Pointer(str(103154)))
 83611  			crt.X__builtin_abort(tls)
 83612  		}
 83613  	}()
 83614  	if (int32(_pExpr.Xop) == int32(158)) && ((_op >= int32(79)) && func() int32 {
 83615  		if _op <= int32(82) {
 83616  			return int32(1)
 83617  		}
 83618  		return func() int32 {
 83619  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129806), unsafe.Pointer(&_exprMightBeIndexedØ00__func__Ø000), unsafe.Pointer(str(4809)))
 83620  			crt.X__builtin_abort(tls)
 83621  			return int32(0)
 83622  		}()
 83623  	}() != 0) {
 83624  		_pExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr)
 83625  	}
 83626  	if int32(_pExpr.Xop) == int32(152) {
 83627  		*elem8(_aiCurCol, 0) = _pExpr.XiTable
 83628  		*elem8(_aiCurCol, uintptr(1)) = int32(_pExpr.XiColumn)
 83629  		return int32(1)
 83630  	}
 83631  	if _mPrereq == (0) {
 83632  		return int32(0)
 83633  	}
 83634  	if (_mPrereq & (_mPrereq - uint64(1))) != (0) {
 83635  		return int32(0)
 83636  	}
 83637  	return _exprMightBeIndexed2(tls, _pFrom, _mPrereq, _aiCurCol, _pExpr)
 83638  }
 83639  
 83640  var _exprMightBeIndexedØ00__func__Ø000 [19]int8
 83641  
 83642  func init() {
 83643  	crt.Xstrncpy(nil, &_exprMightBeIndexedØ00__func__Ø000[0], str(103164), 19)
 83644  }
 83645  
 83646  // C comment
 83647  //  /*
 83648  //  ** Expression pExpr is one operand of a comparison operator that might
 83649  //  ** be useful for indexing.  This routine checks to see if pExpr appears
 83650  //  ** in any index.  Return TRUE (1) if pExpr is an indexed term and return
 83651  //  ** FALSE (0) if not.  If TRUE is returned, also set aiCurCol[0] to the cursor
 83652  //  ** number of the table that is indexed and aiCurCol[1] to the column number
 83653  //  ** of the column that is indexed, or XN_EXPR (-2) if an expression is being
 83654  //  ** indexed.
 83655  //  **
 83656  //  ** If pExpr is a TK_COLUMN column reference, then this routine always returns
 83657  //  ** true even if that particular column is not indexed, because the column
 83658  //  ** might be added to an automatic index later.
 83659  //  */
 83660  func _exprMightBeIndexed2(tls *crt.TLS, _pFrom *XSrcList, _mPrereq uint64, _aiCurCol *int32, _pExpr *XExpr) (r0 int32) {
 83661  	var _i, _iCur int32
 83662  	var _pIdx *XIndex
 83663  	_i = int32(0)
 83664  _0:
 83665  	if _mPrereq <= uint64(1) {
 83666  		goto _3
 83667  	}
 83668  	*func() *uint64 { _i += 1; return &_mPrereq }() >>= 1
 83669  	goto _0
 83670  _3:
 83671  	_iCur = elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), uintptr(_i)).XiCursor
 83672  	_pIdx = (*XIndex)((*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), uintptr(_i)).XpTab).XpIndex)
 83673  _4:
 83674  	if _pIdx == nil {
 83675  		goto _7
 83676  	}
 83677  	if (*XExprList)(_pIdx.XaColExpr) == nil {
 83678  		goto _5
 83679  	}
 83680  	_i = int32(0)
 83681  _9:
 83682  	if _i >= int32(_pIdx.XnKeyCol) {
 83683  		goto _12
 83684  	}
 83685  	if int32(*elem52(_pIdx.XaiColumn, uintptr(_i))) != int32(-2) {
 83686  		goto _10
 83687  	}
 83688  	if _sqlite3ExprCompareSkip(tls, _pExpr, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.XaColExpr).Xa))), uintptr(_i)).XpExpr), _iCur) == int32(0) {
 83689  		*elem8(_aiCurCol, 0) = _iCur
 83690  		*elem8(_aiCurCol, uintptr(1)) = int32(-2)
 83691  		return int32(1)
 83692  	}
 83693  _10:
 83694  	_i += 1
 83695  	goto _9
 83696  _12:
 83697  _5:
 83698  	_pIdx = (*XIndex)(_pIdx.XpNext)
 83699  	goto _4
 83700  _7:
 83701  	return int32(0)
 83702  }
 83703  
 83704  // C comment
 83705  //  /*
 83706  //  ** Like sqlite3ExprCompare() except COLLATE operators at the top-level
 83707  //  ** are ignored.
 83708  //  */
 83709  func _sqlite3ExprCompareSkip(tls *crt.TLS, _pA *XExpr, _pB *XExpr, _iTab int32) (r0 int32) {
 83710  	return _sqlite3ExprCompare(tls, _sqlite3ExprSkipCollate(tls, _pA), _sqlite3ExprSkipCollate(tls, _pB), _iTab)
 83711  }
 83712  
 83713  // C comment
 83714  //  /*
 83715  //  ** Translate from TK_xx operator to WO_xx bitmask.
 83716  //  */
 83717  func _operatorMask(tls *crt.TLS, _op int32) (r0 uint16) {
 83718  	var _c uint16
 83719  	func() {
 83720  		if _allowedOp(tls, _op) == 0 {
 83721  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129081), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103183)))
 83722  			crt.X__builtin_abort(tls)
 83723  		}
 83724  	}()
 83725  	if _op == int32(74) {
 83726  		_c = uint16(1)
 83727  		goto _7
 83728  	}
 83729  	if _op == int32(75) {
 83730  		_c = uint16(256)
 83731  		goto _7
 83732  	}
 83733  	if _op == int32(72) {
 83734  		_c = uint16(128)
 83735  		goto _7
 83736  	}
 83737  	func() {
 83738  		if (int32(2) << uint(_op-int32(78))) >= int32(32767) {
 83739  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129089), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103197)))
 83740  			crt.X__builtin_abort(tls)
 83741  		}
 83742  	}()
 83743  	_c = uint16(int32(2) << uint(_op-int32(78)))
 83744  _7:
 83745  	func() {
 83746  		if _op == int32(75) && int32(_c) != int32(256) {
 83747  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129092), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103226)))
 83748  			crt.X__builtin_abort(tls)
 83749  		}
 83750  	}()
 83751  	func() {
 83752  		if _op == int32(74) && int32(_c) != int32(1) {
 83753  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129093), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103256)))
 83754  			crt.X__builtin_abort(tls)
 83755  		}
 83756  	}()
 83757  	func() {
 83758  		if _op == int32(78) && int32(_c) != int32(2) {
 83759  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129094), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103278)))
 83760  			crt.X__builtin_abort(tls)
 83761  		}
 83762  	}()
 83763  	func() {
 83764  		if _op == int32(81) && int32(_c) != int32(16) {
 83765  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129095), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103300)))
 83766  			crt.X__builtin_abort(tls)
 83767  		}
 83768  	}()
 83769  	func() {
 83770  		if _op == int32(80) && int32(_c) != int32(8) {
 83771  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129096), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103322)))
 83772  			crt.X__builtin_abort(tls)
 83773  		}
 83774  	}()
 83775  	func() {
 83776  		if _op == int32(79) && int32(_c) != int32(4) {
 83777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129097), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103344)))
 83778  			crt.X__builtin_abort(tls)
 83779  		}
 83780  	}()
 83781  	func() {
 83782  		if _op == int32(82) && int32(_c) != int32(32) {
 83783  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129098), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103366)))
 83784  			crt.X__builtin_abort(tls)
 83785  		}
 83786  	}()
 83787  	func() {
 83788  		if _op == int32(72) && int32(_c) != int32(128) {
 83789  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129099), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103388)))
 83790  			crt.X__builtin_abort(tls)
 83791  		}
 83792  	}()
 83793  	return _c
 83794  }
 83795  
 83796  var _operatorMaskØ00__func__Ø000 [13]int8
 83797  
 83798  func init() {
 83799  	crt.Xstrncpy(nil, &_operatorMaskØ00__func__Ø000[0], str(103410), 13)
 83800  }
 83801  
 83802  // C comment
 83803  //  /*
 83804  //  ** Mark term iChild as being a child of term iParent
 83805  //  */
 83806  func _markTermAsChild(tls *crt.TLS, _pWC *XWhereClause, _iChild int32, _iParent int32) {
 83807  	elem101((*XWhereTerm)(_pWC.Xa), uintptr(_iChild)).XiParent = _iParent
 83808  	elem101((*XWhereTerm)(_pWC.Xa), uintptr(_iChild)).XtruthProb = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_iParent)).XtruthProb
 83809  	elem101((*XWhereTerm)(_pWC.Xa), uintptr(_iParent)).XnChild += 1
 83810  }
 83811  
 83812  // C comment
 83813  //  /*
 83814  //  ** We already know that pExpr is a binary operator where both operands are
 83815  //  ** column references.  This routine checks to see if pExpr is an equivalence
 83816  //  ** relation:
 83817  //  **   1.  The SQLITE_Transitive optimization must be enabled
 83818  //  **   2.  Must be either an == or an IS operator
 83819  //  **   3.  Not originating in the ON clause of an OUTER JOIN
 83820  //  **   4.  The affinities of A and B must be compatible
 83821  //  **   5a. Both operands use the same collating sequence OR
 83822  //  **   5b. The overall collating sequence is BINARY
 83823  //  ** If this routine returns TRUE, that means that the RHS can be substituted
 83824  //  ** for the LHS anyplace else in the WHERE clause where the LHS column occurs.
 83825  //  ** This is an optimization.  No harm comes from returning 0.  But if 1 is
 83826  //  ** returned when it should not be, then incorrect answers might result.
 83827  //  */
 83828  func _termIsEquivalence(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 int32) {
 83829  	var _aff1, _aff2 int8
 83830  	var _zColl1, _zColl2 *int8
 83831  	var _pColl *XCollSeq
 83832  	if (int32((*Xsqlite3)(_pParse.Xdb).XdbOptFlags) & int32(512)) != int32(0) {
 83833  		return int32(0)
 83834  	}
 83835  	if (int32(_pExpr.Xop) != int32(78)) && (int32(_pExpr.Xop) != int32(72)) {
 83836  		return int32(0)
 83837  	}
 83838  	if (_pExpr.Xflags & uint32(1)) != (0) {
 83839  		return int32(0)
 83840  	}
 83841  	_aff1 = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.XpLeft))
 83842  	_aff2 = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.XpRight))
 83843  	if (int32(_aff1) != int32(_aff2)) && ((int32(_aff1) < int32(67)) || (int32(_aff2) < int32(67))) {
 83844  		return int32(0)
 83845  	}
 83846  	_pColl = _sqlite3BinaryCompareCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpLeft), (*XExpr)(_pExpr.XpRight))
 83847  	if (_pColl == nil) || (_sqlite3StrICmp(tls, _pColl.XzName, str(37836)) == int32(0)) {
 83848  		return int32(1)
 83849  	}
 83850  	_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpLeft))
 83851  	_zColl1 = func() *int8 {
 83852  		if _pColl != nil {
 83853  			return _pColl.XzName
 83854  		}
 83855  		return nil
 83856  	}()
 83857  	_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpRight))
 83858  	_zColl2 = func() *int8 {
 83859  		if _pColl != nil {
 83860  			return _pColl.XzName
 83861  		}
 83862  		return nil
 83863  	}()
 83864  	return bool2int(Xsqlite3_stricmp(tls, _zColl1, _zColl2) == int32(0))
 83865  }
 83866  
 83867  // C comment
 83868  //  /*
 83869  //  ** Commute a comparison operator.  Expressions of the form "X op Y"
 83870  //  ** are converted into "Y op X".
 83871  //  **
 83872  //  ** If left/right precedence rules come into play when determining the
 83873  //  ** collating sequence, then COLLATE operators are adjusted to ensure
 83874  //  ** that the collating sequence does not change.  For example:
 83875  //  ** "Y collate NOCASE op X" becomes "X op Y" because any collation sequence on
 83876  //  ** the left hand side of a comparison overrides any collation sequence
 83877  //  ** attached to the right. For the same reason the EP_Collate flag
 83878  //  ** is not commuted.
 83879  //  */
 83880  func _exprCommute(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) {
 83881  	var _expRight, _expLeft uint16
 83882  	var _4_t *XExpr
 83883  	_expRight = uint16(((*XExpr)(_pExpr.XpRight).Xflags) & uint32(256))
 83884  	_expLeft = uint16(((*XExpr)(_pExpr.XpLeft).Xflags) & uint32(256))
 83885  	func() {
 83886  		if _allowedOp(tls, int32(_pExpr.Xop)) == 0 || int32(_pExpr.Xop) == int32(74) {
 83887  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129051), unsafe.Pointer(&_exprCommuteØ00__func__Ø000), unsafe.Pointer(str(103423)))
 83888  			crt.X__builtin_abort(tls)
 83889  		}
 83890  	}()
 83891  	if int32(_expRight) != int32(_expLeft) {
 83892  		goto _3
 83893  	}
 83894  	if _expRight != 0 {
 83895  		(*XExpr)(_pExpr.XpRight).Xflags &= uint32(4294967039)
 83896  		goto _6
 83897  	}
 83898  	if _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpLeft)) != nil {
 83899  		(*XExpr)(_pExpr.XpLeft).Xflags |= uint32(256)
 83900  	}
 83901  _6:
 83902  _3:
 83903  	_4_t = (*XExpr)(_pExpr.XpRight)
 83904  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpRight)) = (*XExpr)(_pExpr.XpLeft)
 83905  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpLeft)) = _4_t
 83906  	if int32(_pExpr.Xop) >= int32(79) {
 83907  		func() {
 83908  			if int32(_pExpr.Xop) < int32(79) || int32(_pExpr.Xop) > int32(82) {
 83909  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129071), unsafe.Pointer(&_exprCommuteØ00__func__Ø000), unsafe.Pointer(str(103464)))
 83910  				crt.X__builtin_abort(tls)
 83911  			}
 83912  		}()
 83913  		_pExpr.Xop = uint8(((int32(_pExpr.Xop) - int32(79)) ^ int32(2)) + int32(79))
 83914  	}
 83915  }
 83916  
 83917  var _exprCommuteØ00__func__Ø000 [12]int8
 83918  
 83919  func init() {
 83920  	crt.Xstrncpy(nil, &_exprCommuteØ00__func__Ø000[0], str(103501), 12)
 83921  }
 83922  
 83923  var _exprAnalyzeØ00opsØ001 [2]uint8
 83924  
 83925  func init() {
 83926  	_exprAnalyzeØ00opsØ001 = [2]uint8{82, 80}
 83927  }
 83928  
 83929  // C comment
 83930  //  /*
 83931  //  ** If the pBase expression originated in the ON or USING clause of
 83932  //  ** a join, then transfer the appropriate markings over to derived.
 83933  //  */
 83934  func _transferJoinMarkings(tls *crt.TLS, _pDerived *XExpr, _pBase *XExpr) {
 83935  	if _pDerived != nil {
 83936  		_pDerived.Xflags |= _pBase.Xflags & uint32(1)
 83937  		_pDerived.XiRightJoinTable = _pBase.XiRightJoinTable
 83938  	}
 83939  }
 83940  
 83941  // C comment
 83942  //  /*
 83943  //  ** Analyze a term that consists of two or more OR-connected
 83944  //  ** subterms.  So in:
 83945  //  **
 83946  //  **     ... WHERE  (a=5) AND (b=7 OR c=9 OR d=13) AND (d=13)
 83947  //  **                          ^^^^^^^^^^^^^^^^^^^^
 83948  //  **
 83949  //  ** This routine analyzes terms such as the middle term in the above example.
 83950  //  ** A WhereOrTerm object is computed and attached to the term under
 83951  //  ** analysis, regardless of the outcome of the analysis.  Hence:
 83952  //  **
 83953  //  **     WhereTerm.wtFlags   |=  TERM_ORINFO
 83954  //  **     WhereTerm.u.pOrInfo  =  a dynamically allocated WhereOrTerm object
 83955  //  **
 83956  //  ** The term being analyzed must have two or more of OR-connected subterms.
 83957  //  ** A single subterm might be a set of AND-connected sub-subterms.
 83958  //  ** Examples of terms under analysis:
 83959  //  **
 83960  //  **     (A)     t1.x=t2.y OR t1.x=t2.z OR t1.y=15 OR t1.z=t3.a+5
 83961  //  **     (B)     x=expr1 OR expr2=x OR x=expr3
 83962  //  **     (C)     t1.x=t2.y OR (t1.x=t2.z AND t1.y=15)
 83963  //  **     (D)     x=expr1 OR (y>11 AND y<22 AND z LIKE '*hello*')
 83964  //  **     (E)     (p.a=1 AND q.b=2 AND r.c=3) OR (p.x=4 AND q.y=5 AND r.z=6)
 83965  //  **     (F)     x>A OR (x=A AND y>=B)
 83966  //  **
 83967  //  ** CASE 1:
 83968  //  **
 83969  //  ** If all subterms are of the form T.C=expr for some single column of C and
 83970  //  ** a single table T (as shown in example B above) then create a new virtual
 83971  //  ** term that is an equivalent IN expression.  In other words, if the term
 83972  //  ** being analyzed is:
 83973  //  **
 83974  //  **      x = expr1  OR  expr2 = x  OR  x = expr3
 83975  //  **
 83976  //  ** then create a new virtual term like this:
 83977  //  **
 83978  //  **      x IN (expr1,expr2,expr3)
 83979  //  **
 83980  //  ** CASE 2:
 83981  //  **
 83982  //  ** If there are exactly two disjuncts and one side has x>A and the other side
 83983  //  ** has x=A (for the same x and A) then add a new virtual conjunct term to the
 83984  //  ** WHERE clause of the form "x>=A".  Example:
 83985  //  **
 83986  //  **      x>A OR (x=A AND y>B)    adds:    x>=A
 83987  //  **
 83988  //  ** The added conjunct can sometimes be helpful in query planning.
 83989  //  **
 83990  //  ** CASE 3:
 83991  //  **
 83992  //  ** If all subterms are indexable by a single table T, then set
 83993  //  **
 83994  //  **     WhereTerm.eOperator              =  WO_OR
 83995  //  **     WhereTerm.u.pOrInfo->indexable  |=  the cursor number for table T
 83996  //  **
 83997  //  ** A subterm is "indexable" if it is of the form
 83998  //  ** "T.C <op> <expr>" where C is any column of table T and
 83999  //  ** <op> is one of "=", "<", "<=", ">", ">=", "IS NULL", or "IN".
 84000  //  ** A subterm is also indexable if it is an AND of two or more
 84001  //  ** subsubterms at least one of which is indexable.  Indexable AND
 84002  //  ** subterms have their eOperator set to WO_AND and they have
 84003  //  ** u.pAndInfo set to a dynamically allocated WhereAndTerm object.
 84004  //  **
 84005  //  ** From another point of view, "indexable" means that the subterm could
 84006  //  ** potentially be used with an index if an appropriate index exists.
 84007  //  ** This analysis does not consider whether or not the index exists; that
 84008  //  ** is decided elsewhere.  This analysis only looks at whether subterms
 84009  //  ** appropriate for indexing exist.
 84010  //  **
 84011  //  ** All examples A through E above satisfy case 3.  But if a term
 84012  //  ** also satisfies case 1 (such as B) we know that the optimizer will
 84013  //  ** always prefer case 1, so in that case we pretend that case 3 is not
 84014  //  ** satisfied.
 84015  //  **
 84016  //  ** It might be the case that multiple tables are indexable.  For example,
 84017  //  ** (E) above is indexable on tables P, Q, and R.
 84018  //  **
 84019  //  ** Terms that satisfy case 3 are candidates for lookup by using
 84020  //  ** separate indices to find rowids for each subterm and composing
 84021  //  ** the union of all rowids using a RowSet object.  This is similar
 84022  //  ** to "bitmap indices" in other database engines.
 84023  //  **
 84024  //  ** OTHERWISE:
 84025  //  **
 84026  //  ** If none of cases 1, 2, or 3 apply, then leave the eOperator set to
 84027  //  ** zero.  This term is not useful for search.
 84028  //  */
 84029  func _exprAnalyzeOrTerm(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxTerm int32) {
 84030  	var _i, _3_j, _12_iOne, _13_iTwo, _15_okToChngToIN, _15_iColumn, _15_iCursor, _15_j, _24_affLeft, _24_affRight, _29_idxNew int32
 84031  	var _chngToIN, _indexable, _3_b, _8_b uint64
 84032  	var _db *Xsqlite3
 84033  	var _27_pList *XExprList
 84034  	var _pExpr, _27_pDup, _27_pLeft, _27_pNew *XExpr
 84035  	var _pParse *XParse
 84036  	var _pWInfo *XWhereInfo
 84037  	var _pTerm, _pOrTerm, _3_pAndTerm, _9_pOther, _12_pOne, _13_pTwo *XWhereTerm
 84038  	var _pOrWc, _3_pAndWC *XWhereClause
 84039  	var _pOrInfo *XWhereOrInfo
 84040  	var _2_pAndInfo *XWhereAndInfo
 84041  	_pWInfo = (*XWhereInfo)(_pWC.XpWInfo)
 84042  	_pParse = (*XParse)(_pWInfo.XpParse)
 84043  	_db = (*Xsqlite3)(_pParse.Xdb)
 84044  	_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 84045  	_pExpr = (*XExpr)(_pTerm.XpExpr)
 84046  	func() {
 84047  		if (int32(_pTerm.XwtFlags) & int32(49)) != int32(0) {
 84048  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129466), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103513)))
 84049  			crt.X__builtin_abort(tls)
 84050  		}
 84051  	}()
 84052  	func() {
 84053  		if int32(_pExpr.Xop) != int32(70) {
 84054  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129467), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103575)))
 84055  			crt.X__builtin_abort(tls)
 84056  		}
 84057  	}()
 84058  	*(**XWhereOrInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu)))) = store103(&_pOrInfo, (*XWhereOrInfo)(_sqlite3DbMallocZero(tls, _db, uint64(560))))
 84059  	if _pOrInfo == nil {
 84060  		return
 84061  	}
 84062  	{
 84063  		p := &_pTerm.XwtFlags
 84064  		*p = uint16(int32(*p) | int32(16))
 84065  	}
 84066  	_pOrWc = &_pOrInfo.Xwc
 84067  	crt.Xmemset(tls, unsafe.Pointer(&_pOrWc.XaStatic), int32(0), uint64(512))
 84068  	_sqlite3WhereClauseInit(tls, _pOrWc, _pWInfo)
 84069  	_sqlite3WhereSplit(tls, _pOrWc, _pExpr, uint8(70))
 84070  	_sqlite3WhereExprAnalyze(tls, _pSrc, _pOrWc)
 84071  	if _db.XmallocFailed != 0 {
 84072  		return
 84073  	}
 84074  	func() {
 84075  		if _pOrWc.XnTerm < int32(2) {
 84076  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129477), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103592)))
 84077  			crt.X__builtin_abort(tls)
 84078  		}
 84079  	}()
 84080  	_indexable = uint64(18446744073709551615)
 84081  	_chngToIN = uint64(18446744073709551615)
 84082  	*func() **XWhereTerm { _i = _pOrWc.XnTerm - int32(1); return &_pOrTerm }() = (*XWhereTerm)(_pOrWc.Xa)
 84083  _8:
 84084  	if _i < int32(0) || _indexable == 0 {
 84085  		goto _12
 84086  	}
 84087  	if (int32(_pOrTerm.XeOperator) & int32(511)) != int32(0) {
 84088  		goto _13
 84089  	}
 84090  	func() {
 84091  		if (int32(_pOrTerm.XwtFlags) & int32(48)) != int32(0) {
 84092  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129487), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103608)))
 84093  			crt.X__builtin_abort(tls)
 84094  		}
 84095  	}()
 84096  	_chngToIN = 0
 84097  	_2_pAndInfo = (*XWhereAndInfo)(_sqlite3DbMallocRawNN(tls, _db, uint64(552)))
 84098  	if _2_pAndInfo == nil {
 84099  		goto _16
 84100  	}
 84101  	_3_b = 0
 84102  	*(**XWhereAndInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOrTerm.Xu)))) = _2_pAndInfo
 84103  	{
 84104  		p := &_pOrTerm.XwtFlags
 84105  		*p = uint16(int32(*p) | int32(32))
 84106  	}
 84107  	_pOrTerm.XeOperator = uint16(1024)
 84108  	_3_pAndWC = &_2_pAndInfo.Xwc
 84109  	crt.Xmemset(tls, unsafe.Pointer(&_3_pAndWC.XaStatic), int32(0), uint64(512))
 84110  	_sqlite3WhereClauseInit(tls, _3_pAndWC, (*XWhereInfo)(_pWC.XpWInfo))
 84111  	_sqlite3WhereSplit(tls, _3_pAndWC, (*XExpr)(_pOrTerm.XpExpr), uint8(71))
 84112  	_sqlite3WhereExprAnalyze(tls, _pSrc, _3_pAndWC)
 84113  	*(**XWhereClause)(unsafe.Pointer(&_3_pAndWC.XpOuter)) = _pWC
 84114  	if _db.XmallocFailed != 0 {
 84115  		goto _17
 84116  	}
 84117  	*func() **XWhereTerm { _3_j = int32(0); return &_3_pAndTerm }() = (*XWhereTerm)(_3_pAndWC.Xa)
 84118  _18:
 84119  	if _3_j >= _3_pAndWC.XnTerm {
 84120  		goto _21
 84121  	}
 84122  	func() {
 84123  		if _3_pAndTerm.XpExpr == nil {
 84124  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129506), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103659)))
 84125  			crt.X__builtin_abort(tls)
 84126  		}
 84127  	}()
 84128  	if _allowedOp(tls, int32((*XExpr)(_3_pAndTerm.XpExpr).Xop)) != 0 || (int32(_3_pAndTerm.XeOperator) == int32(64)) {
 84129  		_3_b |= _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _3_pAndTerm.XleftCursor)
 84130  	}
 84131  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _3_j += 1; return &_3_pAndTerm }())) += uintptr(64)
 84132  	goto _18
 84133  _21:
 84134  _17:
 84135  	_indexable &= _3_b
 84136  _16:
 84137  	goto _28
 84138  _13:
 84139  	if (int32(_pOrTerm.XwtFlags) & int32(8)) != 0 {
 84140  		goto _28
 84141  	}
 84142  	_8_b = _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _pOrTerm.XleftCursor)
 84143  	if (int32(_pOrTerm.XwtFlags) & int32(2)) != 0 {
 84144  		_9_pOther = elem101((*XWhereTerm)(_pOrWc.Xa), uintptr(_pOrTerm.XiParent))
 84145  		_8_b |= _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _9_pOther.XleftCursor)
 84146  	}
 84147  	_indexable &= _8_b
 84148  	if (int32(_pOrTerm.XeOperator) & int32(2)) == int32(0) {
 84149  		_chngToIN = 0
 84150  		goto _31
 84151  	}
 84152  	_chngToIN &= _8_b
 84153  _31:
 84154  _28:
 84155  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(64)
 84156  	goto _8
 84157  _12:
 84158  	_pOrInfo.Xindexable = _indexable
 84159  	_pTerm.XeOperator = uint16(func() int32 {
 84160  		if _indexable == (0) {
 84161  			return int32(0)
 84162  		}
 84163  		return int32(512)
 84164  	}())
 84165  	if _indexable == 0 || _pOrWc.XnTerm != int32(2) {
 84166  		goto _35
 84167  	}
 84168  	_12_iOne = int32(0)
 84169  _36:
 84170  	if store101(&_12_pOne, _whereNthSubterm(tls, elem101((*XWhereTerm)(_pOrWc.Xa), 0), postInc2(&_12_iOne, 1))) == nil {
 84171  		goto _37
 84172  	}
 84173  	_13_iTwo = int32(0)
 84174  _38:
 84175  	if store101(&_13_pTwo, _whereNthSubterm(tls, elem101((*XWhereTerm)(_pOrWc.Xa), uintptr(1)), postInc2(&_13_iTwo, 1))) != nil {
 84176  		_whereCombineDisjuncts(tls, _pSrc, _pWC, _12_pOne, _13_pTwo)
 84177  		goto _38
 84178  	}
 84179  	goto _36
 84180  _37:
 84181  _35:
 84182  	if _chngToIN == 0 {
 84183  		goto _40
 84184  	}
 84185  	_15_okToChngToIN = int32(0)
 84186  	_15_iColumn = int32(-1)
 84187  	_15_iCursor = int32(-1)
 84188  	_15_j = int32(0)
 84189  	_15_j = int32(0)
 84190  _41:
 84191  	if _15_j >= int32(2) || _15_okToChngToIN != 0 {
 84192  		goto _45
 84193  	}
 84194  	_pOrTerm = (*XWhereTerm)(_pOrWc.Xa)
 84195  	_i = _pOrWc.XnTerm - int32(1)
 84196  _46:
 84197  	if _i < int32(0) {
 84198  		goto _49
 84199  	}
 84200  	func() {
 84201  		if (int32(_pOrTerm.XeOperator) & int32(2)) == 0 {
 84202  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129592), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103675)))
 84203  			crt.X__builtin_abort(tls)
 84204  		}
 84205  	}()
 84206  	{
 84207  		p := &_pOrTerm.XwtFlags
 84208  		*p = uint16(int32(*p) & int32(-65))
 84209  	}
 84210  	if _pOrTerm.XleftCursor == _15_iCursor {
 84211  		func() {
 84212  			if _15_j != int32(1) {
 84213  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129597), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103702)))
 84214  				crt.X__builtin_abort(tls)
 84215  			}
 84216  		}()
 84217  		goto _47
 84218  	}
 84219  	if (_chngToIN & _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _pOrTerm.XleftCursor)) == (0) {
 84220  		func() {
 84221  			if (int32(_pOrTerm.XwtFlags) & int32(10)) == 0 {
 84222  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129608), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103707)))
 84223  				crt.X__builtin_abort(tls)
 84224  			}
 84225  		}()
 84226  		goto _47
 84227  	}
 84228  	_15_iColumn = *(*int32)(unsafe.Pointer(&_pOrTerm.Xu))
 84229  	_15_iCursor = _pOrTerm.XleftCursor
 84230  	goto _49
 84231  _47:
 84232  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(64)
 84233  	goto _46
 84234  _49:
 84235  	if _i < int32(0) {
 84236  		func() {
 84237  			if _15_j != int32(1) {
 84238  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129618), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103702)))
 84239  				crt.X__builtin_abort(tls)
 84240  			}
 84241  		}()
 84242  		func() {
 84243  			if (_chngToIN & (_chngToIN - uint64(1))) != (0) {
 84244  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129619), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103753)))
 84245  				crt.X__builtin_abort(tls)
 84246  			}
 84247  		}()
 84248  		func() {
 84249  			if _chngToIN != _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _15_iCursor) {
 84250  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129620), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103776)))
 84251  				crt.X__builtin_abort(tls)
 84252  			}
 84253  		}()
 84254  		goto _45
 84255  	}
 84256  	_15_okToChngToIN = int32(1)
 84257  _65:
 84258  	if _i < int32(0) || _15_okToChngToIN == 0 {
 84259  		goto _69
 84260  	}
 84261  	func() {
 84262  		if (int32(_pOrTerm.XeOperator) & int32(2)) == 0 {
 84263  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129629), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103675)))
 84264  			crt.X__builtin_abort(tls)
 84265  		}
 84266  	}()
 84267  	if _pOrTerm.XleftCursor != _15_iCursor {
 84268  		{
 84269  			p := &_pOrTerm.XwtFlags
 84270  			*p = uint16(int32(*p) & int32(-65))
 84271  		}
 84272  		goto _75
 84273  	}
 84274  	if (*(*int32)(unsafe.Pointer(&_pOrTerm.Xu))) != _15_iColumn {
 84275  		_15_okToChngToIN = int32(0)
 84276  		goto _75
 84277  	}
 84278  	_24_affRight = int32(_sqlite3ExprAffinity(tls, (*XExpr)((*XExpr)(_pOrTerm.XpExpr).XpRight)))
 84279  	_24_affLeft = int32(_sqlite3ExprAffinity(tls, (*XExpr)((*XExpr)(_pOrTerm.XpExpr).XpLeft)))
 84280  	if (_24_affRight != int32(0)) && (_24_affRight != _24_affLeft) {
 84281  		_15_okToChngToIN = int32(0)
 84282  		goto _78
 84283  	}
 84284  	{
 84285  		p := &_pOrTerm.XwtFlags
 84286  		*p = uint16(int32(*p) | int32(64))
 84287  	}
 84288  _78:
 84289  _75:
 84290  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(64)
 84291  	goto _65
 84292  _69:
 84293  	_15_j += 1
 84294  	goto _41
 84295  _45:
 84296  	if _15_okToChngToIN == 0 {
 84297  		goto _79
 84298  	}
 84299  	_27_pList = nil
 84300  	_27_pLeft = nil
 84301  	*func() **XWhereTerm { _i = _pOrWc.XnTerm - int32(1); return &_pOrTerm }() = (*XWhereTerm)(_pOrWc.Xa)
 84302  _80:
 84303  	if _i < int32(0) {
 84304  		goto _83
 84305  	}
 84306  	if (int32(_pOrTerm.XwtFlags) & int32(64)) == int32(0) {
 84307  		goto _81
 84308  	}
 84309  	func() {
 84310  		if (int32(_pOrTerm.XeOperator) & int32(2)) == 0 {
 84311  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129663), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103675)))
 84312  			crt.X__builtin_abort(tls)
 84313  		}
 84314  	}()
 84315  	func() {
 84316  		if _pOrTerm.XleftCursor != _15_iCursor {
 84317  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129664), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103834)))
 84318  			crt.X__builtin_abort(tls)
 84319  		}
 84320  	}()
 84321  	func() {
 84322  		if (*(*int32)(unsafe.Pointer(&_pOrTerm.Xu))) != _15_iColumn {
 84323  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129665), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103863)))
 84324  			crt.X__builtin_abort(tls)
 84325  		}
 84326  	}()
 84327  	_27_pDup = _sqlite3ExprDup(tls, _db, (*XExpr)((*XExpr)(_pOrTerm.XpExpr).XpRight), int32(0))
 84328  	_27_pList = _sqlite3ExprListAppend(tls, (*XParse)(_pWInfo.XpParse), _27_pList, _27_pDup)
 84329  	_27_pLeft = (*XExpr)((*XExpr)(_pOrTerm.XpExpr).XpLeft)
 84330  _81:
 84331  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(64)
 84332  	goto _80
 84333  _83:
 84334  	func() {
 84335  		if _27_pLeft == nil {
 84336  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129670), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103894)))
 84337  			crt.X__builtin_abort(tls)
 84338  		}
 84339  	}()
 84340  	_27_pDup = _sqlite3ExprDup(tls, _db, _27_pLeft, int32(0))
 84341  	_27_pNew = _sqlite3PExpr(tls, _pParse, int32(74), _27_pDup, nil)
 84342  	if _27_pNew != nil {
 84343  		_transferJoinMarkings(tls, _27_pNew, _pExpr)
 84344  		func() {
 84345  			if (_27_pNew.Xflags & uint32(2048)) != (0) {
 84346  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129676), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103903)))
 84347  				crt.X__builtin_abort(tls)
 84348  			}
 84349  		}()
 84350  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_27_pNew.Xx)))) = _27_pList
 84351  		_29_idxNew = _whereClauseInsert(tls, _pWC, _27_pNew, uint16(3))
 84352  		_exprAnalyze(tls, _pSrc, _pWC, _29_idxNew)
 84353  		_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 84354  		_markTermAsChild(tls, _pWC, _29_idxNew, _idxTerm)
 84355  		goto _96
 84356  	}
 84357  	_sqlite3ExprListDelete(tls, _db, _27_pList)
 84358  _96:
 84359  	_pTerm.XeOperator = uint16(4096)
 84360  _79:
 84361  _40:
 84362  	_ = _12_iOne
 84363  	_ = _13_iTwo
 84364  }
 84365  
 84366  var _exprAnalyzeOrTermØ00__func__Ø000 [18]int8
 84367  
 84368  func init() {
 84369  	crt.Xstrncpy(nil, &_exprAnalyzeOrTermØ00__func__Ø000[0], str(103940), 18)
 84370  }
 84371  
 84372  // C comment
 84373  //  /*
 84374  //  ** Return the N-th AND-connected subterm of pTerm.  Or if pTerm is not
 84375  //  ** a conjunction, then return just pTerm when N==0.  If N is exceeds
 84376  //  ** the number of available subterms, return NULL.
 84377  //  */
 84378  func _whereNthSubterm(tls *crt.TLS, _pTerm *XWhereTerm, _N int32) (r0 *XWhereTerm) {
 84379  	if int32(_pTerm.XeOperator) != int32(1024) {
 84380  		return func() *XWhereTerm {
 84381  			if _N == int32(0) {
 84382  				return _pTerm
 84383  			}
 84384  			return nil
 84385  		}()
 84386  	}
 84387  	if _N < (((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu))).Xwc).XnTerm) {
 84388  		return elem101((*XWhereTerm)(((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu))).Xwc).Xa), uintptr(_N))
 84389  	}
 84390  	return nil
 84391  }
 84392  
 84393  // C comment
 84394  //  /*
 84395  //  ** Subterms pOne and pTwo are contained within WHERE clause pWC.  The
 84396  //  ** two subterms are in disjunction - they are OR-ed together.
 84397  //  **
 84398  //  ** If these two terms are both of the form:  "A op B" with the same
 84399  //  ** A and B values but different operators and if the operators are
 84400  //  ** compatible (if one is = and the other is <, for example) then
 84401  //  ** add a new virtual AND term to pWC that is the combination of the
 84402  //  ** two.
 84403  //  **
 84404  //  ** Some examples:
 84405  //  **
 84406  //  **    x<y OR x=y    -->     x<=y
 84407  //  **    x=y OR x=y    -->     x=y
 84408  //  **    x<=y OR x<y   -->     x<=y
 84409  //  **
 84410  //  ** The following is NOT generated:
 84411  //  **
 84412  //  **    x<y OR x>y    -->     x!=y
 84413  //  */
 84414  func _whereCombineDisjuncts(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _pOne *XWhereTerm, _pTwo *XWhereTerm) {
 84415  	var _op, _idxNew int32
 84416  	var _eOp uint16
 84417  	var _db *Xsqlite3
 84418  	var _pNew *XExpr
 84419  	_eOp = uint16(int32(_pOne.XeOperator) | int32(_pTwo.XeOperator))
 84420  	if (int32(_pOne.XeOperator) & int32(62)) == int32(0) {
 84421  		return
 84422  	}
 84423  	if (int32(_pTwo.XeOperator) & int32(62)) == int32(0) {
 84424  		return
 84425  	}
 84426  	if ((int32(_eOp) & int32(26)) != int32(_eOp)) && ((int32(_eOp) & int32(38)) != int32(_eOp)) {
 84427  		return
 84428  	}
 84429  	func() {
 84430  		if (*XExpr)((*XExpr)(_pOne.XpExpr).XpLeft) == nil || (*XExpr)((*XExpr)(_pOne.XpExpr).XpRight) == nil {
 84431  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129334), unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000), unsafe.Pointer(str(103958)))
 84432  			crt.X__builtin_abort(tls)
 84433  		}
 84434  	}()
 84435  	func() {
 84436  		if (*XExpr)((*XExpr)(_pTwo.XpExpr).XpLeft) == nil || (*XExpr)((*XExpr)(_pTwo.XpExpr).XpRight) == nil {
 84437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129335), unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000), unsafe.Pointer(str(104006)))
 84438  			crt.X__builtin_abort(tls)
 84439  		}
 84440  	}()
 84441  	if _sqlite3ExprCompare(tls, (*XExpr)((*XExpr)(_pOne.XpExpr).XpLeft), (*XExpr)((*XExpr)(_pTwo.XpExpr).XpLeft), int32(-1)) != 0 {
 84442  		return
 84443  	}
 84444  	if _sqlite3ExprCompare(tls, (*XExpr)((*XExpr)(_pOne.XpExpr).XpRight), (*XExpr)((*XExpr)(_pTwo.XpExpr).XpRight), int32(-1)) != 0 {
 84445  		return
 84446  	}
 84447  	if (int32(_eOp) & (int32(_eOp) - int32(1))) == int32(0) {
 84448  		goto _12
 84449  	}
 84450  	if (int32(_eOp) & int32(24)) != 0 {
 84451  		_eOp = uint16(8)
 84452  		goto _14
 84453  	}
 84454  	func() {
 84455  		if (int32(_eOp) & int32(36)) == 0 {
 84456  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129343), unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000), unsafe.Pointer(str(104054)))
 84457  			crt.X__builtin_abort(tls)
 84458  		}
 84459  	}()
 84460  	_eOp = uint16(32)
 84461  _14:
 84462  _12:
 84463  	_db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.XpWInfo).XpParse).Xdb)
 84464  	_pNew = _sqlite3ExprDup(tls, _db, (*XExpr)(_pOne.XpExpr), int32(0))
 84465  	if _pNew == nil {
 84466  		return
 84467  	}
 84468  	_op = int32(78)
 84469  _18:
 84470  	if int32(_eOp) == (int32(2) << uint(_op-int32(78))) {
 84471  		goto _21
 84472  	}
 84473  	func() {
 84474  		if _op >= int32(82) {
 84475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129350), unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000), unsafe.Pointer(str(104074)))
 84476  			crt.X__builtin_abort(tls)
 84477  		}
 84478  	}()
 84479  	_op += 1
 84480  	goto _18
 84481  _21:
 84482  	_pNew.Xop = uint8(_op)
 84483  	_idxNew = _whereClauseInsert(tls, _pWC, _pNew, uint16(3))
 84484  	_exprAnalyze(tls, _pSrc, _pWC, _idxNew)
 84485  }
 84486  
 84487  var _whereCombineDisjunctsØ00__func__Ø000 [22]int8
 84488  
 84489  func init() {
 84490  	crt.Xstrncpy(nil, &_whereCombineDisjunctsØ00__func__Ø000[0], str(104083), 22)
 84491  }
 84492  
 84493  // C comment
 84494  //  /*
 84495  //  ** Check to see if the given expression is a LIKE or GLOB operator that
 84496  //  ** can be optimized using inequality constraints.  Return TRUE if it is
 84497  //  ** so and false if not.
 84498  //  **
 84499  //  ** In order for the operator to be optimizible, the RHS must be a string
 84500  //  ** literal that does not begin with a wildcard.  The LHS must be a column
 84501  //  ** that may only be NULL, a string, or a BLOB, never a number. (This means
 84502  //  ** that virtual tables cannot participate in the LIKE optimization.)  The
 84503  //  ** collating sequence for the column on the LHS must be appropriate for
 84504  //  ** the operator.
 84505  //  */
 84506  func _isLikeOrGlob(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _ppPrefix **XExpr, _pisComplete *int32, _pnoCase *int32) (r0 int32) {
 84507  	var _c, _cnt, _op, _rc, _2_iCol, _11_r1 int32
 84508  	var _z *int8
 84509  	var _db *Xsqlite3
 84510  	var _2_pReprepare, _10_v *TVdbe
 84511  	var _pVal *XMem
 84512  	var _pList *XExprList
 84513  	var _pRight, _pLeft, _9_pPrefix *XExpr
 84514  	var _wc [3]int8
 84515  	_z = nil
 84516  	_db = (*Xsqlite3)(_pParse.Xdb)
 84517  	_pVal = nil
 84518  	if _sqlite3IsLikeFunction(tls, _db, _pExpr, _pnoCase, (*int8)(unsafe.Pointer(&_wc))) == 0 {
 84519  		return int32(0)
 84520  	}
 84521  	_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 84522  	_pLeft = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(1)).XpExpr)
 84523  	_pRight = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), 0).XpExpr))
 84524  	_op = int32(_pRight.Xop)
 84525  	if _op != int32(135) {
 84526  		goto _1
 84527  	}
 84528  	_2_pReprepare = (*TVdbe)(_pParse.XpReprepare)
 84529  	_2_iCol = int32(_pRight.XiColumn)
 84530  	_pVal = _sqlite3VdbeGetBoundValue(tls, _2_pReprepare, _2_iCol, uint8(65))
 84531  	if (_pVal != nil) && (Xsqlite3_value_type(tls, _pVal) == int32(3)) {
 84532  		_z = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, _pVal)))
 84533  	}
 84534  	_sqlite3VdbeSetVarmask(tls, (*TVdbe)(_pParse.XpVdbe), _2_iCol)
 84535  	func() {
 84536  		if int32(_pRight.Xop) != int32(135) && int32(_pRight.Xop) != int32(157) {
 84537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129154), unsafe.Pointer(&_isLikeOrGlobØ00__func__Ø000), unsafe.Pointer(str(104105)))
 84538  			crt.X__builtin_abort(tls)
 84539  		}
 84540  	}()
 84541  	goto _8
 84542  _1:
 84543  	if _op == int32(97) {
 84544  		_z = *(**int8)(unsafe.Pointer(&_pRight.Xu))
 84545  	}
 84546  _8:
 84547  	if _z == nil {
 84548  		goto _9
 84549  	}
 84550  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_z, 0)))))&int32(4)) == 0 && int32(*elem1(_z, 0)) != int32(45) {
 84551  		goto _11
 84552  	}
 84553  	if ((int32(_pLeft.Xop) != int32(152)) || (int32(_sqlite3ExprAffinity(tls, _pLeft)) != int32(66))) || ((*XTable)(_pLeft.XpTab).XnModuleArg) != 0 {
 84554  		_sqlite3ValueFree(tls, _pVal)
 84555  		return int32(0)
 84556  	}
 84557  _11:
 84558  	_cnt = int32(0)
 84559  _15:
 84560  	if (((store2(&_c, int32(*elem1(_z, uintptr(_cnt)))) != int32(0)) && (_c != int32(*elem1((*int8)(unsafe.Pointer(&_wc)), 0)))) && (_c != int32(*elem1((*int8)(unsafe.Pointer(&_wc)), uintptr(1))))) && (_c != int32(*elem1((*int8)(unsafe.Pointer(&_wc)), uintptr(2)))) {
 84561  		_cnt += 1
 84562  		goto _15
 84563  	}
 84564  	if _cnt == int32(0) || int32(255) == int32(uint8(*elem1(_z, uintptr(_cnt-int32(1))))) {
 84565  		goto _21
 84566  	}
 84567  	*_pisComplete = bool2int((_c == int32(*elem1((*int8)(unsafe.Pointer(&_wc)), 0))) && (int32(*elem1(_z, uintptr(_cnt+int32(1)))) == int32(0)))
 84568  	_9_pPrefix = _sqlite3Expr(tls, _db, int32(97), _z)
 84569  	if _9_pPrefix != nil {
 84570  		*elem1(*(**int8)(unsafe.Pointer(&_9_pPrefix.Xu)), uintptr(_cnt)) = 0
 84571  	}
 84572  	*_ppPrefix = _9_pPrefix
 84573  	if _op != int32(135) {
 84574  		goto _24
 84575  	}
 84576  	_10_v = (*TVdbe)(_pParse.XpVdbe)
 84577  	_sqlite3VdbeSetVarmask(tls, _10_v, int32(_pRight.XiColumn))
 84578  	if (*_pisComplete) != 0 && ((*elem1(*(**int8)(unsafe.Pointer(&_pRight.Xu)), uintptr(1))) != 0) {
 84579  		_11_r1 = _sqlite3GetTempReg(tls, _pParse)
 84580  		_sqlite3ExprCodeTarget(tls, _pParse, _pRight, _11_r1)
 84581  		_sqlite3VdbeChangeP3(tls, _10_v, uint32(_sqlite3VdbeCurrentAddr(tls, _10_v)-int32(1)), int32(0))
 84582  		_sqlite3ReleaseTempReg(tls, _pParse, _11_r1)
 84583  	}
 84584  _24:
 84585  	goto _27
 84586  _21:
 84587  	_z = nil
 84588  _27:
 84589  _9:
 84590  	_rc = bool2int(_z != nil)
 84591  	_sqlite3ValueFree(tls, _pVal)
 84592  	return _rc
 84593  
 84594  	_ = _wc
 84595  	panic(0)
 84596  }
 84597  
 84598  // C comment
 84599  //  /*
 84600  //  ** pExpr points to an expression which implements a function.  If
 84601  //  ** it is appropriate to apply the LIKE optimization to that function
 84602  //  ** then set aWc[0] through aWc[2] to the wildcard characters and
 84603  //  ** return TRUE.  If the function is not a LIKE-style function then
 84604  //  ** return FALSE.
 84605  //  **
 84606  //  ** *pIsNocase is set to true if uppercase and lowercase are equivalent for
 84607  //  ** the function (default for LIKE).  If the function makes the distinction
 84608  //  ** between uppercase and lowercase (as does GLOB) then *pIsNocase is set to
 84609  //  ** false.
 84610  //  */
 84611  func _sqlite3IsLikeFunction(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _pIsNocase *int32, _aWc *int8) (r0 int32) {
 84612  	var _pDef *XFuncDef
 84613  	if ((int32(_pExpr.Xop) != int32(151)) || ((*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) == nil)) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XnExpr) != int32(2)) {
 84614  		return int32(0)
 84615  	}
 84616  	func() {
 84617  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 84618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107262), unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000), unsafe.Pointer(str(42733)))
 84619  			crt.X__builtin_abort(tls)
 84620  		}
 84621  	}()
 84622  	_pDef = _sqlite3FindFunction(tls, _db, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), int32(2), uint8(1), 0)
 84623  	if func() int32 {
 84624  		if _pDef == nil {
 84625  			return func() int32 {
 84626  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107264), unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000), unsafe.Pointer(str(4809)))
 84627  				crt.X__builtin_abort(tls)
 84628  				return int32(1)
 84629  			}()
 84630  		}
 84631  		return int32(0)
 84632  	}() != 0 || ((int32(_pDef.XfuncFlags) & int32(4)) == int32(0)) {
 84633  		return int32(0)
 84634  	}
 84635  	crt.Xmemcpy(tls, unsafe.Pointer(_aWc), _pDef.XpUserData, uint64(3))
 84636  	func() {
 84637  		if (*int8)(unsafe.Pointer(&_likeInfoAlt)) != (*int8)(unsafe.Pointer(&_likeInfoAlt.XmatchAll)) {
 84638  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107273), unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000), unsafe.Pointer(str(104156)))
 84639  			crt.X__builtin_abort(tls)
 84640  		}
 84641  	}()
 84642  	func() {
 84643  		if elem1((*int8)(unsafe.Pointer(&_likeInfoAlt)), uintptr(1)) != (*int8)(unsafe.Pointer(&_likeInfoAlt.XmatchOne)) {
 84644  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107274), unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000), unsafe.Pointer(str(104208)))
 84645  			crt.X__builtin_abort(tls)
 84646  		}
 84647  	}()
 84648  	func() {
 84649  		if elem1((*int8)(unsafe.Pointer(&_likeInfoAlt)), uintptr(2)) != (*int8)(unsafe.Pointer(&_likeInfoAlt.XmatchSet)) {
 84650  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107275), unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000), unsafe.Pointer(str(104266)))
 84651  			crt.X__builtin_abort(tls)
 84652  		}
 84653  	}()
 84654  	*_pIsNocase = bool2int((int32(_pDef.XfuncFlags) & int32(8)) == int32(0))
 84655  	return int32(1)
 84656  }
 84657  
 84658  var _sqlite3IsLikeFunctionØ00__func__Ø000 [22]int8
 84659  
 84660  func init() {
 84661  	crt.Xstrncpy(nil, &_sqlite3IsLikeFunctionØ00__func__Ø000[0], str(104324), 22)
 84662  }
 84663  
 84664  // C comment
 84665  //  /* If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator
 84666  //  ** is case sensitive causing 'a' LIKE 'A' to be false */
 84667  var _likeInfoAlt TcompareInfo
 84668  
 84669  func init() {
 84670  	_likeInfoAlt = TcompareInfo{XmatchAll: uint8(37), XmatchOne: uint8(95)}
 84671  }
 84672  
 84673  // C comment
 84674  //  /*
 84675  //  ** Return a pointer to an sqlite3_value structure containing the value bound
 84676  //  ** parameter iVar of VM v. Except, if the value is an SQL NULL, return
 84677  //  ** 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_*
 84678  //  ** constants) to the value before returning it.
 84679  //  **
 84680  //  ** The returned value must be freed by the caller using sqlite3ValueFree().
 84681  //  */
 84682  func _sqlite3VdbeGetBoundValue(tls *crt.TLS, _v *TVdbe, _iVar int32, _aff uint8) (r0 *XMem) {
 84683  	var _1_pMem, _2_pRet *XMem
 84684  	func() {
 84685  		if _iVar <= int32(0) {
 84686  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75960), unsafe.Pointer(&_sqlite3VdbeGetBoundValueØ00__func__Ø000), unsafe.Pointer(str(104346)))
 84687  			crt.X__builtin_abort(tls)
 84688  		}
 84689  	}()
 84690  	if _v == nil {
 84691  		goto _2
 84692  	}
 84693  	_1_pMem = elem25((*XMem)(_v.XaVar), uintptr(_iVar-int32(1)))
 84694  	if int32(0) != (int32(_1_pMem.Xflags) & int32(1)) {
 84695  		goto _3
 84696  	}
 84697  	_2_pRet = _sqlite3ValueNew(tls, (*Xsqlite3)(_v.Xdb))
 84698  	if _2_pRet != nil {
 84699  		_sqlite3VdbeMemCopy(tls, _2_pRet, _1_pMem)
 84700  		_sqlite3ValueApplyAffinity(tls, _2_pRet, _aff, uint8(1))
 84701  	}
 84702  	return _2_pRet
 84703  
 84704  _3:
 84705  _2:
 84706  	return nil
 84707  }
 84708  
 84709  var _sqlite3VdbeGetBoundValueØ00__func__Ø000 [25]int8
 84710  
 84711  func init() {
 84712  	crt.Xstrncpy(nil, &_sqlite3VdbeGetBoundValueØ00__func__Ø000[0], str(104353), 25)
 84713  }
 84714  
 84715  // C comment
 84716  //  /*
 84717  //  ** Configure SQL variable iVar so that binding a new value to it signals
 84718  //  ** to sqlite3_reoptimize() that re-preparing the statement may result
 84719  //  ** in a better query plan.
 84720  //  */
 84721  func _sqlite3VdbeSetVarmask(tls *crt.TLS, _v *TVdbe, _iVar int32) {
 84722  	func() {
 84723  		if _iVar <= int32(0) {
 84724  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75981), unsafe.Pointer(&_sqlite3VdbeSetVarmaskØ00__func__Ø000), unsafe.Pointer(str(104346)))
 84725  			crt.X__builtin_abort(tls)
 84726  		}
 84727  	}()
 84728  	if _iVar >= int32(32) {
 84729  		_v.Xexpmask |= uint32(2147483648)
 84730  		goto _3
 84731  	}
 84732  	_v.Xexpmask |= uint32(1) << uint(_iVar-int32(1))
 84733  _3:
 84734  }
 84735  
 84736  var _sqlite3VdbeSetVarmaskØ00__func__Ø000 [22]int8
 84737  
 84738  func init() {
 84739  	crt.Xstrncpy(nil, &_sqlite3VdbeSetVarmaskØ00__func__Ø000[0], str(104378), 22)
 84740  }
 84741  
 84742  var _isLikeOrGlobØ00__func__Ø000 [13]int8
 84743  
 84744  func init() {
 84745  	crt.Xstrncpy(nil, &_isLikeOrGlobØ00__func__Ø000[0], str(104400), 13)
 84746  }
 84747  
 84748  func _sqlite3VdbeChangeP3(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) {
 84749  	_sqlite3VdbeGetOp(tls, _p, int32(_addr)).Xp3 = _val
 84750  }
 84751  
 84752  // C comment
 84753  //  /*
 84754  //  ** Check to see if the given expression is of the form
 84755  //  **
 84756  //  **         column OP expr
 84757  //  **
 84758  //  ** where OP is one of MATCH, GLOB, LIKE or REGEXP and "column" is a
 84759  //  ** column of a virtual table.
 84760  //  **
 84761  //  ** If it is then return TRUE.  If not, return FALSE.
 84762  //  */
 84763  func _isMatchOfColumn(tls *crt.TLS, _pExpr *XExpr, _peOp2 *uint8) (r0 int32) {
 84764  	var _i int32
 84765  	var _pList *XExprList
 84766  	var _pCol *XExpr
 84767  	if int32(_pExpr.Xop) != int32(151) {
 84768  		return int32(0)
 84769  	}
 84770  	_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 84771  	if (_pList == nil) || (_pList.XnExpr != int32(2)) {
 84772  		return int32(0)
 84773  	}
 84774  	_pCol = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(1)).XpExpr)
 84775  	if (int32(_pCol.Xop) != int32(152)) || (((*XTable)(_pCol.XpTab).XnModuleArg) == 0) {
 84776  		return int32(0)
 84777  	}
 84778  	_i = int32(0)
 84779  _5:
 84780  	if _i >= int32(4) {
 84781  		goto _8
 84782  	}
 84783  	if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), elem104((*TOp2)(unsafe.Pointer(&_isMatchOfColumnØ00aOpØ001)), uintptr(_i)).XzOp) == int32(0) {
 84784  		*_peOp2 = elem104((*TOp2)(unsafe.Pointer(&_isMatchOfColumnØ00aOpØ001)), uintptr(_i)).XeOp2
 84785  		return int32(1)
 84786  	}
 84787  	_i += 1
 84788  	goto _5
 84789  _8:
 84790  	return int32(0)
 84791  }
 84792  
 84793  var _isMatchOfColumnØ00aOpØ001 [4]TOp2
 84794  
 84795  func init() {
 84796  	_isMatchOfColumnØ00aOpØ001 = [4]TOp2{TOp2{XzOp: str(93845), XeOp2: uint8(64)}, TOp2{XzOp: str(7862), XeOp2: uint8(66)}, TOp2{XzOp: str(7867), XeOp2: uint8(65)}, TOp2{XzOp: str(104413), XeOp2: uint8(67)}}
 84797  }
 84798  
 84799  // C comment
 84800  //  /*
 84801  //  ** Compute and return a new Expr object which when passed to
 84802  //  ** sqlite3ExprCode() will generate all necessary code to compute
 84803  //  ** the iField-th column of the vector expression pVector.
 84804  //  **
 84805  //  ** It is ok for pVector to be a scalar (as long as iField==0).
 84806  //  ** In that case, this routine works like sqlite3ExprDup().
 84807  //  **
 84808  //  ** The caller owns the returned Expr object and is responsible for
 84809  //  ** ensuring that the returned value eventually gets freed.
 84810  //  **
 84811  //  ** The caller retains ownership of pVector.  If pVector is a TK_SELECT,
 84812  //  ** then the returned object will reference pVector and so pVector must remain
 84813  //  ** valid for the life of the returned object.  If pVector is a TK_VECTOR
 84814  //  ** or a scalar expression, then it can be deleted as soon as this routine
 84815  //  ** returns.
 84816  //  **
 84817  //  ** A trick to cause a TK_SELECT pVector to be deleted together with
 84818  //  ** the returned Expr object is to attach the pVector to the pRight field
 84819  //  ** of the returned TK_SELECT_COLUMN Expr object.
 84820  //  */
 84821  func _sqlite3ExprForVectorField(tls *crt.TLS, _pParse *XParse, _pVector *XExpr, _iField int32) (r0 *XExpr) {
 84822  	var _pRet *XExpr
 84823  	if int32(_pVector.Xop) != int32(119) {
 84824  		goto _0
 84825  	}
 84826  	func() {
 84827  		if (_pVector.Xflags & uint32(2048)) == 0 {
 84828  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91309), unsafe.Pointer(&_sqlite3ExprForVectorFieldØ00__func__Ø000), unsafe.Pointer(str(104420)))
 84829  			crt.X__builtin_abort(tls)
 84830  		}
 84831  	}()
 84832  	_pRet = _sqlite3PExpr(tls, _pParse, int32(159), nil, nil)
 84833  	if _pRet != nil {
 84834  		_pRet.XiColumn = int16(_iField)
 84835  		*(**XExpr)(unsafe.Pointer(&_pRet.XpLeft)) = _pVector
 84836  	}
 84837  	func() {
 84838  		if _pRet != nil && _pRet.XiTable != int32(0) {
 84839  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91331), unsafe.Pointer(&_sqlite3ExprForVectorFieldØ00__func__Ø000), unsafe.Pointer(str(104450)))
 84840  			crt.X__builtin_abort(tls)
 84841  		}
 84842  	}()
 84843  	goto _7
 84844  _0:
 84845  	if int32(_pVector.Xop) == int32(158) {
 84846  		_pVector = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pVector.Xx))).Xa))), uintptr(_iField)).XpExpr)
 84847  	}
 84848  	_pRet = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.Xdb), _pVector, int32(0))
 84849  _7:
 84850  	return _pRet
 84851  }
 84852  
 84853  var _sqlite3ExprForVectorFieldØ00__func__Ø000 [26]int8
 84854  
 84855  func init() {
 84856  	crt.Xstrncpy(nil, &_sqlite3ExprForVectorFieldØ00__func__Ø000[0], str(104477), 26)
 84857  }
 84858  
 84859  // C comment
 84860  //  /*
 84861  //  ** Return true if the DISTINCT expression-list passed as the third argument
 84862  //  ** is redundant.
 84863  //  **
 84864  //  ** A DISTINCT list is redundant if any subset of the columns in the
 84865  //  ** DISTINCT list are collectively unique and individually non-null.
 84866  //  */
 84867  func _isDistinctRedundant(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWC *XWhereClause, _pDistinct *XExprList) (r0 int32) {
 84868  	var _i, _iBase int32
 84869  	var _pTab *XTable
 84870  	var _1_p *XExpr
 84871  	var _pIdx *XIndex
 84872  	if _pTabList.XnSrc != int32(1) {
 84873  		return int32(0)
 84874  	}
 84875  	_iBase = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XiCursor
 84876  	_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XpTab)
 84877  	_i = int32(0)
 84878  _1:
 84879  	if _i >= _pDistinct.XnExpr {
 84880  		goto _4
 84881  	}
 84882  	_1_p = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pDistinct.Xa)), uintptr(_i)).XpExpr))
 84883  	if ((int32(_1_p.Xop) == int32(152)) && (_1_p.XiTable == _iBase)) && (int32(_1_p.XiColumn) < int32(0)) {
 84884  		return int32(1)
 84885  	}
 84886  	_i += 1
 84887  	goto _1
 84888  _4:
 84889  	_pIdx = (*XIndex)(_pTab.XpIndex)
 84890  _8:
 84891  	if _pIdx == nil {
 84892  		goto _11
 84893  	}
 84894  	if int32(_pIdx.XonError) == int32(0) {
 84895  		goto _9
 84896  	}
 84897  	_i = int32(0)
 84898  _13:
 84899  	if _i >= int32(_pIdx.XnKeyCol) {
 84900  		goto _16
 84901  	}
 84902  	if nil != _sqlite3WhereFindTerm(tls, _pWC, _iBase, _i, uint64(18446744073709551615), uint32(2), _pIdx) {
 84903  		goto _17
 84904  	}
 84905  	if _findIndexCol(tls, _pParse, _pDistinct, _iBase, _pIdx, _i) < int32(0) {
 84906  		goto _16
 84907  	}
 84908  	if _indexColumnNotNull(tls, _pIdx, _i) == int32(0) {
 84909  		goto _16
 84910  	}
 84911  _17:
 84912  	_i += 1
 84913  	goto _13
 84914  _16:
 84915  	if _i == int32(_pIdx.XnKeyCol) {
 84916  		return int32(1)
 84917  	}
 84918  _9:
 84919  	_pIdx = (*XIndex)(_pIdx.XpNext)
 84920  	goto _8
 84921  _11:
 84922  	return int32(0)
 84923  }
 84924  
 84925  // C comment
 84926  //  /*
 84927  //  ** Search for a term in the WHERE clause that is of the form "X <op> <expr>"
 84928  //  ** where X is a reference to the iColumn of table iCur or of index pIdx
 84929  //  ** if pIdx!=0 and <op> is one of the WO_xx operator codes specified by
 84930  //  ** the op parameter.  Return a pointer to the term.  Return 0 if not found.
 84931  //  **
 84932  //  ** If pIdx!=0 then it must be one of the indexes of table iCur.
 84933  //  ** Search for terms matching the iColumn-th column of pIdx
 84934  //  ** rather than the iColumn-th column of table iCur.
 84935  //  **
 84936  //  ** The term returned might by Y=<expr> if there is another constraint in
 84937  //  ** the WHERE clause that specifies that X=Y.  Any such constraints will be
 84938  //  ** identified by the WO_EQUIV bit in the pTerm->eOperator field.  The
 84939  //  ** aiCur[]/iaColumn[] arrays hold X and all its equivalents. There are 11
 84940  //  ** slots in aiCur[]/aiColumn[] so that means we can look for X plus up to 10
 84941  //  ** other equivalent values.  Hence a search for X will return <expr> if X=A1
 84942  //  ** and A1=A2 and A2=A3 and ... and A9=A10 and A10=<expr>.
 84943  //  **
 84944  //  ** If there are multiple terms in the WHERE clause of the form "X <op> <expr>"
 84945  //  ** then try for the one with no dependencies on <expr> - in other words where
 84946  //  ** <expr> is a constant expression of some kind.  Only return entries of
 84947  //  ** the form "X <op> Y" where Y is a column in another table if no terms of
 84948  //  ** the form "X <op> <const-expr>" exist.   If no terms with a constant RHS
 84949  //  ** exist, try to return a term that does not use WO_EQUIV.
 84950  //  */
 84951  func _sqlite3WhereFindTerm(tls *crt.TLS, _pWC *XWhereClause, _iCur int32, _iColumn int32, _notReady uint64, _op uint32, _pIdx *XIndex) (r0 *XWhereTerm) {
 84952  	var _pResult, _p *XWhereTerm
 84953  	var _scan XWhereScan
 84954  	_pResult = nil
 84955  	_p = _whereScanInit(tls, &_scan, _pWC, _iCur, _iColumn, _op, _pIdx)
 84956  	_op &= uint32(130)
 84957  _0:
 84958  	if _p == nil {
 84959  		goto _1
 84960  	}
 84961  	if (_p.XprereqRight & _notReady) != (0) {
 84962  		goto _2
 84963  	}
 84964  	if (_p.XprereqRight == (0)) && ((uint32(_p.XeOperator) & _op) != (0)) {
 84965  		return _p
 84966  	}
 84967  	if _pResult == nil {
 84968  		_pResult = _p
 84969  	}
 84970  _2:
 84971  	_p = _whereScanNext(tls, &_scan)
 84972  	goto _0
 84973  _1:
 84974  	return _pResult
 84975  }
 84976  
 84977  // C comment
 84978  //  /*
 84979  //  ** Initialize a WHERE clause scanner object.  Return a pointer to the
 84980  //  ** first match.  Return NULL if there are no matches.
 84981  //  **
 84982  //  ** The scanner will be searching the WHERE clause pWC.  It will look
 84983  //  ** for terms of the form "X <op> <expr>" where X is column iColumn of table
 84984  //  ** iCur.   Or if pIdx!=0 then X is column iColumn of index pIdx.  pIdx
 84985  //  ** must be one of the indexes of table iCur.
 84986  //  **
 84987  //  ** The <op> must be one of the operators described by opMask.
 84988  //  **
 84989  //  ** If the search is for X and the WHERE clause contains terms of the
 84990  //  ** form X=Y then this routine might also return terms of the form
 84991  //  ** "Y <op> <expr>".  The number of levels of transitivity is limited,
 84992  //  ** but is enough to handle most commonly occurring SQL statements.
 84993  //  **
 84994  //  ** If X is not the INTEGER PRIMARY KEY then X must be compatible with
 84995  //  ** index pIdx.
 84996  //  */
 84997  func _whereScanInit(tls *crt.TLS, _pScan *XWhereScan, _pWC *XWhereClause, _iCur int32, _iColumn int32, _opMask uint32, _pIdx *XIndex) (r0 *XWhereTerm) {
 84998  	var _1_j int32
 84999  	*(**XWhereClause)(unsafe.Pointer(&_pScan.XpOrigWC)) = _pWC
 85000  	*(**XWhereClause)(unsafe.Pointer(&_pScan.XpWC)) = _pWC
 85001  	*(**XExpr)(unsafe.Pointer(&_pScan.XpIdxExpr)) = nil
 85002  	_pScan.Xidxaff = 0
 85003  	_pScan.XzCollName = nil
 85004  	if _pIdx == nil {
 85005  		goto _0
 85006  	}
 85007  	_1_j = _iColumn
 85008  	_iColumn = int32(*elem52(_pIdx.XaiColumn, uintptr(_1_j)))
 85009  	if _iColumn == int32(-2) {
 85010  		*(**XExpr)(unsafe.Pointer(&_pScan.XpIdxExpr)) = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.XaColExpr).Xa))), uintptr(_1_j)).XpExpr)
 85011  		_pScan.XzCollName = *elem0(_pIdx.XazColl, uintptr(_1_j))
 85012  		goto _5
 85013  	}
 85014  	if _iColumn == int32((*XTable)(_pIdx.XpTable).XiPKey) {
 85015  		_iColumn = int32(-1)
 85016  		goto _5
 85017  	}
 85018  	if _iColumn >= int32(0) {
 85019  		_pScan.Xidxaff = elem43((*XColumn)((*XTable)(_pIdx.XpTable).XaCol), uintptr(_iColumn)).Xaffinity
 85020  		_pScan.XzCollName = *elem0(_pIdx.XazColl, uintptr(_1_j))
 85021  	}
 85022  _5:
 85023  	goto _7
 85024  _0:
 85025  	if _iColumn == int32(-2) {
 85026  		return nil
 85027  	}
 85028  _7:
 85029  	_pScan.XopMask = _opMask
 85030  	_pScan.Xk = int32(0)
 85031  	*elem8((*int32)(unsafe.Pointer(&_pScan.XaiCur)), 0) = _iCur
 85032  	*elem52((*int16)(unsafe.Pointer(&_pScan.XaiColumn)), 0) = int16(_iColumn)
 85033  	_pScan.XnEquiv = uint8(1)
 85034  	_pScan.XiEquiv = uint8(1)
 85035  	return _whereScanNext(tls, _pScan)
 85036  }
 85037  
 85038  // C comment
 85039  //  /*
 85040  //  ** Advance to the next WhereTerm that matches according to the criteria
 85041  //  ** established when the pScan object was initialized by whereScanInit().
 85042  //  ** Return NULL if there are no more matching WhereTerms.
 85043  //  */
 85044  func _whereScanNext(tls *crt.TLS, _pScan *XWhereScan) (r0 *XWhereTerm) {
 85045  	var _iColumn int16
 85046  	var _iCur, _k, _5_j int32
 85047  	var _pX *XExpr
 85048  	var _10_pParse *XParse
 85049  	var _10_pColl *XCollSeq
 85050  	var _pTerm *XWhereTerm
 85051  	var _pWC *XWhereClause
 85052  	_k = _pScan.Xk
 85053  	func() {
 85054  		if int32(_pScan.XiEquiv) > int32(_pScan.XnEquiv) {
 85055  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130590), unsafe.Pointer(&_whereScanNextØ00__func__Ø000), unsafe.Pointer(str(104503)))
 85056  			crt.X__builtin_abort(tls)
 85057  		}
 85058  	}()
 85059  	_pWC = (*XWhereClause)(_pScan.XpWC)
 85060  _2:
 85061  	_iColumn = *elem52((*int16)(unsafe.Pointer(&_pScan.XaiColumn)), uintptr(int32(_pScan.XiEquiv)-int32(1)))
 85062  	_iCur = *elem8((*int32)(unsafe.Pointer(&_pScan.XaiCur)), uintptr(int32(_pScan.XiEquiv)-int32(1)))
 85063  	func() {
 85064  		if _pWC == nil {
 85065  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130595), unsafe.Pointer(&_whereScanNextØ00__func__Ø000), unsafe.Pointer(str(104532)))
 85066  			crt.X__builtin_abort(tls)
 85067  		}
 85068  	}()
 85069  _6:
 85070  	_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.Xa) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_k)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(64)))))))))))
 85071  _7:
 85072  	if _k >= _pWC.XnTerm {
 85073  		goto _10
 85074  	}
 85075  	if _pTerm.XleftCursor != _iCur || (*(*int32)(unsafe.Pointer(&_pTerm.Xu))) != int32(_iColumn) || int32(_iColumn) == int32(-2) && _sqlite3ExprCompareSkip(tls, (*XExpr)((*XExpr)(_pTerm.XpExpr).XpLeft), (*XExpr)(_pScan.XpIdxExpr), _iCur) != int32(0) || int32(_pScan.XiEquiv) > int32(1) && (((*XExpr)(_pTerm.XpExpr).Xflags)&uint32(1)) != (0) {
 85076  		goto _16
 85077  	}
 85078  	if (int32(_pTerm.XeOperator)&int32(2048)) == int32(0) || int32(_pScan.XnEquiv) >= int32(11) || int32(store60(&_pX, _sqlite3ExprSkipCollate(tls, (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight))).Xop) != int32(152) {
 85079  		goto _19
 85080  	}
 85081  	_5_j = int32(0)
 85082  _20:
 85083  	if _5_j >= int32(_pScan.XnEquiv) {
 85084  		goto _23
 85085  	}
 85086  	if ((*elem8((*int32)(unsafe.Pointer(&_pScan.XaiCur)), uintptr(_5_j))) == _pX.XiTable) && (int32(*elem52((*int16)(unsafe.Pointer(&_pScan.XaiColumn)), uintptr(_5_j))) == int32(_pX.XiColumn)) {
 85087  		goto _23
 85088  	}
 85089  	_5_j += 1
 85090  	goto _20
 85091  _23:
 85092  	if _5_j == int32(_pScan.XnEquiv) {
 85093  		*elem8((*int32)(unsafe.Pointer(&_pScan.XaiCur)), uintptr(_5_j)) = _pX.XiTable
 85094  		*elem52((*int16)(unsafe.Pointer(&_pScan.XaiColumn)), uintptr(_5_j)) = _pX.XiColumn
 85095  		_pScan.XnEquiv += 1
 85096  	}
 85097  _19:
 85098  	if (uint32(_pTerm.XeOperator) & _pScan.XopMask) == (0) {
 85099  		goto _27
 85100  	}
 85101  	if _pScan.XzCollName == nil || (int32(_pTerm.XeOperator)&int32(256)) != int32(0) {
 85102  		goto _29
 85103  	}
 85104  	_10_pParse = (*XParse)((*XWhereInfo)(_pWC.XpWInfo).XpParse)
 85105  	_pX = (*XExpr)(_pTerm.XpExpr)
 85106  	if _sqlite3IndexAffinityOk(tls, _pX, _pScan.Xidxaff) == 0 {
 85107  		goto _8
 85108  	}
 85109  	func() {
 85110  		if _pX.XpLeft == nil {
 85111  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130631), unsafe.Pointer(&_whereScanNextØ00__func__Ø000), unsafe.Pointer(str(104539)))
 85112  			crt.X__builtin_abort(tls)
 85113  		}
 85114  	}()
 85115  	_10_pColl = _sqlite3BinaryCompareCollSeq(tls, _10_pParse, (*XExpr)(_pX.XpLeft), (*XExpr)(_pX.XpRight))
 85116  	if _10_pColl == nil {
 85117  		_10_pColl = (*XCollSeq)((*Xsqlite3)(_10_pParse.Xdb).XpDfltColl)
 85118  	}
 85119  	if _sqlite3StrICmp(tls, _10_pColl.XzName, _pScan.XzCollName) != 0 {
 85120  		goto _8
 85121  	}
 85122  _29:
 85123  	if ((((int32(_pTerm.XeOperator) & int32(130)) != int32(0)) && (int32(store60(&_pX, (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)).Xop) == int32(152))) && (_pX.XiTable == (*elem8((*int32)(unsafe.Pointer(&_pScan.XaiCur)), 0)))) && (int32(_pX.XiColumn) == int32(*elem52((*int16)(unsafe.Pointer(&_pScan.XaiColumn)), 0))) {
 85124  		goto _8
 85125  	}
 85126  	*(**XWhereClause)(unsafe.Pointer(&_pScan.XpWC)) = _pWC
 85127  	_pScan.Xk = _k + int32(1)
 85128  	return _pTerm
 85129  
 85130  _27:
 85131  _16:
 85132  _8:
 85133  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _k += 1; return &_pTerm }())) += uintptr(64)
 85134  	goto _7
 85135  _10:
 85136  	_pWC = (*XWhereClause)(_pWC.XpOuter)
 85137  	_k = int32(0)
 85138  	if _pWC != nil {
 85139  		goto _6
 85140  	}
 85141  	if int32(_pScan.XiEquiv) >= int32(_pScan.XnEquiv) {
 85142  		goto _3
 85143  	}
 85144  	_pWC = (*XWhereClause)(_pScan.XpOrigWC)
 85145  	_k = int32(0)
 85146  	_pScan.XiEquiv += 1
 85147  	goto _2
 85148  _3:
 85149  	return nil
 85150  }
 85151  
 85152  var _whereScanNextØ00__func__Ø000 [14]int8
 85153  
 85154  func init() {
 85155  	crt.Xstrncpy(nil, &_whereScanNextØ00__func__Ø000[0], str(104549), 14)
 85156  }
 85157  
 85158  // C comment
 85159  //  /*
 85160  //  ** pExpr is a comparison expression, eg. '=', '<', IN(...) etc.
 85161  //  ** idx_affinity is the affinity of an indexed column. Return true
 85162  //  ** if the index with affinity idx_affinity may be used to implement
 85163  //  ** the comparison in pExpr.
 85164  //  */
 85165  func _sqlite3IndexAffinityOk(tls *crt.TLS, _pExpr *XExpr, _idx_affinity int8) (r0 int32) {
 85166  	var _aff int8
 85167  	_aff = _comparisonAffinity(tls, _pExpr)
 85168  	switch int32(_aff) {
 85169  	case int32(65):
 85170  		goto _1
 85171  	case int32(66):
 85172  		goto _2
 85173  	default:
 85174  		goto _3
 85175  	}
 85176  
 85177  _1:
 85178  	return int32(1)
 85179  
 85180  _2:
 85181  	return bool2int(int32(_idx_affinity) == int32(66))
 85182  
 85183  _3:
 85184  	return bool2int(int32(_idx_affinity) >= int32(67))
 85185  }
 85186  
 85187  // C comment
 85188  //  /*
 85189  //  ** pExpr is a comparison operator.  Return the type affinity that should
 85190  //  ** be applied to both operands prior to doing the comparison.
 85191  //  */
 85192  func _comparisonAffinity(tls *crt.TLS, _pExpr *XExpr) (r0 int8) {
 85193  	var _aff int8
 85194  	func() {
 85195  		if int32(_pExpr.Xop) != int32(78) && int32(_pExpr.Xop) != int32(74) && int32(_pExpr.Xop) != int32(81) && int32(_pExpr.Xop) != int32(79) && int32(_pExpr.Xop) != int32(82) && int32(_pExpr.Xop) != int32(80) && int32(_pExpr.Xop) != int32(77) && int32(_pExpr.Xop) != int32(72) && int32(_pExpr.Xop) != int32(148) {
 85196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91123), unsafe.Pointer(&_comparisonAffinityØ00__func__Ø000), unsafe.Pointer(str(104563)))
 85197  			crt.X__builtin_abort(tls)
 85198  		}
 85199  	}()
 85200  	func() {
 85201  		if _pExpr.XpLeft == nil {
 85202  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91126), unsafe.Pointer(&_comparisonAffinityØ00__func__Ø000), unsafe.Pointer(str(104743)))
 85203  			crt.X__builtin_abort(tls)
 85204  		}
 85205  	}()
 85206  	_aff = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.XpLeft))
 85207  	if _pExpr.XpRight != nil {
 85208  		_aff = _sqlite3CompareAffinity(tls, (*XExpr)(_pExpr.XpRight), _aff)
 85209  		goto _16
 85210  	}
 85211  	if (_pExpr.Xflags & uint32(2048)) != (0) {
 85212  		_aff = _sqlite3CompareAffinity(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpEList).Xa))), 0).XpExpr), _aff)
 85213  		goto _16
 85214  	}
 85215  	if int32(_aff) == int32(0) {
 85216  		_aff = int8(65)
 85217  	}
 85218  _16:
 85219  	return _aff
 85220  }
 85221  
 85222  var _comparisonAffinityØ00__func__Ø000 [19]int8
 85223  
 85224  func init() {
 85225  	crt.Xstrncpy(nil, &_comparisonAffinityØ00__func__Ø000[0], str(104756), 19)
 85226  }
 85227  
 85228  // C comment
 85229  //  /*
 85230  //  ** This function searches pList for an entry that matches the iCol-th column
 85231  //  ** of index pIdx.
 85232  //  **
 85233  //  ** If such an expression is found, its index in pList->a[] is returned. If
 85234  //  ** no expression is found, -1 is returned.
 85235  //  */
 85236  func _findIndexCol(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _iBase int32, _pIdx *XIndex, _iCol int32) (r0 int32) {
 85237  	var _i int32
 85238  	var _zColl *int8
 85239  	var _1_p *XExpr
 85240  	var _2_pColl *XCollSeq
 85241  	_zColl = *elem0(_pIdx.XazColl, uintptr(_iCol))
 85242  	_i = int32(0)
 85243  _0:
 85244  	if _i >= _pList.XnExpr {
 85245  		goto _3
 85246  	}
 85247  	_1_p = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))
 85248  	if int32(_1_p.Xop) != int32(152) || int32(_1_p.XiColumn) != int32(*elem52(_pIdx.XaiColumn, uintptr(_iCol))) || _1_p.XiTable != _iBase {
 85249  		goto _6
 85250  	}
 85251  	_2_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))
 85252  	if (_2_pColl != nil) && (int32(0) == _sqlite3StrICmp(tls, _2_pColl.XzName, _zColl)) {
 85253  		return _i
 85254  	}
 85255  _6:
 85256  	_i += 1
 85257  	goto _0
 85258  _3:
 85259  	return int32(-1)
 85260  }
 85261  
 85262  // C comment
 85263  //  /*
 85264  //  ** Return TRUE if the iCol-th column of index pIdx is NOT NULL
 85265  //  */
 85266  func _indexColumnNotNull(tls *crt.TLS, _pIdx *XIndex, _iCol int32) (r0 int32) {
 85267  	var _j int32
 85268  	func() {
 85269  		if _pIdx == nil {
 85270  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130810), unsafe.Pointer(&_indexColumnNotNullØ00__func__Ø000), unsafe.Pointer(str(42024)))
 85271  			crt.X__builtin_abort(tls)
 85272  		}
 85273  	}()
 85274  	func() {
 85275  		if _iCol < int32(0) || _iCol >= int32(_pIdx.XnColumn) {
 85276  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130811), unsafe.Pointer(&_indexColumnNotNullØ00__func__Ø000), unsafe.Pointer(str(104775)))
 85277  			crt.X__builtin_abort(tls)
 85278  		}
 85279  	}()
 85280  	_j = int32(*elem52(_pIdx.XaiColumn, uintptr(_iCol)))
 85281  	if _j >= int32(0) {
 85282  		return int32(elem43((*XColumn)((*XTable)(_pIdx.XpTable).XaCol), uintptr(_j)).XnotNull)
 85283  	}
 85284  	if _j == int32(-1) {
 85285  		return int32(1)
 85286  	}
 85287  	func() {
 85288  		if _j != int32(-2) {
 85289  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130818), unsafe.Pointer(&_indexColumnNotNullØ00__func__Ø000), unsafe.Pointer(str(104805)))
 85290  			crt.X__builtin_abort(tls)
 85291  		}
 85292  	}()
 85293  	return int32(0)
 85294  }
 85295  
 85296  var _indexColumnNotNullØ00__func__Ø000 [19]int8
 85297  
 85298  func init() {
 85299  	crt.Xstrncpy(nil, &_indexColumnNotNullØ00__func__Ø000[0], str(104813), 19)
 85300  }
 85301  
 85302  // C comment
 85303  //  /*
 85304  //  ** Most queries use only a single table (they are not joins) and have
 85305  //  ** simple == constraints against indexed fields.  This routine attempts
 85306  //  ** to plan those simple cases using much less ceremony than the
 85307  //  ** general-purpose query planner, and thereby yield faster sqlite3_prepare()
 85308  //  ** times for the common case.
 85309  //  **
 85310  //  ** Return non-zero on success, if this query can be handled by this
 85311  //  ** no-frills query planner.  Return zero if this query needs the
 85312  //  ** general-purpose query planner.
 85313  //  */
 85314  func _whereShortCut(tls *crt.TLS, _pBuilder *XWhereLoopBuilder) (r0 int32) {
 85315  	var _iCur, _j, _3_opMask int32
 85316  	var _pTab *XTable
 85317  	var _pItem *TSrcList_item
 85318  	var _pIdx *XIndex
 85319  	var _pWInfo *XWhereInfo
 85320  	var _pLoop *XWhereLoop
 85321  	var _pTerm *XWhereTerm
 85322  	var _pWC *XWhereClause
 85323  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 85324  	if (int32(_pWInfo.XwctrlFlags) & int32(32)) != 0 {
 85325  		return int32(0)
 85326  	}
 85327  	func() {
 85328  		if ((*XSrcList)(_pWInfo.XpTabList).XnSrc) < int32(1) {
 85329  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134607), unsafe.Pointer(&_whereShortCutØ00__func__Ø000), unsafe.Pointer(str(104832)))
 85330  			crt.X__builtin_abort(tls)
 85331  		}
 85332  	}()
 85333  	_pItem = (*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa)))
 85334  	_pTab = (*XTable)(_pItem.XpTab)
 85335  	if _pTab.XnModuleArg != 0 {
 85336  		return int32(0)
 85337  	}
 85338  	if ((uint32((_pItem.Xfg.XnotIndexed)>>1) << 31) >> 31) != 0 {
 85339  		return int32(0)
 85340  	}
 85341  	_iCur = _pItem.XiCursor
 85342  	_pWC = &_pWInfo.XsWC
 85343  	_pLoop = (*XWhereLoop)(_pBuilder.XpNew)
 85344  	_pLoop.XwsFlags = 0
 85345  	_pLoop.XnSkip = 0
 85346  	_pTerm = _sqlite3WhereFindTerm(tls, _pWC, _iCur, int32(-1), 0, uint32(130), nil)
 85347  	if _pTerm != nil {
 85348  		_pLoop.XwsFlags = uint32(4353)
 85349  		*elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), 0) = _pTerm
 85350  		_pLoop.XnLTerm = uint16(1)
 85351  		(*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq = uint16(1)
 85352  		_pLoop.XrRun = int16(33)
 85353  		goto _6
 85354  	}
 85355  	_pIdx = (*XIndex)(_pTab.XpIndex)
 85356  _7:
 85357  	if _pIdx == nil {
 85358  		goto _10
 85359  	}
 85360  	func() {
 85361  		if (**XWhereTerm)(unsafe.Pointer(&_pLoop.XaLTermSpace)) != (**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)) {
 85362  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134629), unsafe.Pointer(&_whereShortCutØ00__func__Ø000), unsafe.Pointer(str(104858)))
 85363  			crt.X__builtin_abort(tls)
 85364  		}
 85365  	}()
 85366  	if ((int32(_pIdx.XonError) == int32(0)) || ((*XExpr)(_pIdx.XpPartIdxWhere) != nil)) || (int32(_pIdx.XnKeyCol) > int32(3)) {
 85367  		goto _8
 85368  	}
 85369  	_3_opMask = func() int32 {
 85370  		if ((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0 {
 85371  			return int32(130)
 85372  		}
 85373  		return int32(2)
 85374  	}()
 85375  	_j = int32(0)
 85376  _18:
 85377  	if _j >= int32(_pIdx.XnKeyCol) {
 85378  		goto _21
 85379  	}
 85380  	_pTerm = _sqlite3WhereFindTerm(tls, _pWC, _iCur, _j, 0, uint32(_3_opMask), _pIdx)
 85381  	if _pTerm == nil {
 85382  		goto _21
 85383  	}
 85384  	*elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j)) = _pTerm
 85385  	_j += 1
 85386  	goto _18
 85387  _21:
 85388  	if _j != int32(_pIdx.XnKeyCol) {
 85389  		goto _8
 85390  	}
 85391  	_pLoop.XwsFlags = uint32(4609)
 85392  	if (((uint32(_pIdx.XidxType>>5) << 31) >> 31) != 0) || ((_pItem.XcolUsed & (^_columnsInIndex(tls, _pIdx))) == (0)) {
 85393  		_pLoop.XwsFlags |= uint32(64)
 85394  	}
 85395  	_pLoop.XnLTerm = uint16(_j)
 85396  	(*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq = uint16(_j)
 85397  	*(**XIndex)(unsafe.Pointer(&((*t102)(unsafe.Pointer(&_pLoop.Xu)).XpIndex))) = _pIdx
 85398  	_pLoop.XrRun = int16(39)
 85399  	goto _10
 85400  _8:
 85401  	_pIdx = (*XIndex)(_pIdx.XpNext)
 85402  	goto _7
 85403  _10:
 85404  _6:
 85405  	if _pLoop.XwsFlags == 0 {
 85406  		goto _26
 85407  	}
 85408  	_pLoop.XnOut = int16(1)
 85409  	*(**XWhereLoop)(unsafe.Pointer(&(elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), 0).XpWLoop))) = _pLoop
 85410  	func() {
 85411  		if (_pWInfo.XsMaskSet.Xn) != int32(1) || _iCur != (*elem8((*int32)(unsafe.Pointer(&(_pWInfo.XsMaskSet.Xix))), 0)) {
 85412  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134657), unsafe.Pointer(&_whereShortCutØ00__func__Ø000), unsafe.Pointer(str(104892)))
 85413  			crt.X__builtin_abort(tls)
 85414  		}
 85415  	}()
 85416  	_pLoop.XmaskSelf = uint64(1)
 85417  	elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), 0).XiTabCur = _iCur
 85418  	_pWInfo.XnRowOut = int16(1)
 85419  	if _pWInfo.XpOrderBy != nil {
 85420  		_pWInfo.XnOBSat = int8((*XExprList)(_pWInfo.XpOrderBy).XnExpr)
 85421  	}
 85422  	if (int32(_pWInfo.XwctrlFlags) & int32(256)) != 0 {
 85423  		_pWInfo.XeDistinct = uint8(1)
 85424  	}
 85425  	_pLoop.XcId = int8(48)
 85426  	return int32(1)
 85427  
 85428  _26:
 85429  	return int32(0)
 85430  }
 85431  
 85432  var _whereShortCutØ00__func__Ø000 [14]int8
 85433  
 85434  func init() {
 85435  	crt.Xstrncpy(nil, &_whereShortCutØ00__func__Ø000[0], str(104946), 14)
 85436  }
 85437  
 85438  // C comment
 85439  //  /*
 85440  //  ** Return a bitmask where 1s indicate that the corresponding column of
 85441  //  ** the table is used by an index.  Only the first 63 columns are considered.
 85442  //  */
 85443  func _columnsInIndex(tls *crt.TLS, _pIdx *XIndex) (r0 uint64) {
 85444  	var _j, _1_x int32
 85445  	var _m uint64
 85446  	_m = uint64(0)
 85447  	_j = int32(_pIdx.XnColumn) - int32(1)
 85448  _0:
 85449  	if _j < int32(0) {
 85450  		goto _3
 85451  	}
 85452  	_1_x = int32(*elem52(_pIdx.XaiColumn, uintptr(_j)))
 85453  	if _1_x < int32(0) {
 85454  		goto _4
 85455  	}
 85456  	if _1_x < int32(63) {
 85457  		_m |= uint64(1) << uint(_1_x)
 85458  	}
 85459  _4:
 85460  	_j -= 1
 85461  	goto _0
 85462  _3:
 85463  	return _m
 85464  }
 85465  
 85466  // C comment
 85467  //  /*
 85468  //  ** Add all WhereLoop objects for all tables
 85469  //  */
 85470  func _whereLoopAddAll(tls *crt.TLS, _pBuilder *XWhereLoopBuilder) (r0 int32) {
 85471  	var _iTab, _rc int32
 85472  	var _mPrereq, _mPrior, _1_mUnusable uint64
 85473  	var _priorJointype uint8
 85474  	var _db *Xsqlite3
 85475  	var _pTabList *XSrcList
 85476  	var _pItem, _pEnd, _3_p *TSrcList_item
 85477  	var _pWInfo *XWhereInfo
 85478  	var _pNew *XWhereLoop
 85479  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 85480  	_mPrereq = uint64(0)
 85481  	_mPrior = uint64(0)
 85482  	_pTabList = (*XSrcList)(_pWInfo.XpTabList)
 85483  	_pEnd = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_pWInfo.XnLevel))
 85484  	_db = (*Xsqlite3)((*XParse)(_pWInfo.XpParse).Xdb)
 85485  	_rc = int32(0)
 85486  	_priorJointype = uint8(0)
 85487  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 85488  	_whereLoopInit(tls, _pNew)
 85489  	*func() **TSrcList_item { _iTab = int32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa))
 85490  _0:
 85491  	if crt.P2U(unsafe.Pointer(_pItem)) >= crt.P2U(unsafe.Pointer(_pEnd)) {
 85492  		goto _3
 85493  	}
 85494  	_1_mUnusable = 0
 85495  	_pNew.XiTab = uint8(_iTab)
 85496  	_pNew.XmaskSelf = _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _pItem.XiCursor)
 85497  	if ((int32(_pItem.Xfg.Xjointype) | int32(_priorJointype)) & int32(10)) != int32(0) {
 85498  		_mPrereq = _mPrior
 85499  	}
 85500  	_priorJointype = _pItem.Xfg.Xjointype
 85501  	if ((*XTable)(_pItem.XpTab).XnModuleArg) == 0 {
 85502  		goto _5
 85503  	}
 85504  	_3_p = elem6(_pItem, uintptr(1))
 85505  _6:
 85506  	if crt.P2U(unsafe.Pointer(_3_p)) >= crt.P2U(unsafe.Pointer(_pEnd)) {
 85507  		goto _9
 85508  	}
 85509  	if (_1_mUnusable != 0) || (int32(_3_p.Xfg.Xjointype)&int32(10)) != 0 {
 85510  		_1_mUnusable |= _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _3_p.XiCursor)
 85511  	}
 85512  	*(*uintptr)(unsafe.Pointer(&_3_p)) += uintptr(112)
 85513  	goto _6
 85514  _9:
 85515  	_rc = _whereLoopAddVirtual(tls, _pBuilder, _mPrereq, _1_mUnusable)
 85516  	goto _12
 85517  _5:
 85518  	_rc = _whereLoopAddBtree(tls, _pBuilder, _mPrereq)
 85519  _12:
 85520  	if _rc == int32(0) {
 85521  		_rc = _whereLoopAddOr(tls, _pBuilder, _mPrereq, _1_mUnusable)
 85522  	}
 85523  	_mPrior |= _pNew.XmaskSelf
 85524  	if _rc != 0 || (_db.XmallocFailed != 0) {
 85525  		goto _3
 85526  	}
 85527  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _iTab += 1; return &_pItem }())) += uintptr(112)
 85528  	goto _0
 85529  _3:
 85530  	_whereLoopClear(tls, _db, _pNew)
 85531  	return _rc
 85532  }
 85533  
 85534  // C comment
 85535  //  /*
 85536  //  ** Add all WhereLoop objects for a table of the join identified by
 85537  //  ** pBuilder->pNew->iTab.  That table is guaranteed to be a virtual table.
 85538  //  **
 85539  //  ** If there are no LEFT or CROSS JOIN joins in the query, both mPrereq and
 85540  //  ** mUnusable are set to 0. Otherwise, mPrereq is a mask of all FROM clause
 85541  //  ** entries that occur before the virtual table in the FROM clause and are
 85542  //  ** separated from it by at least one LEFT or CROSS JOIN. Similarly, the
 85543  //  ** mUnusable mask contains all FROM clause entries that occur after the
 85544  //  ** virtual table and are separated from it by at least one LEFT or
 85545  //  ** CROSS JOIN.
 85546  //  **
 85547  //  ** For example, if the query were:
 85548  //  **
 85549  //  **   ... FROM t1, t2 LEFT JOIN t3, t4, vt CROSS JOIN t5, t6;
 85550  //  **
 85551  //  ** then mPrereq corresponds to (t1, t2) and mUnusable to (t5, t6).
 85552  //  **
 85553  //  ** All the tables in mPrereq must be scanned before the current virtual
 85554  //  ** table. So any terms for which all prerequisites are satisfied by
 85555  //  ** mPrereq may be specified as "usable" in all calls to xBestIndex.
 85556  //  ** Conversely, all tables in mUnusable must be scanned after the current
 85557  //  ** virtual table, so any terms for which the prerequisites overlap with
 85558  //  ** mUnusable should always be configured as "not-usable" for xBestIndex.
 85559  //  */
 85560  func _whereLoopAddVirtual(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUnusable uint64) (r0 int32) {
 85561  	var _rc, _nConstraint, _bIn, _2_seenZero, _2_seenZeroNoIN, _5_i int32
 85562  	var _mBest, _2_mPrev, _2_mBestNoIn, _5_mNext, _6_mThis uint64
 85563  	var _mNoOmit uint16
 85564  	var _pSrc *TSrcList_item
 85565  	var _pParse *XParse
 85566  	var _pWInfo *XWhereInfo
 85567  	var _p *Xsqlite3_index_info
 85568  	var _pNew *XWhereLoop
 85569  	var _pWC *XWhereClause
 85570  	_rc = int32(0)
 85571  	func() {
 85572  		if (_mPrereq & _mUnusable) != (0) {
 85573  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133550), unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000), unsafe.Pointer(str(104960)))
 85574  			crt.X__builtin_abort(tls)
 85575  		}
 85576  	}()
 85577  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 85578  	_pParse = (*XParse)(_pWInfo.XpParse)
 85579  	_pWC = (*XWhereClause)(_pBuilder.XpWC)
 85580  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 85581  	_pSrc = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))), uintptr(_pNew.XiTab))
 85582  	func() {
 85583  		if ((*XTable)(_pSrc.XpTab).XnModuleArg) == 0 {
 85584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133556), unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000), unsafe.Pointer(str(104985)))
 85585  			crt.X__builtin_abort(tls)
 85586  		}
 85587  	}()
 85588  	_p = _allocateIndexInfo(tls, _pParse, _pWC, _mUnusable, _pSrc, (*XExprList)(_pBuilder.XpOrderBy), &_mNoOmit)
 85589  	if _p == nil {
 85590  		return _sqlite3NomemError(tls, int32(133559))
 85591  	}
 85592  	_pNew.XrSetup = 0
 85593  	_pNew.XwsFlags = uint32(1024)
 85594  	_pNew.XnLTerm = 0
 85595  	(*t106)(unsafe.Pointer(&_pNew.Xu)).XneedFree = 0
 85596  	_nConstraint = _p.XnConstraint
 85597  	if _whereLoopResize(tls, (*Xsqlite3)(_pParse.Xdb), _pNew, _nConstraint) != 0 {
 85598  		_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_p))
 85599  		return _sqlite3NomemError(tls, int32(133567))
 85600  	}
 85601  	_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, uint64(18446744073709551615), 0, _p, _mNoOmit, &_bIn)
 85602  	if _rc != int32(0) || store23(&_mBest, _pNew.Xprereq&(^_mPrereq)) == (0) {
 85603  		goto _7
 85604  	}
 85605  	_2_seenZero = int32(0)
 85606  	_2_seenZeroNoIN = int32(0)
 85607  	_2_mPrev = uint64(0)
 85608  	_2_mBestNoIn = uint64(0)
 85609  	if _bIn == 0 {
 85610  		goto _8
 85611  	}
 85612  	_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, uint64(18446744073709551615), uint16(1), _p, _mNoOmit, &_bIn)
 85613  	func() {
 85614  		if _bIn != int32(0) {
 85615  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133591), unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000), unsafe.Pointer(str(105007)))
 85616  			crt.X__builtin_abort(tls)
 85617  		}
 85618  	}()
 85619  	_2_mBestNoIn = _pNew.Xprereq & (^_mPrereq)
 85620  	if _2_mBestNoIn == (0) {
 85621  		_2_seenZero = int32(1)
 85622  		_2_seenZeroNoIN = int32(1)
 85623  	}
 85624  _8:
 85625  	if _rc != int32(0) {
 85626  		goto _13
 85627  	}
 85628  	_5_mNext = uint64(18446744073709551615)
 85629  	func() {
 85630  		if _5_mNext <= (0) {
 85631  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133604), unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000), unsafe.Pointer(str(105014)))
 85632  			crt.X__builtin_abort(tls)
 85633  		}
 85634  	}()
 85635  	_5_i = int32(0)
 85636  _16:
 85637  	if _5_i >= _nConstraint {
 85638  		goto _19
 85639  	}
 85640  	_6_mThis = (elem101((*XWhereTerm)(_pWC.Xa), uintptr(elem107((*Tsqlite3_index_constraint)(_p.XaConstraint), uintptr(_5_i)).XiTermOffset)).XprereqRight) & (^_mPrereq)
 85641  	if (_6_mThis > _2_mPrev) && (_6_mThis < _5_mNext) {
 85642  		_5_mNext = _6_mThis
 85643  	}
 85644  	_5_i += 1
 85645  	goto _16
 85646  _19:
 85647  	_2_mPrev = _5_mNext
 85648  	if _5_mNext == uint64(18446744073709551615) {
 85649  		goto _13
 85650  	}
 85651  	if (_5_mNext == _mBest) || (_5_mNext == _2_mBestNoIn) {
 85652  		goto _8
 85653  	}
 85654  	_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _5_mNext|_mPrereq, 0, _p, _mNoOmit, &_bIn)
 85655  	if _pNew.Xprereq != _mPrereq {
 85656  		goto _25
 85657  	}
 85658  	_2_seenZero = int32(1)
 85659  	if _bIn == int32(0) {
 85660  		_2_seenZeroNoIN = int32(1)
 85661  	}
 85662  _25:
 85663  	goto _8
 85664  _13:
 85665  	if _rc != int32(0) || _2_seenZero != int32(0) {
 85666  		goto _28
 85667  	}
 85668  	_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _mPrereq, 0, _p, _mNoOmit, &_bIn)
 85669  	if _bIn == int32(0) {
 85670  		_2_seenZeroNoIN = int32(1)
 85671  	}
 85672  _28:
 85673  	if (_rc == int32(0)) && (_2_seenZeroNoIN == int32(0)) {
 85674  		_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _mPrereq, uint16(1), _p, _mNoOmit, &_bIn)
 85675  	}
 85676  _7:
 85677  	if _p.XneedToFreeIdxStr != 0 {
 85678  		Xsqlite3_free(tls, unsafe.Pointer(_p.XidxStr))
 85679  	}
 85680  	_sqlite3DbFreeNN(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_p))
 85681  	return _rc
 85682  }
 85683  
 85684  var _whereLoopAddVirtualØ00__func__Ø000 [20]int8
 85685  
 85686  func init() {
 85687  	crt.Xstrncpy(nil, &_whereLoopAddVirtualØ00__func__Ø000[0], str(105022), 20)
 85688  }
 85689  
 85690  // C comment
 85691  //  /*
 85692  //  ** Allocate and populate an sqlite3_index_info structure. It is the
 85693  //  ** responsibility of the caller to eventually release the structure
 85694  //  ** by passing the pointer returned by this function to sqlite3_free().
 85695  //  */
 85696  func _allocateIndexInfo(tls *crt.TLS, _pParse *XParse, _pWC *XWhereClause, _mUnusable uint64, _pSrc *TSrcList_item, _pOrderBy *XExprList, _pmNoOmit *uint16) (r0 *Xsqlite3_index_info) {
 85697  	var _i, _j, _nTerm, _nOrderBy, _2_n int32
 85698  	var _mNoOmit uint16
 85699  	var _6_op uint8
 85700  	var _3_pExpr, _9_pExpr *XExpr
 85701  	var _pIdxInfo *Xsqlite3_index_info
 85702  	var _pIdxCons *Tsqlite3_index_constraint
 85703  	var _pUsage *Tsqlite3_index_constraint_usage
 85704  	var _pTerm *XWhereTerm
 85705  	var _pIdxOrderBy *Tsqlite3_index_orderby
 85706  	_mNoOmit = uint16(0)
 85707  	*func() **XWhereTerm { _i = store2(&_nTerm, int32(0)); return &_pTerm }() = (*XWhereTerm)(_pWC.Xa)
 85708  _0:
 85709  	if _i >= _pWC.XnTerm {
 85710  		goto _3
 85711  	}
 85712  	if _pTerm.XleftCursor != _pSrc.XiCursor {
 85713  		goto _1
 85714  	}
 85715  	if (_pTerm.XprereqRight & _mUnusable) != 0 {
 85716  		goto _1
 85717  	}
 85718  	func() {
 85719  		if ((int32(_pTerm.XeOperator) & int32(-2049)) & ((int32(_pTerm.XeOperator) & int32(-2049)) - int32(1))) != int32(0) {
 85720  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131246), unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000), unsafe.Pointer(str(105042)))
 85721  			crt.X__builtin_abort(tls)
 85722  		}
 85723  	}()
 85724  	if (int32(_pTerm.XeOperator) & int32(-2433)) == int32(0) {
 85725  		goto _1
 85726  	}
 85727  	if (int32(_pTerm.XwtFlags) & int32(0)) != 0 {
 85728  		goto _1
 85729  	}
 85730  	func() {
 85731  		if (*(*int32)(unsafe.Pointer(&_pTerm.Xu))) < int32(-1) {
 85732  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131253), unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000), unsafe.Pointer(str(105085)))
 85733  			crt.X__builtin_abort(tls)
 85734  		}
 85735  	}()
 85736  	_nTerm += 1
 85737  _1:
 85738  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i += 1; return &_pTerm }())) += uintptr(64)
 85739  	goto _0
 85740  _3:
 85741  	_nOrderBy = int32(0)
 85742  	if _pOrderBy == nil {
 85743  		goto _12
 85744  	}
 85745  	_2_n = _pOrderBy.XnExpr
 85746  	_i = int32(0)
 85747  _13:
 85748  	if _i >= _2_n {
 85749  		goto _16
 85750  	}
 85751  	_3_pExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr)
 85752  	if (int32(_3_pExpr.Xop) != int32(152)) || (_3_pExpr.XiTable != _pSrc.XiCursor) {
 85753  		goto _16
 85754  	}
 85755  	_i += 1
 85756  	goto _13
 85757  _16:
 85758  	if _i == _2_n {
 85759  		_nOrderBy = _2_n
 85760  	}
 85761  _12:
 85762  	_pIdxInfo = (*Xsqlite3_index_info)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), (uint64(96)+(uint64(20)*uint64(_nTerm)))+(uint64(8)*uint64(_nOrderBy))))
 85763  	if _pIdxInfo == nil {
 85764  		_sqlite3ErrorMsg(tls, _pParse, str(59395))
 85765  		return nil
 85766  	}
 85767  	_pIdxCons = (*Tsqlite3_index_constraint)(unsafe.Pointer(elem108(_pIdxInfo, uintptr(1))))
 85768  	_pIdxOrderBy = (*Tsqlite3_index_orderby)(unsafe.Pointer(elem107(_pIdxCons, uintptr(_nTerm))))
 85769  	_pUsage = (*Tsqlite3_index_constraint_usage)(unsafe.Pointer(elem109(_pIdxOrderBy, uintptr(_nOrderBy))))
 85770  	_pIdxInfo.XnConstraint = _nTerm
 85771  	_pIdxInfo.XnOrderBy = _nOrderBy
 85772  	*(**Tsqlite3_index_constraint)(unsafe.Pointer(&_pIdxInfo.XaConstraint)) = _pIdxCons
 85773  	*(**Tsqlite3_index_orderby)(unsafe.Pointer(&_pIdxInfo.XaOrderBy)) = _pIdxOrderBy
 85774  	*(**Tsqlite3_index_constraint_usage)(unsafe.Pointer(&_pIdxInfo.XaConstraintUsage)) = _pUsage
 85775  	*func() **XWhereTerm { _i = store2(&_j, int32(0)); return &_pTerm }() = (*XWhereTerm)(_pWC.Xa)
 85776  _21:
 85777  	if _i >= _pWC.XnTerm {
 85778  		goto _24
 85779  	}
 85780  	if _pTerm.XleftCursor != _pSrc.XiCursor {
 85781  		goto _22
 85782  	}
 85783  	if (_pTerm.XprereqRight & _mUnusable) != 0 {
 85784  		goto _22
 85785  	}
 85786  	func() {
 85787  		if ((int32(_pTerm.XeOperator) & int32(-2049)) & ((int32(_pTerm.XeOperator) & int32(-2049)) - int32(1))) != int32(0) {
 85788  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131302), unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000), unsafe.Pointer(str(105042)))
 85789  			crt.X__builtin_abort(tls)
 85790  		}
 85791  	}()
 85792  	if (int32(_pTerm.XeOperator) & int32(-2433)) == int32(0) {
 85793  		goto _22
 85794  	}
 85795  	if (int32(_pTerm.XwtFlags) & int32(0)) != 0 {
 85796  		goto _22
 85797  	}
 85798  	func() {
 85799  		if (*(*int32)(unsafe.Pointer(&_pTerm.Xu))) < int32(-1) {
 85800  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131309), unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000), unsafe.Pointer(str(105085)))
 85801  			crt.X__builtin_abort(tls)
 85802  		}
 85803  	}()
 85804  	elem107(_pIdxCons, uintptr(_j)).XiColumn = *(*int32)(unsafe.Pointer(&_pTerm.Xu))
 85805  	elem107(_pIdxCons, uintptr(_j)).XiTermOffset = _i
 85806  	_6_op = uint8(int32(uint8(_pTerm.XeOperator)) & int32(8191))
 85807  	if int32(_6_op) == int32(1) {
 85808  		_6_op = uint8(2)
 85809  	}
 85810  	if int32(_6_op) == int32(64) {
 85811  		_6_op = _pTerm.XeMatchOp
 85812  	}
 85813  	elem107(_pIdxCons, uintptr(_j)).Xop = _6_op
 85814  
 85815  	func() {
 85816  		if (int32(_pTerm.XeOperator) & int32(127)) == 0 {
 85817  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131327), unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000), unsafe.Pointer(str(105111)))
 85818  			crt.X__builtin_abort(tls)
 85819  		}
 85820  	}()
 85821  	if (int32(_6_op)&int32(60)) == 0 || _sqlite3ExprIsVector(tls, (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)) == 0 {
 85822  		goto _38
 85823  	}
 85824  	if _i < int32(16) {
 85825  		{
 85826  			p := &_mNoOmit
 85827  			*p = uint16(int32(*p) | (int32(1) << uint(_i)))
 85828  		}
 85829  	}
 85830  	if int32(_6_op) == int32(16) {
 85831  		elem107(_pIdxCons, uintptr(_j)).Xop = uint8(8)
 85832  	}
 85833  	if int32(_6_op) == int32(4) {
 85834  		elem107(_pIdxCons, uintptr(_j)).Xop = uint8(32)
 85835  	}
 85836  _38:
 85837  	_j += 1
 85838  _22:
 85839  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i += 1; return &_pTerm }())) += uintptr(64)
 85840  	goto _21
 85841  _24:
 85842  	_i = int32(0)
 85843  _42:
 85844  	if _i >= _nOrderBy {
 85845  		goto _45
 85846  	}
 85847  	_9_pExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr)
 85848  	elem109(_pIdxOrderBy, uintptr(_i)).XiColumn = int32(_9_pExpr.XiColumn)
 85849  	elem109(_pIdxOrderBy, uintptr(_i)).Xdesc = elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XsortOrder
 85850  	_i += 1
 85851  	goto _42
 85852  _45:
 85853  	*_pmNoOmit = _mNoOmit
 85854  	return _pIdxInfo
 85855  }
 85856  
 85857  var _allocateIndexInfoØ00__func__Ø000 [18]int8
 85858  
 85859  func init() {
 85860  	crt.Xstrncpy(nil, &_allocateIndexInfoØ00__func__Ø000[0], str(105177), 18)
 85861  }
 85862  
 85863  // C comment
 85864  //  /*
 85865  //  ** Increase the memory allocation for pLoop->aLTerm[] to be at least n.
 85866  //  */
 85867  func _whereLoopResize(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop, _n int32) (r0 int32) {
 85868  	var _paNew **XWhereTerm
 85869  	if int32(_p.XnLSlot) >= _n {
 85870  		return int32(0)
 85871  	}
 85872  	_n = (_n + int32(7)) & int32(-8)
 85873  	_paNew = (**XWhereTerm)(_sqlite3DbMallocRawNN(tls, _db, uint64(8)*uint64(_n)))
 85874  	if _paNew == nil {
 85875  		return _sqlite3NomemError(tls, int32(132201))
 85876  	}
 85877  	crt.Xmemcpy(tls, unsafe.Pointer(_paNew), unsafe.Pointer(_p.XaLTerm), uint64(8)*uint64(_p.XnLSlot))
 85878  	if (**XWhereTerm)(unsafe.Pointer(_p.XaLTerm)) != (**XWhereTerm)(unsafe.Pointer(&_p.XaLTermSpace)) {
 85879  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p.XaLTerm))
 85880  	}
 85881  	*(***XWhereTerm)(unsafe.Pointer(&_p.XaLTerm)) = _paNew
 85882  	_p.XnLSlot = uint16(_n)
 85883  	return int32(0)
 85884  }
 85885  
 85886  // C comment
 85887  //  /*
 85888  //  ** Argument pIdxInfo is already populated with all constraints that may
 85889  //  ** be used by the virtual table identified by pBuilder->pNew->iTab. This
 85890  //  ** function marks a subset of those constraints usable, invokes the
 85891  //  ** xBestIndex method and adds the returned plan to pBuilder.
 85892  //  **
 85893  //  ** A constraint is marked usable if:
 85894  //  **
 85895  //  **   * Argument mUsable indicates that its prerequisites are available, and
 85896  //  **
 85897  //  **   * It is not one of the operators specified in the mExclude mask passed
 85898  //  **     as the fourth argument (which in practice is either WO_IN or 0).
 85899  //  **
 85900  //  ** Argument mPrereq is a mask of tables that must be scanned before the
 85901  //  ** virtual table in question. These are added to the plans prerequisites
 85902  //  ** before it is added to pBuilder.
 85903  //  **
 85904  //  ** Output parameter *pbIn is set to true if the plan added to pBuilder
 85905  //  ** uses one or more WO_IN terms, or false otherwise.
 85906  //  */
 85907  func _whereLoopAddVirtualOne(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUsable uint64, _mExclude uint16, _pIdxInfo *Xsqlite3_index_info, _mNoOmit uint16, _pbIn *int32) (r0 int32) {
 85908  	var _i, _mxTerm, _rc, _nConstraint, _3_iTerm, _4_j int32
 85909  	var _pSrc *TSrcList_item
 85910  	var _pParse *XParse
 85911  	var _pIdxCons *Tsqlite3_index_constraint
 85912  	var _pUsage *Tsqlite3_index_constraint_usage
 85913  	var _pNew *XWhereLoop
 85914  	var _1_pTerm, _4_pTerm *XWhereTerm
 85915  	var _pWC *XWhereClause
 85916  	_pWC = (*XWhereClause)(_pBuilder.XpWC)
 85917  	_pUsage = (*Tsqlite3_index_constraint_usage)(_pIdxInfo.XaConstraintUsage)
 85918  	_rc = int32(0)
 85919  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 85920  	_pParse = (*XParse)((*XWhereInfo)(_pBuilder.XpWInfo).XpParse)
 85921  	_pSrc = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)((*XWhereInfo)(_pBuilder.XpWInfo).XpTabList).Xa))), uintptr(_pNew.XiTab))
 85922  	_nConstraint = _pIdxInfo.XnConstraint
 85923  	func() {
 85924  		if (_mUsable & _mPrereq) != _mPrereq {
 85925  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133399), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105195)))
 85926  			crt.X__builtin_abort(tls)
 85927  		}
 85928  	}()
 85929  	*_pbIn = int32(0)
 85930  	_pNew.Xprereq = _mPrereq
 85931  	_pIdxCons = *(**Tsqlite3_index_constraint)(unsafe.Pointer(&_pIdxInfo.XaConstraint))
 85932  	_i = int32(0)
 85933  _2:
 85934  	if _i >= _nConstraint {
 85935  		goto _5
 85936  	}
 85937  	_1_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_pIdxCons.XiTermOffset))
 85938  	_pIdxCons.Xusable = 0
 85939  	if ((_1_pTerm.XprereqRight & _mUsable) == _1_pTerm.XprereqRight) && ((int32(_1_pTerm.XeOperator) & int32(_mExclude)) == int32(0)) {
 85940  		_pIdxCons.Xusable = uint8(1)
 85941  	}
 85942  	*(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pIdxCons }())) += uintptr(12)
 85943  	goto _2
 85944  _5:
 85945  	crt.Xmemset(tls, unsafe.Pointer(_pUsage), int32(0), uint64(8)*uint64(_nConstraint))
 85946  	func() {
 85947  		if _pIdxInfo.XneedToFreeIdxStr != int32(0) {
 85948  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133418), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105224)))
 85949  			crt.X__builtin_abort(tls)
 85950  		}
 85951  	}()
 85952  	_pIdxInfo.XidxStr = nil
 85953  	_pIdxInfo.XidxNum = int32(0)
 85954  	_pIdxInfo.XorderByConsumed = int32(0)
 85955  	_pIdxInfo.XestimatedCost = float64(5e+98)
 85956  	_pIdxInfo.XestimatedRows = int64(25)
 85957  	_pIdxInfo.XidxFlags = int32(0)
 85958  	_pIdxInfo.XcolUsed = uint64(int64(_pSrc.XcolUsed))
 85959  	_rc = _vtabBestIndex(tls, _pParse, (*XTable)(_pSrc.XpTab), _pIdxInfo)
 85960  	if _rc != 0 {
 85961  		return _rc
 85962  	}
 85963  	_mxTerm = int32(-1)
 85964  	func() {
 85965  		if int32(_pNew.XnLSlot) < _nConstraint {
 85966  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133432), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105254)))
 85967  			crt.X__builtin_abort(tls)
 85968  		}
 85969  	}()
 85970  	_i = int32(0)
 85971  _13:
 85972  	if _i >= _nConstraint {
 85973  		goto _16
 85974  	}
 85975  	*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(_i)) = nil
 85976  	_i += 1
 85977  	goto _13
 85978  _16:
 85979  	(*t106)(unsafe.Pointer(&_pNew.Xu)).XomitMask = 0
 85980  	_pIdxCons = *(**Tsqlite3_index_constraint)(unsafe.Pointer(&_pIdxInfo.XaConstraint))
 85981  	_i = int32(0)
 85982  _17:
 85983  	if _i >= _nConstraint {
 85984  		goto _20
 85985  	}
 85986  	if store2(&_3_iTerm, (elem97(_pUsage, uintptr(_i)).XargvIndex)-int32(1)) < int32(0) {
 85987  		goto _21
 85988  	}
 85989  	_4_j = _pIdxCons.XiTermOffset
 85990  	if ((((_3_iTerm >= _nConstraint) || (_4_j < int32(0))) || (_4_j >= _pWC.XnTerm)) || ((*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(_3_iTerm))) != nil)) || (int32(_pIdxCons.Xusable) == int32(0)) {
 85991  		_rc = int32(1)
 85992  		_sqlite3ErrorMsg(tls, _pParse, str(105280), unsafe.Pointer((*XTable)(_pSrc.XpTab).XzName))
 85993  		return _rc
 85994  	}
 85995  	_4_pTerm = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_4_j))
 85996  	_pNew.Xprereq |= _4_pTerm.XprereqRight
 85997  	func() {
 85998  		if _3_iTerm >= int32(_pNew.XnLSlot) {
 85999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133456), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105306)))
 86000  			crt.X__builtin_abort(tls)
 86001  		}
 86002  	}()
 86003  	*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(_3_iTerm)) = _4_pTerm
 86004  	if _3_iTerm > _mxTerm {
 86005  		_mxTerm = _3_iTerm
 86006  	}
 86007  	if (_3_iTerm < int32(16)) && ((elem97(_pUsage, uintptr(_i)).Xomit) != 0) {
 86008  		{
 86009  			p := &((*t106)(unsafe.Pointer(&_pNew.Xu)).XomitMask)
 86010  			*p = uint16(int32(*p) | (int32(1) << uint(_3_iTerm)))
 86011  		}
 86012  	}
 86013  	if (int32(_4_pTerm.XeOperator) & int32(1)) != int32(0) {
 86014  		_pIdxInfo.XorderByConsumed = int32(0)
 86015  		_pIdxInfo.XidxFlags &= int32(-2)
 86016  		*_pbIn = int32(1)
 86017  		func() {
 86018  			if (int32(_mExclude) & int32(1)) != int32(0) {
 86019  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133470), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105325)))
 86020  				crt.X__builtin_abort(tls)
 86021  			}
 86022  		}()
 86023  	}
 86024  _21:
 86025  	*(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pIdxCons }())) += uintptr(12)
 86026  	goto _17
 86027  _20:
 86028  	{
 86029  		p := &((*t106)(unsafe.Pointer(&_pNew.Xu)).XomitMask)
 86030  		*p = uint16(int32(*p) & (^int32(_mNoOmit)))
 86031  	}
 86032  	_pNew.XnLTerm = uint16(_mxTerm + int32(1))
 86033  	func() {
 86034  		if int32(_pNew.XnLTerm) > int32(_pNew.XnLSlot) {
 86035  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133477), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105347)))
 86036  			crt.X__builtin_abort(tls)
 86037  		}
 86038  	}()
 86039  	(*t106)(unsafe.Pointer(&_pNew.Xu)).XidxNum = _pIdxInfo.XidxNum
 86040  	(*t106)(unsafe.Pointer(&_pNew.Xu)).XneedFree = uint8(_pIdxInfo.XneedToFreeIdxStr)
 86041  	_pIdxInfo.XneedToFreeIdxStr = int32(0)
 86042  	(*t106)(unsafe.Pointer(&_pNew.Xu)).XidxStr = _pIdxInfo.XidxStr
 86043  	(*t106)(unsafe.Pointer(&_pNew.Xu)).XisOrdered = int8(func() int32 {
 86044  		if _pIdxInfo.XorderByConsumed != 0 {
 86045  			return _pIdxInfo.XnOrderBy
 86046  		}
 86047  		return int32(0)
 86048  	}())
 86049  	_pNew.XrSetup = 0
 86050  	_pNew.XrRun = _sqlite3LogEstFromDouble(tls, _pIdxInfo.XestimatedCost)
 86051  	_pNew.XnOut = _sqlite3LogEst(tls, uint64(_pIdxInfo.XestimatedRows))
 86052  	if (_pIdxInfo.XidxFlags & int32(1)) != 0 {
 86053  		_pNew.XwsFlags |= uint32(4096)
 86054  		goto _40
 86055  	}
 86056  	_pNew.XwsFlags &= uint32(4294963199)
 86057  _40:
 86058  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 86059  	if ((*t106)(unsafe.Pointer(&_pNew.Xu)).XneedFree) != 0 {
 86060  		Xsqlite3_free(tls, unsafe.Pointer((*t106)(unsafe.Pointer(&_pNew.Xu)).XidxStr))
 86061  		(*t106)(unsafe.Pointer(&_pNew.Xu)).XneedFree = 0
 86062  	}
 86063  	return _rc
 86064  }
 86065  
 86066  var _whereLoopAddVirtualOneØ00__func__Ø000 [23]int8
 86067  
 86068  func init() {
 86069  	crt.Xstrncpy(nil, &_whereLoopAddVirtualOneØ00__func__Ø000[0], str(105374), 23)
 86070  }
 86071  
 86072  // C comment
 86073  //  /*
 86074  //  ** The table object reference passed as the second argument to this function
 86075  //  ** must represent a virtual table. This function invokes the xBestIndex()
 86076  //  ** method of the virtual table with the sqlite3_index_info object that
 86077  //  ** comes in as the 3rd argument to this function.
 86078  //  **
 86079  //  ** If an error occurs, pParse is populated with an error message and a
 86080  //  ** non-zero value is returned. Otherwise, 0 is returned and the output
 86081  //  ** part of the sqlite3_index_info structure is left populated.
 86082  //  **
 86083  //  ** Whether or not an error is returned, it is the responsibility of the
 86084  //  ** caller to eventually free p->idxStr if p->needToFreeIdxStr indicates
 86085  //  ** that this is required.
 86086  //  */
 86087  func _vtabBestIndex(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _p *Xsqlite3_index_info) (r0 int32) {
 86088  	var _rc int32
 86089  	var _pVtab *Xsqlite3_vtab
 86090  	_pVtab = (*Xsqlite3_vtab)(_sqlite3GetVTable(tls, (*Xsqlite3)(_pParse.Xdb), _pTab).XpVtab)
 86091  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32 {
 86092  		v := (*Xsqlite3_module)(_pVtab.XpModule).XxBestIndex
 86093  		return *(*func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32)(unsafe.Pointer(&v))
 86094  	}()(tls, _pVtab, _p)
 86095  	if _rc == int32(0) {
 86096  		goto _0
 86097  	}
 86098  	if _rc == int32(7) {
 86099  		_sqlite3OomFault(tls, (*Xsqlite3)(_pParse.Xdb))
 86100  		goto _4
 86101  	}
 86102  	if _pVtab.XzErrMsg == nil {
 86103  		_sqlite3ErrorMsg(tls, _pParse, str(24531), unsafe.Pointer(_sqlite3ErrStr(tls, _rc)))
 86104  		goto _4
 86105  	}
 86106  	_sqlite3ErrorMsg(tls, _pParse, str(24531), unsafe.Pointer(_pVtab.XzErrMsg))
 86107  _4:
 86108  _0:
 86109  	Xsqlite3_free(tls, unsafe.Pointer(_pVtab.XzErrMsg))
 86110  	_pVtab.XzErrMsg = nil
 86111  	return _pParse.XnErr
 86112  }
 86113  
 86114  // C comment
 86115  //  /*
 86116  //  ** Convert a double into a LogEst
 86117  //  ** In other words, compute an approximation for 10*log2(x).
 86118  //  */
 86119  func _sqlite3LogEstFromDouble(tls *crt.TLS, _x float64) (r0 int16) {
 86120  	var _e int16
 86121  	var _a uint64
 86122  
 86123  	if _x <= (1) {
 86124  		return 0
 86125  	}
 86126  	if _x <= (2e+09) {
 86127  		return _sqlite3LogEst(tls, uint64(_x))
 86128  	}
 86129  	crt.Xmemcpy(tls, unsafe.Pointer(&_a), unsafe.Pointer(&_x), uint64(8))
 86130  	_e = int16((_a >> 52) - uint64(1022))
 86131  	return int16(int32(_e) * int32(10))
 86132  }
 86133  
 86134  // C comment
 86135  //  /*
 86136  //  ** Insert or replace a WhereLoop entry using the template supplied.
 86137  //  **
 86138  //  ** An existing WhereLoop entry might be overwritten if the new template
 86139  //  ** is better and has fewer dependencies.  Or the template will be ignored
 86140  //  ** and no insert will occur if an existing WhereLoop is faster and has
 86141  //  ** fewer dependencies than the template.  Otherwise a new WhereLoop is
 86142  //  ** added based on the template.
 86143  //  **
 86144  //  ** If pBuilder->pOrSet is not NULL then we care about only the
 86145  //  ** prerequisites and rRun and nOut costs of the N best loops.  That
 86146  //  ** information is gathered in the pBuilder->pOrSet object.  This special
 86147  //  ** processing mode is used only for OR clause processing.
 86148  //  **
 86149  //  ** When accumulating multiple loops (when pBuilder->pOrSet is NULL) we
 86150  //  ** still might overwrite similar loops with the new template if the
 86151  //  ** new template is better.  Loops may be overwritten if the following
 86152  //  ** conditions are met:
 86153  //  **
 86154  //  **    (1)  They have the same iTab.
 86155  //  **    (2)  They have the same iSortIdx.
 86156  //  **    (3)  The template has same or fewer dependencies than the current loop
 86157  //  **    (4)  The template has the same or lower cost than the current loop
 86158  //  */
 86159  func _whereLoopInsert(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pTemplate *XWhereLoop) (r0 int32) {
 86160  	var _rc int32
 86161  	var _db *Xsqlite3
 86162  	var _8_pIndex *XIndex
 86163  	var _pWInfo *XWhereInfo
 86164  	var _p, _6_pToDel *XWhereLoop
 86165  	var _ppPrev, _6_ppTail **XWhereLoop
 86166  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 86167  	_db = (*Xsqlite3)((*XParse)(_pWInfo.XpParse).Xdb)
 86168  	if (*XWhereOrSet)(_pBuilder.XpOrSet) == nil {
 86169  		goto _0
 86170  	}
 86171  	if _pTemplate.XnLTerm != 0 {
 86172  		_whereOrInsert(tls, (*XWhereOrSet)(_pBuilder.XpOrSet), _pTemplate.Xprereq, _pTemplate.XrRun, _pTemplate.XnOut)
 86173  	}
 86174  	return int32(0)
 86175  
 86176  _0:
 86177  	_whereLoopAdjustCost(tls, (*XWhereLoop)(_pWInfo.XpLoops), _pTemplate)
 86178  	_ppPrev = _whereLoopFindLesser(tls, (**XWhereLoop)(unsafe.Pointer(&_pWInfo.XpLoops)), _pTemplate)
 86179  	if _ppPrev == nil {
 86180  		return int32(0)
 86181  	}
 86182  	_p = *_ppPrev
 86183  	if _p != nil {
 86184  		goto _4
 86185  	}
 86186  	*_ppPrev = store110(&_p, (*XWhereLoop)(_sqlite3DbMallocRawNN(tls, _db, uint64(104))))
 86187  	if _p == nil {
 86188  		return _sqlite3NomemError(tls, int32(132499))
 86189  	}
 86190  	_whereLoopInit(tls, _p)
 86191  	*(**XWhereLoop)(unsafe.Pointer(&_p.XpNextLoop)) = nil
 86192  	goto _6
 86193  _4:
 86194  	_6_ppTail = (**XWhereLoop)(unsafe.Pointer(&_p.XpNextLoop))
 86195  _7:
 86196  	if (*_6_ppTail) == nil {
 86197  		goto _8
 86198  	}
 86199  	_6_ppTail = _whereLoopFindLesser(tls, _6_ppTail, _pTemplate)
 86200  	if _6_ppTail == nil {
 86201  		goto _8
 86202  	}
 86203  	_6_pToDel = *_6_ppTail
 86204  	if _6_pToDel == nil {
 86205  		goto _8
 86206  	}
 86207  	*_6_ppTail = (*XWhereLoop)(_6_pToDel.XpNextLoop)
 86208  	_whereLoopDelete(tls, _db, _6_pToDel)
 86209  	goto _7
 86210  _8:
 86211  _6:
 86212  	_rc = _whereLoopXfer(tls, _db, _p, _pTemplate)
 86213  	if (_p.XwsFlags & uint32(1024)) != (0) {
 86214  		goto _11
 86215  	}
 86216  	_8_pIndex = (*XIndex)((*t102)(unsafe.Pointer(&_p.Xu)).XpIndex)
 86217  	if (_8_pIndex != nil) && (_8_pIndex.Xtnum == int32(0)) {
 86218  		*(**XIndex)(unsafe.Pointer(&((*t102)(unsafe.Pointer(&_p.Xu)).XpIndex))) = nil
 86219  	}
 86220  _11:
 86221  	return _rc
 86222  }
 86223  
 86224  // C comment
 86225  //  /*
 86226  //  ** Try to insert a new prerequisite/cost entry into the WhereOrSet pSet.
 86227  //  **
 86228  //  ** The new entry might overwrite an existing entry, or it might be
 86229  //  ** appended, or it might be discarded.  Do whatever is the right thing
 86230  //  ** so that pSet keeps the N_OR_COST best entries seen so far.
 86231  //  */
 86232  func _whereOrInsert(tls *crt.TLS, _pSet *XWhereOrSet, _prereq uint64, _rRun int16, _nOut int16) (r0 int32) {
 86233  	var _i uint16
 86234  	var _p *XWhereOrCost
 86235  	*func() **XWhereOrCost { _i = _pSet.Xn; return &_p }() = (*XWhereOrCost)(unsafe.Pointer(&_pSet.Xa))
 86236  _0:
 86237  	if int32(_i) <= int32(0) {
 86238  		goto _3
 86239  	}
 86240  	if (int32(_rRun) <= int32(_p.XrRun)) && ((_prereq & _p.Xprereq) == _prereq) {
 86241  		goto _whereOrInsert_done
 86242  	}
 86243  	if (int32(_p.XrRun) <= int32(_rRun)) && ((_p.Xprereq & _prereq) == _p.Xprereq) {
 86244  		return int32(0)
 86245  	}
 86246  	*(*uintptr)(unsafe.Pointer(func() **XWhereOrCost { _i -= 1; return &_p }())) += uintptr(16)
 86247  	goto _0
 86248  _3:
 86249  	if int32(_pSet.Xn) < int32(3) {
 86250  		_p = elem111((*XWhereOrCost)(unsafe.Pointer(&_pSet.Xa)), uintptr(postInc78(&_pSet.Xn, uint16(1))))
 86251  		_p.XnOut = _nOut
 86252  		goto _whereOrInsert_done
 86253  	}
 86254  	_p = (*XWhereOrCost)(unsafe.Pointer(&_pSet.Xa))
 86255  	_i = uint16(1)
 86256  _10:
 86257  	if int32(_i) >= int32(_pSet.Xn) {
 86258  		goto _13
 86259  	}
 86260  	if int32(_p.XrRun) > int32(elem111((*XWhereOrCost)(unsafe.Pointer(&_pSet.Xa)), uintptr(_i)).XrRun) {
 86261  		_p = (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pSet.Xa)) + uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(_i)*uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(16)))))))))))
 86262  	}
 86263  	_i += 1
 86264  	goto _10
 86265  _13:
 86266  	if int32(_p.XrRun) <= int32(_rRun) {
 86267  		return int32(0)
 86268  	}
 86269  _whereOrInsert_done:
 86270  	_p.Xprereq = _prereq
 86271  	_p.XrRun = _rRun
 86272  	if int32(_p.XnOut) > int32(_nOut) {
 86273  		_p.XnOut = _nOut
 86274  	}
 86275  	return int32(1)
 86276  }
 86277  
 86278  // C comment
 86279  //  /*
 86280  //  ** Try to adjust the cost of WhereLoop pTemplate upwards or downwards so
 86281  //  ** that:
 86282  //  **
 86283  //  **   (1) pTemplate costs less than any other WhereLoops that are a proper
 86284  //  **       subset of pTemplate
 86285  //  **
 86286  //  **   (2) pTemplate costs more than any other WhereLoops for which pTemplate
 86287  //  **       is a proper subset.
 86288  //  **
 86289  //  ** To say "WhereLoop X is a proper subset of Y" means that X uses fewer
 86290  //  ** WHERE clause terms than Y and that every WHERE clause term used by X is
 86291  //  ** also used by Y.
 86292  //  */
 86293  func _whereLoopAdjustCost(tls *crt.TLS, _p *XWhereLoop, _pTemplate *XWhereLoop) {
 86294  	if (_pTemplate.XwsFlags & uint32(512)) == (0) {
 86295  		return
 86296  	}
 86297  _0:
 86298  	if _p == nil {
 86299  		goto _4
 86300  	}
 86301  	if int32(_p.XiTab) != int32(_pTemplate.XiTab) {
 86302  		goto _2
 86303  	}
 86304  	if (_p.XwsFlags & uint32(512)) == (0) {
 86305  		goto _2
 86306  	}
 86307  	if _whereLoopCheaperProperSubset(tls, _p, _pTemplate) != 0 {
 86308  		_pTemplate.XrRun = _p.XrRun
 86309  		_pTemplate.XnOut = int16(int32(_p.XnOut) - int32(1))
 86310  		goto _9
 86311  	}
 86312  	if _whereLoopCheaperProperSubset(tls, _pTemplate, _p) != 0 {
 86313  		_pTemplate.XrRun = _p.XrRun
 86314  		_pTemplate.XnOut = int16(int32(_p.XnOut) + int32(1))
 86315  	}
 86316  _9:
 86317  _2:
 86318  	_p = (*XWhereLoop)(_p.XpNextLoop)
 86319  	goto _0
 86320  _4:
 86321  }
 86322  
 86323  // C comment
 86324  //  /*
 86325  //  ** Return TRUE if all of the following are true:
 86326  //  **
 86327  //  **   (1)  X has the same or lower cost that Y
 86328  //  **   (2)  X is a proper subset of Y
 86329  //  **   (3)  X skips at least as many columns as Y
 86330  //  **
 86331  //  ** By "proper subset" we mean that X uses fewer WHERE clause terms
 86332  //  ** than Y and that every WHERE clause term used by X is also used
 86333  //  ** by Y.
 86334  //  **
 86335  //  ** If X is a proper subset of Y then Y is a better choice and ought
 86336  //  ** to have a lower cost.  This routine returns TRUE when that cost
 86337  //  ** relationship is inverted and needs to be adjusted.  The third rule
 86338  //  ** was added because if X uses skip-scan less than Y it still might
 86339  //  ** deserve a lower cost even if it is a proper subset of Y.
 86340  //  */
 86341  func _whereLoopCheaperProperSubset(tls *crt.TLS, _pX *XWhereLoop, _pY *XWhereLoop) (r0 int32) {
 86342  	var _i, _j int32
 86343  	if (int32(_pX.XnLTerm) - int32(_pX.XnSkip)) >= (int32(_pY.XnLTerm) - int32(_pY.XnSkip)) {
 86344  		return int32(0)
 86345  	}
 86346  	if int32(_pY.XnSkip) > int32(_pX.XnSkip) {
 86347  		return int32(0)
 86348  	}
 86349  	if int32(_pX.XrRun) < int32(_pY.XrRun) {
 86350  		goto _2
 86351  	}
 86352  	if int32(_pX.XrRun) > int32(_pY.XrRun) {
 86353  		return int32(0)
 86354  	}
 86355  	if int32(_pX.XnOut) > int32(_pY.XnOut) {
 86356  		return int32(0)
 86357  	}
 86358  _2:
 86359  	_i = int32(_pX.XnLTerm) - int32(1)
 86360  _5:
 86361  	if _i < int32(0) {
 86362  		goto _8
 86363  	}
 86364  	if (*elem105((**XWhereTerm)(unsafe.Pointer(_pX.XaLTerm)), uintptr(_i))) == nil {
 86365  		goto _6
 86366  	}
 86367  	_j = int32(_pY.XnLTerm) - int32(1)
 86368  _10:
 86369  	if _j < int32(0) {
 86370  		goto _13
 86371  	}
 86372  	if (*elem105((**XWhereTerm)(unsafe.Pointer(_pY.XaLTerm)), uintptr(_j))) == (*elem105((**XWhereTerm)(unsafe.Pointer(_pX.XaLTerm)), uintptr(_i))) {
 86373  		goto _13
 86374  	}
 86375  	_j -= 1
 86376  	goto _10
 86377  _13:
 86378  	if _j < int32(0) {
 86379  		return int32(0)
 86380  	}
 86381  _6:
 86382  	_i -= 1
 86383  	goto _5
 86384  _8:
 86385  	return int32(1)
 86386  }
 86387  
 86388  // C comment
 86389  //  /*
 86390  //  ** Search the list of WhereLoops in *ppPrev looking for one that can be
 86391  //  ** supplanted by pTemplate.
 86392  //  **
 86393  //  ** Return NULL if the WhereLoop list contains an entry that can supplant
 86394  //  ** pTemplate, in other words if pTemplate does not belong on the list.
 86395  //  **
 86396  //  ** If pX is a WhereLoop that pTemplate can supplant, then return the
 86397  //  ** link that points to pX.
 86398  //  **
 86399  //  ** If pTemplate cannot supplant any existing element of the list but needs
 86400  //  ** to be added to the list, then return a pointer to the tail of the list.
 86401  //  */
 86402  func _whereLoopFindLesser(tls *crt.TLS, _ppPrev **XWhereLoop, _pTemplate *XWhereLoop) (r0 **XWhereLoop) {
 86403  	var _p *XWhereLoop
 86404  	_p = *_ppPrev
 86405  _0:
 86406  	if _p == nil {
 86407  		goto _3
 86408  	}
 86409  	if (int32(_p.XiTab) != int32(_pTemplate.XiTab)) || (int32(_p.XiSortIdx) != int32(_pTemplate.XiSortIdx)) {
 86410  		goto _1
 86411  	}
 86412  	func() {
 86413  		if int32(_p.XrSetup) != int32(0) && int32(_pTemplate.XrSetup) != int32(0) && int32(_p.XrSetup) != int32(_pTemplate.XrSetup) {
 86414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132363), unsafe.Pointer(&_whereLoopFindLesserØ00__func__Ø000), unsafe.Pointer(str(105397)))
 86415  			crt.X__builtin_abort(tls)
 86416  		}
 86417  	}()
 86418  	func() {
 86419  		if int32(_p.XrSetup) < int32(_pTemplate.XrSetup) {
 86420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132369), unsafe.Pointer(&_whereLoopFindLesserØ00__func__Ø000), unsafe.Pointer(str(105466)))
 86421  			crt.X__builtin_abort(tls)
 86422  		}
 86423  	}()
 86424  	if (((((_p.XwsFlags & uint32(16384)) != (0)) && (int32(_pTemplate.XnSkip) == int32(0))) && ((_pTemplate.XwsFlags & uint32(512)) != (0))) && ((_pTemplate.XwsFlags & uint32(1)) != (0))) && ((_p.Xprereq & _pTemplate.Xprereq) == _pTemplate.Xprereq) {
 86425  		goto _3
 86426  	}
 86427  	if ((((_p.Xprereq & _pTemplate.Xprereq) == _p.Xprereq) && (int32(_p.XrSetup) <= int32(_pTemplate.XrSetup))) && (int32(_p.XrRun) <= int32(_pTemplate.XrRun))) && (int32(_p.XnOut) <= int32(_pTemplate.XnOut)) {
 86428  		return nil
 86429  	}
 86430  	if (((_p.Xprereq & _pTemplate.Xprereq) == _pTemplate.Xprereq) && (int32(_p.XrRun) >= int32(_pTemplate.XrRun))) && (int32(_p.XnOut) >= int32(_pTemplate.XnOut)) {
 86431  		func() {
 86432  			if int32(_p.XrSetup) < int32(_pTemplate.XrSetup) {
 86433  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132405), unsafe.Pointer(&_whereLoopFindLesserØ00__func__Ø000), unsafe.Pointer(str(105466)))
 86434  				crt.X__builtin_abort(tls)
 86435  			}
 86436  		}()
 86437  		goto _3
 86438  	}
 86439  _1:
 86440  	*func() **XWhereLoop { _ppPrev = (**XWhereLoop)(unsafe.Pointer(&_p.XpNextLoop)); return &_p }() = *_ppPrev
 86441  	goto _0
 86442  _3:
 86443  	return _ppPrev
 86444  }
 86445  
 86446  var _whereLoopFindLesserØ00__func__Ø000 [20]int8
 86447  
 86448  func init() {
 86449  	crt.Xstrncpy(nil, &_whereLoopFindLesserØ00__func__Ø000[0], str(105495), 20)
 86450  }
 86451  
 86452  // C comment
 86453  //  /*
 86454  //  ** Delete a WhereLoop object
 86455  //  */
 86456  func _whereLoopDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) {
 86457  	_whereLoopClear(tls, _db, _p)
 86458  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 86459  }
 86460  
 86461  // C comment
 86462  //  /*
 86463  //  ** Deallocate internal memory used by a WhereLoop object
 86464  //  */
 86465  func _whereLoopClear(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) {
 86466  	if (**XWhereTerm)(unsafe.Pointer(_p.XaLTerm)) != (**XWhereTerm)(unsafe.Pointer(&_p.XaLTermSpace)) {
 86467  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p.XaLTerm))
 86468  	}
 86469  	_whereLoopClearUnion(tls, _db, _p)
 86470  	_whereLoopInit(tls, _p)
 86471  }
 86472  
 86473  // C comment
 86474  //  /*
 86475  //  ** Clear the WhereLoop.u union.  Leave WhereLoop.pLTerm intact.
 86476  //  */
 86477  func _whereLoopClearUnion(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) {
 86478  	if (_p.XwsFlags & uint32(17408)) == 0 {
 86479  		goto _0
 86480  	}
 86481  	if ((_p.XwsFlags & uint32(1024)) != (0)) && (((*t106)(unsafe.Pointer(&_p.Xu)).XneedFree) != 0) {
 86482  		Xsqlite3_free(tls, unsafe.Pointer((*t106)(unsafe.Pointer(&_p.Xu)).XidxStr))
 86483  		(*t106)(unsafe.Pointer(&_p.Xu)).XneedFree = 0
 86484  		(*t106)(unsafe.Pointer(&_p.Xu)).XidxStr = nil
 86485  		goto _5
 86486  	}
 86487  	if ((_p.XwsFlags & uint32(16384)) != (0)) && ((*XIndex)((*t102)(unsafe.Pointer(&_p.Xu)).XpIndex) != nil) {
 86488  		_sqlite3DbFree(tls, _db, unsafe.Pointer((*XIndex)((*t102)(unsafe.Pointer(&_p.Xu)).XpIndex).XzColAff))
 86489  		_sqlite3DbFreeNN(tls, _db, (*t102)(unsafe.Pointer(&_p.Xu)).XpIndex)
 86490  		*(**XIndex)(unsafe.Pointer(&((*t102)(unsafe.Pointer(&_p.Xu)).XpIndex))) = nil
 86491  	}
 86492  _5:
 86493  _0:
 86494  }
 86495  
 86496  // C comment
 86497  //  /*
 86498  //  ** Transfer content from the second pLoop into the first.
 86499  //  */
 86500  func _whereLoopXfer(tls *crt.TLS, _db *Xsqlite3, _pTo *XWhereLoop, _pFrom *XWhereLoop) (r0 int32) {
 86501  	_whereLoopClearUnion(tls, _db, _pTo)
 86502  	if _whereLoopResize(tls, _db, _pTo, int32(_pFrom.XnLTerm)) != 0 {
 86503  		crt.Xmemset(tls, unsafe.Pointer(&_pTo.Xu), int32(0), uint64(16))
 86504  		return _sqlite3NomemError(tls, int32(132216))
 86505  	}
 86506  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), uint64(56))
 86507  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo.XaLTerm), unsafe.Pointer(_pFrom.XaLTerm), uint64(_pTo.XnLTerm)*uint64(8))
 86508  	if (_pFrom.XwsFlags & uint32(1024)) != 0 {
 86509  		(*t106)(unsafe.Pointer(&_pFrom.Xu)).XneedFree = 0
 86510  		goto _3
 86511  	}
 86512  	if (_pFrom.XwsFlags & uint32(16384)) != (0) {
 86513  		*(**XIndex)(unsafe.Pointer(&((*t102)(unsafe.Pointer(&_pFrom.Xu)).XpIndex))) = nil
 86514  	}
 86515  _3:
 86516  	return int32(0)
 86517  }
 86518  
 86519  // C comment
 86520  //  /*
 86521  //  ** Add all WhereLoop objects for a single table of the join where the table
 86522  //  ** is identified by pBuilder->pNew->iTab.  That table is guaranteed to be
 86523  //  ** a b-tree table, not a virtual table.
 86524  //  **
 86525  //  ** The costs (WhereLoop.rRun) of the b-tree loops added by this function
 86526  //  ** are calculated as follows:
 86527  //  **
 86528  //  ** For a full scan, assuming the table (or index) contains nRow rows:
 86529  //  **
 86530  //  **     cost = nRow * 3.0                    // full-table scan
 86531  //  **     cost = nRow * K                      // scan of covering index
 86532  //  **     cost = nRow * (K+3.0)                // scan of non-covering index
 86533  //  **
 86534  //  ** where K is a value between 1.1 and 3.0 set based on the relative
 86535  //  ** estimated average size of the index and table records.
 86536  //  **
 86537  //  ** For an index scan, where nVisit is the number of index rows visited
 86538  //  ** by the scan, and nSeek is the number of seek operations required on
 86539  //  ** the index b-tree:
 86540  //  **
 86541  //  **     cost = nSeek * (log(nRow) + K * nVisit)          // covering index
 86542  //  **     cost = nSeek * (log(nRow) + (K+3.0) * nVisit)    // non-covering index
 86543  //  **
 86544  //  ** Normally, nSeek is 1. nSeek values greater than 1 come about if the
 86545  //  ** WHERE clause includes "x IN (....)" terms used in place of "x=?". Or when
 86546  //  ** implicit "x IN (SELECT x FROM tbl)" terms are added for skip-scans.
 86547  //  **
 86548  //  ** The estimated values (nRow, nVisit, nSeek) often contain a large amount
 86549  //  ** of uncertainty.  For this reason, scoring is designed to pick plans that
 86550  //  ** "do the least harm" if the estimates are inaccurate.  For example, a
 86551  //  ** log(nRow) factor is omitted from a non-covering index scan in order to
 86552  //  ** bias the scoring in favor of using an index, since the worst-case
 86553  //  ** performance of using an index is far better than the worst-case performance
 86554  //  ** of a full table scan.
 86555  //  */
 86556  func _whereLoopAddBtree(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64) (r0 int32) {
 86557  	var _aiColumnPk, _rSize, _rLogSize, _16_nLookup int16
 86558  	var _rc, _iSortIdx, _b, _16_ii, _16_iCur int32
 86559  	var _12_m uint64
 86560  	var _pTab *XTable
 86561  	var _pTabList *XSrcList
 86562  	var _pSrc *TSrcList_item
 86563  	var _pProbe, _3_pFirst *XIndex
 86564  	var _sPk XIndex
 86565  	var _pWInfo *XWhereInfo
 86566  	var _pNew *XWhereLoop
 86567  	var _5_pTerm, _5_pWCEnd, _17_pTerm *XWhereTerm
 86568  	var _pWC, _16_pWC2 *XWhereClause
 86569  	var _aiRowEstPk [2]int16
 86570  	_aiColumnPk = int16(-1)
 86571  	_rc = int32(0)
 86572  	_iSortIdx = int32(1)
 86573  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 86574  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 86575  	_pTabList = (*XSrcList)(_pWInfo.XpTabList)
 86576  	_pSrc = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pTabList.Xa)) + uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(_pNew.XiTab)*uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(112)))))))))))
 86577  	_pTab = (*XTable)(_pSrc.XpTab)
 86578  	_pWC = (*XWhereClause)(_pBuilder.XpWC)
 86579  	func() {
 86580  		if ((*XTable)(_pSrc.XpTab).XnModuleArg) != 0 {
 86581  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133153), unsafe.Pointer(&_whereLoopAddBtreeØ00__func__Ø000), unsafe.Pointer(str(105515)))
 86582  			crt.X__builtin_abort(tls)
 86583  		}
 86584  	}()
 86585  	if _pSrc.XpIBIndex != nil {
 86586  		_pProbe = (*XIndex)(_pSrc.XpIBIndex)
 86587  		goto _5
 86588  	}
 86589  	if (_pTab.XtabFlags & uint32(32)) != (0) {
 86590  		_pProbe = (*XIndex)(_pTab.XpIndex)
 86591  		goto _5
 86592  	}
 86593  	crt.Xmemset(tls, unsafe.Pointer(&_sPk), int32(0), uint64(104))
 86594  	_sPk.XnKeyCol = uint16(1)
 86595  	_sPk.XnColumn = uint16(1)
 86596  	_sPk.XaiColumn = &_aiColumnPk
 86597  	_sPk.XaiRowLogEst = (*int16)(unsafe.Pointer(&_aiRowEstPk))
 86598  	_sPk.XonError = uint8(5)
 86599  	*(**XTable)(unsafe.Pointer(&_sPk.XpTable)) = _pTab
 86600  	_sPk.XszIdxRow = _pTab.XszTabRow
 86601  	*elem52((*int16)(unsafe.Pointer(&_aiRowEstPk)), 0) = _pTab.XnRowLogEst
 86602  	*elem52((*int16)(unsafe.Pointer(&_aiRowEstPk)), uintptr(1)) = 0
 86603  	_3_pFirst = (*XIndex)((*XTable)(_pSrc.XpTab).XpIndex)
 86604  	if int32((uint32(_pSrc.Xfg.XnotIndexed)<<31)>>31) == int32(0) {
 86605  		*(**XIndex)(unsafe.Pointer(&_sPk.XpNext)) = _3_pFirst
 86606  	}
 86607  	_pProbe = &_sPk
 86608  _5:
 86609  	_rSize = _pTab.XnRowLogEst
 86610  	_rLogSize = _estLog(tls, _rSize)
 86611  	if _pBuilder.XpOrSet != nil || (int32(_pWInfo.XwctrlFlags)&int32(32)) != int32(0) || (((*Xsqlite3)((*XParse)(_pWInfo.XpParse).Xdb).Xflags)&int32(1048576)) == int32(0) || (*XIndex)(_pSrc.XpIBIndex) != nil || ((uint32(_pSrc.Xfg.XnotIndexed)<<31)>>31) != 0 || (_pTab.XtabFlags&uint32(32)) != (0) || ((uint32((_pSrc.Xfg.XnotIndexed)>>3)<<31)>>31) != 0 || ((uint32((_pSrc.Xfg.XnotIndexed)>>5)<<31)>>31) != 0 {
 86612  		goto _14
 86613  	}
 86614  	_5_pWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.Xa) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.XnTerm)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(64)))))))))))
 86615  	_5_pTerm = (*XWhereTerm)(_pWC.Xa)
 86616  _15:
 86617  	if _rc != int32(0) || crt.P2U(unsafe.Pointer(_5_pTerm)) >= crt.P2U(unsafe.Pointer(_5_pWCEnd)) {
 86618  		goto _19
 86619  	}
 86620  	if (_5_pTerm.XprereqRight & _pNew.XmaskSelf) != 0 {
 86621  		goto _16
 86622  	}
 86623  	if _termCanDriveIndex(tls, _5_pTerm, _pSrc, 0) == 0 {
 86624  		goto _21
 86625  	}
 86626  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq = uint16(1)
 86627  	_pNew.XnSkip = 0
 86628  	*(**XIndex)(unsafe.Pointer(&((*t102)(unsafe.Pointer(&_pNew.Xu)).XpIndex))) = nil
 86629  	_pNew.XnLTerm = uint16(1)
 86630  	*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), 0) = _5_pTerm
 86631  	_pNew.XrSetup = int16((int32(_rLogSize) + int32(_rSize)) + int32(4))
 86632  	if ((*XSelect)(_pTab.XpSelect) == nil) && ((_pTab.XtabFlags & uint32(2)) == (0)) {
 86633  		{
 86634  			p := &_pNew.XrSetup
 86635  			*p = int16(int32(*p) + int32(24))
 86636  		}
 86637  	}
 86638  	if int32(_pNew.XrSetup) < int32(0) {
 86639  		_pNew.XrSetup = 0
 86640  	}
 86641  	_pNew.XnOut = int16(43)
 86642  	func() {
 86643  		if int32(43) != int32(_sqlite3LogEst(tls, uint64(20))) {
 86644  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133227), unsafe.Pointer(&_whereLoopAddBtreeØ00__func__Ø000), unsafe.Pointer(str(105538)))
 86645  			crt.X__builtin_abort(tls)
 86646  		}
 86647  	}()
 86648  	_pNew.XrRun = _sqlite3LogEstAdd(tls, _rLogSize, _pNew.XnOut)
 86649  	_pNew.XwsFlags = uint32(16384)
 86650  	_pNew.Xprereq = _mPrereq | _5_pTerm.XprereqRight
 86651  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 86652  _21:
 86653  _16:
 86654  	*(*uintptr)(unsafe.Pointer(&_5_pTerm)) += uintptr(64)
 86655  	goto _15
 86656  _19:
 86657  _14:
 86658  	if _rc != int32(0) || _pProbe == nil {
 86659  		goto _31
 86660  	}
 86661  	if ((*XExpr)(_pProbe.XpPartIdxWhere) != nil) && (_whereUsablePartialIndex(tls, _pSrc.XiCursor, _pWC, (*XExpr)(_pProbe.XpPartIdxWhere)) == 0) {
 86662  		goto _28
 86663  	}
 86664  	_rSize = *elem52(_pProbe.XaiRowLogEst, 0)
 86665  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq = 0
 86666  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnBtm = 0
 86667  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnTop = 0
 86668  	_pNew.XnSkip = 0
 86669  	_pNew.XnLTerm = 0
 86670  	_pNew.XiSortIdx = 0
 86671  	_pNew.XrSetup = 0
 86672  	_pNew.Xprereq = _mPrereq
 86673  	_pNew.XnOut = _rSize
 86674  	*(**XIndex)(unsafe.Pointer(&((*t102)(unsafe.Pointer(&_pNew.Xu)).XpIndex))) = _pProbe
 86675  	_b = _indexMightHelpWithOrderBy(tls, _pBuilder, _pProbe, _pSrc.XiCursor)
 86676  	func() {
 86677  		if (int32(_pWInfo.XwctrlFlags)&int32(4)) != int32(0) && _b != int32(0) {
 86678  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133258), unsafe.Pointer(&_whereLoopAddBtreeØ00__func__Ø000), unsafe.Pointer(str(105560)))
 86679  			crt.X__builtin_abort(tls)
 86680  		}
 86681  	}()
 86682  	if _pProbe.Xtnum > int32(0) {
 86683  		goto _37
 86684  	}
 86685  	_pNew.XwsFlags = uint32(256)
 86686  	_pNew.XiSortIdx = uint8(func() int32 {
 86687  		if _b != 0 {
 86688  			return _iSortIdx
 86689  		}
 86690  		return int32(0)
 86691  	}())
 86692  	_pNew.XrRun = int16(int32(_rSize) + int32(16))
 86693  	_whereLoopOutputAdjust(tls, _pWC, _pNew, _rSize)
 86694  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 86695  	_pNew.XnOut = _rSize
 86696  	if _rc != 0 {
 86697  		goto _31
 86698  	}
 86699  	goto _41
 86700  _37:
 86701  	if ((uint32(_pProbe.XidxType>>5) << 31) >> 31) != 0 {
 86702  		_pNew.XwsFlags = uint32(576)
 86703  		_12_m = 0
 86704  		goto _43
 86705  	}
 86706  	_12_m = _pSrc.XcolUsed & (^_columnsInIndex(tls, _pProbe))
 86707  	_pNew.XwsFlags = uint32(func() int32 {
 86708  		if _12_m == (0) {
 86709  			return int32(576)
 86710  		}
 86711  		return int32(512)
 86712  	}())
 86713  _43:
 86714  	if _b == 0 && (_pTab.XtabFlags&uint32(32)) == (0) && (*XExpr)(_pProbe.XpPartIdxWhere) == nil && (_12_m != (0) || int32((uint32(_pProbe.XidxType>>2)<<31)>>31) != int32(0) || int32(_pProbe.XszIdxRow) >= int32(_pTab.XszTabRow) || (int32(_pWInfo.XwctrlFlags)&int32(4)) != int32(0) || _sqlite3Config.XbUseCis == 0 || (int32((*Xsqlite3)((*XParse)(_pWInfo.XpParse).Xdb).XdbOptFlags)&int32(64)) != int32(0)) {
 86715  		goto _54
 86716  	}
 86717  	_pNew.XiSortIdx = uint8(func() int32 {
 86718  		if _b != 0 {
 86719  			return _iSortIdx
 86720  		}
 86721  		return int32(0)
 86722  	}())
 86723  	_pNew.XrRun = int16((int32(_rSize) + int32(1)) + ((int32(15) * int32(_pProbe.XszIdxRow)) / int32(_pTab.XszTabRow)))
 86724  	if _12_m == (0) {
 86725  		goto _57
 86726  	}
 86727  	_16_nLookup = int16(int32(_rSize) + int32(16))
 86728  	_16_iCur = _pSrc.XiCursor
 86729  	_16_pWC2 = &_pWInfo.XsWC
 86730  	_16_ii = int32(0)
 86731  _58:
 86732  	if _16_ii >= _16_pWC2.XnTerm {
 86733  		goto _61
 86734  	}
 86735  	_17_pTerm = elem101((*XWhereTerm)(_16_pWC2.Xa), uintptr(_16_ii))
 86736  	if _sqlite3ExprCoveredByIndex(tls, (*XExpr)(_17_pTerm.XpExpr), _16_iCur, _pProbe) == 0 {
 86737  		goto _61
 86738  	}
 86739  	if int32(_17_pTerm.XtruthProb) <= int32(0) {
 86740  		{
 86741  			p := &_16_nLookup
 86742  			*p = int16(int32(*p) + int32(_17_pTerm.XtruthProb))
 86743  		}
 86744  		goto _64
 86745  	}
 86746  	_16_nLookup -= 1
 86747  	if (int32(_17_pTerm.XeOperator) & int32(130)) != 0 {
 86748  		{
 86749  			p := &_16_nLookup
 86750  			*p = int16(int32(*p) - int32(19))
 86751  		}
 86752  	}
 86753  _64:
 86754  	_16_ii += 1
 86755  	goto _58
 86756  _61:
 86757  	_pNew.XrRun = _sqlite3LogEstAdd(tls, _pNew.XrRun, _16_nLookup)
 86758  _57:
 86759  	_whereLoopOutputAdjust(tls, _pWC, _pNew, _rSize)
 86760  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 86761  	_pNew.XnOut = _rSize
 86762  	if _rc != 0 {
 86763  		goto _31
 86764  	}
 86765  _54:
 86766  _41:
 86767  	_pBuilder.XbldFlags = 0
 86768  	_rc = _whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, 0)
 86769  	if _pBuilder.XbldFlags == uint32(1) {
 86770  		_pTab.XtabFlags |= uint32(256)
 86771  	}
 86772  	if _pSrc.XpIBIndex != nil {
 86773  		goto _31
 86774  	}
 86775  _28:
 86776  	*func() *int32 { _pProbe = (*XIndex)(_pProbe.XpNext); return &_iSortIdx }() += 1
 86777  	goto _14
 86778  _31:
 86779  	return _rc
 86780  
 86781  	_ = _aiRowEstPk
 86782  	_ = _aiColumnPk
 86783  	panic(0)
 86784  }
 86785  
 86786  var _whereLoopAddBtreeØ00__func__Ø000 [18]int8
 86787  
 86788  func init() {
 86789  	crt.Xstrncpy(nil, &_whereLoopAddBtreeØ00__func__Ø000[0], str(105616), 18)
 86790  }
 86791  
 86792  // C comment
 86793  //  /*
 86794  //  ** Estimate the logarithm of the input value to base 2.
 86795  //  */
 86796  func _estLog(tls *crt.TLS, _N int16) (r0 int16) {
 86797  	return int16(func() int32 {
 86798  		if int32(_N) <= int32(10) {
 86799  			return int32(0)
 86800  		}
 86801  		return (int32(_sqlite3LogEst(tls, uint64(_N))) - int32(33))
 86802  	}())
 86803  }
 86804  
 86805  // C comment
 86806  //  /*
 86807  //  ** Return TRUE if the WHERE clause term pTerm is of a form where it
 86808  //  ** could be used with an index to access pSrc, assuming an appropriate
 86809  //  ** index existed.
 86810  //  */
 86811  func _termCanDriveIndex(tls *crt.TLS, _pTerm *XWhereTerm, _pSrc *TSrcList_item, _notReady uint64) (r0 int32) {
 86812  	var _aff int8
 86813  	if _pTerm.XleftCursor != _pSrc.XiCursor {
 86814  		return int32(0)
 86815  	}
 86816  	if (int32(_pTerm.XeOperator) & int32(130)) == int32(0) {
 86817  		return int32(0)
 86818  	}
 86819  	if (_pTerm.XprereqRight & _notReady) != (0) {
 86820  		return int32(0)
 86821  	}
 86822  	if (*(*int32)(unsafe.Pointer(&_pTerm.Xu))) < int32(0) {
 86823  		return int32(0)
 86824  	}
 86825  	_aff = elem43((*XColumn)((*XTable)(_pSrc.XpTab).XaCol), uintptr(*(*int32)(unsafe.Pointer(&_pTerm.Xu)))).Xaffinity
 86826  	if _sqlite3IndexAffinityOk(tls, (*XExpr)(_pTerm.XpExpr), _aff) == 0 {
 86827  		return int32(0)
 86828  	}
 86829  	return int32(1)
 86830  }
 86831  
 86832  // C comment
 86833  //  /* Check to see if a partial index with pPartIndexWhere can be used
 86834  //  ** in the current query.  Return true if it can be and false if not.
 86835  //  */
 86836  func _whereUsablePartialIndex(tls *crt.TLS, _iTab int32, _pWC *XWhereClause, _pWhere *XExpr) (r0 int32) {
 86837  	var _i int32
 86838  	var _2_pExpr *XExpr
 86839  	var _pTerm *XWhereTerm
 86840  _0:
 86841  	if int32(_pWhere.Xop) != int32(71) {
 86842  		goto _1
 86843  	}
 86844  	if _whereUsablePartialIndex(tls, _iTab, _pWC, (*XExpr)(_pWhere.XpLeft)) == 0 {
 86845  		return int32(0)
 86846  	}
 86847  	_pWhere = (*XExpr)(_pWhere.XpRight)
 86848  	goto _0
 86849  _1:
 86850  	*func() **XWhereTerm { _i = int32(0); return &_pTerm }() = (*XWhereTerm)(_pWC.Xa)
 86851  _3:
 86852  	if _i >= _pWC.XnTerm {
 86853  		goto _6
 86854  	}
 86855  	_2_pExpr = (*XExpr)(_pTerm.XpExpr)
 86856  	if _sqlite3ExprImpliesExpr(tls, _2_pExpr, _pWhere, _iTab) != 0 && (((_2_pExpr.Xflags & uint32(1)) == (0)) || (int32(_2_pExpr.XiRightJoinTable) == _iTab)) {
 86857  		return int32(1)
 86858  	}
 86859  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i += 1; return &_pTerm }())) += uintptr(64)
 86860  	goto _3
 86861  _6:
 86862  	return int32(0)
 86863  }
 86864  
 86865  // C comment
 86866  //  /*
 86867  //  ** Return true if we can prove the pE2 will always be true if pE1 is
 86868  //  ** true.  Return false if we cannot complete the proof or if pE2 might
 86869  //  ** be false.  Examples:
 86870  //  **
 86871  //  **     pE1: x==5       pE2: x==5             Result: true
 86872  //  **     pE1: x>0        pE2: x==5             Result: false
 86873  //  **     pE1: x=21       pE2: x=21 OR y=43     Result: true
 86874  //  **     pE1: x!=123     pE2: x IS NOT NULL    Result: true
 86875  //  **     pE1: x!=?1      pE2: x IS NOT NULL    Result: true
 86876  //  **     pE1: x IS NULL  pE2: x IS NOT NULL    Result: false
 86877  //  **     pE1: x IS ?2    pE2: x IS NOT NULL    Reuslt: false
 86878  //  **
 86879  //  ** When comparing TK_COLUMN nodes between pE1 and pE2, if pE2 has
 86880  //  ** Expr.iTable<0 then assume a table number given by iTab.
 86881  //  **
 86882  //  ** When in doubt, return false.  Returning true might give a performance
 86883  //  ** improvement.  Returning false might cause a performance reduction, but
 86884  //  ** it will always give the correct answer and is hence always safe.
 86885  //  */
 86886  func _sqlite3ExprImpliesExpr(tls *crt.TLS, _pE1 *XExpr, _pE2 *XExpr, _iTab int32) (r0 int32) {
 86887  	var _3_pX *XExpr
 86888  	if _sqlite3ExprCompare(tls, _pE1, _pE2, _iTab) == int32(0) {
 86889  		return int32(1)
 86890  	}
 86891  	if (int32(_pE2.Xop) == int32(70)) && (_sqlite3ExprImpliesExpr(tls, _pE1, (*XExpr)(_pE2.XpLeft), _iTab) != 0 || _sqlite3ExprImpliesExpr(tls, _pE1, (*XExpr)(_pE2.XpRight), _iTab) != 0) {
 86892  		return int32(1)
 86893  	}
 86894  	if int32(_pE2.Xop) != int32(76) || int32(_pE1.Xop) == int32(75) || int32(_pE1.Xop) == int32(72) {
 86895  		goto _6
 86896  	}
 86897  	_3_pX = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pE1.XpLeft))
 86898  	if _sqlite3ExprCompare(tls, _3_pX, (*XExpr)(_pE2.XpLeft), _iTab) == int32(0) {
 86899  		return int32(1)
 86900  	}
 86901  _6:
 86902  	return int32(0)
 86903  }
 86904  
 86905  // C comment
 86906  //  /*
 86907  //  ** Return True if it is possible that pIndex might be useful in
 86908  //  ** implementing the ORDER BY clause in pBuilder.
 86909  //  **
 86910  //  ** Return False if pBuilder does not contain an ORDER BY clause or
 86911  //  ** if there is no way for pIndex to be useful in implementing that
 86912  //  ** ORDER BY clause.
 86913  //  */
 86914  func _indexMightHelpWithOrderBy(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pIndex *XIndex, _iCursor int32) (r0 int32) {
 86915  	var _ii, _jj int32
 86916  	var _pOB, _aColExpr *XExprList
 86917  	var _1_pExpr *XExpr
 86918  	if ((uint32(_pIndex.XidxType>>2) << 31) >> 31) != 0 {
 86919  		return int32(0)
 86920  	}
 86921  	if store72(&_pOB, (*XExprList)((*XWhereInfo)(_pBuilder.XpWInfo).XpOrderBy)) == nil {
 86922  		return int32(0)
 86923  	}
 86924  	_ii = int32(0)
 86925  _2:
 86926  	if _ii >= _pOB.XnExpr {
 86927  		goto _5
 86928  	}
 86929  	_1_pExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pOB.Xa)), uintptr(_ii)).XpExpr))
 86930  	if int32(_1_pExpr.Xop) != int32(152) || _1_pExpr.XiTable != _iCursor {
 86931  		goto _7
 86932  	}
 86933  	if int32(_1_pExpr.XiColumn) < int32(0) {
 86934  		return int32(1)
 86935  	}
 86936  	_jj = int32(0)
 86937  _9:
 86938  	if _jj >= int32(_pIndex.XnKeyCol) {
 86939  		goto _12
 86940  	}
 86941  	if int32(_1_pExpr.XiColumn) == int32(*elem52(_pIndex.XaiColumn, uintptr(_jj))) {
 86942  		return int32(1)
 86943  	}
 86944  	_jj += 1
 86945  	goto _9
 86946  _12:
 86947  	goto _15
 86948  _7:
 86949  	if store72(&_aColExpr, (*XExprList)(_pIndex.XaColExpr)) == nil {
 86950  		goto _15
 86951  	}
 86952  	_jj = int32(0)
 86953  _16:
 86954  	if _jj >= int32(_pIndex.XnKeyCol) {
 86955  		goto _19
 86956  	}
 86957  	if int32(*elem52(_pIndex.XaiColumn, uintptr(_jj))) != int32(-2) {
 86958  		goto _17
 86959  	}
 86960  	if _sqlite3ExprCompare(tls, _1_pExpr, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_aColExpr.Xa)), uintptr(_jj)).XpExpr), _iCursor) == int32(0) {
 86961  		return int32(1)
 86962  	}
 86963  _17:
 86964  	_jj += 1
 86965  	goto _16
 86966  _19:
 86967  _15:
 86968  	_ii += 1
 86969  	goto _2
 86970  _5:
 86971  	return int32(0)
 86972  }
 86973  
 86974  // C comment
 86975  //  /*
 86976  //  ** Adjust the WhereLoop.nOut value downward to account for terms of the
 86977  //  ** WHERE clause that reference the loop but which are not used by an
 86978  //  ** index.
 86979  //  *
 86980  //  ** For every WHERE clause term that is not used by the index
 86981  //  ** and which has a truth probability assigned by one of the likelihood(),
 86982  //  ** likely(), or unlikely() SQL functions, reduce the estimated number
 86983  //  ** of output rows by the probability specified.
 86984  //  **
 86985  //  ** TUNING:  For every WHERE clause term that is not used by the index
 86986  //  ** and which does not have an assigned truth probability, heuristics
 86987  //  ** described below are used to try to estimate the truth probability.
 86988  //  ** TODO --> Perhaps this is something that could be improved by better
 86989  //  ** table statistics.
 86990  //  **
 86991  //  ** Heuristic 1:  Estimate the truth probability as 93.75%.  The 93.75%
 86992  //  ** value corresponds to -1 in LogEst notation, so this means decrement
 86993  //  ** the WhereLoop.nOut field for every such WHERE clause term.
 86994  //  **
 86995  //  ** Heuristic 2:  If there exists one or more WHERE clause terms of the
 86996  //  ** form "x==EXPR" and EXPR is not a constant 0 or 1, then make sure the
 86997  //  ** final output row estimate is no greater than 1/4 of the total number
 86998  //  ** of rows in the table.  In other words, assume that x==EXPR will filter
 86999  //  ** out at least 3 out of 4 rows.  If EXPR is -1 or 0 or 1, then maybe the
 87000  //  ** "x" column is boolean or else -1 or 0 or 1 is a common default value
 87001  //  ** on the "x" column and so in that case only cap the output row estimate
 87002  //  ** at 1/2 instead of 1/4.
 87003  //  */
 87004  func _whereLoopOutputAdjust(tls *crt.TLS, _pWC *XWhereClause, _pLoop *XWhereLoop, _nRow int16) {
 87005  	var _iReduce int16
 87006  	var _i, _j, _k int32
 87007  	var _notAllowed uint64
 87008  	var _6_pRight *XExpr
 87009  	var _pTerm, _pX *XWhereTerm
 87010  	_notAllowed = ^(_pLoop.Xprereq | _pLoop.XmaskSelf)
 87011  	_iReduce = int16(0)
 87012  	func() {
 87013  		if (_pLoop.XwsFlags & uint32(16384)) != (0) {
 87014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132572), unsafe.Pointer(&_whereLoopOutputAdjustØ00__func__Ø000), unsafe.Pointer(str(105634)))
 87015  			crt.X__builtin_abort(tls)
 87016  		}
 87017  	}()
 87018  	*func() **XWhereTerm { _i = _pWC.XnTerm; return &_pTerm }() = (*XWhereTerm)(_pWC.Xa)
 87019  _2:
 87020  	if _i <= int32(0) {
 87021  		goto _5
 87022  	}
 87023  	if (int32(_pTerm.XwtFlags) & int32(2)) != int32(0) {
 87024  		goto _5
 87025  	}
 87026  	if (_pTerm.XprereqAll & _pLoop.XmaskSelf) == (0) {
 87027  		goto _3
 87028  	}
 87029  	if (_pTerm.XprereqAll & _notAllowed) != (0) {
 87030  		goto _3
 87031  	}
 87032  	_j = int32(_pLoop.XnLTerm) - int32(1)
 87033  _9:
 87034  	if _j < int32(0) {
 87035  		goto _12
 87036  	}
 87037  	_pX = *elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))
 87038  	if _pX == nil {
 87039  		goto _10
 87040  	}
 87041  	if _pX == _pTerm {
 87042  		goto _12
 87043  	}
 87044  	if (_pX.XiParent >= int32(0)) && (elem101((*XWhereTerm)(_pWC.Xa), uintptr(_pX.XiParent)) == _pTerm) {
 87045  		goto _12
 87046  	}
 87047  _10:
 87048  	_j -= 1
 87049  	goto _9
 87050  _12:
 87051  	if _j >= int32(0) {
 87052  		goto _17
 87053  	}
 87054  	if int32(_pTerm.XtruthProb) <= int32(0) {
 87055  		{
 87056  			p := &_pLoop.XnOut
 87057  			*p = int16(int32(*p) + int32(_pTerm.XtruthProb))
 87058  		}
 87059  		goto _19
 87060  	}
 87061  	_pLoop.XnOut -= 1
 87062  	if (int32(_pTerm.XeOperator) & int32(130)) == 0 {
 87063  		goto _20
 87064  	}
 87065  	_6_pRight = (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)
 87066  	if (_sqlite3ExprIsInteger(tls, _6_pRight, &_k) != 0 && (_k >= int32(-1))) && (_k <= int32(1)) {
 87067  		_k = int32(10)
 87068  		goto _24
 87069  	}
 87070  	_k = int32(20)
 87071  _24:
 87072  	if int32(_iReduce) < _k {
 87073  		_iReduce = int16(_k)
 87074  	}
 87075  _20:
 87076  _19:
 87077  _17:
 87078  _3:
 87079  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pTerm }())) += uintptr(64)
 87080  	goto _2
 87081  _5:
 87082  	if int32(_pLoop.XnOut) > (int32(_nRow) - int32(_iReduce)) {
 87083  		_pLoop.XnOut = int16(int32(_nRow) - int32(_iReduce))
 87084  	}
 87085  }
 87086  
 87087  var _whereLoopOutputAdjustØ00__func__Ø000 [22]int8
 87088  
 87089  func init() {
 87090  	crt.Xstrncpy(nil, &_whereLoopOutputAdjustØ00__func__Ø000[0], str(105673), 22)
 87091  }
 87092  
 87093  // C comment
 87094  //  /*
 87095  //  ** Determine if an index pIdx on table with cursor iCur contains will
 87096  //  ** the expression pExpr.  Return true if the index does cover the
 87097  //  ** expression and false if the pExpr expression references table columns
 87098  //  ** that are not found in the index pIdx.
 87099  //  **
 87100  //  ** An index covering an expression means that the expression can be
 87101  //  ** evaluated using only the index and without having to lookup the
 87102  //  ** corresponding table entry.
 87103  //  */
 87104  func _sqlite3ExprCoveredByIndex(tls *crt.TLS, _pExpr *XExpr, _iCur int32, _pIdx *XIndex) (r0 int32) {
 87105  	var _w XWalker
 87106  	var _xcov TIdxCover
 87107  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint64(48))
 87108  	_xcov.XiCur = _iCur
 87109  	*(**XIndex)(unsafe.Pointer(&_xcov.XpIdx)) = _pIdx
 87110  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _exprIdxCover
 87111  	*(**TIdxCover)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = &_xcov
 87112  	_sqlite3WalkExpr(tls, &_w, _pExpr)
 87113  	return bool2int(_w.XeCode == 0)
 87114  }
 87115  
 87116  // C comment
 87117  //  /*
 87118  //  ** Check to see if there are references to columns in table
 87119  //  ** pWalker->u.pIdxCover->iCur can be satisfied using the index
 87120  //  ** pWalker->u.pIdxCover->pIdx.
 87121  //  */
 87122  func _exprIdxCover(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 87123  	if ((int32(_pExpr.Xop) == int32(152)) && (_pExpr.XiTable == ((*TIdxCover)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu))).XiCur))) && (int32(_sqlite3ColumnOfIndex(tls, (*XIndex)((*TIdxCover)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu))).XpIdx), _pExpr.XiColumn)) < int32(0)) {
 87124  		_pWalker.XeCode = uint8(1)
 87125  		return int32(2)
 87126  	}
 87127  	return int32(0)
 87128  }
 87129  
 87130  // C comment
 87131  //  /*
 87132  //  ** We have so far matched pBuilder->pNew->u.btree.nEq terms of the
 87133  //  ** index pIndex. Try to match one more.
 87134  //  **
 87135  //  ** When this function is called, pBuilder->pNew->nOut contains the
 87136  //  ** number of rows expected to be visited by filtering using the nEq
 87137  //  ** terms only. If it is modified, this value is restored before this
 87138  //  ** function returns.
 87139  //  **
 87140  //  ** If pProbe->tnum==0, that means pIndex is a fake index used for the
 87141  //  ** INTEGER PRIMARY KEY.
 87142  //  */
 87143  func _whereLoopAddBtreeIndex(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pSrc *TSrcList_item, _pProbe *XIndex, _nInMul int16) (r0 int32) {
 87144  	var _saved_nOut, _rSize, _rLogSize, _3_rCostIdx, _3_nOutUnadjusted, _30_nIter int16
 87145  	var _opMask, _rc, _3_nIn, _9_i, _12_iCol, _21_nEq int32
 87146  	var _saved_wsFlags uint32
 87147  	var _saved_prereq uint64
 87148  	var _saved_nLTerm, _saved_nEq, _saved_nBtm, _saved_nTop, _saved_nSkip, _3_eOp uint16
 87149  	var _db *Xsqlite3
 87150  	var _8_pExpr *XExpr
 87151  	var _pParse *XParse
 87152  	var _pWInfo *XWhereInfo
 87153  	var _pNew *XWhereLoop
 87154  	var _pTerm, _pTop, _pBtm *XWhereTerm
 87155  	var _scan XWhereScan
 87156  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 87157  	_pParse = (*XParse)(_pWInfo.XpParse)
 87158  	_db = (*Xsqlite3)(_pParse.Xdb)
 87159  	_rc = int32(0)
 87160  	_pTop = nil
 87161  	_pBtm = nil
 87162  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 87163  	if _db.XmallocFailed != 0 {
 87164  		return _sqlite3NomemError(tls, int32(132723))
 87165  	}
 87166  	func() {
 87167  		if (_pNew.XwsFlags & uint32(1024)) != (0) {
 87168  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132727), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105695)))
 87169  			crt.X__builtin_abort(tls)
 87170  		}
 87171  	}()
 87172  	func() {
 87173  		if (_pNew.XwsFlags & uint32(16)) != (0) {
 87174  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132728), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105735)))
 87175  			crt.X__builtin_abort(tls)
 87176  		}
 87177  	}()
 87178  	if (_pNew.XwsFlags & uint32(32)) != 0 {
 87179  		_opMask = int32(24)
 87180  		goto _6
 87181  	}
 87182  	func() {
 87183  		if int32((*t102)(unsafe.Pointer(&_pNew.Xu)).XnBtm) != int32(0) {
 87184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132732), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105772)))
 87185  			crt.X__builtin_abort(tls)
 87186  		}
 87187  	}()
 87188  	_opMask = int32(447)
 87189  _6:
 87190  	if ((uint32(_pProbe.XidxType>>2) << 31) >> 31) != 0 {
 87191  		_opMask &= int32(-61)
 87192  	}
 87193  	func() {
 87194  		if int32((*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq) >= int32(_pProbe.XnColumn) {
 87195  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132737), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105794)))
 87196  			crt.X__builtin_abort(tls)
 87197  		}
 87198  	}()
 87199  	_saved_nEq = (*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq
 87200  	_saved_nBtm = (*t102)(unsafe.Pointer(&_pNew.Xu)).XnBtm
 87201  	_saved_nTop = (*t102)(unsafe.Pointer(&_pNew.Xu)).XnTop
 87202  	_saved_nSkip = _pNew.XnSkip
 87203  	_saved_nLTerm = _pNew.XnLTerm
 87204  	_saved_wsFlags = _pNew.XwsFlags
 87205  	_saved_prereq = _pNew.Xprereq
 87206  	_saved_nOut = _pNew.XnOut
 87207  	_pTerm = _whereScanInit(tls, &_scan, (*XWhereClause)(_pBuilder.XpWC), _pSrc.XiCursor, int32(_saved_nEq), uint32(_opMask), _pProbe)
 87208  	_pNew.XrSetup = 0
 87209  	_rSize = *elem52(_pProbe.XaiRowLogEst, 0)
 87210  	_rLogSize = _estLog(tls, _rSize)
 87211  _12:
 87212  	if _rc != int32(0) || _pTerm == nil {
 87213  		goto _16
 87214  	}
 87215  	_3_eOp = _pTerm.XeOperator
 87216  	_3_nIn = int32(0)
 87217  	if ((int32(_3_eOp) == int32(256)) || ((int32(_pTerm.XwtFlags) & int32(0)) != int32(0))) && _indexColumnNotNull(tls, _pProbe, int32(_saved_nEq)) != 0 {
 87218  		goto _13
 87219  	}
 87220  	if (_pTerm.XprereqRight & _pNew.XmaskSelf) != 0 {
 87221  		goto _13
 87222  	}
 87223  	if (int32(_pTerm.XwtFlags)&int32(256)) != 0 && (int32(_pTerm.XeOperator) == int32(16)) {
 87224  		goto _13
 87225  	}
 87226  	if (((int32(_pSrc.Xfg.Xjointype) & int32(8)) != int32(0)) && ((((*XExpr)(_pTerm.XpExpr).Xflags) & uint32(1)) == (0))) && ((int32(_3_eOp) & int32(384)) != int32(0)) {
 87227  		goto _13
 87228  	}
 87229  	if (int32(_pProbe.XonError) != int32(0)) && (int32(_saved_nEq) == (int32(_pProbe.XnKeyCol) - int32(1))) {
 87230  		_pBuilder.XbldFlags |= uint32(2)
 87231  		goto _28
 87232  	}
 87233  	_pBuilder.XbldFlags |= uint32(1)
 87234  _28:
 87235  	_pNew.XwsFlags = _saved_wsFlags
 87236  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq = _saved_nEq
 87237  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnBtm = _saved_nBtm
 87238  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnTop = _saved_nTop
 87239  	_pNew.XnLTerm = _saved_nLTerm
 87240  	if _whereLoopResize(tls, _db, _pNew, int32(_pNew.XnLTerm)+int32(1)) != 0 {
 87241  		goto _16
 87242  	}
 87243  	*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(postInc78(&_pNew.XnLTerm, uint16(1)))) = _pTerm
 87244  	_pNew.Xprereq = (_saved_prereq | _pTerm.XprereqRight) & (^_pNew.XmaskSelf)
 87245  	func() {
 87246  		if int32(_nInMul) != int32(0) && (_pNew.XwsFlags&uint32(8)) == (0) && (_pNew.XwsFlags&uint32(4)) == (0) && (_pNew.XwsFlags&uint32(32768)) == (0) {
 87247  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132797), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105828)))
 87248  			crt.X__builtin_abort(tls)
 87249  		}
 87250  	}()
 87251  	if (int32(_3_eOp) & int32(1)) == 0 {
 87252  		goto _35
 87253  	}
 87254  	_8_pExpr = (*XExpr)(_pTerm.XpExpr)
 87255  	_pNew.XwsFlags |= uint32(4)
 87256  	if (_8_pExpr.Xflags & uint32(2048)) == (0) {
 87257  		goto _36
 87258  	}
 87259  	_3_nIn = int32(46)
 87260  	func() {
 87261  		if int32(46) != int32(_sqlite3LogEst(tls, uint64(25))) {
 87262  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132809), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105959)))
 87263  			crt.X__builtin_abort(tls)
 87264  		}
 87265  	}()
 87266  	_9_i = int32(0)
 87267  _39:
 87268  	if _9_i >= (int32(_pNew.XnLTerm) - int32(1)) {
 87269  		goto _42
 87270  	}
 87271  	if ((*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(_9_i))) != nil) && ((*XExpr)((*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(_9_i))).XpExpr) == _8_pExpr) {
 87272  		_3_nIn = int32(0)
 87273  	}
 87274  	_9_i += 1
 87275  	goto _39
 87276  _42:
 87277  	goto _49
 87278  _36:
 87279  	if func() int32 {
 87280  		if ((*(*unsafe.Pointer)(unsafe.Pointer(&_8_pExpr.Xx))) != nil) && ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_8_pExpr.Xx))).XnExpr) != 0 {
 87281  			return int32(1)
 87282  		}
 87283  		return func() int32 {
 87284  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132819), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 87285  			crt.X__builtin_abort(tls)
 87286  			return int32(0)
 87287  		}()
 87288  	}() != 0 {
 87289  		_3_nIn = int32(_sqlite3LogEst(tls, uint64((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_8_pExpr.Xx))).XnExpr)))
 87290  		func() {
 87291  			if _3_nIn <= int32(0) {
 87292  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132822), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105981)))
 87293  				crt.X__builtin_abort(tls)
 87294  			}
 87295  		}()
 87296  	}
 87297  _49:
 87298  	goto _75
 87299  _35:
 87300  	if (int32(_3_eOp) & int32(130)) == 0 {
 87301  		goto _53
 87302  	}
 87303  	_12_iCol = int32(*elem52(_pProbe.XaiColumn, uintptr(_saved_nEq)))
 87304  	_pNew.XwsFlags |= uint32(1)
 87305  	func() {
 87306  		if int32(_saved_nEq) != int32((*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq) {
 87307  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132828), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105987)))
 87308  			crt.X__builtin_abort(tls)
 87309  		}
 87310  	}()
 87311  	if _12_iCol != int32(-1) && (_12_iCol <= int32(0) || int32(_nInMul) != int32(0) || int32(_saved_nEq) != (int32(_pProbe.XnKeyCol)-int32(1))) {
 87312  		goto _59
 87313  	}
 87314  	if (_12_iCol >= int32(0)) && (int32((uint32(_pProbe.XidxType>>3)<<31)>>31) == int32(0)) {
 87315  		_pNew.XwsFlags |= uint32(65536)
 87316  		goto _62
 87317  	}
 87318  	_pNew.XwsFlags |= uint32(4096)
 87319  _62:
 87320  _59:
 87321  	goto _75
 87322  _53:
 87323  	if (int32(_3_eOp) & int32(256)) != 0 {
 87324  		_pNew.XwsFlags |= uint32(8)
 87325  		goto _75
 87326  	}
 87327  	if (int32(_3_eOp) & int32(36)) == 0 {
 87328  		goto _66
 87329  	}
 87330  	_pNew.XwsFlags |= uint32(34)
 87331  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnBtm = uint16(_whereRangeVectorLen(tls, _pParse, _pSrc.XiCursor, _pProbe, int32(_saved_nEq), _pTerm))
 87332  	_pBtm = _pTerm
 87333  	_pTop = nil
 87334  	if (int32(_pTerm.XwtFlags) & int32(256)) == 0 {
 87335  		goto _67
 87336  	}
 87337  	_pTop = elem101(_pTerm, uintptr(1))
 87338  	func() {
 87339  		if int64((uintptr(unsafe.Pointer(_pTop))-uintptr((*XWhereClause)(_pTerm.XpWC).Xa))/64) >= int64((*XWhereClause)(_pTerm.XpWC).XnTerm) {
 87340  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132853), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106016)))
 87341  			crt.X__builtin_abort(tls)
 87342  		}
 87343  	}()
 87344  	func() {
 87345  		if (int32(_pTop.XwtFlags) & int32(256)) == 0 {
 87346  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132854), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106057)))
 87347  			crt.X__builtin_abort(tls)
 87348  		}
 87349  	}()
 87350  	func() {
 87351  		if int32(_pTop.XeOperator) != int32(16) {
 87352  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132855), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106086)))
 87353  			crt.X__builtin_abort(tls)
 87354  		}
 87355  	}()
 87356  	if _whereLoopResize(tls, _db, _pNew, int32(_pNew.XnLTerm)+int32(1)) != 0 {
 87357  		goto _16
 87358  	}
 87359  	*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(postInc78(&_pNew.XnLTerm, uint16(1)))) = _pTop
 87360  	_pNew.XwsFlags |= uint32(16)
 87361  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnTop = uint16(1)
 87362  _67:
 87363  	goto _75
 87364  _66:
 87365  	func() {
 87366  		if (int32(_3_eOp) & int32(24)) == 0 {
 87367  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132862), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106109)))
 87368  			crt.X__builtin_abort(tls)
 87369  		}
 87370  	}()
 87371  	_pNew.XwsFlags |= uint32(18)
 87372  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnTop = uint16(_whereRangeVectorLen(tls, _pParse, _pSrc.XiCursor, _pProbe, int32(_saved_nEq), _pTerm))
 87373  	_pTop = _pTerm
 87374  	_pBtm = func() *XWhereTerm {
 87375  		if (_pNew.XwsFlags & uint32(32)) != (0) {
 87376  			return (*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(int32(_pNew.XnLTerm)-int32(2))))
 87377  		}
 87378  		return nil
 87379  	}()
 87380  _75:
 87381  	func() {
 87382  		if int32(_pNew.XnOut) != int32(_saved_nOut) {
 87383  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132879), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106129)))
 87384  			crt.X__builtin_abort(tls)
 87385  		}
 87386  	}()
 87387  	if (_pNew.XwsFlags & uint32(2)) != 0 {
 87388  		_whereRangeScanEst(tls, _pParse, _pBuilder, _pBtm, _pTop, _pNew)
 87389  		goto _83
 87390  	}
 87391  	_21_nEq = int32(preInc78(&((*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq), uint16(1)))
 87392  	func() {
 87393  		if (int32(_3_eOp) & int32(387)) == 0 {
 87394  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132886), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106152)))
 87395  			crt.X__builtin_abort(tls)
 87396  		}
 87397  	}()
 87398  	func() {
 87399  		if int32(_pNew.XnOut) != int32(_saved_nOut) {
 87400  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132888), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106129)))
 87401  			crt.X__builtin_abort(tls)
 87402  		}
 87403  	}()
 87404  	if (int32(_pTerm.XtruthProb) <= int32(0)) && (int32(*elem52(_pProbe.XaiColumn, uintptr(_saved_nEq))) >= int32(0)) {
 87405  		func() {
 87406  			if (int32(_3_eOp)&int32(1)) == 0 && _3_nIn != int32(0) {
 87407  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132890), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106188)))
 87408  				crt.X__builtin_abort(tls)
 87409  			}
 87410  		}()
 87411  		{
 87412  			p := &_pNew.XnOut
 87413  			*p = int16(int32(*p) + int32(_pTerm.XtruthProb))
 87414  		}
 87415  		{
 87416  			p := &_pNew.XnOut
 87417  			*p = int16(int32(*p) - _3_nIn)
 87418  		}
 87419  		goto _93
 87420  	}
 87421  	{
 87422  		p := &_pNew.XnOut
 87423  		*p = int16(int32(*p) + (int32(*elem52(_pProbe.XaiRowLogEst, uintptr(_21_nEq))) - int32(*elem52(_pProbe.XaiRowLogEst, uintptr(_21_nEq-int32(1))))))
 87424  	}
 87425  	if (int32(_3_eOp) & int32(256)) != 0 {
 87426  		{
 87427  			p := &_pNew.XnOut
 87428  			*p = int16(int32(*p) + int32(10))
 87429  		}
 87430  	}
 87431  _93:
 87432  _83:
 87433  	_3_rCostIdx = int16((int32(_pNew.XnOut) + int32(1)) + ((int32(15) * int32(_pProbe.XszIdxRow)) / int32((*XTable)(_pSrc.XpTab).XszTabRow)))
 87434  	_pNew.XrRun = _sqlite3LogEstAdd(tls, _rLogSize, _3_rCostIdx)
 87435  	if (_pNew.XwsFlags & uint32(320)) == (0) {
 87436  		_pNew.XrRun = _sqlite3LogEstAdd(tls, _pNew.XrRun, int16(int32(_pNew.XnOut)+int32(16)))
 87437  	}
 87438  	_3_nOutUnadjusted = _pNew.XnOut
 87439  	{
 87440  		p := &_pNew.XrRun
 87441  		*p = int16(int32(*p) + (int32(_nInMul) + _3_nIn))
 87442  	}
 87443  	{
 87444  		p := &_pNew.XnOut
 87445  		*p = int16(int32(*p) + (int32(_nInMul) + _3_nIn))
 87446  	}
 87447  	_whereLoopOutputAdjust(tls, (*XWhereClause)(_pBuilder.XpWC), _pNew, _rSize)
 87448  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 87449  	if (_pNew.XwsFlags & uint32(2)) != 0 {
 87450  		_pNew.XnOut = _saved_nOut
 87451  		goto _97
 87452  	}
 87453  	_pNew.XnOut = _3_nOutUnadjusted
 87454  _97:
 87455  	if ((_pNew.XwsFlags & uint32(16)) == (0)) && (int32((*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq) < int32(_pProbe.XnColumn)) {
 87456  		_whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, int16(int32(_nInMul)+_3_nIn))
 87457  	}
 87458  	_pNew.XnOut = _saved_nOut
 87459  _13:
 87460  	_pTerm = _whereScanNext(tls, &_scan)
 87461  	goto _12
 87462  _16:
 87463  	_pNew.Xprereq = _saved_prereq
 87464  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq = _saved_nEq
 87465  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnBtm = _saved_nBtm
 87466  	(*t102)(unsafe.Pointer(&_pNew.Xu)).XnTop = _saved_nTop
 87467  	_pNew.XnSkip = _saved_nSkip
 87468  	_pNew.XwsFlags = _saved_wsFlags
 87469  	_pNew.XnOut = _saved_nOut
 87470  	_pNew.XnLTerm = _saved_nLTerm
 87471  	func() {
 87472  		if int32(42) != int32(_sqlite3LogEst(tls, uint64(18))) {
 87473  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132985), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106212)))
 87474  			crt.X__builtin_abort(tls)
 87475  		}
 87476  	}()
 87477  	if ((((int32(_saved_nEq) == int32(_saved_nSkip)) && ((int32(_saved_nEq) + int32(1)) < int32(_pProbe.XnKeyCol))) && (int32((uint32(_pProbe.XidxType>>6)<<31)>>31) == int32(0))) && (int32(*elem52(_pProbe.XaiRowLogEst, uintptr(int32(_saved_nEq)+int32(1)))) >= int32(42))) && (store2(&_rc, _whereLoopResize(tls, _db, _pNew, int32(_pNew.XnLTerm)+int32(1))) == int32(0)) {
 87478  		(*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq += 1
 87479  		_pNew.XnSkip += 1
 87480  		*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(postInc78(&_pNew.XnLTerm, uint16(1)))) = nil
 87481  		_pNew.XwsFlags |= uint32(32768)
 87482  		_30_nIter = int16(int32(*elem52(_pProbe.XaiRowLogEst, uintptr(_saved_nEq))) - int32(*elem52(_pProbe.XaiRowLogEst, uintptr(int32(_saved_nEq)+int32(1)))))
 87483  		{
 87484  			p := &_pNew.XnOut
 87485  			*p = int16(int32(*p) - int32(_30_nIter))
 87486  		}
 87487  		{
 87488  			p := &_30_nIter
 87489  			*p = int16(int32(*p) + int32(5))
 87490  		}
 87491  		_whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, int16(int32(_30_nIter)+int32(_nInMul)))
 87492  		_pNew.XnOut = _saved_nOut
 87493  		(*t102)(unsafe.Pointer(&_pNew.Xu)).XnEq = _saved_nEq
 87494  		_pNew.XnSkip = _saved_nSkip
 87495  		_pNew.XwsFlags = _saved_wsFlags
 87496  	}
 87497  	return _rc
 87498  }
 87499  
 87500  var _whereLoopAddBtreeIndexØ00__func__Ø000 [23]int8
 87501  
 87502  func init() {
 87503  	crt.Xstrncpy(nil, &_whereLoopAddBtreeIndexØ00__func__Ø000[0], str(106234), 23)
 87504  }
 87505  
 87506  // C comment
 87507  //  /*
 87508  //  ** Term pTerm is a vector range comparison operation. The first comparison
 87509  //  ** in the vector can be optimized using column nEq of the index. This
 87510  //  ** function returns the total number of vector elements that can be used
 87511  //  ** as part of the range comparison.
 87512  //  **
 87513  //  ** For example, if the query is:
 87514  //  **
 87515  //  **   WHERE a = ? AND (b, c, d) > (?, ?, ?)
 87516  //  **
 87517  //  ** and the index:
 87518  //  **
 87519  //  **   CREATE INDEX ... ON (a, b, c, d, e)
 87520  //  **
 87521  //  ** then this function would be invoked with nEq=1. The value returned in
 87522  //  ** this case is 3.
 87523  //  */
 87524  func _whereRangeVectorLen(tls *crt.TLS, _pParse *XParse, _iCur int32, _pIdx *XIndex, _nEq int32, _pTerm *XWhereTerm) (r0 int32) {
 87525  	var _nCmp, _i int32
 87526  	var _1_aff, _1_idxaff int8
 87527  	var _1_pLhs, _1_pRhs *XExpr
 87528  	var _1_pColl *XCollSeq
 87529  	_nCmp = _sqlite3ExprVectorSize(tls, (*XExpr)((*XExpr)(_pTerm.XpExpr).XpLeft))
 87530  	_nCmp = func() int32 {
 87531  		if _nCmp < (int32(_pIdx.XnColumn) - _nEq) {
 87532  			return _nCmp
 87533  		}
 87534  		return (int32(_pIdx.XnColumn) - _nEq)
 87535  	}()
 87536  	_i = int32(1)
 87537  _2:
 87538  	if _i >= _nCmp {
 87539  		goto _5
 87540  	}
 87541  	_1_idxaff = 0
 87542  	_1_pLhs = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)((*XExpr)(_pTerm.XpExpr).XpLeft).Xx)))).Xa))), uintptr(_i)).XpExpr)
 87543  	_1_pRhs = (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)
 87544  	if (_1_pRhs.Xflags & uint32(2048)) != 0 {
 87545  		_1_pRhs = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pRhs.Xx))).XpEList).Xa))), uintptr(_i)).XpExpr)
 87546  		goto _7
 87547  	}
 87548  	_1_pRhs = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pRhs.Xx))).Xa))), uintptr(_i)).XpExpr)
 87549  _7:
 87550  	if (((int32(_1_pLhs.Xop) != int32(152)) || (_1_pLhs.XiTable != _iCur)) || (int32(_1_pLhs.XiColumn) != int32(*elem52(_pIdx.XaiColumn, uintptr(_i+_nEq))))) || (int32(*elem15(_pIdx.XaSortOrder, uintptr(_i+_nEq))) != int32(*elem15(_pIdx.XaSortOrder, uintptr(_nEq)))) {
 87551  		goto _5
 87552  	}
 87553  	_1_aff = _sqlite3CompareAffinity(tls, _1_pRhs, _sqlite3ExprAffinity(tls, _1_pLhs))
 87554  	_1_idxaff = _sqlite3TableColumnAffinity(tls, (*XTable)(_pIdx.XpTable), int32(_1_pLhs.XiColumn))
 87555  	if int32(_1_aff) != int32(_1_idxaff) {
 87556  		goto _5
 87557  	}
 87558  	_1_pColl = _sqlite3BinaryCompareCollSeq(tls, _pParse, _1_pLhs, _1_pRhs)
 87559  	if _1_pColl == nil {
 87560  		goto _5
 87561  	}
 87562  	if _sqlite3StrICmp(tls, _1_pColl.XzName, *elem0(_pIdx.XazColl, uintptr(_i+_nEq))) != 0 {
 87563  		goto _5
 87564  	}
 87565  	_i += 1
 87566  	goto _2
 87567  _5:
 87568  	return _i
 87569  }
 87570  
 87571  // C comment
 87572  //  /*
 87573  //  ** This function is used to estimate the number of rows that will be visited
 87574  //  ** by scanning an index for a range of values. The range may have an upper
 87575  //  ** bound, a lower bound, or both. The WHERE clause terms that set the upper
 87576  //  ** and lower bounds are represented by pLower and pUpper respectively. For
 87577  //  ** example, assuming that index p is on t1(a):
 87578  //  **
 87579  //  **   ... FROM t1 WHERE a > ? AND a < ? ...
 87580  //  **                    |_____|   |_____|
 87581  //  **                       |         |
 87582  //  **                     pLower    pUpper
 87583  //  **
 87584  //  ** If either of the upper or lower bound is not present, then NULL is passed in
 87585  //  ** place of the corresponding WhereTerm.
 87586  //  **
 87587  //  ** The value in (pBuilder->pNew->u.btree.nEq) is the number of the index
 87588  //  ** column subject to the range constraint. Or, equivalently, the number of
 87589  //  ** equality constraints optimized by the proposed index scan. For example,
 87590  //  ** assuming index p is on t1(a, b), and the SQL query is:
 87591  //  **
 87592  //  **   ... FROM t1 WHERE a = ? AND b > ? AND b < ? ...
 87593  //  **
 87594  //  ** then nEq is set to 1 (as the range restricted column, b, is the second
 87595  //  ** left-most column of the index). Or, if the query is:
 87596  //  **
 87597  //  **   ... FROM t1 WHERE a > ? AND a < ? ...
 87598  //  **
 87599  //  ** then nEq is set to 0.
 87600  //  **
 87601  //  ** When this function is called, *pnOut is set to the sqlite3LogEst() of the
 87602  //  ** number of rows that the index scan is expected to visit without
 87603  //  ** considering the range constraints. If nEq is 0, then *pnOut is the number of
 87604  //  ** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced)
 87605  //  ** to account for the range constraints pLower and pUpper.
 87606  //  **
 87607  //  ** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be
 87608  //  ** used, a single range inequality reduces the search space by a factor of 4.
 87609  //  ** and a pair of constraints (x>? AND x<?) reduces the expected number of
 87610  //  ** rows visited by a factor of 64.
 87611  //  */
 87612  func _whereRangeScanEst(tls *crt.TLS, _pParse *XParse, _pBuilder *XWhereLoopBuilder, _pLower *XWhereTerm, _pUpper *XWhereTerm, _pLoop *XWhereLoop) (r0 int32) {
 87613  	var _nNew int16
 87614  	var _rc, _nOut int32
 87615  	_rc = int32(0)
 87616  	_nOut = int32(_pLoop.XnOut)
 87617  
 87618  	func() {
 87619  		if _pLower == nil && _pUpper == nil {
 87620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131911), unsafe.Pointer(&_whereRangeScanEstØ00__func__Ø000), unsafe.Pointer(str(106257)))
 87621  			crt.X__builtin_abort(tls)
 87622  		}
 87623  	}()
 87624  	func() {
 87625  		if _pUpper != nil && (int32(_pUpper.XwtFlags)&int32(0)) != int32(0) {
 87626  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131913), unsafe.Pointer(&_whereRangeScanEstØ00__func__Ø000), unsafe.Pointer(str(106274)))
 87627  			crt.X__builtin_abort(tls)
 87628  		}
 87629  	}()
 87630  	_nNew = _whereRangeAdjust(tls, _pLower, int16(_nOut))
 87631  	_nNew = _whereRangeAdjust(tls, _pUpper, _nNew)
 87632  	if (((_pLower != nil) && (int32(_pLower.XtruthProb) > int32(0))) && (_pUpper != nil)) && (int32(_pUpper.XtruthProb) > int32(0)) {
 87633  		{
 87634  			p := &_nNew
 87635  			*p = int16(int32(*p) - int32(20))
 87636  		}
 87637  	}
 87638  	_nOut -= bool2int(_pLower != nil) + bool2int(_pUpper != nil)
 87639  	if int32(_nNew) < int32(10) {
 87640  		_nNew = int16(10)
 87641  	}
 87642  	if int32(_nNew) < _nOut {
 87643  		_nOut = int32(_nNew)
 87644  	}
 87645  	_pLoop.XnOut = int16(_nOut)
 87646  	return _rc
 87647  }
 87648  
 87649  var _whereRangeScanEstØ00__func__Ø000 [18]int8
 87650  
 87651  func init() {
 87652  	crt.Xstrncpy(nil, &_whereRangeScanEstØ00__func__Ø000[0], str(106321), 18)
 87653  }
 87654  
 87655  // C comment
 87656  //  /*
 87657  //  ** If it is not NULL, pTerm is a term that provides an upper or lower
 87658  //  ** bound on a range scan. Without considering pTerm, it is estimated
 87659  //  ** that the scan will visit nNew rows. This function returns the number
 87660  //  ** estimated to be visited after taking pTerm into account.
 87661  //  **
 87662  //  ** If the user explicitly specified a likelihood() value for this term,
 87663  //  ** then the return value is the likelihood multiplied by the number of
 87664  //  ** input rows. Otherwise, this function assumes that an "IS NOT NULL" term
 87665  //  ** has a likelihood of 0.50, and any other term a likelihood of 0.25.
 87666  //  */
 87667  func _whereRangeAdjust(tls *crt.TLS, _pTerm *XWhereTerm, _nNew int16) (r0 int16) {
 87668  	var _nRet int16
 87669  	_nRet = _nNew
 87670  	if _pTerm == nil {
 87671  		goto _0
 87672  	}
 87673  	if int32(_pTerm.XtruthProb) <= int32(0) {
 87674  		{
 87675  			p := &_nRet
 87676  			*p = int16(int32(*p) + int32(_pTerm.XtruthProb))
 87677  		}
 87678  		goto _3
 87679  	}
 87680  	if (int32(_pTerm.XwtFlags) & int32(0)) == int32(0) {
 87681  		{
 87682  			p := &_nRet
 87683  			*p = int16(int32(*p) - int32(20))
 87684  		}
 87685  		func() {
 87686  			if int32(20) != int32(_sqlite3LogEst(tls, uint64(4))) {
 87687  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131610), unsafe.Pointer(&_whereRangeAdjustØ00__func__Ø000), unsafe.Pointer(str(106339)))
 87688  				crt.X__builtin_abort(tls)
 87689  			}
 87690  		}()
 87691  	}
 87692  _3:
 87693  _0:
 87694  	return _nRet
 87695  }
 87696  
 87697  var _whereRangeAdjustØ00__func__Ø000 [17]int8
 87698  
 87699  func init() {
 87700  	crt.Xstrncpy(nil, &_whereRangeAdjustØ00__func__Ø000[0], str(106360), 17)
 87701  }
 87702  
 87703  // C comment
 87704  //  /*
 87705  //  ** Add WhereLoop entries to handle OR terms.  This works for either
 87706  //  ** btrees or virtual tables.
 87707  //  */
 87708  func _whereLoopAddOr(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUnusable uint64) (r0 int32) {
 87709  	var _rc, _iCur, _2_once, _2_i, _2_j int32
 87710  	var _pItem *TSrcList_item
 87711  	var _pWInfo *XWhereInfo
 87712  	var _tempWC XWhereClause
 87713  	var _pNew *XWhereLoop
 87714  	var _pTerm, _pWCEnd, _2_pOrWCEnd, _2_pOrTerm *XWhereTerm
 87715  	var _pWC, _2_pOrWC *XWhereClause
 87716  	var _sSum, _sCur, _12_sPrev XWhereOrSet
 87717  	var _sSubBuild XWhereLoopBuilder
 87718  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 87719  	_rc = int32(0)
 87720  	_pWC = (*XWhereClause)(_pBuilder.XpWC)
 87721  	_pWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.Xa) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.XnTerm)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(64)))))))))))
 87722  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 87723  	crt.Xmemset(tls, unsafe.Pointer(&_sSum), int32(0), uint64(56))
 87724  	_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))) + uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(_pNew.XiTab)*uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(112)))))))))))
 87725  	_iCur = _pItem.XiCursor
 87726  	_pTerm = (*XWhereTerm)(_pWC.Xa)
 87727  _0:
 87728  	if crt.P2U(unsafe.Pointer(_pTerm)) >= crt.P2U(unsafe.Pointer(_pWCEnd)) || _rc != int32(0) {
 87729  		goto _4
 87730  	}
 87731  	if (int32(_pTerm.XeOperator)&int32(512)) == int32(0) || (((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu))).Xindexable)&_pNew.XmaskSelf) == (0) {
 87732  		goto _6
 87733  	}
 87734  	_2_pOrWC = &((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu))).Xwc)
 87735  	_2_pOrWCEnd = elem101((*XWhereTerm)(_2_pOrWC.Xa), uintptr(_2_pOrWC.XnTerm))
 87736  	_2_once = int32(1)
 87737  	_sSubBuild = *_pBuilder
 87738  	*(**XExprList)(unsafe.Pointer(&_sSubBuild.XpOrderBy)) = nil
 87739  	*(**XWhereOrSet)(unsafe.Pointer(&_sSubBuild.XpOrSet)) = &_sCur
 87740  	_2_pOrTerm = (*XWhereTerm)(_2_pOrWC.Xa)
 87741  _7:
 87742  	if crt.P2U(unsafe.Pointer(_2_pOrTerm)) >= crt.P2U(unsafe.Pointer(_2_pOrWCEnd)) {
 87743  		goto _10
 87744  	}
 87745  	if (int32(_2_pOrTerm.XeOperator) & int32(1024)) != int32(0) {
 87746  		*(**XWhereClause)(unsafe.Pointer(&_sSubBuild.XpWC)) = &((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_2_pOrTerm.Xu))).Xwc)
 87747  		goto _14
 87748  	}
 87749  	if _2_pOrTerm.XleftCursor == _iCur {
 87750  		*(**XWhereInfo)(unsafe.Pointer(&_tempWC.XpWInfo)) = (*XWhereInfo)(_pWC.XpWInfo)
 87751  		*(**XWhereClause)(unsafe.Pointer(&_tempWC.XpOuter)) = _pWC
 87752  		_tempWC.Xop = uint8(71)
 87753  		_tempWC.XnTerm = int32(1)
 87754  		*(**XWhereTerm)(unsafe.Pointer(&_tempWC.Xa)) = _2_pOrTerm
 87755  		*(**XWhereClause)(unsafe.Pointer(&_sSubBuild.XpWC)) = &_tempWC
 87756  		goto _14
 87757  	}
 87758  	goto _8
 87759  _14:
 87760  	_sCur.Xn = 0
 87761  	if ((*XTable)(_pItem.XpTab).XnModuleArg) != 0 {
 87762  		_rc = _whereLoopAddVirtual(tls, &_sSubBuild, _mPrereq, _mUnusable)
 87763  		goto _16
 87764  	}
 87765  	_rc = _whereLoopAddBtree(tls, &_sSubBuild, _mPrereq)
 87766  _16:
 87767  	if _rc == int32(0) {
 87768  		_rc = _whereLoopAddOr(tls, &_sSubBuild, _mPrereq, _mUnusable)
 87769  	}
 87770  	func() {
 87771  		if _rc != int32(0) && int32(_sCur.Xn) != int32(0) {
 87772  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133724), unsafe.Pointer(&_whereLoopAddOrØ00__func__Ø000), unsafe.Pointer(str(106377)))
 87773  			crt.X__builtin_abort(tls)
 87774  		}
 87775  	}()
 87776  	if int32(_sCur.Xn) == int32(0) {
 87777  		_sSum.Xn = 0
 87778  		goto _10
 87779  	}
 87780  	if _2_once != 0 {
 87781  		_whereOrMove(tls, &_sSum, &_sCur)
 87782  		_2_once = int32(0)
 87783  		goto _24
 87784  	}
 87785  	_whereOrMove(tls, &_12_sPrev, &_sSum)
 87786  	_sSum.Xn = 0
 87787  	_2_i = int32(0)
 87788  _25:
 87789  	if _2_i >= int32(_12_sPrev.Xn) {
 87790  		goto _28
 87791  	}
 87792  	_2_j = int32(0)
 87793  _29:
 87794  	if _2_j >= int32(_sCur.Xn) {
 87795  		goto _32
 87796  	}
 87797  	_whereOrInsert(tls, &_sSum, (elem111((*XWhereOrCost)(unsafe.Pointer(&_12_sPrev.Xa)), uintptr(_2_i)).Xprereq)|(elem111((*XWhereOrCost)(unsafe.Pointer(&_sCur.Xa)), uintptr(_2_j)).Xprereq), _sqlite3LogEstAdd(tls, elem111((*XWhereOrCost)(unsafe.Pointer(&_12_sPrev.Xa)), uintptr(_2_i)).XrRun, elem111((*XWhereOrCost)(unsafe.Pointer(&_sCur.Xa)), uintptr(_2_j)).XrRun), _sqlite3LogEstAdd(tls, elem111((*XWhereOrCost)(unsafe.Pointer(&_12_sPrev.Xa)), uintptr(_2_i)).XnOut, elem111((*XWhereOrCost)(unsafe.Pointer(&_sCur.Xa)), uintptr(_2_j)).XnOut))
 87798  	_2_j += 1
 87799  	goto _29
 87800  _32:
 87801  	_2_i += 1
 87802  	goto _25
 87803  _28:
 87804  _24:
 87805  _8:
 87806  	*(*uintptr)(unsafe.Pointer(&_2_pOrTerm)) += uintptr(64)
 87807  	goto _7
 87808  _10:
 87809  	_pNew.XnLTerm = uint16(1)
 87810  	*elem105((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), 0) = _pTerm
 87811  	_pNew.XwsFlags = uint32(8192)
 87812  	_pNew.XrSetup = 0
 87813  	_pNew.XiSortIdx = 0
 87814  	crt.Xmemset(tls, unsafe.Pointer(&_pNew.Xu), int32(0), uint64(16))
 87815  	_2_i = int32(0)
 87816  _33:
 87817  	if _rc != int32(0) || _2_i >= int32(_sSum.Xn) {
 87818  		goto _37
 87819  	}
 87820  	_pNew.XrRun = int16(int32(elem111((*XWhereOrCost)(unsafe.Pointer(&_sSum.Xa)), uintptr(_2_i)).XrRun) + int32(1))
 87821  	_pNew.XnOut = elem111((*XWhereOrCost)(unsafe.Pointer(&_sSum.Xa)), uintptr(_2_i)).XnOut
 87822  	_pNew.Xprereq = elem111((*XWhereOrCost)(unsafe.Pointer(&_sSum.Xa)), uintptr(_2_i)).Xprereq
 87823  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 87824  	_2_i += 1
 87825  	goto _33
 87826  _37:
 87827  _6:
 87828  	*(*uintptr)(unsafe.Pointer(&_pTerm)) += uintptr(64)
 87829  	goto _0
 87830  _4:
 87831  	return _rc
 87832  }
 87833  
 87834  var _whereLoopAddOrØ00__func__Ø000 [15]int8
 87835  
 87836  func init() {
 87837  	crt.Xstrncpy(nil, &_whereLoopAddOrØ00__func__Ø000[0], str(106404), 15)
 87838  }
 87839  
 87840  // C comment
 87841  //  /*
 87842  //  ** Move the content of pSrc into pDest
 87843  //  */
 87844  func _whereOrMove(tls *crt.TLS, _pDest *XWhereOrSet, _pSrc *XWhereOrSet) {
 87845  	_pDest.Xn = _pSrc.Xn
 87846  	crt.Xmemcpy(tls, unsafe.Pointer(&_pDest.Xa), unsafe.Pointer(&_pSrc.Xa), uint64(_pDest.Xn)*uint64(16))
 87847  }
 87848  
 87849  // C comment
 87850  //  /*
 87851  //  ** Given the list of WhereLoop objects at pWInfo->pLoops, this routine
 87852  //  ** attempts to find the lowest cost path that visits each WhereLoop
 87853  //  ** once.  This path is then loaded into the pWInfo->a[].pWLoop fields.
 87854  //  **
 87855  //  ** Assume that the total number of output rows that will need to be sorted
 87856  //  ** will be nRowEst (in the 10*log2 representation).  Or, ignore sorting
 87857  //  ** costs if nRowEst==0.
 87858  //  **
 87859  //  ** Return SQLITE_OK on success or SQLITE_NOMEM of a memory allocation
 87860  //  ** error occurs.
 87861  //  */
 87862  func _wherePathSolver(tls *crt.TLS, _pWInfo *XWhereInfo, _nRowEst int16) (r0 int32) {
 87863  	var _mxCost, _mxUnsorted, _8_nOut, _8_rCost, _8_rUnsorted int16
 87864  	var _mxChoice, _nLoop, _iLoop, _ii, _jj, _mxI, _nOrderBy, _nTo, _nFrom, _nSpace, _29_rc, _37_rc, _39_nOrder int32
 87865  	var _8_isOrdered int8
 87866  	var _36_wsFlags uint32
 87867  	var _8_maskNew, _8_revMask, _29_notUsed, _37_m, _39_revMask uint64
 87868  	var _pSpace *int8
 87869  	var _db *Xsqlite3
 87870  	var _pParse *XParse
 87871  	var _aSortCost *int16
 87872  	var _pWLoop *XWhereLoop
 87873  	var _28_pLevel *XWhereLevel
 87874  	var _pX **XWhereLoop
 87875  	var _aFrom, _aTo, _pFrom, _pTo *XWherePath
 87876  	_mxI = int32(0)
 87877  	_mxCost = int16(0)
 87878  	_mxUnsorted = int16(0)
 87879  	_aSortCost = nil
 87880  	_pParse = (*XParse)(_pWInfo.XpParse)
 87881  	_db = (*Xsqlite3)(_pParse.Xdb)
 87882  	_nLoop = int32(_pWInfo.XnLevel)
 87883  	_mxChoice = func() int32 {
 87884  		if _nLoop <= int32(1) {
 87885  			return int32(1)
 87886  		}
 87887  		return func() int32 {
 87888  			if _nLoop == int32(2) {
 87889  				return int32(5)
 87890  			}
 87891  			return int32(10)
 87892  		}()
 87893  	}()
 87894  	func() {
 87895  		if _nLoop > ((*XSrcList)(_pWInfo.XpTabList).XnSrc) {
 87896  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134255), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106419)))
 87897  			crt.X__builtin_abort(tls)
 87898  		}
 87899  	}()
 87900  	if ((*XExprList)(_pWInfo.XpOrderBy) == nil) || (int32(_nRowEst) == int32(0)) {
 87901  		_nOrderBy = int32(0)
 87902  		goto _8
 87903  	}
 87904  	_nOrderBy = (*XExprList)(_pWInfo.XpOrderBy).XnExpr
 87905  _8:
 87906  	_nSpace = int32(((uint64(32) + (uint64(8) * uint64(_nLoop))) * uint64(_mxChoice)) * uint64(2))
 87907  	{
 87908  		p := &_nSpace
 87909  		*p = int32(uint64(*p) + (uint64(2) * uint64(_nOrderBy)))
 87910  	}
 87911  	_pSpace = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nSpace)))
 87912  	if _pSpace == nil {
 87913  		return _sqlite3NomemError(tls, int32(134273))
 87914  	}
 87915  	_aTo = (*XWherePath)(unsafe.Pointer(_pSpace))
 87916  	_aFrom = (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aTo)) + uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(_mxChoice)*uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(32)))))))))))
 87917  	crt.Xmemset(tls, unsafe.Pointer(_aFrom), int32(0), uint64(32))
 87918  	_pX = (**XWhereLoop)(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrom)) + uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(_mxChoice)*uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(32)))))))))))))
 87919  	*func() **XWherePath { _ii = _mxChoice * int32(2); return &_pFrom }() = _aTo
 87920  _10:
 87921  	if _ii <= int32(0) {
 87922  		goto _13
 87923  	}
 87924  	*(***XWhereLoop)(unsafe.Pointer(&_pFrom.XaLoop)) = _pX
 87925  	*(*uintptr)(unsafe.Pointer(func() ***XWhereLoop {
 87926  		*(*uintptr)(unsafe.Pointer(func() **XWherePath { _ii -= 1; return &_pFrom }())) += uintptr(32)
 87927  		return &_pX
 87928  	}())) += 8 * uintptr(_nLoop)
 87929  	goto _10
 87930  _13:
 87931  	if _nOrderBy != 0 {
 87932  		_aSortCost = (*int16)(unsafe.Pointer(_pX))
 87933  		crt.Xmemset(tls, unsafe.Pointer(_aSortCost), int32(0), uint64(2)*uint64(_nOrderBy))
 87934  	}
 87935  	func() {
 87936  		if _aSortCost != nil && elem1(_pSpace, uintptr(_nSpace)) != (*int8)(unsafe.Pointer(elem52(_aSortCost, uintptr(_nOrderBy)))) {
 87937  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134291), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106449)))
 87938  			crt.X__builtin_abort(tls)
 87939  		}
 87940  	}()
 87941  	func() {
 87942  		if _aSortCost == nil && elem1(_pSpace, uintptr(_nSpace)) != (*int8)(unsafe.Pointer(_pX)) {
 87943  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134292), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106510)))
 87944  			crt.X__builtin_abort(tls)
 87945  		}
 87946  	}()
 87947  	elem112(_aFrom, 0).XnRow = int16(func() uint32 {
 87948  		if _pParse.XnQueryLoop < uint32(48) {
 87949  			return _pParse.XnQueryLoop
 87950  		}
 87951  		return uint32(48)
 87952  	}())
 87953  	func() {
 87954  		if int32(48) != int32(_sqlite3LogEst(tls, uint64(28))) {
 87955  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134299), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106553)))
 87956  			crt.X__builtin_abort(tls)
 87957  		}
 87958  	}()
 87959  	_nFrom = int32(1)
 87960  	func() {
 87961  		if int32(elem112(_aFrom, 0).XisOrdered) != int32(0) {
 87962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134301), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106575)))
 87963  			crt.X__builtin_abort(tls)
 87964  		}
 87965  	}()
 87966  	if _nOrderBy != 0 {
 87967  		elem112(_aFrom, 0).XisOrdered = int8(func() int32 {
 87968  			if _nLoop > int32(0) {
 87969  				return int32(-1)
 87970  			}
 87971  			return _nOrderBy
 87972  		}())
 87973  	}
 87974  	_iLoop = int32(0)
 87975  _30:
 87976  	if _iLoop >= _nLoop {
 87977  		goto _33
 87978  	}
 87979  	_nTo = int32(0)
 87980  	*func() **XWherePath { _ii = int32(0); return &_pFrom }() = _aFrom
 87981  _34:
 87982  	if _ii >= _nFrom {
 87983  		goto _37
 87984  	}
 87985  	_pWLoop = (*XWhereLoop)(_pWInfo.XpLoops)
 87986  _38:
 87987  	if _pWLoop == nil {
 87988  		goto _41
 87989  	}
 87990  	_8_isOrdered = _pFrom.XisOrdered
 87991  	_8_revMask = 0
 87992  	if (_pWLoop.Xprereq & (^_pFrom.XmaskLoop)) != (0) {
 87993  		goto _39
 87994  	}
 87995  	if (_pWLoop.XmaskSelf & _pFrom.XmaskLoop) != (0) {
 87996  		goto _39
 87997  	}
 87998  	if ((_pWLoop.XwsFlags & uint32(16384)) != (0)) && (int32(_pFrom.XnRow) < int32(10)) {
 87999  		func() {
 88000  			if int32(10) != int32(_sqlite3LogEst(tls, uint64(2))) {
 88001  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134331), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(86888)))
 88002  				crt.X__builtin_abort(tls)
 88003  			}
 88004  		}()
 88005  		goto _39
 88006  	}
 88007  	_8_rUnsorted = _sqlite3LogEstAdd(tls, _pWLoop.XrSetup, int16(int32(_pWLoop.XrRun)+int32(_pFrom.XnRow)))
 88008  	_8_rUnsorted = _sqlite3LogEstAdd(tls, _8_rUnsorted, _pFrom.XrUnsorted)
 88009  	_8_nOut = int16(int32(_pFrom.XnRow) + int32(_pWLoop.XnOut))
 88010  	_8_maskNew = _pFrom.XmaskLoop | _pWLoop.XmaskSelf
 88011  	if int32(_8_isOrdered) < int32(0) {
 88012  		_8_isOrdered = _wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.XpOrderBy), _pFrom, _pWInfo.XwctrlFlags, uint16(_iLoop), _pWLoop, &_8_revMask)
 88013  		goto _49
 88014  	}
 88015  	_8_revMask = _pFrom.XrevLoop
 88016  _49:
 88017  	if int32(_8_isOrdered) < int32(0) || int32(_8_isOrdered) >= _nOrderBy {
 88018  		goto _51
 88019  	}
 88020  	if int32(*elem52(_aSortCost, uintptr(_8_isOrdered))) == int32(0) {
 88021  		*elem52(_aSortCost, uintptr(_8_isOrdered)) = _whereSortingCost(tls, _pWInfo, _nRowEst, _nOrderBy, int32(_8_isOrdered))
 88022  	}
 88023  	_8_rCost = _sqlite3LogEstAdd(tls, _8_rUnsorted, *elem52(_aSortCost, uintptr(_8_isOrdered)))
 88024  	goto _53
 88025  _51:
 88026  	_8_rCost = _8_rUnsorted
 88027  _53:
 88028  	*func() **XWherePath { _jj = int32(0); return &_pTo }() = _aTo
 88029  _54:
 88030  	if _jj >= _nTo {
 88031  		goto _57
 88032  	}
 88033  	if (_pTo.XmaskLoop == _8_maskNew) && (((int32(_pTo.XisOrdered) ^ int32(_8_isOrdered)) & int32(128)) == int32(0)) {
 88034  		goto _57
 88035  	}
 88036  	*(*uintptr)(unsafe.Pointer(func() **XWherePath { _jj += 1; return &_pTo }())) += uintptr(32)
 88037  	goto _54
 88038  _57:
 88039  	if _jj < _nTo {
 88040  		goto _60
 88041  	}
 88042  	if (_nTo >= _mxChoice) && ((int32(_8_rCost) > int32(_mxCost)) || ((int32(_8_rCost) == int32(_mxCost)) && (int32(_8_rUnsorted) >= int32(_mxUnsorted)))) {
 88043  		goto _39
 88044  	}
 88045  	if _nTo < _mxChoice {
 88046  		_jj = postInc2(&_nTo, 1)
 88047  		goto _66
 88048  	}
 88049  	_jj = _mxI
 88050  _66:
 88051  	_pTo = elem112(_aTo, uintptr(_jj))
 88052  	goto _67
 88053  _60:
 88054  	if (int32(_pTo.XrCost) < int32(_8_rCost)) || ((int32(_pTo.XrCost) == int32(_8_rCost)) && (int32(_pTo.XnRow) <= int32(_8_nOut))) {
 88055  		goto _39
 88056  	}
 88057  _67:
 88058  	_pTo.XmaskLoop = _pFrom.XmaskLoop | _pWLoop.XmaskSelf
 88059  	_pTo.XrevLoop = _8_revMask
 88060  	_pTo.XnRow = _8_nOut
 88061  	_pTo.XrCost = _8_rCost
 88062  	_pTo.XrUnsorted = _8_rUnsorted
 88063  	_pTo.XisOrdered = _8_isOrdered
 88064  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo.XaLoop), unsafe.Pointer(_pFrom.XaLoop), uint64(8)*uint64(_iLoop))
 88065  	*elem113((**XWhereLoop)(unsafe.Pointer(_pTo.XaLoop)), uintptr(_iLoop)) = _pWLoop
 88066  	if _nTo < _mxChoice {
 88067  		goto _71
 88068  	}
 88069  	_mxI = int32(0)
 88070  	_mxCost = elem112(_aTo, 0).XrCost
 88071  	_mxUnsorted = elem112(_aTo, 0).XnRow
 88072  	*func() **XWherePath { _jj = int32(1); return &_pTo }() = elem112(_aTo, uintptr(1))
 88073  _72:
 88074  	if _jj >= _mxChoice {
 88075  		goto _75
 88076  	}
 88077  	if (int32(_pTo.XrCost) > int32(_mxCost)) || ((int32(_pTo.XrCost) == int32(_mxCost)) && (int32(_pTo.XrUnsorted) > int32(_mxUnsorted))) {
 88078  		_mxCost = _pTo.XrCost
 88079  		_mxUnsorted = _pTo.XrUnsorted
 88080  		_mxI = _jj
 88081  	}
 88082  	*(*uintptr)(unsafe.Pointer(func() **XWherePath { _jj += 1; return &_pTo }())) += uintptr(32)
 88083  	goto _72
 88084  _75:
 88085  _71:
 88086  _39:
 88087  	_pWLoop = (*XWhereLoop)(_pWLoop.XpNextLoop)
 88088  	goto _38
 88089  _41:
 88090  	*(*uintptr)(unsafe.Pointer(func() **XWherePath { _ii += 1; return &_pFrom }())) += uintptr(32)
 88091  	goto _34
 88092  _37:
 88093  	_pFrom = _aTo
 88094  	_aTo = _aFrom
 88095  	_aFrom = _pFrom
 88096  	_nFrom = _nTo
 88097  	_iLoop += 1
 88098  	goto _30
 88099  _33:
 88100  	if _nFrom == int32(0) {
 88101  		_sqlite3ErrorMsg(tls, _pParse, str(106597))
 88102  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pSpace))
 88103  		return int32(1)
 88104  	}
 88105  	_pFrom = _aFrom
 88106  	_ii = int32(1)
 88107  _80:
 88108  	if _ii >= _nFrom {
 88109  		goto _83
 88110  	}
 88111  	if int32(_pFrom.XrCost) > int32(elem112(_aFrom, uintptr(_ii)).XrCost) {
 88112  		_pFrom = elem112(_aFrom, uintptr(_ii))
 88113  	}
 88114  	_ii += 1
 88115  	goto _80
 88116  _83:
 88117  	func() {
 88118  		if int32(_pWInfo.XnLevel) != _nLoop {
 88119  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134512), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106615)))
 88120  			crt.X__builtin_abort(tls)
 88121  		}
 88122  	}()
 88123  	_iLoop = int32(0)
 88124  _87:
 88125  	if _iLoop >= _nLoop {
 88126  		goto _90
 88127  	}
 88128  	_28_pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pWInfo.Xa)) + uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer(uintptr(_iLoop)*uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer(uintptr(88)))))))))))
 88129  	*(**XWhereLoop)(unsafe.Pointer(&_28_pLevel.XpWLoop)) = store110(&_pWLoop, *elem113((**XWhereLoop)(unsafe.Pointer(_pFrom.XaLoop)), uintptr(_iLoop)))
 88130  	_28_pLevel.XiFrom = _pWLoop.XiTab
 88131  	_28_pLevel.XiTabCur = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))), uintptr(_28_pLevel.XiFrom)).XiCursor
 88132  	_iLoop += 1
 88133  	goto _87
 88134  _90:
 88135  	if (int32(_pWInfo.XwctrlFlags)&int32(256)) == int32(0) || (int32(_pWInfo.XwctrlFlags)&int32(128)) != int32(0) || int32(_pWInfo.XeDistinct) != int32(0) || _nRowEst == 0 {
 88136  		goto _94
 88137  	}
 88138  	_29_rc = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.XpResultSet), _pFrom, uint16(128), uint16(_nLoop-int32(1)), *elem113((**XWhereLoop)(unsafe.Pointer(_pFrom.XaLoop)), uintptr(_nLoop-int32(1))), &_29_notUsed))
 88139  	if _29_rc == ((*XExprList)(_pWInfo.XpResultSet).XnExpr) {
 88140  		_pWInfo.XeDistinct = uint8(2)
 88141  	}
 88142  _94:
 88143  	if _pWInfo.XpOrderBy == nil {
 88144  		goto _96
 88145  	}
 88146  	if (int32(_pWInfo.XwctrlFlags) & int32(128)) == 0 {
 88147  		goto _97
 88148  	}
 88149  	if int32(_pFrom.XisOrdered) == ((*XExprList)(_pWInfo.XpOrderBy).XnExpr) {
 88150  		_pWInfo.XeDistinct = uint8(2)
 88151  	}
 88152  	goto _99
 88153  _97:
 88154  	_pWInfo.XnOBSat = _pFrom.XisOrdered
 88155  	_pWInfo.XrevMask = _pFrom.XrevLoop
 88156  	if int32(_pWInfo.XnOBSat) > int32(0) {
 88157  		goto _100
 88158  	}
 88159  	_pWInfo.XnOBSat = 0
 88160  	if _nLoop <= int32(0) {
 88161  		goto _101
 88162  	}
 88163  	_36_wsFlags = (*elem113((**XWhereLoop)(unsafe.Pointer(_pFrom.XaLoop)), uintptr(_nLoop-int32(1)))).XwsFlags
 88164  	if (_36_wsFlags&uint32(4096)) != (0) || (_36_wsFlags&uint32(260)) == uint32(260) {
 88165  		goto _103
 88166  	}
 88167  	_37_m = uint64(0)
 88168  	_37_rc = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.XpOrderBy), _pFrom, uint16(2048), uint16(_nLoop-int32(1)), *elem113((**XWhereLoop)(unsafe.Pointer(_pFrom.XaLoop)), uintptr(_nLoop-int32(1))), &_37_m))
 88169  	if _37_rc == ((*XExprList)(_pWInfo.XpOrderBy).XnExpr) {
 88170  		_pWInfo.XbOrderedInnerLoop = uint8(1)
 88171  		_pWInfo.XrevMask = _37_m
 88172  	}
 88173  _103:
 88174  _101:
 88175  _100:
 88176  _99:
 88177  	if (int32(_pWInfo.XwctrlFlags)&int32(512)) == 0 || int32(_pWInfo.XnOBSat) != ((*XExprList)(_pWInfo.XpOrderBy).XnExpr) || _nLoop <= int32(0) {
 88178  		goto _107
 88179  	}
 88180  	_39_revMask = uint64(0)
 88181  	_39_nOrder = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.XpOrderBy), _pFrom, 0, uint16(_nLoop-int32(1)), *elem113((**XWhereLoop)(unsafe.Pointer(_pFrom.XaLoop)), uintptr(_nLoop-int32(1))), &_39_revMask))
 88182  	func() {
 88183  		if int32(_pWInfo.Xsorted) != int32(0) {
 88184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134567), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106637)))
 88185  			crt.X__builtin_abort(tls)
 88186  		}
 88187  	}()
 88188  	if _39_nOrder == ((*XExprList)(_pWInfo.XpOrderBy).XnExpr) {
 88189  		_pWInfo.Xsorted = uint8(1)
 88190  		_pWInfo.XrevMask = _39_revMask
 88191  	}
 88192  _107:
 88193  _96:
 88194  	_pWInfo.XnRowOut = _pFrom.XnRow
 88195  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pSpace))
 88196  	return int32(0)
 88197  }
 88198  
 88199  var _wherePathSolverØ00__func__Ø000 [16]int8
 88200  
 88201  func init() {
 88202  	crt.Xstrncpy(nil, &_wherePathSolverØ00__func__Ø000[0], str(106655), 16)
 88203  }
 88204  
 88205  // C comment
 88206  //  /*
 88207  //  ** Examine a WherePath (with the addition of the extra WhereLoop of the 6th
 88208  //  ** parameters) to see if it outputs rows in the requested ORDER BY
 88209  //  ** (or GROUP BY) without requiring a separate sort operation.  Return N:
 88210  //  **
 88211  //  **   N>0:   N terms of the ORDER BY clause are satisfied
 88212  //  **   N==0:  No terms of the ORDER BY clause are satisfied
 88213  //  **   N<0:   Unknown yet how many terms of ORDER BY might be satisfied.
 88214  //  **
 88215  //  ** Note that processing for WHERE_GROUPBY and WHERE_DISTINCTBY is not as
 88216  //  ** strict.  With GROUP BY and DISTINCT the only requirement is that
 88217  //  ** equivalent rows appear immediately adjacent to one another.  GROUP BY
 88218  //  ** and DISTINCT do not require rows to appear in any particular order as long
 88219  //  ** as equivalent rows are grouped together.  Thus for GROUP BY and DISTINCT
 88220  //  ** the pOrderBy terms can be matched in any order.  With ORDER BY, the
 88221  //  ** pOrderBy terms must be matched in strict left-to-right order.
 88222  //  */
 88223  func _wherePathSatisfiesOrderBy(tls *crt.TLS, _pWInfo *XWhereInfo, _pOrderBy *XExprList, _pPath *XWherePath, _wctrlFlags uint16, _nLoop uint16, _pLast *XWhereLoop, _pRevMask *uint64) (r0 int8) {
 88224  	var _iLoop, _i, _j, _iCur, _iColumn int32
 88225  	var _obSat, _obDone, _orderDistinctMask, _ready, _38_mTerm, _41_m uint64
 88226  	var _9_z1, _9_z2 *int8
 88227  	var _eqOpMask, _nKeyCol, _nColumn, _nOrderBy, _15_eOp uint16
 88228  	var _revSet, _rev, _revIdx, _isOrderDistinct, _distinctColumns, _isMatch, _14_bOnce uint8
 88229  	var _db *Xsqlite3
 88230  	var _pOBExpr, _18_pX, _38_p *XExpr
 88231  	var _pIndex *XIndex
 88232  	var _pColl *XCollSeq
 88233  	var _pLoop *XWhereLoop
 88234  	var _pTerm *XWhereTerm
 88235  	_pLoop = nil
 88236  	_db = (*Xsqlite3)((*XParse)(_pWInfo.XpParse).Xdb)
 88237  	_obSat = uint64(0)
 88238  	func() {
 88239  		if _pOrderBy == nil {
 88240  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133901), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106671)))
 88241  			crt.X__builtin_abort(tls)
 88242  		}
 88243  	}()
 88244  	if (_nLoop != 0) && ((int32(_db.XdbOptFlags) & int32(128)) != int32(0)) {
 88245  		return 0
 88246  	}
 88247  	_nOrderBy = uint16(_pOrderBy.XnExpr)
 88248  	if int32(_nOrderBy) > int32(63) {
 88249  		return 0
 88250  	}
 88251  	_isOrderDistinct = uint8(1)
 88252  	_obDone = (uint64(1) << uint(int32(_nOrderBy))) - uint64(1)
 88253  	_orderDistinctMask = 0
 88254  	_ready = 0
 88255  	_eqOpMask = uint16(386)
 88256  	if (int32(_wctrlFlags) & int32(2048)) != 0 {
 88257  		{
 88258  			p := &_eqOpMask
 88259  			*p = uint16(int32(*p) | int32(1))
 88260  		}
 88261  	}
 88262  	_iLoop = int32(0)
 88263  _6:
 88264  	if _isOrderDistinct == 0 || _obSat >= _obDone || _iLoop > int32(_nLoop) {
 88265  		goto _11
 88266  	}
 88267  	if _iLoop > int32(0) {
 88268  		_ready |= _pLoop.XmaskSelf
 88269  	}
 88270  	if _iLoop >= int32(_nLoop) {
 88271  		goto _13
 88272  	}
 88273  	_pLoop = *elem113((**XWhereLoop)(unsafe.Pointer(_pPath.XaLoop)), uintptr(_iLoop))
 88274  	if (int32(_wctrlFlags) & int32(2048)) != 0 {
 88275  		goto _7
 88276  	}
 88277  	goto _15
 88278  _13:
 88279  	_pLoop = _pLast
 88280  _15:
 88281  	if (_pLoop.XwsFlags & uint32(1024)) == 0 {
 88282  		goto _16
 88283  	}
 88284  	if ((*t106)(unsafe.Pointer(&_pLoop.Xu)).XisOrdered) != 0 {
 88285  		_obSat = _obDone
 88286  	}
 88287  	goto _11
 88288  _16:
 88289  	(*t102)(unsafe.Pointer(&_pLoop.Xu)).XnIdxCol = 0
 88290  	_iCur = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))), uintptr(_pLoop.XiTab)).XiCursor
 88291  	_i = int32(0)
 88292  _19:
 88293  	if _i >= int32(_nOrderBy) {
 88294  		goto _22
 88295  	}
 88296  	if ((uint64(1) << uint(_i)) & _obSat) != 0 {
 88297  		goto _20
 88298  	}
 88299  	_pOBExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr))
 88300  	if int32(_pOBExpr.Xop) != int32(152) {
 88301  		goto _20
 88302  	}
 88303  	if _pOBExpr.XiTable != _iCur {
 88304  		goto _20
 88305  	}
 88306  	_pTerm = _sqlite3WhereFindTerm(tls, &_pWInfo.XsWC, _iCur, int32(_pOBExpr.XiColumn), ^_ready, uint32(_eqOpMask), nil)
 88307  	if _pTerm == nil {
 88308  		goto _20
 88309  	}
 88310  	if int32(_pTerm.XeOperator) != int32(1) {
 88311  		goto _27
 88312  	}
 88313  	func() {
 88314  		if (int32(_wctrlFlags) & int32(2048)) == 0 {
 88315  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133946), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106683)))
 88316  			crt.X__builtin_abort(tls)
 88317  		}
 88318  	}()
 88319  	_j = int32(0)
 88320  _30:
 88321  	if _j >= int32(_pLoop.XnLTerm) || _pTerm == (*elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))) {
 88322  		goto _34
 88323  	}
 88324  	_j += 1
 88325  	goto _30
 88326  _34:
 88327  	if _j >= int32(_pLoop.XnLTerm) {
 88328  		goto _20
 88329  	}
 88330  _27:
 88331  	if (int32(_pTerm.XeOperator)&int32(130)) == int32(0) || int32(_pOBExpr.XiColumn) < int32(0) {
 88332  		goto _37
 88333  	}
 88334  	_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.XpParse), (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr))
 88335  	if _pColl == nil {
 88336  		_pColl = (*XCollSeq)(_db.XpDfltColl)
 88337  	}
 88338  	_9_z1 = _pColl.XzName
 88339  	_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.XpParse), (*XExpr)(_pTerm.XpExpr))
 88340  	if _pColl == nil {
 88341  		_pColl = (*XCollSeq)(_db.XpDfltColl)
 88342  	}
 88343  	_9_z2 = _pColl.XzName
 88344  	if _sqlite3StrICmp(tls, _9_z1, _9_z2) != int32(0) {
 88345  		goto _20
 88346  	}
 88347  _37:
 88348  	_obSat |= uint64(1) << uint(_i)
 88349  _20:
 88350  	_i += 1
 88351  	goto _19
 88352  _22:
 88353  	if (_pLoop.XwsFlags & uint32(4096)) != (0) {
 88354  		goto _41
 88355  	}
 88356  	if (_pLoop.XwsFlags & uint32(256)) != 0 {
 88357  		_pIndex = nil
 88358  		_nKeyCol = 0
 88359  		_nColumn = uint16(1)
 88360  		goto _46
 88361  	}
 88362  	if (store114(&_pIndex, (*XIndex)((*t102)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)) == nil) || (((uint32(_pIndex.XidxType>>2) << 31) >> 31) != 0) {
 88363  		return 0
 88364  	}
 88365  	_nKeyCol = _pIndex.XnKeyCol
 88366  	_nColumn = _pIndex.XnColumn
 88367  	func() {
 88368  		if int32(_nColumn) != (int32(_nKeyCol)+int32(1)) && (((*XTable)(_pIndex.XpTable).XtabFlags)&uint32(32)) == (0) {
 88369  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133974), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106716)))
 88370  			crt.X__builtin_abort(tls)
 88371  		}
 88372  	}()
 88373  	func() {
 88374  		if int32(*elem52(_pIndex.XaiColumn, uintptr(int32(_nColumn)-int32(1)))) != int32(-1) && (((*XTable)(_pIndex.XpTable).XtabFlags)&uint32(32)) == (0) {
 88375  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133975), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106764)))
 88376  			crt.X__builtin_abort(tls)
 88377  		}
 88378  	}()
 88379  	_isOrderDistinct = uint8(bool2int(int32(_pIndex.XonError) != int32(0)))
 88380  _46:
 88381  	_rev = store3(&_revSet, 0)
 88382  	_distinctColumns = 0
 88383  	_j = int32(0)
 88384  _53:
 88385  	if _j >= int32(_nColumn) {
 88386  		goto _56
 88387  	}
 88388  	_14_bOnce = uint8(1)
 88389  	func() {
 88390  		if _j < int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq) && ((*elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))) == nil) != (_j < int32(_pLoop.XnSkip)) {
 88391  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133988), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106831)))
 88392  			crt.X__builtin_abort(tls)
 88393  		}
 88394  	}()
 88395  	if _j >= int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq) || _j < int32(_pLoop.XnSkip) {
 88396  		goto _61
 88397  	}
 88398  	_15_eOp = (*elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))).XeOperator
 88399  	if (int32(_15_eOp) & int32(_eqOpMask)) == int32(0) {
 88400  		goto _62
 88401  	}
 88402  	if (int32(_15_eOp) & int32(256)) != 0 {
 88403  		_isOrderDistinct = 0
 88404  	}
 88405  	goto _54
 88406  _62:
 88407  	if func() int32 {
 88408  		if (int32(_15_eOp) & int32(1)) != 0 {
 88409  			return int32(1)
 88410  		}
 88411  		return func() int32 {
 88412  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134008), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(4809)))
 88413  			crt.X__builtin_abort(tls)
 88414  			return int32(0)
 88415  		}()
 88416  	}() == 0 {
 88417  		goto _67
 88418  	}
 88419  	_18_pX = (*XExpr)((*elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))).XpExpr)
 88420  	_i = _j + int32(1)
 88421  _68:
 88422  	if _i >= int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq) {
 88423  		goto _71
 88424  	}
 88425  	if (*XExpr)((*elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_i))).XpExpr) == _18_pX {
 88426  		func() {
 88427  			if (int32((*elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_i))).XeOperator) & int32(1)) == 0 {
 88428  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134016), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106896)))
 88429  				crt.X__builtin_abort(tls)
 88430  			}
 88431  		}()
 88432  		_14_bOnce = 0
 88433  		goto _71
 88434  	}
 88435  	_i += 1
 88436  	goto _68
 88437  _71:
 88438  _67:
 88439  _61:
 88440  	if _pIndex == nil {
 88441  		goto _75
 88442  	}
 88443  	_iColumn = int32(*elem52(_pIndex.XaiColumn, uintptr(_j)))
 88444  	_revIdx = *elem15(_pIndex.XaSortOrder, uintptr(_j))
 88445  	if _iColumn == int32((*XTable)(_pIndex.XpTable).XiPKey) {
 88446  		_iColumn = int32(-1)
 88447  	}
 88448  	goto _77
 88449  _75:
 88450  	_iColumn = int32(-1)
 88451  	_revIdx = 0
 88452  _77:
 88453  	if (((_isOrderDistinct != 0) && (_iColumn >= int32(0))) && (_j >= int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq))) && (int32(elem43((*XColumn)((*XTable)(_pIndex.XpTable).XaCol), uintptr(_iColumn)).XnotNull) == int32(0)) {
 88454  		_isOrderDistinct = 0
 88455  	}
 88456  	_isMatch = 0
 88457  	_i = int32(0)
 88458  _82:
 88459  	if _14_bOnce == 0 || _i >= int32(_nOrderBy) {
 88460  		goto _86
 88461  	}
 88462  	if ((uint64(1) << uint(_i)) & _obSat) != 0 {
 88463  		goto _83
 88464  	}
 88465  	_pOBExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr))
 88466  	if (int32(_wctrlFlags) & int32(192)) == int32(0) {
 88467  		_14_bOnce = 0
 88468  	}
 88469  	if _iColumn < int32(-1) {
 88470  		goto _89
 88471  	}
 88472  	if int32(_pOBExpr.Xop) != int32(152) {
 88473  		goto _83
 88474  	}
 88475  	if _pOBExpr.XiTable != _iCur {
 88476  		goto _83
 88477  	}
 88478  	if int32(_pOBExpr.XiColumn) != _iColumn {
 88479  		goto _83
 88480  	}
 88481  	goto _93
 88482  _89:
 88483  	if _sqlite3ExprCompare(tls, _pOBExpr, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIndex.XaColExpr).Xa))), uintptr(_j)).XpExpr), _iCur) != 0 {
 88484  		goto _83
 88485  	}
 88486  _93:
 88487  	if _iColumn < int32(0) {
 88488  		goto _95
 88489  	}
 88490  	_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.XpParse), (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr))
 88491  	if _pColl == nil {
 88492  		_pColl = (*XCollSeq)(_db.XpDfltColl)
 88493  	}
 88494  	if _sqlite3StrICmp(tls, _pColl.XzName, *elem0(_pIndex.XazColl, uintptr(_j))) != int32(0) {
 88495  		goto _83
 88496  	}
 88497  _95:
 88498  	(*t102)(unsafe.Pointer(&_pLoop.Xu)).XnIdxCol = uint16(_j + int32(1))
 88499  	_isMatch = uint8(1)
 88500  	goto _86
 88501  _83:
 88502  	_i += 1
 88503  	goto _82
 88504  _86:
 88505  	if _isMatch == 0 || (int32(_wctrlFlags)&int32(64)) != int32(0) {
 88506  		goto _99
 88507  	}
 88508  	if _revSet == 0 {
 88509  		goto _100
 88510  	}
 88511  	if (int32(_rev) ^ int32(_revIdx)) != int32(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XsortOrder) {
 88512  		_isMatch = 0
 88513  	}
 88514  	goto _102
 88515  _100:
 88516  	_rev = uint8(int32(_revIdx) ^ int32(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XsortOrder))
 88517  	if _rev != 0 {
 88518  		*_pRevMask |= uint64(1) << uint(_iLoop)
 88519  	}
 88520  	_revSet = uint8(1)
 88521  _102:
 88522  _99:
 88523  	if _isMatch == 0 {
 88524  		goto _104
 88525  	}
 88526  	if _iColumn == int32(-1) {
 88527  		_distinctColumns = uint8(1)
 88528  	}
 88529  	_obSat |= uint64(1) << uint(_i)
 88530  	goto _106
 88531  _104:
 88532  	if (_j == int32(0)) || (_j < int32(_nKeyCol)) {
 88533  		_isOrderDistinct = 0
 88534  	}
 88535  	goto _56
 88536  _106:
 88537  _54:
 88538  	_j += 1
 88539  	goto _53
 88540  _56:
 88541  	if _distinctColumns != 0 {
 88542  		_isOrderDistinct = uint8(1)
 88543  	}
 88544  _41:
 88545  	if _isOrderDistinct == 0 {
 88546  		goto _110
 88547  	}
 88548  	_orderDistinctMask |= _pLoop.XmaskSelf
 88549  	_i = int32(0)
 88550  _111:
 88551  	if _i >= int32(_nOrderBy) {
 88552  		goto _114
 88553  	}
 88554  	if ((uint64(1) << uint(_i)) & _obSat) != 0 {
 88555  		goto _112
 88556  	}
 88557  	_38_p = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr)
 88558  	_38_mTerm = _sqlite3WhereExprUsage(tls, &_pWInfo.XsMaskSet, _38_p)
 88559  	if (_38_mTerm == (0)) && (_sqlite3ExprIsConstant(tls, _38_p) == 0) {
 88560  		goto _112
 88561  	}
 88562  	if (_38_mTerm & (^_orderDistinctMask)) == (0) {
 88563  		_obSat |= uint64(1) << uint(_i)
 88564  	}
 88565  _112:
 88566  	_i += 1
 88567  	goto _111
 88568  _114:
 88569  _110:
 88570  _7:
 88571  	_iLoop += 1
 88572  	goto _6
 88573  _11:
 88574  	if _obSat == _obDone {
 88575  		return int8(_nOrderBy)
 88576  	}
 88577  	if _isOrderDistinct != 0 {
 88578  		goto _120
 88579  	}
 88580  	_i = int32(_nOrderBy) - int32(1)
 88581  _121:
 88582  	if _i <= int32(0) {
 88583  		goto _124
 88584  	}
 88585  	_41_m = (uint64(1) << uint(_i)) - uint64(1)
 88586  	if (_obSat & _41_m) == _41_m {
 88587  		return int8(_i)
 88588  	}
 88589  	_i -= 1
 88590  	goto _121
 88591  _124:
 88592  	return 0
 88593  
 88594  _120:
 88595  	return int8(-1)
 88596  }
 88597  
 88598  var _wherePathSatisfiesOrderByØ00__func__Ø000 [26]int8
 88599  
 88600  func init() {
 88601  	crt.Xstrncpy(nil, &_wherePathSatisfiesOrderByØ00__func__Ø000[0], str(106934), 26)
 88602  }
 88603  
 88604  // C comment
 88605  //  /*
 88606  //  ** Return the cost of sorting nRow rows, assuming that the keys have
 88607  //  ** nOrderby columns and that the first nSorted columns are already in
 88608  //  ** order.
 88609  //  */
 88610  func _whereSortingCost(tls *crt.TLS, _pWInfo *XWhereInfo, _nRow int16, _nOrderBy int32, _nSorted int32) (r0 int16) {
 88611  	var _rScale, _rSortCost int16
 88612  	func() {
 88613  		if _nOrderBy <= int32(0) || int32(66) != int32(_sqlite3LogEst(tls, uint64(100))) {
 88614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134201), unsafe.Pointer(&_whereSortingCostØ00__func__Ø000), unsafe.Pointer(str(106960)))
 88615  			crt.X__builtin_abort(tls)
 88616  		}
 88617  	}()
 88618  	_rScale = int16(int32(_sqlite3LogEst(tls, uint64(((_nOrderBy-_nSorted)*int32(100))/_nOrderBy))) - int32(66))
 88619  	_rSortCost = int16((int32(_nRow) + int32(_rScale)) + int32(16))
 88620  	if ((int32(_pWInfo.XwctrlFlags) & int32(16384)) != int32(0)) && (int32(_pWInfo.XiLimit) < int32(_nRow)) {
 88621  		_nRow = _pWInfo.XiLimit
 88622  	}
 88623  	{
 88624  		p := &_rSortCost
 88625  		*p = int16(int32(*p) + int32(_estLog(tls, _nRow)))
 88626  	}
 88627  	return _rSortCost
 88628  }
 88629  
 88630  var _whereSortingCostØ00__func__Ø000 [17]int8
 88631  
 88632  func init() {
 88633  	crt.Xstrncpy(nil, &_whereSortingCostØ00__func__Ø000[0], str(106997), 17)
 88634  }
 88635  
 88636  // C comment
 88637  //  /*
 88638  //  ** Generate code to construct the Index object for an automatic index
 88639  //  ** and to set up the WhereLevel object pLevel so that the code generator
 88640  //  ** makes use of the automatic index.
 88641  //  */
 88642  func _constructAutomaticIndex(tls *crt.TLS, _pParse *XParse, _pWC *XWhereClause, _pSrc *TSrcList_item, _notReady uint64, _pLevel *XWhereLevel) {
 88643  	var _nKeyCol, _addrInit, _addrTop, _regRecord, _n, _i, _mxBitCol, _iContinue, _addrCounter, _regBase, _3_iCol, _10_iCol, _16_regYield int32
 88644  	var _idxCols, _extraCols, _3_cMask, _10_cMask uint64
 88645  	var _zNotUsed *int8
 88646  	var _sentWarning uint8
 88647  	var _pTable *XTable
 88648  	var _v *TVdbe
 88649  	var _pTabItem *TSrcList_item
 88650  	var _pPartial, _1_pExpr, _11_pX *XExpr
 88651  	var _pIdx *XIndex
 88652  	var _pColl *XCollSeq
 88653  	var _pLoop *XWhereLoop
 88654  	var _pTerm, _pWCEnd *XWhereTerm
 88655  	_sentWarning = uint8(0)
 88656  	_pPartial = nil
 88657  	_iContinue = int32(0)
 88658  	_addrCounter = int32(0)
 88659  	_v = (*TVdbe)(_pParse.XpVdbe)
 88660  	func() {
 88661  		if _v == nil {
 88662  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131050), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(42019)))
 88663  			crt.X__builtin_abort(tls)
 88664  		}
 88665  	}()
 88666  	_addrInit = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 88667  	_nKeyCol = int32(0)
 88668  	_pTable = (*XTable)(_pSrc.XpTab)
 88669  	_pWCEnd = elem101((*XWhereTerm)(_pWC.Xa), uintptr(_pWC.XnTerm))
 88670  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 88671  	_idxCols = 0
 88672  	_pTerm = (*XWhereTerm)(_pWC.Xa)
 88673  _2:
 88674  	if crt.P2U(unsafe.Pointer(_pTerm)) >= crt.P2U(unsafe.Pointer(_pWCEnd)) {
 88675  		goto _5
 88676  	}
 88677  	_1_pExpr = (*XExpr)(_pTerm.XpExpr)
 88678  	func() {
 88679  		if (_1_pExpr.Xflags&uint32(1)) != (0) && int32(_1_pExpr.XiRightJoinTable) == _pSrc.XiCursor && _pLoop.Xprereq == (0) {
 88680  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131062), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(107014)))
 88681  			crt.X__builtin_abort(tls)
 88682  		}
 88683  	}()
 88684  	if (((_pLoop.Xprereq == (0)) && ((int32(_pTerm.XwtFlags) & int32(2)) == int32(0))) && ((_1_pExpr.Xflags & uint32(1)) == (0))) && _sqlite3ExprIsTableConstant(tls, _1_pExpr, _pSrc.XiCursor) != 0 {
 88685  		_pPartial = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.Xdb), _pPartial, _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.Xdb), _1_pExpr, int32(0)))
 88686  	}
 88687  	if _termCanDriveIndex(tls, _pTerm, _pSrc, _notReady) == 0 {
 88688  		goto _14
 88689  	}
 88690  	_3_iCol = *(*int32)(unsafe.Pointer(&_pTerm.Xu))
 88691  	_3_cMask = func() uint64 {
 88692  		if _3_iCol >= int32(64) {
 88693  			return uint64(9223372036854775808)
 88694  		}
 88695  		return (uint64(1) << uint(_3_iCol))
 88696  	}()
 88697  	if _sentWarning == 0 {
 88698  		Xsqlite3_log(tls, int32(284), str(107112), unsafe.Pointer(_pTable.XzName), unsafe.Pointer(elem43((*XColumn)(_pTable.XaCol), uintptr(_3_iCol)).XzName))
 88699  		_sentWarning = uint8(1)
 88700  	}
 88701  	if (_idxCols & _3_cMask) != (0) {
 88702  		goto _18
 88703  	}
 88704  	if _whereLoopResize(tls, (*Xsqlite3)(_pParse.Xdb), _pLoop, _nKeyCol+int32(1)) != 0 {
 88705  		goto _end_auto_index_create
 88706  	}
 88707  	*elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(postInc2(&_nKeyCol, 1))) = _pTerm
 88708  	_idxCols |= _3_cMask
 88709  _18:
 88710  _14:
 88711  	*(*uintptr)(unsafe.Pointer(&_pTerm)) += uintptr(64)
 88712  	goto _2
 88713  _5:
 88714  	func() {
 88715  		if _nKeyCol <= int32(0) {
 88716  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131092), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(107138)))
 88717  			crt.X__builtin_abort(tls)
 88718  		}
 88719  	}()
 88720  	(*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq = store78(&_pLoop.XnLTerm, uint16(_nKeyCol))
 88721  	_pLoop.XwsFlags = uint32(16961)
 88722  	_extraCols = _pSrc.XcolUsed & ((^_idxCols) | uint64(9223372036854775808))
 88723  	_mxBitCol = func() int32 {
 88724  		if int32(63) < int32(_pTable.XnCol) {
 88725  			return int32(63)
 88726  		}
 88727  		return int32(_pTable.XnCol)
 88728  	}()
 88729  	_i = int32(0)
 88730  _24:
 88731  	if _i >= _mxBitCol {
 88732  		goto _27
 88733  	}
 88734  	if (_extraCols & (uint64(1) << uint(_i))) != 0 {
 88735  		_nKeyCol += 1
 88736  	}
 88737  	_i += 1
 88738  	goto _24
 88739  _27:
 88740  	if (_pSrc.XcolUsed & uint64(9223372036854775808)) != 0 {
 88741  		_nKeyCol += (int32(_pTable.XnCol) - int32(64)) + int32(1)
 88742  	}
 88743  	_pIdx = _sqlite3AllocateIndexObject(tls, (*Xsqlite3)(_pParse.Xdb), int16(_nKeyCol+int32(1)), int32(0), &_zNotUsed)
 88744  	if _pIdx == nil {
 88745  		goto _end_auto_index_create
 88746  	}
 88747  	*(**XIndex)(unsafe.Pointer(&((*t102)(unsafe.Pointer(&_pLoop.Xu)).XpIndex))) = _pIdx
 88748  	_pIdx.XzName = str(107148)
 88749  	*(**XTable)(unsafe.Pointer(&_pIdx.XpTable)) = _pTable
 88750  	_n = int32(0)
 88751  	_idxCols = 0
 88752  	_pTerm = (*XWhereTerm)(_pWC.Xa)
 88753  _31:
 88754  	if crt.P2U(unsafe.Pointer(_pTerm)) >= crt.P2U(unsafe.Pointer(_pWCEnd)) {
 88755  		goto _34
 88756  	}
 88757  	if _termCanDriveIndex(tls, _pTerm, _pSrc, _notReady) == 0 {
 88758  		goto _35
 88759  	}
 88760  	_10_iCol = *(*int32)(unsafe.Pointer(&_pTerm.Xu))
 88761  	_10_cMask = func() uint64 {
 88762  		if _10_iCol >= int32(64) {
 88763  			return uint64(9223372036854775808)
 88764  		}
 88765  		return (uint64(1) << uint(_10_iCol))
 88766  	}()
 88767  	if (_idxCols & _10_cMask) == (0) {
 88768  		_11_pX = (*XExpr)(_pTerm.XpExpr)
 88769  		_idxCols |= _10_cMask
 88770  		*elem52(_pIdx.XaiColumn, uintptr(_n)) = int16(*(*int32)(unsafe.Pointer(&_pTerm.Xu)))
 88771  		_pColl = _sqlite3BinaryCompareCollSeq(tls, _pParse, (*XExpr)(_11_pX.XpLeft), (*XExpr)(_11_pX.XpRight))
 88772  		*elem0(_pIdx.XazColl, uintptr(_n)) = func() *int8 {
 88773  			if _pColl != nil {
 88774  				return _pColl.XzName
 88775  			}
 88776  			return (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 88777  		}()
 88778  		_n += 1
 88779  	}
 88780  _35:
 88781  	*(*uintptr)(unsafe.Pointer(&_pTerm)) += uintptr(64)
 88782  	goto _31
 88783  _34:
 88784  	func() {
 88785  		if uint32(_n) != uint32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq) {
 88786  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131140), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(107159)))
 88787  			crt.X__builtin_abort(tls)
 88788  		}
 88789  	}()
 88790  	_i = int32(0)
 88791  _43:
 88792  	if _i >= _mxBitCol {
 88793  		goto _46
 88794  	}
 88795  	if (_extraCols & (uint64(1) << uint(_i))) != 0 {
 88796  		*elem52(_pIdx.XaiColumn, uintptr(_n)) = int16(_i)
 88797  		*elem0(_pIdx.XazColl, uintptr(_n)) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 88798  		_n += 1
 88799  	}
 88800  	_i += 1
 88801  	goto _43
 88802  _46:
 88803  	if (_pSrc.XcolUsed & uint64(9223372036854775808)) == 0 {
 88804  		goto _48
 88805  	}
 88806  	_i = int32(63)
 88807  _49:
 88808  	if _i >= int32(_pTable.XnCol) {
 88809  		goto _52
 88810  	}
 88811  	*elem52(_pIdx.XaiColumn, uintptr(_n)) = int16(_i)
 88812  	*elem0(_pIdx.XazColl, uintptr(_n)) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 88813  	_n += 1
 88814  	_i += 1
 88815  	goto _49
 88816  _52:
 88817  _48:
 88818  	func() {
 88819  		if _n != _nKeyCol {
 88820  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131158), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(107186)))
 88821  			crt.X__builtin_abort(tls)
 88822  		}
 88823  	}()
 88824  	*elem52(_pIdx.XaiColumn, uintptr(_n)) = int16(-1)
 88825  	*elem0(_pIdx.XazColl, uintptr(_n)) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 88826  	func() {
 88827  		if _pLevel.XiIdxCur < int32(0) {
 88828  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131163), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(107197)))
 88829  			crt.X__builtin_abort(tls)
 88830  		}
 88831  	}()
 88832  	_pLevel.XiIdxCur = postInc2(&_pParse.XnTab, 1)
 88833  	_sqlite3VdbeAddOp2(tls, _v, int32(109), _pLevel.XiIdxCur, _nKeyCol+int32(1))
 88834  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
 88835  	_sqlite3VdbeComment(tls, _v, str(107216), unsafe.Pointer(_pTable.XzName))
 88836  	_sqlite3ExprCachePush(tls, _pParse)
 88837  	_pTabItem = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)((*XWhereInfo)(_pWC.XpWInfo).XpTabList).Xa))), uintptr(_pLevel.XiFrom))
 88838  	if ((uint32((_pTabItem.Xfg.XnotIndexed)>>4) << 31) >> 31) != 0 {
 88839  		_16_regYield = _pTabItem.XregReturn
 88840  		_addrCounter = _sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), int32(0))
 88841  		_sqlite3VdbeAddOp3(tls, _v, int32(15), _16_regYield, int32(0), _pTabItem.XaddrFillSub)
 88842  		_addrTop = _sqlite3VdbeAddOp1(tls, _v, int32(16), _16_regYield)
 88843  		_sqlite3VdbeComment(tls, _v, str(107223), unsafe.Pointer((*XTable)(_pTabItem.XpTab).XzName))
 88844  		goto _58
 88845  	}
 88846  	_addrTop = _sqlite3VdbeAddOp1(tls, _v, int32(37), _pLevel.XiTabCur)
 88847  _58:
 88848  	if _pPartial != nil {
 88849  		_iContinue = _sqlite3VdbeMakeLabel(tls, _v)
 88850  		_sqlite3ExprIfFalse(tls, _pParse, _pPartial, _iContinue, int32(16))
 88851  		_pLoop.XwsFlags |= uint32(131072)
 88852  	}
 88853  	_regRecord = _sqlite3GetTempReg(tls, _pParse)
 88854  	_regBase = _sqlite3GenerateIndexKey(tls, _pParse, _pIdx, _pLevel.XiTabCur, _regRecord, int32(0), nil, nil, int32(0))
 88855  	_sqlite3VdbeAddOp2(tls, _v, int32(128), _pLevel.XiIdxCur, _regRecord)
 88856  	_sqlite3VdbeChangeP5(tls, _v, uint16(16))
 88857  	if _pPartial != nil {
 88858  		_sqlite3VdbeResolveLabel(tls, _v, _iContinue)
 88859  	}
 88860  	if ((uint32((_pTabItem.Xfg.XnotIndexed)>>4) << 31) >> 31) != 0 {
 88861  		_sqlite3VdbeChangeP2(tls, _v, uint32(_addrCounter), _regBase+_n)
 88862  		_translateColumnToCopy(tls, _pParse, _addrTop, _pLevel.XiTabCur, _pTabItem.XregResult, int32(1))
 88863  		_sqlite3VdbeGoto(tls, _v, _addrTop)
 88864  		storebits5(&(_pTabItem.Xfg.XnotIndexed), 0, 16, 4)
 88865  		goto _62
 88866  	}
 88867  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _pLevel.XiTabCur, _addrTop+int32(1))
 88868  _62:
 88869  	_sqlite3VdbeChangeP5(tls, _v, uint16(3))
 88870  	_sqlite3VdbeJumpHere(tls, _v, _addrTop)
 88871  	_sqlite3ReleaseTempReg(tls, _pParse, _regRecord)
 88872  	_sqlite3ExprCachePop(tls, _pParse)
 88873  	_sqlite3VdbeJumpHere(tls, _v, _addrInit)
 88874  _end_auto_index_create:
 88875  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), _pPartial)
 88876  }
 88877  
 88878  var _constructAutomaticIndexØ00__func__Ø000 [24]int8
 88879  
 88880  func init() {
 88881  	crt.Xstrncpy(nil, &_constructAutomaticIndexØ00__func__Ø000[0], str(107240), 24)
 88882  }
 88883  
 88884  // C comment
 88885  //  /*
 88886  //  ** Allocate heap space to hold an Index object with nCol columns.
 88887  //  **
 88888  //  ** Increase the allocation size to provide an extra nExtra bytes
 88889  //  ** of 8-byte aligned space after the Index object and return a
 88890  //  ** pointer to this extra space in *ppExtra.
 88891  //  */
 88892  func _sqlite3AllocateIndexObject(tls *crt.TLS, _db *Xsqlite3, _nCol int16, _nExtra int32, _ppExtra **int8) (r0 *XIndex) {
 88893  	var _nByte int32
 88894  	var _1_pExtra *int8
 88895  	var _p *XIndex
 88896  	_nByte = int32((uint64(104) + (((uint64(8) * uint64(_nCol)) + uint64(7)) & uint64(18446744073709551608))) + (((((uint64(2) * uint64(int32(_nCol)+int32(1))) + (uint64(2) * uint64(_nCol))) + (uint64(1) * uint64(_nCol))) + uint64(7)) & uint64(18446744073709551608)))
 88897  	_p = (*XIndex)(_sqlite3DbMallocZero(tls, _db, uint64(_nByte+_nExtra)))
 88898  	if _p != nil {
 88899  		_1_pExtra = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + uintptr(uint64(104))))
 88900  		_p.XazColl = (**int8)(unsafe.Pointer(_1_pExtra))
 88901  		*(*uintptr)(unsafe.Pointer(&_1_pExtra)) += uintptr(((uint64(8) * uint64(_nCol)) + uint64(7)) & uint64(18446744073709551608))
 88902  		_p.XaiRowLogEst = (*int16)(unsafe.Pointer(_1_pExtra))
 88903  		*(*uintptr)(unsafe.Pointer(&_1_pExtra)) += uintptr(uint64(2) * uint64(int32(_nCol)+int32(1)))
 88904  		_p.XaiColumn = (*int16)(unsafe.Pointer(_1_pExtra))
 88905  		*(*uintptr)(unsafe.Pointer(&_1_pExtra)) += uintptr(uint64(2) * uint64(_nCol))
 88906  		_p.XaSortOrder = (*uint8)(unsafe.Pointer(_1_pExtra))
 88907  		_p.XnColumn = uint16(_nCol)
 88908  		_p.XnKeyCol = uint16(int32(_nCol) - int32(1))
 88909  		*_ppExtra = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + uintptr(_nByte)))
 88910  	}
 88911  	return _p
 88912  }
 88913  
 88914  // C comment
 88915  //  /*
 88916  //  ** Generate code that will assemble an index key and stores it in register
 88917  //  ** regOut.  The key with be for index pIdx which is an index on pTab.
 88918  //  ** iCur is the index of a cursor open on the pTab table and pointing to
 88919  //  ** the entry that needs indexing.  If pTab is a WITHOUT ROWID table, then
 88920  //  ** iCur must be the cursor of the PRIMARY KEY index.
 88921  //  **
 88922  //  ** Return a register number which is the first in a block of
 88923  //  ** registers that holds the elements of the index key.  The
 88924  //  ** block of registers has already been deallocated by the time
 88925  //  ** this routine returns.
 88926  //  **
 88927  //  ** If *piPartIdxLabel is not NULL, fill it in with a label and jump
 88928  //  ** to that label if pIdx is a partial index that should be skipped.
 88929  //  ** The label should be resolved using sqlite3ResolvePartIdxLabel().
 88930  //  ** A partial index should be skipped if its WHERE clause evaluates
 88931  //  ** to false or null.  If pIdx is not a partial index, *piPartIdxLabel
 88932  //  ** will be set to zero which is an empty label that is ignored by
 88933  //  ** sqlite3ResolvePartIdxLabel().
 88934  //  **
 88935  //  ** The pPrior and regPrior parameters are used to implement a cache to
 88936  //  ** avoid unnecessary register loads.  If pPrior is not NULL, then it is
 88937  //  ** a pointer to a different index for which an index key has just been
 88938  //  ** computed into register regPrior.  If the current pIdx index is generating
 88939  //  ** its key into the same sequence of registers and if pPrior and pIdx share
 88940  //  ** a column in common, then the register corresponding to that column already
 88941  //  ** holds the correct value and the loading of that register is skipped.
 88942  //  ** This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK
 88943  //  ** on a table with multiple indices, and especially with the ROWID or
 88944  //  ** PRIMARY KEY columns of the index.
 88945  //  */
 88946  func _sqlite3GenerateIndexKey(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex, _iDataCur int32, _regOut int32, _prefixOnly int32, _piPartIdxLabel *int32, _pPrior *XIndex, _regPrior int32) (r0 int32) {
 88947  	var _j, _regBase, _nCol int32
 88948  	var _7_zAff *int8
 88949  	var _v *TVdbe
 88950  	_v = (*TVdbe)(_pParse.XpVdbe)
 88951  	if _piPartIdxLabel == nil {
 88952  		goto _0
 88953  	}
 88954  	if _pIdx.XpPartIdxWhere != nil {
 88955  		*_piPartIdxLabel = _sqlite3VdbeMakeLabel(tls, _v)
 88956  		_pParse.XiSelfTab = _iDataCur
 88957  		_sqlite3ExprCachePush(tls, _pParse)
 88958  		_sqlite3ExprIfFalseDup(tls, _pParse, (*XExpr)(_pIdx.XpPartIdxWhere), *_piPartIdxLabel, int32(16))
 88959  		goto _2
 88960  	}
 88961  	*_piPartIdxLabel = int32(0)
 88962  _2:
 88963  _0:
 88964  	_nCol = int32(func() uint16 {
 88965  		if _prefixOnly != 0 && (((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0) {
 88966  			return _pIdx.XnKeyCol
 88967  		}
 88968  		return _pIdx.XnColumn
 88969  	}())
 88970  	_regBase = _sqlite3GetTempRange(tls, _pParse, _nCol)
 88971  	if (_pPrior != nil) && ((_regBase != _regPrior) || (_pPrior.XpPartIdxWhere != nil)) {
 88972  		_pPrior = nil
 88973  	}
 88974  	_j = int32(0)
 88975  _9:
 88976  	if _j >= _nCol {
 88977  		goto _12
 88978  	}
 88979  	if ((_pPrior != nil) && (int32(*elem52(_pPrior.XaiColumn, uintptr(_j))) == int32(*elem52(_pIdx.XaiColumn, uintptr(_j))))) && (int32(*elem52(_pPrior.XaiColumn, uintptr(_j))) != int32(-2)) {
 88980  		goto _10
 88981  	}
 88982  	_sqlite3ExprCodeLoadIndexColumn(tls, _pParse, _pIdx, _iDataCur, _j, _regBase+_j)
 88983  	_sqlite3VdbeDeletePriorOpcode(tls, _v, uint8(74))
 88984  _10:
 88985  	_j += 1
 88986  	goto _9
 88987  _12:
 88988  	if _regOut == 0 {
 88989  		goto _16
 88990  	}
 88991  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regBase, _nCol, _regOut)
 88992  	if ((*XTable)(_pIdx.XpTable).XpSelect) != nil {
 88993  		_7_zAff = _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.Xdb), _pIdx)
 88994  		_sqlite3VdbeChangeP4(tls, _v, int32(-1), _7_zAff, int32(0))
 88995  	}
 88996  _16:
 88997  	_sqlite3ReleaseTempRange(tls, _pParse, _regBase, _nCol)
 88998  	return _regBase
 88999  }
 89000  
 89001  // C comment
 89002  //  /*
 89003  //  ** Like sqlite3ExprIfFalse() except that a copy is made of pExpr before
 89004  //  ** code generation, and that copy is deleted after code generation. This
 89005  //  ** ensures that the original pExpr is unchanged.
 89006  //  */
 89007  func _sqlite3ExprIfFalseDup(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) {
 89008  	var _db *Xsqlite3
 89009  	var _pCopy *XExpr
 89010  	_db = (*Xsqlite3)(_pParse.Xdb)
 89011  	_pCopy = _sqlite3ExprDup(tls, _db, _pExpr, int32(0))
 89012  	if int32(_db.XmallocFailed) == int32(0) {
 89013  		_sqlite3ExprIfFalse(tls, _pParse, _pCopy, _dest, _jumpIfNull)
 89014  	}
 89015  	_sqlite3ExprDelete(tls, _db, _pCopy)
 89016  }
 89017  
 89018  // C comment
 89019  //  /* Generate code that will load into register regOut a value that is
 89020  //  ** appropriate for the iIdxCol-th column of index pIdx.
 89021  //  */
 89022  func _sqlite3ExprCodeLoadIndexColumn(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex, _iTabCur int32, _iIdxCol int32, _regOut int32) {
 89023  	var _iTabCol int16
 89024  	_iTabCol = *elem52(_pIdx.XaiColumn, uintptr(_iIdxCol))
 89025  	if int32(_iTabCol) == int32(-2) {
 89026  		func() {
 89027  			if _pIdx.XaColExpr == nil {
 89028  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94130), unsafe.Pointer(&_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000), unsafe.Pointer(str(107264)))
 89029  				crt.X__builtin_abort(tls)
 89030  			}
 89031  		}()
 89032  		func() {
 89033  			if ((*XExprList)(_pIdx.XaColExpr).XnExpr) <= _iIdxCol {
 89034  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94131), unsafe.Pointer(&_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000), unsafe.Pointer(str(107279)))
 89035  				crt.X__builtin_abort(tls)
 89036  			}
 89037  		}()
 89038  		_pParse.XiSelfTab = _iTabCur
 89039  		_sqlite3ExprCodeCopy(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.XaColExpr).Xa))), uintptr(_iIdxCol)).XpExpr), _regOut)
 89040  		goto _5
 89041  	}
 89042  	_sqlite3ExprCodeGetColumnOfTable(tls, (*TVdbe)(_pParse.XpVdbe), (*XTable)(_pIdx.XpTable), _iTabCur, int32(_iTabCol), _regOut)
 89043  _5:
 89044  }
 89045  
 89046  var _sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000 [31]int8
 89047  
 89048  func init() {
 89049  	crt.Xstrncpy(nil, &_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000[0], str(107309), 31)
 89050  }
 89051  
 89052  // C comment
 89053  //  /*
 89054  //  ** Make a transient copy of expression pExpr and then code it using
 89055  //  ** sqlite3ExprCode().  This routine works just like sqlite3ExprCode()
 89056  //  ** except that the input expression is guaranteed to be unchanged.
 89057  //  */
 89058  func _sqlite3ExprCodeCopy(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
 89059  	var _db *Xsqlite3
 89060  	_db = (*Xsqlite3)(_pParse.Xdb)
 89061  	_pExpr = _sqlite3ExprDup(tls, _db, _pExpr, int32(0))
 89062  	if _db.XmallocFailed == 0 {
 89063  		_sqlite3ExprCode(tls, _pParse, _pExpr, _target)
 89064  	}
 89065  	_sqlite3ExprDelete(tls, _db, _pExpr)
 89066  }
 89067  
 89068  // C comment
 89069  //  /*
 89070  //  ** If the last opcode is "op" and it is not a jump destination,
 89071  //  ** then remove it.  Return true if and only if an opcode was removed.
 89072  //  */
 89073  func _sqlite3VdbeDeletePriorOpcode(tls *crt.TLS, _p *TVdbe, _op uint8) (r0 int32) {
 89074  	if (_p.XnOp > int32(0)) && (int32(elem63((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1))).Xopcode) == int32(_op)) {
 89075  		return _sqlite3VdbeChangeToNoop(tls, _p, _p.XnOp-int32(1))
 89076  	}
 89077  	return int32(0)
 89078  }
 89079  
 89080  // C comment
 89081  //  /*
 89082  //  ** Return a pointer to the column affinity string associated with index
 89083  //  ** pIdx. A column affinity string has one character for each column in
 89084  //  ** the table, according to the affinity of the column:
 89085  //  **
 89086  //  **  Character      Column affinity
 89087  //  **  ------------------------------
 89088  //  **  'A'            BLOB
 89089  //  **  'B'            TEXT
 89090  //  **  'C'            NUMERIC
 89091  //  **  'D'            INTEGER
 89092  //  **  'F'            REAL
 89093  //  **
 89094  //  ** An extra 'D' is appended to the end of the string to cover the
 89095  //  ** rowid that appears as the last column in every index.
 89096  //  **
 89097  //  ** Memory for the buffer containing the column index affinity string
 89098  //  ** is managed along with the rest of the Index structure. It will be
 89099  //  ** released when sqlite3DeleteIndex() is called.
 89100  //  */
 89101  func _sqlite3IndexAffinityStr(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex) (r0 *int8) {
 89102  	var _3_x int16
 89103  	var _1_n int32
 89104  	var _6_aff int8
 89105  	var _1_pTab *XTable
 89106  	if _pIdx.XzColAff != nil {
 89107  		goto _0
 89108  	}
 89109  	_1_pTab = (*XTable)(_pIdx.XpTable)
 89110  	_pIdx.XzColAff = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(int32(_pIdx.XnColumn)+int32(1))))
 89111  	if _pIdx.XzColAff == nil {
 89112  		_sqlite3OomFault(tls, _db)
 89113  		return nil
 89114  	}
 89115  	_1_n = int32(0)
 89116  _2:
 89117  	if _1_n >= int32(_pIdx.XnColumn) {
 89118  		goto _5
 89119  	}
 89120  	_3_x = *elem52(_pIdx.XaiColumn, uintptr(_1_n))
 89121  	if int32(_3_x) >= int32(0) {
 89122  		*elem1(_pIdx.XzColAff, uintptr(_1_n)) = elem43((*XColumn)(_1_pTab.XaCol), uintptr(_3_x)).Xaffinity
 89123  		goto _9
 89124  	}
 89125  	if int32(_3_x) == int32(-1) {
 89126  		*elem1(_pIdx.XzColAff, uintptr(_1_n)) = int8(68)
 89127  		goto _9
 89128  	}
 89129  	func() {
 89130  		if int32(_3_x) != int32(-2) {
 89131  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108932), unsafe.Pointer(&_sqlite3IndexAffinityStrØ00__func__Ø000), unsafe.Pointer(str(107340)))
 89132  			crt.X__builtin_abort(tls)
 89133  		}
 89134  	}()
 89135  	func() {
 89136  		if (*XExprList)(_pIdx.XaColExpr) == nil {
 89137  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108933), unsafe.Pointer(&_sqlite3IndexAffinityStrØ00__func__Ø000), unsafe.Pointer(str(107351)))
 89138  			crt.X__builtin_abort(tls)
 89139  		}
 89140  	}()
 89141  	_6_aff = _sqlite3ExprAffinity(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.XaColExpr).Xa))), uintptr(_1_n)).XpExpr))
 89142  	if int32(_6_aff) == int32(0) {
 89143  		_6_aff = int8(65)
 89144  	}
 89145  	*elem1(_pIdx.XzColAff, uintptr(_1_n)) = _6_aff
 89146  _9:
 89147  	_1_n += 1
 89148  	goto _2
 89149  _5:
 89150  	*elem1(_pIdx.XzColAff, uintptr(_1_n)) = 0
 89151  _0:
 89152  	return _pIdx.XzColAff
 89153  }
 89154  
 89155  var _sqlite3IndexAffinityStrØ00__func__Ø000 [24]int8
 89156  
 89157  func init() {
 89158  	crt.Xstrncpy(nil, &_sqlite3IndexAffinityStrØ00__func__Ø000[0], str(107369), 24)
 89159  }
 89160  
 89161  // C comment
 89162  //  /*
 89163  //  ** Convert OP_Column opcodes to OP_Copy in previously generated code.
 89164  //  **
 89165  //  ** This routine runs over generated VDBE code and translates OP_Column
 89166  //  ** opcodes into OP_Copy when the table is being accessed via co-routine
 89167  //  ** instead of via table lookup.
 89168  //  **
 89169  //  ** If the bIncrRowid parameter is 0, then any OP_Rowid instructions on
 89170  //  ** cursor iTabCur are transformed into OP_Null. Or, if bIncrRowid is non-zero,
 89171  //  ** then each OP_Rowid is transformed into an instruction to increment the
 89172  //  ** value stored in its output register.
 89173  //  */
 89174  func _translateColumnToCopy(tls *crt.TLS, _pParse *XParse, _iStart int32, _iTabCur int32, _iRegister int32, _bIncrRowid int32) {
 89175  	var _iEnd int32
 89176  	var _v *TVdbe
 89177  	var _pOp *XVdbeOp
 89178  	_v = (*TVdbe)(_pParse.XpVdbe)
 89179  	_pOp = _sqlite3VdbeGetOp(tls, _v, _iStart)
 89180  	_iEnd = _sqlite3VdbeCurrentAddr(tls, _v)
 89181  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 89182  		return
 89183  	}
 89184  _0:
 89185  	if _iStart >= _iEnd {
 89186  		goto _4
 89187  	}
 89188  	if _pOp.Xp1 != _iTabCur {
 89189  		goto _2
 89190  	}
 89191  	if int32(_pOp.Xopcode) == int32(99) {
 89192  		_pOp.Xopcode = uint8(64)
 89193  		_pOp.Xp1 = _pOp.Xp2 + _iRegister
 89194  		_pOp.Xp2 = _pOp.Xp3
 89195  		_pOp.Xp3 = int32(0)
 89196  		goto _8
 89197  	}
 89198  	if int32(_pOp.Xopcode) != int32(125) {
 89199  		goto _8
 89200  	}
 89201  	if _bIncrRowid != 0 {
 89202  		_pOp.Xopcode = uint8(73)
 89203  		_pOp.Xp1 = _pOp.Xp2
 89204  		_pOp.Xp2 = int32(1)
 89205  		goto _10
 89206  	}
 89207  	_pOp.Xopcode = uint8(59)
 89208  	_pOp.Xp1 = int32(0)
 89209  	_pOp.Xp3 = int32(0)
 89210  _10:
 89211  _8:
 89212  _2:
 89213  	*(*uintptr)(unsafe.Pointer(func() **XVdbeOp { _iStart += 1; return &_pOp }())) += uintptr(32)
 89214  	goto _0
 89215  _4:
 89216  }
 89217  
 89218  // C comment
 89219  //  /*
 89220  //  ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
 89221  //  ** command, or if either SQLITE_DEBUG or SQLITE_ENABLE_STMT_SCANSTATUS was
 89222  //  ** defined at compile-time. If it is not a no-op, a single OP_Explain opcode
 89223  //  ** is added to the output to describe the table scan strategy in pLevel.
 89224  //  **
 89225  //  ** If an OP_Explain opcode is added to the VM, its address is returned.
 89226  //  ** Otherwise, if no OP_Explain is coded, zero is returned.
 89227  //  */
 89228  func _sqlite3WhereExplainOneScan(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pLevel *XWhereLevel, _iLevel int32, _iFrom int32, _wctrlFlags uint16) (r0 int32) {
 89229  	var _ret, _1_iId, _1_isSearch int32
 89230  	var _1_flags uint32
 89231  	var _1_zMsg, _5_zFmt, _13_zRangeOp *int8
 89232  	var _1_db *Xsqlite3
 89233  	var _1_v *TVdbe
 89234  	var _1_zBuf [100]int8
 89235  	var _1_str XStrAccum
 89236  	var _1_pItem *TSrcList_item
 89237  	var _5_pIdx *XIndex
 89238  	var _1_pLoop *XWhereLoop
 89239  	_ret = int32(0)
 89240  	_1_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_pLevel.XiFrom))
 89241  	_1_v = (*TVdbe)(_pParse.XpVdbe)
 89242  	_1_db = (*Xsqlite3)(_pParse.Xdb)
 89243  	_1_iId = _pParse.XiSelectId
 89244  	_1_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 89245  	_1_flags = _1_pLoop.XwsFlags
 89246  	if ((_1_flags & uint32(8192)) != 0) || (int32(_wctrlFlags)&int32(32)) != 0 {
 89247  		return int32(0)
 89248  	}
 89249  	_1_isSearch = bool2int((((_1_flags & uint32(48)) != (0)) || (((_1_flags & uint32(1024)) == (0)) && (int32((*t102)(unsafe.Pointer(&_1_pLoop.Xu)).XnEq) > int32(0)))) || (int32(_wctrlFlags)&int32(3)) != 0)
 89250  	_sqlite3StrAccumInit(tls, &_1_str, _1_db, (*int8)(unsafe.Pointer(&_1_zBuf)), int32(100), int32(1000000000))
 89251  	_sqlite3StrAccumAppendAll(tls, &_1_str, func() *int8 {
 89252  		if _1_isSearch != 0 {
 89253  			return str(107393)
 89254  		}
 89255  		return str(107400)
 89256  	}())
 89257  	if _1_pItem.XpSelect != nil {
 89258  		_sqlite3XPrintf(tls, &_1_str, str(107405), int32(_1_pItem.XiSelectId))
 89259  		goto _8
 89260  	}
 89261  	_sqlite3XPrintf(tls, &_1_str, str(107418), unsafe.Pointer(_1_pItem.XzName))
 89262  _8:
 89263  	if _1_pItem.XzAlias != nil {
 89264  		_sqlite3XPrintf(tls, &_1_str, str(107428), unsafe.Pointer(_1_pItem.XzAlias))
 89265  	}
 89266  	if (_1_flags & uint32(1280)) != (0) {
 89267  		goto _10
 89268  	}
 89269  	_5_zFmt = nil
 89270  	func() {
 89271  		if (*XIndex)((*t102)(unsafe.Pointer(&_1_pLoop.Xu)).XpIndex) == nil {
 89272  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126959), unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000), unsafe.Pointer(str(107435)))
 89273  			crt.X__builtin_abort(tls)
 89274  		}
 89275  	}()
 89276  	_5_pIdx = (*XIndex)((*t102)(unsafe.Pointer(&_1_pLoop.Xu)).XpIndex)
 89277  	func() {
 89278  		if (_1_flags&uint32(16384)) != 0 && (_1_flags&uint32(64)) == 0 {
 89279  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126961), unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000), unsafe.Pointer(str(107460)))
 89280  			crt.X__builtin_abort(tls)
 89281  		}
 89282  	}()
 89283  	if (((*XTable)(_1_pItem.XpTab).XtabFlags)&uint32(32)) == (0) || int32((uint32(_5_pIdx.XidxType)<<30)>>30) != int32(2) {
 89284  		goto _17
 89285  	}
 89286  	if _1_isSearch != 0 {
 89287  		_5_zFmt = str(107512)
 89288  	}
 89289  	goto _25
 89290  _17:
 89291  	if (_1_flags & uint32(131072)) != 0 {
 89292  		_5_zFmt = str(107524)
 89293  		goto _25
 89294  	}
 89295  	if (_1_flags & uint32(16384)) != 0 {
 89296  		_5_zFmt = str(107557)
 89297  		goto _25
 89298  	}
 89299  	if (_1_flags & uint32(64)) != 0 {
 89300  		_5_zFmt = str(107582)
 89301  		goto _25
 89302  	}
 89303  	_5_zFmt = str(107600)
 89304  _25:
 89305  	if _5_zFmt != nil {
 89306  		_sqlite3StrAccumAppend(tls, &_1_str, str(107609), int32(7))
 89307  		_sqlite3XPrintf(tls, &_1_str, _5_zFmt, unsafe.Pointer(_5_pIdx.XzName))
 89308  		_explainIndexRange(tls, &_1_str, _1_pLoop)
 89309  	}
 89310  	goto _39
 89311  _10:
 89312  	if (_1_flags&uint32(256)) == (0) || (_1_flags&uint32(15)) == (0) {
 89313  		goto _29
 89314  	}
 89315  	if (_1_flags & uint32(5)) != 0 {
 89316  		_13_zRangeOp = str(107617)
 89317  		goto _35
 89318  	}
 89319  	if (_1_flags & uint32(48)) == uint32(48) {
 89320  		_13_zRangeOp = str(107619)
 89321  		goto _35
 89322  	}
 89323  	if (_1_flags & uint32(32)) != 0 {
 89324  		_13_zRangeOp = str(107633)
 89325  		goto _35
 89326  	}
 89327  	func() {
 89328  		if (_1_flags & uint32(16)) == 0 {
 89329  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126989), unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000), unsafe.Pointer(str(107635)))
 89330  			crt.X__builtin_abort(tls)
 89331  		}
 89332  	}()
 89333  	_13_zRangeOp = str(107657)
 89334  _35:
 89335  	_sqlite3XPrintf(tls, &_1_str, str(107659), unsafe.Pointer(_13_zRangeOp))
 89336  	goto _39
 89337  _29:
 89338  	if (_1_flags & uint32(1024)) != (0) {
 89339  		_sqlite3XPrintf(tls, &_1_str, str(107697), (*t106)(unsafe.Pointer(&_1_pLoop.Xu)).XidxNum, unsafe.Pointer((*t106)(unsafe.Pointer(&_1_pLoop.Xu)).XidxStr))
 89340  	}
 89341  _39:
 89342  	_1_zMsg = _sqlite3StrAccumFinish(tls, &_1_str)
 89343  	_ret = _sqlite3VdbeAddOp4(tls, _1_v, int32(165), _1_iId, _iLevel, _iFrom, _1_zMsg, int32(-1))
 89344  	return _ret
 89345  
 89346  	_ = _1_zBuf
 89347  	panic(0)
 89348  }
 89349  
 89350  var _sqlite3WhereExplainOneScanØ00__func__Ø000 [27]int8
 89351  
 89352  func init() {
 89353  	crt.Xstrncpy(nil, &_sqlite3WhereExplainOneScanØ00__func__Ø000[0], str(107724), 27)
 89354  }
 89355  
 89356  // C comment
 89357  //  /*
 89358  //  ** Argument pLevel describes a strategy for scanning table pTab. This
 89359  //  ** function appends text to pStr that describes the subset of table
 89360  //  ** rows scanned by the strategy in the form of an SQL expression.
 89361  //  **
 89362  //  ** For example, if the query:
 89363  //  **
 89364  //  **   SELECT * FROM t1 WHERE a=1 AND b>2;
 89365  //  **
 89366  //  ** is run and there is an index on (a, b), then this function returns a
 89367  //  ** string similar to:
 89368  //  **
 89369  //  **   "a=? AND b>?"
 89370  //  */
 89371  func _explainIndexRange(tls *crt.TLS, _pStr *XStrAccum, _pLoop *XWhereLoop) {
 89372  	var _i, _j int32
 89373  	var _1_z *int8
 89374  	var _nEq, _nSkip uint16
 89375  	var _pIndex *XIndex
 89376  	_pIndex = (*XIndex)((*t102)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)
 89377  	_nEq = (*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq
 89378  	_nSkip = _pLoop.XnSkip
 89379  	if (int32(_nEq) == int32(0)) && ((_pLoop.XwsFlags & uint32(48)) == (0)) {
 89380  		return
 89381  	}
 89382  	_sqlite3StrAccumAppend(tls, _pStr, str(107751), int32(2))
 89383  	_i = int32(0)
 89384  _2:
 89385  	if _i >= int32(_nEq) {
 89386  		goto _5
 89387  	}
 89388  	_1_z = _explainIndexColumnName(tls, _pIndex, _i)
 89389  	if _i != 0 {
 89390  		_sqlite3StrAccumAppend(tls, _pStr, str(107754), int32(5))
 89391  	}
 89392  	_sqlite3XPrintf(tls, _pStr, func() *int8 {
 89393  		if _i >= int32(_nSkip) {
 89394  			return str(107760)
 89395  		}
 89396  		return str(107765)
 89397  	}(), unsafe.Pointer(_1_z))
 89398  	_i += 1
 89399  	goto _2
 89400  _5:
 89401  	_j = _i
 89402  	if (_pLoop.XwsFlags & uint32(32)) != 0 {
 89403  		_explainAppendTerm(tls, _pStr, _pIndex, int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnBtm), _j, _i, str(107633))
 89404  		_i = int32(1)
 89405  	}
 89406  	if (_pLoop.XwsFlags & uint32(16)) != 0 {
 89407  		_explainAppendTerm(tls, _pStr, _pIndex, int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnTop), _j, _i, str(107657))
 89408  	}
 89409  	_sqlite3StrAccumAppend(tls, _pStr, str(37853), int32(1))
 89410  }
 89411  
 89412  // C comment
 89413  //  /*
 89414  //  ** Return the name of the i-th column of the pIdx index.
 89415  //  */
 89416  func _explainIndexColumnName(tls *crt.TLS, _pIdx *XIndex, _i int32) (r0 *int8) {
 89417  	_i = int32(*elem52(_pIdx.XaiColumn, uintptr(_i)))
 89418  	if _i == int32(-2) {
 89419  		return str(107773)
 89420  	}
 89421  	if _i == int32(-1) {
 89422  		return str(27182)
 89423  	}
 89424  	return elem43((*XColumn)((*XTable)(_pIdx.XpTable).XaCol), uintptr(_i)).XzName
 89425  }
 89426  
 89427  // C comment
 89428  //  /*
 89429  //  ** This routine is a helper for explainIndexRange() below
 89430  //  **
 89431  //  ** pStr holds the text of an expression that we are building up one term
 89432  //  ** at a time.  This routine adds a new term to the end of the expression.
 89433  //  ** Terms are separated by AND so add the "AND" text for second and subsequent
 89434  //  ** terms only.
 89435  //  */
 89436  func _explainAppendTerm(tls *crt.TLS, _pStr *XStrAccum, _pIdx *XIndex, _nTerm int32, _iTerm int32, _bAnd int32, _zOp *int8) {
 89437  	var _i int32
 89438  	func() {
 89439  		if _nTerm < int32(1) {
 89440  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126844), unsafe.Pointer(&_explainAppendTermØ00__func__Ø000), unsafe.Pointer(str(107780)))
 89441  			crt.X__builtin_abort(tls)
 89442  		}
 89443  	}()
 89444  	if _bAnd != 0 {
 89445  		_sqlite3StrAccumAppend(tls, _pStr, str(107754), int32(5))
 89446  	}
 89447  	if _nTerm > int32(1) {
 89448  		_sqlite3StrAccumAppend(tls, _pStr, str(107789), int32(1))
 89449  	}
 89450  	_i = int32(0)
 89451  _4:
 89452  	if _i >= _nTerm {
 89453  		goto _7
 89454  	}
 89455  	if _i != 0 {
 89456  		_sqlite3StrAccumAppend(tls, _pStr, str(107791), int32(1))
 89457  	}
 89458  	_sqlite3StrAccumAppendAll(tls, _pStr, _explainIndexColumnName(tls, _pIdx, _iTerm+_i))
 89459  	_i += 1
 89460  	goto _4
 89461  _7:
 89462  	if _nTerm > int32(1) {
 89463  		_sqlite3StrAccumAppend(tls, _pStr, str(37853), int32(1))
 89464  	}
 89465  	_sqlite3StrAccumAppend(tls, _pStr, _zOp, int32(1))
 89466  	if _nTerm > int32(1) {
 89467  		_sqlite3StrAccumAppend(tls, _pStr, str(107789), int32(1))
 89468  	}
 89469  	_i = int32(0)
 89470  _11:
 89471  	if _i >= _nTerm {
 89472  		goto _14
 89473  	}
 89474  	if _i != 0 {
 89475  		_sqlite3StrAccumAppend(tls, _pStr, str(107791), int32(1))
 89476  	}
 89477  	_sqlite3StrAccumAppend(tls, _pStr, str(50378), int32(1))
 89478  	_i += 1
 89479  	goto _11
 89480  _14:
 89481  	if _nTerm > int32(1) {
 89482  		_sqlite3StrAccumAppend(tls, _pStr, str(37853), int32(1))
 89483  	}
 89484  }
 89485  
 89486  var _explainAppendTermØ00__func__Ø000 [18]int8
 89487  
 89488  func init() {
 89489  	crt.Xstrncpy(nil, &_explainAppendTermØ00__func__Ø000[0], str(107793), 18)
 89490  }
 89491  
 89492  // C comment
 89493  //  /*
 89494  //  ** Generate code for the start of the iLevel-th loop in the WHERE clause
 89495  //  ** implementation described by pWInfo.
 89496  //  */
 89497  func _sqlite3WhereCodeOneLoopStart(tls *crt.TLS, _pWInfo *XWhereInfo, _iLevel int32, _notReady uint64) (r0 uint64) {
 89498  	var _j, _k, _iCur, _addrNxt, _omitTable, _bRev, _addrBrk, _addrHalt, _addrCont, _iRowidReg, _iReleaseReg, _loopAgain, _3_regYield, _4_iReg, _4_addrNotFound, _4_nConstraint, _4_iIn, _5_iTarget, _15_testOp, _15_start, _15_memEndValue, _17_r1, _17_rTemp, _17_op, _26_regBase, _26_startEq, _26_endEq, _26_start_constraints, _26_nConstraint, _26_iIdxCur, _26_nExtraReg, _26_op, _65_iCovCur, _65_regReturn, _65_regRowset, _65_regRowid, _65_iLoopBody, _65_iRetInit, _65_untestedTerms, _65_ii, _66_nNotReady, _72_iTerm, _76_jmp1, _78_addrExplain, _79_r, _79_iSet, _81_nPk, _81_iPk, _82_iCol, _92_skipLikeAddr int32
 89499  	var _96_x uint32
 89500  	var _26_zStartAff, _26_zEndAff *int8
 89501  	var _26_nEq, _26_nBtm, _26_nTop, _65_wctrlFlags uint16
 89502  	var _26_bSeekPastNull, _26_bStopAtNull, _35_t, _36_t uint8
 89503  	var _db *Xsqlite3
 89504  	var _65_pTab *XTable
 89505  	var _v *TVdbe
 89506  	var _65_pOrTab *XSrcList
 89507  	var _pTabItem, _66_origSrc *TSrcList_item
 89508  	var _7_pRight, _10_pCompare, _10_pRight, _17_pX, _21_pX, _38_pRight, _46_pRight, _65_pAndExpr, _73_pExpr, _76_pOrExpr, _92_pE, _97_pE *XExpr
 89509  	var _97_sEAlt XExpr
 89510  	var _pParse *XParse
 89511  	var _17_aMoveOp [4]uint8
 89512  	var _pIdx, _58_pPk, _65_pCov, _71_pPk, _81_pPk *XIndex
 89513  	var _10_pOp *XVdbeOp
 89514  	var _76_pSubWInfo *XWhereInfo
 89515  	var _pLoop, _78_pSubLoop *XWhereLoop
 89516  	var _pLevel *XWhereLevel
 89517  	var _pTerm, _15_pStart, _15_pEnd, _26_pRangeStart, _26_pRangeEnd, _34_t, _75_pOrTerm, _97_pAlt *XWhereTerm
 89518  	var _pWC, _65_pOrWc *XWhereClause
 89519  	_iRowidReg = int32(0)
 89520  	_iReleaseReg = int32(0)
 89521  	_pIdx = nil
 89522  	_pParse = (*XParse)(_pWInfo.XpParse)
 89523  	_v = (*TVdbe)(_pParse.XpVdbe)
 89524  	_pWC = &_pWInfo.XsWC
 89525  	_db = (*Xsqlite3)(_pParse.Xdb)
 89526  	_pLevel = elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_iLevel))
 89527  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 89528  	_pTabItem = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))), uintptr(_pLevel.XiFrom))
 89529  	_iCur = _pTabItem.XiCursor
 89530  	_pLevel.XnotReady = _notReady & (^_sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _iCur))
 89531  	_bRev = int32((_pWInfo.XrevMask >> uint(_iLevel)) & uint64(1))
 89532  	_omitTable = bool2int(((_pLoop.XwsFlags & uint32(64)) != (0)) && ((int32(_pWInfo.XwctrlFlags) & int32(32)) == int32(0)))
 89533  	_addrBrk = store2(&_pLevel.XaddrBrk, store2(&_pLevel.XaddrNxt, _sqlite3VdbeMakeLabel(tls, _v)))
 89534  	_addrCont = store2(&_pLevel.XaddrCont, _sqlite3VdbeMakeLabel(tls, _v))
 89535  	if (int32(_pLevel.XiFrom) > int32(0)) && ((int32((elem6(_pTabItem, 0).Xfg).Xjointype) & int32(8)) != int32(0)) {
 89536  		_pLevel.XiLeftJoin = preInc2(&_pParse.XnMem, 1)
 89537  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _pLevel.XiLeftJoin)
 89538  		_sqlite3VdbeComment(tls, _v, str(107811))
 89539  	}
 89540  	_j = _iLevel
 89541  _3:
 89542  	if _j <= int32(0) || (elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_j)).XiLeftJoin) != int32(0) {
 89543  		goto _7
 89544  	}
 89545  	_j -= 1
 89546  	goto _3
 89547  _7:
 89548  	_addrHalt = elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_j)).XaddrBrk
 89549  	if ((uint32((_pTabItem.Xfg.XnotIndexed)>>4) << 31) >> 31) != 0 {
 89550  		_3_regYield = _pTabItem.XregReturn
 89551  		_sqlite3VdbeAddOp3(tls, _v, int32(15), _3_regYield, int32(0), _pTabItem.XaddrFillSub)
 89552  		_pLevel.Xp2 = _sqlite3VdbeAddOp2(tls, _v, int32(16), _3_regYield, _addrBrk)
 89553  		_sqlite3VdbeComment(tls, _v, str(107223), unsafe.Pointer((*XTable)(_pTabItem.XpTab).XzName))
 89554  		_pLevel.Xop = uint8(13)
 89555  		goto _270
 89556  	}
 89557  	if (_pLoop.XwsFlags & uint32(1024)) == (0) {
 89558  		goto _10
 89559  	}
 89560  	_4_nConstraint = int32(_pLoop.XnLTerm)
 89561  	_sqlite3ExprCachePush(tls, _pParse)
 89562  	_4_iReg = _sqlite3GetTempRange(tls, _pParse, _4_nConstraint+int32(2))
 89563  	_4_addrNotFound = _pLevel.XaddrBrk
 89564  	_j = int32(0)
 89565  _11:
 89566  	if _j >= _4_nConstraint {
 89567  		goto _14
 89568  	}
 89569  	_5_iTarget = (_4_iReg + _j) + int32(2)
 89570  	_pTerm = *elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))
 89571  	if func() int32 {
 89572  		if _pTerm == nil {
 89573  			return func() int32 {
 89574  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127994), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(4809)))
 89575  				crt.X__builtin_abort(tls)
 89576  				return int32(1)
 89577  			}()
 89578  		}
 89579  		return int32(0)
 89580  	}() != 0 {
 89581  		goto _12
 89582  	}
 89583  	if (int32(_pTerm.XeOperator) & int32(1)) != 0 {
 89584  		_codeEqualityTerm(tls, _pParse, _pTerm, _pLevel, _j, _bRev, _5_iTarget)
 89585  		_4_addrNotFound = _pLevel.XaddrNxt
 89586  		goto _19
 89587  	}
 89588  	_7_pRight = (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)
 89589  	_codeExprOrVector(tls, _pParse, _7_pRight, _5_iTarget, int32(1))
 89590  _19:
 89591  _12:
 89592  	_j += 1
 89593  	goto _11
 89594  _14:
 89595  	_sqlite3VdbeAddOp2(tls, _v, int32(56), (*t106)(unsafe.Pointer(&_pLoop.Xu)).XidxNum, _4_iReg)
 89596  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _4_nConstraint, _4_iReg+int32(1))
 89597  	_sqlite3VdbeAddOp4(tls, _v, int32(11), _iCur, _4_addrNotFound, _4_iReg, (*t106)(unsafe.Pointer(&_pLoop.Xu)).XidxStr, func() int32 {
 89598  		if ((*t106)(unsafe.Pointer(&_pLoop.Xu)).XneedFree) != 0 {
 89599  			return int32(-1)
 89600  		}
 89601  		return int32(-2)
 89602  	}())
 89603  	(*t106)(unsafe.Pointer(&_pLoop.Xu)).XneedFree = 0
 89604  	_pLevel.Xp1 = _iCur
 89605  	_pLevel.Xop = uint8(func() int32 {
 89606  		if _pWInfo.XeOnePass != 0 {
 89607  			return int32(164)
 89608  		}
 89609  		return int32(50)
 89610  	}())
 89611  	_pLevel.Xp2 = _sqlite3VdbeCurrentAddr(tls, _v)
 89612  	_4_iIn = (*t115)(unsafe.Pointer(&_pLevel.Xu)).XnIn
 89613  	_j = _4_nConstraint - int32(1)
 89614  _24:
 89615  	if _j < int32(0) {
 89616  		goto _27
 89617  	}
 89618  	_pTerm = *elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))
 89619  	if (_j < int32(16)) && ((int32((*t106)(unsafe.Pointer(&_pLoop.Xu)).XomitMask)>>uint(_j))&int32(1)) != 0 {
 89620  		_disableTerm(tls, _pLevel, _pTerm)
 89621  		goto _31
 89622  	}
 89623  	if (int32(_pTerm.XeOperator) & int32(1)) == int32(0) {
 89624  		goto _31
 89625  	}
 89626  	func() {
 89627  		if (*TInLoop)((*t115)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop) == nil && _db.XmallocFailed == 0 {
 89628  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128027), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(107840)))
 89629  			crt.X__builtin_abort(tls)
 89630  		}
 89631  	}()
 89632  	if _db.XmallocFailed == 0 {
 89633  		func() {
 89634  			if _4_iIn <= int32(0) {
 89635  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128029), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(107884)))
 89636  				crt.X__builtin_abort(tls)
 89637  			}
 89638  		}()
 89639  		_10_pOp = _sqlite3VdbeGetOp(tls, _v, elem116((*TInLoop)((*t115)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop), uintptr(preInc2(&_4_iIn, -1))).XaddrInTop)
 89640  		func() {
 89641  			if int32(_10_pOp.Xopcode) != int32(99) && int32(_10_pOp.Xopcode) != int32(125) {
 89642  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128031), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(107890)))
 89643  				crt.X__builtin_abort(tls)
 89644  			}
 89645  		}()
 89646  		func() {
 89647  			if int32(_10_pOp.Xopcode) == int32(99) && _10_pOp.Xp3 != ((_4_iReg+_j)+int32(2)) {
 89648  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128032), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(107938)))
 89649  				crt.X__builtin_abort(tls)
 89650  			}
 89651  		}()
 89652  		func() {
 89653  			if int32(_10_pOp.Xopcode) == int32(125) && _10_pOp.Xp2 != ((_4_iReg+_j)+int32(2)) {
 89654  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128033), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(107982)))
 89655  				crt.X__builtin_abort(tls)
 89656  			}
 89657  		}()
 89658  		_sqlite3VdbeAddOp3(tls, _v, int32(_10_pOp.Xopcode), _10_pOp.Xp1, _10_pOp.Xp2, _10_pOp.Xp3)
 89659  	}
 89660  	_10_pCompare = _sqlite3PExpr(tls, _pParse, int32(78), nil, nil)
 89661  	func() {
 89662  		if _10_pCompare == nil && _db.XmallocFailed == 0 {
 89663  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128041), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108025)))
 89664  			crt.X__builtin_abort(tls)
 89665  		}
 89666  	}()
 89667  	if _10_pCompare == nil {
 89668  		goto _50
 89669  	}
 89670  	*(**XExpr)(unsafe.Pointer(&_10_pCompare.XpLeft)) = (*XExpr)((*XExpr)(_pTerm.XpExpr).XpLeft)
 89671  	*(**XExpr)(unsafe.Pointer(&_10_pCompare.XpRight)) = store60(&_10_pRight, _sqlite3Expr(tls, _db, int32(157), nil))
 89672  	if _10_pRight != nil {
 89673  		_10_pRight.XiTable = (_4_iReg + _j) + int32(2)
 89674  		_sqlite3ExprIfFalse(tls, _pParse, _10_pCompare, _pLevel.XaddrCont, int32(0))
 89675  	}
 89676  	*(**XExpr)(unsafe.Pointer(&_10_pCompare.XpLeft)) = nil
 89677  	_sqlite3ExprDelete(tls, _db, _10_pCompare)
 89678  _50:
 89679  _31:
 89680  	_j -= 1
 89681  	goto _24
 89682  _27:
 89683  	_sqlite3ExprCachePop(tls, _pParse)
 89684  	goto _270
 89685  _10:
 89686  	if (_pLoop.XwsFlags&uint32(256)) == (0) || (_pLoop.XwsFlags&uint32(5)) == (0) {
 89687  		goto _54
 89688  	}
 89689  	func() {
 89690  		if int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq) != int32(1) {
 89691  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128073), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108057)))
 89692  			crt.X__builtin_abort(tls)
 89693  		}
 89694  	}()
 89695  	_pTerm = *elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), 0)
 89696  	func() {
 89697  		if _pTerm == nil {
 89698  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128075), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108079)))
 89699  			crt.X__builtin_abort(tls)
 89700  		}
 89701  	}()
 89702  	func() {
 89703  		if (*XExpr)(_pTerm.XpExpr) == nil {
 89704  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128076), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108088)))
 89705  			crt.X__builtin_abort(tls)
 89706  		}
 89707  	}()
 89708  	func() {
 89709  		if _omitTable != int32(0) {
 89710  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128077), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108104)))
 89711  			crt.X__builtin_abort(tls)
 89712  		}
 89713  	}()
 89714  	_iReleaseReg = preInc2(&_pParse.XnMem, 1)
 89715  	_iRowidReg = _codeEqualityTerm(tls, _pParse, _pTerm, _pLevel, int32(0), _bRev, _iReleaseReg)
 89716  	if _iRowidReg != _iReleaseReg {
 89717  		_sqlite3ReleaseTempReg(tls, _pParse, _iReleaseReg)
 89718  	}
 89719  	_addrNxt = _pLevel.XaddrNxt
 89720  	_sqlite3VdbeAddOp3(tls, _v, int32(31), _iCur, _addrNxt, _iRowidReg)
 89721  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _iRowidReg, int32(1))
 89722  	_sqlite3ExprCacheStore(tls, _pParse, _iCur, int32(-1), _iRowidReg)
 89723  	_sqlite3VdbeComment(tls, _v, str(93736))
 89724  	_pLevel.Xop = uint8(164)
 89725  	goto _270
 89726  _54:
 89727  	if (_pLoop.XwsFlags&uint32(256)) == (0) || (_pLoop.XwsFlags&uint32(2)) == (0) {
 89728  		goto _66
 89729  	}
 89730  	_15_testOp = int32(164)
 89731  	_15_memEndValue = int32(0)
 89732  	func() {
 89733  		if _omitTable != int32(0) {
 89734  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128099), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108104)))
 89735  			crt.X__builtin_abort(tls)
 89736  		}
 89737  	}()
 89738  	_j = int32(0)
 89739  	_15_pStart = store101(&_15_pEnd, nil)
 89740  	if (_pLoop.XwsFlags & uint32(32)) != 0 {
 89741  		_15_pStart = *elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(postInc2(&_j, 1)))
 89742  	}
 89743  	if (_pLoop.XwsFlags & uint32(16)) != 0 {
 89744  		_15_pEnd = *elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(postInc2(&_j, 1)))
 89745  	}
 89746  	func() {
 89747  		if _15_pStart == nil && _15_pEnd == nil {
 89748  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128104), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108117)))
 89749  			crt.X__builtin_abort(tls)
 89750  		}
 89751  	}()
 89752  	if _bRev != 0 {
 89753  		_pTerm = _15_pStart
 89754  		_15_pStart = _15_pEnd
 89755  		_15_pEnd = _pTerm
 89756  	}
 89757  	if _15_pStart == nil {
 89758  		goto _75
 89759  	}
 89760  	_17_aMoveOp = [4]uint8{uint8(27), uint8(25), uint8(24), uint8(26)}
 89761  
 89762  	func() {
 89763  		if (int32(_15_pStart.XwtFlags) & int32(0)) != int32(0) {
 89764  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128129), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108138)))
 89765  			crt.X__builtin_abort(tls)
 89766  		}
 89767  	}()
 89768  	_17_pX = (*XExpr)(_15_pStart.XpExpr)
 89769  	func() {
 89770  		if _17_pX == nil {
 89771  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128132), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(65696)))
 89772  			crt.X__builtin_abort(tls)
 89773  		}
 89774  	}()
 89775  	if _sqlite3ExprIsVector(tls, (*XExpr)(_17_pX.XpRight)) != 0 {
 89776  		_17_r1 = store2(&_17_rTemp, _sqlite3GetTempReg(tls, _pParse))
 89777  		_codeExprOrVector(tls, _pParse, (*XExpr)(_17_pX.XpRight), _17_r1, int32(1))
 89778  		_17_op = int32(*elem15((*uint8)(unsafe.Pointer(&_17_aMoveOp)), uintptr((int32(_17_pX.Xop)-int32(79))|int32(1))))
 89779  		goto _81
 89780  	}
 89781  	_17_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_17_pX.XpRight), &_17_rTemp)
 89782  	_disableTerm(tls, _pLevel, _15_pStart)
 89783  	_17_op = int32(*elem15((*uint8)(unsafe.Pointer(&_17_aMoveOp)), uintptr(int32(_17_pX.Xop)-int32(79))))
 89784  _81:
 89785  	_sqlite3VdbeAddOp3(tls, _v, _17_op, _iCur, _addrBrk, _17_r1)
 89786  	_sqlite3VdbeComment(tls, _v, str(93736))
 89787  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _17_r1, int32(1))
 89788  	_sqlite3ReleaseTempReg(tls, _pParse, _17_rTemp)
 89789  	goto _82
 89790  _75:
 89791  	_sqlite3VdbeAddOp2(tls, _v, func() int32 {
 89792  		if _bRev != 0 {
 89793  			return int32(33)
 89794  		}
 89795  		return int32(37)
 89796  	}(), _iCur, _addrHalt)
 89797  _82:
 89798  	if _15_pEnd == nil {
 89799  		goto _85
 89800  	}
 89801  	_21_pX = (*XExpr)(_15_pEnd.XpExpr)
 89802  	func() {
 89803  		if _21_pX == nil {
 89804  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128159), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(65696)))
 89805  			crt.X__builtin_abort(tls)
 89806  		}
 89807  	}()
 89808  	func() {
 89809  		if (int32(_15_pEnd.XwtFlags) & int32(0)) != int32(0) {
 89810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128160), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108172)))
 89811  			crt.X__builtin_abort(tls)
 89812  		}
 89813  	}()
 89814  	_15_memEndValue = preInc2(&_pParse.XnMem, 1)
 89815  	_codeExprOrVector(tls, _pParse, (*XExpr)(_21_pX.XpRight), _15_memEndValue, int32(1))
 89816  	if (int32(0) == _sqlite3ExprIsVector(tls, (*XExpr)(_21_pX.XpRight))) && ((int32(_21_pX.Xop) == int32(81)) || (int32(_21_pX.Xop) == int32(79))) {
 89817  		_15_testOp = func() int32 {
 89818  			if _bRev != 0 {
 89819  				return int32(80)
 89820  			}
 89821  			return int32(82)
 89822  		}()
 89823  		goto _95
 89824  	}
 89825  	_15_testOp = func() int32 {
 89826  		if _bRev != 0 {
 89827  			return int32(81)
 89828  		}
 89829  		return int32(79)
 89830  	}()
 89831  _95:
 89832  	if int32(0) == _sqlite3ExprIsVector(tls, (*XExpr)(_21_pX.XpRight)) {
 89833  		_disableTerm(tls, _pLevel, _15_pEnd)
 89834  	}
 89835  _85:
 89836  	_15_start = _sqlite3VdbeCurrentAddr(tls, _v)
 89837  	_pLevel.Xop = uint8(func() int32 {
 89838  		if _bRev != 0 {
 89839  			return int32(6)
 89840  		}
 89841  		return int32(7)
 89842  	}())
 89843  	_pLevel.Xp1 = _iCur
 89844  	_pLevel.Xp2 = _15_start
 89845  	func() {
 89846  		if int32(_pLevel.Xp5) != int32(0) {
 89847  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128180), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108204)))
 89848  			crt.X__builtin_abort(tls)
 89849  		}
 89850  	}()
 89851  	if _15_testOp != int32(164) {
 89852  		_iRowidReg = preInc2(&_pParse.XnMem, 1)
 89853  		_sqlite3VdbeAddOp2(tls, _v, int32(125), _iCur, _iRowidReg)
 89854  		_sqlite3ExprCacheStore(tls, _pParse, _iCur, int32(-1), _iRowidReg)
 89855  		_sqlite3VdbeAddOp3(tls, _v, _15_testOp, _15_memEndValue, _addrBrk, _iRowidReg)
 89856  		_sqlite3VdbeChangeP5(tls, _v, uint16(83))
 89857  	}
 89858  	goto _270
 89859  _66:
 89860  	if (_pLoop.XwsFlags & uint32(512)) == 0 {
 89861  		goto _105
 89862  	}
 89863  	_26_nEq = (*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq
 89864  	_26_nBtm = (*t102)(unsafe.Pointer(&_pLoop.Xu)).XnBtm
 89865  	_26_nTop = (*t102)(unsafe.Pointer(&_pLoop.Xu)).XnTop
 89866  	_26_pRangeStart = nil
 89867  	_26_pRangeEnd = nil
 89868  	_26_nExtraReg = int32(0)
 89869  	_26_zEndAff = nil
 89870  	_26_bSeekPastNull = uint8(0)
 89871  	_26_bStopAtNull = uint8(0)
 89872  	_pIdx = (*XIndex)((*t102)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)
 89873  	_26_iIdxCur = _pLevel.XiIdxCur
 89874  	func() {
 89875  		if int32(_26_nEq) < int32(_pLoop.XnSkip) {
 89876  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128260), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108218)))
 89877  			crt.X__builtin_abort(tls)
 89878  		}
 89879  	}()
 89880  	func() {
 89881  		if (*XExprList)(_pWInfo.XpOrderBy) != nil && ((*XExprList)(_pWInfo.XpOrderBy).XnExpr) != int32(1) && (int32(_pWInfo.XwctrlFlags)&int32(1)) != int32(0) {
 89882  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128270), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108236)))
 89883  			crt.X__builtin_abort(tls)
 89884  		}
 89885  	}()
 89886  	if (((int32(_pWInfo.XwctrlFlags) & int32(1)) != int32(0)) && (int32(_pWInfo.XnOBSat) > int32(0))) && (int32(_pIdx.XnKeyCol) > int32(_26_nEq)) {
 89887  		func() {
 89888  			if int32(_pLoop.XnSkip) != int32(0) {
 89889  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128277), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108331)))
 89890  				crt.X__builtin_abort(tls)
 89891  			}
 89892  		}()
 89893  		_26_bSeekPastNull = uint8(1)
 89894  		_26_nExtraReg = int32(1)
 89895  	}
 89896  	_j = int32(_26_nEq)
 89897  	if (_pLoop.XwsFlags & uint32(32)) != 0 {
 89898  		_26_pRangeStart = *elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(postInc2(&_j, 1)))
 89899  		_26_nExtraReg = func() int32 {
 89900  			if _26_nExtraReg > int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnBtm) {
 89901  				return _26_nExtraReg
 89902  			}
 89903  			return int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnBtm)
 89904  		}()
 89905  		func() {
 89906  			if (int32(_26_pRangeStart.XwtFlags)&int32(256)) != int32(0) && (_pLoop.XwsFlags&uint32(16)) == (0) {
 89907  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128290), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108347)))
 89908  				crt.X__builtin_abort(tls)
 89909  			}
 89910  		}()
 89911  	}
 89912  	if (_pLoop.XwsFlags & uint32(16)) == 0 {
 89913  		goto _123
 89914  	}
 89915  	_26_pRangeEnd = *elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(postInc2(&_j, 1)))
 89916  	_26_nExtraReg = func() int32 {
 89917  		if _26_nExtraReg > int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnTop) {
 89918  			return _26_nExtraReg
 89919  		}
 89920  		return int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnTop)
 89921  	}()
 89922  	if (int32(_26_pRangeEnd.XwtFlags) & int32(256)) != int32(0) {
 89923  		func() {
 89924  			if _26_pRangeStart == nil {
 89925  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128298), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108429)))
 89926  				crt.X__builtin_abort(tls)
 89927  			}
 89928  		}()
 89929  		func() {
 89930  			if (int32(_26_pRangeStart.XwtFlags) & int32(256)) == 0 {
 89931  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128299), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108444)))
 89932  				crt.X__builtin_abort(tls)
 89933  			}
 89934  		}()
 89935  		_pLevel.XiLikeRepCntr = uint32(preInc2(&_pParse.XnMem, 1))
 89936  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), int32(_pLevel.XiLikeRepCntr))
 89937  		_sqlite3VdbeComment(tls, _v, str(108480))
 89938  		_pLevel.XaddrLikeRep = _sqlite3VdbeCurrentAddr(tls, _v)
 89939  		func() {
 89940  			if (_bRev & int32(-2)) != int32(0) {
 89941  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128308), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108498)))
 89942  				crt.X__builtin_abort(tls)
 89943  			}
 89944  		}()
 89945  		_pLevel.XiLikeRepCntr <<= 1
 89946  		_pLevel.XiLikeRepCntr |= uint32(_bRev ^ bool2int(int32(*elem15(_pIdx.XaSortOrder, uintptr(_26_nEq))) == int32(1)))
 89947  	}
 89948  	if _26_pRangeStart != nil {
 89949  		goto _133
 89950  	}
 89951  	_j = int32(*elem52(_pIdx.XaiColumn, uintptr(_26_nEq)))
 89952  	if ((_j >= int32(0)) && (int32(elem43((*XColumn)((*XTable)(_pIdx.XpTable).XaCol), uintptr(_j)).XnotNull) == int32(0))) || (_j == int32(-2)) {
 89953  		_26_bSeekPastNull = uint8(1)
 89954  	}
 89955  _133:
 89956  _123:
 89957  	func() {
 89958  		if _26_pRangeEnd != nil && (int32(_26_pRangeEnd.XwtFlags)&int32(0)) != int32(0) {
 89959  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128320), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108513)))
 89960  			crt.X__builtin_abort(tls)
 89961  		}
 89962  	}()
 89963  	if ((int32(_26_nEq) < int32(_pIdx.XnKeyCol)) && (_bRev == bool2int(int32(*elem15(_pIdx.XaSortOrder, uintptr(_26_nEq))) == int32(0)))) || (_bRev != 0 && (int32(_pIdx.XnKeyCol) == int32(_26_nEq))) {
 89964  		_34_t = _26_pRangeEnd
 89965  		_26_pRangeEnd = _26_pRangeStart
 89966  		_26_pRangeStart = _34_t
 89967  		_35_t = _26_bSeekPastNull
 89968  		_26_bSeekPastNull = _26_bStopAtNull
 89969  		_26_bStopAtNull = _35_t
 89970  		_36_t = uint8(_26_nBtm)
 89971  		_26_nBtm = _26_nTop
 89972  		_26_nTop = uint16(_36_t)
 89973  	}
 89974  	_26_regBase = _codeAllEqualityTerms(tls, _pParse, _pLevel, _bRev, _26_nExtraReg, &_26_zStartAff)
 89975  	func() {
 89976  		if _26_zStartAff != nil && _sqlite3Strlen30(tls, _26_zStartAff) < int32(_26_nEq) {
 89977  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128340), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108566)))
 89978  			crt.X__builtin_abort(tls)
 89979  		}
 89980  	}()
 89981  	if (_26_zStartAff != nil) && (_26_nTop != 0) {
 89982  		_26_zEndAff = _sqlite3DbStrDup(tls, _db, elem1(_26_zStartAff, uintptr(_26_nEq)))
 89983  	}
 89984  	_addrNxt = _pLevel.XaddrNxt
 89985  	_26_startEq = bool2int((_26_pRangeStart == nil) || (int32(_26_pRangeStart.XeOperator)&int32(40)) != 0)
 89986  	_26_endEq = bool2int((_26_pRangeEnd == nil) || (int32(_26_pRangeEnd.XeOperator)&int32(40)) != 0)
 89987  	_26_start_constraints = bool2int((_26_pRangeStart != nil) || (int32(_26_nEq) > int32(0)))
 89988  	_26_nConstraint = int32(_26_nEq)
 89989  	if _26_pRangeStart == nil {
 89990  		goto _152
 89991  	}
 89992  	_38_pRight = (*XExpr)((*XExpr)(_26_pRangeStart.XpExpr).XpRight)
 89993  	_codeExprOrVector(tls, _pParse, _38_pRight, _26_regBase+int32(_26_nEq), int32(_26_nBtm))
 89994  	_whereLikeOptimizationStringFixup(tls, _v, _pLevel, _26_pRangeStart)
 89995  	if ((int32(_26_pRangeStart.XwtFlags) & int32(0)) == int32(0)) && _sqlite3ExprCanBeNull(tls, _38_pRight) != 0 {
 89996  		_sqlite3VdbeAddOp2(tls, _v, int32(75), _26_regBase+int32(_26_nEq), _addrNxt)
 89997  	}
 89998  	if _26_zStartAff != nil {
 89999  		_updateRangeAffinityStr(tls, _38_pRight, int32(_26_nBtm), elem1(_26_zStartAff, uintptr(_26_nEq)))
 90000  	}
 90001  	_26_nConstraint += int32(_26_nBtm)
 90002  	if _sqlite3ExprIsVector(tls, _38_pRight) == int32(0) {
 90003  		_disableTerm(tls, _pLevel, _26_pRangeStart)
 90004  		goto _157
 90005  	}
 90006  	_26_startEq = int32(1)
 90007  _157:
 90008  	_26_bSeekPastNull = 0
 90009  	goto _159
 90010  _152:
 90011  	if _26_bSeekPastNull != 0 {
 90012  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _26_regBase+int32(_26_nEq))
 90013  		_26_nConstraint += 1
 90014  		_26_startEq = int32(0)
 90015  		_26_start_constraints = int32(1)
 90016  	}
 90017  _159:
 90018  	_codeApplyAffinity(tls, _pParse, _26_regBase, _26_nConstraint-int32(_26_bSeekPastNull), _26_zStartAff)
 90019  	if (int32(_pLoop.XnSkip) > int32(0)) && (_26_nConstraint == int32(_pLoop.XnSkip)) {
 90020  		goto _162
 90021  	}
 90022  	_26_op = int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aStartOpØ001)), uintptr(((_26_start_constraints<<2)+(_26_startEq<<1))+_bRev)))
 90023  	func() {
 90024  		if _26_op == int32(0) {
 90025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128390), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108614)))
 90026  			crt.X__builtin_abort(tls)
 90027  		}
 90028  	}()
 90029  	_sqlite3VdbeAddOp4Int(tls, _v, _26_op, _26_iIdxCur, _addrNxt, _26_regBase, _26_nConstraint)
 90030  _162:
 90031  	_26_nConstraint = int32(_26_nEq)
 90032  	if _26_pRangeEnd == nil {
 90033  		goto _165
 90034  	}
 90035  	_46_pRight = (*XExpr)((*XExpr)(_26_pRangeEnd.XpExpr).XpRight)
 90036  	_sqlite3ExprCacheRemove(tls, _pParse, _26_regBase+int32(_26_nEq), int32(1))
 90037  	_codeExprOrVector(tls, _pParse, _46_pRight, _26_regBase+int32(_26_nEq), int32(_26_nTop))
 90038  	_whereLikeOptimizationStringFixup(tls, _v, _pLevel, _26_pRangeEnd)
 90039  	if ((int32(_26_pRangeEnd.XwtFlags) & int32(0)) == int32(0)) && _sqlite3ExprCanBeNull(tls, _46_pRight) != 0 {
 90040  		_sqlite3VdbeAddOp2(tls, _v, int32(75), _26_regBase+int32(_26_nEq), _addrNxt)
 90041  	}
 90042  	if _26_zEndAff != nil {
 90043  		_updateRangeAffinityStr(tls, _46_pRight, int32(_26_nTop), _26_zEndAff)
 90044  		_codeApplyAffinity(tls, _pParse, _26_regBase+int32(_26_nEq), int32(_26_nTop), _26_zEndAff)
 90045  		goto _169
 90046  	}
 90047  	func() {
 90048  		if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 90049  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128420), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(42441)))
 90050  			crt.X__builtin_abort(tls)
 90051  		}
 90052  	}()
 90053  _169:
 90054  	_26_nConstraint += int32(_26_nTop)
 90055  	if _sqlite3ExprIsVector(tls, _46_pRight) == int32(0) {
 90056  		_disableTerm(tls, _pLevel, _26_pRangeEnd)
 90057  		goto _173
 90058  	}
 90059  	_26_endEq = int32(1)
 90060  _173:
 90061  	goto _175
 90062  _165:
 90063  	if _26_bStopAtNull != 0 {
 90064  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _26_regBase+int32(_26_nEq))
 90065  		_26_endEq = int32(0)
 90066  		_26_nConstraint += 1
 90067  	}
 90068  _175:
 90069  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_26_zStartAff))
 90070  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_26_zEndAff))
 90071  	_pLevel.Xp2 = _sqlite3VdbeCurrentAddr(tls, _v)
 90072  	if _26_nConstraint != 0 {
 90073  		_26_op = int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aEndOpØ002)), uintptr((_bRev*int32(2))+_26_endEq)))
 90074  		_sqlite3VdbeAddOp4Int(tls, _v, _26_op, _26_iIdxCur, _addrNxt, _26_regBase, _26_nConstraint)
 90075  	}
 90076  	if _omitTable != 0 {
 90077  		goto _185
 90078  	}
 90079  	if (((*XTable)(_pIdx.XpTable).XtabFlags) & uint32(32)) != (0) {
 90080  		goto _179
 90081  	}
 90082  	if (int32(_pWInfo.XwctrlFlags)&int32(1024)) != 0 || ((int32(_pWInfo.XwctrlFlags)&int32(4096)) != 0 && (int32(_pWInfo.XeOnePass) == int32(1))) {
 90083  		_iRowidReg = preInc2(&_pParse.XnMem, 1)
 90084  		_sqlite3VdbeAddOp2(tls, _v, int32(131), _26_iIdxCur, _iRowidReg)
 90085  		_sqlite3ExprCacheStore(tls, _pParse, _iCur, int32(-1), _iRowidReg)
 90086  		_sqlite3VdbeAddOp3(tls, _v, int32(32), _iCur, int32(0), _iRowidReg)
 90087  		goto _183
 90088  	}
 90089  	_codeDeferredSeek(tls, _pWInfo, _pIdx, _iCur, _26_iIdxCur)
 90090  _183:
 90091  	goto _185
 90092  _179:
 90093  	if _iCur == _26_iIdxCur {
 90094  		goto _185
 90095  	}
 90096  	_58_pPk = _sqlite3PrimaryKeyIndex(tls, (*XTable)(_pIdx.XpTable))
 90097  	_iRowidReg = _sqlite3GetTempRange(tls, _pParse, int32(_58_pPk.XnKeyCol))
 90098  	_j = int32(0)
 90099  _186:
 90100  	if _j >= int32(_58_pPk.XnKeyCol) {
 90101  		goto _189
 90102  	}
 90103  	_k = int32(_sqlite3ColumnOfIndex(tls, _pIdx, *elem52(_58_pPk.XaiColumn, uintptr(_j))))
 90104  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _26_iIdxCur, _k, _iRowidReg+_j)
 90105  	_j += 1
 90106  	goto _186
 90107  _189:
 90108  	_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iCur, _addrCont, _iRowidReg, int32(_58_pPk.XnKeyCol))
 90109  _185:
 90110  	_whereIndexExprTrans(tls, _pIdx, _iCur, _26_iIdxCur, _pWInfo)
 90111  	if (_pLoop.XwsFlags & uint32(4096)) != 0 {
 90112  		_pLevel.Xop = uint8(164)
 90113  		goto _193
 90114  	}
 90115  	if _bRev != 0 {
 90116  		_pLevel.Xop = uint8(6)
 90117  		goto _193
 90118  	}
 90119  	_pLevel.Xop = uint8(7)
 90120  _193:
 90121  	_pLevel.Xp1 = _26_iIdxCur
 90122  	_pLevel.Xp3 = uint8(func() int32 {
 90123  		if (_pLoop.XwsFlags & uint32(65536)) != (0) {
 90124  			return int32(1)
 90125  		}
 90126  		return int32(0)
 90127  	}())
 90128  	if (_pLoop.XwsFlags & uint32(15)) == (0) {
 90129  		_pLevel.Xp5 = uint8(1)
 90130  		goto _197
 90131  	}
 90132  	func() {
 90133  		if int32(_pLevel.Xp5) != int32(0) {
 90134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128498), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108204)))
 90135  			crt.X__builtin_abort(tls)
 90136  		}
 90137  	}()
 90138  _197:
 90139  	if _omitTable != 0 {
 90140  		_pIdx = nil
 90141  	}
 90142  	goto _270
 90143  _105:
 90144  	if (_pLoop.XwsFlags & uint32(8192)) == 0 {
 90145  		goto _202
 90146  	}
 90147  	_65_pCov = nil
 90148  	_65_iCovCur = postInc2(&_pParse.XnTab, 1)
 90149  	_65_regReturn = preInc2(&_pParse.XnMem, 1)
 90150  	_65_regRowset = int32(0)
 90151  	_65_regRowid = int32(0)
 90152  	_65_iLoopBody = _sqlite3VdbeMakeLabel(tls, _v)
 90153  	_65_untestedTerms = int32(0)
 90154  	_65_pAndExpr = nil
 90155  	_65_pTab = (*XTable)(_pTabItem.XpTab)
 90156  	_pTerm = *elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), 0)
 90157  	func() {
 90158  		if _pTerm == nil {
 90159  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128565), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108079)))
 90160  			crt.X__builtin_abort(tls)
 90161  		}
 90162  	}()
 90163  	func() {
 90164  		if (int32(_pTerm.XeOperator) & int32(512)) == 0 {
 90165  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128566), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108620)))
 90166  			crt.X__builtin_abort(tls)
 90167  		}
 90168  	}()
 90169  	func() {
 90170  		if (int32(_pTerm.XwtFlags) & int32(16)) == int32(0) {
 90171  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128567), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108645)))
 90172  			crt.X__builtin_abort(tls)
 90173  		}
 90174  	}()
 90175  	_65_pOrWc = &((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu))).Xwc)
 90176  	_pLevel.Xop = uint8(52)
 90177  	_pLevel.Xp1 = _65_regReturn
 90178  	if int32(_pWInfo.XnLevel) <= int32(1) {
 90179  		goto _209
 90180  	}
 90181  	_66_nNotReady = (int32(_pWInfo.XnLevel) - _iLevel) - int32(1)
 90182  	_65_pOrTab = (*XSrcList)(_sqlite3DbMallocRaw(tls, _db, uint64(120)+(uint64(_66_nNotReady)*uint64(112))))
 90183  	if _65_pOrTab == nil {
 90184  		return _notReady
 90185  	}
 90186  	_65_pOrTab.XnAlloc = uint32(uint8(_66_nNotReady + int32(1)))
 90187  	_65_pOrTab.XnSrc = int32(_65_pOrTab.XnAlloc)
 90188  	crt.Xmemcpy(tls, unsafe.Pointer(&_65_pOrTab.Xa), unsafe.Pointer(_pTabItem), uint64(112))
 90189  	_66_origSrc = (*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa)))
 90190  	_k = int32(1)
 90191  _211:
 90192  	if _k > _66_nNotReady {
 90193  		goto _214
 90194  	}
 90195  	crt.Xmemcpy(tls, unsafe.Pointer(elem6((*TSrcList_item)(unsafe.Pointer(&_65_pOrTab.Xa)), uintptr(_k))), unsafe.Pointer(elem6(_66_origSrc, uintptr(elem100(_pLevel, uintptr(_k)).XiFrom))), uint64(112))
 90196  	_k += 1
 90197  	goto _211
 90198  _214:
 90199  	goto _215
 90200  _209:
 90201  	_65_pOrTab = (*XSrcList)(_pWInfo.XpTabList)
 90202  _215:
 90203  	if (int32(_pWInfo.XwctrlFlags) & int32(16)) != int32(0) {
 90204  		goto _216
 90205  	}
 90206  	if (_65_pTab.XtabFlags & uint32(32)) == (0) {
 90207  		_65_regRowset = preInc2(&_pParse.XnMem, 1)
 90208  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _65_regRowset)
 90209  		goto _218
 90210  	}
 90211  	_71_pPk = _sqlite3PrimaryKeyIndex(tls, _65_pTab)
 90212  	_65_regRowset = postInc2(&_pParse.XnTab, 1)
 90213  	_sqlite3VdbeAddOp2(tls, _v, int32(110), _65_regRowset, int32(_71_pPk.XnKeyCol))
 90214  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _71_pPk)
 90215  _218:
 90216  	_65_regRowid = preInc2(&_pParse.XnMem, 1)
 90217  _216:
 90218  	_65_iRetInit = _sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _65_regReturn)
 90219  	if _pWC.XnTerm <= int32(1) {
 90220  		goto _219
 90221  	}
 90222  	_72_iTerm = int32(0)
 90223  _220:
 90224  	if _72_iTerm >= _pWC.XnTerm {
 90225  		goto _223
 90226  	}
 90227  	_73_pExpr = (*XExpr)(elem101((*XWhereTerm)(_pWC.Xa), uintptr(_72_iTerm)).XpExpr)
 90228  	if elem101((*XWhereTerm)(_pWC.Xa), uintptr(_72_iTerm)) == _pTerm {
 90229  		goto _221
 90230  	}
 90231  	if (_73_pExpr.Xflags & uint32(1)) != (0) {
 90232  		goto _221
 90233  	}
 90234  	if (int32(elem101((*XWhereTerm)(_pWC.Xa), uintptr(_72_iTerm)).XwtFlags) & int32(6)) != int32(0) {
 90235  		goto _221
 90236  	}
 90237  	if (int32(elem101((*XWhereTerm)(_pWC.Xa), uintptr(_72_iTerm)).XeOperator) & int32(8191)) == int32(0) {
 90238  		goto _221
 90239  	}
 90240  	_73_pExpr = _sqlite3ExprDup(tls, _db, _73_pExpr, int32(0))
 90241  	_65_pAndExpr = _sqlite3ExprAnd(tls, _db, _65_pAndExpr, _73_pExpr)
 90242  _221:
 90243  	_72_iTerm += 1
 90244  	goto _220
 90245  _223:
 90246  	if _65_pAndExpr != nil {
 90247  		_65_pAndExpr = _sqlite3PExpr(tls, _pParse, int32(327), nil, _65_pAndExpr)
 90248  	}
 90249  _219:
 90250  	_65_wctrlFlags = uint16(int32(32) | (int32(_pWInfo.XwctrlFlags) & int32(1024)))
 90251  	_65_ii = int32(0)
 90252  _229:
 90253  	if _65_ii >= _65_pOrWc.XnTerm {
 90254  		goto _232
 90255  	}
 90256  	_75_pOrTerm = elem101((*XWhereTerm)(_65_pOrWc.Xa), uintptr(_65_ii))
 90257  	if _75_pOrTerm.XleftCursor != _iCur && (int32(_75_pOrTerm.XeOperator)&int32(1024)) == int32(0) {
 90258  		goto _234
 90259  	}
 90260  	_76_pOrExpr = (*XExpr)(_75_pOrTerm.XpExpr)
 90261  	_76_jmp1 = int32(0)
 90262  	if (_65_pAndExpr != nil) && ((_76_pOrExpr.Xflags & uint32(1)) == (0)) {
 90263  		*(**XExpr)(unsafe.Pointer(&_65_pAndExpr.XpLeft)) = _76_pOrExpr
 90264  		_76_pOrExpr = _65_pAndExpr
 90265  	}
 90266  	_76_pSubWInfo = _sqlite3WhereBegin(tls, _pParse, _65_pOrTab, _76_pOrExpr, nil, nil, _65_wctrlFlags, _65_iCovCur)
 90267  	func() {
 90268  		if _76_pSubWInfo == nil && _pParse.XnErr == 0 && _db.XmallocFailed == 0 {
 90269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128672), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108679)))
 90270  			crt.X__builtin_abort(tls)
 90271  		}
 90272  	}()
 90273  	if _76_pSubWInfo == nil {
 90274  		goto _241
 90275  	}
 90276  	_78_addrExplain = _sqlite3WhereExplainOneScan(tls, _pParse, _65_pOrTab, elem100((*XWhereLevel)(unsafe.Pointer(&_76_pSubWInfo.Xa)), 0), _iLevel, int32(_pLevel.XiFrom), 0)
 90277  
 90278  	if (int32(_pWInfo.XwctrlFlags) & int32(16)) != int32(0) {
 90279  		goto _242
 90280  	}
 90281  	_79_iSet = func() int32 {
 90282  		if _65_ii == (_65_pOrWc.XnTerm - int32(1)) {
 90283  			return int32(-1)
 90284  		}
 90285  		return _65_ii
 90286  	}()
 90287  	if (_65_pTab.XtabFlags & uint32(32)) == (0) {
 90288  		_79_r = _sqlite3ExprCodeGetColumn(tls, _pParse, _65_pTab, int32(-1), _iCur, _65_regRowid, 0)
 90289  		_76_jmp1 = _sqlite3VdbeAddOp4Int(tls, _v, int32(43), _65_regRowset, int32(0), _79_r, _79_iSet)
 90290  		goto _246
 90291  	}
 90292  	_81_pPk = _sqlite3PrimaryKeyIndex(tls, _65_pTab)
 90293  	_81_nPk = int32(_81_pPk.XnKeyCol)
 90294  	_79_r = _sqlite3GetTempRange(tls, _pParse, _81_nPk)
 90295  	_81_iPk = int32(0)
 90296  _247:
 90297  	if _81_iPk >= _81_nPk {
 90298  		goto _250
 90299  	}
 90300  	_82_iCol = int32(*elem52(_81_pPk.XaiColumn, uintptr(_81_iPk)))
 90301  	_sqlite3ExprCodeGetColumnToReg(tls, _pParse, _65_pTab, _82_iCol, _iCur, _79_r+_81_iPk)
 90302  	_81_iPk += 1
 90303  	goto _247
 90304  _250:
 90305  	if _79_iSet != 0 {
 90306  		_76_jmp1 = _sqlite3VdbeAddOp4Int(tls, _v, int32(30), _65_regRowset, int32(0), _79_r, _81_nPk)
 90307  	}
 90308  	if _79_iSet < int32(0) {
 90309  		goto _252
 90310  	}
 90311  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _79_r, _81_nPk, _65_regRowid)
 90312  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _65_regRowset, _65_regRowid, _79_r, _81_nPk)
 90313  	if _79_iSet != 0 {
 90314  		_sqlite3VdbeChangeP5(tls, _v, uint16(16))
 90315  	}
 90316  _252:
 90317  	_sqlite3ReleaseTempRange(tls, _pParse, _79_r, _81_nPk)
 90318  _246:
 90319  _242:
 90320  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _65_regReturn, _65_iLoopBody)
 90321  	if _76_jmp1 != 0 {
 90322  		_sqlite3VdbeJumpHere(tls, _v, _76_jmp1)
 90323  	}
 90324  	if _76_pSubWInfo.XuntestedTerms != 0 {
 90325  		_65_untestedTerms = int32(1)
 90326  	}
 90327  	_78_pSubLoop = (*XWhereLoop)(elem100((*XWhereLevel)(unsafe.Pointer(&_76_pSubWInfo.Xa)), 0).XpWLoop)
 90328  	func() {
 90329  		if (_78_pSubLoop.XwsFlags & uint32(16384)) != (0) {
 90330  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128759), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108725)))
 90331  			crt.X__builtin_abort(tls)
 90332  		}
 90333  	}()
 90334  	if (((_78_pSubLoop.XwsFlags & uint32(512)) != (0)) && ((_65_ii == int32(0)) || ((*XIndex)((*t102)(unsafe.Pointer(&_78_pSubLoop.Xu)).XpIndex) == _65_pCov))) && (((_65_pTab.XtabFlags & uint32(32)) == (0)) || (int32((uint32((*XIndex)((*t102)(unsafe.Pointer(&_78_pSubLoop.Xu)).XpIndex).XidxType)<<30)>>30) != int32(2))) {
 90335  		func() {
 90336  			if (elem100((*XWhereLevel)(unsafe.Pointer(&_76_pSubWInfo.Xa)), 0).XiIdxCur) != _65_iCovCur {
 90337  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128764), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108767)))
 90338  				crt.X__builtin_abort(tls)
 90339  			}
 90340  		}()
 90341  		_65_pCov = (*XIndex)((*t102)(unsafe.Pointer(&_78_pSubLoop.Xu)).XpIndex)
 90342  		goto _265
 90343  	}
 90344  	_65_pCov = nil
 90345  _265:
 90346  	_sqlite3WhereEnd(tls, _76_pSubWInfo)
 90347  _241:
 90348  _234:
 90349  	_65_ii += 1
 90350  	goto _229
 90351  _232:
 90352  	*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pLevel.Xu)))) = _65_pCov
 90353  	if _65_pCov != nil {
 90354  		_pLevel.XiIdxCur = _65_iCovCur
 90355  	}
 90356  	if _65_pAndExpr != nil {
 90357  		*(**XExpr)(unsafe.Pointer(&_65_pAndExpr.XpLeft)) = nil
 90358  		_sqlite3ExprDelete(tls, _db, _65_pAndExpr)
 90359  	}
 90360  	_sqlite3VdbeChangeP1(tls, _v, uint32(_65_iRetInit), _sqlite3VdbeCurrentAddr(tls, _v))
 90361  	_sqlite3VdbeGoto(tls, _v, _pLevel.XaddrBrk)
 90362  	_sqlite3VdbeResolveLabel(tls, _v, _65_iLoopBody)
 90363  	if int32(_pWInfo.XnLevel) > int32(1) {
 90364  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_65_pOrTab))
 90365  	}
 90366  	if _65_untestedTerms == 0 {
 90367  		_disableTerm(tls, _pLevel, _pTerm)
 90368  	}
 90369  	goto _270
 90370  _202:
 90371  	func() {
 90372  		if _bRev != int32(0) && _bRev != int32(1) {
 90373  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128796), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108800)))
 90374  			crt.X__builtin_abort(tls)
 90375  		}
 90376  	}()
 90377  	if ((uint32((_pTabItem.Xfg.XnotIndexed)>>5) << 31) >> 31) != 0 {
 90378  		_pLevel.Xop = uint8(164)
 90379  		goto _275
 90380  	}
 90381  	_pLevel.Xop = *elem15((*uint8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aStepØ003)), uintptr(_bRev))
 90382  	_pLevel.Xp1 = _iCur
 90383  	_pLevel.Xp2 = int32(1) + _sqlite3VdbeAddOp2(tls, _v, int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aStartØ004)), uintptr(_bRev))), _iCur, _addrHalt)
 90384  	_pLevel.Xp5 = uint8(1)
 90385  _275:
 90386  _270:
 90387  	_loopAgain = int32(0)
 90388  	*func() *int32 { _pTerm = (*XWhereTerm)(_pWC.Xa); return &_j }() = _pWC.XnTerm
 90389  _277:
 90390  	if _j <= int32(0) {
 90391  		goto _280
 90392  	}
 90393  	_92_skipLikeAddr = int32(0)
 90394  	if (int32(_pTerm.XwtFlags) & int32(6)) != 0 {
 90395  		goto _278
 90396  	}
 90397  	if (_pTerm.XprereqAll & _pLevel.XnotReady) != (0) {
 90398  		_pWInfo.XuntestedTerms = uint8(1)
 90399  		goto _278
 90400  	}
 90401  	_92_pE = (*XExpr)(_pTerm.XpExpr)
 90402  	func() {
 90403  		if _92_pE == nil {
 90404  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128839), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108819)))
 90405  			crt.X__builtin_abort(tls)
 90406  		}
 90407  	}()
 90408  	if _pLevel.XiLeftJoin != 0 && ((_92_pE.Xflags & uint32(1)) == (0)) {
 90409  		goto _278
 90410  	}
 90411  	if (_pIdx != nil) && (_sqlite3ExprCoveredByIndex(tls, _92_pE, _pLevel.XiTabCur, _pIdx) == 0) {
 90412  		_loopAgain = int32(1)
 90413  		goto _278
 90414  	}
 90415  	if (int32(_pTerm.XwtFlags) & int32(512)) != 0 {
 90416  		_96_x = _pLevel.XiLikeRepCntr
 90417  		func() {
 90418  			if _96_x <= (0) {
 90419  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128857), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108825)))
 90420  				crt.X__builtin_abort(tls)
 90421  			}
 90422  		}()
 90423  		_92_skipLikeAddr = _sqlite3VdbeAddOp1(tls, _v, func() int32 {
 90424  			if (_96_x & uint32(1)) != 0 {
 90425  				return int32(22)
 90426  			}
 90427  			return int32(21)
 90428  		}(), int32(_96_x>>1))
 90429  	}
 90430  	_sqlite3ExprIfFalse(tls, _pParse, _92_pE, _addrCont, int32(16))
 90431  	if _92_skipLikeAddr != 0 {
 90432  		_sqlite3VdbeJumpHere(tls, _v, _92_skipLikeAddr)
 90433  	}
 90434  	{
 90435  		p := &_pTerm.XwtFlags
 90436  		*p = uint16(int32(*p) | int32(4))
 90437  	}
 90438  _278:
 90439  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _j -= 1; return &_pTerm }())) += uintptr(64)
 90440  	goto _277
 90441  _280:
 90442  	_pIdx = nil
 90443  	if _loopAgain != 0 {
 90444  		goto _270
 90445  	}
 90446  	*func() *int32 { _pTerm = (*XWhereTerm)(_pWC.Xa); return &_j }() = _pWC.XnTerm
 90447  _295:
 90448  	if _j <= int32(0) {
 90449  		goto _298
 90450  	}
 90451  	if (int32(_pTerm.XwtFlags) & int32(6)) != 0 {
 90452  		goto _296
 90453  	}
 90454  	if (int32(_pTerm.XeOperator) & int32(130)) == int32(0) {
 90455  		goto _296
 90456  	}
 90457  	if (int32(_pTerm.XeOperator) & int32(2048)) == int32(0) {
 90458  		goto _296
 90459  	}
 90460  	if _pTerm.XleftCursor != _iCur {
 90461  		goto _296
 90462  	}
 90463  	if _pLevel.XiLeftJoin != 0 {
 90464  		goto _296
 90465  	}
 90466  	_97_pE = (*XExpr)(_pTerm.XpExpr)
 90467  	func() {
 90468  		if (_97_pE.Xflags & uint32(1)) != (0) {
 90469  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128886), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108829)))
 90470  			crt.X__builtin_abort(tls)
 90471  		}
 90472  	}()
 90473  	func() {
 90474  		if (_pTerm.XprereqRight & _pLevel.XnotReady) == (0) {
 90475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128887), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108863)))
 90476  			crt.X__builtin_abort(tls)
 90477  		}
 90478  	}()
 90479  	_97_pAlt = _sqlite3WhereFindTerm(tls, _pWC, _iCur, *(*int32)(unsafe.Pointer(&_pTerm.Xu)), _notReady, uint32(131), nil)
 90480  	if _97_pAlt == nil {
 90481  		goto _296
 90482  	}
 90483  	if (int32(_97_pAlt.XwtFlags) & int32(4)) != 0 {
 90484  		goto _296
 90485  	}
 90486  	_97_sEAlt = *(*XExpr)(_97_pAlt.XpExpr)
 90487  	*(**XExpr)(unsafe.Pointer(&_97_sEAlt.XpLeft)) = (*XExpr)(_97_pE.XpLeft)
 90488  	_sqlite3ExprIfFalse(tls, _pParse, &_97_sEAlt, _addrCont, int32(16))
 90489  _296:
 90490  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _j -= 1; return &_pTerm }())) += uintptr(64)
 90491  	goto _295
 90492  _298:
 90493  	if _pLevel.XiLeftJoin == 0 {
 90494  		goto _310
 90495  	}
 90496  	_pLevel.XaddrFirst = _sqlite3VdbeCurrentAddr(tls, _v)
 90497  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _pLevel.XiLeftJoin)
 90498  	_sqlite3VdbeComment(tls, _v, str(108906))
 90499  	_sqlite3ExprCacheClear(tls, _pParse)
 90500  	*func() *int32 { _pTerm = (*XWhereTerm)(_pWC.Xa); return &_j }() = int32(0)
 90501  _311:
 90502  	if _j >= _pWC.XnTerm {
 90503  		goto _314
 90504  	}
 90505  	if (int32(_pTerm.XwtFlags) & int32(6)) != 0 {
 90506  		goto _312
 90507  	}
 90508  	if (_pTerm.XprereqAll & _pLevel.XnotReady) != (0) {
 90509  		func() {
 90510  			if _pWInfo.XuntestedTerms == 0 {
 90511  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128914), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108927)))
 90512  				crt.X__builtin_abort(tls)
 90513  			}
 90514  		}()
 90515  		goto _312
 90516  	}
 90517  	func() {
 90518  		if _pTerm.XpExpr == nil {
 90519  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128917), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108949)))
 90520  			crt.X__builtin_abort(tls)
 90521  		}
 90522  	}()
 90523  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pTerm.XpExpr), _addrCont, int32(16))
 90524  	{
 90525  		p := &_pTerm.XwtFlags
 90526  		*p = uint16(int32(*p) | int32(4))
 90527  	}
 90528  _312:
 90529  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _j += 1; return &_pTerm }())) += uintptr(64)
 90530  	goto _311
 90531  _314:
 90532  _310:
 90533  	return _pLevel.XnotReady
 90534  
 90535  	_ = _17_aMoveOp
 90536  	_ = _78_addrExplain
 90537  	panic(0)
 90538  }
 90539  
 90540  var _sqlite3WhereCodeOneLoopStartØ00__func__Ø000 [29]int8
 90541  
 90542  func init() {
 90543  	crt.Xstrncpy(nil, &_sqlite3WhereCodeOneLoopStartØ00__func__Ø000[0], str(108962), 29)
 90544  }
 90545  
 90546  // C comment
 90547  //  /*
 90548  //  ** Generate code for a single equality term of the WHERE clause.  An equality
 90549  //  ** term can be either X=expr or X IN (...).   pTerm is the term to be
 90550  //  ** coded.
 90551  //  **
 90552  //  ** The current value for the constraint is left in a register, the index
 90553  //  ** of which is returned.  An attempt is made store the result in iTarget but
 90554  //  ** this is only guaranteed for TK_ISNULL and TK_IN constraints.  If the
 90555  //  ** constraint is a TK_EQ or TK_IS, then the current value might be left in
 90556  //  ** some other register and it is the caller's responsibility to compensate.
 90557  //  **
 90558  //  ** For a constraint of the form X=expr, the expression is evaluated in
 90559  //  ** straight-line code.  For constraints of the form X IN (...)
 90560  //  ** this routine sets up a loop that will iterate over all values of X.
 90561  //  */
 90562  func _codeEqualityTerm(tls *crt.TLS, _pParse *XParse, _pTerm *XWhereTerm, _pLevel *XWhereLevel, _iEq int32, _bRev int32, _iTarget int32) (r0 int32) {
 90563  	var _iReg, _3_eType, _3_iTab, _3_i, _3_nEq, _11_iField, _19_iMap, _21_iOut, _23_iCol int32
 90564  	var _3_aiMap *int32
 90565  	var _9_savedDbOptFlags uint16
 90566  	var _9_db *Xsqlite3
 90567  	var _v *TVdbe
 90568  	var _9_pOrigRhs, _9_pOrigLhs, _9_pRhs, _9_pLhs, _13_pOrderBy *XExprList
 90569  	var _9_pSelect *XSelect
 90570  	var _pX, _11_pNewRhs, _11_pNewLhs, _12_pLeft *XExpr
 90571  	var _3_pLoop *XWhereLoop
 90572  	var _3_pIn *TInLoop
 90573  	_pX = (*XExpr)(_pTerm.XpExpr)
 90574  	_v = (*TVdbe)(_pParse.XpVdbe)
 90575  	func() {
 90576  		if (*elem105((**XWhereTerm)(unsafe.Pointer((*XWhereLoop)(_pLevel.XpWLoop).XaLTerm)), uintptr(_iEq))) != _pTerm {
 90577  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127197), unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000), unsafe.Pointer(str(108991)))
 90578  			crt.X__builtin_abort(tls)
 90579  		}
 90580  	}()
 90581  	func() {
 90582  		if _iTarget <= int32(0) {
 90583  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127198), unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000), unsafe.Pointer(str(109026)))
 90584  			crt.X__builtin_abort(tls)
 90585  		}
 90586  	}()
 90587  	if (int32(_pX.Xop) == int32(78)) || (int32(_pX.Xop) == int32(72)) {
 90588  		_iReg = _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pX.XpRight), _iTarget)
 90589  		goto _8
 90590  	}
 90591  	if int32(_pX.Xop) == int32(75) {
 90592  		_iReg = _iTarget
 90593  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _iReg)
 90594  		goto _8
 90595  	}
 90596  	_3_eType = int32(5)
 90597  	_3_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 90598  	_3_nEq = int32(0)
 90599  	_3_aiMap = nil
 90600  	if (((_3_pLoop.XwsFlags & uint32(1024)) == (0)) && ((*XIndex)((*t102)(unsafe.Pointer(&_3_pLoop.Xu)).XpIndex) != nil)) && ((*elem15((*XIndex)((*t102)(unsafe.Pointer(&_3_pLoop.Xu)).XpIndex).XaSortOrder, uintptr(_iEq))) != 0) {
 90601  		_bRev = bool2int(_bRev == 0)
 90602  	}
 90603  	func() {
 90604  		if int32(_pX.Xop) != int32(74) {
 90605  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127222), unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000), unsafe.Pointer(str(102033)))
 90606  			crt.X__builtin_abort(tls)
 90607  		}
 90608  	}()
 90609  	_iReg = _iTarget
 90610  	_3_i = int32(0)
 90611  _14:
 90612  	if _3_i >= _iEq {
 90613  		goto _17
 90614  	}
 90615  	if ((*elem105((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))) != nil) && ((*XExpr)((*elem105((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))).XpExpr) == _pX) {
 90616  		_disableTerm(tls, _pLevel, _pTerm)
 90617  		return _iTarget
 90618  	}
 90619  	_3_i += 1
 90620  	goto _14
 90621  _17:
 90622  	_3_i = _iEq
 90623  _20:
 90624  	if _3_i >= int32(_3_pLoop.XnLTerm) {
 90625  		goto _23
 90626  	}
 90627  	if func() int32 {
 90628  		if (*elem105((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))) != nil {
 90629  			return int32(1)
 90630  		}
 90631  		return func() int32 {
 90632  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127232), unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000), unsafe.Pointer(str(4809)))
 90633  			crt.X__builtin_abort(tls)
 90634  			return int32(0)
 90635  		}()
 90636  	}() != 0 && ((*XExpr)((*elem105((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))).XpExpr) == _pX) {
 90637  		_3_nEq += 1
 90638  	}
 90639  	_3_i += 1
 90640  	goto _20
 90641  _23:
 90642  	if ((_pX.Xflags & uint32(2048)) == (0)) || (((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pX.Xx))).XpEList).XnExpr) == int32(1)) {
 90643  		_3_eType = _sqlite3FindInIndex(tls, _pParse, _pX, uint32(4), nil, nil)
 90644  		goto _30
 90645  	}
 90646  	_9_pSelect = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pX.Xx)))
 90647  	_9_db = (*Xsqlite3)(_pParse.Xdb)
 90648  	_9_savedDbOptFlags = _9_db.XdbOptFlags
 90649  	_9_pOrigRhs = (*XExprList)(_9_pSelect.XpEList)
 90650  	_9_pOrigLhs = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(_pX.XpLeft).Xx))))
 90651  	_9_pRhs = nil
 90652  	_9_pLhs = nil
 90653  	_3_i = _iEq
 90654  _31:
 90655  	if _3_i >= int32(_3_pLoop.XnLTerm) {
 90656  		goto _34
 90657  	}
 90658  	if (*XExpr)((*elem105((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))).XpExpr) == _pX {
 90659  		_11_iField = ((*elem105((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))).XiField) - int32(1)
 90660  		_11_pNewRhs = _sqlite3ExprDup(tls, _9_db, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_9_pOrigRhs.Xa)), uintptr(_11_iField)).XpExpr), int32(0))
 90661  		_11_pNewLhs = _sqlite3ExprDup(tls, _9_db, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_9_pOrigLhs.Xa)), uintptr(_11_iField)).XpExpr), int32(0))
 90662  		_9_pRhs = _sqlite3ExprListAppend(tls, _pParse, _9_pRhs, _11_pNewRhs)
 90663  		_9_pLhs = _sqlite3ExprListAppend(tls, _pParse, _9_pLhs, _11_pNewLhs)
 90664  	}
 90665  	_3_i += 1
 90666  	goto _31
 90667  _34:
 90668  	if _9_db.XmallocFailed != 0 {
 90669  		goto _36
 90670  	}
 90671  	_12_pLeft = (*XExpr)(_pX.XpLeft)
 90672  	if _9_pSelect.XpOrderBy == nil {
 90673  		goto _37
 90674  	}
 90675  	_13_pOrderBy = (*XExprList)(_9_pSelect.XpOrderBy)
 90676  	_3_i = int32(0)
 90677  _38:
 90678  	if _3_i >= _13_pOrderBy.XnExpr {
 90679  		goto _41
 90680  	}
 90681  	(*t73)(unsafe.Pointer(&(elem59((*TExprList_item)(unsafe.Pointer(&_13_pOrderBy.Xa)), uintptr(_3_i)).Xu))).XiOrderByCol = 0
 90682  	_3_i += 1
 90683  	goto _38
 90684  _41:
 90685  _37:
 90686  	if _9_pLhs.XnExpr == int32(1) {
 90687  		*(**XExpr)(unsafe.Pointer(&_pX.XpLeft)) = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_9_pLhs.Xa)), 0).XpExpr)
 90688  		goto _43
 90689  	}
 90690  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_12_pLeft.Xx)))) = _9_pLhs
 90691  	_3_aiMap = (*int32)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), uint64(4)*uint64(_3_nEq)))
 90692  _43:
 90693  	*(**XExprList)(unsafe.Pointer(&_9_pSelect.XpEList)) = _9_pRhs
 90694  	{
 90695  		p := &_9_db.XdbOptFlags
 90696  		*p = uint16(int32(*p) | int32(1))
 90697  	}
 90698  	_3_eType = _sqlite3FindInIndex(tls, _pParse, _pX, uint32(4), nil, _3_aiMap)
 90699  	_9_db.XdbOptFlags = _9_savedDbOptFlags
 90700  	*(**XExprList)(unsafe.Pointer(&_9_pSelect.XpEList)) = _9_pOrigRhs
 90701  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_12_pLeft.Xx)))) = _9_pOrigLhs
 90702  	*(**XExpr)(unsafe.Pointer(&_pX.XpLeft)) = _12_pLeft
 90703  _36:
 90704  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _9_pLhs)
 90705  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _9_pRhs)
 90706  _30:
 90707  	if _3_eType == int32(4) {
 90708  		_bRev = bool2int(_bRev == 0)
 90709  	}
 90710  	_3_iTab = _pX.XiTable
 90711  	_sqlite3VdbeAddOp2(tls, _v, func() int32 {
 90712  		if _bRev != 0 {
 90713  			return int32(33)
 90714  		}
 90715  		return int32(37)
 90716  	}(), _3_iTab, int32(0))
 90717  	func() {
 90718  		if (_3_pLoop.XwsFlags & uint32(8192)) != (0) {
 90719  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127304), unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000), unsafe.Pointer(str(109036)))
 90720  			crt.X__builtin_abort(tls)
 90721  		}
 90722  	}()
 90723  	_3_pLoop.XwsFlags |= uint32(2048)
 90724  	if ((*t115)(unsafe.Pointer(&_pLevel.Xu)).XnIn) == int32(0) {
 90725  		_pLevel.XaddrNxt = _sqlite3VdbeMakeLabel(tls, _v)
 90726  	}
 90727  	_3_i = (*t115)(unsafe.Pointer(&_pLevel.Xu)).XnIn
 90728  	(*t115)(unsafe.Pointer(&_pLevel.Xu)).XnIn += _3_nEq
 90729  	*(**TInLoop)(unsafe.Pointer(&((*t115)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop))) = (*TInLoop)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pParse.Xdb), (*t115)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop, uint64(12)*uint64((*t115)(unsafe.Pointer(&_pLevel.Xu)).XnIn)))
 90730  	_3_pIn = (*TInLoop)((*t115)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop)
 90731  	if _3_pIn == nil {
 90732  		goto _50
 90733  	}
 90734  	_19_iMap = int32(0)
 90735  	*(*uintptr)(unsafe.Pointer(&_3_pIn)) += 12 * uintptr(_3_i)
 90736  	_3_i = _iEq
 90737  _51:
 90738  	if _3_i >= int32(_3_pLoop.XnLTerm) {
 90739  		goto _54
 90740  	}
 90741  	if (*XExpr)((*elem105((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))).XpExpr) != _pX {
 90742  		goto _55
 90743  	}
 90744  	_21_iOut = (_iReg + _3_i) - _iEq
 90745  	if _3_eType == int32(1) {
 90746  		_3_pIn.XaddrInTop = _sqlite3VdbeAddOp2(tls, _v, int32(125), _3_iTab, _21_iOut)
 90747  		goto _57
 90748  	}
 90749  	_23_iCol = func() int32 {
 90750  		if _3_aiMap != nil {
 90751  			return (*elem8(_3_aiMap, uintptr(postInc2(&_19_iMap, 1))))
 90752  		}
 90753  		return int32(0)
 90754  	}()
 90755  	_3_pIn.XaddrInTop = _sqlite3VdbeAddOp3(tls, _v, int32(99), _3_iTab, _23_iCol, _21_iOut)
 90756  _57:
 90757  	_sqlite3VdbeAddOp1(tls, _v, int32(75), _21_iOut)
 90758  	if _3_i == _iEq {
 90759  		_3_pIn.XiCur = _3_iTab
 90760  		_3_pIn.XeEndLoopOp = uint8(func() int32 {
 90761  			if _bRev != 0 {
 90762  				return int32(4)
 90763  			}
 90764  			return int32(5)
 90765  		}())
 90766  		goto _63
 90767  	}
 90768  	_3_pIn.XeEndLoopOp = uint8(164)
 90769  _63:
 90770  	*(*uintptr)(unsafe.Pointer(&_3_pIn)) += uintptr(12)
 90771  _55:
 90772  	_3_i += 1
 90773  	goto _51
 90774  _54:
 90775  	goto _64
 90776  _50:
 90777  	(*t115)(unsafe.Pointer(&_pLevel.Xu)).XnIn = int32(0)
 90778  _64:
 90779  	_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_3_aiMap))
 90780  _8:
 90781  	_disableTerm(tls, _pLevel, _pTerm)
 90782  	return _iReg
 90783  
 90784  	_ = _19_iMap
 90785  	panic(0)
 90786  }
 90787  
 90788  var _codeEqualityTermØ00__func__Ø000 [17]int8
 90789  
 90790  func init() {
 90791  	crt.Xstrncpy(nil, &_codeEqualityTermØ00__func__Ø000[0], str(109073), 17)
 90792  }
 90793  
 90794  // C comment
 90795  //  /*
 90796  //  ** Disable a term in the WHERE clause.  Except, do not disable the term
 90797  //  ** if it controls a LEFT OUTER JOIN and it did not originate in the ON
 90798  //  ** or USING clause of that join.
 90799  //  **
 90800  //  ** Consider the term t2.z='ok' in the following queries:
 90801  //  **
 90802  //  **   (1)  SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok'
 90803  //  **   (2)  SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok'
 90804  //  **   (3)  SELECT * FROM t1, t2 WHERE t1.a=t2.x AND t2.z='ok'
 90805  //  **
 90806  //  ** The t2.z='ok' is disabled in the in (2) because it originates
 90807  //  ** in the ON clause.  The term is disabled in (3) because it is not part
 90808  //  ** of a LEFT OUTER JOIN.  In (1), the term is not disabled.
 90809  //  **
 90810  //  ** Disabling a term causes that term to not be tested in the inner loop
 90811  //  ** of the join.  Disabling is an optimization.  When terms are satisfied
 90812  //  ** by indices, we disable them to prevent redundant tests in the inner
 90813  //  ** loop.  We would get the correct results if nothing were ever disabled,
 90814  //  ** but joins might run a little slower.  The trick is to disable as much
 90815  //  ** as we can without disabling too much.  If we disabled in (1), we'd get
 90816  //  ** the wrong answer.  See ticket #813.
 90817  //  **
 90818  //  ** If all the children of a term are disabled, then that term is also
 90819  //  ** automatically disabled.  In this way, terms get disabled if derived
 90820  //  ** virtual terms are tested first.  For example:
 90821  //  **
 90822  //  **      x GLOB 'abc*' AND x>='abc' AND x<'acd'
 90823  //  **      \___________/     \______/     \_____/
 90824  //  **         parent          child1       child2
 90825  //  **
 90826  //  ** Only the parent term was in the original WHERE clause.  The child1
 90827  //  ** and child2 terms were added by the LIKE optimization.  If both of
 90828  //  ** the virtual child terms are valid, then testing of the parent can be
 90829  //  ** skipped.
 90830  //  **
 90831  //  ** Usually the parent term is marked as TERM_CODED.  But if the parent
 90832  //  ** term was originally TERM_LIKE, then the parent gets TERM_LIKECOND instead.
 90833  //  ** The TERM_LIKECOND marking indicates that the term should be coded inside
 90834  //  ** a conditional such that is only evaluated on the second pass of a
 90835  //  ** LIKE-optimization loop, when scanning BLOBs instead of strings.
 90836  //  */
 90837  func _disableTerm(tls *crt.TLS, _pLevel *XWhereLevel, _pTerm *XWhereTerm) {
 90838  	var _nLoop int32
 90839  	_nLoop = int32(0)
 90840  _0:
 90841  	if func() int32 {
 90842  		if _pTerm != nil {
 90843  			return int32(1)
 90844  		}
 90845  		return func() int32 {
 90846  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127088), unsafe.Pointer(&_disableTermØ00__func__Ø000), unsafe.Pointer(str(4809)))
 90847  			crt.X__builtin_abort(tls)
 90848  			return int32(0)
 90849  		}()
 90850  	}() == 0 || (int32(_pTerm.XwtFlags)&int32(4)) != int32(0) || _pLevel.XiLeftJoin != int32(0) && (((*XExpr)(_pTerm.XpExpr).Xflags)&uint32(1)) == (0) || (_pLevel.XnotReady&_pTerm.XprereqAll) != (0) {
 90851  		goto _1
 90852  	}
 90853  	if _nLoop != 0 && ((int32(_pTerm.XwtFlags) & int32(1024)) != int32(0)) {
 90854  		{
 90855  			p := &_pTerm.XwtFlags
 90856  			*p = uint16(int32(*p) | int32(512))
 90857  		}
 90858  		goto _10
 90859  	}
 90860  	{
 90861  		p := &_pTerm.XwtFlags
 90862  		*p = uint16(int32(*p) | int32(4))
 90863  	}
 90864  _10:
 90865  	if _pTerm.XiParent < int32(0) {
 90866  		goto _1
 90867  	}
 90868  	_pTerm = elem101((*XWhereTerm)((*XWhereClause)(_pTerm.XpWC).Xa), uintptr(_pTerm.XiParent))
 90869  	_pTerm.XnChild -= 1
 90870  	if int32(_pTerm.XnChild) != int32(0) {
 90871  		goto _1
 90872  	}
 90873  	_nLoop += 1
 90874  	goto _0
 90875  _1:
 90876  }
 90877  
 90878  var _disableTermØ00__func__Ø000 [12]int8
 90879  
 90880  func init() {
 90881  	crt.Xstrncpy(nil, &_disableTermØ00__func__Ø000[0], str(109090), 12)
 90882  }
 90883  
 90884  // C comment
 90885  //  /*
 90886  //  ** If the expression passed as the second argument is a vector, generate
 90887  //  ** code to write the first nReg elements of the vector into an array
 90888  //  ** of registers starting with iReg.
 90889  //  **
 90890  //  ** If the expression is not a vector, then nReg must be passed 1. In
 90891  //  ** this case, generate code to evaluate the expression and leave the
 90892  //  ** result in register iReg.
 90893  //  */
 90894  func _codeExprOrVector(tls *crt.TLS, _pParse *XParse, _p *XExpr, _iReg int32, _nReg int32) {
 90895  	var _2_iSelect, _3_i int32
 90896  	var _2_v *TVdbe
 90897  	var _3_pList *XExprList
 90898  	func() {
 90899  		if _nReg <= int32(0) {
 90900  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127810), unsafe.Pointer(&_codeExprOrVectorØ00__func__Ø000), unsafe.Pointer(str(109102)))
 90901  			crt.X__builtin_abort(tls)
 90902  		}
 90903  	}()
 90904  	if _sqlite3ExprIsVector(tls, _p) == 0 {
 90905  		goto _2
 90906  	}
 90907  	if (_p.Xflags & uint32(2048)) != 0 {
 90908  		_2_v = (*TVdbe)(_pParse.XpVdbe)
 90909  		_2_iSelect = _sqlite3CodeSubselect(tls, _pParse, _p, int32(0), int32(0))
 90910  		_sqlite3VdbeAddOp3(tls, _2_v, int32(64), _2_iSelect, _iReg, _nReg-int32(1))
 90911  		goto _4
 90912  	}
 90913  	_3_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx)))
 90914  	func() {
 90915  		if _nReg > _3_pList.XnExpr {
 90916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127822), unsafe.Pointer(&_codeExprOrVectorØ00__func__Ø000), unsafe.Pointer(str(109109)))
 90917  			crt.X__builtin_abort(tls)
 90918  		}
 90919  	}()
 90920  	_3_i = int32(0)
 90921  _7:
 90922  	if _3_i >= _nReg {
 90923  		goto _10
 90924  	}
 90925  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_3_pList.Xa)), uintptr(_3_i)).XpExpr), _iReg+_3_i)
 90926  	_3_i += 1
 90927  	goto _7
 90928  _10:
 90929  _4:
 90930  	goto _11
 90931  _2:
 90932  	func() {
 90933  		if _nReg != int32(1) {
 90934  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127828), unsafe.Pointer(&_codeExprOrVectorØ00__func__Ø000), unsafe.Pointer(str(109128)))
 90935  			crt.X__builtin_abort(tls)
 90936  		}
 90937  	}()
 90938  	_sqlite3ExprCode(tls, _pParse, _p, _iReg)
 90939  _11:
 90940  }
 90941  
 90942  var _codeExprOrVectorØ00__func__Ø000 [17]int8
 90943  
 90944  func init() {
 90945  	crt.Xstrncpy(nil, &_codeExprOrVectorØ00__func__Ø000[0], str(109136), 17)
 90946  }
 90947  
 90948  // C comment
 90949  //  /*
 90950  //  ** Generate code that will evaluate all == and IN constraints for an
 90951  //  ** index scan.
 90952  //  **
 90953  //  ** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c).
 90954  //  ** Suppose the WHERE clause is this:  a==5 AND b IN (1,2,3) AND c>5 AND c<10
 90955  //  ** The index has as many as three equality constraints, but in this
 90956  //  ** example, the third "c" value is an inequality.  So only two
 90957  //  ** constraints are coded.  This routine will generate code to evaluate
 90958  //  ** a==5 and b IN (1,2,3).  The current values for a and b will be stored
 90959  //  ** in consecutive registers and the index of the first register is returned.
 90960  //  **
 90961  //  ** In the example above nEq==2.  But this subroutine works for any value
 90962  //  ** of nEq including 0.  If nEq==0, this routine is nearly a no-op.
 90963  //  ** The only thing it does is allocate the pLevel->iMem memory cell and
 90964  //  ** compute the affinity string.
 90965  //  **
 90966  //  ** The nExtraReg parameter is 0 or 1.  It is 0 if all WHERE clause constraints
 90967  //  ** are == or IN and are covered by the nEq.  nExtraReg is 1 if there is
 90968  //  ** an inequality constraint (such as the "c>=5 AND c<10" in the example) that
 90969  //  ** occurs after the nEq quality constraints.
 90970  //  **
 90971  //  ** This routine allocates a range of nEq+nExtraReg memory cells and returns
 90972  //  ** the index of the first memory cell in that range. The code that
 90973  //  ** calls this routine will use that memory range to store keys for
 90974  //  ** start and termination conditions of the loop.
 90975  //  ** key value of the loop.  If one or more IN operators appear, then
 90976  //  ** this routine allocates an additional nEq memory cells for internal
 90977  //  ** use.
 90978  //  **
 90979  //  ** Before returning, *pzAff is set to point to a buffer containing a
 90980  //  ** copy of the column affinity string of the index allocated using
 90981  //  ** sqlite3DbMalloc(). Except, entries in the copy of the string associated
 90982  //  ** with equality constraints that use BLOB or NONE affinity are set to
 90983  //  ** SQLITE_AFF_BLOB. This is to deal with SQL such as the following:
 90984  //  **
 90985  //  **   CREATE TABLE t1(a TEXT PRIMARY KEY, b);
 90986  //  **   SELECT ... FROM t1 AS t2, t1 WHERE t1.a = t2.b;
 90987  //  **
 90988  //  ** In the example above, the index on t1(a) has TEXT affinity. But since
 90989  //  ** the right hand side of the equality constraint (t2.b) has BLOB/NONE affinity,
 90990  //  ** no conversion should be attempted before using a t2.b value as part of
 90991  //  ** a key to search the index. Hence the first byte in the returned affinity
 90992  //  ** string in this example would be set to SQLITE_AFF_BLOB.
 90993  //  */
 90994  func _codeAllEqualityTerms(tls *crt.TLS, _pParse *XParse, _pLevel *XWhereLevel, _bRev int32, _nExtraReg int32, _pzAff **int8) (r0 int32) {
 90995  	var _j, _regBase, _nReg, _1_iIdxCur, _3_r1 int32
 90996  	var _zAff *int8
 90997  	var _nEq, _nSkip uint16
 90998  	var _v *TVdbe
 90999  	var _9_pRight *XExpr
 91000  	var _pIdx *XIndex
 91001  	var _pLoop *XWhereLoop
 91002  	var _pTerm *XWhereTerm
 91003  	_v = (*TVdbe)(_pParse.XpVdbe)
 91004  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 91005  	func() {
 91006  		if (_pLoop.XwsFlags & uint32(1024)) != (0) {
 91007  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127415), unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000), unsafe.Pointer(str(109153)))
 91008  			crt.X__builtin_abort(tls)
 91009  		}
 91010  	}()
 91011  	_nEq = (*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq
 91012  	_nSkip = _pLoop.XnSkip
 91013  	_pIdx = (*XIndex)((*t102)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)
 91014  	func() {
 91015  		if _pIdx == nil {
 91016  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127419), unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000), unsafe.Pointer(str(42024)))
 91017  			crt.X__builtin_abort(tls)
 91018  		}
 91019  	}()
 91020  	_regBase = _pParse.XnMem + int32(1)
 91021  	_nReg = int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnEq) + _nExtraReg
 91022  	_pParse.XnMem += _nReg
 91023  	_zAff = _sqlite3DbStrDup(tls, (*Xsqlite3)(_pParse.Xdb), _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.Xdb), _pIdx))
 91024  	func() {
 91025  		if _zAff == nil && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 91026  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127428), unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000), unsafe.Pointer(str(109194)))
 91027  			crt.X__builtin_abort(tls)
 91028  		}
 91029  	}()
 91030  	if _nSkip == 0 {
 91031  		goto _7
 91032  	}
 91033  	_1_iIdxCur = _pLevel.XiIdxCur
 91034  	_sqlite3VdbeAddOp1(tls, _v, func() int32 {
 91035  		if _bRev != 0 {
 91036  			return int32(33)
 91037  		}
 91038  		return int32(37)
 91039  	}(), _1_iIdxCur)
 91040  	_sqlite3VdbeComment(tls, _v, str(109230), unsafe.Pointer(_pIdx.XzName))
 91041  	_j = _sqlite3VdbeAddOp0(tls, _v, int32(13))
 91042  	_pLevel.XaddrSkip = _sqlite3VdbeAddOp4Int(tls, _v, func() int32 {
 91043  		if _bRev != 0 {
 91044  			return int32(24)
 91045  		}
 91046  		return int32(27)
 91047  	}(), _1_iIdxCur, int32(0), _regBase, int32(_nSkip))
 91048  	_sqlite3VdbeJumpHere(tls, _v, _j)
 91049  	_j = int32(0)
 91050  _12:
 91051  	if _j >= int32(_nSkip) {
 91052  		goto _15
 91053  	}
 91054  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _1_iIdxCur, _j, _regBase+_j)
 91055  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_explainIndexColumnName(tls, _pIdx, _j)))
 91056  	_j += 1
 91057  	goto _12
 91058  _15:
 91059  _7:
 91060  	func() {
 91061  		if _zAff != nil && int32(crt.Xstrlen(tls, _zAff)) < int32(_nEq) {
 91062  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127451), unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000), unsafe.Pointer(str(109252)))
 91063  			crt.X__builtin_abort(tls)
 91064  		}
 91065  	}()
 91066  	_j = int32(_nSkip)
 91067  _19:
 91068  	if _j >= int32(_nEq) {
 91069  		goto _22
 91070  	}
 91071  	_pTerm = *elem105((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))
 91072  	func() {
 91073  		if _pTerm == nil {
 91074  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127455), unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000), unsafe.Pointer(str(108079)))
 91075  			crt.X__builtin_abort(tls)
 91076  		}
 91077  	}()
 91078  	_3_r1 = _codeEqualityTerm(tls, _pParse, _pTerm, _pLevel, _j, _bRev, _regBase+_j)
 91079  	if _3_r1 == (_regBase + _j) {
 91080  		goto _25
 91081  	}
 91082  	if _nReg == int32(1) {
 91083  		_sqlite3ReleaseTempReg(tls, _pParse, _regBase)
 91084  		_regBase = _3_r1
 91085  		goto _27
 91086  	}
 91087  	_sqlite3VdbeAddOp2(tls, _v, int32(65), _3_r1, _regBase+_j)
 91088  _27:
 91089  _25:
 91090  	if (int32(_pTerm.XeOperator) & int32(1)) == 0 {
 91091  		goto _28
 91092  	}
 91093  	if (((*XExpr)(_pTerm.XpExpr).Xflags) & uint32(2048)) == 0 {
 91094  		goto _29
 91095  	}
 91096  	if _zAff != nil {
 91097  		*elem1(_zAff, uintptr(_j)) = int8(65)
 91098  	}
 91099  _29:
 91100  	goto _32
 91101  _28:
 91102  	if (int32(_pTerm.XeOperator) & int32(256)) != int32(0) {
 91103  		goto _32
 91104  	}
 91105  	_9_pRight = (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)
 91106  	if ((int32(_pTerm.XwtFlags) & int32(2048)) == int32(0)) && _sqlite3ExprCanBeNull(tls, _9_pRight) != 0 {
 91107  		_sqlite3VdbeAddOp2(tls, _v, int32(75), _regBase+_j, _pLevel.XaddrBrk)
 91108  	}
 91109  	if _zAff == nil {
 91110  		goto _35
 91111  	}
 91112  	if int32(_sqlite3CompareAffinity(tls, _9_pRight, *elem1(_zAff, uintptr(_j)))) == int32(65) {
 91113  		*elem1(_zAff, uintptr(_j)) = int8(65)
 91114  	}
 91115  	if _sqlite3ExprNeedsNoAffinityChange(tls, _9_pRight, *elem1(_zAff, uintptr(_j))) != 0 {
 91116  		*elem1(_zAff, uintptr(_j)) = int8(65)
 91117  	}
 91118  _35:
 91119  _32:
 91120  	_j += 1
 91121  	goto _19
 91122  _22:
 91123  	*_pzAff = _zAff
 91124  	return _regBase
 91125  }
 91126  
 91127  var _codeAllEqualityTermsØ00__func__Ø000 [21]int8
 91128  
 91129  func init() {
 91130  	crt.Xstrncpy(nil, &_codeAllEqualityTermsØ00__func__Ø000[0], str(109286), 21)
 91131  }
 91132  
 91133  // C comment
 91134  //  /*
 91135  //  ** Return TRUE if the given expression is a constant which would be
 91136  //  ** unchanged by OP_Affinity with the affinity given in the second
 91137  //  ** argument.
 91138  //  **
 91139  //  ** This routine is used to determine if the OP_Affinity operation
 91140  //  ** can be omitted.  When in doubt return FALSE.  A false negative
 91141  //  ** is harmless.  A false positive, however, can result in the wrong
 91142  //  ** answer.
 91143  //  */
 91144  func _sqlite3ExprNeedsNoAffinityChange(tls *crt.TLS, _p *XExpr, _aff int8) (r0 int32) {
 91145  	var _op uint8
 91146  	if int32(_aff) == int32(65) {
 91147  		return int32(1)
 91148  	}
 91149  _0:
 91150  	if (int32(_p.Xop) == int32(156)) || (int32(_p.Xop) == int32(155)) {
 91151  		_p = (*XExpr)(_p.XpLeft)
 91152  		goto _0
 91153  	}
 91154  	_op = _p.Xop
 91155  	if int32(_op) == int32(157) {
 91156  		_op = _p.Xop2
 91157  	}
 91158  	switch int32(_op) {
 91159  	case int32(97):
 91160  		goto _8
 91161  	case int32(132):
 91162  		goto _7
 91163  	case int32(133):
 91164  		goto _9
 91165  	case int32(134):
 91166  		goto _6
 91167  	case int32(152):
 91168  		goto _10
 91169  	default:
 91170  		goto _11
 91171  	}
 91172  
 91173  _6:
 91174  	return bool2int((int32(_aff) == int32(68)) || (int32(_aff) == int32(67)))
 91175  
 91176  _7:
 91177  	return bool2int((int32(_aff) == int32(69)) || (int32(_aff) == int32(67)))
 91178  
 91179  _8:
 91180  	return bool2int(int32(_aff) == int32(66))
 91181  
 91182  _9:
 91183  	return int32(1)
 91184  
 91185  _10:
 91186  	func() {
 91187  		if _p.XiTable < int32(0) {
 91188  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92905), unsafe.Pointer(&_sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000), unsafe.Pointer(str(109307)))
 91189  			crt.X__builtin_abort(tls)
 91190  		}
 91191  	}()
 91192  	return bool2int((int32(_p.XiColumn) < int32(0)) && ((int32(_aff) == int32(68)) || (int32(_aff) == int32(67))))
 91193  
 91194  _11:
 91195  	return int32(0)
 91196  }
 91197  
 91198  var _sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000 [33]int8
 91199  
 91200  func init() {
 91201  	crt.Xstrncpy(nil, &_sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000[0], str(109320), 33)
 91202  }
 91203  
 91204  // C comment
 91205  //  /*
 91206  //  ** If the most recently coded instruction is a constant range constraint
 91207  //  ** (a string literal) that originated from the LIKE optimization, then
 91208  //  ** set P3 and P5 on the OP_String opcode so that the string will be cast
 91209  //  ** to a BLOB at appropriate times.
 91210  //  **
 91211  //  ** The LIKE optimization trys to evaluate "x LIKE 'abc%'" as a range
 91212  //  ** expression: "x>='ABC' AND x<'abd'".  But this requires that the range
 91213  //  ** scan loop run twice, once for strings and a second time for BLOBs.
 91214  //  ** The OP_String opcodes on the second pass convert the upper and lower
 91215  //  ** bound string constants to blobs.  This routine makes the necessary changes
 91216  //  ** to the OP_String opcodes for that to happen.
 91217  //  **
 91218  //  ** Except, of course, if SQLITE_LIKE_DOESNT_MATCH_BLOBS is defined, then
 91219  //  ** only the one pass through the string space is required, so this routine
 91220  //  ** becomes a no-op.
 91221  //  */
 91222  func _whereLikeOptimizationStringFixup(tls *crt.TLS, _v *TVdbe, _pLevel *XWhereLevel, _pTerm *XWhereTerm) {
 91223  	var _1_pOp *XVdbeOp
 91224  	if (int32(_pTerm.XwtFlags) & int32(256)) != 0 {
 91225  		func() {
 91226  			if _pLevel.XiLikeRepCntr <= (0) {
 91227  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127522), unsafe.Pointer(&_whereLikeOptimizationStringFixupØ00__func__Ø000), unsafe.Pointer(str(109353)))
 91228  				crt.X__builtin_abort(tls)
 91229  			}
 91230  		}()
 91231  		_1_pOp = _sqlite3VdbeGetOp(tls, _v, int32(-1))
 91232  		func() {
 91233  			if _1_pOp == nil {
 91234  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127524), unsafe.Pointer(&_whereLikeOptimizationStringFixupØ00__func__Ø000), unsafe.Pointer(str(109376)))
 91235  				crt.X__builtin_abort(tls)
 91236  			}
 91237  		}()
 91238  		func() {
 91239  			if int32(_1_pOp.Xopcode) != int32(97) && ((*Xsqlite3)((*XParse)((*XWhereInfo)((*XWhereClause)(_pTerm.XpWC).XpWInfo).XpParse).Xdb).XmallocFailed) == 0 {
 91240  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127525), unsafe.Pointer(&_whereLikeOptimizationStringFixupØ00__func__Ø000), unsafe.Pointer(str(109383)))
 91241  				crt.X__builtin_abort(tls)
 91242  			}
 91243  		}()
 91244  		_1_pOp.Xp3 = int32(_pLevel.XiLikeRepCntr >> 1)
 91245  		_1_pOp.Xp5 = uint16(uint8(_pLevel.XiLikeRepCntr & uint32(1)))
 91246  	}
 91247  }
 91248  
 91249  var _whereLikeOptimizationStringFixupØ00__func__Ø000 [33]int8
 91250  
 91251  func init() {
 91252  	crt.Xstrncpy(nil, &_whereLikeOptimizationStringFixupØ00__func__Ø000[0], str(109455), 33)
 91253  }
 91254  
 91255  // C comment
 91256  //  /*
 91257  //  ** Expression pRight, which is the RHS of a comparison operation, is
 91258  //  ** either a vector of n elements or, if n==1, a scalar expression.
 91259  //  ** Before the comparison operation, affinity zAff is to be applied
 91260  //  ** to the pRight values. This function modifies characters within the
 91261  //  ** affinity string to SQLITE_AFF_BLOB if either:
 91262  //  **
 91263  //  **   * the comparison will be performed with no affinity, or
 91264  //  **   * the affinity change in zAff is guaranteed not to change the value.
 91265  //  */
 91266  func _updateRangeAffinityStr(tls *crt.TLS, _pRight *XExpr, _n int32, _zAff *int8) {
 91267  	var _i int32
 91268  	var _1_p *XExpr
 91269  	_i = int32(0)
 91270  _0:
 91271  	if _i >= _n {
 91272  		goto _3
 91273  	}
 91274  	_1_p = _sqlite3VectorFieldSubexpr(tls, _pRight, _i)
 91275  	if (int32(_sqlite3CompareAffinity(tls, _1_p, *elem1(_zAff, uintptr(_i)))) == int32(65)) || _sqlite3ExprNeedsNoAffinityChange(tls, _1_p, *elem1(_zAff, uintptr(_i))) != 0 {
 91276  		*elem1(_zAff, uintptr(_i)) = int8(65)
 91277  	}
 91278  	_i += 1
 91279  	goto _0
 91280  _3:
 91281  }
 91282  
 91283  // C comment
 91284  //  /*
 91285  //  ** Code an OP_Affinity opcode to apply the column affinity string zAff
 91286  //  ** to the n registers starting at base.
 91287  //  **
 91288  //  ** As an optimization, SQLITE_AFF_BLOB entries (which are no-ops) at the
 91289  //  ** beginning and end of zAff are ignored.  If all entries in zAff are
 91290  //  ** SQLITE_AFF_BLOB, then no code gets generated.
 91291  //  **
 91292  //  ** This routine makes its own copy of zAff so that the caller is free
 91293  //  ** to modify zAff after this routine returns.
 91294  //  */
 91295  func _codeApplyAffinity(tls *crt.TLS, _pParse *XParse, _base int32, _n int32, _zAff *int8) {
 91296  	var _v *TVdbe
 91297  	_v = (*TVdbe)(_pParse.XpVdbe)
 91298  	if _zAff == nil {
 91299  		func() {
 91300  			if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 91301  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127120), unsafe.Pointer(&_codeApplyAffinityØ00__func__Ø000), unsafe.Pointer(str(42441)))
 91302  				crt.X__builtin_abort(tls)
 91303  			}
 91304  		}()
 91305  		return
 91306  	}
 91307  	func() {
 91308  		if _v == nil {
 91309  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127123), unsafe.Pointer(&_codeApplyAffinityØ00__func__Ø000), unsafe.Pointer(str(42019)))
 91310  			crt.X__builtin_abort(tls)
 91311  		}
 91312  	}()
 91313  _5:
 91314  	if (_n > int32(0)) && (int32(*elem1(_zAff, 0)) == int32(65)) {
 91315  		_n -= 1
 91316  		_base += 1
 91317  		*(*uintptr)(unsafe.Pointer(&_zAff)) += uintptr(1)
 91318  		goto _5
 91319  	}
 91320  _6:
 91321  	if (_n > int32(1)) && (int32(*elem1(_zAff, uintptr(_n-int32(1)))) == int32(65)) {
 91322  		_n -= 1
 91323  		goto _6
 91324  	}
 91325  	if _n > int32(0) {
 91326  		_sqlite3VdbeAddOp4(tls, _v, int32(100), _base, _n, int32(0), _zAff, _n)
 91327  		_sqlite3ExprCacheAffinityChange(tls, _pParse, _base, _n)
 91328  	}
 91329  }
 91330  
 91331  var _codeApplyAffinityØ00__func__Ø000 [18]int8
 91332  
 91333  func init() {
 91334  	crt.Xstrncpy(nil, &_codeApplyAffinityØ00__func__Ø000[0], str(109488), 18)
 91335  }
 91336  
 91337  var _sqlite3WhereCodeOneLoopStartØ00aStartOpØ001 [8]uint8
 91338  
 91339  func init() {
 91340  	_sqlite3WhereCodeOneLoopStartØ00aStartOpØ001 = [8]uint8{0, 0, 37, 33, 27, 24, 26, 25}
 91341  }
 91342  
 91343  var _sqlite3WhereCodeOneLoopStartØ00aEndOpØ002 [4]uint8
 91344  
 91345  func init() {
 91346  	_sqlite3WhereCodeOneLoopStartØ00aEndOpØ002 = [4]uint8{41, 39, 38, 40}
 91347  }
 91348  
 91349  // C comment
 91350  //  /*
 91351  //  ** Cursor iCur is open on an intkey b-tree (a table). Register iRowid contains
 91352  //  ** a rowid value just read from cursor iIdxCur, open on index pIdx. This
 91353  //  ** function generates code to do a deferred seek of cursor iCur to the
 91354  //  ** rowid stored in register iRowid.
 91355  //  **
 91356  //  ** Normally, this is just:
 91357  //  **
 91358  //  **   OP_Seek $iCur $iRowid
 91359  //  **
 91360  //  ** However, if the scan currently being coded is a branch of an OR-loop and
 91361  //  ** the statement currently being coded is a SELECT, then P3 of the OP_Seek
 91362  //  ** is set to iIdxCur and P4 is set to point to an array of integers
 91363  //  ** containing one entry for each column of the table cursor iCur is open
 91364  //  ** on. For each table column, if the column is the i'th column of the
 91365  //  ** index, then the corresponding array entry is set to (i+1). If the column
 91366  //  ** does not appear in the index at all, the array entry is set to 0.
 91367  //  */
 91368  func _codeDeferredSeek(tls *crt.TLS, _pWInfo *XWhereInfo, _pIdx *XIndex, _iCur int32, _iIdxCur int32) {
 91369  	var _1_i int32
 91370  	var _1_ai *int32
 91371  	var _1_pTab *XTable
 91372  	var _v *TVdbe
 91373  	var _pParse *XParse
 91374  	_pParse = (*XParse)(_pWInfo.XpParse)
 91375  	_v = (*TVdbe)(_pParse.XpVdbe)
 91376  	func() {
 91377  		if _iIdxCur <= int32(0) {
 91378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127779), unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000), unsafe.Pointer(str(109506)))
 91379  			crt.X__builtin_abort(tls)
 91380  		}
 91381  	}()
 91382  	func() {
 91383  		if int32(*elem52(_pIdx.XaiColumn, uintptr(int32(_pIdx.XnColumn)-int32(1)))) != int32(-1) {
 91384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127780), unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000), unsafe.Pointer(str(109516)))
 91385  			crt.X__builtin_abort(tls)
 91386  		}
 91387  	}()
 91388  	_sqlite3VdbeAddOp3(tls, _v, int32(130), _iIdxCur, int32(0), _iCur)
 91389  	if (int32(_pWInfo.XwctrlFlags)&int32(32)) == 0 || (func() *XParse {
 91390  		if _pParse.XpToplevel != nil {
 91391  			return (*XParse)(_pParse.XpToplevel)
 91392  		}
 91393  		return _pParse
 91394  	}().XwriteMask) != (0) {
 91395  		goto _7
 91396  	}
 91397  	_1_pTab = (*XTable)(_pIdx.XpTable)
 91398  	_1_ai = (*int32)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), uint64(4)*uint64(int32(_1_pTab.XnCol)+int32(1))))
 91399  	if _1_ai == nil {
 91400  		goto _8
 91401  	}
 91402  	*elem8(_1_ai, 0) = int32(_1_pTab.XnCol)
 91403  	_1_i = int32(0)
 91404  _9:
 91405  	if _1_i >= (int32(_pIdx.XnColumn) - int32(1)) {
 91406  		goto _12
 91407  	}
 91408  	func() {
 91409  		if int32(*elem52(_pIdx.XaiColumn, uintptr(_1_i))) >= int32(_1_pTab.XnCol) {
 91410  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127792), unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000), unsafe.Pointer(str(109552)))
 91411  			crt.X__builtin_abort(tls)
 91412  		}
 91413  	}()
 91414  	if int32(*elem52(_pIdx.XaiColumn, uintptr(_1_i))) >= int32(0) {
 91415  		*elem8(_1_ai, uintptr(int32(*elem52(_pIdx.XaiColumn, uintptr(_1_i)))+int32(1))) = _1_i + int32(1)
 91416  	}
 91417  	_1_i += 1
 91418  	goto _9
 91419  _12:
 91420  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), (*int8)(unsafe.Pointer(_1_ai)), int32(-12))
 91421  _8:
 91422  _7:
 91423  }
 91424  
 91425  var _codeDeferredSeekØ00__func__Ø000 [17]int8
 91426  
 91427  func init() {
 91428  	crt.Xstrncpy(nil, &_codeDeferredSeekØ00__func__Ø000[0], str(109581), 17)
 91429  }
 91430  
 91431  // C comment
 91432  //  /*
 91433  //  ** For an indexes on expression X, locate every instance of expression X in pExpr
 91434  //  ** and change that subexpression into a reference to the appropriate column of
 91435  //  ** the index.
 91436  //  */
 91437  func _whereIndexExprTrans(tls *crt.TLS, _pIdx *XIndex, _iTabCur int32, _iIdxCur int32, _pWInfo *XWhereInfo) {
 91438  	var _iIdxCol int32
 91439  	var _aColExpr *XExprList
 91440  	var _w XWalker
 91441  	var _x XIdxExprTrans
 91442  	_aColExpr = (*XExprList)(_pIdx.XaColExpr)
 91443  	if _aColExpr == nil {
 91444  		return
 91445  	}
 91446  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint64(48))
 91447  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _whereIndexExprTransNode
 91448  	*(**XIdxExprTrans)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = &_x
 91449  	_x.XiTabCur = _iTabCur
 91450  	_x.XiIdxCur = _iIdxCur
 91451  	_iIdxCol = int32(0)
 91452  _1:
 91453  	if _iIdxCol >= _aColExpr.XnExpr {
 91454  		goto _4
 91455  	}
 91456  	if int32(*elem52(_pIdx.XaiColumn, uintptr(_iIdxCol))) != int32(-2) {
 91457  		goto _2
 91458  	}
 91459  	func() {
 91460  		if (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_aColExpr.Xa)), uintptr(_iIdxCol)).XpExpr) == nil {
 91461  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127887), unsafe.Pointer(&_whereIndexExprTransØ00__func__Ø000), unsafe.Pointer(str(109598)))
 91462  			crt.X__builtin_abort(tls)
 91463  		}
 91464  	}()
 91465  	_x.XiIdxCol = _iIdxCol
 91466  	*(**XExpr)(unsafe.Pointer(&_x.XpIdxExpr)) = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_aColExpr.Xa)), uintptr(_iIdxCol)).XpExpr)
 91467  	_sqlite3WalkExpr(tls, &_w, (*XExpr)(_pWInfo.XpWhere))
 91468  	_sqlite3WalkExprList(tls, &_w, (*XExprList)(_pWInfo.XpOrderBy))
 91469  	_sqlite3WalkExprList(tls, &_w, (*XExprList)(_pWInfo.XpResultSet))
 91470  _2:
 91471  	_iIdxCol += 1
 91472  	goto _1
 91473  _4:
 91474  }
 91475  
 91476  // C comment
 91477  //  /* The walker node callback used to transform matching expressions into
 91478  //  ** a reference to an index column for an index on an expression.
 91479  //  **
 91480  //  ** If pExpr matches, then transform it into a reference to the index column
 91481  //  ** that contains the value of pExpr.
 91482  //  */
 91483  func _whereIndexExprTransNode(tls *crt.TLS, _p *XWalker, _pExpr *XExpr) (r0 int32) {
 91484  	var _pX *XIdxExprTrans
 91485  	_pX = (*XIdxExprTrans)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
 91486  	if _sqlite3ExprCompare(tls, _pExpr, (*XExpr)(_pX.XpIdxExpr), _pX.XiTabCur) == int32(0) {
 91487  		_pExpr.Xop = uint8(152)
 91488  		_pExpr.XiTable = _pX.XiIdxCur
 91489  		_pExpr.XiColumn = int16(_pX.XiIdxCol)
 91490  		*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = nil
 91491  		return int32(1)
 91492  	}
 91493  	return int32(0)
 91494  }
 91495  
 91496  var _whereIndexExprTransØ00__func__Ø000 [20]int8
 91497  
 91498  func init() {
 91499  	crt.Xstrncpy(nil, &_whereIndexExprTransØ00__func__Ø000[0], str(109628), 20)
 91500  }
 91501  
 91502  func _sqlite3ExprCodeGetColumnToReg(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iColumn int32, _iTable int32, _iReg int32) {
 91503  	var _r1 int32
 91504  	_r1 = _sqlite3ExprCodeGetColumn(tls, _pParse, _pTab, _iColumn, _iTable, _iReg, 0)
 91505  	if _r1 != _iReg {
 91506  		_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.XpVdbe), int32(65), _r1, _iReg)
 91507  	}
 91508  }
 91509  
 91510  // C comment
 91511  //  /*
 91512  //  ** Generate the end of the WHERE loop.  See comments on
 91513  //  ** sqlite3WhereBegin() for additional information.
 91514  //  */
 91515  func _sqlite3WhereEnd(tls *crt.TLS, _pWInfo *XWhereInfo) {
 91516  	var _i, _1_addr, _2_addrSeek, _2_n, _3_r1, _3_j, _3_op, _6_j, _11_ws, _16_k, _16_last, _22_x int32
 91517  	var _db *Xsqlite3
 91518  	var _16_pTab *XTable
 91519  	var _v *TVdbe
 91520  	var _pTabList *XSrcList
 91521  	var _16_pTabItem *TSrcList_item
 91522  	var _pParse *XParse
 91523  	var _2_pIdx, _16_pIdx, _23_pPk *XIndex
 91524  	var _16_pOp *XVdbeOp
 91525  	var _pLoop *XWhereLoop
 91526  	var _pLevel *XWhereLevel
 91527  	var _6_pIn *TInLoop
 91528  	_pParse = (*XParse)(_pWInfo.XpParse)
 91529  	_v = (*TVdbe)(_pParse.XpVdbe)
 91530  	_pTabList = (*XSrcList)(_pWInfo.XpTabList)
 91531  	_db = (*Xsqlite3)(_pParse.Xdb)
 91532  	_sqlite3ExprCacheClear(tls, _pParse)
 91533  	_i = int32(_pWInfo.XnLevel) - int32(1)
 91534  _0:
 91535  	if _i < int32(0) {
 91536  		goto _3
 91537  	}
 91538  	_pLevel = elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_i))
 91539  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 91540  	if int32(_pLevel.Xop) == int32(164) {
 91541  		goto _4
 91542  	}
 91543  	_2_addrSeek = int32(0)
 91544  	if int32(_pWInfo.XeDistinct) != int32(2) || (_pLoop.XwsFlags&uint32(512)) == (0) || ((uint32((store114(&_2_pIdx, (*XIndex)((*t102)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)).XidxType)>>7)<<31)>>31) == 0 || store2(&_2_n, int32((*t102)(unsafe.Pointer(&_pLoop.Xu)).XnIdxCol)) <= int32(0) || int32(*elem52(_2_pIdx.XaiRowLogEst, uintptr(_2_n))) < int32(36) {
 91545  		goto _9
 91546  	}
 91547  	_3_r1 = _pParse.XnMem + int32(1)
 91548  	_3_j = int32(0)
 91549  _10:
 91550  	if _3_j >= _2_n {
 91551  		goto _13
 91552  	}
 91553  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _pLevel.XiIdxCur, _3_j, _3_r1+_3_j)
 91554  	_3_j += 1
 91555  	goto _10
 91556  _13:
 91557  	_pParse.XnMem += _2_n + int32(1)
 91558  	_3_op = func() int32 {
 91559  		if int32(_pLevel.Xop) == int32(6) {
 91560  			return int32(24)
 91561  		}
 91562  		return int32(27)
 91563  	}()
 91564  	_2_addrSeek = _sqlite3VdbeAddOp4Int(tls, _v, _3_op, _pLevel.XiIdxCur, int32(0), _3_r1, _2_n)
 91565  	_sqlite3VdbeAddOp2(tls, _v, int32(13), int32(1), _pLevel.Xp2)
 91566  _9:
 91567  	_sqlite3VdbeResolveLabel(tls, _v, _pLevel.XaddrCont)
 91568  	_sqlite3VdbeAddOp3(tls, _v, int32(_pLevel.Xop), _pLevel.Xp1, _pLevel.Xp2, int32(_pLevel.Xp3))
 91569  	_sqlite3VdbeChangeP5(tls, _v, uint16(_pLevel.Xp5))
 91570  	if _2_addrSeek != 0 {
 91571  		_sqlite3VdbeJumpHere(tls, _v, _2_addrSeek)
 91572  	}
 91573  	goto _17
 91574  _4:
 91575  	_sqlite3VdbeResolveLabel(tls, _v, _pLevel.XaddrCont)
 91576  _17:
 91577  	if (_pLoop.XwsFlags&uint32(2048)) == 0 || ((*t115)(unsafe.Pointer(&_pLevel.Xu)).XnIn) <= int32(0) {
 91578  		goto _19
 91579  	}
 91580  	_sqlite3VdbeResolveLabel(tls, _v, _pLevel.XaddrNxt)
 91581  	*func() **TInLoop { _6_j = (*t115)(unsafe.Pointer(&_pLevel.Xu)).XnIn; return &_6_pIn }() = elem116((*TInLoop)((*t115)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop), uintptr(_6_j-int32(1)))
 91582  _20:
 91583  	if _6_j <= int32(0) {
 91584  		goto _23
 91585  	}
 91586  	_sqlite3VdbeJumpHere(tls, _v, _6_pIn.XaddrInTop+int32(1))
 91587  	if int32(_6_pIn.XeEndLoopOp) != int32(164) {
 91588  		_sqlite3VdbeAddOp2(tls, _v, int32(_6_pIn.XeEndLoopOp), _6_pIn.XiCur, _6_pIn.XaddrInTop)
 91589  	}
 91590  	_sqlite3VdbeJumpHere(tls, _v, _6_pIn.XaddrInTop-int32(1))
 91591  	*(*uintptr)(unsafe.Pointer(func() **TInLoop { _6_j -= 1; return &_6_pIn }())) += uintptr(18446744073709551604)
 91592  	goto _20
 91593  _23:
 91594  _19:
 91595  	_sqlite3VdbeResolveLabel(tls, _v, _pLevel.XaddrBrk)
 91596  	if _pLevel.XaddrSkip != 0 {
 91597  		_sqlite3VdbeGoto(tls, _v, _pLevel.XaddrSkip)
 91598  		_sqlite3VdbeComment(tls, _v, str(109648), unsafe.Pointer((*XIndex)((*t102)(unsafe.Pointer(&_pLoop.Xu)).XpIndex).XzName))
 91599  		_sqlite3VdbeJumpHere(tls, _v, _pLevel.XaddrSkip)
 91600  		_sqlite3VdbeJumpHere(tls, _v, _pLevel.XaddrSkip-int32(2))
 91601  	}
 91602  	if _pLevel.XaddrLikeRep != 0 {
 91603  		_sqlite3VdbeAddOp2(tls, _v, int32(48), int32(_pLevel.XiLikeRepCntr>>1), _pLevel.XaddrLikeRep)
 91604  	}
 91605  	if _pLevel.XiLeftJoin == 0 {
 91606  		goto _27
 91607  	}
 91608  	_11_ws = int32(_pLoop.XwsFlags)
 91609  	_1_addr = _sqlite3VdbeAddOp1(tls, _v, int32(46), _pLevel.XiLeftJoin)
 91610  	func() {
 91611  		if (_11_ws&int32(64)) != int32(0) && (_11_ws&int32(512)) == int32(0) {
 91612  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135312), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(109669)))
 91613  			crt.X__builtin_abort(tls)
 91614  		}
 91615  	}()
 91616  	if (_11_ws & int32(64)) == int32(0) {
 91617  		_sqlite3VdbeAddOp1(tls, _v, int32(126), elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_i)).XiCursor)
 91618  	}
 91619  	if (_11_ws&int32(512)) != 0 || ((_11_ws&int32(8192)) != 0 && ((*(*unsafe.Pointer)(unsafe.Pointer(&_pLevel.Xu))) != nil)) {
 91620  		_sqlite3VdbeAddOp1(tls, _v, int32(126), _pLevel.XiIdxCur)
 91621  	}
 91622  	if int32(_pLevel.Xop) == int32(52) {
 91623  		_sqlite3VdbeAddOp2(tls, _v, int32(14), _pLevel.Xp1, _pLevel.XaddrFirst)
 91624  		goto _36
 91625  	}
 91626  	_sqlite3VdbeGoto(tls, _v, _pLevel.XaddrFirst)
 91627  _36:
 91628  	_sqlite3VdbeJumpHere(tls, _v, _1_addr)
 91629  _27:
 91630  	_i -= 1
 91631  	goto _0
 91632  _3:
 91633  	_sqlite3VdbeResolveLabel(tls, _v, _pWInfo.XiBreak)
 91634  	func() {
 91635  		if int32(_pWInfo.XnLevel) > _pTabList.XnSrc {
 91636  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135337), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(109721)))
 91637  			crt.X__builtin_abort(tls)
 91638  		}
 91639  	}()
 91640  	*func() **XWhereLevel { _i = int32(0); return &_pLevel }() = (*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa))
 91641  _39:
 91642  	if _i >= int32(_pWInfo.XnLevel) {
 91643  		goto _42
 91644  	}
 91645  	_16_pIdx = nil
 91646  	_16_pTabItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_pLevel.XiFrom))
 91647  	_16_pTab = (*XTable)(_16_pTabItem.XpTab)
 91648  	func() {
 91649  		if _16_pTab == nil {
 91650  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135344), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(43549)))
 91651  			crt.X__builtin_abort(tls)
 91652  		}
 91653  	}()
 91654  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 91655  	if ((uint32((_16_pTabItem.Xfg.XnotIndexed)>>4) << 31) >> 31) != 0 {
 91656  		_translateColumnToCopy(tls, _pParse, _pLevel.XaddrBody, _pLevel.XiTabCur, _16_pTabItem.XregResult, int32(0))
 91657  		goto _40
 91658  	}
 91659  	if (_pLoop.XwsFlags & uint32(576)) != 0 {
 91660  		_16_pIdx = (*XIndex)((*t102)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)
 91661  		goto _48
 91662  	}
 91663  	if (_pLoop.XwsFlags & uint32(8192)) != 0 {
 91664  		_16_pIdx = (*XIndex)(*(*unsafe.Pointer)(unsafe.Pointer(&_pLevel.Xu)))
 91665  	}
 91666  _48:
 91667  	if _16_pIdx == nil || int32(_pWInfo.XeOnePass) != int32(0) && (((*XTable)(_16_pIdx.XpTable).XtabFlags)&uint32(32)) == (0) || _db.XmallocFailed != 0 {
 91668  		goto _52
 91669  	}
 91670  	_16_last = _sqlite3VdbeCurrentAddr(tls, _v)
 91671  	_16_k = _pLevel.XaddrBody
 91672  	_16_pOp = _sqlite3VdbeGetOp(tls, _v, _16_k)
 91673  _53:
 91674  	if _16_k >= _16_last {
 91675  		goto _56
 91676  	}
 91677  	if _16_pOp.Xp1 != _pLevel.XiTabCur {
 91678  		goto _54
 91679  	}
 91680  	if int32(_16_pOp.Xopcode) != int32(99) {
 91681  		goto _58
 91682  	}
 91683  	_22_x = _16_pOp.Xp2
 91684  	func() {
 91685  		if (*XTable)(_16_pIdx.XpTable) != _16_pTab {
 91686  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135385), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(109752)))
 91687  			crt.X__builtin_abort(tls)
 91688  		}
 91689  	}()
 91690  	if (_16_pTab.XtabFlags & uint32(32)) != (0) {
 91691  		_23_pPk = _sqlite3PrimaryKeyIndex(tls, _16_pTab)
 91692  		_22_x = int32(*elem52(_23_pPk.XaiColumn, uintptr(_22_x)))
 91693  		func() {
 91694  			if _22_x < int32(0) {
 91695  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135389), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(109771)))
 91696  				crt.X__builtin_abort(tls)
 91697  			}
 91698  		}()
 91699  	}
 91700  	_22_x = int32(_sqlite3ColumnOfIndex(tls, _16_pIdx, int16(_22_x)))
 91701  	if _22_x >= int32(0) {
 91702  		_16_pOp.Xp2 = _22_x
 91703  		_16_pOp.Xp1 = _pLevel.XiIdxCur
 91704  	}
 91705  	func() {
 91706  		if (_pLoop.XwsFlags&uint32(64)) != (0) && _22_x < int32(0) && _pWInfo.XeOnePass == 0 {
 91707  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135396), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(109776)))
 91708  			crt.X__builtin_abort(tls)
 91709  		}
 91710  	}()
 91711  	goto _72
 91712  _58:
 91713  	if int32(_16_pOp.Xopcode) == int32(125) {
 91714  		_16_pOp.Xp1 = _pLevel.XiIdxCur
 91715  		_16_pOp.Xopcode = uint8(131)
 91716  		goto _72
 91717  	}
 91718  	if int32(_16_pOp.Xopcode) == int32(23) {
 91719  		_16_pOp.Xp1 = _pLevel.XiIdxCur
 91720  	}
 91721  _72:
 91722  _54:
 91723  	*(*uintptr)(unsafe.Pointer(func() **XVdbeOp { _16_k += 1; return &_16_pOp }())) += uintptr(32)
 91724  	goto _53
 91725  _56:
 91726  _52:
 91727  _40:
 91728  	*(*uintptr)(unsafe.Pointer(func() **XWhereLevel { _i += 1; return &_pLevel }())) += uintptr(88)
 91729  	goto _39
 91730  _42:
 91731  	_pParse.XnQueryLoop = uint32(_pWInfo.XsavedNQueryLoop)
 91732  	_whereInfoFree(tls, _db, _pWInfo)
 91733  }
 91734  
 91735  var _sqlite3WhereEndØ00__func__Ø000 [16]int8
 91736  
 91737  func init() {
 91738  	crt.Xstrncpy(nil, &_sqlite3WhereEndØ00__func__Ø000[0], str(109841), 16)
 91739  }
 91740  
 91741  // C comment
 91742  //  /*
 91743  //  ** Free a WhereInfo structure
 91744  //  */
 91745  func _whereInfoFree(tls *crt.TLS, _db *Xsqlite3, _pWInfo *XWhereInfo) {
 91746  	var _1_i int32
 91747  	var _4_p *XWhereLoop
 91748  	var _2_pLevel *XWhereLevel
 91749  	if func() int32 {
 91750  		if _pWInfo != nil {
 91751  			return int32(1)
 91752  		}
 91753  		return func() int32 {
 91754  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132240), unsafe.Pointer(&_whereInfoFreeØ00__func__Ø000), unsafe.Pointer(str(4809)))
 91755  			crt.X__builtin_abort(tls)
 91756  			return int32(0)
 91757  		}()
 91758  	}() == 0 {
 91759  		goto _2
 91760  	}
 91761  	_1_i = int32(0)
 91762  _3:
 91763  	if _1_i >= int32(_pWInfo.XnLevel) {
 91764  		goto _6
 91765  	}
 91766  	_2_pLevel = elem100((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_1_i))
 91767  	if (_2_pLevel.XpWLoop != nil) && ((((*XWhereLoop)(_2_pLevel.XpWLoop).XwsFlags) & uint32(2048)) != 0) {
 91768  		_sqlite3DbFree(tls, _db, (*t115)(unsafe.Pointer(&_2_pLevel.Xu)).XaInLoop)
 91769  	}
 91770  	_1_i += 1
 91771  	goto _3
 91772  _6:
 91773  	_sqlite3WhereClauseClear(tls, &_pWInfo.XsWC)
 91774  _9:
 91775  	if _pWInfo.XpLoops != nil {
 91776  		_4_p = (*XWhereLoop)(_pWInfo.XpLoops)
 91777  		*(**XWhereLoop)(unsafe.Pointer(&_pWInfo.XpLoops)) = (*XWhereLoop)(_4_p.XpNextLoop)
 91778  		_whereLoopDelete(tls, _db, _4_p)
 91779  		goto _9
 91780  	}
 91781  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pWInfo))
 91782  _2:
 91783  }
 91784  
 91785  var _whereInfoFreeØ00__func__Ø000 [14]int8
 91786  
 91787  func init() {
 91788  	crt.Xstrncpy(nil, &_whereInfoFreeØ00__func__Ø000[0], str(109857), 14)
 91789  }
 91790  
 91791  // C comment
 91792  //  /*
 91793  //  ** Deallocate a WhereClause structure.  The WhereClause structure
 91794  //  ** itself is not freed.  This routine is the inverse of
 91795  //  ** sqlite3WhereClauseInit().
 91796  //  */
 91797  func _sqlite3WhereClauseClear(tls *crt.TLS, _pWC *XWhereClause) {
 91798  	var _i int32
 91799  	var _db *Xsqlite3
 91800  	var _a *XWhereTerm
 91801  	_db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.XpWInfo).XpParse).Xdb)
 91802  	*func() **XWhereTerm { _i = _pWC.XnTerm - int32(1); return &_a }() = (*XWhereTerm)(_pWC.Xa)
 91803  _0:
 91804  	if _i < int32(0) {
 91805  		goto _3
 91806  	}
 91807  	if (int32(_a.XwtFlags) & int32(1)) != 0 {
 91808  		_sqlite3ExprDelete(tls, _db, (*XExpr)(_a.XpExpr))
 91809  	}
 91810  	if (int32(_a.XwtFlags) & int32(16)) != 0 {
 91811  		_whereOrInfoDelete(tls, _db, (*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_a.Xu))))
 91812  		goto _7
 91813  	}
 91814  	if (int32(_a.XwtFlags) & int32(32)) != 0 {
 91815  		_whereAndInfoDelete(tls, _db, (*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_a.Xu))))
 91816  	}
 91817  _7:
 91818  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_a }())) += uintptr(64)
 91819  	goto _0
 91820  _3:
 91821  	if (*XWhereTerm)(_pWC.Xa) != (*XWhereTerm)(unsafe.Pointer(&_pWC.XaStatic)) {
 91822  		_sqlite3DbFree(tls, _db, _pWC.Xa)
 91823  	}
 91824  }
 91825  
 91826  // C comment
 91827  //  /*
 91828  //  ** Deallocate all memory associated with a WhereOrInfo object.
 91829  //  */
 91830  func _whereOrInfoDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereOrInfo) {
 91831  	_sqlite3WhereClauseClear(tls, &_p.Xwc)
 91832  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p))
 91833  }
 91834  
 91835  // C comment
 91836  //  /*
 91837  //  ** Deallocate all memory associated with a WhereAndInfo object.
 91838  //  */
 91839  func _whereAndInfoDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereAndInfo) {
 91840  	_sqlite3WhereClauseClear(tls, &_p.Xwc)
 91841  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p))
 91842  }
 91843  
 91844  var _sqlite3WhereCodeOneLoopStartØ00aStepØ003 [2]uint8
 91845  
 91846  func init() {
 91847  	_sqlite3WhereCodeOneLoopStartØ00aStepØ003 = [2]uint8{7, 6}
 91848  }
 91849  
 91850  var _sqlite3WhereCodeOneLoopStartØ00aStartØ004 [2]uint8
 91851  
 91852  func init() {
 91853  	_sqlite3WhereCodeOneLoopStartØ00aStartØ004 = [2]uint8{37, 33}
 91854  }
 91855  
 91856  // C comment
 91857  //  /*
 91858  //  ** Return the estimated number of output rows from a WHERE clause
 91859  //  */
 91860  func _sqlite3WhereOutputRowCount(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int16) {
 91861  	return _pWInfo.XnRowOut
 91862  }
 91863  
 91864  // C comment
 91865  //  /*
 91866  //  ** Return one of the WHERE_DISTINCT_xxxxx values to indicate how this
 91867  //  ** WHERE clause returns outputs for DISTINCT processing.
 91868  //  */
 91869  func _sqlite3WhereIsDistinct(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 91870  	return int32(_pWInfo.XeDistinct)
 91871  }
 91872  
 91873  // C comment
 91874  //  /*
 91875  //  ** Return TRUE if the WHERE clause returns rows in ORDER BY order.
 91876  //  ** Return FALSE if the output needs to be sorted.
 91877  //  */
 91878  func _sqlite3WhereIsOrdered(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 91879  	return int32(_pWInfo.XnOBSat)
 91880  }
 91881  
 91882  // C comment
 91883  //  /*
 91884  //  ** Return TRUE if the innermost loop of the WHERE clause implementation
 91885  //  ** returns rows in ORDER BY order for complete run of the inner loop.
 91886  //  **
 91887  //  ** Across multiple iterations of outer loops, the output rows need not be
 91888  //  ** sorted.  As long as rows are sorted for just the innermost loop, this
 91889  //  ** routine can return TRUE.
 91890  //  */
 91891  func _sqlite3WhereOrderedInnerLoop(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 91892  	return int32(_pWInfo.XbOrderedInnerLoop)
 91893  }
 91894  
 91895  // C comment
 91896  //  /*
 91897  //  ** Return the VDBE address or label to jump to in order to continue
 91898  //  ** immediately with the next row of a WHERE clause.
 91899  //  */
 91900  func _sqlite3WhereContinueLabel(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 91901  	func() {
 91902  		if _pWInfo.XiContinue == int32(0) {
 91903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130460), unsafe.Pointer(&_sqlite3WhereContinueLabelØ00__func__Ø000), unsafe.Pointer(str(109871)))
 91904  			crt.X__builtin_abort(tls)
 91905  		}
 91906  	}()
 91907  	return _pWInfo.XiContinue
 91908  }
 91909  
 91910  var _sqlite3WhereContinueLabelØ00__func__Ø000 [26]int8
 91911  
 91912  func init() {
 91913  	crt.Xstrncpy(nil, &_sqlite3WhereContinueLabelØ00__func__Ø000[0], str(109892), 26)
 91914  }
 91915  
 91916  // C comment
 91917  //  /*
 91918  //  ** Return the VDBE address or label to jump to in order to break
 91919  //  ** out of a WHERE loop.
 91920  //  */
 91921  func _sqlite3WhereBreakLabel(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 91922  	return _pWInfo.XiBreak
 91923  }
 91924  
 91925  // C comment
 91926  //  /*
 91927  //  ** Call sqlite3ExprAnalyzeAggregates() for every expression in an
 91928  //  ** expression list.  Return the number of errors.
 91929  //  **
 91930  //  ** If an error is found, the analysis is cut short.
 91931  //  */
 91932  func _sqlite3ExprAnalyzeAggList(tls *crt.TLS, _pNC *XNameContext, _pList *XExprList) {
 91933  	var _i int32
 91934  	var _pItem *TExprList_item
 91935  	if _pList == nil {
 91936  		goto _0
 91937  	}
 91938  	*func() *int32 { _pItem = (*TExprList_item)(unsafe.Pointer(&_pList.Xa)); return &_i }() = int32(0)
 91939  _1:
 91940  	if _i >= _pList.XnExpr {
 91941  		goto _4
 91942  	}
 91943  	_sqlite3ExprAnalyzeAggregates(tls, _pNC, (*XExpr)(_pItem.XpExpr))
 91944  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(32)
 91945  	goto _1
 91946  _4:
 91947  _0:
 91948  }
 91949  
 91950  // C comment
 91951  //  /*
 91952  //  ** Analyze the pExpr expression looking for aggregate functions and
 91953  //  ** for variables that need to be added to AggInfo object that pNC->pAggInfo
 91954  //  ** points to.  Additional entries are made on the AggInfo object as
 91955  //  ** necessary.
 91956  //  **
 91957  //  ** This routine should only be called after the expression has been
 91958  //  ** analyzed by sqlite3ResolveExprNames().
 91959  //  */
 91960  func _sqlite3ExprAnalyzeAggregates(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr) {
 91961  	var _w XWalker
 91962  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint64(48))
 91963  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _analyzeAggregate
 91964  	*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _analyzeAggregatesInSelect
 91965  	*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = _pNC
 91966  	func() {
 91967  		if (*XSrcList)(_pNC.XpSrcList) == nil {
 91968  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95995), unsafe.Pointer(&_sqlite3ExprAnalyzeAggregatesØ00__func__Ø000), unsafe.Pointer(str(94487)))
 91969  			crt.X__builtin_abort(tls)
 91970  		}
 91971  	}()
 91972  	_sqlite3WalkExpr(tls, &_w, _pExpr)
 91973  }
 91974  
 91975  // C comment
 91976  //  /*
 91977  //  ** This is the xExprCallback for a tree walker.  It is used to
 91978  //  ** implement sqlite3ExprAnalyzeAggregates().  See sqlite3ExprAnalyzeAggregates
 91979  //  ** for additional information.
 91980  //  */
 91981  func _analyzeAggregate(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 91982  	var _i, _5_k, _9_j, _9_n int32
 91983  	var _17_enc uint8
 91984  	var _pSrcList *XSrcList
 91985  	var _3_pItem *TSrcList_item
 91986  	var _9_pGB *XExprList
 91987  	var _9_pTerm *TExprList_item
 91988  	var _10_pE *XExpr
 91989  	var _pParse *XParse
 91990  	var _pNC *XNameContext
 91991  	var _pAggInfo *XAggInfo
 91992  	var _4_pCol *TAggInfo_col
 91993  	var _14_pItem *TAggInfo_func
 91994  	_pNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 91995  	_pParse = (*XParse)(_pNC.XpParse)
 91996  	_pSrcList = (*XSrcList)(_pNC.XpSrcList)
 91997  	_pAggInfo = (*XAggInfo)(_pNC.XpAggInfo)
 91998  	switch int32(_pExpr.Xop) {
 91999  	case int32(152):
 92000  		goto _1
 92001  	case int32(153):
 92002  		goto _3
 92003  	case int32(154):
 92004  		goto _1
 92005  	default:
 92006  		goto _4
 92007  	}
 92008  
 92009  _1:
 92010  	if func() int32 {
 92011  		if _pSrcList != nil {
 92012  			return int32(1)
 92013  		}
 92014  		return func() int32 {
 92015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95863), unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000), unsafe.Pointer(str(4809)))
 92016  			crt.X__builtin_abort(tls)
 92017  			return int32(0)
 92018  		}()
 92019  	}() == 0 {
 92020  		goto _7
 92021  	}
 92022  	_3_pItem = (*TSrcList_item)(unsafe.Pointer(&_pSrcList.Xa))
 92023  	_i = int32(0)
 92024  _8:
 92025  	if _i >= _pSrcList.XnSrc {
 92026  		goto _11
 92027  	}
 92028  	func() {
 92029  		if (_pExpr.Xflags & uint32(24576)) != (0) {
 92030  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95867), unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000), unsafe.Pointer(str(96033)))
 92031  			crt.X__builtin_abort(tls)
 92032  		}
 92033  	}()
 92034  	if _pExpr.XiTable != _3_pItem.XiCursor {
 92035  		goto _14
 92036  	}
 92037  	_4_pCol = (*TAggInfo_col)(_pAggInfo.XaCol)
 92038  	_5_k = int32(0)
 92039  _15:
 92040  	if _5_k >= _pAggInfo.XnColumn {
 92041  		goto _18
 92042  	}
 92043  	if (_4_pCol.XiTable == _pExpr.XiTable) && (_4_pCol.XiColumn == int32(_pExpr.XiColumn)) {
 92044  		goto _18
 92045  	}
 92046  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_col { _5_k += 1; return &_4_pCol }())) += uintptr(32)
 92047  	goto _15
 92048  _18:
 92049  	if _5_k < _pAggInfo.XnColumn || store2(&_5_k, _addAggInfoColumn(tls, (*Xsqlite3)(_pParse.Xdb), _pAggInfo)) < int32(0) {
 92050  		goto _22
 92051  	}
 92052  	_4_pCol = elem68((*TAggInfo_col)(_pAggInfo.XaCol), uintptr(_5_k))
 92053  	*(**XTable)(unsafe.Pointer(&_4_pCol.XpTab)) = (*XTable)(_pExpr.XpTab)
 92054  	_4_pCol.XiTable = _pExpr.XiTable
 92055  	_4_pCol.XiColumn = int32(_pExpr.XiColumn)
 92056  	_4_pCol.XiMem = preInc2(&_pParse.XnMem, 1)
 92057  	_4_pCol.XiSorterColumn = int32(-1)
 92058  	*(**XExpr)(unsafe.Pointer(&_4_pCol.XpExpr)) = _pExpr
 92059  	if _pAggInfo.XpGroupBy == nil {
 92060  		goto _23
 92061  	}
 92062  	_9_pGB = (*XExprList)(_pAggInfo.XpGroupBy)
 92063  	_9_pTerm = (*TExprList_item)(unsafe.Pointer(&_9_pGB.Xa))
 92064  	_9_n = _9_pGB.XnExpr
 92065  	_9_j = int32(0)
 92066  _24:
 92067  	if _9_j >= _9_n {
 92068  		goto _27
 92069  	}
 92070  	_10_pE = (*XExpr)(_9_pTerm.XpExpr)
 92071  	if ((int32(_10_pE.Xop) == int32(152)) && (_10_pE.XiTable == _pExpr.XiTable)) && (int32(_10_pE.XiColumn) == int32(_pExpr.XiColumn)) {
 92072  		_4_pCol.XiSorterColumn = _9_j
 92073  		goto _27
 92074  	}
 92075  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _9_j += 1; return &_9_pTerm }())) += uintptr(32)
 92076  	goto _24
 92077  _27:
 92078  _23:
 92079  	if _4_pCol.XiSorterColumn < int32(0) {
 92080  		_4_pCol.XiSorterColumn = postInc2(&_pAggInfo.XnSortingColumn, 1)
 92081  	}
 92082  _22:
 92083  	_pExpr.Xflags |= uint32(131072)
 92084  	*(**XAggInfo)(unsafe.Pointer(&_pExpr.XpAggInfo)) = _pAggInfo
 92085  	_pExpr.Xop = uint8(154)
 92086  	_pExpr.XiAgg = int16(_5_k)
 92087  	goto _11
 92088  _14:
 92089  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_3_pItem }())) += uintptr(112)
 92090  	goto _8
 92091  _11:
 92092  _7:
 92093  	return int32(1)
 92094  
 92095  _3:
 92096  	if (int32(_pNC.XncFlags)&int32(8)) != int32(0) || _pWalker.XwalkerDepth != int32(_pExpr.Xop2) {
 92097  		goto _33
 92098  	}
 92099  	_14_pItem = (*TAggInfo_func)(_pAggInfo.XaFunc)
 92100  	_i = int32(0)
 92101  _34:
 92102  	if _i >= _pAggInfo.XnFunc {
 92103  		goto _37
 92104  	}
 92105  	if _sqlite3ExprCompare(tls, (*XExpr)(_14_pItem.XpExpr), _pExpr, int32(-1)) == int32(0) {
 92106  		goto _37
 92107  	}
 92108  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_14_pItem }())) += uintptr(24)
 92109  	goto _34
 92110  _37:
 92111  	if _i < _pAggInfo.XnFunc {
 92112  		goto _39
 92113  	}
 92114  	_17_enc = (*Xsqlite3)(_pParse.Xdb).Xenc
 92115  	_i = _addAggInfoFunc(tls, (*Xsqlite3)(_pParse.Xdb), _pAggInfo)
 92116  	if _i < int32(0) {
 92117  		goto _40
 92118  	}
 92119  	func() {
 92120  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 92121  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95945), unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000), unsafe.Pointer(str(42733)))
 92122  			crt.X__builtin_abort(tls)
 92123  		}
 92124  	}()
 92125  	_14_pItem = elem69((*TAggInfo_func)(_pAggInfo.XaFunc), uintptr(_i))
 92126  	*(**XExpr)(unsafe.Pointer(&_14_pItem.XpExpr)) = _pExpr
 92127  	_14_pItem.XiMem = preInc2(&_pParse.XnMem, 1)
 92128  	func() {
 92129  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 92130  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95949), unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000), unsafe.Pointer(str(42479)))
 92131  			crt.X__builtin_abort(tls)
 92132  		}
 92133  	}()
 92134  	*(**XFuncDef)(unsafe.Pointer(&_14_pItem.XpFunc)) = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.Xdb), *(**int8)(unsafe.Pointer(&_pExpr.Xu)), func() int32 {
 92135  		if (*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) != nil {
 92136  			return ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XnExpr)
 92137  		}
 92138  		return int32(0)
 92139  	}(), _17_enc, 0)
 92140  	if (_pExpr.Xflags & uint32(16)) != 0 {
 92141  		_14_pItem.XiDistinct = postInc2(&_pParse.XnTab, 1)
 92142  		goto _48
 92143  	}
 92144  	_14_pItem.XiDistinct = int32(-1)
 92145  _48:
 92146  _40:
 92147  _39:
 92148  	func() {
 92149  		if (_pExpr.Xflags & uint32(24576)) != (0) {
 92150  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95962), unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000), unsafe.Pointer(str(96033)))
 92151  			crt.X__builtin_abort(tls)
 92152  		}
 92153  	}()
 92154  	_pExpr.Xflags |= uint32(131072)
 92155  	_pExpr.XiAgg = int16(_i)
 92156  	*(**XAggInfo)(unsafe.Pointer(&_pExpr.XpAggInfo)) = _pAggInfo
 92157  	return int32(1)
 92158  
 92159  _33:
 92160  	return int32(0)
 92161  
 92162  _4:
 92163  	return int32(0)
 92164  }
 92165  
 92166  var _analyzeAggregateØ00__func__Ø000 [17]int8
 92167  
 92168  func init() {
 92169  	crt.Xstrncpy(nil, &_analyzeAggregateØ00__func__Ø000[0], str(109918), 17)
 92170  }
 92171  
 92172  // C comment
 92173  //  /*
 92174  //  ** Add a new element to the pAggInfo->aCol[] array.  Return the index of
 92175  //  ** the new element.  Return a negative number if malloc fails.
 92176  //  */
 92177  func _addAggInfoColumn(tls *crt.TLS, _db *Xsqlite3, _pInfo *XAggInfo) (r0 int32) {
 92178  	var _i int32
 92179  	*(**TAggInfo_col)(unsafe.Pointer(&_pInfo.XaCol)) = (*TAggInfo_col)(_sqlite3ArrayAllocate(tls, _db, _pInfo.XaCol, int32(32), &_pInfo.XnColumn, &_i))
 92180  	return _i
 92181  }
 92182  
 92183  // C comment
 92184  //  /*
 92185  //  ** pArray is a pointer to an array of objects. Each object in the
 92186  //  ** array is szEntry bytes in size. This routine uses sqlite3DbRealloc()
 92187  //  ** to extend the array so that there is space for a new object at the end.
 92188  //  **
 92189  //  ** When this function is called, *pnEntry contains the current size of
 92190  //  ** the array (in entries - so the allocation is ((*pnEntry) * szEntry) bytes
 92191  //  ** in total).
 92192  //  **
 92193  //  ** If the realloc() is successful (i.e. if no OOM condition occurs), the
 92194  //  ** space allocated for the new object is zeroed, *pnEntry updated to
 92195  //  ** reflect the new size of the array and a pointer to the new allocation
 92196  //  ** returned. *pIdx is set to the index of the new array entry in this case.
 92197  //  **
 92198  //  ** Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains
 92199  //  ** unchanged and a copy of pArray returned.
 92200  //  */
 92201  func _sqlite3ArrayAllocate(tls *crt.TLS, _db *Xsqlite3, _pArray unsafe.Pointer, _szEntry int32, _pnEntry *int32, _pIdx *int32) (r0 unsafe.Pointer) {
 92202  	var _n, _1_sz int32
 92203  	var _z *int8
 92204  	var _1_pNew unsafe.Pointer
 92205  	_n = *_pnEntry
 92206  	if (_n & (_n - int32(1))) != int32(0) {
 92207  		goto _0
 92208  	}
 92209  	_1_sz = func() int32 {
 92210  		if _n == int32(0) {
 92211  			return int32(1)
 92212  		}
 92213  		return (int32(2) * _n)
 92214  	}()
 92215  	_1_pNew = _sqlite3DbRealloc(tls, _db, _pArray, uint64(_1_sz*_szEntry))
 92216  	if _1_pNew == nil {
 92217  		*_pIdx = int32(-1)
 92218  		return _pArray
 92219  	}
 92220  	_pArray = _1_pNew
 92221  _0:
 92222  	_z = (*int8)(_pArray)
 92223  	crt.Xmemset(tls, unsafe.Pointer(elem1(_z, uintptr(_n*_szEntry))), int32(0), uint64(_szEntry))
 92224  	*_pIdx = _n
 92225  	*_pnEntry += 1
 92226  	return _pArray
 92227  }
 92228  
 92229  // C comment
 92230  //  /*
 92231  //  ** Add a new element to the pAggInfo->aFunc[] array.  Return the index of
 92232  //  ** the new element.  Return a negative number if malloc fails.
 92233  //  */
 92234  func _addAggInfoFunc(tls *crt.TLS, _db *Xsqlite3, _pInfo *XAggInfo) (r0 int32) {
 92235  	var _i int32
 92236  	*(**TAggInfo_func)(unsafe.Pointer(&_pInfo.XaFunc)) = (*TAggInfo_func)(_sqlite3ArrayAllocate(tls, _db, _pInfo.XaFunc, int32(24), &_pInfo.XnFunc, &_i))
 92237  	return _i
 92238  }
 92239  
 92240  func _analyzeAggregatesInSelect(tls *crt.TLS, _pWalker *XWalker, _pSelect *XSelect) (r0 int32) {
 92241  	return int32(0)
 92242  }
 92243  
 92244  var _sqlite3ExprAnalyzeAggregatesØ00__func__Ø000 [29]int8
 92245  
 92246  func init() {
 92247  	crt.Xstrncpy(nil, &_sqlite3ExprAnalyzeAggregatesØ00__func__Ø000[0], str(109935), 29)
 92248  }
 92249  
 92250  // C comment
 92251  //  /*
 92252  //  ** Transfer eligible terms from the HAVING clause of a query, which is
 92253  //  ** processed after grouping, to the WHERE clause, which is processed before
 92254  //  ** grouping. For example, the query:
 92255  //  **
 92256  //  **   SELECT * FROM <tables> WHERE a=? GROUP BY b HAVING b=? AND c=?
 92257  //  **
 92258  //  ** can be rewritten as:
 92259  //  **
 92260  //  **   SELECT * FROM <tables> WHERE a=? AND b=? GROUP BY b HAVING c=?
 92261  //  **
 92262  //  ** A term of the HAVING expression is eligible for transfer if it consists
 92263  //  ** entirely of constants and expressions that are also GROUP BY terms that
 92264  //  ** use the "BINARY" collation sequence.
 92265  //  */
 92266  func _havingToWhere(tls *crt.TLS, _pParse *XParse, _pGroupBy *XExprList, _pHaving *XExpr, _ppWhere **XExpr) {
 92267  	var _sWalker XWalker
 92268  	var _sCtx THavingToWhereCtx
 92269  	*(***XExpr)(unsafe.Pointer(&_sCtx.XppWhere)) = _ppWhere
 92270  	*(**XExprList)(unsafe.Pointer(&_sCtx.XpGroupBy)) = _pGroupBy
 92271  	crt.Xmemset(tls, unsafe.Pointer(&_sWalker), int32(0), uint64(48))
 92272  	*(**XParse)(unsafe.Pointer(&_sWalker.XpParse)) = _pParse
 92273  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_sWalker.XxExprCallback)) = _havingToWhereExprCb
 92274  	*(**THavingToWhereCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sWalker.Xu)))) = &_sCtx
 92275  	_sqlite3WalkExpr(tls, &_sWalker, _pHaving)
 92276  }
 92277  
 92278  // C comment
 92279  //  /*
 92280  //  ** sqlite3WalkExpr() callback used by havingToWhere().
 92281  //  **
 92282  //  ** If the node passed to the callback is a TK_AND node, return
 92283  //  ** WRC_Continue to tell sqlite3WalkExpr() to iterate through child nodes.
 92284  //  **
 92285  //  ** Otherwise, return WRC_Prune. In this case, also check if the
 92286  //  ** sub-expression matches the criteria for being moved to the WHERE
 92287  //  ** clause. If so, add it to the WHERE clause and replace the sub-expression
 92288  //  ** within the HAVING expression with a constant "1".
 92289  //  */
 92290  func _havingToWhereExprCb(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 92291  	var _2_db *Xsqlite3
 92292  	var _2_pNew, _3_pWhere *XExpr
 92293  	var _4_t XExpr
 92294  	var _1_p *THavingToWhereCtx
 92295  	if int32(_pExpr.Xop) == int32(71) {
 92296  		goto _0
 92297  	}
 92298  	_1_p = (*THavingToWhereCtx)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 92299  	if _sqlite3ExprIsConstantOrGroupBy(tls, (*XParse)(_pWalker.XpParse), _pExpr, (*XExprList)(_1_p.XpGroupBy)) == 0 {
 92300  		goto _1
 92301  	}
 92302  	_2_db = (*Xsqlite3)((*XParse)(_pWalker.XpParse).Xdb)
 92303  	_2_pNew = _sqlite3ExprAlloc(tls, _2_db, int32(134), elem58((*XToken)(unsafe.Pointer(&_sqlite3IntTokens)), uintptr(1)), int32(0))
 92304  	if _2_pNew != nil {
 92305  		_3_pWhere = *(**XExpr)(unsafe.Pointer(_1_p.XppWhere))
 92306  		_4_t = *_2_pNew
 92307  		*_2_pNew = *_pExpr
 92308  		*_pExpr = _4_t
 92309  		_2_pNew = _sqlite3ExprAnd(tls, _2_db, _3_pWhere, _2_pNew)
 92310  		*(**XExpr)(unsafe.Pointer(_1_p.XppWhere)) = _2_pNew
 92311  	}
 92312  _1:
 92313  	return int32(1)
 92314  
 92315  _0:
 92316  	return int32(0)
 92317  }
 92318  
 92319  // C comment
 92320  //  /*
 92321  //  ** Walk the expression tree passed as the first argument. Return non-zero
 92322  //  ** if the expression consists entirely of constants or copies of terms
 92323  //  ** in pGroupBy that sort with the BINARY collation sequence.
 92324  //  **
 92325  //  ** This routine is used to determine if a term of the HAVING clause can
 92326  //  ** be promoted into the WHERE clause.  In order for such a promotion to work,
 92327  //  ** the value of the HAVING clause term must be the same for all members of
 92328  //  ** a "group".  The requirement that the GROUP BY term must be BINARY
 92329  //  ** assumes that no other collating sequence will have a finer-grained
 92330  //  ** grouping than binary.  In other words (A=B COLLATE binary) implies
 92331  //  ** A=B in every other collating sequence.  The requirement that the
 92332  //  ** GROUP BY be BINARY is stricter than necessary.  It would also work
 92333  //  ** to promote HAVING clauses that use the same alternative collating
 92334  //  ** sequence as the GROUP BY term, but that is much harder to check,
 92335  //  ** alternative collating sequences are uncommon, and this is only an
 92336  //  ** optimization, so we take the easy way out and simply require the
 92337  //  ** GROUP BY to use the BINARY collating sequence.
 92338  //  */
 92339  func _sqlite3ExprIsConstantOrGroupBy(tls *crt.TLS, _pParse *XParse, _p *XExpr, _pGroupBy *XExprList) (r0 int32) {
 92340  	var _w XWalker
 92341  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint64(48))
 92342  	_w.XeCode = uint8(1)
 92343  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _exprNodeIsConstantOrGroupBy
 92344  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = _pGroupBy
 92345  	*(**XParse)(unsafe.Pointer(&_w.XpParse)) = _pParse
 92346  	_sqlite3WalkExpr(tls, &_w, _p)
 92347  	return int32(_w.XeCode)
 92348  }
 92349  
 92350  // C comment
 92351  //  /*
 92352  //  ** sqlite3WalkExpr() callback used by sqlite3ExprIsConstantOrGroupBy().
 92353  //  */
 92354  func _exprNodeIsConstantOrGroupBy(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 92355  	var _i int32
 92356  	var _pGroupBy *XExprList
 92357  	var _1_p *XExpr
 92358  	var _2_pColl *XCollSeq
 92359  	_pGroupBy = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 92360  	_i = int32(0)
 92361  _0:
 92362  	if _i >= _pGroupBy.XnExpr {
 92363  		goto _3
 92364  	}
 92365  	_1_p = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pGroupBy.Xa)), uintptr(_i)).XpExpr)
 92366  	if _sqlite3ExprCompare(tls, _pExpr, _1_p, int32(-1)) >= int32(2) {
 92367  		goto _4
 92368  	}
 92369  	_2_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWalker.XpParse), _1_p)
 92370  	if (_2_pColl == nil) || (Xsqlite3_stricmp(tls, str(37836), _2_pColl.XzName) == int32(0)) {
 92371  		return int32(1)
 92372  	}
 92373  _4:
 92374  	_i += 1
 92375  	goto _0
 92376  _3:
 92377  	if (_pExpr.Xflags & uint32(2048)) != (0) {
 92378  		_pWalker.XeCode = 0
 92379  		return int32(2)
 92380  	}
 92381  	return _exprNodeIsConstant(tls, _pWalker, _pExpr)
 92382  }
 92383  
 92384  // C comment
 92385  //  /*
 92386  //  ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
 92387  //  ** is a no-op. Otherwise, it adds a single row of output to the EQP result,
 92388  //  ** where the caption is of the form:
 92389  //  **
 92390  //  **   "USE TEMP B-TREE FOR xxx"
 92391  //  **
 92392  //  ** where xxx is one of "DISTINCT", "ORDER BY" or "GROUP BY". Exactly which
 92393  //  ** is determined by the zUsage argument.
 92394  //  */
 92395  func _explainTempTable(tls *crt.TLS, _pParse *XParse, _zUsage *int8) {
 92396  	var _1_zMsg *int8
 92397  	var _1_v *TVdbe
 92398  	if int32(_pParse.Xexplain) == int32(2) {
 92399  		_1_v = (*TVdbe)(_pParse.XpVdbe)
 92400  		_1_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(109964), unsafe.Pointer(_zUsage))
 92401  		_sqlite3VdbeAddOp4(tls, _1_v, int32(165), _pParse.XiSelectId, int32(0), int32(0), _1_zMsg, int32(-1))
 92402  	}
 92403  }
 92404  
 92405  // C comment
 92406  //  /*
 92407  //  ** If the WHERE_GROUPBY flag is set in the mask passed to sqlite3WhereBegin(),
 92408  //  ** the planner assumes that the specified pOrderBy list is actually a GROUP
 92409  //  ** BY clause - and so any order that groups rows as required satisfies the
 92410  //  ** request.
 92411  //  **
 92412  //  ** Normally, in this case it is not possible for the caller to determine
 92413  //  ** whether or not the rows are really being delivered in sorted order, or
 92414  //  ** just in some other order that provides the required grouping. However,
 92415  //  ** if the WHERE_SORTBYGROUP flag is also passed to sqlite3WhereBegin(), then
 92416  //  ** this function may be called on the returned WhereInfo object. It returns
 92417  //  ** true if the rows really will be sorted in the specified order, or false
 92418  //  ** otherwise.
 92419  //  **
 92420  //  ** For example, assuming:
 92421  //  **
 92422  //  **   CREATE INDEX i1 ON t1(x, Y);
 92423  //  **
 92424  //  ** then
 92425  //  **
 92426  //  **   SELECT * FROM t1 GROUP BY x,y ORDER BY x,y;   -- IsSorted()==1
 92427  //  **   SELECT * FROM t1 GROUP BY y,x ORDER BY y,x;   -- IsSorted()==0
 92428  //  */
 92429  func _sqlite3WhereIsSorted(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 92430  	func() {
 92431  		if (int32(_pWInfo.XwctrlFlags) & int32(64)) == 0 {
 92432  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134159), unsafe.Pointer(&_sqlite3WhereIsSortedØ00__func__Ø000), unsafe.Pointer(str(109987)))
 92433  			crt.X__builtin_abort(tls)
 92434  		}
 92435  	}()
 92436  	func() {
 92437  		if (int32(_pWInfo.XwctrlFlags) & int32(512)) == 0 {
 92438  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134160), unsafe.Pointer(&_sqlite3WhereIsSortedØ00__func__Ø000), unsafe.Pointer(str(110022)))
 92439  			crt.X__builtin_abort(tls)
 92440  		}
 92441  	}()
 92442  	return int32(_pWInfo.Xsorted)
 92443  }
 92444  
 92445  var _sqlite3WhereIsSortedØ00__func__Ø000 [21]int8
 92446  
 92447  func init() {
 92448  	crt.Xstrncpy(nil, &_sqlite3WhereIsSortedØ00__func__Ø000[0], str(110061), 21)
 92449  }
 92450  
 92451  // C comment
 92452  //  /*
 92453  //  ** Update the accumulator memory cells for an aggregate based on
 92454  //  ** the current cursor position.
 92455  //  */
 92456  func _updateAccumulator(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) {
 92457  	var _i, _regHit, _addrHitTest, _1_nArg, _1_addrNext, _1_regAgg, _5_j int32
 92458  	var _v *TVdbe
 92459  	var _1_pList *XExprList
 92460  	var _5_pItem *TExprList_item
 92461  	var _5_pColl *XCollSeq
 92462  	var _pC *TAggInfo_col
 92463  	var _pF *TAggInfo_func
 92464  	_v = (*TVdbe)(_pParse.XpVdbe)
 92465  	_regHit = int32(0)
 92466  	_addrHitTest = int32(0)
 92467  	_pAggInfo.XdirectMode = uint8(1)
 92468  	*func() **TAggInfo_func { _i = int32(0); return &_pF }() = (*TAggInfo_func)(_pAggInfo.XaFunc)
 92469  _0:
 92470  	if _i >= _pAggInfo.XnFunc {
 92471  		goto _3
 92472  	}
 92473  	_1_addrNext = int32(0)
 92474  	_1_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(_pF.XpExpr).Xx))))
 92475  	func() {
 92476  		if (((*XExpr)(_pF.XpExpr).Xflags) & uint32(2048)) != (0) {
 92477  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121330), unsafe.Pointer(&_updateAccumulatorØ00__func__Ø000), unsafe.Pointer(str(110082)))
 92478  			crt.X__builtin_abort(tls)
 92479  		}
 92480  	}()
 92481  	if _1_pList != nil {
 92482  		_1_nArg = _1_pList.XnExpr
 92483  		_1_regAgg = _sqlite3GetTempRange(tls, _pParse, _1_nArg)
 92484  		_sqlite3ExprCodeExprList(tls, _pParse, _1_pList, _1_regAgg, int32(0), uint8(1))
 92485  		goto _7
 92486  	}
 92487  	_1_nArg = int32(0)
 92488  	_1_regAgg = int32(0)
 92489  _7:
 92490  	if _pF.XiDistinct >= int32(0) {
 92491  		_1_addrNext = _sqlite3VdbeMakeLabel(tls, _v)
 92492  		_codeDistinct(tls, _pParse, _pF.XiDistinct, _1_addrNext, int32(1), _1_regAgg)
 92493  	}
 92494  	if (int32((*XFuncDef)(_pF.XpFunc).XfuncFlags) & int32(32)) == 0 {
 92495  		goto _9
 92496  	}
 92497  	_5_pColl = nil
 92498  	func() {
 92499  		if _1_pList == nil {
 92500  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121349), unsafe.Pointer(&_updateAccumulatorØ00__func__Ø000), unsafe.Pointer(str(88609)))
 92501  			crt.X__builtin_abort(tls)
 92502  		}
 92503  	}()
 92504  	*func() **TExprList_item { _5_j = int32(0); return &_5_pItem }() = (*TExprList_item)(unsafe.Pointer(&_1_pList.Xa))
 92505  _12:
 92506  	if _5_pColl != nil || _5_j >= _1_nArg {
 92507  		goto _16
 92508  	}
 92509  	_5_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_5_pItem.XpExpr))
 92510  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _5_j += 1; return &_5_pItem }())) += uintptr(32)
 92511  	goto _12
 92512  _16:
 92513  	if _5_pColl == nil {
 92514  		_5_pColl = (*XCollSeq)((*Xsqlite3)(_pParse.Xdb).XpDfltColl)
 92515  	}
 92516  	if (_regHit == int32(0)) && _pAggInfo.XnAccumulator != 0 {
 92517  		_regHit = preInc2(&_pParse.XnMem, 1)
 92518  	}
 92519  	_sqlite3VdbeAddOp4(tls, _v, int32(68), _regHit, int32(0), int32(0), (*int8)(unsafe.Pointer(_5_pColl)), int32(-3))
 92520  _9:
 92521  	_sqlite3VdbeAddOp3(tls, _v, int32(150), int32(0), _1_regAgg, _pF.XiMem)
 92522  	_sqlite3VdbeAppendP4(tls, _v, _pF.XpFunc, int32(-4))
 92523  	_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_1_nArg)))
 92524  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _1_regAgg, _1_nArg)
 92525  	_sqlite3ReleaseTempRange(tls, _pParse, _1_regAgg, _1_nArg)
 92526  	if _1_addrNext != 0 {
 92527  		_sqlite3VdbeResolveLabel(tls, _v, _1_addrNext)
 92528  		_sqlite3ExprCacheClear(tls, _pParse)
 92529  	}
 92530  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_pF }())) += uintptr(24)
 92531  	goto _0
 92532  _3:
 92533  	if _regHit != 0 {
 92534  		_addrHitTest = _sqlite3VdbeAddOp1(tls, _v, int32(21), _regHit)
 92535  	}
 92536  	_sqlite3ExprCacheClear(tls, _pParse)
 92537  	*func() **TAggInfo_col { _i = int32(0); return &_pC }() = (*TAggInfo_col)(_pAggInfo.XaCol)
 92538  _22:
 92539  	if _i >= _pAggInfo.XnAccumulator {
 92540  		goto _25
 92541  	}
 92542  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(_pC.XpExpr), _pC.XiMem)
 92543  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_col { _i += 1; return &_pC }())) += uintptr(32)
 92544  	goto _22
 92545  _25:
 92546  	_pAggInfo.XdirectMode = 0
 92547  	_sqlite3ExprCacheClear(tls, _pParse)
 92548  	if _addrHitTest != 0 {
 92549  		_sqlite3VdbeJumpHere(tls, _v, _addrHitTest)
 92550  	}
 92551  }
 92552  
 92553  var _updateAccumulatorØ00__func__Ø000 [18]int8
 92554  
 92555  func init() {
 92556  	crt.Xstrncpy(nil, &_updateAccumulatorØ00__func__Ø000[0], str(110124), 18)
 92557  }
 92558  
 92559  // C comment
 92560  //  /*
 92561  //  ** Invoke the OP_AggFinalize opcode for every aggregate function
 92562  //  ** in the AggInfo structure.
 92563  //  */
 92564  func _finalizeAggFunctions(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) {
 92565  	var _i int32
 92566  	var _v *TVdbe
 92567  	var _1_pList *XExprList
 92568  	var _pF *TAggInfo_func
 92569  	_v = (*TVdbe)(_pParse.XpVdbe)
 92570  	*func() **TAggInfo_func { _i = int32(0); return &_pF }() = (*TAggInfo_func)(_pAggInfo.XaFunc)
 92571  _0:
 92572  	if _i >= _pAggInfo.XnFunc {
 92573  		goto _3
 92574  	}
 92575  	_1_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(_pF.XpExpr).Xx))))
 92576  	func() {
 92577  		if (((*XExpr)(_pF.XpExpr).Xflags) & uint32(2048)) != (0) {
 92578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121306), unsafe.Pointer(&_finalizeAggFunctionsØ00__func__Ø000), unsafe.Pointer(str(110082)))
 92579  			crt.X__builtin_abort(tls)
 92580  		}
 92581  	}()
 92582  	_sqlite3VdbeAddOp2(tls, _v, int32(152), _pF.XiMem, func() int32 {
 92583  		if _1_pList != nil {
 92584  			return _1_pList.XnExpr
 92585  		}
 92586  		return int32(0)
 92587  	}())
 92588  	_sqlite3VdbeAppendP4(tls, _v, _pF.XpFunc, int32(-4))
 92589  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_pF }())) += uintptr(24)
 92590  	goto _0
 92591  _3:
 92592  }
 92593  
 92594  var _finalizeAggFunctionsØ00__func__Ø000 [21]int8
 92595  
 92596  func init() {
 92597  	crt.Xstrncpy(nil, &_finalizeAggFunctionsØ00__func__Ø000[0], str(110142), 21)
 92598  }
 92599  
 92600  // C comment
 92601  //  /*
 92602  //  ** Reset the aggregate accumulator.
 92603  //  **
 92604  //  ** The aggregate accumulator is a set of memory cells that hold
 92605  //  ** intermediate results while calculating an aggregate.  This
 92606  //  ** routine generates code that stores NULLs in all of those memory
 92607  //  ** cells.
 92608  //  */
 92609  func _resetAccumulator(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) {
 92610  	var _i, _nReg int32
 92611  	var _v *TVdbe
 92612  	var _4_pE *XExpr
 92613  	var _6_pKeyInfo *XKeyInfo
 92614  	var _pFunc *TAggInfo_func
 92615  	_v = (*TVdbe)(_pParse.XpVdbe)
 92616  	_nReg = _pAggInfo.XnFunc + _pAggInfo.XnColumn
 92617  	if _nReg == int32(0) {
 92618  		return
 92619  	}
 92620  	func() {
 92621  		if _nReg != ((_pAggInfo.XmxReg - _pAggInfo.XmnReg) + int32(1)) {
 92622  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121268), unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000), unsafe.Pointer(str(110163)))
 92623  			crt.X__builtin_abort(tls)
 92624  		}
 92625  	}()
 92626  	_i = int32(0)
 92627  _3:
 92628  	if _i >= _pAggInfo.XnColumn {
 92629  		goto _6
 92630  	}
 92631  	func() {
 92632  		if (elem68((*TAggInfo_col)(_pAggInfo.XaCol), uintptr(_i)).XiMem) < _pAggInfo.XmnReg || (elem68((*TAggInfo_col)(_pAggInfo.XaCol), uintptr(_i)).XiMem) > _pAggInfo.XmxReg {
 92633  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121270), unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000), unsafe.Pointer(str(110203)))
 92634  			crt.X__builtin_abort(tls)
 92635  		}
 92636  	}()
 92637  	_i += 1
 92638  	goto _3
 92639  _6:
 92640  	_i = int32(0)
 92641  _10:
 92642  	if _i >= _pAggInfo.XnFunc {
 92643  		goto _13
 92644  	}
 92645  	func() {
 92646  		if (elem69((*TAggInfo_func)(_pAggInfo.XaFunc), uintptr(_i)).XiMem) < _pAggInfo.XmnReg || (elem69((*TAggInfo_func)(_pAggInfo.XaFunc), uintptr(_i)).XiMem) > _pAggInfo.XmxReg {
 92647  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121274), unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000), unsafe.Pointer(str(110286)))
 92648  			crt.X__builtin_abort(tls)
 92649  		}
 92650  	}()
 92651  	_i += 1
 92652  	goto _10
 92653  _13:
 92654  	_sqlite3VdbeAddOp3(tls, _v, int32(59), int32(0), _pAggInfo.XmnReg, _pAggInfo.XmxReg)
 92655  	*func() *int32 { _pFunc = (*TAggInfo_func)(_pAggInfo.XaFunc); return &_i }() = int32(0)
 92656  _17:
 92657  	if _i >= _pAggInfo.XnFunc {
 92658  		goto _20
 92659  	}
 92660  	if _pFunc.XiDistinct < int32(0) {
 92661  		goto _21
 92662  	}
 92663  	_4_pE = (*XExpr)(_pFunc.XpExpr)
 92664  	func() {
 92665  		if (_4_pE.Xflags & uint32(2048)) != (0) {
 92666  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121282), unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000), unsafe.Pointer(str(110371)))
 92667  			crt.X__builtin_abort(tls)
 92668  		}
 92669  	}()
 92670  	if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_pE.Xx))) == nil) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_pE.Xx))).XnExpr) != int32(1)) {
 92671  		_sqlite3ErrorMsg(tls, _pParse, str(110406))
 92672  		_pFunc.XiDistinct = int32(-1)
 92673  		goto _26
 92674  	}
 92675  	_6_pKeyInfo = _keyInfoFromExprList(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_pE.Xx))), int32(0), int32(0))
 92676  	_sqlite3VdbeAddOp4(tls, _v, int32(110), _pFunc.XiDistinct, int32(0), int32(0), (*int8)(unsafe.Pointer(_6_pKeyInfo)), int32(-5))
 92677  _26:
 92678  _21:
 92679  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_pFunc }())) += uintptr(24)
 92680  	goto _17
 92681  _20:
 92682  }
 92683  
 92684  var _resetAccumulatorØ00__func__Ø000 [17]int8
 92685  
 92686  func init() {
 92687  	crt.Xstrncpy(nil, &_resetAccumulatorØ00__func__Ø000[0], str(110457), 17)
 92688  }
 92689  
 92690  // C comment
 92691  //  /*
 92692  //  ** The select statement passed as the first argument is an aggregate query.
 92693  //  ** The second argument is the associated aggregate-info object. This
 92694  //  ** function tests if the SELECT is of the form:
 92695  //  **
 92696  //  **   SELECT count(*) FROM <tbl>
 92697  //  **
 92698  //  ** where table is a database table, not a sub-select or view. If the query
 92699  //  ** does match this pattern, then a pointer to the Table object representing
 92700  //  ** <tbl> is returned. Otherwise, 0 is returned.
 92701  //  */
 92702  func _isSimpleCount(tls *crt.TLS, _p *XSelect, _pAggInfo *XAggInfo) (r0 *XTable) {
 92703  	var _pTab *XTable
 92704  	var _pExpr *XExpr
 92705  	func() {
 92706  		if _p.XpGroupBy != nil {
 92707  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120492), unsafe.Pointer(&_isSimpleCountØ00__func__Ø000), unsafe.Pointer(str(110474)))
 92708  			crt.X__builtin_abort(tls)
 92709  		}
 92710  	}()
 92711  	if (((_p.XpWhere != nil) || (((*XExprList)(_p.XpEList).XnExpr) != int32(1))) || (((*XSrcList)(_p.XpSrc).XnSrc) != int32(1))) || ((elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), 0).XpSelect) != nil) {
 92712  		return nil
 92713  	}
 92714  	_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), 0).XpTab)
 92715  	_pExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpEList).Xa))), 0).XpExpr)
 92716  	func() {
 92717  		if _pTab == nil || _pTab.XpSelect != nil || _pExpr == nil {
 92718  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120501), unsafe.Pointer(&_isSimpleCountØ00__func__Ø000), unsafe.Pointer(str(110487)))
 92719  			crt.X__builtin_abort(tls)
 92720  		}
 92721  	}()
 92722  	if _pTab.XnModuleArg != 0 {
 92723  		return nil
 92724  	}
 92725  	if int32(_pExpr.Xop) != int32(153) {
 92726  		return nil
 92727  	}
 92728  	if func() int32 {
 92729  		if _pAggInfo.XnFunc == int32(0) {
 92730  			return func() int32 {
 92731  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120505), unsafe.Pointer(&_isSimpleCountØ00__func__Ø000), unsafe.Pointer(str(4809)))
 92732  				crt.X__builtin_abort(tls)
 92733  				return int32(1)
 92734  			}()
 92735  		}
 92736  		return int32(0)
 92737  	}() != 0 {
 92738  		return nil
 92739  	}
 92740  	if (int32((*XFuncDef)(elem69((*TAggInfo_func)(_pAggInfo.XaFunc), 0).XpFunc).XfuncFlags) & int32(256)) == int32(0) {
 92741  		return nil
 92742  	}
 92743  	if (_pExpr.Xflags & uint32(16)) != 0 {
 92744  		return nil
 92745  	}
 92746  	return _pTab
 92747  }
 92748  
 92749  var _isSimpleCountØ00__func__Ø000 [14]int8
 92750  
 92751  func init() {
 92752  	crt.Xstrncpy(nil, &_isSimpleCountØ00__func__Ø000[0], str(110519), 14)
 92753  }
 92754  
 92755  func _explainSimpleCount(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pIdx *XIndex) {
 92756  	var _1_bCover int32
 92757  	var _1_zEqp *int8
 92758  	if int32(_pParse.Xexplain) == int32(2) {
 92759  		_1_bCover = bool2int((_pIdx != nil) && (((_pTab.XtabFlags & uint32(32)) == (0)) || (int32((uint32(_pIdx.XidxType)<<30)>>30) != int32(2))))
 92760  		_1_zEqp = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(110533), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(func() *int8 {
 92761  			if _1_bCover != 0 {
 92762  				return str(110551)
 92763  			}
 92764  			return str(284)
 92765  		}()), unsafe.Pointer(func() *int8 {
 92766  			if _1_bCover != 0 {
 92767  				return _pIdx.XzName
 92768  			}
 92769  			return str(284)
 92770  		}()))
 92771  		_sqlite3VdbeAddOp4(tls, (*TVdbe)(_pParse.XpVdbe), int32(165), _pParse.XiSelectId, int32(0), int32(0), _1_zEqp, int32(-1))
 92772  	}
 92773  }
 92774  
 92775  // C comment
 92776  //  /*
 92777  //  ** Based on the contents of the AggInfo structure indicated by the first
 92778  //  ** argument, this function checks if the following are true:
 92779  //  **
 92780  //  **    * the query contains just a single aggregate function,
 92781  //  **    * the aggregate function is either min() or max(), and
 92782  //  **    * the argument to the aggregate function is a column value.
 92783  //  **
 92784  //  ** If all of the above are true, then WHERE_ORDERBY_MIN or WHERE_ORDERBY_MAX
 92785  //  ** is returned as appropriate. Also, *ppMinMax is set to point to the
 92786  //  ** list of arguments passed to the aggregate before returning.
 92787  //  **
 92788  //  ** Or, if the conditions above are not met, *ppMinMax is set to 0 and
 92789  //  ** WHERE_ORDERBY_NORMAL is returned.
 92790  //  */
 92791  func _minMaxQuery(tls *crt.TLS, _pAggInfo *XAggInfo, _ppMinMax **XExprList) (r0 uint8) {
 92792  	var _eRet int32
 92793  	var _2_zFunc *int8
 92794  	var _1_pEList *XExprList
 92795  	var _1_pExpr *XExpr
 92796  	_eRet = int32(0)
 92797  	*_ppMinMax = nil
 92798  	if _pAggInfo.XnFunc != int32(1) {
 92799  		goto _0
 92800  	}
 92801  	_1_pExpr = (*XExpr)(elem69((*TAggInfo_func)(_pAggInfo.XaFunc), 0).XpExpr)
 92802  	_1_pEList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pExpr.Xx)))
 92803  	func() {
 92804  		if int32(_1_pExpr.Xop) != int32(153) {
 92805  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120460), unsafe.Pointer(&_minMaxQueryØ00__func__Ø000), unsafe.Pointer(str(96806)))
 92806  			crt.X__builtin_abort(tls)
 92807  		}
 92808  	}()
 92809  	if _1_pEList == nil || _1_pEList.XnExpr != int32(1) || int32((*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_1_pEList.Xa)), 0).XpExpr).Xop) != int32(154) {
 92810  		goto _5
 92811  	}
 92812  	_2_zFunc = *(**int8)(unsafe.Pointer(&_1_pExpr.Xu))
 92813  	if _sqlite3StrICmp(tls, _2_zFunc, str(7610)) == int32(0) {
 92814  		_eRet = int32(1)
 92815  		*_ppMinMax = _1_pEList
 92816  		goto _8
 92817  	}
 92818  	if _sqlite3StrICmp(tls, _2_zFunc, str(7614)) == int32(0) {
 92819  		_eRet = int32(2)
 92820  		*_ppMinMax = _1_pEList
 92821  	}
 92822  _8:
 92823  _5:
 92824  _0:
 92825  	func() {
 92826  		if (*_ppMinMax) != nil && ((*_ppMinMax).XnExpr) != int32(1) {
 92827  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120473), unsafe.Pointer(&_minMaxQueryØ00__func__Ø000), unsafe.Pointer(str(110574)))
 92828  			crt.X__builtin_abort(tls)
 92829  		}
 92830  	}()
 92831  	return uint8(_eRet)
 92832  }
 92833  
 92834  var _minMaxQueryØ00__func__Ø000 [12]int8
 92835  
 92836  func init() {
 92837  	crt.Xstrncpy(nil, &_minMaxQueryØ00__func__Ø000[0], str(110612), 12)
 92838  }
 92839  
 92840  // C comment
 92841  //  /*
 92842  //  ** If the inner loop was generated using a non-null pOrderBy argument,
 92843  //  ** then the results were placed in a sorter.  After the loop is terminated
 92844  //  ** we need to run the sorter and output the results.  The following
 92845  //  ** routine generates the code needed to do that.
 92846  //  */
 92847  func _generateSortTail(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pSort *XSortCtx, _nColumn int32, _pDest *XSelectDest) {
 92848  	var _addrBreak, _addrContinue, _addr, _addrOnce, _iTab, _eDest, _iParm, _regRow, _regRowid, _iCol, _nKey, _iSortTab, _nSortData, _i, _bSeq, _4_regSortOut, _7_iRead int32
 92849  	var _v *TVdbe
 92850  	var _pOrderBy *XExprList
 92851  	var _aOutEx *TExprList_item
 92852  	_v = (*TVdbe)(_pParse.XpVdbe)
 92853  	_addrBreak = _pSort.XlabelDone
 92854  	_addrContinue = _sqlite3VdbeMakeLabel(tls, _v)
 92855  	_addrOnce = int32(0)
 92856  	_pOrderBy = (*XExprList)(_pSort.XpOrderBy)
 92857  	_eDest = int32(_pDest.XeDest)
 92858  	_iParm = _pDest.XiSDParm
 92859  	_aOutEx = (*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpEList).Xa)))
 92860  	func() {
 92861  		if _addrBreak >= int32(0) {
 92862  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117761), unsafe.Pointer(&_generateSortTailØ00__func__Ø000), unsafe.Pointer(str(110624)))
 92863  			crt.X__builtin_abort(tls)
 92864  		}
 92865  	}()
 92866  	if _pSort.XlabelBkOut != 0 {
 92867  		_sqlite3VdbeAddOp2(tls, _v, int32(14), _pSort.XregReturn, _pSort.XlabelBkOut)
 92868  		_sqlite3VdbeGoto(tls, _v, _addrBreak)
 92869  		_sqlite3VdbeResolveLabel(tls, _v, _pSort.XlabelBkOut)
 92870  	}
 92871  	_iTab = _pSort.XiECursor
 92872  	if ((_eDest == int32(9)) || (_eDest == int32(13))) || (_eDest == int32(10)) {
 92873  		_regRowid = int32(0)
 92874  		_regRow = _pDest.XiSdst
 92875  		_nSortData = _nColumn
 92876  		goto _6
 92877  	}
 92878  	_regRowid = _sqlite3GetTempReg(tls, _pParse)
 92879  	_regRow = _sqlite3GetTempRange(tls, _pParse, _nColumn)
 92880  	_nSortData = _nColumn
 92881  _6:
 92882  	_nKey = _pOrderBy.XnExpr - _pSort.XnOBSat
 92883  	if (int32(_pSort.XsortFlags) & int32(1)) == 0 {
 92884  		goto _7
 92885  	}
 92886  	_4_regSortOut = preInc2(&_pParse.XnMem, 1)
 92887  	_iSortTab = postInc2(&_pParse.XnTab, 1)
 92888  	if _pSort.XlabelBkOut != 0 {
 92889  		_addrOnce = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 92890  	}
 92891  	_sqlite3VdbeAddOp3(tls, _v, int32(113), _iSortTab, _4_regSortOut, (_nKey+int32(1))+_nSortData)
 92892  	if _addrOnce != 0 {
 92893  		_sqlite3VdbeJumpHere(tls, _v, _addrOnce)
 92894  	}
 92895  	_addr = int32(1) + _sqlite3VdbeAddOp2(tls, _v, int32(35), _iTab, _addrBreak)
 92896  	_codeOffset(tls, _v, _p.XiOffset, _addrContinue)
 92897  	_sqlite3VdbeAddOp3(tls, _v, int32(123), _iTab, _4_regSortOut, _iSortTab)
 92898  	_bSeq = int32(0)
 92899  	goto _10
 92900  _7:
 92901  	_addr = int32(1) + _sqlite3VdbeAddOp2(tls, _v, int32(36), _iTab, _addrBreak)
 92902  	_codeOffset(tls, _v, _p.XiOffset, _addrContinue)
 92903  	_iSortTab = _iTab
 92904  	_bSeq = int32(1)
 92905  _10:
 92906  	*func() *int32 { _i = int32(0); return &_iCol }() = _nKey + _bSeq
 92907  _11:
 92908  	if _i >= _nSortData {
 92909  		goto _14
 92910  	}
 92911  	if ((*t73)(unsafe.Pointer(&(elem59(_aOutEx, uintptr(_i)).Xu))).XiOrderByCol) != 0 {
 92912  		_7_iRead = int32((*t73)(unsafe.Pointer(&(elem59(_aOutEx, uintptr(_i)).Xu))).XiOrderByCol) - int32(1)
 92913  		goto _16
 92914  	}
 92915  	_7_iRead = postInc2(&_iCol, 1)
 92916  _16:
 92917  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _iSortTab, _7_iRead, _regRow+_i)
 92918  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(func() *int8 {
 92919  		if (elem59(_aOutEx, uintptr(_i)).XzName) != nil {
 92920  			return (elem59(_aOutEx, uintptr(_i)).XzName)
 92921  		}
 92922  		return (elem59(_aOutEx, uintptr(_i)).XzSpan)
 92923  	}()))
 92924  	_i += 1
 92925  	goto _11
 92926  _14:
 92927  	switch _eDest {
 92928  	case int32(10):
 92929  		goto _23
 92930  	case int32(11):
 92931  		goto _22
 92932  	case int32(12):
 92933  		goto _20
 92934  	case int32(14):
 92935  		goto _20
 92936  	default:
 92937  		goto _24
 92938  	}
 92939  
 92940  _20:
 92941  	_sqlite3VdbeAddOp2(tls, _v, int32(117), _iParm, _regRowid)
 92942  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _iParm, _regRow, _regRowid)
 92943  	_sqlite3VdbeChangeP5(tls, _v, uint16(8))
 92944  	goto _25
 92945  _22:
 92946  	func() {
 92947  		if _nColumn != _sqlite3Strlen30(tls, _pDest.XzAffSdst) {
 92948  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117817), unsafe.Pointer(&_generateSortTailØ00__func__Ø000), unsafe.Pointer(str(110636)))
 92949  			crt.X__builtin_abort(tls)
 92950  		}
 92951  	}()
 92952  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _regRow, _nColumn, _regRowid, _pDest.XzAffSdst, _nColumn)
 92953  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _regRow, _nColumn)
 92954  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iParm, _regRowid, _regRow, _nColumn)
 92955  	goto _25
 92956  _23:
 92957  	goto _25
 92958  _24:
 92959  	func() {
 92960  		if _eDest != int32(9) && _eDest != int32(13) {
 92961  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117830), unsafe.Pointer(&_generateSortTailØ00__func__Ø000), unsafe.Pointer(str(110678)))
 92962  			crt.X__builtin_abort(tls)
 92963  		}
 92964  	}()
 92965  	if _eDest == int32(9) {
 92966  		_sqlite3VdbeAddOp2(tls, _v, int32(67), _pDest.XiSdst, _nColumn)
 92967  		_sqlite3ExprCacheAffinityChange(tls, _pParse, _pDest.XiSdst, _nColumn)
 92968  		goto _32
 92969  	}
 92970  	_sqlite3VdbeAddOp1(tls, _v, int32(16), _pDest.XiSDParm)
 92971  _32:
 92972  	goto _25
 92973  _25:
 92974  	if _regRowid == 0 {
 92975  		goto _33
 92976  	}
 92977  	if _eDest == int32(11) {
 92978  		_sqlite3ReleaseTempRange(tls, _pParse, _regRow, _nColumn)
 92979  		goto _35
 92980  	}
 92981  	_sqlite3ReleaseTempReg(tls, _pParse, _regRow)
 92982  _35:
 92983  	_sqlite3ReleaseTempReg(tls, _pParse, _regRowid)
 92984  _33:
 92985  	_sqlite3VdbeResolveLabel(tls, _v, _addrContinue)
 92986  	if (int32(_pSort.XsortFlags) & int32(1)) != 0 {
 92987  		_sqlite3VdbeAddOp2(tls, _v, int32(3), _iTab, _addr)
 92988  		goto _37
 92989  	}
 92990  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _iTab, _addr)
 92991  _37:
 92992  	if _pSort.XregReturn != 0 {
 92993  		_sqlite3VdbeAddOp1(tls, _v, int32(52), _pSort.XregReturn)
 92994  	}
 92995  	_sqlite3VdbeResolveLabel(tls, _v, _addrBreak)
 92996  	_ = _iCol
 92997  }
 92998  
 92999  var _generateSortTailØ00__func__Ø000 [17]int8
 93000  
 93001  func init() {
 93002  	crt.Xstrncpy(nil, &_generateSortTailØ00__func__Ø000[0], str(110720), 17)
 93003  }
 93004  
 93005  // C comment
 93006  //  /*
 93007  //  ** Argument pVector points to a vector expression - either a TK_VECTOR
 93008  //  ** or TK_SELECT that returns more than one column. This function returns
 93009  //  ** the register number of a register that contains the value of
 93010  //  ** element iField of the vector.
 93011  //  **
 93012  //  ** If pVector is a TK_SELECT expression, then code for it must have
 93013  //  ** already been generated using the exprCodeSubselect() routine. In this
 93014  //  ** case parameter regSelect should be the first in an array of registers
 93015  //  ** containing the results of the sub-select.
 93016  //  **
 93017  //  ** If pVector is of type TK_VECTOR, then code for the requested field
 93018  //  ** is generated. In this case (*pRegFree) may be set to the number of
 93019  //  ** a temporary register to be freed by the caller before returning.
 93020  //  **
 93021  //  ** Before returning, output parameter (*ppExpr) is set to point to the
 93022  //  ** Expr object corresponding to element iElem of the vector.
 93023  //  */
 93024  func _exprVectorRegister(tls *crt.TLS, _pParse *XParse, _pVector *XExpr, _iField int32, _regSelect int32, _ppExpr **XExpr, _pRegFree *int32) (r0 int32) {
 93025  	var _op uint8
 93026  	_op = _pVector.Xop
 93027  	func() {
 93028  		if int32(_op) != int32(158) && int32(_op) != int32(157) && int32(_op) != int32(119) {
 93029  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91384), unsafe.Pointer(&_exprVectorRegisterØ00__func__Ø000), unsafe.Pointer(str(110737)))
 93030  			crt.X__builtin_abort(tls)
 93031  		}
 93032  	}()
 93033  	if int32(_op) == int32(157) {
 93034  		*_ppExpr = _sqlite3VectorFieldSubexpr(tls, _pVector, _iField)
 93035  		return _pVector.XiTable + _iField
 93036  	}
 93037  	if int32(_op) == int32(119) {
 93038  		*_ppExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pVector.Xx))).XpEList).Xa))), uintptr(_iField)).XpExpr)
 93039  		return _regSelect + _iField
 93040  	}
 93041  	*_ppExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pVector.Xx))).Xa))), uintptr(_iField)).XpExpr)
 93042  	return _sqlite3ExprCodeTemp(tls, _pParse, *_ppExpr, _pRegFree)
 93043  }
 93044  
 93045  var _exprVectorRegisterØ00__func__Ø000 [19]int8
 93046  
 93047  func init() {
 93048  	crt.Xstrncpy(nil, &_exprVectorRegisterØ00__func__Ø000[0], str(110787), 19)
 93049  }
 93050  
 93051  // C comment
 93052  //  /*
 93053  //  ** The first parameter (pDef) is a function implementation.  The
 93054  //  ** second parameter (pExpr) is the first argument to this function.
 93055  //  ** If pExpr is a column in a virtual table, then let the virtual
 93056  //  ** table implementation have an opportunity to overload the function.
 93057  //  **
 93058  //  ** This routine is used to allow virtual table implementations to
 93059  //  ** overload MATCH, LIKE, GLOB, and REGEXP operators.
 93060  //  **
 93061  //  ** Return either the pDef argument (indicating no change) or a
 93062  //  ** new FuncDef structure that is marked as ephemeral using the
 93063  //  ** SQLITE_FUNC_EPHEM flag.
 93064  //  */
 93065  func _sqlite3VtabOverloadFunction(tls *crt.TLS, _db *Xsqlite3, _pDef *XFuncDef, _nArg int32, _pExpr *XExpr) (r0 *XFuncDef) {
 93066  	var _rc int32
 93067  	var _zLowerName *int8
 93068  	var _pArg unsafe.Pointer
 93069  	var _z *uint8
 93070  	var _pTab *XTable
 93071  	var _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
 93072  	var _pNew *XFuncDef
 93073  	var _pVtab *Xsqlite3_vtab
 93074  	var _pMod *Xsqlite3_module
 93075  	_xSFunc = nil
 93076  	_pArg = nil
 93077  	_rc = int32(0)
 93078  	if func() int32 {
 93079  		if _pExpr == nil {
 93080  			return func() int32 {
 93081  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126040), unsafe.Pointer(&_sqlite3VtabOverloadFunctionØ00__func__Ø000), unsafe.Pointer(str(4809)))
 93082  				crt.X__builtin_abort(tls)
 93083  				return int32(1)
 93084  			}()
 93085  		}
 93086  		return int32(0)
 93087  	}() != 0 {
 93088  		return _pDef
 93089  	}
 93090  	if int32(_pExpr.Xop) != int32(152) {
 93091  		return _pDef
 93092  	}
 93093  	_pTab = (*XTable)(_pExpr.XpTab)
 93094  	if _pTab == nil {
 93095  		return _pDef
 93096  	}
 93097  	if _pTab.XnModuleArg == 0 {
 93098  		return _pDef
 93099  	}
 93100  	_pVtab = (*Xsqlite3_vtab)(_sqlite3GetVTable(tls, _db, _pTab).XpVtab)
 93101  	func() {
 93102  		if _pVtab == nil {
 93103  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126046), unsafe.Pointer(&_sqlite3VtabOverloadFunctionØ00__func__Ø000), unsafe.Pointer(str(110806)))
 93104  			crt.X__builtin_abort(tls)
 93105  		}
 93106  	}()
 93107  	func() {
 93108  		if (*Xsqlite3_module)(_pVtab.XpModule) == nil {
 93109  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126047), unsafe.Pointer(&_sqlite3VtabOverloadFunctionØ00__func__Ø000), unsafe.Pointer(str(110815)))
 93110  			crt.X__builtin_abort(tls)
 93111  		}
 93112  	}()
 93113  	_pMod = (*Xsqlite3_module)(_pVtab.XpModule)
 93114  	if func() func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32 {
 93115  		v := _pMod.XxFindFunction
 93116  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32)(unsafe.Pointer(&v))
 93117  	}() == nil {
 93118  		return _pDef
 93119  	}
 93120  	_zLowerName = _sqlite3DbStrDup(tls, _db, _pDef.XzName)
 93121  	if _zLowerName == nil {
 93122  		goto _11
 93123  	}
 93124  	_z = (*uint8)(unsafe.Pointer(_zLowerName))
 93125  _12:
 93126  	if (*_z) == 0 {
 93127  		goto _15
 93128  	}
 93129  	*_z = *elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_z))
 93130  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 93131  	goto _12
 93132  _15:
 93133  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32 {
 93134  		v := _pMod.XxFindFunction
 93135  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32)(unsafe.Pointer(&v))
 93136  	}()(tls, _pVtab, _nArg, _zLowerName, &_xSFunc, &_pArg)
 93137  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zLowerName))
 93138  _11:
 93139  	if _rc == int32(0) {
 93140  		return _pDef
 93141  	}
 93142  	_pNew = (*XFuncDef)(_sqlite3DbMallocZero(tls, _db, (uint64(56)+uint64(_sqlite3Strlen30(tls, _pDef.XzName)))+uint64(1)))
 93143  	if _pNew == nil {
 93144  		return _pDef
 93145  	}
 93146  	*_pNew = *_pDef
 93147  	_pNew.XzName = (*int8)(unsafe.Pointer(elem17(_pNew, uintptr(1))))
 93148  	crt.Xmemcpy(tls, unsafe.Pointer(elem17(_pNew, uintptr(1))), unsafe.Pointer(_pDef.XzName), uint64(_sqlite3Strlen30(tls, _pDef.XzName)+int32(1)))
 93149  	*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&_pNew.XxSFunc)) = _xSFunc
 93150  	_pNew.XpUserData = _pArg
 93151  	{
 93152  		p := &_pNew.XfuncFlags
 93153  		*p = uint16(int32(*p) | int32(16))
 93154  	}
 93155  	return _pNew
 93156  }
 93157  
 93158  var _sqlite3VtabOverloadFunctionØ00__func__Ø000 [28]int8
 93159  
 93160  func init() {
 93161  	crt.Xstrncpy(nil, &_sqlite3VtabOverloadFunctionØ00__func__Ø000[0], str(110833), 28)
 93162  }
 93163  
 93164  // C comment
 93165  //  /*
 93166  //  ** The code generator calls this routine if is discovers that it is
 93167  //  ** possible to abort a statement prior to completion.  In order to
 93168  //  ** perform this abort without corrupting the database, we need to make
 93169  //  ** sure that the statement is protected by a statement transaction.
 93170  //  **
 93171  //  ** Technically, we only need to set the mayAbort flag if the
 93172  //  ** isMultiWrite flag was previously set.  There is a time dependency
 93173  //  ** such that the abort must occur after the multiwrite.  This makes
 93174  //  ** some statements involving the REPLACE conflict resolution algorithm
 93175  //  ** go a little faster.  But taking advantage of this time dependency
 93176  //  ** makes it more difficult to prove that the code is correct (in
 93177  //  ** particular, it prevents us from writing an effective
 93178  //  ** implementation of sqlite3AssertMayAbort()) and so we have chosen
 93179  //  ** to take the safe route and skip the optimization.
 93180  //  */
 93181  func _sqlite3MayAbort(tls *crt.TLS, _pParse *XParse) {
 93182  	var _pToplevel *XParse
 93183  	_pToplevel = func() *XParse {
 93184  		if _pParse.XpToplevel != nil {
 93185  			return (*XParse)(_pParse.XpToplevel)
 93186  		}
 93187  		return _pParse
 93188  	}()
 93189  	_pToplevel.XmayAbort = uint8(1)
 93190  }
 93191  
 93192  // C comment
 93193  //  /*
 93194  //  ** Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT
 93195  //  ** error. The onError parameter determines which (if any) of the statement
 93196  //  ** and/or current transaction is rolled back.
 93197  //  */
 93198  func _sqlite3HaltConstraint(tls *crt.TLS, _pParse *XParse, _errCode int32, _onError int32, _p4 *int8, _p4type int8, _p5Errmsg uint8) {
 93199  	var _v *TVdbe
 93200  	_v = _sqlite3GetVdbe(tls, _pParse)
 93201  	func() {
 93202  		if (_errCode & int32(255)) != int32(19) {
 93203  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103850), unsafe.Pointer(&_sqlite3HaltConstraintØ00__func__Ø000), unsafe.Pointer(str(110861)))
 93204  			crt.X__builtin_abort(tls)
 93205  		}
 93206  	}()
 93207  	if _onError == int32(2) {
 93208  		_sqlite3MayAbort(tls, _pParse)
 93209  	}
 93210  	_sqlite3VdbeAddOp4(tls, _v, int32(55), _errCode, _onError, int32(0), _p4, int32(_p4type))
 93211  	_sqlite3VdbeChangeP5(tls, _v, uint16(_p5Errmsg))
 93212  }
 93213  
 93214  var _sqlite3HaltConstraintØ00__func__Ø000 [22]int8
 93215  
 93216  func init() {
 93217  	crt.Xstrncpy(nil, &_sqlite3HaltConstraintØ00__func__Ø000[0], str(110895), 22)
 93218  }
 93219  
 93220  // C comment
 93221  //  /*
 93222  //  ** Prepare a virtual machine for execution for the first time after
 93223  //  ** creating the virtual machine.  This involves things such
 93224  //  ** as allocating registers and initializing the program counter.
 93225  //  ** After the VDBE has be prepped, it can be executed by one or more
 93226  //  ** calls to sqlite3VdbeExec().
 93227  //  **
 93228  //  ** This function may be called exactly once on each virtual machine.
 93229  //  ** After this routine is called the VM has been "packaged" and is ready
 93230  //  ** to run.  After this routine is called, further calls to
 93231  //  ** sqlite3VdbeAddOp() functions are prohibited.  This routine disconnects
 93232  //  ** the Vdbe from the Parse object that helped generate it so that the
 93233  //  ** the Vdbe becomes an independent entity and the Parse object can be
 93234  //  ** destroyed.
 93235  //  **
 93236  //  ** Use the sqlite3VdbeRewind() procedure to restore a virtual machine back
 93237  //  ** to its initial state after it has been run.
 93238  //  */
 93239  func _sqlite3VdbeMakeReady(tls *crt.TLS, _p *TVdbe, _pParse *XParse) {
 93240  	var _nVar, _nMem, _nCursor, _nArg, _n int32
 93241  	var _db *Xsqlite3
 93242  	var _x TReusableSpace
 93243  	func() {
 93244  		if _p == nil {
 93245  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73360), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(807)))
 93246  			crt.X__builtin_abort(tls)
 93247  		}
 93248  	}()
 93249  	func() {
 93250  		if _p.XnOp <= int32(0) {
 93251  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73361), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(41671)))
 93252  			crt.X__builtin_abort(tls)
 93253  		}
 93254  	}()
 93255  	func() {
 93256  		if _pParse == nil {
 93257  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73362), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(110917)))
 93258  			crt.X__builtin_abort(tls)
 93259  		}
 93260  	}()
 93261  	func() {
 93262  		if _p.Xmagic != uint32(381479589) {
 93263  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73363), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(37597)))
 93264  			crt.X__builtin_abort(tls)
 93265  		}
 93266  	}()
 93267  	func() {
 93268  		if _pParse != (*XParse)(_p.XpParse) {
 93269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73364), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(110927)))
 93270  			crt.X__builtin_abort(tls)
 93271  		}
 93272  	}()
 93273  	_db = (*Xsqlite3)(_p.Xdb)
 93274  	func() {
 93275  		if int32(_db.XmallocFailed) != int32(0) {
 93276  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73366), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(1262)))
 93277  			crt.X__builtin_abort(tls)
 93278  		}
 93279  	}()
 93280  	_nVar = int32(_pParse.XnVar)
 93281  	_nMem = _pParse.XnMem
 93282  	_nCursor = _pParse.XnTab
 93283  	_nArg = _pParse.XnMaxArg
 93284  	_nMem += _nCursor
 93285  	if (_nCursor == int32(0)) && (_nMem > int32(0)) {
 93286  		_nMem += 1
 93287  	}
 93288  	_n = int32(((uint64(32) * uint64(_p.XnOp)) + uint64(7)) & uint64(18446744073709551608))
 93289  	_x.XpSpace = elem15((*uint8)(unsafe.Pointer((*XVdbeOp)(_p.XaOp))), uintptr(_n))
 93290  	func() {
 93291  		if (int64(uintptr(unsafe.Pointer(_x.XpSpace))) & int64(7)) != (0) {
 93292  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73386), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(110945)))
 93293  			crt.X__builtin_abort(tls)
 93294  		}
 93295  	}()
 93296  	_x.XnFree = (_pParse.XszOpAlloc - _n) & int32(-8)
 93297  	func() {
 93298  		if _x.XnFree < int32(0) {
 93299  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73388), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(110976)))
 93300  			crt.X__builtin_abort(tls)
 93301  		}
 93302  	}()
 93303  	func() {
 93304  		if (int64(uintptr(unsafe.Pointer(elem15(_x.XpSpace, uintptr(_x.XnFree))))) & int64(7)) != (0) {
 93305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73389), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(110987)))
 93306  			crt.X__builtin_abort(tls)
 93307  		}
 93308  	}()
 93309  	_resolveP2Values(tls, _p, &_nArg)
 93310  	storebits26(&_p.Xexpired, int16(uint8(bool2int((_pParse.XisMultiWrite != 0) && (_pParse.XmayAbort != 0)))), 64, 6)
 93311  	if (_pParse.Xexplain != 0) && (_nMem < int32(10)) {
 93312  		_nMem = int32(10)
 93313  	}
 93314  	storebits26(&_p.Xexpired, 0, 1, 0)
 93315  _23:
 93316  	_x.XnNeeded = int32(0)
 93317  	*(**XMem)(unsafe.Pointer(&_p.XaMem)) = (*XMem)(_allocSpace(tls, &_x, _p.XaMem, int32(uint64(_nMem)*uint64(72))))
 93318  	*(**XMem)(unsafe.Pointer(&_p.XaVar)) = (*XMem)(_allocSpace(tls, &_x, _p.XaVar, int32(uint64(_nVar)*uint64(72))))
 93319  	*(***XMem)(unsafe.Pointer(&_p.XapArg)) = (**XMem)(_allocSpace(tls, &_x, unsafe.Pointer(_p.XapArg), int32(uint64(_nArg)*uint64(8))))
 93320  	*(***XVdbeCursor)(unsafe.Pointer(&_p.XapCsr)) = (**XVdbeCursor)(_allocSpace(tls, &_x, unsafe.Pointer(_p.XapCsr), int32(uint64(_nCursor)*uint64(8))))
 93321  	if _x.XnNeeded == int32(0) {
 93322  		goto _25
 93323  	}
 93324  	_x.XpSpace = (*uint8)(store16(&_p.XpFree, _sqlite3DbMallocRawNN(tls, _db, uint64(_x.XnNeeded))))
 93325  	_x.XnFree = _x.XnNeeded
 93326  	if _db.XmallocFailed == 0 {
 93327  		goto _23
 93328  	}
 93329  _25:
 93330  	_p.XpVList = _pParse.XpVList
 93331  	_pParse.XpVList = nil
 93332  	storebits26(&_p.Xexpired, int16(_pParse.Xexplain), 12, 2)
 93333  	if _db.XmallocFailed != 0 {
 93334  		_p.XnVar = 0
 93335  		_p.XnCursor = int32(0)
 93336  		_p.XnMem = int32(0)
 93337  		goto _27
 93338  	}
 93339  	_p.XnCursor = _nCursor
 93340  	_p.XnVar = int16(_nVar)
 93341  	_initMemArray(tls, (*XMem)(_p.XaVar), _nVar, _db, uint16(1))
 93342  	_p.XnMem = _nMem
 93343  	_initMemArray(tls, (*XMem)(_p.XaMem), _nMem, _db, uint16(128))
 93344  	crt.Xmemset(tls, unsafe.Pointer(_p.XapCsr), int32(0), uint64(_nCursor)*uint64(8))
 93345  _27:
 93346  	_sqlite3VdbeRewind(tls, _p)
 93347  }
 93348  
 93349  var _sqlite3VdbeMakeReadyØ00__func__Ø000 [21]int8
 93350  
 93351  func init() {
 93352  	crt.Xstrncpy(nil, &_sqlite3VdbeMakeReadyØ00__func__Ø000[0], str(111028), 21)
 93353  }
 93354  
 93355  // C comment
 93356  //  /*
 93357  //  ** This routine is called after all opcodes have been inserted.  It loops
 93358  //  ** through all the opcodes and fixes up some details.
 93359  //  **
 93360  //  ** (1) For each jump instruction with a negative P2 value (a label)
 93361  //  **     resolve the P2 value to an actual address.
 93362  //  **
 93363  //  ** (2) Compute the maximum number of arguments used by any SQL function
 93364  //  **     and store that value in *pMaxFuncArgs.
 93365  //  **
 93366  //  ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately
 93367  //  **     indicate what the prepared statement actually does.
 93368  //  **
 93369  //  ** (4) Initialize the p4.xAdvance pointer on opcodes that use it.
 93370  //  **
 93371  //  ** (5) Reclaim the memory allocated for storing labels.
 93372  //  **
 93373  //  ** This routine will only function correctly if the mkopcodeh.tcl generator
 93374  //  ** script numbers the opcodes correctly.  Changes to this routine must be
 93375  //  ** coordinated with changes to mkopcodeh.tcl.
 93376  //  */
 93377  func _resolveP2Values(tls *crt.TLS, _p *TVdbe, _pMaxFuncArgs *int32) {
 93378  	var _nMaxArgs, _8_n int32
 93379  	var _aLabel *int32
 93380  	var _pParse *XParse
 93381  	var _pOp *XVdbeOp
 93382  	_nMaxArgs = *_pMaxFuncArgs
 93383  	_pParse = (*XParse)(_p.XpParse)
 93384  	_aLabel = _pParse.XaLabel
 93385  	storebits26(&_p.Xexpired, int16(1), 128, 7)
 93386  	storebits26(&_p.Xexpired, 0, 256, 8)
 93387  	_pOp = elem63((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1)))
 93388  _0:
 93389  	if int32(_pOp.Xopcode) > int32(83) {
 93390  		goto _2
 93391  	}
 93392  	switch int32(_pOp.Xopcode) {
 93393  	case int32(0):
 93394  		goto _5
 93395  	case int32(1):
 93396  		goto _5
 93397  	case int32(2):
 93398  		goto _4
 93399  	case int32(3):
 93400  		goto _12
 93401  	case int32(4):
 93402  		goto _15
 93403  	case int32(5):
 93404  		goto _12
 93405  	case int32(6):
 93406  		goto _15
 93407  	case int32(7):
 93408  		goto _12
 93409  	case int32(8):
 93410  		goto _7
 93411  	case int32(9):
 93412  		goto _7
 93413  	case int32(10):
 93414  		goto _7
 93415  	case int32(11):
 93416  		goto _11
 93417  	case int32(12):
 93418  		goto _10
 93419  	default:
 93420  		goto _17
 93421  	}
 93422  
 93423  _4:
 93424  	if _pOp.Xp2 != int32(0) {
 93425  		storebits26(&_p.Xexpired, 0, 128, 7)
 93426  	}
 93427  _5:
 93428  	storebits26(&_p.Xexpired, int16(1), 256, 8)
 93429  	goto _17
 93430  _7:
 93431  	storebits26(&_p.Xexpired, 0, 128, 7)
 93432  	storebits26(&_p.Xexpired, int16(1), 256, 8)
 93433  	goto _17
 93434  _10:
 93435  	if _pOp.Xp2 > _nMaxArgs {
 93436  		_nMaxArgs = _pOp.Xp2
 93437  	}
 93438  	goto _17
 93439  _11:
 93440  	func() {
 93441  		if int64((uintptr(unsafe.Pointer(_pOp))-uintptr(_p.XaOp))/32) < int64(3) {
 93442  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72021), unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000), unsafe.Pointer(str(111049)))
 93443  			crt.X__builtin_abort(tls)
 93444  		}
 93445  	}()
 93446  	func() {
 93447  		if int32(elem63(_pOp, uintptr(18446744073709551615)).Xopcode) != int32(56) {
 93448  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72022), unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000), unsafe.Pointer(str(111069)))
 93449  			crt.X__builtin_abort(tls)
 93450  		}
 93451  	}()
 93452  	_8_n = elem63(_pOp, uintptr(18446744073709551615)).Xp1
 93453  	if _8_n > _nMaxArgs {
 93454  		_nMaxArgs = _8_n
 93455  	}
 93456  	goto _17
 93457  _12:
 93458  	*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4)))) = _sqlite3BtreeNext
 93459  	_pOp.Xp4type = int8(-14)
 93460  	goto _17
 93461  _15:
 93462  	*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4)))) = _sqlite3BtreePrevious
 93463  	_pOp.Xp4type = int8(-14)
 93464  	goto _17
 93465  _17:
 93466  	if ((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3OpcodeProperty)), uintptr(_pOp.Xopcode))) & int32(1)) != int32(0)) && (_pOp.Xp2 < int32(0)) {
 93467  		func() {
 93468  			if (int32(-1) - _pOp.Xp2) >= _pParse.XnLabel {
 93469  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72043), unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000), unsafe.Pointer(str(111096)))
 93470  				crt.X__builtin_abort(tls)
 93471  			}
 93472  		}()
 93473  		_pOp.Xp2 = *elem8(_aLabel, uintptr(int32(-1)-_pOp.Xp2))
 93474  	}
 93475  _2:
 93476  	if _pOp == (*XVdbeOp)(_p.XaOp) {
 93477  		goto _1
 93478  	}
 93479  	*(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(18446744073709551584)
 93480  	goto _0
 93481  _1:
 93482  	_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_pParse.XaLabel))
 93483  	_pParse.XaLabel = nil
 93484  	_pParse.XnLabel = int32(0)
 93485  	*_pMaxFuncArgs = _nMaxArgs
 93486  	func() {
 93487  		if int32((uint32(_p.Xexpired>>8)<<31)>>31) == int32(0) && _p.XbtreeMask != (0) {
 93488  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72054), unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000), unsafe.Pointer(str(111125)))
 93489  			crt.X__builtin_abort(tls)
 93490  		}
 93491  	}()
 93492  }
 93493  
 93494  var _resolveP2ValuesØ00__func__Ø000 [16]int8
 93495  
 93496  func init() {
 93497  	crt.Xstrncpy(nil, &_resolveP2ValuesØ00__func__Ø000[0], str(111172), 16)
 93498  }
 93499  
 93500  // C comment
 93501  //  /* Try to allocate nByte bytes of 8-byte aligned bulk memory for pBuf
 93502  //  ** from the ReusableSpace object.  Return a pointer to the allocated
 93503  //  ** memory on success.  If insufficient memory is available in the
 93504  //  ** ReusableSpace object, increase the ReusableSpace.nNeeded
 93505  //  ** value by the amount needed and return NULL.
 93506  //  **
 93507  //  ** If pBuf is not initially NULL, that means that the memory has already
 93508  //  ** been allocated by a prior call to this routine, so just return a copy
 93509  //  ** of pBuf and leave ReusableSpace unchanged.
 93510  //  **
 93511  //  ** This allocator is employed to repurpose unused slots at the end of the
 93512  //  ** opcode array of prepared state for other memory needs of the prepared
 93513  //  ** statement.
 93514  //  */
 93515  func _allocSpace(tls *crt.TLS, _p *TReusableSpace, _pBuf unsafe.Pointer, _nByte int32) (r0 unsafe.Pointer) {
 93516  	func() {
 93517  		if (int64(uintptr(unsafe.Pointer(_p.XpSpace))) & int64(7)) != (0) {
 93518  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73277), unsafe.Pointer(&_allocSpaceØ00__func__Ø000), unsafe.Pointer(str(111188)))
 93519  			crt.X__builtin_abort(tls)
 93520  		}
 93521  	}()
 93522  	if _pBuf != nil {
 93523  		goto _2
 93524  	}
 93525  	_nByte = (_nByte + int32(7)) & int32(-8)
 93526  	if _nByte <= _p.XnFree {
 93527  		_p.XnFree -= _nByte
 93528  		_pBuf = unsafe.Pointer(elem15(_p.XpSpace, uintptr(_p.XnFree)))
 93529  		goto _4
 93530  	}
 93531  	_p.XnNeeded += _nByte
 93532  _4:
 93533  _2:
 93534  	func() {
 93535  		if (int64(uintptr(_pBuf)) & int64(7)) != (0) {
 93536  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73287), unsafe.Pointer(&_allocSpaceØ00__func__Ø000), unsafe.Pointer(str(111220)))
 93537  			crt.X__builtin_abort(tls)
 93538  		}
 93539  	}()
 93540  	return _pBuf
 93541  }
 93542  
 93543  var _allocSpaceØ00__func__Ø000 [11]int8
 93544  
 93545  func init() {
 93546  	crt.Xstrncpy(nil, &_allocSpaceØ00__func__Ø000[0], str(111247), 11)
 93547  }
 93548  
 93549  // C comment
 93550  //  /*
 93551  //  ** Generate VDBE code for a BEGIN statement.
 93552  //  */
 93553  func _sqlite3BeginTransaction(tls *crt.TLS, _pParse *XParse, _type int32) {
 93554  	var _i int32
 93555  	var _db *Xsqlite3
 93556  	var _v *TVdbe
 93557  	func() {
 93558  		if _pParse == nil {
 93559  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103643), unsafe.Pointer(&_sqlite3BeginTransactionØ00__func__Ø000), unsafe.Pointer(str(110917)))
 93560  			crt.X__builtin_abort(tls)
 93561  		}
 93562  	}()
 93563  	_db = (*Xsqlite3)(_pParse.Xdb)
 93564  	func() {
 93565  		if _db == nil {
 93566  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103645), unsafe.Pointer(&_sqlite3BeginTransactionØ00__func__Ø000), unsafe.Pointer(str(1219)))
 93567  			crt.X__builtin_abort(tls)
 93568  		}
 93569  	}()
 93570  	if _sqlite3AuthCheck(tls, _pParse, int32(22), str(24938), nil, nil) != 0 {
 93571  		return
 93572  	}
 93573  	_v = _sqlite3GetVdbe(tls, _pParse)
 93574  	if _v == nil {
 93575  		return
 93576  	}
 93577  	if _type == int32(7) {
 93578  		goto _6
 93579  	}
 93580  	_i = int32(0)
 93581  _7:
 93582  	if _i >= _db.XnDb {
 93583  		goto _10
 93584  	}
 93585  	_sqlite3VdbeAddOp2(tls, _v, int32(2), _i, bool2int(_type == int32(9))+int32(1))
 93586  	_sqlite3VdbeUsesBtree(tls, _v, _i)
 93587  	_i += 1
 93588  	goto _7
 93589  _10:
 93590  _6:
 93591  	_sqlite3VdbeAddOp0(tls, _v, int32(1))
 93592  }
 93593  
 93594  var _sqlite3BeginTransactionØ00__func__Ø000 [24]int8
 93595  
 93596  func init() {
 93597  	crt.Xstrncpy(nil, &_sqlite3BeginTransactionØ00__func__Ø000[0], str(111258), 24)
 93598  }
 93599  
 93600  // C comment
 93601  //  /*
 93602  //  ** Generate VDBE code for a COMMIT statement.
 93603  //  */
 93604  func _sqlite3CommitTransaction(tls *crt.TLS, _pParse *XParse) {
 93605  	var _v *TVdbe
 93606  	func() {
 93607  		if _pParse == nil {
 93608  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103666), unsafe.Pointer(&_sqlite3CommitTransactionØ00__func__Ø000), unsafe.Pointer(str(110917)))
 93609  			crt.X__builtin_abort(tls)
 93610  		}
 93611  	}()
 93612  	func() {
 93613  		if (*Xsqlite3)(_pParse.Xdb) == nil {
 93614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103667), unsafe.Pointer(&_sqlite3CommitTransactionØ00__func__Ø000), unsafe.Pointer(str(111282)))
 93615  			crt.X__builtin_abort(tls)
 93616  		}
 93617  	}()
 93618  	if _sqlite3AuthCheck(tls, _pParse, int32(22), str(24985), nil, nil) != 0 {
 93619  		return
 93620  	}
 93621  	_v = _sqlite3GetVdbe(tls, _pParse)
 93622  	if _v != nil {
 93623  		_sqlite3VdbeAddOp1(tls, _v, int32(1), int32(1))
 93624  	}
 93625  }
 93626  
 93627  var _sqlite3CommitTransactionØ00__func__Ø000 [25]int8
 93628  
 93629  func init() {
 93630  	crt.Xstrncpy(nil, &_sqlite3CommitTransactionØ00__func__Ø000[0], str(111296), 25)
 93631  }
 93632  
 93633  // C comment
 93634  //  /*
 93635  //  ** Generate VDBE code for a ROLLBACK statement.
 93636  //  */
 93637  func _sqlite3RollbackTransaction(tls *crt.TLS, _pParse *XParse) {
 93638  	var _v *TVdbe
 93639  	func() {
 93640  		if _pParse == nil {
 93641  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103683), unsafe.Pointer(&_sqlite3RollbackTransactionØ00__func__Ø000), unsafe.Pointer(str(110917)))
 93642  			crt.X__builtin_abort(tls)
 93643  		}
 93644  	}()
 93645  	func() {
 93646  		if (*Xsqlite3)(_pParse.Xdb) == nil {
 93647  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103684), unsafe.Pointer(&_sqlite3RollbackTransactionØ00__func__Ø000), unsafe.Pointer(str(111282)))
 93648  			crt.X__builtin_abort(tls)
 93649  		}
 93650  	}()
 93651  	if _sqlite3AuthCheck(tls, _pParse, int32(22), str(24996), nil, nil) != 0 {
 93652  		return
 93653  	}
 93654  	_v = _sqlite3GetVdbe(tls, _pParse)
 93655  	if _v != nil {
 93656  		_sqlite3VdbeAddOp2(tls, _v, int32(1), int32(1), int32(1))
 93657  	}
 93658  }
 93659  
 93660  var _sqlite3RollbackTransactionØ00__func__Ø000 [27]int8
 93661  
 93662  func init() {
 93663  	crt.Xstrncpy(nil, &_sqlite3RollbackTransactionØ00__func__Ø000[0], str(111321), 27)
 93664  }
 93665  
 93666  // C comment
 93667  //  /*
 93668  //  ** This function is called by the parser when it parses a command to create,
 93669  //  ** release or rollback an SQL savepoint.
 93670  //  */
 93671  func _sqlite3Savepoint(tls *crt.TLS, _pParse *XParse, _op int32, _pName *XToken) {
 93672  	var _zName *int8
 93673  	var _1_v *TVdbe
 93674  	_zName = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.Xdb), _pName)
 93675  	if _zName == nil {
 93676  		goto _0
 93677  	}
 93678  	_1_v = _sqlite3GetVdbe(tls, _pParse)
 93679  
 93680  	if (_1_v == nil) || _sqlite3AuthCheck(tls, _pParse, int32(32), *elem0((**int8)(unsafe.Pointer(&_sqlite3SavepointØ00azØ001)), uintptr(_op)), _zName, nil) != 0 {
 93681  		_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_zName))
 93682  		return
 93683  	}
 93684  	_sqlite3VdbeAddOp4(tls, _1_v, int32(0), _op, int32(0), int32(0), _zName, int32(-1))
 93685  _0:
 93686  }
 93687  
 93688  var _sqlite3SavepointØ00azØ001 [3]*int8
 93689  
 93690  func init() {
 93691  	_sqlite3SavepointØ00azØ001 = [3]*int8{str(24938), str(25015), str(24996)}
 93692  }
 93693  
 93694  // C comment
 93695  //  /*
 93696  //  ** Begin constructing a new table representation in memory.  This is
 93697  //  ** the first of several action routines that get called in response
 93698  //  ** to a CREATE TABLE statement.  In particular, this routine is called
 93699  //  ** after seeing tokens "CREATE" and "TABLE" and the table name. The isTemp
 93700  //  ** flag is true if the table should be stored in the auxiliary database
 93701  //  ** file instead of in the main database file.  This is normally the case
 93702  //  ** when the "TEMP" or "TEMPORARY" keyword occurs in between
 93703  //  ** CREATE and TABLE.
 93704  //  **
 93705  //  ** The new table record is initialized and put in pParse->pNewTable.
 93706  //  ** As more of the CREATE TABLE statement is parsed, additional action
 93707  //  ** routines will be called to add more information to this record.
 93708  //  ** At the end of the CREATE TABLE statement, the sqlite3EndTable() routine
 93709  //  ** is called to complete the construction of the new table record.
 93710  //  */
 93711  func _sqlite3StartTable(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _isTemp int32, _isView int32, _isVirtual int32, _noErr int32) {
 93712  	var _iDb, _16_addr1, _16_fileFormat, _16_reg1, _16_reg2, _16_reg3 int32
 93713  	var _zName, _5_zDb, _8_zDb *int8
 93714  	var _db *Xsqlite3
 93715  	var _pTable *XTable
 93716  	var _v *TVdbe
 93717  	var _pName *XToken
 93718  	_zName = nil
 93719  	_db = (*Xsqlite3)(_pParse.Xdb)
 93720  	if ((_db.Xinit.Xbusy) != 0) && ((_db.Xinit.XnewTnum) == int32(1)) {
 93721  		_iDb = int32(_db.Xinit.XiDb)
 93722  		_zName = _sqlite3DbStrDup(tls, _db, func() *int8 {
 93723  			if int32(1) != 0 && (_iDb == int32(1)) {
 93724  				return str(49962)
 93725  			}
 93726  			return str(49981)
 93727  		}())
 93728  		_pName = _pName1
 93729  		goto _5
 93730  	}
 93731  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
 93732  	if _iDb < int32(0) {
 93733  		return
 93734  	}
 93735  	if ((int32(1) != 0 && _isTemp != 0) && (_pName2.Xn > (0))) && (_iDb != int32(1)) {
 93736  		_sqlite3ErrorMsg(tls, _pParse, str(111348))
 93737  		return
 93738  	}
 93739  	if int32(1) != 0 && _isTemp != 0 {
 93740  		_iDb = int32(1)
 93741  	}
 93742  	_zName = _sqlite3NameFromToken(tls, _db, _pName)
 93743  _5:
 93744  	_pParse.XsNameToken = *_pName
 93745  	if _zName == nil {
 93746  		return
 93747  	}
 93748  	if int32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) {
 93749  		goto _begin_table_error
 93750  	}
 93751  	if int32(_db.Xinit.XiDb) == int32(1) {
 93752  		_isTemp = int32(1)
 93753  	}
 93754  	func() {
 93755  		if _isTemp != int32(0) && _isTemp != int32(1) {
 93756  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100579), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(111389)))
 93757  			crt.X__builtin_abort(tls)
 93758  		}
 93759  	}()
 93760  	func() {
 93761  		if _isView != int32(0) && _isView != int32(1) {
 93762  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100580), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(111412)))
 93763  			crt.X__builtin_abort(tls)
 93764  		}
 93765  	}()
 93766  	_5_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 93767  	if _sqlite3AuthCheck(tls, _pParse, int32(18), func() *int8 {
 93768  		if int32(1) != 0 && (_isTemp == int32(1)) {
 93769  			return str(49962)
 93770  		}
 93771  		return str(49981)
 93772  	}(), nil, _5_zDb) != 0 {
 93773  		goto _begin_table_error
 93774  	}
 93775  	if (_isVirtual == 0) && _sqlite3AuthCheck(tls, _pParse, int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3StartTableØ00aCodeØ001)), uintptr(_isTemp+(int32(2)*_isView)))), _zName, nil, _5_zDb) != 0 {
 93776  		goto _begin_table_error
 93777  	}
 93778  	if _pParse.XdeclareVtab != 0 {
 93779  		goto _28
 93780  	}
 93781  	_8_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 93782  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
 93783  		goto _begin_table_error
 93784  	}
 93785  	_pTable = _sqlite3FindTable(tls, _db, _zName, _8_zDb)
 93786  	if _pTable == nil {
 93787  		goto _30
 93788  	}
 93789  	if _noErr == 0 {
 93790  		_sqlite3ErrorMsg(tls, _pParse, str(111435), unsafe.Pointer(_pName))
 93791  		goto _32
 93792  	}
 93793  	func() {
 93794  		if (_db.Xinit.Xbusy) != 0 && _sqlite3Config.XneverCorrupt != int32(0) {
 93795  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100616), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(111459)))
 93796  			crt.X__builtin_abort(tls)
 93797  		}
 93798  	}()
 93799  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
 93800  _32:
 93801  	goto _begin_table_error
 93802  _30:
 93803  	if _sqlite3FindIndex(tls, _db, _zName, _8_zDb) != nil {
 93804  		_sqlite3ErrorMsg(tls, _pParse, str(111488), unsafe.Pointer(_zName))
 93805  		goto _begin_table_error
 93806  	}
 93807  _28:
 93808  	_pTable = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(128)))
 93809  	if _pTable == nil {
 93810  		func() {
 93811  			if _db.XmallocFailed == 0 {
 93812  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100629), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(47803)))
 93813  				crt.X__builtin_abort(tls)
 93814  			}
 93815  		}()
 93816  		_pParse.Xrc = _sqlite3NomemError(tls, int32(100630))
 93817  		_pParse.XnErr += 1
 93818  		goto _begin_table_error
 93819  	}
 93820  	_pTable.XzName = _zName
 93821  	_pTable.XiPKey = int16(-1)
 93822  	*(**XSchema)(unsafe.Pointer(&_pTable.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
 93823  	_pTable.XnTabRef = uint32(1)
 93824  	_pTable.XnRowLogEst = int16(200)
 93825  	func() {
 93826  		if int32(200) != int32(_sqlite3LogEst(tls, uint64(1048576))) {
 93827  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100638), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(48082)))
 93828  			crt.X__builtin_abort(tls)
 93829  		}
 93830  	}()
 93831  	func() {
 93832  		if (*XTable)(_pParse.XpNewTable) != nil {
 93833  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100639), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(24589)))
 93834  			crt.X__builtin_abort(tls)
 93835  		}
 93836  	}()
 93837  	*(**XTable)(unsafe.Pointer(&_pParse.XpNewTable)) = _pTable
 93838  	if (_pParse.Xnested == 0) && (crt.Xstrcmp(tls, _zName, str(111523)) == int32(0)) {
 93839  		func() {
 93840  			if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 93841  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100648), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(51126)))
 93842  				crt.X__builtin_abort(tls)
 93843  			}
 93844  		}()
 93845  		*(**XTable)(unsafe.Pointer(&((*XSchema)(_pTable.XpSchema).XpSeqTab))) = _pTable
 93846  	}
 93847  	if (_db.Xinit.Xbusy) != 0 || store62(&_v, _sqlite3GetVdbe(tls, _pParse)) == nil {
 93848  		goto _49
 93849  	}
 93850  	_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
 93851  	if _isVirtual != 0 {
 93852  		_sqlite3VdbeAddOp0(tls, _v, int32(155))
 93853  	}
 93854  	_16_reg1 = store2(&_pParse.XregRowid, preInc2(&_pParse.XnMem, 1))
 93855  	_16_reg2 = store2(&_pParse.XregRoot, preInc2(&_pParse.XnMem, 1))
 93856  	_16_reg3 = preInc2(&_pParse.XnMem, 1)
 93857  	_sqlite3VdbeAddOp3(tls, _v, int32(103), _iDb, _16_reg3, int32(2))
 93858  	_sqlite3VdbeUsesBtree(tls, _v, _iDb)
 93859  	_16_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(21), _16_reg3)
 93860  	_16_fileFormat = func() int32 {
 93861  		if (_db.Xflags & int32(32768)) != int32(0) {
 93862  			return int32(1)
 93863  		}
 93864  		return int32(4)
 93865  	}()
 93866  	_sqlite3VdbeAddOp3(tls, _v, int32(104), _iDb, int32(2), _16_fileFormat)
 93867  	_sqlite3VdbeAddOp3(tls, _v, int32(104), _iDb, int32(5), int32(_db.Xenc))
 93868  	_sqlite3VdbeJumpHere(tls, _v, _16_addr1)
 93869  	if _isView != 0 || _isVirtual != 0 {
 93870  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _16_reg2)
 93871  		goto _55
 93872  	}
 93873  	_pParse.XaddrCrTab = _sqlite3VdbeAddOp2(tls, _v, int32(137), _iDb, _16_reg2)
 93874  _55:
 93875  	_sqlite3OpenMasterTable(tls, _pParse, _iDb)
 93876  	_sqlite3VdbeAddOp2(tls, _v, int32(117), int32(0), _16_reg1)
 93877  	_sqlite3VdbeAddOp4(tls, _v, int32(61), int32(6), _16_reg3, int32(0), (*int8)(unsafe.Pointer(&_sqlite3StartTableØ00nullRowØ002)), int32(-2))
 93878  	_sqlite3VdbeAddOp3(tls, _v, int32(118), int32(0), _16_reg3, _16_reg1)
 93879  	_sqlite3VdbeChangeP5(tls, _v, uint16(8))
 93880  	_sqlite3VdbeAddOp0(tls, _v, int32(114))
 93881  _49:
 93882  	return
 93883  _begin_table_error:
 93884  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
 93885  }
 93886  
 93887  // C comment
 93888  //  /* The table or view or trigger name is passed to this routine via tokens
 93889  //  ** pName1 and pName2. If the table name was fully qualified, for example:
 93890  //  **
 93891  //  ** CREATE TABLE xxx.yyy (...);
 93892  //  **
 93893  //  ** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if
 93894  //  ** the table name is not fully qualified, i.e.:
 93895  //  **
 93896  //  ** CREATE TABLE yyy(...);
 93897  //  **
 93898  //  ** Then pName1 is set to "yyy" and pName2 is "".
 93899  //  **
 93900  //  ** This routine sets the *ppUnqual pointer to point at the token (pName1 or
 93901  //  ** pName2) that stores the unqualified table name.  The index of the
 93902  //  ** database "xxx" is returned.
 93903  //  */
 93904  func _sqlite3TwoPartName(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pUnqual **XToken) (r0 int32) {
 93905  	var _iDb int32
 93906  	var _db *Xsqlite3
 93907  	_db = (*Xsqlite3)(_pParse.Xdb)
 93908  	func() {
 93909  		if _pName2 == nil {
 93910  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100464), unsafe.Pointer(&_sqlite3TwoPartNameØ00__func__Ø000), unsafe.Pointer(str(111539)))
 93911  			crt.X__builtin_abort(tls)
 93912  		}
 93913  	}()
 93914  	if _pName2.Xn <= (0) {
 93915  		goto _2
 93916  	}
 93917  	if (_db.Xinit.Xbusy) != 0 {
 93918  		_sqlite3ErrorMsg(tls, _pParse, str(111549))
 93919  		return int32(-1)
 93920  	}
 93921  	*_pUnqual = _pName2
 93922  	_iDb = _sqlite3FindDb(tls, _db, _pName1)
 93923  	if _iDb < int32(0) {
 93924  		_sqlite3ErrorMsg(tls, _pParse, str(111566), unsafe.Pointer(_pName1))
 93925  		return int32(-1)
 93926  	}
 93927  	goto _5
 93928  _2:
 93929  	func() {
 93930  		if int32(_db.Xinit.XiDb) != int32(0) && (_db.Xinit.Xbusy) == 0 && (_db.Xflags&int32(268435456)) == int32(0) {
 93931  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100477), unsafe.Pointer(&_sqlite3TwoPartNameØ00__func__Ø000), unsafe.Pointer(str(111586)))
 93932  			crt.X__builtin_abort(tls)
 93933  		}
 93934  	}()
 93935  	_iDb = int32(_db.Xinit.XiDb)
 93936  	*_pUnqual = _pName1
 93937  _5:
 93938  	return _iDb
 93939  }
 93940  
 93941  var _sqlite3TwoPartNameØ00__func__Ø000 [19]int8
 93942  
 93943  func init() {
 93944  	crt.Xstrncpy(nil, &_sqlite3TwoPartNameØ00__func__Ø000[0], str(111653), 19)
 93945  }
 93946  
 93947  // C comment
 93948  //  /*
 93949  //  ** The token *pName contains the name of a database (either "main" or
 93950  //  ** "temp" or the name of an attached db). This routine returns the
 93951  //  ** index of the named database in db->aDb[], or -1 if the named db
 93952  //  ** does not exist.
 93953  //  */
 93954  func _sqlite3FindDb(tls *crt.TLS, _db *Xsqlite3, _pName *XToken) (r0 int32) {
 93955  	var _i int32
 93956  	var _zName *int8
 93957  	_zName = _sqlite3NameFromToken(tls, _db, _pName)
 93958  	_i = _sqlite3FindDbName(tls, _db, _zName)
 93959  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
 93960  	return _i
 93961  }
 93962  
 93963  // C comment
 93964  //  /*
 93965  //  ** This routine is used to check if the UTF-8 string zName is a legal
 93966  //  ** unqualified name for a new schema object (table, index, view or
 93967  //  ** trigger). All names are legal except those that begin with the string
 93968  //  ** "sqlite_" (in upper, lower or mixed case). This portion of the namespace
 93969  //  ** is reserved for internal use.
 93970  //  */
 93971  func _sqlite3CheckObjectName(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 int32) {
 93972  	if ((((((*Xsqlite3)(_pParse.Xdb).Xinit).Xbusy) == 0) && (int32(_pParse.Xnested) == int32(0))) && ((((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(2048)) == int32(0))) && (int32(0) == Xsqlite3_strnicmp(tls, _zName, str(111672), int32(7))) {
 93973  		_sqlite3ErrorMsg(tls, _pParse, str(111680), unsafe.Pointer(_zName))
 93974  		return int32(1)
 93975  	}
 93976  	return int32(0)
 93977  }
 93978  
 93979  var _sqlite3StartTableØ00__func__Ø000 [18]int8
 93980  
 93981  func init() {
 93982  	crt.Xstrncpy(nil, &_sqlite3StartTableØ00__func__Ø000[0], str(111722), 18)
 93983  }
 93984  
 93985  var _sqlite3StartTableØ00aCodeØ001 [4]uint8
 93986  
 93987  func init() {
 93988  	_sqlite3StartTableØ00aCodeØ001 = [4]uint8{2, 4, 8, 6}
 93989  }
 93990  
 93991  // C comment
 93992  //  /*
 93993  //  ** Generate VDBE code that prepares for doing an operation that
 93994  //  ** might change the database.
 93995  //  **
 93996  //  ** This routine starts a new transaction if we are not already within
 93997  //  ** a transaction.  If we are already within a transaction, then a checkpoint
 93998  //  ** is set if the setStatement parameter is true.  A checkpoint should
 93999  //  ** be set for operations that might fail (due to a constraint) part of
 94000  //  ** the way through and which will need to undo some writes without having to
 94001  //  ** rollback the whole transaction.  For operations where all constraints
 94002  //  ** can be checked before any changes are made to the database, it is never
 94003  //  ** necessary to undo a write and the checkpoint should not be set.
 94004  //  */
 94005  func _sqlite3BeginWriteOperation(tls *crt.TLS, _pParse *XParse, _setStatement int32, _iDb int32) {
 94006  	var _pToplevel *XParse
 94007  	_pToplevel = func() *XParse {
 94008  		if _pParse.XpToplevel != nil {
 94009  			return (*XParse)(_pParse.XpToplevel)
 94010  		}
 94011  		return _pParse
 94012  	}()
 94013  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
 94014  	_pToplevel.XwriteMask |= uint32(1) << uint(_iDb)
 94015  	{
 94016  		p := &_pToplevel.XisMultiWrite
 94017  		*p = uint8(int32(*p) | _setStatement)
 94018  	}
 94019  }
 94020  
 94021  // C comment
 94022  //  /*
 94023  //  ** Open the sqlite_master table stored in database number iDb for
 94024  //  ** writing. The table is opened using cursor 0.
 94025  //  */
 94026  func _sqlite3OpenMasterTable(tls *crt.TLS, _p *XParse, _iDb int32) {
 94027  	var _v *TVdbe
 94028  	_v = _sqlite3GetVdbe(tls, _p)
 94029  	_sqlite3TableLock(tls, _p, _iDb, int32(1), uint8(1), str(49981))
 94030  	_sqlite3VdbeAddOp4Int(tls, _v, int32(107), int32(0), int32(1), _iDb, int32(5))
 94031  	if _p.XnTab == int32(0) {
 94032  		_p.XnTab = int32(1)
 94033  	}
 94034  }
 94035  
 94036  var _sqlite3StartTableØ00nullRowØ002 [6]int8
 94037  
 94038  func init() {
 94039  	_sqlite3StartTableØ00nullRowØ002 = [6]int8{6, 0, 0, 0, 0, 0}
 94040  }
 94041  
 94042  // C comment
 94043  //  /*
 94044  //  ** Disable lookaside memory allocation for objects that might be
 94045  //  ** shared across database connections.
 94046  //  */
 94047  func _disableLookaside(tls *crt.TLS, _pParse *XParse) {
 94048  	_pParse.XdisableLookaside += 1
 94049  	((*Xsqlite3)(_pParse.Xdb).Xlookaside).XbDisable += 1
 94050  }
 94051  
 94052  // C comment
 94053  //  /*
 94054  //  ** This routine is called to report the final ")" that terminates
 94055  //  ** a CREATE TABLE statement.
 94056  //  **
 94057  //  ** The table structure that other action routines have been building
 94058  //  ** is added to the internal hash tables, assuming no errors have
 94059  //  ** occurred.
 94060  //  **
 94061  //  ** An entry for the table is made in the master table on disk, unless
 94062  //  ** this is a temporary table or db->init.busy==1.  When db->init.busy==1
 94063  //  ** it means we are reading the sqlite_master table because we just
 94064  //  ** connected to the database or because the sqlite_master table has
 94065  //  ** recently changed, so the entry for this table already exists in
 94066  //  ** the sqlite_master table.  We do not want to create it again.
 94067  //  **
 94068  //  ** If the pSelect argument is not NULL, it means that this routine
 94069  //  ** was called to create a table generated from a
 94070  //  ** "CREATE TABLE ... AS SELECT ..." statement.  The column names of
 94071  //  ** the new table will match the result set of the SELECT.
 94072  //  */
 94073  func _sqlite3EndTable(tls *crt.TLS, _pParse *XParse, _pCons *XToken, _pEnd *XToken, _tabOpts uint8, _pSelect *XSelect) {
 94074  	var _iDb, _9_n, _12_regYield, _12_addrTop, _12_regRec, _12_regRowid, _12_addrInsLoop, _19_nName int32
 94075  	var _9_zType, _9_zType2, _9_zStmt, _19_zName *int8
 94076  	var _db *Xsqlite3
 94077  	var _15_pDb *XDb
 94078  	var _17_pSchema *XSchema
 94079  	var _p, _12_pSelTab, _17_pOld *XTable
 94080  	var _9_v *TVdbe
 94081  	var _14_pEnd2 *XToken
 94082  	var _pIdx *XIndex
 94083  	var _12_dest XSelectDest
 94084  	_db = (*Xsqlite3)(_pParse.Xdb)
 94085  	if (_pEnd == nil) && (_pSelect == nil) {
 94086  		return
 94087  	}
 94088  	func() {
 94089  		if _db.XmallocFailed != 0 {
 94090  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101544), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(23824)))
 94091  			crt.X__builtin_abort(tls)
 94092  		}
 94093  	}()
 94094  	_p = (*XTable)(_pParse.XpNewTable)
 94095  	if _p == nil {
 94096  		return
 94097  	}
 94098  	func() {
 94099  		if (_db.Xinit.Xbusy) != 0 && _pSelect != nil {
 94100  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101548), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(111740)))
 94101  			crt.X__builtin_abort(tls)
 94102  		}
 94103  	}()
 94104  	if (_db.Xinit.Xbusy) == 0 {
 94105  		goto _8
 94106  	}
 94107  	_p.Xtnum = _db.Xinit.XnewTnum
 94108  	if _p.Xtnum == int32(1) {
 94109  		_p.XtabFlags |= uint32(1)
 94110  	}
 94111  _8:
 94112  	if (int32(_tabOpts) & int32(32)) == 0 {
 94113  		goto _10
 94114  	}
 94115  	if (_p.XtabFlags & uint32(8)) != 0 {
 94116  		_sqlite3ErrorMsg(tls, _pParse, str(111767))
 94117  		return
 94118  	}
 94119  	if (_p.XtabFlags & uint32(4)) == (0) {
 94120  		_sqlite3ErrorMsg(tls, _pParse, str(111817), unsafe.Pointer(_p.XzName))
 94121  		goto _13
 94122  	}
 94123  	_p.XtabFlags |= uint32(96)
 94124  	_convertToWithoutRowidTable(tls, _pParse, _p)
 94125  _13:
 94126  _10:
 94127  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_p.XpSchema))
 94128  	if _p.XpCheck != nil {
 94129  		_sqlite3ResolveSelfReference(tls, _pParse, _p, int32(4), nil, (*XExprList)(_p.XpCheck))
 94130  	}
 94131  	_estimateTableWidth(tls, _p)
 94132  	_pIdx = (*XIndex)(_p.XpIndex)
 94133  _15:
 94134  	if _pIdx == nil {
 94135  		goto _18
 94136  	}
 94137  	_estimateIndexWidth(tls, _pIdx)
 94138  	_pIdx = (*XIndex)(_pIdx.XpNext)
 94139  	goto _15
 94140  _18:
 94141  	if (_db.Xinit.Xbusy) != 0 {
 94142  		goto _19
 94143  	}
 94144  	_9_v = _sqlite3GetVdbe(tls, _pParse)
 94145  	if func() int32 {
 94146  		if _9_v == nil {
 94147  			return func() int32 {
 94148  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101609), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(4809)))
 94149  				crt.X__builtin_abort(tls)
 94150  				return int32(1)
 94151  			}()
 94152  		}
 94153  		return int32(0)
 94154  	}() != 0 {
 94155  		return
 94156  	}
 94157  	_sqlite3VdbeAddOp1(tls, _9_v, int32(114), int32(0))
 94158  	if (*XSelect)(_p.XpSelect) == nil {
 94159  		_9_zType = str(93816)
 94160  		_9_zType2 = str(25026)
 94161  		goto _24
 94162  	}
 94163  	_9_zType = str(111849)
 94164  	_9_zType2 = str(25313)
 94165  _24:
 94166  	if _pSelect == nil {
 94167  		goto _25
 94168  	}
 94169  	_12_regYield = preInc2(&_pParse.XnMem, 1)
 94170  	_12_regRec = preInc2(&_pParse.XnMem, 1)
 94171  	_12_regRowid = preInc2(&_pParse.XnMem, 1)
 94172  	func() {
 94173  		if _pParse.XnTab != int32(1) {
 94174  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101653), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(111854)))
 94175  			crt.X__builtin_abort(tls)
 94176  		}
 94177  	}()
 94178  	_sqlite3MayAbort(tls, _pParse)
 94179  	_sqlite3VdbeAddOp3(tls, _9_v, int32(107), int32(1), _pParse.XregRoot, _iDb)
 94180  	_sqlite3VdbeChangeP5(tls, _9_v, uint16(16))
 94181  	_pParse.XnTab = int32(2)
 94182  	_12_addrTop = _sqlite3VdbeCurrentAddr(tls, _9_v) + int32(1)
 94183  	_sqlite3VdbeAddOp3(tls, _9_v, int32(15), _12_regYield, int32(0), _12_addrTop)
 94184  	_sqlite3SelectDestInit(tls, &_12_dest, int32(13), _12_regYield)
 94185  	_sqlite3Select(tls, _pParse, _pSelect, &_12_dest)
 94186  	_sqlite3VdbeEndCoroutine(tls, _9_v, _12_regYield)
 94187  	_sqlite3VdbeJumpHere(tls, _9_v, _12_addrTop-int32(1))
 94188  	if _pParse.XnErr != 0 {
 94189  		return
 94190  	}
 94191  	_12_pSelTab = _sqlite3ResultSetOfSelect(tls, _pParse, _pSelect)
 94192  	if _12_pSelTab == nil {
 94193  		return
 94194  	}
 94195  	func() {
 94196  		if (*XColumn)(_p.XaCol) != nil {
 94197  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101667), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(111870)))
 94198  			crt.X__builtin_abort(tls)
 94199  		}
 94200  	}()
 94201  	_p.XnCol = _12_pSelTab.XnCol
 94202  	*(**XColumn)(unsafe.Pointer(&_p.XaCol)) = (*XColumn)(_12_pSelTab.XaCol)
 94203  	_12_pSelTab.XnCol = 0
 94204  	*(**XColumn)(unsafe.Pointer(&_12_pSelTab.XaCol)) = nil
 94205  	_sqlite3DeleteTable(tls, _db, _12_pSelTab)
 94206  	_12_addrInsLoop = _sqlite3VdbeAddOp1(tls, _9_v, int32(16), _12_dest.XiSDParm)
 94207  	_sqlite3VdbeAddOp3(tls, _9_v, int32(101), _12_dest.XiSdst, _12_dest.XnSdst, _12_regRec)
 94208  	_sqlite3TableAffinity(tls, _9_v, _p, int32(0))
 94209  	_sqlite3VdbeAddOp2(tls, _9_v, int32(117), int32(1), _12_regRowid)
 94210  	_sqlite3VdbeAddOp3(tls, _9_v, int32(118), int32(1), _12_regRec, _12_regRowid)
 94211  	_sqlite3VdbeGoto(tls, _9_v, _12_addrInsLoop)
 94212  	_sqlite3VdbeJumpHere(tls, _9_v, _12_addrInsLoop)
 94213  	_sqlite3VdbeAddOp1(tls, _9_v, int32(114), int32(1))
 94214  _25:
 94215  	if _pSelect != nil {
 94216  		_9_zStmt = _createTableStmt(tls, _db, _p)
 94217  		goto _33
 94218  	}
 94219  	_14_pEnd2 = func() *XToken {
 94220  		if _tabOpts != 0 {
 94221  			return &_pParse.XsLastToken
 94222  		}
 94223  		return _pEnd
 94224  	}()
 94225  	_9_n = int32(int64(uintptr(unsafe.Pointer(_14_pEnd2.Xz)) - uintptr(unsafe.Pointer(_pParse.XsNameToken.Xz))))
 94226  	if int32(*elem1(_14_pEnd2.Xz, 0)) != int32(59) {
 94227  		{
 94228  			p := &_9_n
 94229  			*p = int32(uint32(*p) + _14_pEnd2.Xn)
 94230  		}
 94231  	}
 94232  	_9_zStmt = _sqlite3MPrintf(tls, _db, str(111881), unsafe.Pointer(_9_zType2), _9_n, unsafe.Pointer(_pParse.XsNameToken.Xz))
 94233  _33:
 94234  	_sqlite3NestedParse(tls, _pParse, str(111896), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(str(49981)), unsafe.Pointer(_9_zType), unsafe.Pointer(_p.XzName), unsafe.Pointer(_p.XzName), _pParse.XregRoot, unsafe.Pointer(_9_zStmt), _pParse.XregRowid)
 94235  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_9_zStmt))
 94236  	_sqlite3ChangeCookie(tls, _pParse, _iDb)
 94237  	if (_p.XtabFlags & uint32(8)) == (0) {
 94238  		goto _37
 94239  	}
 94240  	_15_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 94241  	func() {
 94242  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 94243  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101721), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(51126)))
 94244  			crt.X__builtin_abort(tls)
 94245  		}
 94246  	}()
 94247  	if (*XTable)((*XSchema)(_15_pDb.XpSchema).XpSeqTab) == nil {
 94248  		_sqlite3NestedParse(tls, _pParse, str(111983), unsafe.Pointer(_15_pDb.XzDbSName))
 94249  	}
 94250  _37:
 94251  	_sqlite3VdbeAddParseSchemaOp(tls, _9_v, _iDb, _sqlite3MPrintf(tls, _db, str(112025), unsafe.Pointer(_p.XzName)))
 94252  _19:
 94253  	if (_db.Xinit.Xbusy) == 0 {
 94254  		goto _41
 94255  	}
 94256  	_17_pSchema = (*XSchema)(_p.XpSchema)
 94257  	func() {
 94258  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 94259  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101742), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(51126)))
 94260  			crt.X__builtin_abort(tls)
 94261  		}
 94262  	}()
 94263  	_17_pOld = (*XTable)(_sqlite3HashInsert(tls, &_17_pSchema.XtblHash, _p.XzName, unsafe.Pointer(_p)))
 94264  	if _17_pOld != nil {
 94265  		func() {
 94266  			if _p != _17_pOld {
 94267  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101745), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(112059)))
 94268  				crt.X__builtin_abort(tls)
 94269  			}
 94270  		}()
 94271  		_sqlite3OomFault(tls, _db)
 94272  		return
 94273  	}
 94274  	*(**XTable)(unsafe.Pointer(&_pParse.XpNewTable)) = nil
 94275  	_db.Xflags |= int32(2)
 94276  	if _p.XpSelect != nil {
 94277  		goto _47
 94278  	}
 94279  	_19_zName = _pParse.XsNameToken.Xz
 94280  	func() {
 94281  		if _pSelect != nil || _pCons == nil || _pEnd == nil {
 94282  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101756), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(112067)))
 94283  			crt.X__builtin_abort(tls)
 94284  		}
 94285  	}()
 94286  	if _pCons.Xz == nil {
 94287  		_pCons = _pEnd
 94288  	}
 94289  	_19_nName = int32(int64(uintptr(unsafe.Pointer(_pCons.Xz)) - uintptr(unsafe.Pointer(_19_zName))))
 94290  	_p.XaddColOffset = int32(13) + _sqlite3Utf8CharLen(tls, _19_zName, _19_nName)
 94291  _47:
 94292  _41:
 94293  }
 94294  
 94295  var _sqlite3EndTableØ00__func__Ø000 [16]int8
 94296  
 94297  func init() {
 94298  	crt.Xstrncpy(nil, &_sqlite3EndTableØ00__func__Ø000[0], str(112093), 16)
 94299  }
 94300  
 94301  // C comment
 94302  //  /*
 94303  //  ** This routine runs at the end of parsing a CREATE TABLE statement that
 94304  //  ** has a WITHOUT ROWID clause.  The job of this routine is to convert both
 94305  //  ** internal schema data structures and the generated VDBE code so that they
 94306  //  ** are appropriate for a WITHOUT ROWID table instead of a rowid table.
 94307  //  ** Changes include:
 94308  //  **
 94309  //  **     (1)  Set all columns of the PRIMARY KEY schema object to be NOT NULL.
 94310  //  **     (2)  Convert the OP_CreateTable into an OP_CreateIndex.  There is
 94311  //  **          no rowid btree for a WITHOUT ROWID.  Instead, the canonical
 94312  //  **          data storage is a covering index btree.
 94313  //  **     (3)  Bypass the creation of the sqlite_master table entry
 94314  //  **          for the PRIMARY KEY as the primary key index is now
 94315  //  **          identified by the sqlite_master table entry of the table itself.
 94316  //  **     (4)  Set the Index.tnum of the PRIMARY KEY Index object in the
 94317  //  **          schema to the rootpage from the main table.
 94318  //  **     (5)  Add all table columns to the PRIMARY KEY Index object
 94319  //  **          so that the PRIMARY KEY is a covering index.  The surplus
 94320  //  **          columns are part of KeyInfo.nXField and are not used for
 94321  //  **          sorting or lookup or uniqueness checks.
 94322  //  **     (6)  Replace the rowid tail on all automatically generated UNIQUE
 94323  //  **          indices with the PRIMARY KEY columns.
 94324  //  **
 94325  //  ** For virtual tables, only (1) is performed.
 94326  //  */
 94327  func _convertToWithoutRowidTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) {
 94328  	var _nPk, _i, _j, _11_n int32
 94329  	var _5_ipkToken XToken
 94330  	var _db *Xsqlite3
 94331  	var _v *TVdbe
 94332  	var _5_pList *XExprList
 94333  	var _pIdx, _pPk *XIndex
 94334  	_db = (*Xsqlite3)(_pParse.Xdb)
 94335  	_v = (*TVdbe)(_pParse.XpVdbe)
 94336  	if (_db.Xinit.XimposterTable) != 0 {
 94337  		goto _0
 94338  	}
 94339  	_i = int32(0)
 94340  _1:
 94341  	if _i >= int32(_pTab.XnCol) {
 94342  		goto _4
 94343  	}
 94344  	if (int32(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XcolFlags) & int32(1)) != int32(0) {
 94345  		elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XnotNull = uint8(2)
 94346  	}
 94347  	_i += 1
 94348  	goto _1
 94349  _4:
 94350  _0:
 94351  	if _pParse.XdeclareVtab != 0 {
 94352  		return
 94353  	}
 94354  	if _pParse.XaddrCrTab != 0 {
 94355  		func() {
 94356  			if _v == nil {
 94357  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101409), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(41816)))
 94358  				crt.X__builtin_abort(tls)
 94359  			}
 94360  		}()
 94361  		_sqlite3VdbeChangeOpcode(tls, _v, uint32(_pParse.XaddrCrTab), uint8(136))
 94362  	}
 94363  	if int32(_pTab.XiPKey) < int32(0) {
 94364  		goto _10
 94365  	}
 94366  	_sqlite3TokenInit(tls, &_5_ipkToken, elem43((*XColumn)(_pTab.XaCol), uintptr(_pTab.XiPKey)).XzName)
 94367  	_5_pList = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3ExprAlloc(tls, _db, int32(27), &_5_ipkToken, int32(0)))
 94368  	if _5_pList == nil {
 94369  		return
 94370  	}
 94371  	elem59((*TExprList_item)(unsafe.Pointer(&_5_pList.Xa)), 0).XsortOrder = _pParse.XiPkSortOrder
 94372  	func() {
 94373  		if (*XTable)(_pParse.XpNewTable) != _pTab {
 94374  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101424), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112109)))
 94375  			crt.X__builtin_abort(tls)
 94376  		}
 94377  	}()
 94378  	_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, _5_pList, int32(_pTab.XkeyConf), nil, nil, int32(0), int32(0), uint8(2))
 94379  	if _db.XmallocFailed != 0 {
 94380  		return
 94381  	}
 94382  	_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 94383  	_pTab.XiPKey = int16(-1)
 94384  	goto _15
 94385  _10:
 94386  	_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 94387  	if _v != nil {
 94388  		func() {
 94389  			if int32(_db.Xinit.Xbusy) != int32(0) {
 94390  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101438), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(49851)))
 94391  				crt.X__builtin_abort(tls)
 94392  			}
 94393  		}()
 94394  		_sqlite3VdbeChangeOpcode(tls, _v, uint32(_pPk.Xtnum), uint8(13))
 94395  	}
 94396  	_i = store2(&_j, int32(1))
 94397  _19:
 94398  	if _i >= int32(_pPk.XnKeyCol) {
 94399  		goto _22
 94400  	}
 94401  	if _hasColumn(tls, _pPk.XaiColumn, _j, int32(*elem52(_pPk.XaiColumn, uintptr(_i)))) != 0 {
 94402  		_pPk.XnColumn -= 1
 94403  		goto _24
 94404  	}
 94405  	*elem52(_pPk.XaiColumn, uintptr(postInc2(&_j, 1))) = *elem52(_pPk.XaiColumn, uintptr(_i))
 94406  _24:
 94407  	_i += 1
 94408  	goto _19
 94409  _22:
 94410  	_pPk.XnKeyCol = uint16(_j)
 94411  _15:
 94412  	func() {
 94413  		if _pPk == nil {
 94414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101456), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(41949)))
 94415  			crt.X__builtin_abort(tls)
 94416  		}
 94417  	}()
 94418  	storebits5(&_pPk.XidxType, int8(1), 32, 5)
 94419  	if (_db.Xinit.XimposterTable) == 0 {
 94420  		storebits5(&_pPk.XidxType, int8(1), 8, 3)
 94421  	}
 94422  	_nPk = int32(_pPk.XnKeyCol)
 94423  	_pPk.Xtnum = _pTab.Xtnum
 94424  	_pIdx = (*XIndex)(_pTab.XpIndex)
 94425  _28:
 94426  	if _pIdx == nil {
 94427  		goto _31
 94428  	}
 94429  	if int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2) {
 94430  		goto _29
 94431  	}
 94432  	_i = store2(&_11_n, int32(0))
 94433  _33:
 94434  	if _i >= _nPk {
 94435  		goto _36
 94436  	}
 94437  	if _hasColumn(tls, _pIdx.XaiColumn, int32(_pIdx.XnKeyCol), int32(*elem52(_pPk.XaiColumn, uintptr(_i)))) == 0 {
 94438  		_11_n += 1
 94439  	}
 94440  	_i += 1
 94441  	goto _33
 94442  _36:
 94443  	if _11_n == int32(0) {
 94444  		_pIdx.XnColumn = _pIdx.XnKeyCol
 94445  		goto _29
 94446  	}
 94447  	if _resizeIndexObject(tls, _db, _pIdx, int32(_pIdx.XnKeyCol)+_11_n) != 0 {
 94448  		return
 94449  	}
 94450  	*func() *int32 { _i = int32(0); return &_j }() = int32(_pIdx.XnKeyCol)
 94451  _40:
 94452  	if _i >= _nPk {
 94453  		goto _43
 94454  	}
 94455  	if _hasColumn(tls, _pIdx.XaiColumn, int32(_pIdx.XnKeyCol), int32(*elem52(_pPk.XaiColumn, uintptr(_i)))) == 0 {
 94456  		*elem52(_pIdx.XaiColumn, uintptr(_j)) = *elem52(_pPk.XaiColumn, uintptr(_i))
 94457  		*elem0(_pIdx.XazColl, uintptr(_j)) = *elem0(_pPk.XazColl, uintptr(_i))
 94458  		_j += 1
 94459  	}
 94460  	_i += 1
 94461  	goto _40
 94462  _43:
 94463  	func() {
 94464  		if int32(_pIdx.XnColumn) < (int32(_pIdx.XnKeyCol) + _11_n) {
 94465  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101486), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112133)))
 94466  			crt.X__builtin_abort(tls)
 94467  		}
 94468  	}()
 94469  	func() {
 94470  		if int32(_pIdx.XnColumn) < _j {
 94471  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101487), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112164)))
 94472  			crt.X__builtin_abort(tls)
 94473  		}
 94474  	}()
 94475  _29:
 94476  	_pIdx = (*XIndex)(_pIdx.XpNext)
 94477  	goto _28
 94478  _31:
 94479  	if _nPk >= int32(_pTab.XnCol) {
 94480  		goto _49
 94481  	}
 94482  	if _resizeIndexObject(tls, _db, _pPk, int32(_pTab.XnCol)) != 0 {
 94483  		return
 94484  	}
 94485  	*func() *int32 { _i = int32(0); return &_j }() = _nPk
 94486  _51:
 94487  	if _i >= int32(_pTab.XnCol) {
 94488  		goto _54
 94489  	}
 94490  	if _hasColumn(tls, _pPk.XaiColumn, _j, _i) == 0 {
 94491  		func() {
 94492  			if _j >= int32(_pPk.XnColumn) {
 94493  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101496), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112181)))
 94494  				crt.X__builtin_abort(tls)
 94495  			}
 94496  		}()
 94497  		*elem52(_pPk.XaiColumn, uintptr(_j)) = int16(_i)
 94498  		*elem0(_pPk.XazColl, uintptr(_j)) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 94499  		_j += 1
 94500  	}
 94501  	_i += 1
 94502  	goto _51
 94503  _54:
 94504  	func() {
 94505  		if int32(_pPk.XnColumn) != _j {
 94506  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101502), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112196)))
 94507  			crt.X__builtin_abort(tls)
 94508  		}
 94509  	}()
 94510  	func() {
 94511  		if int32(_pTab.XnCol) != _j {
 94512  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101503), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112212)))
 94513  			crt.X__builtin_abort(tls)
 94514  		}
 94515  	}()
 94516  	goto _62
 94517  _49:
 94518  	_pPk.XnColumn = uint16(_pTab.XnCol)
 94519  _62:
 94520  }
 94521  
 94522  var _convertToWithoutRowidTableØ00__func__Ø000 [27]int8
 94523  
 94524  func init() {
 94525  	crt.Xstrncpy(nil, &_convertToWithoutRowidTableØ00__func__Ø000[0], str(112226), 27)
 94526  }
 94527  
 94528  // C comment
 94529  //  /*
 94530  //  ** Create a new index for an SQL table.  pName1.pName2 is the name of the index
 94531  //  ** and pTblList is the name of the table that is to be indexed.  Both will
 94532  //  ** be NULL for a primary key or an index that is created to satisfy a
 94533  //  ** UNIQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
 94534  //  ** as the table to be indexed.  pParse->pNewTable is a table that is
 94535  //  ** currently being constructed by a CREATE TABLE statement.
 94536  //  **
 94537  //  ** pList is a list of columns to be indexed.  pList will be NULL if this
 94538  //  ** is a primary key or unique-constraint on the most recent column added
 94539  //  ** to the table currently under construction.
 94540  //  */
 94541  func _sqlite3CreateIndex(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pTblName *XSrcList, _pList *XExprList, _onError int32, _pStart *XToken, _pPIWhere *XExpr, _sortOrder int32, _ifNotExist int32, _idxType uint8) {
 94542  	var _nName, _i, _j, _sortOrderMask, _iDb, _nExtra, _nExtraCol, _20_n, _34_requestedSortOrder, _42_nColl, _46_x, _53_k, _62_iMem, _63_n int32
 94543  	var _zName, _zExtra, _23_zDb, _34_zColl, _54_z1, _54_z2, _62_zStmt *int8
 94544  	var _26_prevCol XToken
 94545  	var _db *Xsqlite3
 94546  	var _pDb *XDb
 94547  	var _pTab *XTable
 94548  	var _62_v *TVdbe
 94549  	var _pName *XToken
 94550  	var _37_pCopy *XExprList
 94551  	var _pListItem *TExprList_item
 94552  	var _28_pExpr, _34_pCExpr *XExpr
 94553  	var _pIndex, _pPk, _20_pLoop, _52_pIdx, _59_p, _68_pOther *XIndex
 94554  	var _sFix XDbFixer
 94555  	_pTab = nil
 94556  	_pIndex = nil
 94557  	_zName = nil
 94558  	_db = (*Xsqlite3)(_pParse.Xdb)
 94559  	_pName = nil
 94560  	_nExtra = int32(0)
 94561  	_zExtra = nil
 94562  	_pPk = nil
 94563  	if (_db.XmallocFailed != 0) || (_pParse.XnErr > int32(0)) {
 94564  		goto _exit_create_index
 94565  	}
 94566  	if (_pParse.XdeclareVtab != 0) && (int32(_idxType) != int32(2)) {
 94567  		goto _exit_create_index
 94568  	}
 94569  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
 94570  		goto _exit_create_index
 94571  	}
 94572  	if _pTblName == nil {
 94573  		goto _5
 94574  	}
 94575  	func() {
 94576  		if _pName1 == nil || _pName2 == nil {
 94577  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102638), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112253)))
 94578  			crt.X__builtin_abort(tls)
 94579  		}
 94580  	}()
 94581  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
 94582  	if _iDb < int32(0) {
 94583  		goto _exit_create_index
 94584  	}
 94585  	func() {
 94586  		if _pName == nil || _pName.Xz == nil {
 94587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102641), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112270)))
 94588  			crt.X__builtin_abort(tls)
 94589  		}
 94590  	}()
 94591  	if (_db.Xinit.Xbusy) != 0 {
 94592  		goto _13
 94593  	}
 94594  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTblName)
 94595  	if ((_pName2.Xn == (0)) && (_pTab != nil)) && ((*XSchema)(_pTab.XpSchema) == (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema)) {
 94596  		_iDb = int32(1)
 94597  	}
 94598  _13:
 94599  	_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(112288), _pName)
 94600  	if _sqlite3FixSrcList(tls, &_sFix, _pTblName) != 0 {
 94601  		crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102660), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 94602  		crt.X__builtin_abort(tls)
 94603  	}
 94604  	_pTab = _sqlite3LocateTableItem(tls, _pParse, 0, elem6((*TSrcList_item)(unsafe.Pointer(&_pTblName.Xa)), 0))
 94605  	func() {
 94606  		if int32(_db.XmallocFailed) != int32(0) && _pTab != nil {
 94607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102663), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112294)))
 94608  			crt.X__builtin_abort(tls)
 94609  		}
 94610  	}()
 94611  	if _pTab == nil {
 94612  		goto _exit_create_index
 94613  	}
 94614  	if (_iDb == int32(1)) && ((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema) != (*XSchema)(_pTab.XpSchema)) {
 94615  		_sqlite3ErrorMsg(tls, _pParse, str(112325), unsafe.Pointer(_pTab.XzName))
 94616  		goto _exit_create_index
 94617  	}
 94618  	if (_pTab.XtabFlags & uint32(32)) != (0) {
 94619  		_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 94620  	}
 94621  	goto _25
 94622  _5:
 94623  	func() {
 94624  		if _pName != nil {
 94625  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102673), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112375)))
 94626  			crt.X__builtin_abort(tls)
 94627  		}
 94628  	}()
 94629  	func() {
 94630  		if _pStart != nil {
 94631  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102674), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112384)))
 94632  			crt.X__builtin_abort(tls)
 94633  		}
 94634  	}()
 94635  	_pTab = (*XTable)(_pParse.XpNewTable)
 94636  	if _pTab == nil {
 94637  		goto _exit_create_index
 94638  	}
 94639  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
 94640  _25:
 94641  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 94642  	func() {
 94643  		if _pTab == nil {
 94644  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102681), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(43549)))
 94645  			crt.X__builtin_abort(tls)
 94646  		}
 94647  	}()
 94648  	func() {
 94649  		if _pParse.XnErr != int32(0) {
 94650  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102682), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112394)))
 94651  			crt.X__builtin_abort(tls)
 94652  		}
 94653  	}()
 94654  	if ((Xsqlite3_strnicmp(tls, _pTab.XzName, str(111672), int32(7)) == int32(0)) && (int32(_db.Xinit.Xbusy) == int32(0))) && (Xsqlite3_strnicmp(tls, elem1(_pTab.XzName, uintptr(7)), str(112410), int32(9)) != int32(0)) {
 94655  		_sqlite3ErrorMsg(tls, _pParse, str(112420), unsafe.Pointer(_pTab.XzName))
 94656  		goto _exit_create_index
 94657  	}
 94658  	if _pTab.XpSelect != nil {
 94659  		_sqlite3ErrorMsg(tls, _pParse, str(112448))
 94660  		goto _exit_create_index
 94661  	}
 94662  	if _pTab.XnModuleArg != 0 {
 94663  		_sqlite3ErrorMsg(tls, _pParse, str(112473))
 94664  		goto _exit_create_index
 94665  	}
 94666  	if _pName == nil {
 94667  		goto _40
 94668  	}
 94669  	_zName = _sqlite3NameFromToken(tls, _db, _pName)
 94670  	if _zName == nil {
 94671  		goto _exit_create_index
 94672  	}
 94673  	func() {
 94674  		if _pName.Xz == nil {
 94675  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102721), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112507)))
 94676  			crt.X__builtin_abort(tls)
 94677  		}
 94678  	}()
 94679  	if int32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) {
 94680  		goto _exit_create_index
 94681  	}
 94682  	if (_db.Xinit.Xbusy) != 0 {
 94683  		goto _45
 94684  	}
 94685  	if _sqlite3FindTable(tls, _db, _zName, nil) != nil {
 94686  		_sqlite3ErrorMsg(tls, _pParse, str(112519), unsafe.Pointer(_zName))
 94687  		goto _exit_create_index
 94688  	}
 94689  _45:
 94690  	if _sqlite3FindIndex(tls, _db, _zName, _pDb.XzDbSName) == nil {
 94691  		goto _47
 94692  	}
 94693  	if _ifNotExist == 0 {
 94694  		_sqlite3ErrorMsg(tls, _pParse, str(112553), unsafe.Pointer(_zName))
 94695  		goto _49
 94696  	}
 94697  	func() {
 94698  		if (_db.Xinit.Xbusy) != 0 {
 94699  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102735), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112577)))
 94700  			crt.X__builtin_abort(tls)
 94701  		}
 94702  	}()
 94703  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
 94704  _49:
 94705  	goto _exit_create_index
 94706  _47:
 94707  	goto _52
 94708  _40:
 94709  	*func() *int32 { _20_pLoop = (*XIndex)(_pTab.XpIndex); return &_20_n }() = int32(1)
 94710  _53:
 94711  	if _20_pLoop == nil {
 94712  		goto _56
 94713  	}
 94714  	*func() *int32 { _20_pLoop = (*XIndex)(_20_pLoop.XpNext); return &_20_n }() += 1
 94715  	goto _53
 94716  _56:
 94717  	_zName = _sqlite3MPrintf(tls, _db, str(112592), unsafe.Pointer(_pTab.XzName), _20_n)
 94718  	if _zName == nil {
 94719  		goto _exit_create_index
 94720  	}
 94721  	if _pParse.XdeclareVtab != 0 {
 94722  		*elem1(_zName, uintptr(7)) += 1
 94723  	}
 94724  _52:
 94725  	_23_zDb = _pDb.XzDbSName
 94726  	if _sqlite3AuthCheck(tls, _pParse, int32(18), func() *int8 {
 94727  		if int32(1) != 0 && (_iDb == int32(1)) {
 94728  			return str(49962)
 94729  		}
 94730  		return str(49981)
 94731  	}(), nil, _23_zDb) != 0 {
 94732  		goto _exit_create_index
 94733  	}
 94734  	_i = int32(1)
 94735  	if int32(1) != 0 && (_iDb == int32(1)) {
 94736  		_i = int32(3)
 94737  	}
 94738  	if _sqlite3AuthCheck(tls, _pParse, _i, _zName, _pTab.XzName, _23_zDb) != 0 {
 94739  		goto _exit_create_index
 94740  	}
 94741  	if _pList != nil {
 94742  		goto _66
 94743  	}
 94744  	_sqlite3TokenInit(tls, &_26_prevCol, elem43((*XColumn)(_pTab.XaCol), uintptr(int32(_pTab.XnCol)-int32(1))).XzName)
 94745  	_pList = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3ExprAlloc(tls, _db, int32(27), &_26_prevCol, int32(0)))
 94746  	if _pList == nil {
 94747  		goto _exit_create_index
 94748  	}
 94749  	func() {
 94750  		if _pList.XnExpr != int32(1) {
 94751  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102783), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112615)))
 94752  			crt.X__builtin_abort(tls)
 94753  		}
 94754  	}()
 94755  	_sqlite3ExprListSetSortOrder(tls, _pList, _sortOrder)
 94756  	goto _70
 94757  _66:
 94758  	_sqlite3ExprListCheckLength(tls, _pParse, _pList, str(112288))
 94759  _70:
 94760  	_i = int32(0)
 94761  _71:
 94762  	if _i >= _pList.XnExpr {
 94763  		goto _74
 94764  	}
 94765  	_28_pExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr)
 94766  	func() {
 94767  		if _28_pExpr == nil {
 94768  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102794), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(43591)))
 94769  			crt.X__builtin_abort(tls)
 94770  		}
 94771  	}()
 94772  	if int32(_28_pExpr.Xop) == int32(94) {
 94773  		_nExtra += int32(1) + _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_28_pExpr.Xu)))
 94774  	}
 94775  	_i += 1
 94776  	goto _71
 94777  _74:
 94778  	_nName = _sqlite3Strlen30(tls, _zName)
 94779  	_nExtraCol = func() int32 {
 94780  		if _pPk != nil {
 94781  			return int32(_pPk.XnKeyCol)
 94782  		}
 94783  		return int32(1)
 94784  	}()
 94785  	_pIndex = _sqlite3AllocateIndexObject(tls, _db, int16(_pList.XnExpr+_nExtraCol), (_nName+_nExtra)+int32(1), &_zExtra)
 94786  	if _db.XmallocFailed != 0 {
 94787  		goto _exit_create_index
 94788  	}
 94789  	func() {
 94790  		if (int64(uintptr(unsafe.Pointer(_pIndex.XaiRowLogEst))) & int64(7)) != (0) {
 94791  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102810), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112631)))
 94792  			crt.X__builtin_abort(tls)
 94793  		}
 94794  	}()
 94795  	func() {
 94796  		if (int64(uintptr(unsafe.Pointer(_pIndex.XazColl))) & int64(7)) != (0) {
 94797  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102811), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112673)))
 94798  			crt.X__builtin_abort(tls)
 94799  		}
 94800  	}()
 94801  	_pIndex.XzName = _zExtra
 94802  	*(*uintptr)(unsafe.Pointer(&_zExtra)) += uintptr(_nName + int32(1))
 94803  	crt.Xmemcpy(tls, unsafe.Pointer(_pIndex.XzName), unsafe.Pointer(_zName), uint64(_nName+int32(1)))
 94804  	*(**XTable)(unsafe.Pointer(&_pIndex.XpTable)) = _pTab
 94805  	_pIndex.XonError = uint8(_onError)
 94806  	storebits5(&_pIndex.XidxType, int8(bool2int(_onError != int32(0))), 8, 3)
 94807  	storebits5(&_pIndex.XidxType, int8(_idxType), 3, 0)
 94808  	*(**XSchema)(unsafe.Pointer(&_pIndex.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
 94809  	_pIndex.XnKeyCol = uint16(_pList.XnExpr)
 94810  	if _pPIWhere != nil {
 94811  		_sqlite3ResolveSelfReference(tls, _pParse, _pTab, int32(2), _pPIWhere, nil)
 94812  		*(**XExpr)(unsafe.Pointer(&_pIndex.XpPartIdxWhere)) = _pPIWhere
 94813  		_pPIWhere = nil
 94814  	}
 94815  	func() {
 94816  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 94817  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102826), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(51126)))
 94818  			crt.X__builtin_abort(tls)
 94819  		}
 94820  	}()
 94821  	if int32((*XSchema)(_pDb.XpSchema).Xfile_format) >= int32(4) {
 94822  		_sortOrderMask = int32(-1)
 94823  		goto _89
 94824  	}
 94825  	_sortOrderMask = int32(0)
 94826  _89:
 94827  	*func() **TExprList_item { _i = int32(0); return &_pListItem }() = (*TExprList_item)(unsafe.Pointer(&_pList.Xa))
 94828  _90:
 94829  	if _i >= _pList.XnExpr {
 94830  		goto _93
 94831  	}
 94832  	_sqlite3StringToId(tls, (*XExpr)(_pListItem.XpExpr))
 94833  	_sqlite3ResolveSelfReference(tls, _pParse, _pTab, int32(32), (*XExpr)(_pListItem.XpExpr), nil)
 94834  	if _pParse.XnErr != 0 {
 94835  		goto _exit_create_index
 94836  	}
 94837  	_34_pCExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pListItem.XpExpr))
 94838  	if int32(_34_pCExpr.Xop) == int32(152) {
 94839  		goto _95
 94840  	}
 94841  	if _pTab == (*XTable)(_pParse.XpNewTable) {
 94842  		_sqlite3ErrorMsg(tls, _pParse, str(112710))
 94843  		goto _exit_create_index
 94844  	}
 94845  	if (*XExprList)(_pIndex.XaColExpr) != nil {
 94846  		goto _97
 94847  	}
 94848  	_37_pCopy = _sqlite3ExprListDup(tls, _db, _pList, int32(0))
 94849  	*(**XExprList)(unsafe.Pointer(&_pIndex.XaColExpr)) = _37_pCopy
 94850  	if _db.XmallocFailed == 0 {
 94851  		func() {
 94852  			if _37_pCopy == nil {
 94853  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102864), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112771)))
 94854  				crt.X__builtin_abort(tls)
 94855  			}
 94856  		}()
 94857  		_pListItem = elem59((*TExprList_item)(unsafe.Pointer(&_37_pCopy.Xa)), uintptr(_i))
 94858  	}
 94859  _97:
 94860  	_j = int32(-2)
 94861  	*elem52(_pIndex.XaiColumn, uintptr(_i)) = int16(-2)
 94862  	storebits5(&_pIndex.XidxType, 0, 8, 3)
 94863  	goto _101
 94864  _95:
 94865  	_j = int32(_34_pCExpr.XiColumn)
 94866  	func() {
 94867  		if _j > int32(32767) {
 94868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102873), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112780)))
 94869  			crt.X__builtin_abort(tls)
 94870  		}
 94871  	}()
 94872  	if _j < int32(0) {
 94873  		_j = int32(_pTab.XiPKey)
 94874  		goto _106
 94875  	}
 94876  	if int32(elem43((*XColumn)(_pTab.XaCol), uintptr(_j)).XnotNull) == int32(0) {
 94877  		storebits5(&_pIndex.XidxType, 0, 8, 3)
 94878  	}
 94879  _106:
 94880  	*elem52(_pIndex.XaiColumn, uintptr(_i)) = int16(_j)
 94881  _101:
 94882  	_34_zColl = nil
 94883  	if int32((*XExpr)(_pListItem.XpExpr).Xop) == int32(94) {
 94884  		_34_zColl = *(**int8)(unsafe.Pointer(&((*XExpr)(_pListItem.XpExpr).Xu)))
 94885  		_42_nColl = _sqlite3Strlen30(tls, _34_zColl) + int32(1)
 94886  		func() {
 94887  			if _nExtra < _42_nColl {
 94888  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102886), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112790)))
 94889  				crt.X__builtin_abort(tls)
 94890  			}
 94891  		}()
 94892  		crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_34_zColl), uint64(_42_nColl))
 94893  		_34_zColl = _zExtra
 94894  		*(*uintptr)(unsafe.Pointer(&_zExtra)) += uintptr(_42_nColl)
 94895  		_nExtra -= _42_nColl
 94896  		goto _111
 94897  	}
 94898  	if _j >= int32(0) {
 94899  		_34_zColl = elem43((*XColumn)(_pTab.XaCol), uintptr(_j)).XzColl
 94900  	}
 94901  _111:
 94902  	if _34_zColl == nil {
 94903  		_34_zColl = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 94904  	}
 94905  	if ((_db.Xinit.Xbusy) == 0) && (_sqlite3LocateCollSeq(tls, _pParse, _34_zColl) == nil) {
 94906  		goto _exit_create_index
 94907  	}
 94908  	*elem0(_pIndex.XazColl, uintptr(_i)) = _34_zColl
 94909  	_34_requestedSortOrder = int32(_pListItem.XsortOrder) & _sortOrderMask
 94910  	*elem15(_pIndex.XaSortOrder, uintptr(_i)) = uint8(_34_requestedSortOrder)
 94911  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pListItem }())) += uintptr(32)
 94912  	goto _90
 94913  _93:
 94914  	if _pPk == nil {
 94915  		goto _115
 94916  	}
 94917  	_j = int32(0)
 94918  _116:
 94919  	if _j >= int32(_pPk.XnKeyCol) {
 94920  		goto _119
 94921  	}
 94922  	_46_x = int32(*elem52(_pPk.XaiColumn, uintptr(_j)))
 94923  	func() {
 94924  		if _46_x < int32(0) {
 94925  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102910), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(109771)))
 94926  			crt.X__builtin_abort(tls)
 94927  		}
 94928  	}()
 94929  	if _hasColumn(tls, _pIndex.XaiColumn, int32(_pIndex.XnKeyCol), _46_x) != 0 {
 94930  		_pIndex.XnColumn -= 1
 94931  		goto _123
 94932  	}
 94933  	*elem52(_pIndex.XaiColumn, uintptr(_i)) = int16(_46_x)
 94934  	*elem0(_pIndex.XazColl, uintptr(_i)) = *elem0(_pPk.XazColl, uintptr(_j))
 94935  	*elem15(_pIndex.XaSortOrder, uintptr(_i)) = *elem15(_pPk.XaSortOrder, uintptr(_j))
 94936  	_i += 1
 94937  _123:
 94938  	_j += 1
 94939  	goto _116
 94940  _119:
 94941  	func() {
 94942  		if _i != int32(_pIndex.XnColumn) {
 94943  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102920), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112804)))
 94944  			crt.X__builtin_abort(tls)
 94945  		}
 94946  	}()
 94947  	goto _126
 94948  _115:
 94949  	*elem52(_pIndex.XaiColumn, uintptr(_i)) = int16(-1)
 94950  	*elem0(_pIndex.XazColl, uintptr(_i)) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 94951  _126:
 94952  	_sqlite3DefaultRowEst(tls, _pIndex)
 94953  	if (*XTable)(_pParse.XpNewTable) == nil {
 94954  		_estimateIndexWidth(tls, _pIndex)
 94955  	}
 94956  	func() {
 94957  		if (_pTab.XtabFlags&uint32(32)) != (0) && int32(_pTab.XiPKey) >= int32(0) && int32(_sqlite3ColumnOfIndex(tls, _pIndex, _pTab.XiPKey)) < int32(0) {
 94958  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102930), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112823)))
 94959  			crt.X__builtin_abort(tls)
 94960  		}
 94961  	}()
 94962  	if _pTblName == nil || int32(_pIndex.XnColumn) < int32(_pTab.XnCol) {
 94963  		goto _133
 94964  	}
 94965  	storebits5(&_pIndex.XidxType, int8(1), 32, 5)
 94966  	_j = int32(0)
 94967  _134:
 94968  	if _j >= int32(_pTab.XnCol) {
 94969  		goto _137
 94970  	}
 94971  	if _j == int32(_pTab.XiPKey) {
 94972  		goto _135
 94973  	}
 94974  	if int32(_sqlite3ColumnOfIndex(tls, _pIndex, int16(_j))) >= int32(0) {
 94975  		goto _135
 94976  	}
 94977  	storebits5(&_pIndex.XidxType, 0, 32, 5)
 94978  	goto _137
 94979  _135:
 94980  	_j += 1
 94981  	goto _134
 94982  _137:
 94983  _133:
 94984  	if _pTab != (*XTable)(_pParse.XpNewTable) {
 94985  		goto _140
 94986  	}
 94987  	_52_pIdx = (*XIndex)(_pTab.XpIndex)
 94988  _141:
 94989  	if _52_pIdx == nil {
 94990  		goto _144
 94991  	}
 94992  	func() {
 94993  		if int32(_52_pIdx.XonError) == int32(0) {
 94994  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102967), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112903)))
 94995  			crt.X__builtin_abort(tls)
 94996  		}
 94997  	}()
 94998  	func() {
 94999  		if int32((uint32(_52_pIdx.XidxType)<<30)>>30) == int32(0) {
 95000  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102968), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112923)))
 95001  			crt.X__builtin_abort(tls)
 95002  		}
 95003  	}()
 95004  	func() {
 95005  		if int32(_pIndex.XonError) == int32(0) {
 95006  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102969), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112960)))
 95007  			crt.X__builtin_abort(tls)
 95008  		}
 95009  	}()
 95010  	if int32(_52_pIdx.XnKeyCol) != int32(_pIndex.XnKeyCol) {
 95011  		goto _142
 95012  	}
 95013  	_53_k = int32(0)
 95014  _152:
 95015  	if _53_k >= int32(_52_pIdx.XnKeyCol) {
 95016  		goto _155
 95017  	}
 95018  	func() {
 95019  		if int32(*elem52(_52_pIdx.XaiColumn, uintptr(_53_k))) < int32(0) {
 95020  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102975), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112982)))
 95021  			crt.X__builtin_abort(tls)
 95022  		}
 95023  	}()
 95024  	if int32(*elem52(_52_pIdx.XaiColumn, uintptr(_53_k))) != int32(*elem52(_pIndex.XaiColumn, uintptr(_53_k))) {
 95025  		goto _155
 95026  	}
 95027  	_54_z1 = *elem0(_52_pIdx.XazColl, uintptr(_53_k))
 95028  	_54_z2 = *elem0(_pIndex.XazColl, uintptr(_53_k))
 95029  	if _sqlite3StrICmp(tls, _54_z1, _54_z2) != 0 {
 95030  		goto _155
 95031  	}
 95032  	_53_k += 1
 95033  	goto _152
 95034  _155:
 95035  	if _53_k != int32(_52_pIdx.XnKeyCol) {
 95036  		goto _160
 95037  	}
 95038  	if int32(_52_pIdx.XonError) == int32(_pIndex.XonError) {
 95039  		goto _161
 95040  	}
 95041  	if int32(_52_pIdx.XonError) != int32(10) && int32(_pIndex.XonError) != int32(10) {
 95042  		_sqlite3ErrorMsg(tls, _pParse, str(113003), int32(0))
 95043  	}
 95044  	if int32(_52_pIdx.XonError) == int32(10) {
 95045  		_52_pIdx.XonError = _pIndex.XonError
 95046  	}
 95047  _161:
 95048  	if int32(_idxType) == int32(2) {
 95049  		storebits5(&_52_pIdx.XidxType, int8(_idxType), 3, 0)
 95050  	}
 95051  	goto _exit_create_index
 95052  _160:
 95053  _142:
 95054  	_52_pIdx = (*XIndex)(_52_pIdx.XpNext)
 95055  	goto _141
 95056  _144:
 95057  _140:
 95058  	func() {
 95059  		if _pParse.XnErr != int32(0) {
 95060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103007), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112394)))
 95061  			crt.X__builtin_abort(tls)
 95062  		}
 95063  	}()
 95064  	if (_db.Xinit.Xbusy) == 0 {
 95065  		goto _168
 95066  	}
 95067  	func() {
 95068  		if _pParse.XdeclareVtab != 0 {
 95069  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103010), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(113045)))
 95070  			crt.X__builtin_abort(tls)
 95071  		}
 95072  	}()
 95073  	func() {
 95074  		if _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_pIndex.XpSchema)) == 0 {
 95075  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103011), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(113062)))
 95076  			crt.X__builtin_abort(tls)
 95077  		}
 95078  	}()
 95079  	_59_p = (*XIndex)(_sqlite3HashInsert(tls, &((*XSchema)(_pIndex.XpSchema).XidxHash), _pIndex.XzName, unsafe.Pointer(_pIndex)))
 95080  	if _59_p != nil {
 95081  		func() {
 95082  			if _59_p != _pIndex {
 95083  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103015), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(113109)))
 95084  				crt.X__builtin_abort(tls)
 95085  			}
 95086  		}()
 95087  		_sqlite3OomFault(tls, _db)
 95088  		goto _exit_create_index
 95089  	}
 95090  	_db.Xflags |= int32(2)
 95091  	if _pTblName != nil {
 95092  		_pIndex.Xtnum = _db.Xinit.XnewTnum
 95093  	}
 95094  	goto _179
 95095  _168:
 95096  	if (_pTab.XtabFlags&uint32(32)) != (0) && _pTblName == nil {
 95097  		goto _179
 95098  	}
 95099  	_62_iMem = preInc2(&_pParse.XnMem, 1)
 95100  	_62_v = _sqlite3GetVdbe(tls, _pParse)
 95101  	if _62_v == nil {
 95102  		goto _exit_create_index
 95103  	}
 95104  	_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
 95105  	_pIndex.Xtnum = _sqlite3VdbeAddOp0(tls, _62_v, int32(164))
 95106  	_sqlite3VdbeAddOp2(tls, _62_v, int32(136), _iDb, _62_iMem)
 95107  	if _pStart == nil {
 95108  		goto _181
 95109  	}
 95110  	_63_n = int32(uint32(int32(int64(uintptr(unsafe.Pointer(_pParse.XsLastToken.Xz))-uintptr(unsafe.Pointer(_pName.Xz))))) + (_pParse.XsLastToken.Xn))
 95111  	if int32(*elem1(_pName.Xz, uintptr(_63_n-int32(1)))) == int32(59) {
 95112  		_63_n -= 1
 95113  	}
 95114  	_62_zStmt = _sqlite3MPrintf(tls, _db, str(113119), unsafe.Pointer(func() *int8 {
 95115  		if _onError == int32(0) {
 95116  			return str(284)
 95117  		}
 95118  		return str(113139)
 95119  	}()), _63_n, unsafe.Pointer(_pName.Xz))
 95120  	goto _185
 95121  _181:
 95122  	_62_zStmt = nil
 95123  _185:
 95124  	_sqlite3NestedParse(tls, _pParse, str(113147), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(str(49981)), unsafe.Pointer(_pIndex.XzName), unsafe.Pointer(_pTab.XzName), _62_iMem, unsafe.Pointer(_62_zStmt))
 95125  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_62_zStmt))
 95126  	if _pTblName != nil {
 95127  		_sqlite3RefillIndex(tls, _pParse, _pIndex, _62_iMem)
 95128  		_sqlite3ChangeCookie(tls, _pParse, _iDb)
 95129  		_sqlite3VdbeAddParseSchemaOp(tls, _62_v, _iDb, _sqlite3MPrintf(tls, _db, str(113195), unsafe.Pointer(_pIndex.XzName)))
 95130  		_sqlite3VdbeAddOp0(tls, _62_v, int32(153))
 95131  	}
 95132  	_sqlite3VdbeJumpHere(tls, _62_v, _pIndex.Xtnum)
 95133  _179:
 95134  	if (_db.Xinit.Xbusy) == 0 && _pTblName != nil {
 95135  		goto _exit_create_index
 95136  	}
 95137  	if ((_onError != int32(5)) || ((*XIndex)(_pTab.XpIndex) == nil)) || (int32((*XIndex)(_pTab.XpIndex).XonError) == int32(5)) {
 95138  		*(**XIndex)(unsafe.Pointer(&_pIndex.XpNext)) = (*XIndex)(_pTab.XpIndex)
 95139  		*(**XIndex)(unsafe.Pointer(&_pTab.XpIndex)) = _pIndex
 95140  		goto _192
 95141  	}
 95142  	_68_pOther = (*XIndex)(_pTab.XpIndex)
 95143  _193:
 95144  	if (_68_pOther.XpNext != nil) && (int32((*XIndex)(_68_pOther.XpNext).XonError) != int32(5)) {
 95145  		_68_pOther = (*XIndex)(_68_pOther.XpNext)
 95146  		goto _193
 95147  	}
 95148  	*(**XIndex)(unsafe.Pointer(&_pIndex.XpNext)) = (*XIndex)(_68_pOther.XpNext)
 95149  	*(**XIndex)(unsafe.Pointer(&_68_pOther.XpNext)) = _pIndex
 95150  _192:
 95151  	_pIndex = nil
 95152  _exit_create_index:
 95153  	if _pIndex != nil {
 95154  		_freeIndex(tls, _db, _pIndex)
 95155  	}
 95156  	_sqlite3ExprDelete(tls, _db, _pPIWhere)
 95157  	_sqlite3ExprListDelete(tls, _db, _pList)
 95158  	_sqlite3SrcListDelete(tls, _db, _pTblName)
 95159  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
 95160  }
 95161  
 95162  var _sqlite3CreateIndexØ00__func__Ø000 [19]int8
 95163  
 95164  func init() {
 95165  	crt.Xstrncpy(nil, &_sqlite3CreateIndexØ00__func__Ø000[0], str(113222), 19)
 95166  }
 95167  
 95168  // C comment
 95169  //  /*
 95170  //  ** While a SrcList can in general represent multiple tables and subqueries
 95171  //  ** (as in the FROM clause of a SELECT statement) in this case it contains
 95172  //  ** the name of a single table, as one might find in an INSERT, DELETE,
 95173  //  ** or UPDATE statement.  Look up that table in the symbol table and
 95174  //  ** return a pointer.  Set an error message and return NULL if the table
 95175  //  ** name is not found or if any other error occurs.
 95176  //  **
 95177  //  ** The following fields are initialized appropriate in pSrc:
 95178  //  **
 95179  //  **    pSrc->a[0].pTab       Pointer to the Table object
 95180  //  **    pSrc->a[0].pIndex     Pointer to the INDEXED BY index, if there is one
 95181  //  **
 95182  //  */
 95183  func _sqlite3SrcListLookup(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) (r0 *XTable) {
 95184  	var _pTab *XTable
 95185  	var _pItem *TSrcList_item
 95186  	_pItem = (*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa))
 95187  	func() {
 95188  		if _pItem == nil || _pSrc.XnSrc != int32(1) {
 95189  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104667), unsafe.Pointer(&_sqlite3SrcListLookupØ00__func__Ø000), unsafe.Pointer(str(113241)))
 95190  			crt.X__builtin_abort(tls)
 95191  		}
 95192  	}()
 95193  	_pTab = _sqlite3LocateTableItem(tls, _pParse, 0, _pItem)
 95194  	_sqlite3DeleteTable(tls, (*Xsqlite3)(_pParse.Xdb), (*XTable)(_pItem.XpTab))
 95195  	*(**XTable)(unsafe.Pointer(&_pItem.XpTab)) = _pTab
 95196  	if _pTab != nil {
 95197  		_pTab.XnTabRef += 1
 95198  	}
 95199  	if _sqlite3IndexedByLookup(tls, _pParse, _pItem) != 0 {
 95200  		_pTab = nil
 95201  	}
 95202  	return _pTab
 95203  }
 95204  
 95205  var _sqlite3SrcListLookupØ00__func__Ø000 [21]int8
 95206  
 95207  func init() {
 95208  	crt.Xstrncpy(nil, &_sqlite3SrcListLookupØ00__func__Ø000[0], str(113264), 21)
 95209  }
 95210  
 95211  // C comment
 95212  //  /*
 95213  //  ** Initialize a DbFixer structure.  This routine must be called prior
 95214  //  ** to passing the structure to one of the sqliteFixAAAA() routines below.
 95215  //  */
 95216  func _sqlite3FixInit(tls *crt.TLS, _pFix *XDbFixer, _pParse *XParse, _iDb int32, _zType *int8, _pName *XToken) {
 95217  	var _db *Xsqlite3
 95218  	_db = (*Xsqlite3)(_pParse.Xdb)
 95219  	func() {
 95220  		if _db.XnDb <= _iDb {
 95221  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99270), unsafe.Pointer(&_sqlite3FixInitØ00__func__Ø000), unsafe.Pointer(str(113285)))
 95222  			crt.X__builtin_abort(tls)
 95223  		}
 95224  	}()
 95225  	*(**XParse)(unsafe.Pointer(&_pFix.XpParse)) = _pParse
 95226  	_pFix.XzDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 95227  	*(**XSchema)(unsafe.Pointer(&_pFix.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
 95228  	_pFix.XzType = _zType
 95229  	*(**XToken)(unsafe.Pointer(&_pFix.XpName)) = _pName
 95230  	_pFix.XbVarOnly = bool2int(_iDb == int32(1))
 95231  }
 95232  
 95233  var _sqlite3FixInitØ00__func__Ø000 [15]int8
 95234  
 95235  func init() {
 95236  	crt.Xstrncpy(nil, &_sqlite3FixInitØ00__func__Ø000[0], str(113297), 15)
 95237  }
 95238  
 95239  // C comment
 95240  //  /*
 95241  //  ** The following set of routines walk through the parse tree and assign
 95242  //  ** a specific database to all table references where the database name
 95243  //  ** was left unspecified in the original SQL statement.  The pFix structure
 95244  //  ** must have been initialized by a prior call to sqlite3FixInit().
 95245  //  **
 95246  //  ** These routines are used to make sure that an index, trigger, or
 95247  //  ** view in one database does not refer to objects in a different database.
 95248  //  ** (Exception: indices, triggers, and views in the TEMP database are
 95249  //  ** allowed to refer to anything.)  If a reference is explicitly made
 95250  //  ** to an object in a different database, an error message is added to
 95251  //  ** pParse->zErrMsg and these routines return non-zero.  If everything
 95252  //  ** checks out, these routines return 0.
 95253  //  */
 95254  func _sqlite3FixSrcList(tls *crt.TLS, _pFix *XDbFixer, _pList *XSrcList) (r0 int32) {
 95255  	var _i int32
 95256  	var _zDb *int8
 95257  	var _pItem *TSrcList_item
 95258  	if func() int32 {
 95259  		if _pList == nil {
 95260  			return func() int32 {
 95261  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99301), unsafe.Pointer(&_sqlite3FixSrcListØ00__func__Ø000), unsafe.Pointer(str(4809)))
 95262  				crt.X__builtin_abort(tls)
 95263  				return int32(1)
 95264  			}()
 95265  		}
 95266  		return int32(0)
 95267  	}() != 0 {
 95268  		return int32(0)
 95269  	}
 95270  	_zDb = _pFix.XzDb
 95271  	*func() **TSrcList_item { _i = int32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_pList.Xa))
 95272  _3:
 95273  	if _i >= _pList.XnSrc {
 95274  		goto _6
 95275  	}
 95276  	if _pFix.XbVarOnly != int32(0) {
 95277  		goto _7
 95278  	}
 95279  	if (_pItem.XzDatabase != nil) && _sqlite3StrICmp(tls, _pItem.XzDatabase, _zDb) != 0 {
 95280  		_sqlite3ErrorMsg(tls, (*XParse)(_pFix.XpParse), str(113312), unsafe.Pointer(_pFix.XzType), _pFix.XpName, unsafe.Pointer(_pItem.XzDatabase))
 95281  		return int32(1)
 95282  	}
 95283  	_sqlite3DbFree(tls, (*Xsqlite3)((*XParse)(_pFix.XpParse).Xdb), unsafe.Pointer(_pItem.XzDatabase))
 95284  	_pItem.XzDatabase = nil
 95285  	*(**XSchema)(unsafe.Pointer(&_pItem.XpSchema)) = (*XSchema)(_pFix.XpSchema)
 95286  _7:
 95287  	if _sqlite3FixSelect(tls, _pFix, (*XSelect)(_pItem.XpSelect)) != 0 {
 95288  		return int32(1)
 95289  	}
 95290  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pItem.XpOn)) != 0 {
 95291  		return int32(1)
 95292  	}
 95293  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(112)
 95294  	goto _3
 95295  _6:
 95296  	return int32(0)
 95297  }
 95298  
 95299  var _sqlite3FixSrcListØ00__func__Ø000 [18]int8
 95300  
 95301  func init() {
 95302  	crt.Xstrncpy(nil, &_sqlite3FixSrcListØ00__func__Ø000[0], str(113358), 18)
 95303  }
 95304  
 95305  func _sqlite3FixSelect(tls *crt.TLS, _pFix *XDbFixer, _pSelect *XSelect) (r0 int32) {
 95306  _0:
 95307  	if _pSelect == nil {
 95308  		goto _1
 95309  	}
 95310  	if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pSelect.XpEList)) != 0 {
 95311  		return int32(1)
 95312  	}
 95313  	if _sqlite3FixSrcList(tls, _pFix, (*XSrcList)(_pSelect.XpSrc)) != 0 {
 95314  		return int32(1)
 95315  	}
 95316  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.XpWhere)) != 0 {
 95317  		return int32(1)
 95318  	}
 95319  	if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pSelect.XpGroupBy)) != 0 {
 95320  		return int32(1)
 95321  	}
 95322  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.XpHaving)) != 0 {
 95323  		return int32(1)
 95324  	}
 95325  	if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pSelect.XpOrderBy)) != 0 {
 95326  		return int32(1)
 95327  	}
 95328  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.XpLimit)) != 0 {
 95329  		return int32(1)
 95330  	}
 95331  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.XpOffset)) != 0 {
 95332  		return int32(1)
 95333  	}
 95334  	_pSelect = (*XSelect)(_pSelect.XpPrior)
 95335  	goto _0
 95336  _1:
 95337  	return int32(0)
 95338  }
 95339  
 95340  func _sqlite3FixExprList(tls *crt.TLS, _pFix *XDbFixer, _pList *XExprList) (r0 int32) {
 95341  	var _i int32
 95342  	var _pItem *TExprList_item
 95343  	if _pList == nil {
 95344  		return int32(0)
 95345  	}
 95346  	*func() **TExprList_item { _i = int32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pList.Xa))
 95347  _1:
 95348  	if _i >= _pList.XnExpr {
 95349  		goto _4
 95350  	}
 95351  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pItem.XpExpr)) != 0 {
 95352  		return int32(1)
 95353  	}
 95354  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(32)
 95355  	goto _1
 95356  _4:
 95357  	return int32(0)
 95358  }
 95359  
 95360  func _sqlite3FixExpr(tls *crt.TLS, _pFix *XDbFixer, _pExpr *XExpr) (r0 int32) {
 95361  _0:
 95362  	if _pExpr == nil {
 95363  		goto _1
 95364  	}
 95365  	if int32(_pExpr.Xop) != int32(135) {
 95366  		goto _2
 95367  	}
 95368  	if (((*Xsqlite3)((*XParse)(_pFix.XpParse).Xdb).Xinit).Xbusy) != 0 {
 95369  		_pExpr.Xop = uint8(101)
 95370  		goto _4
 95371  	}
 95372  	_sqlite3ErrorMsg(tls, (*XParse)(_pFix.XpParse), str(113376), unsafe.Pointer(_pFix.XzType))
 95373  	return int32(1)
 95374  
 95375  _4:
 95376  _2:
 95377  	if (_pExpr.Xflags & uint32(8404992)) != (0) {
 95378  		goto _1
 95379  	}
 95380  	if (_pExpr.Xflags & uint32(2048)) == (0) {
 95381  		goto _6
 95382  	}
 95383  	if _sqlite3FixSelect(tls, _pFix, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))) != 0 {
 95384  		return int32(1)
 95385  	}
 95386  	goto _8
 95387  _6:
 95388  	if _sqlite3FixExprList(tls, _pFix, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))) != 0 {
 95389  		return int32(1)
 95390  	}
 95391  _8:
 95392  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pExpr.XpRight)) != 0 {
 95393  		return int32(1)
 95394  	}
 95395  	_pExpr = (*XExpr)(_pExpr.XpLeft)
 95396  	goto _0
 95397  _1:
 95398  	return int32(0)
 95399  }
 95400  
 95401  // C comment
 95402  //  /*
 95403  //  ** Set the sort order for the last element on the given ExprList.
 95404  //  */
 95405  func _sqlite3ExprListSetSortOrder(tls *crt.TLS, _p *XExprList, _iSortOrder int32) {
 95406  	if _p == nil {
 95407  		return
 95408  	}
 95409  
 95410  	func() {
 95411  		if _p.XnExpr <= int32(0) {
 95412  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92474), unsafe.Pointer(&_sqlite3ExprListSetSortOrderØ00__func__Ø000), unsafe.Pointer(str(113400)))
 95413  			crt.X__builtin_abort(tls)
 95414  		}
 95415  	}()
 95416  	if _iSortOrder < int32(0) {
 95417  		func() {
 95418  			if int32(elem59((*TExprList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnExpr-int32(1))).XsortOrder) != int32(0) {
 95419  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92476), unsafe.Pointer(&_sqlite3ExprListSetSortOrderØ00__func__Ø000), unsafe.Pointer(str(113411)))
 95420  				crt.X__builtin_abort(tls)
 95421  			}
 95422  		}()
 95423  		return
 95424  	}
 95425  	elem59((*TExprList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnExpr-int32(1))).XsortOrder = uint8(_iSortOrder)
 95426  }
 95427  
 95428  var _sqlite3ExprListSetSortOrderØ00__func__Ø000 [28]int8
 95429  
 95430  func init() {
 95431  	crt.Xstrncpy(nil, &_sqlite3ExprListSetSortOrderØ00__func__Ø000[0], str(113453), 28)
 95432  }
 95433  
 95434  // C comment
 95435  //  /*
 95436  //  ** If the expression list pEList contains more than iLimit elements,
 95437  //  ** leave an error message in pParse.
 95438  //  */
 95439  func _sqlite3ExprListCheckLength(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _zObject *int8) {
 95440  	var _mx int32
 95441  	_mx = *elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.Xdb).XaLimit))), uintptr(2))
 95442  	if (_pEList != nil) && (_pEList.XnExpr > _mx) {
 95443  		_sqlite3ErrorMsg(tls, _pParse, str(113481), unsafe.Pointer(_zObject))
 95444  	}
 95445  }
 95446  
 95447  // C comment
 95448  //  /*
 95449  //  ** Resolve names in expressions that can only reference a single table:
 95450  //  **
 95451  //  **    *   CHECK constraints
 95452  //  **    *   WHERE clauses on partial indices
 95453  //  **
 95454  //  ** The Expr.iTable value for Expr.op==TK_COLUMN nodes of the expression
 95455  //  ** is set to -1 and the Expr.iColumn value is set to the column number.
 95456  //  **
 95457  //  ** Any errors cause an error message to be set in pParse.
 95458  //  */
 95459  func _sqlite3ResolveSelfReference(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _type int32, _pExpr *XExpr, _pList *XExprList) {
 95460  	var _sSrc XSrcList
 95461  	var _sNC XNameContext
 95462  	func() {
 95463  		if _type != int32(4) && _type != int32(2) && _type != int32(32) {
 95464  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90883), unsafe.Pointer(&_sqlite3ResolveSelfReferenceØ00__func__Ø000), unsafe.Pointer(str(113504)))
 95465  			crt.X__builtin_abort(tls)
 95466  		}
 95467  	}()
 95468  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint64(56))
 95469  	crt.Xmemset(tls, unsafe.Pointer(&_sSrc), int32(0), uint64(120))
 95470  	_sSrc.XnSrc = int32(1)
 95471  	elem6((*TSrcList_item)(unsafe.Pointer(&_sSrc.Xa)), 0).XzName = _pTab.XzName
 95472  	*(**XTable)(unsafe.Pointer(&(elem6((*TSrcList_item)(unsafe.Pointer(&_sSrc.Xa)), 0).XpTab))) = _pTab
 95473  	elem6((*TSrcList_item)(unsafe.Pointer(&_sSrc.Xa)), 0).XiCursor = int32(-1)
 95474  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pParse
 95475  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = &_sSrc
 95476  	_sNC.XncFlags = uint16(_type)
 95477  	if _sqlite3ResolveExprNames(tls, &_sNC, _pExpr) != 0 {
 95478  		return
 95479  	}
 95480  	if _pList != nil {
 95481  		_sqlite3ResolveExprListNames(tls, &_sNC, _pList)
 95482  	}
 95483  }
 95484  
 95485  var _sqlite3ResolveSelfReferenceØ00__func__Ø000 [28]int8
 95486  
 95487  func init() {
 95488  	crt.Xstrncpy(nil, &_sqlite3ResolveSelfReferenceØ00__func__Ø000[0], str(113561), 28)
 95489  }
 95490  
 95491  // C comment
 95492  //  /*
 95493  //  ** Backwards Compatibility Hack:
 95494  //  **
 95495  //  ** Historical versions of SQLite accepted strings as column names in
 95496  //  ** indexes and PRIMARY KEY constraints and in UNIQUE constraints.  Example:
 95497  //  **
 95498  //  **     CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim)
 95499  //  **     CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC);
 95500  //  **
 95501  //  ** This is goofy.  But to preserve backwards compatibility we continue to
 95502  //  ** accept it.  This routine does the necessary conversion.  It converts
 95503  //  ** the expression given in its argument from a TK_STRING into a TK_ID
 95504  //  ** if the expression is just a TK_STRING with an optional COLLATE clause.
 95505  //  ** If the epxression is anything other than TK_STRING, the expression is
 95506  //  ** unchanged.
 95507  //  */
 95508  func _sqlite3StringToId(tls *crt.TLS, _p *XExpr) {
 95509  	if int32(_p.Xop) == int32(97) {
 95510  		_p.Xop = uint8(27)
 95511  		goto _3
 95512  	}
 95513  	if (int32(_p.Xop) == int32(94)) && (int32((*XExpr)(_p.XpLeft).Xop) == int32(97)) {
 95514  		(*XExpr)(_p.XpLeft).Xop = uint8(27)
 95515  	}
 95516  _3:
 95517  }
 95518  
 95519  // C comment
 95520  //  /* Return true if value x is found any of the first nCol entries of aiCol[]
 95521  //  */
 95522  func _hasColumn(tls *crt.TLS, _aiCol *int16, _nCol int32, _x int32) (r0 int32) {
 95523  _0:
 95524  	if postInc2(&_nCol, -1) <= int32(0) {
 95525  		goto _1
 95526  	}
 95527  	if _x == int32(*postInc52(&_aiCol, 2)) {
 95528  		return int32(1)
 95529  	}
 95530  	goto _0
 95531  _1:
 95532  	return int32(0)
 95533  }
 95534  
 95535  // C comment
 95536  //  /*
 95537  //  ** Estimate the average size of a row for an index.
 95538  //  */
 95539  func _estimateIndexWidth(tls *crt.TLS, _pIdx *XIndex) {
 95540  	var _1_x int16
 95541  	var _i int32
 95542  	var _wIndex uint32
 95543  	var _aCol *XColumn
 95544  	_wIndex = uint32(0)
 95545  	_aCol = (*XColumn)((*XTable)(_pIdx.XpTable).XaCol)
 95546  	_i = int32(0)
 95547  _0:
 95548  	if _i >= int32(_pIdx.XnColumn) {
 95549  		goto _3
 95550  	}
 95551  	_1_x = *elem52(_pIdx.XaiColumn, uintptr(_i))
 95552  	func() {
 95553  		if int32(_1_x) >= int32((*XTable)(_pIdx.XpTable).XnCol) {
 95554  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101344), unsafe.Pointer(&_estimateIndexWidthØ00__func__Ø000), unsafe.Pointer(str(113589)))
 95555  			crt.X__builtin_abort(tls)
 95556  		}
 95557  	}()
 95558  	_wIndex += uint32(func() int32 {
 95559  		if int32(_1_x) < int32(0) {
 95560  			return int32(1)
 95561  		}
 95562  		return int32(elem43(_aCol, uintptr(*elem52(_pIdx.XaiColumn, uintptr(_i)))).XszEst)
 95563  	}())
 95564  	_i += 1
 95565  	goto _0
 95566  _3:
 95567  	_pIdx.XszIdxRow = _sqlite3LogEst(tls, uint64(_wIndex*uint32(4)))
 95568  }
 95569  
 95570  var _estimateIndexWidthØ00__func__Ø000 [19]int8
 95571  
 95572  func init() {
 95573  	crt.Xstrncpy(nil, &_estimateIndexWidthØ00__func__Ø000[0], str(113610), 19)
 95574  }
 95575  
 95576  // C comment
 95577  //  /*
 95578  //  ** Run the parser and code generator recursively in order to generate
 95579  //  ** code for the SQL statement given onto the end of the pParse context
 95580  //  ** currently under construction.  When the parser is run recursively
 95581  //  ** this way, the final OP_Halt is not appended and other initialization
 95582  //  ** and finalization steps are omitted because those are handling by the
 95583  //  ** outermost parser.
 95584  //  **
 95585  //  ** Not everything is nestable.  This facility is designed to permit
 95586  //  ** INSERT, UPDATE, and DELETE operations against SQLITE_MASTER.  Use
 95587  //  ** care if you decide to try to use this routine for some other purposes.
 95588  //  */
 95589  func _sqlite3NestedParse(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ...interface{}) {
 95590  	var _zSql, _zErrMsg *int8
 95591  	var _ap []interface{}
 95592  	var _db *Xsqlite3
 95593  	var _saveBuf [144]int8
 95594  	_zErrMsg = nil
 95595  	_db = (*Xsqlite3)(_pParse.Xdb)
 95596  	if _pParse.XnErr != 0 {
 95597  		return
 95598  	}
 95599  	func() {
 95600  		if int32(_pParse.Xnested) >= int32(10) {
 95601  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99955), unsafe.Pointer(&_sqlite3NestedParseØ00__func__Ø000), unsafe.Pointer(str(113629)))
 95602  			crt.X__builtin_abort(tls)
 95603  		}
 95604  	}()
 95605  	_ap = args
 95606  	_zSql = _sqlite3VMPrintf(tls, _db, _zFormat, _ap)
 95607  	_ap = nil
 95608  	if _zSql == nil {
 95609  		return
 95610  	}
 95611  	_pParse.Xnested += 1
 95612  	crt.Xmemcpy(tls, unsafe.Pointer(&_saveBuf), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParse))+uintptr(uint64(456))))), uint64(144))
 95613  	crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParse))+uintptr(uint64(456))))), int32(0), uint64(144))
 95614  	_sqlite3RunParser(tls, _pParse, _zSql, &_zErrMsg)
 95615  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg))
 95616  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zSql))
 95617  	crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParse))+uintptr(uint64(456))))), unsafe.Pointer(&_saveBuf), uint64(144))
 95618  	_pParse.Xnested -= 1
 95619  	_ = _saveBuf
 95620  }
 95621  
 95622  var _sqlite3NestedParseØ00__func__Ø000 [19]int8
 95623  
 95624  func init() {
 95625  	crt.Xstrncpy(nil, &_sqlite3NestedParseØ00__func__Ø000[0], str(113647), 19)
 95626  }
 95627  
 95628  // C comment
 95629  //  /*
 95630  //  ** Generate code that will erase and refill index *pIdx.  This is
 95631  //  ** used to initialize a newly created index or to recompute the
 95632  //  ** content of an index in response to a REINDEX command.
 95633  //  **
 95634  //  ** if memRootPage is not negative, it means that the index is newly
 95635  //  ** created.  The register specified by memRootPage contains the
 95636  //  ** root page number of the index.  If memRootPage is negative, then
 95637  //  ** the index already exists and must be cleared before being refilled and
 95638  //  ** the root page number of the index is taken from pIndex->tnum.
 95639  //  */
 95640  func _sqlite3RefillIndex(tls *crt.TLS, _pParse *XParse, _pIndex *XIndex, _memRootPage int32) {
 95641  	var _iTab, _iIdx, _iSorter, _addr1, _addr2, _tnum, _iPartIdxLabel, _regRecord, _iDb, _4_j2 int32
 95642  	var _db *Xsqlite3
 95643  	var _pTab *XTable
 95644  	var _v *TVdbe
 95645  	var _pKey *XKeyInfo
 95646  	_pTab = (*XTable)(_pIndex.XpTable)
 95647  	_iTab = postInc2(&_pParse.XnTab, 1)
 95648  	_iIdx = postInc2(&_pParse.XnTab, 1)
 95649  	_db = (*Xsqlite3)(_pParse.Xdb)
 95650  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pIndex.XpSchema))
 95651  	if _sqlite3AuthCheck(tls, _pParse, int32(27), _pIndex.XzName, nil, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName) != 0 {
 95652  		return
 95653  	}
 95654  	_sqlite3TableLock(tls, _pParse, _iDb, _pTab.Xtnum, uint8(1), _pTab.XzName)
 95655  	_v = _sqlite3GetVdbe(tls, _pParse)
 95656  	if _v == nil {
 95657  		return
 95658  	}
 95659  	if _memRootPage >= int32(0) {
 95660  		_tnum = _memRootPage
 95661  		goto _3
 95662  	}
 95663  	_tnum = _pIndex.Xtnum
 95664  _3:
 95665  	_pKey = _sqlite3KeyInfoOfIndex(tls, _pParse, _pIndex)
 95666  	func() {
 95667  		if _pKey == nil && _db.XmallocFailed == 0 && _pParse.XnErr == 0 {
 95668  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102495), unsafe.Pointer(&_sqlite3RefillIndexØ00__func__Ø000), unsafe.Pointer(str(113666)))
 95669  			crt.X__builtin_abort(tls)
 95670  		}
 95671  	}()
 95672  	_iSorter = postInc2(&_pParse.XnTab, 1)
 95673  	_sqlite3VdbeAddOp4(tls, _v, int32(111), _iSorter, int32(0), int32(_pIndex.XnKeyCol), (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _pKey))), int32(-5))
 95674  	_sqlite3OpenTable(tls, _pParse, _iTab, _iDb, _pTab, int32(106))
 95675  	_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(37), _iTab, int32(0))
 95676  	_regRecord = _sqlite3GetTempReg(tls, _pParse)
 95677  	_sqlite3GenerateIndexKey(tls, _pParse, _pIndex, _iTab, _regRecord, int32(0), &_iPartIdxLabel, nil, int32(0))
 95678  	_sqlite3VdbeAddOp2(tls, _v, int32(127), _iSorter, _regRecord)
 95679  	_sqlite3ResolvePartIdxLabel(tls, _pParse, _iPartIdxLabel)
 95680  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _iTab, _addr1+int32(1))
 95681  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 95682  	if _memRootPage < int32(0) {
 95683  		_sqlite3VdbeAddOp2(tls, _v, int32(134), _tnum, _iDb)
 95684  	}
 95685  	_sqlite3VdbeAddOp4(tls, _v, int32(107), _iIdx, _tnum, _iDb, (*int8)(unsafe.Pointer(_pKey)), int32(-5))
 95686  	_sqlite3VdbeChangeP5(tls, _v, uint16(int32(1)|func() int32 {
 95687  		if _memRootPage >= int32(0) {
 95688  			return int32(16)
 95689  		}
 95690  		return int32(0)
 95691  	}()))
 95692  	_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(35), _iSorter, int32(0))
 95693  	if int32(_pIndex.XonError) != int32(0) {
 95694  		_4_j2 = _sqlite3VdbeCurrentAddr(tls, _v) + int32(3)
 95695  		_sqlite3VdbeGoto(tls, _v, _4_j2)
 95696  		_addr2 = _sqlite3VdbeCurrentAddr(tls, _v)
 95697  		_sqlite3VdbeAddOp4Int(tls, _v, int32(122), _iSorter, _4_j2, _regRecord, int32(_pIndex.XnKeyCol))
 95698  		_sqlite3UniqueConstraint(tls, _pParse, int32(2), _pIndex)
 95699  		goto _12
 95700  	}
 95701  	_addr2 = _sqlite3VdbeCurrentAddr(tls, _v)
 95702  _12:
 95703  	_sqlite3VdbeAddOp3(tls, _v, int32(123), _iSorter, _regRecord, _iIdx)
 95704  	_sqlite3VdbeAddOp3(tls, _v, int32(33), _iIdx, int32(0), int32(-1))
 95705  	_sqlite3VdbeAddOp2(tls, _v, int32(128), _iIdx, _regRecord)
 95706  	_sqlite3VdbeChangeP5(tls, _v, uint16(16))
 95707  	_sqlite3ReleaseTempReg(tls, _pParse, _regRecord)
 95708  	_sqlite3VdbeAddOp2(tls, _v, int32(3), _iSorter, _addr2)
 95709  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 95710  	_sqlite3VdbeAddOp1(tls, _v, int32(114), _iTab)
 95711  	_sqlite3VdbeAddOp1(tls, _v, int32(114), _iIdx)
 95712  	_sqlite3VdbeAddOp1(tls, _v, int32(114), _iSorter)
 95713  }
 95714  
 95715  var _sqlite3RefillIndexØ00__func__Ø000 [19]int8
 95716  
 95717  func init() {
 95718  	crt.Xstrncpy(nil, &_sqlite3RefillIndexØ00__func__Ø000[0], str(113710), 19)
 95719  }
 95720  
 95721  // C comment
 95722  //  /*
 95723  //  ** If a prior call to sqlite3GenerateIndexKey() generated a jump-over label
 95724  //  ** because it was a partial index, then this routine should be called to
 95725  //  ** resolve that label.
 95726  //  */
 95727  func _sqlite3ResolvePartIdxLabel(tls *crt.TLS, _pParse *XParse, _iLabel int32) {
 95728  	if _iLabel != 0 {
 95729  		_sqlite3VdbeResolveLabel(tls, (*TVdbe)(_pParse.XpVdbe), _iLabel)
 95730  		_sqlite3ExprCachePop(tls, _pParse)
 95731  	}
 95732  }
 95733  
 95734  // C comment
 95735  //  /*
 95736  //  ** Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation.
 95737  //  */
 95738  func _sqlite3UniqueConstraint(tls *crt.TLS, _pParse *XParse, _onError int32, _pIdx *XIndex) {
 95739  	var _j int32
 95740  	var _zErr, _3_zCol *int8
 95741  	var _pTab *XTable
 95742  	var _errMsg XStrAccum
 95743  	_pTab = (*XTable)(_pIdx.XpTable)
 95744  	_sqlite3StrAccumInit(tls, &_errMsg, (*Xsqlite3)(_pParse.Xdb), nil, int32(0), int32(200))
 95745  	if _pIdx.XaColExpr != nil {
 95746  		_sqlite3XPrintf(tls, &_errMsg, str(113729), unsafe.Pointer(_pIdx.XzName))
 95747  		goto _1
 95748  	}
 95749  	_j = int32(0)
 95750  _2:
 95751  	if _j >= int32(_pIdx.XnKeyCol) {
 95752  		goto _5
 95753  	}
 95754  	func() {
 95755  		if int32(*elem52(_pIdx.XaiColumn, uintptr(_j))) < int32(0) {
 95756  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103877), unsafe.Pointer(&_sqlite3UniqueConstraintØ00__func__Ø000), unsafe.Pointer(str(113740)))
 95757  			crt.X__builtin_abort(tls)
 95758  		}
 95759  	}()
 95760  	_3_zCol = elem43((*XColumn)(_pTab.XaCol), uintptr(*elem52(_pIdx.XaiColumn, uintptr(_j)))).XzName
 95761  	if _j != 0 {
 95762  		_sqlite3StrAccumAppend(tls, &_errMsg, str(113761), int32(2))
 95763  	}
 95764  	_sqlite3XPrintf(tls, &_errMsg, str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(_3_zCol))
 95765  	_j += 1
 95766  	goto _2
 95767  _5:
 95768  _1:
 95769  	_zErr = _sqlite3StrAccumFinish(tls, &_errMsg)
 95770  	_sqlite3HaltConstraint(tls, _pParse, func() int32 {
 95771  		if int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2) {
 95772  			return int32(1555)
 95773  		}
 95774  		return int32(2067)
 95775  	}(), _onError, _zErr, int8(-1), uint8(2))
 95776  }
 95777  
 95778  var _sqlite3UniqueConstraintØ00__func__Ø000 [24]int8
 95779  
 95780  func init() {
 95781  	crt.Xstrncpy(nil, &_sqlite3UniqueConstraintØ00__func__Ø000[0], str(113764), 24)
 95782  }
 95783  
 95784  // C comment
 95785  //  /*
 95786  //  ** Generate code that will increment the schema cookie.
 95787  //  **
 95788  //  ** The schema cookie is used to determine when the schema for the
 95789  //  ** database changes.  After each schema change, the cookie value
 95790  //  ** changes.  When a process first reads the schema it records the
 95791  //  ** cookie.  Thereafter, whenever it goes to access the database,
 95792  //  ** it checks the cookie to make sure the schema has not changed
 95793  //  ** since it was last read.
 95794  //  **
 95795  //  ** This plan is not completely bullet-proof.  It is possible for
 95796  //  ** the schema to change multiple times and for the cookie to be
 95797  //  ** set back to prior value.  But schema changes are infrequent
 95798  //  ** and the probability of hitting the same cookie value is only
 95799  //  ** 1 chance in 2^32.  So we're safe enough.
 95800  //  **
 95801  //  ** IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments
 95802  //  ** the schema-version whenever the schema changes.
 95803  //  */
 95804  func _sqlite3ChangeCookie(tls *crt.TLS, _pParse *XParse, _iDb int32) {
 95805  	var _db *Xsqlite3
 95806  	var _v *TVdbe
 95807  	_db = (*Xsqlite3)(_pParse.Xdb)
 95808  	_v = (*TVdbe)(_pParse.XpVdbe)
 95809  	func() {
 95810  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 95811  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101170), unsafe.Pointer(&_sqlite3ChangeCookieØ00__func__Ø000), unsafe.Pointer(str(51126)))
 95812  			crt.X__builtin_abort(tls)
 95813  		}
 95814  	}()
 95815  	_sqlite3VdbeAddOp3(tls, _v, int32(104), _iDb, int32(1), ((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).Xschema_cookie)+int32(1))
 95816  }
 95817  
 95818  var _sqlite3ChangeCookieØ00__func__Ø000 [20]int8
 95819  
 95820  func init() {
 95821  	crt.Xstrncpy(nil, &_sqlite3ChangeCookieØ00__func__Ø000[0], str(113788), 20)
 95822  }
 95823  
 95824  // C comment
 95825  //  /*
 95826  //  ** Add an OP_ParseSchema opcode.  This routine is broken out from
 95827  //  ** sqlite3VdbeAddOp4() since it needs to also needs to mark all btrees
 95828  //  ** as having been used.
 95829  //  **
 95830  //  ** The zWhere string must have been obtained from sqlite3_malloc().
 95831  //  ** This routine will take ownership of the allocated memory.
 95832  //  */
 95833  func _sqlite3VdbeAddParseSchemaOp(tls *crt.TLS, _p *TVdbe, _iDb int32, _zWhere *int8) {
 95834  	var _j int32
 95835  	_sqlite3VdbeAddOp4(tls, _p, int32(139), _iDb, int32(0), int32(0), _zWhere, int32(-1))
 95836  	_j = int32(0)
 95837  _0:
 95838  	if _j >= ((*Xsqlite3)(_p.Xdb).XnDb) {
 95839  		goto _3
 95840  	}
 95841  	_sqlite3VdbeUsesBtree(tls, _p, _j)
 95842  	_j += 1
 95843  	goto _0
 95844  _3:
 95845  }
 95846  
 95847  // C comment
 95848  //  /*
 95849  //  ** Resize an Index object to hold N columns total.  Return SQLITE_OK
 95850  //  ** on success and SQLITE_NOMEM on an OOM error.
 95851  //  */
 95852  func _resizeIndexObject(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex, _N int32) (r0 int32) {
 95853  	var _nByte int32
 95854  	var _zExtra *int8
 95855  	if int32(_pIdx.XnColumn) >= _N {
 95856  		return int32(0)
 95857  	}
 95858  	func() {
 95859  		if int32((uint32(_pIdx.XidxType>>4)<<31)>>31) != int32(0) {
 95860  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101304), unsafe.Pointer(&_resizeIndexObjectØ00__func__Ø000), unsafe.Pointer(str(113808)))
 95861  			crt.X__builtin_abort(tls)
 95862  		}
 95863  	}()
 95864  	_nByte = int32(uint64(11) * uint64(_N))
 95865  	_zExtra = (*int8)(_sqlite3DbMallocZero(tls, _db, uint64(_nByte)))
 95866  	if _zExtra == nil {
 95867  		return _sqlite3NomemError(tls, int32(101307))
 95868  	}
 95869  	crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_pIdx.XazColl), uint64(8)*uint64(_pIdx.XnColumn))
 95870  	_pIdx.XazColl = (**int8)(unsafe.Pointer(_zExtra))
 95871  	*(*uintptr)(unsafe.Pointer(&_zExtra)) += uintptr(uint64(8) * uint64(_N))
 95872  	crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_pIdx.XaiColumn), uint64(2)*uint64(_pIdx.XnColumn))
 95873  	_pIdx.XaiColumn = (*int16)(unsafe.Pointer(_zExtra))
 95874  	*(*uintptr)(unsafe.Pointer(&_zExtra)) += uintptr(uint64(2) * uint64(_N))
 95875  	crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_pIdx.XaSortOrder), uint64(_pIdx.XnColumn))
 95876  	_pIdx.XaSortOrder = (*uint8)(unsafe.Pointer(_zExtra))
 95877  	_pIdx.XnColumn = uint16(_N)
 95878  	storebits5(&_pIdx.XidxType, int8(1), 16, 4)
 95879  	return int32(0)
 95880  }
 95881  
 95882  var _resizeIndexObjectØ00__func__Ø000 [18]int8
 95883  
 95884  func init() {
 95885  	crt.Xstrncpy(nil, &_resizeIndexObjectØ00__func__Ø000[0], str(113827), 18)
 95886  }
 95887  
 95888  // C comment
 95889  //  /*
 95890  //  ** Estimate the total row width for a table.
 95891  //  */
 95892  func _estimateTableWidth(tls *crt.TLS, _pTab *XTable) {
 95893  	var _i int32
 95894  	var _wTable uint32
 95895  	var _pTabCol *XColumn
 95896  	_wTable = uint32(0)
 95897  	*func() **XColumn { _i = int32(_pTab.XnCol); return &_pTabCol }() = (*XColumn)(_pTab.XaCol)
 95898  _0:
 95899  	if _i <= int32(0) {
 95900  		goto _3
 95901  	}
 95902  	_wTable += uint32(_pTabCol.XszEst)
 95903  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i -= 1; return &_pTabCol }())) += uintptr(32)
 95904  	goto _0
 95905  _3:
 95906  	if int32(_pTab.XiPKey) < int32(0) {
 95907  		_wTable += 1
 95908  	}
 95909  	_pTab.XszTabRow = _sqlite3LogEst(tls, uint64(_wTable*uint32(4)))
 95910  }
 95911  
 95912  // C comment
 95913  //  /*
 95914  //  ** Compute the affinity string for table pTab, if it has not already been
 95915  //  ** computed.  As an optimization, omit trailing SQLITE_AFF_BLOB affinities.
 95916  //  **
 95917  //  ** If the affinity exists (if it is no entirely SQLITE_AFF_BLOB values) and
 95918  //  ** if iReg>0 then code an OP_Affinity opcode that will set the affinities
 95919  //  ** for register iReg and following.  Or if affinities exists and iReg==0,
 95920  //  ** then just set the P4 operand of the previous opcode (which should  be
 95921  //  ** an OP_MakeRecord) to the affinity string.
 95922  //  **
 95923  //  ** A column affinity string has one character per column:
 95924  //  **
 95925  //  **  Character      Column affinity
 95926  //  **  ------------------------------
 95927  //  **  'A'            BLOB
 95928  //  **  'B'            TEXT
 95929  //  **  'C'            NUMERIC
 95930  //  **  'D'            INTEGER
 95931  //  **  'E'            REAL
 95932  //  */
 95933  func _sqlite3TableAffinity(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _iReg int32) {
 95934  	var _i int32
 95935  	var _zColAff *int8
 95936  	var _1_db *Xsqlite3
 95937  	_zColAff = _pTab.XzColAff
 95938  	if _zColAff != nil {
 95939  		goto _0
 95940  	}
 95941  	_1_db = _sqlite3VdbeDb(tls, _v)
 95942  	_zColAff = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(int32(_pTab.XnCol)+int32(1))))
 95943  	if _zColAff == nil {
 95944  		_sqlite3OomFault(tls, _1_db)
 95945  		return
 95946  	}
 95947  	_i = int32(0)
 95948  _2:
 95949  	if _i >= int32(_pTab.XnCol) {
 95950  		goto _5
 95951  	}
 95952  	*elem1(_zColAff, uintptr(_i)) = elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).Xaffinity
 95953  	_i += 1
 95954  	goto _2
 95955  _5:
 95956  	*elem1(_zColAff, uintptr(postInc2(&_i, -1))) = 0
 95957  	if (_i >= int32(0)) && (int32(*elem1(_zColAff, uintptr(_i))) == int32(65)) {
 95958  		goto _5
 95959  	}
 95960  	_pTab.XzColAff = _zColAff
 95961  _0:
 95962  	_i = _sqlite3Strlen30(tls, _zColAff)
 95963  	if _i == 0 {
 95964  		goto _8
 95965  	}
 95966  	if _iReg != 0 {
 95967  		_sqlite3VdbeAddOp4(tls, _v, int32(100), _iReg, _i, int32(0), _zColAff, _i)
 95968  		goto _10
 95969  	}
 95970  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), _zColAff, _i)
 95971  _10:
 95972  _8:
 95973  }
 95974  
 95975  // C comment
 95976  //  /*
 95977  //  ** Generate a CREATE TABLE statement appropriate for the given
 95978  //  ** table.  Memory to hold the text of the statement is obtained
 95979  //  ** from sqliteMalloc() and must be freed by the calling function.
 95980  //  */
 95981  func _createTableStmt(tls *crt.TLS, _db *Xsqlite3, _p *XTable) (r0 *int8) {
 95982  	var _i, _k, _n, _5_len int32
 95983  	var _zStmt, _zSep, _zSep2, _zEnd, _5_zType *int8
 95984  	var _pCol *XColumn
 95985  	_n = int32(0)
 95986  	*func() *int32 { _pCol = (*XColumn)(_p.XaCol); return &_i }() = int32(0)
 95987  _0:
 95988  	if _i >= int32(_p.XnCol) {
 95989  		goto _3
 95990  	}
 95991  	_n += _identLength(tls, _pCol.XzName) + int32(5)
 95992  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(32)
 95993  	goto _0
 95994  _3:
 95995  	_n += _identLength(tls, _p.XzName)
 95996  	if _n < int32(50) {
 95997  		_zSep = str(284)
 95998  		_zSep2 = str(107791)
 95999  		_zEnd = str(37853)
 96000  		goto _5
 96001  	}
 96002  	_zSep = str(113845)
 96003  	_zSep2 = str(113849)
 96004  	_zEnd = str(113854)
 96005  _5:
 96006  	_n += int32(35) + (int32(6) * int32(_p.XnCol))
 96007  	_zStmt = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(_n)))
 96008  	if _zStmt == nil {
 96009  		_sqlite3OomFault(tls, _db)
 96010  		return nil
 96011  	}
 96012  	Xsqlite3_snprintf(tls, _n, _zStmt, str(113857))
 96013  	_k = _sqlite3Strlen30(tls, _zStmt)
 96014  	_identPut(tls, _zStmt, &_k, _p.XzName)
 96015  	*elem1(_zStmt, uintptr(postInc2(&_k, 1))) = int8(40)
 96016  	*func() *int32 { _pCol = (*XColumn)(_p.XaCol); return &_i }() = int32(0)
 96017  _7:
 96018  	if _i >= int32(_p.XnCol) {
 96019  		goto _10
 96020  	}
 96021  	Xsqlite3_snprintf(tls, _n-_k, elem1(_zStmt, uintptr(_k)), _zSep)
 96022  	_k += _sqlite3Strlen30(tls, elem1(_zStmt, uintptr(_k)))
 96023  	_zSep = _zSep2
 96024  	_identPut(tls, _zStmt, &_k, _pCol.XzName)
 96025  	func() {
 96026  		if (int32(_pCol.Xaffinity) - int32(65)) < int32(0) {
 96027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101276), unsafe.Pointer(&_createTableStmtØ00__func__Ø000), unsafe.Pointer(str(113871)))
 96028  			crt.X__builtin_abort(tls)
 96029  		}
 96030  	}()
 96031  	func() {
 96032  		if (int32(_pCol.Xaffinity) - int32(65)) >= int32(5) {
 96033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101277), unsafe.Pointer(&_createTableStmtØ00__func__Ø000), unsafe.Pointer(str(113907)))
 96034  			crt.X__builtin_abort(tls)
 96035  		}
 96036  	}()
 96037  	_5_zType = *elem0((**int8)(unsafe.Pointer(&_createTableStmtØ00azTypeØ001)), uintptr(int32(_pCol.Xaffinity)-int32(65)))
 96038  	_5_len = _sqlite3Strlen30(tls, _5_zType)
 96039  	func() {
 96040  		if int32(_pCol.Xaffinity) != int32(65) && int32(_pCol.Xaffinity) != int32(_sqlite3AffinityType(tls, _5_zType, nil)) {
 96041  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101286), unsafe.Pointer(&_createTableStmtØ00__func__Ø000), unsafe.Pointer(str(113958)))
 96042  			crt.X__builtin_abort(tls)
 96043  		}
 96044  	}()
 96045  	crt.Xmemcpy(tls, unsafe.Pointer(elem1(_zStmt, uintptr(_k))), unsafe.Pointer(_5_zType), uint64(_5_len))
 96046  	_k += _5_len
 96047  	func() {
 96048  		if _k > _n {
 96049  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101290), unsafe.Pointer(&_createTableStmtØ00__func__Ø000), unsafe.Pointer(str(114039)))
 96050  			crt.X__builtin_abort(tls)
 96051  		}
 96052  	}()
 96053  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(32)
 96054  	goto _7
 96055  _10:
 96056  	Xsqlite3_snprintf(tls, _n-_k, elem1(_zStmt, uintptr(_k)), str(24531), unsafe.Pointer(_zEnd))
 96057  	return _zStmt
 96058  }
 96059  
 96060  // C comment
 96061  //  /*
 96062  //  ** Measure the number of characters needed to output the given
 96063  //  ** identifier.  The number returned includes any quotes used
 96064  //  ** but does not include the null terminator.
 96065  //  **
 96066  //  ** The estimate is conservative.  It might be larger that what is
 96067  //  ** really needed.
 96068  //  */
 96069  func _identLength(tls *crt.TLS, _z *int8) (r0 int32) {
 96070  	var _n int32
 96071  	_n = int32(0)
 96072  _0:
 96073  	if (*_z) == 0 {
 96074  		goto _3
 96075  	}
 96076  	if int32(*_z) == int32(34) {
 96077  		_n += 1
 96078  	}
 96079  	*(*uintptr)(unsafe.Pointer(func() **int8 { _n += 1; return &_z }())) += uintptr(1)
 96080  	goto _0
 96081  _3:
 96082  	return _n + int32(2)
 96083  }
 96084  
 96085  // C comment
 96086  //  /*
 96087  //  ** The first parameter is a pointer to an output buffer. The second
 96088  //  ** parameter is a pointer to an integer that contains the offset at
 96089  //  ** which to write into the output buffer. This function copies the
 96090  //  ** nul-terminated string pointed to by the third parameter, zSignedIdent,
 96091  //  ** to the specified offset in the buffer and updates *pIdx to refer
 96092  //  ** to the first byte after the last byte written before returning.
 96093  //  **
 96094  //  ** If the string zSignedIdent consists entirely of alpha-numeric
 96095  //  ** characters, does not begin with a digit and is not an SQL keyword,
 96096  //  ** then it is copied to the output buffer exactly as it is. Otherwise,
 96097  //  ** it is quoted using double-quotes.
 96098  //  */
 96099  func _identPut(tls *crt.TLS, _z *int8, _pIdx *int32, _zSignedIdent *int8) {
 96100  	var _i, _j, _needQuote int32
 96101  	var _zIdent *uint8
 96102  	_zIdent = (*uint8)(unsafe.Pointer(_zSignedIdent))
 96103  	_i = *_pIdx
 96104  	_j = int32(0)
 96105  _0:
 96106  	if (*elem15(_zIdent, uintptr(_j))) == 0 {
 96107  		goto _3
 96108  	}
 96109  	if ((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_zIdent, uintptr(_j))))) & int32(6)) == 0) && (int32(*elem15(_zIdent, uintptr(_j))) != int32(95)) {
 96110  		goto _3
 96111  	}
 96112  	_j += 1
 96113  	goto _0
 96114  _3:
 96115  	_needQuote = bool2int((((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_zIdent, 0))))&int32(4)) != 0 || (_sqlite3KeywordCode(tls, _zIdent, _j) != int32(27))) || (int32(*elem15(_zIdent, uintptr(_j))) != int32(0))) || (_j == int32(0)))
 96116  	if _needQuote != 0 {
 96117  		*elem1(_z, uintptr(postInc2(&_i, 1))) = int8(34)
 96118  	}
 96119  	_j = int32(0)
 96120  _10:
 96121  	if (*elem15(_zIdent, uintptr(_j))) == 0 {
 96122  		goto _13
 96123  	}
 96124  	*elem1(_z, uintptr(postInc2(&_i, 1))) = int8(*elem15(_zIdent, uintptr(_j)))
 96125  	if int32(*elem15(_zIdent, uintptr(_j))) == int32(34) {
 96126  		*elem1(_z, uintptr(postInc2(&_i, 1))) = int8(34)
 96127  	}
 96128  	_j += 1
 96129  	goto _10
 96130  _13:
 96131  	if _needQuote != 0 {
 96132  		*elem1(_z, uintptr(postInc2(&_i, 1))) = int8(34)
 96133  	}
 96134  	*elem1(_z, uintptr(_i)) = 0
 96135  	*_pIdx = _i
 96136  }
 96137  
 96138  func _sqlite3KeywordCode(tls *crt.TLS, _z *uint8, _n int32) (r0 int32) {
 96139  	var _id int32
 96140  	_id = int32(27)
 96141  	_keywordCode(tls, (*int8)(unsafe.Pointer(_z)), _n, &_id)
 96142  	return _id
 96143  }
 96144  
 96145  var _createTableStmtØ00__func__Ø000 [16]int8
 96146  
 96147  func init() {
 96148  	crt.Xstrncpy(nil, &_createTableStmtØ00__func__Ø000[0], str(114044), 16)
 96149  }
 96150  
 96151  var _createTableStmtØ00azTypeØ001 [5]*int8
 96152  
 96153  func init() {
 96154  	_createTableStmtØ00azTypeØ001 = [5]*int8{str(284), str(114060), str(114066), str(114071), str(114076)}
 96155  }
 96156  
 96157  // C comment
 96158  //  /*
 96159  //  ** pZ is a UTF-8 encoded unicode string. If nByte is less than zero,
 96160  //  ** return the number of unicode characters in pZ up to (but not including)
 96161  //  ** the first 0x00 byte. If nByte is not less than zero, return the
 96162  //  ** number of unicode characters in the first nByte of pZ (or up to
 96163  //  ** the first 0x00, whichever comes first).
 96164  //  */
 96165  func _sqlite3Utf8CharLen(tls *crt.TLS, _zIn *int8, _nByte int32) (r0 int32) {
 96166  	var _r int32
 96167  	var _z, _zTerm *uint8
 96168  	_r = int32(0)
 96169  	_z = (*uint8)(unsafe.Pointer(_zIn))
 96170  	if _nByte >= int32(0) {
 96171  		_zTerm = elem15(_z, uintptr(_nByte))
 96172  		goto _1
 96173  	}
 96174  	_zTerm = (*uint8)(crt.U2P(uintptr(uint64(18446744073709551615))))
 96175  _1:
 96176  	func() {
 96177  		if crt.P2U(unsafe.Pointer(_z)) > crt.P2U(unsafe.Pointer(_zTerm)) {
 96178  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27515), unsafe.Pointer(&_sqlite3Utf8CharLenØ00__func__Ø000), unsafe.Pointer(str(114082)))
 96179  			crt.X__builtin_abort(tls)
 96180  		}
 96181  	}()
 96182  _4:
 96183  	if int32(*_z) == int32(0) || crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zTerm)) {
 96184  		goto _5
 96185  	}
 96186  	if int32(*postInc15(&_z, 1)) < int32(192) {
 96187  		goto _7
 96188  	}
 96189  _8:
 96190  	if (int32(*_z) & int32(192)) == int32(128) {
 96191  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 96192  		goto _8
 96193  	}
 96194  _7:
 96195  	_r += 1
 96196  	goto _4
 96197  _5:
 96198  	return _r
 96199  }
 96200  
 96201  var _sqlite3Utf8CharLenØ00__func__Ø000 [19]int8
 96202  
 96203  func init() {
 96204  	crt.Xstrncpy(nil, &_sqlite3Utf8CharLenØ00__func__Ø000[0], str(114091), 19)
 96205  }
 96206  
 96207  // C comment
 96208  //  /*
 96209  //  ** Add a new column to the table currently being constructed.
 96210  //  **
 96211  //  ** The parser calls this routine once for each column declaration
 96212  //  ** in a CREATE TABLE statement.  sqlite3StartTable() gets called
 96213  //  ** first to get things going.  Then this routine is called for each
 96214  //  ** column.
 96215  //  */
 96216  func _sqlite3AddColumn(tls *crt.TLS, _pParse *XParse, _pName *XToken, _pType *XToken) {
 96217  	var _i int32
 96218  	var _z, _zType *int8
 96219  	var _db *Xsqlite3
 96220  	var _p *XTable
 96221  	var _pCol, _4_aNew *XColumn
 96222  	_db = (*Xsqlite3)(_pParse.Xdb)
 96223  	if store74(&_p, (*XTable)(_pParse.XpNewTable)) == nil {
 96224  		return
 96225  	}
 96226  	if (int32(_p.XnCol) + int32(1)) > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(2))) {
 96227  		_sqlite3ErrorMsg(tls, _pParse, str(114110), unsafe.Pointer(_p.XzName))
 96228  		return
 96229  	}
 96230  	_z = (*int8)(_sqlite3DbMallocRaw(tls, _db, uint64((_pName.Xn+_pType.Xn)+uint32(2))))
 96231  	if _z == nil {
 96232  		return
 96233  	}
 96234  	crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(_pName.Xz), uint64(_pName.Xn))
 96235  	*elem1(_z, uintptr(_pName.Xn)) = 0
 96236  	_sqlite3Dequote(tls, _z)
 96237  	_i = int32(0)
 96238  _3:
 96239  	if _i >= int32(_p.XnCol) {
 96240  		goto _6
 96241  	}
 96242  	if Xsqlite3_stricmp(tls, _z, elem43((*XColumn)(_p.XaCol), uintptr(_i)).XzName) == int32(0) {
 96243  		_sqlite3ErrorMsg(tls, _pParse, str(114133), unsafe.Pointer(_z))
 96244  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
 96245  		return
 96246  	}
 96247  	_i += 1
 96248  	goto _3
 96249  _6:
 96250  	if (int32(_p.XnCol) & int32(7)) != int32(0) {
 96251  		goto _8
 96252  	}
 96253  	_4_aNew = (*XColumn)(_sqlite3DbRealloc(tls, _db, _p.XaCol, uint64(int32(_p.XnCol)+int32(8))*uint64(32)))
 96254  	if _4_aNew == nil {
 96255  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
 96256  		return
 96257  	}
 96258  	*(**XColumn)(unsafe.Pointer(&_p.XaCol)) = _4_aNew
 96259  _8:
 96260  	_pCol = elem43((*XColumn)(_p.XaCol), uintptr(_p.XnCol))
 96261  	crt.Xmemset(tls, unsafe.Pointer(_pCol), int32(0), uint64(32))
 96262  	_pCol.XzName = _z
 96263  	if _pType.Xn == (0) {
 96264  		_pCol.Xaffinity = int8(65)
 96265  		_pCol.XszEst = uint8(1)
 96266  		goto _11
 96267  	}
 96268  	_zType = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_sqlite3Strlen30(tls, _z)))))) + uintptr(int32(1))))
 96269  	crt.Xmemcpy(tls, unsafe.Pointer(_zType), unsafe.Pointer(_pType.Xz), uint64(_pType.Xn))
 96270  	*elem1(_zType, uintptr(_pType.Xn)) = 0
 96271  	_sqlite3Dequote(tls, _zType)
 96272  	_pCol.Xaffinity = _sqlite3AffinityType(tls, _zType, &_pCol.XszEst)
 96273  	{
 96274  		p := &_pCol.XcolFlags
 96275  		*p = uint8(int32(*p) | int32(4))
 96276  	}
 96277  _11:
 96278  	_p.XnCol += 1
 96279  	_pParse.XconstraintName.Xn = 0
 96280  }
 96281  
 96282  // C comment
 96283  //  /*
 96284  //  ** The expression is the default value for the most recently added column
 96285  //  ** of the table currently under construction.
 96286  //  **
 96287  //  ** Default value expressions must be constant.  Raise an exception if this
 96288  //  ** is not the case.
 96289  //  **
 96290  //  ** This routine is called by the parser while in the middle of
 96291  //  ** parsing a CREATE TABLE statement.
 96292  //  */
 96293  func _sqlite3AddDefaultValue(tls *crt.TLS, _pParse *XParse, _pSpan *XExprSpan) {
 96294  	var _db *Xsqlite3
 96295  	var _p *XTable
 96296  	var _3_x XExpr
 96297  	var _pCol *XColumn
 96298  	_db = (*Xsqlite3)(_pParse.Xdb)
 96299  	_p = (*XTable)(_pParse.XpNewTable)
 96300  	if _p == nil {
 96301  		goto _0
 96302  	}
 96303  	_pCol = elem43((*XColumn)(_p.XaCol), uintptr(int32(_p.XnCol)-int32(1)))
 96304  	if _sqlite3ExprIsConstantOrFunction(tls, (*XExpr)(_pSpan.XpExpr), _db.Xinit.Xbusy) == 0 {
 96305  		_sqlite3ErrorMsg(tls, _pParse, str(114159), unsafe.Pointer(_pCol.XzName))
 96306  		goto _2
 96307  	}
 96308  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pCol.XpDflt))
 96309  	crt.Xmemset(tls, unsafe.Pointer(&_3_x), int32(0), uint64(72))
 96310  	_3_x.Xop = uint8(162)
 96311  	*(**int8)(unsafe.Pointer(&_3_x.Xu)) = _sqlite3DbStrNDup(tls, _db, _pSpan.XzStart, uint64(int32(int64(uintptr(unsafe.Pointer(_pSpan.XzEnd))-uintptr(unsafe.Pointer(_pSpan.XzStart))))))
 96312  	*(**XExpr)(unsafe.Pointer(&_3_x.XpLeft)) = (*XExpr)(_pSpan.XpExpr)
 96313  	_3_x.Xflags = uint32(4096)
 96314  	*(**XExpr)(unsafe.Pointer(&_pCol.XpDflt)) = _sqlite3ExprDup(tls, _db, &_3_x, int32(1))
 96315  	_sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_3_x.Xu))))
 96316  _2:
 96317  _0:
 96318  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pSpan.XpExpr))
 96319  }
 96320  
 96321  // C comment
 96322  //  /*
 96323  //  ** Walk an expression tree.  Return non-zero if the expression is constant
 96324  //  ** or a function call with constant arguments.  Return and 0 if there
 96325  //  ** are any variables.
 96326  //  **
 96327  //  ** For the purposes of this function, a double-quoted string (ex: "abc")
 96328  //  ** is considered a variable but a single-quoted string (ex: 'abc') is
 96329  //  ** a constant.
 96330  //  */
 96331  func _sqlite3ExprIsConstantOrFunction(tls *crt.TLS, _p *XExpr, _isInit uint8) (r0 int32) {
 96332  	func() {
 96333  		if int32(_isInit) != int32(0) && int32(_isInit) != int32(1) {
 96334  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92783), unsafe.Pointer(&_sqlite3ExprIsConstantOrFunctionØ00__func__Ø000), unsafe.Pointer(str(114204)))
 96335  			crt.X__builtin_abort(tls)
 96336  		}
 96337  	}()
 96338  	return _exprIsConst(tls, _p, int32(4)+int32(_isInit), int32(0))
 96339  }
 96340  
 96341  var _sqlite3ExprIsConstantOrFunctionØ00__func__Ø000 [32]int8
 96342  
 96343  func init() {
 96344  	crt.Xstrncpy(nil, &_sqlite3ExprIsConstantOrFunctionØ00__func__Ø000[0], str(114227), 32)
 96345  }
 96346  
 96347  func _spanExpr(tls *crt.TLS, _pOut *XExprSpan, _pParse *XParse, _op int32, _t XToken) {
 96348  	var _p *XExpr
 96349  	_p = (*XExpr)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.Xdb), (uint64(72)+uint64(_t.Xn))+uint64(1)))
 96350  	if _p == nil {
 96351  		goto _0
 96352  	}
 96353  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(72))
 96354  	_p.Xop = uint8(_op)
 96355  	_p.Xflags = uint32(8388608)
 96356  	_p.XiAgg = int16(-1)
 96357  	*(**int8)(unsafe.Pointer(&_p.Xu)) = (*int8)(unsafe.Pointer(elem60(_p, uintptr(1))))
 96358  	crt.Xmemcpy(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_p.Xu))), unsafe.Pointer(_t.Xz), uint64(_t.Xn))
 96359  	*elem1(*(**int8)(unsafe.Pointer(&_p.Xu)), uintptr(_t.Xn)) = 0
 96360  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(*(**int8)(unsafe.Pointer(&_p.Xu)), 0))))) & int32(128)) == 0 {
 96361  		goto _1
 96362  	}
 96363  	if int32(*elem1(*(**int8)(unsafe.Pointer(&_p.Xu)), 0)) == int32(34) {
 96364  		_p.Xflags |= uint32(64)
 96365  	}
 96366  	_sqlite3Dequote(tls, *(**int8)(unsafe.Pointer(&_p.Xu)))
 96367  _1:
 96368  	_p.XnHeight = int32(1)
 96369  _0:
 96370  	*(**XExpr)(unsafe.Pointer(&_pOut.XpExpr)) = _p
 96371  	_pOut.XzStart = _t.Xz
 96372  	_pOut.XzEnd = elem1(_t.Xz, uintptr(_t.Xn))
 96373  }
 96374  
 96375  // C comment
 96376  //  /*
 96377  //  ** This routine is called by the parser while in the middle of
 96378  //  ** parsing a CREATE TABLE statement.  A "NOT NULL" constraint has
 96379  //  ** been seen on a column.  This routine sets the notNull flag on
 96380  //  ** the column currently under construction.
 96381  //  */
 96382  func _sqlite3AddNotNull(tls *crt.TLS, _pParse *XParse, _onError int32) {
 96383  	var _p *XTable
 96384  	_p = (*XTable)(_pParse.XpNewTable)
 96385  	if (_p == nil) || func() int32 {
 96386  		if int32(_p.XnCol) < int32(1) {
 96387  			return func() int32 {
 96388  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100812), unsafe.Pointer(&_sqlite3AddNotNullØ00__func__Ø000), unsafe.Pointer(str(4809)))
 96389  				crt.X__builtin_abort(tls)
 96390  				return int32(1)
 96391  			}()
 96392  		}
 96393  		return int32(0)
 96394  	}() != 0 {
 96395  		return
 96396  	}
 96397  	elem43((*XColumn)(_p.XaCol), uintptr(int32(_p.XnCol)-int32(1))).XnotNull = uint8(_onError)
 96398  	_p.XtabFlags |= uint32(512)
 96399  }
 96400  
 96401  var _sqlite3AddNotNullØ00__func__Ø000 [18]int8
 96402  
 96403  func init() {
 96404  	crt.Xstrncpy(nil, &_sqlite3AddNotNullØ00__func__Ø000[0], str(114259), 18)
 96405  }
 96406  
 96407  // C comment
 96408  //  /*
 96409  //  ** Designate the PRIMARY KEY for the table.  pList is a list of names
 96410  //  ** of columns that form the primary key.  If pList is NULL, then the
 96411  //  ** most recently added column of the table is the primary key.
 96412  //  **
 96413  //  ** A table can have at most one primary key.  If the table already has
 96414  //  ** a primary key (and this is the second primary key) then create an
 96415  //  ** error.
 96416  //  **
 96417  //  ** If the PRIMARY KEY is on a single column whose datatype is INTEGER,
 96418  //  ** then we will try to use that column as the rowid.  Set the Table.iPKey
 96419  //  ** field of the table under construction to be the index of the
 96420  //  ** INTEGER PRIMARY KEY column.  Table.iPKey is set to -1 if there is
 96421  //  ** no INTEGER PRIMARY KEY.
 96422  //  **
 96423  //  ** If the key is not an INTEGER PRIMARY KEY, then create a unique
 96424  //  ** index for the key.  No index is created for INTEGER PRIMARY KEYs.
 96425  //  */
 96426  func _sqlite3AddPrimaryKey(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _onError int32, _autoInc int32, _sortOrder int32) {
 96427  	var _iCol, _i, _nTerm int32
 96428  	var _5_zCName *int8
 96429  	var _pTab *XTable
 96430  	var _4_pCExpr *XExpr
 96431  	var _pCol *XColumn
 96432  	_pTab = (*XTable)(_pParse.XpNewTable)
 96433  	_pCol = nil
 96434  	_iCol = int32(-1)
 96435  	if _pTab == nil {
 96436  		goto _primary_key_exit
 96437  	}
 96438  	if (_pTab.XtabFlags & uint32(4)) != 0 {
 96439  		_sqlite3ErrorMsg(tls, _pParse, str(114277), unsafe.Pointer(_pTab.XzName))
 96440  		goto _primary_key_exit
 96441  	}
 96442  	_pTab.XtabFlags |= uint32(4)
 96443  	if _pList == nil {
 96444  		_iCol = int32(_pTab.XnCol) - int32(1)
 96445  		_pCol = elem43((*XColumn)(_pTab.XaCol), uintptr(_iCol))
 96446  		{
 96447  			p := &_pCol.XcolFlags
 96448  			*p = uint8(int32(*p) | int32(1))
 96449  		}
 96450  		_nTerm = int32(1)
 96451  		goto _3
 96452  	}
 96453  	_nTerm = _pList.XnExpr
 96454  	_i = int32(0)
 96455  _4:
 96456  	if _i >= _nTerm {
 96457  		goto _7
 96458  	}
 96459  	_4_pCExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))
 96460  	func() {
 96461  		if _4_pCExpr == nil {
 96462  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101013), unsafe.Pointer(&_sqlite3AddPrimaryKeyØ00__func__Ø000), unsafe.Pointer(str(114318)))
 96463  			crt.X__builtin_abort(tls)
 96464  		}
 96465  	}()
 96466  	_sqlite3StringToId(tls, _4_pCExpr)
 96467  	if int32(_4_pCExpr.Xop) != int32(27) {
 96468  		goto _10
 96469  	}
 96470  	_5_zCName = *(**int8)(unsafe.Pointer(&_4_pCExpr.Xu))
 96471  	_iCol = int32(0)
 96472  _11:
 96473  	if _iCol >= int32(_pTab.XnCol) {
 96474  		goto _14
 96475  	}
 96476  	if _sqlite3StrICmp(tls, _5_zCName, elem43((*XColumn)(_pTab.XaCol), uintptr(_iCol)).XzName) == int32(0) {
 96477  		_pCol = elem43((*XColumn)(_pTab.XaCol), uintptr(_iCol))
 96478  		{
 96479  			p := &_pCol.XcolFlags
 96480  			*p = uint8(int32(*p) | int32(1))
 96481  		}
 96482  		goto _14
 96483  	}
 96484  	_iCol += 1
 96485  	goto _11
 96486  _14:
 96487  _10:
 96488  	_i += 1
 96489  	goto _4
 96490  _7:
 96491  _3:
 96492  	if _nTerm != int32(1) || _pCol == nil || _sqlite3StrICmp(tls, _sqlite3ColumnType(tls, _pCol, str(284)), str(25747)) != int32(0) || _sortOrder == int32(1) {
 96493  		goto _19
 96494  	}
 96495  	_pTab.XiPKey = int16(_iCol)
 96496  	_pTab.XkeyConf = uint8(_onError)
 96497  	func() {
 96498  		if _autoInc != int32(0) && _autoInc != int32(1) {
 96499  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101034), unsafe.Pointer(&_sqlite3AddPrimaryKeyØ00__func__Ø000), unsafe.Pointer(str(114328)))
 96500  			crt.X__builtin_abort(tls)
 96501  		}
 96502  	}()
 96503  	_pTab.XtabFlags |= uint32(_autoInc * int32(8))
 96504  	if _pList != nil {
 96505  		_pParse.XiPkSortOrder = elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), 0).XsortOrder
 96506  	}
 96507  	goto _primary_key_exit
 96508  _19:
 96509  	if _autoInc != 0 {
 96510  		_sqlite3ErrorMsg(tls, _pParse, str(114353))
 96511  		goto _primary_key_exit
 96512  	}
 96513  	_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, _pList, _onError, nil, nil, _sortOrder, int32(0), uint8(2))
 96514  	_pList = nil
 96515  _primary_key_exit:
 96516  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _pList)
 96517  }
 96518  
 96519  var _sqlite3AddPrimaryKeyØ00__func__Ø000 [21]int8
 96520  
 96521  func init() {
 96522  	crt.Xstrncpy(nil, &_sqlite3AddPrimaryKeyØ00__func__Ø000[0], str(114409), 21)
 96523  }
 96524  
 96525  // C comment
 96526  //  /*
 96527  //  ** Add a new CHECK constraint to the table currently under construction.
 96528  //  */
 96529  func _sqlite3AddCheckConstraint(tls *crt.TLS, _pParse *XParse, _pCheckExpr *XExpr) {
 96530  	var _db *Xsqlite3
 96531  	var _pTab *XTable
 96532  	_pTab = (*XTable)(_pParse.XpNewTable)
 96533  	_db = (*Xsqlite3)(_pParse.Xdb)
 96534  	if _pTab == nil || _pParse.XdeclareVtab != 0 || _sqlite3BtreeIsReadonly(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_db.Xinit.XiDb)).XpBt)) != 0 {
 96535  		goto _2
 96536  	}
 96537  	*(**XExprList)(unsafe.Pointer(&_pTab.XpCheck)) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(_pTab.XpCheck), _pCheckExpr)
 96538  	if (_pParse.XconstraintName.Xn) != 0 {
 96539  		_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(_pTab.XpCheck), &_pParse.XconstraintName, int32(1))
 96540  	}
 96541  	goto _4
 96542  _2:
 96543  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), _pCheckExpr)
 96544  _4:
 96545  }
 96546  
 96547  // C comment
 96548  //  /*
 96549  //  ** Return true if the given Btree is read-only.
 96550  //  */
 96551  func _sqlite3BtreeIsReadonly(tls *crt.TLS, _p *XBtree) (r0 int32) {
 96552  	return bool2int((int32((*XBtShared)(_p.XpBt).XbtsFlags) & int32(1)) != int32(0))
 96553  }
 96554  
 96555  // C comment
 96556  //  /*
 96557  //  ** This routine is called to create a new foreign key on the table
 96558  //  ** currently under construction.  pFromCol determines which columns
 96559  //  ** in the current table point to the foreign key.  If pFromCol==0 then
 96560  //  ** connect the key to the last column inserted.  pTo is the name of
 96561  //  ** the table referred to (a.k.a the "parent" table).  pToCol is a list
 96562  //  ** of tables in the parent pTo table.  flags contains all
 96563  //  ** information about the conflict resolution algorithms specified
 96564  //  ** in the ON DELETE, ON UPDATE and ON INSERT clauses.
 96565  //  **
 96566  //  ** An FKey structure is created and added to the table currently
 96567  //  ** under construction in the pParse->pNewTable field.
 96568  //  **
 96569  //  ** The foreign key is set for IMMEDIATE processing.  A subsequent call
 96570  //  ** to sqlite3DeferForeignKey() might change this to DEFERRED.
 96571  //  */
 96572  func _sqlite3CreateForeignKey(tls *crt.TLS, _pParse *XParse, _pFromCol *XExprList, _pTo *XToken, _pToCol *XExprList, _flags int32) {
 96573  	var _nByte, _i, _nCol, _1_iCol, _10_j, _15_n int32
 96574  	var _z *int8
 96575  	var _db *Xsqlite3
 96576  	var _p *XTable
 96577  	var _pFKey, _pNextTo *XFKey
 96578  	_db = (*Xsqlite3)(_pParse.Xdb)
 96579  	_pFKey = nil
 96580  	_p = (*XTable)(_pParse.XpNewTable)
 96581  	func() {
 96582  		if _pTo == nil {
 96583  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102337), unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000), unsafe.Pointer(str(114430)))
 96584  			crt.X__builtin_abort(tls)
 96585  		}
 96586  	}()
 96587  	if (_p == nil) || (_pParse.XdeclareVtab != 0) {
 96588  		goto _fk_end
 96589  	}
 96590  	if _pFromCol != nil {
 96591  		goto _4
 96592  	}
 96593  	_1_iCol = int32(_p.XnCol) - int32(1)
 96594  	if func() int32 {
 96595  		if _1_iCol < int32(0) {
 96596  			return func() int32 {
 96597  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102341), unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000), unsafe.Pointer(str(4809)))
 96598  				crt.X__builtin_abort(tls)
 96599  				return int32(1)
 96600  			}()
 96601  		}
 96602  		return int32(0)
 96603  	}() != 0 {
 96604  		goto _fk_end
 96605  	}
 96606  	if (_pToCol != nil) && (_pToCol.XnExpr != int32(1)) {
 96607  		_sqlite3ErrorMsg(tls, _pParse, str(114437), unsafe.Pointer(elem43((*XColumn)(_p.XaCol), uintptr(_1_iCol)).XzName), unsafe.Pointer(_pTo))
 96608  		goto _fk_end
 96609  	}
 96610  	_nCol = int32(1)
 96611  	goto _13
 96612  _4:
 96613  	if (_pToCol != nil) && (_pToCol.XnExpr != _pFromCol.XnExpr) {
 96614  		_sqlite3ErrorMsg(tls, _pParse, str(114500))
 96615  		goto _fk_end
 96616  	}
 96617  	_nCol = _pFromCol.XnExpr
 96618  _13:
 96619  	_nByte = int32(((uint64(80) + (uint64(_nCol-int32(1)) * uint64(16))) + uint64(_pTo.Xn)) + uint64(1))
 96620  	if _pToCol == nil {
 96621  		goto _14
 96622  	}
 96623  	_i = int32(0)
 96624  _15:
 96625  	if _i >= _pToCol.XnExpr {
 96626  		goto _18
 96627  	}
 96628  	_nByte += _sqlite3Strlen30(tls, elem59((*TExprList_item)(unsafe.Pointer(&_pToCol.Xa)), uintptr(_i)).XzName) + int32(1)
 96629  	_i += 1
 96630  	goto _15
 96631  _18:
 96632  _14:
 96633  	_pFKey = (*XFKey)(_sqlite3DbMallocZero(tls, _db, uint64(_nByte)))
 96634  	if _pFKey == nil {
 96635  		goto _fk_end
 96636  	}
 96637  	*(**XTable)(unsafe.Pointer(&_pFKey.XpFrom)) = _p
 96638  	*(**XFKey)(unsafe.Pointer(&_pFKey.XpNextFrom)) = (*XFKey)(_p.XpFKey)
 96639  	_z = (*int8)(unsafe.Pointer(elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_nCol))))
 96640  	_pFKey.XzTo = _z
 96641  	crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(_pTo.Xz), uint64(_pTo.Xn))
 96642  	*elem1(_z, uintptr(_pTo.Xn)) = 0
 96643  	_sqlite3Dequote(tls, _z)
 96644  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_pTo.Xn + uint32(1))
 96645  	_pFKey.XnCol = _nCol
 96646  	if _pFromCol == nil {
 96647  		elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), 0).XiFrom = int32(_p.XnCol) - int32(1)
 96648  		goto _21
 96649  	}
 96650  	_i = int32(0)
 96651  _22:
 96652  	if _i >= _nCol {
 96653  		goto _25
 96654  	}
 96655  	_10_j = int32(0)
 96656  _26:
 96657  	if _10_j >= int32(_p.XnCol) {
 96658  		goto _29
 96659  	}
 96660  	if _sqlite3StrICmp(tls, elem43((*XColumn)(_p.XaCol), uintptr(_10_j)).XzName, elem59((*TExprList_item)(unsafe.Pointer(&_pFromCol.Xa)), uintptr(_i)).XzName) == int32(0) {
 96661  		elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_i)).XiFrom = _10_j
 96662  		goto _29
 96663  	}
 96664  	_10_j += 1
 96665  	goto _26
 96666  _29:
 96667  	if _10_j >= int32(_p.XnCol) {
 96668  		_sqlite3ErrorMsg(tls, _pParse, str(114594), unsafe.Pointer(elem59((*TExprList_item)(unsafe.Pointer(&_pFromCol.Xa)), uintptr(_i)).XzName))
 96669  		goto _fk_end
 96670  	}
 96671  	_i += 1
 96672  	goto _22
 96673  _25:
 96674  _21:
 96675  	if _pToCol == nil {
 96676  		goto _32
 96677  	}
 96678  	_i = int32(0)
 96679  _33:
 96680  	if _i >= _nCol {
 96681  		goto _36
 96682  	}
 96683  	_15_n = _sqlite3Strlen30(tls, elem59((*TExprList_item)(unsafe.Pointer(&_pToCol.Xa)), uintptr(_i)).XzName)
 96684  	elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_i)).XzCol = _z
 96685  	crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(elem59((*TExprList_item)(unsafe.Pointer(&_pToCol.Xa)), uintptr(_i)).XzName), uint64(_15_n))
 96686  	*elem1(_z, uintptr(_15_n)) = 0
 96687  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_15_n + int32(1))
 96688  	_i += 1
 96689  	goto _33
 96690  _36:
 96691  _32:
 96692  	_pFKey.XisDeferred = 0
 96693  	*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), 0) = uint8(_flags & int32(255))
 96694  	*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), uintptr(1)) = uint8((_flags >> 8) & int32(255))
 96695  	func() {
 96696  		if _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_p.XpSchema)) == 0 {
 96697  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102408), unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000), unsafe.Pointer(str(114640)))
 96698  			crt.X__builtin_abort(tls)
 96699  		}
 96700  	}()
 96701  	_pNextTo = (*XFKey)(_sqlite3HashInsert(tls, &((*XSchema)(_p.XpSchema).XfkeyHash), _pFKey.XzTo, unsafe.Pointer(_pFKey)))
 96702  	if _pNextTo == _pFKey {
 96703  		_sqlite3OomFault(tls, _db)
 96704  		goto _fk_end
 96705  	}
 96706  	if _pNextTo != nil {
 96707  		func() {
 96708  			if (*XFKey)(_pNextTo.XpPrevTo) != nil {
 96709  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102417), unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000), unsafe.Pointer(str(114682)))
 96710  				crt.X__builtin_abort(tls)
 96711  			}
 96712  		}()
 96713  		*(**XFKey)(unsafe.Pointer(&_pFKey.XpNextTo)) = _pNextTo
 96714  		*(**XFKey)(unsafe.Pointer(&_pNextTo.XpPrevTo)) = _pFKey
 96715  	}
 96716  	*(**XFKey)(unsafe.Pointer(&_p.XpFKey)) = _pFKey
 96717  	_pFKey = nil
 96718  _fk_end:
 96719  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pFKey))
 96720  	_sqlite3ExprListDelete(tls, _db, _pFromCol)
 96721  	_sqlite3ExprListDelete(tls, _db, _pToCol)
 96722  }
 96723  
 96724  var _sqlite3CreateForeignKeyØ00__func__Ø000 [24]int8
 96725  
 96726  func init() {
 96727  	crt.Xstrncpy(nil, &_sqlite3CreateForeignKeyØ00__func__Ø000[0], str(114702), 24)
 96728  }
 96729  
 96730  // C comment
 96731  //  /*
 96732  //  ** This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED
 96733  //  ** clause is seen as part of a foreign key definition.  The isDeferred
 96734  //  ** parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE.
 96735  //  ** The behavior of the most recently created foreign key is adjusted
 96736  //  ** accordingly.
 96737  //  */
 96738  func _sqlite3DeferForeignKey(tls *crt.TLS, _pParse *XParse, _isDeferred int32) {
 96739  	var _pTab *XTable
 96740  	var _pFKey *XFKey
 96741  	if (store74(&_pTab, (*XTable)(_pParse.XpNewTable)) == nil) || (store119(&_pFKey, (*XFKey)(_pTab.XpFKey)) == nil) {
 96742  		return
 96743  	}
 96744  	func() {
 96745  		if _isDeferred != int32(0) && _isDeferred != int32(1) {
 96746  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102446), unsafe.Pointer(&_sqlite3DeferForeignKeyØ00__func__Ø000), unsafe.Pointer(str(114726)))
 96747  			crt.X__builtin_abort(tls)
 96748  		}
 96749  	}()
 96750  	_pFKey.XisDeferred = uint8(_isDeferred)
 96751  }
 96752  
 96753  var _sqlite3DeferForeignKeyØ00__func__Ø000 [23]int8
 96754  
 96755  func init() {
 96756  	crt.Xstrncpy(nil, &_sqlite3DeferForeignKeyØ00__func__Ø000[0], str(114757), 23)
 96757  }
 96758  
 96759  // C comment
 96760  //  /*
 96761  //  ** Set the collation function of the most recently parsed table column
 96762  //  ** to the CollSeq given.
 96763  //  */
 96764  func _sqlite3AddCollateType(tls *crt.TLS, _pParse *XParse, _pToken *XToken) {
 96765  	var _i int32
 96766  	var _zColl *int8
 96767  	var _db *Xsqlite3
 96768  	var _p *XTable
 96769  	var _1_pIdx *XIndex
 96770  	if store74(&_p, (*XTable)(_pParse.XpNewTable)) == nil {
 96771  		return
 96772  	}
 96773  	_i = int32(_p.XnCol) - int32(1)
 96774  	_db = (*Xsqlite3)(_pParse.Xdb)
 96775  	_zColl = _sqlite3NameFromToken(tls, _db, _pToken)
 96776  	if _zColl == nil {
 96777  		return
 96778  	}
 96779  	if _sqlite3LocateCollSeq(tls, _pParse, _zColl) == nil {
 96780  		goto _2
 96781  	}
 96782  	_sqlite3DbFree(tls, _db, unsafe.Pointer(elem43((*XColumn)(_p.XaCol), uintptr(_i)).XzColl))
 96783  	elem43((*XColumn)(_p.XaCol), uintptr(_i)).XzColl = _zColl
 96784  	_1_pIdx = (*XIndex)(_p.XpIndex)
 96785  _3:
 96786  	if _1_pIdx == nil {
 96787  		goto _6
 96788  	}
 96789  	func() {
 96790  		if int32(_1_pIdx.XnKeyCol) != int32(1) {
 96791  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101103), unsafe.Pointer(&_sqlite3AddCollateTypeØ00__func__Ø000), unsafe.Pointer(str(114780)))
 96792  			crt.X__builtin_abort(tls)
 96793  		}
 96794  	}()
 96795  	if int32(*elem52(_1_pIdx.XaiColumn, 0)) == _i {
 96796  		*elem0(_1_pIdx.XazColl, 0) = elem43((*XColumn)(_p.XaCol), uintptr(_i)).XzColl
 96797  	}
 96798  	_1_pIdx = (*XIndex)(_1_pIdx.XpNext)
 96799  	goto _3
 96800  _6:
 96801  	goto _10
 96802  _2:
 96803  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zColl))
 96804  _10:
 96805  }
 96806  
 96807  var _sqlite3AddCollateTypeØ00__func__Ø000 [22]int8
 96808  
 96809  func init() {
 96810  	crt.Xstrncpy(nil, &_sqlite3AddCollateTypeØ00__func__Ø000[0], str(114797), 22)
 96811  }
 96812  
 96813  // C comment
 96814  //  /*
 96815  //  ** This routine is called to do the work of a DROP TABLE statement.
 96816  //  ** pName is the name of the table to be dropped.
 96817  //  */
 96818  func _sqlite3DropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _isView int32, _noErr int32) {
 96819  	var _iDb, _4_code int32
 96820  	var _4_zTab, _4_zDb, _4_zArg2 *int8
 96821  	var _db *Xsqlite3
 96822  	var _pTab *XTable
 96823  	var _v *TVdbe
 96824  	_db = (*Xsqlite3)(_pParse.Xdb)
 96825  	if _db.XmallocFailed != 0 {
 96826  		goto _exit_drop_table
 96827  	}
 96828  	func() {
 96829  		if _pParse.XnErr != int32(0) {
 96830  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102213), unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000), unsafe.Pointer(str(112394)))
 96831  			crt.X__builtin_abort(tls)
 96832  		}
 96833  	}()
 96834  	func() {
 96835  		if _pName.XnSrc != int32(1) {
 96836  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102214), unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000), unsafe.Pointer(str(114819)))
 96837  			crt.X__builtin_abort(tls)
 96838  		}
 96839  	}()
 96840  	if _sqlite3ReadSchema(tls, _pParse) != 0 {
 96841  		goto _exit_drop_table
 96842  	}
 96843  	if _noErr != 0 {
 96844  		_db.XsuppressErr += 1
 96845  	}
 96846  	func() {
 96847  		if _isView != int32(0) && _isView != int32(1) {
 96848  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102217), unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000), unsafe.Pointer(str(114834)))
 96849  			crt.X__builtin_abort(tls)
 96850  		}
 96851  	}()
 96852  	_pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(_isView), elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0))
 96853  	if _noErr != 0 {
 96854  		_db.XsuppressErr -= 1
 96855  	}
 96856  	if _pTab != nil {
 96857  		goto _11
 96858  	}
 96859  	if _noErr != 0 {
 96860  		_sqlite3CodeVerifyNamedSchema(tls, _pParse, elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzDatabase)
 96861  	}
 96862  	goto _exit_drop_table
 96863  _11:
 96864  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
 96865  	func() {
 96866  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 96867  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102226), unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000), unsafe.Pointer(str(21693)))
 96868  			crt.X__builtin_abort(tls)
 96869  		}
 96870  	}()
 96871  	if _pTab.XnModuleArg != 0 && _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
 96872  		goto _exit_drop_table
 96873  	}
 96874  	_4_zTab = func() *int8 {
 96875  		if int32(1) != 0 && (_iDb == int32(1)) {
 96876  			return str(49962)
 96877  		}
 96878  		return str(49981)
 96879  	}()
 96880  	_4_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 96881  	_4_zArg2 = nil
 96882  	if _sqlite3AuthCheck(tls, _pParse, int32(9), _4_zTab, nil, _4_zDb) != 0 {
 96883  		goto _exit_drop_table
 96884  	}
 96885  	if _isView == 0 {
 96886  		goto _22
 96887  	}
 96888  	if int32(1) != 0 && (_iDb == int32(1)) {
 96889  		_4_code = int32(15)
 96890  		goto _25
 96891  	}
 96892  	_4_code = int32(17)
 96893  _25:
 96894  	goto _28
 96895  _22:
 96896  	if _pTab.XnModuleArg != 0 {
 96897  		_4_code = int32(30)
 96898  		_4_zArg2 = (*XModule)(_sqlite3GetVTable(tls, _db, _pTab).XpMod).XzName
 96899  		goto _28
 96900  	}
 96901  	if int32(1) != 0 && (_iDb == int32(1)) {
 96902  		_4_code = int32(13)
 96903  		goto _31
 96904  	}
 96905  	_4_code = int32(11)
 96906  _31:
 96907  _28:
 96908  	if _sqlite3AuthCheck(tls, _pParse, _4_code, _pTab.XzName, _4_zArg2, _4_zDb) != 0 {
 96909  		goto _exit_drop_table
 96910  	}
 96911  	if _sqlite3AuthCheck(tls, _pParse, int32(9), _pTab.XzName, nil, _4_zDb) != 0 {
 96912  		goto _exit_drop_table
 96913  	}
 96914  	if (Xsqlite3_strnicmp(tls, _pTab.XzName, str(111672), int32(7)) == int32(0)) && (Xsqlite3_strnicmp(tls, _pTab.XzName, str(114867), int32(11)) != int32(0)) {
 96915  		_sqlite3ErrorMsg(tls, _pParse, str(114879), unsafe.Pointer(_pTab.XzName))
 96916  		goto _exit_drop_table
 96917  	}
 96918  	if _isView != 0 && ((*XSelect)(_pTab.XpSelect) == nil) {
 96919  		_sqlite3ErrorMsg(tls, _pParse, str(114907), unsafe.Pointer(_pTab.XzName))
 96920  		goto _exit_drop_table
 96921  	}
 96922  	if (_isView == 0) && (_pTab.XpSelect != nil) {
 96923  		_sqlite3ErrorMsg(tls, _pParse, str(114941), unsafe.Pointer(_pTab.XzName))
 96924  		goto _exit_drop_table
 96925  	}
 96926  	_v = _sqlite3GetVdbe(tls, _pParse)
 96927  	if _v != nil {
 96928  		_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
 96929  		_sqlite3ClearStatTables(tls, _pParse, _iDb, str(93739), _pTab.XzName)
 96930  		_sqlite3FkDropTable(tls, _pParse, _pName, _pTab)
 96931  		_sqlite3CodeDropTable(tls, _pParse, _pTab, _iDb, _isView)
 96932  	}
 96933  _exit_drop_table:
 96934  	_sqlite3SrcListDelete(tls, _db, _pName)
 96935  }
 96936  
 96937  var _sqlite3DropTableØ00__func__Ø000 [17]int8
 96938  
 96939  func init() {
 96940  	crt.Xstrncpy(nil, &_sqlite3DropTableØ00__func__Ø000[0], str(114973), 17)
 96941  }
 96942  
 96943  // C comment
 96944  //  /*
 96945  //  ** If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each
 96946  //  ** attached database. Otherwise, invoke it for the database named zDb only.
 96947  //  */
 96948  func _sqlite3CodeVerifyNamedSchema(tls *crt.TLS, _pParse *XParse, _zDb *int8) {
 96949  	var _i int32
 96950  	var _db *Xsqlite3
 96951  	var _1_pDb *XDb
 96952  	_db = (*Xsqlite3)(_pParse.Xdb)
 96953  	_i = int32(0)
 96954  _0:
 96955  	if _i >= _db.XnDb {
 96956  		goto _3
 96957  	}
 96958  	_1_pDb = elem27((*XDb)(_db.XaDb), uintptr(_i))
 96959  	if (_1_pDb.XpBt != nil) && ((_zDb == nil) || (int32(0) == _sqlite3StrICmp(tls, _zDb, _1_pDb.XzDbSName))) {
 96960  		_sqlite3CodeVerifySchema(tls, _pParse, _i)
 96961  	}
 96962  	_i += 1
 96963  	goto _0
 96964  _3:
 96965  }
 96966  
 96967  // C comment
 96968  //  /*
 96969  //  ** Remove entries from the sqlite_statN tables (for N in (1,2,3))
 96970  //  ** after a DROP INDEX or DROP TABLE command.
 96971  //  */
 96972  func _sqlite3ClearStatTables(tls *crt.TLS, _pParse *XParse, _iDb int32, _zType *int8, _zName *int8) {
 96973  	var _i int32
 96974  	var _zDbName *int8
 96975  	var _1_zTab [24]int8
 96976  	_zDbName = elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_iDb)).XzDbSName
 96977  	_i = int32(1)
 96978  _0:
 96979  	if _i > int32(4) {
 96980  		goto _3
 96981  	}
 96982  	Xsqlite3_snprintf(tls, int32(24), (*int8)(unsafe.Pointer(&_1_zTab)), str(114990), _i)
 96983  	if _sqlite3FindTable(tls, (*Xsqlite3)(_pParse.Xdb), (*int8)(unsafe.Pointer(&_1_zTab)), _zDbName) != nil {
 96984  		_sqlite3NestedParse(tls, _pParse, str(115004), unsafe.Pointer(_zDbName), unsafe.Pointer(&_1_zTab), unsafe.Pointer(_zType), unsafe.Pointer(_zName))
 96985  	}
 96986  	_i += 1
 96987  	goto _0
 96988  _3:
 96989  	_ = _1_zTab
 96990  }
 96991  
 96992  // C comment
 96993  //  /*
 96994  //  ** This function is called to generate code that runs when table pTab is
 96995  //  ** being dropped from the database. The SrcList passed as the second argument
 96996  //  ** to this function contains a single entry guaranteed to resolve to
 96997  //  ** table pTab.
 96998  //  **
 96999  //  ** Normally, no code is required. However, if either
 97000  //  **
 97001  //  **   (a) The table is the parent table of a FK constraint, or
 97002  //  **   (b) The table is the child table of a deferred FK constraint and it is
 97003  //  **       determined at runtime that there are outstanding deferred FK
 97004  //  **       constraint violations in the database,
 97005  //  **
 97006  //  ** then the equivalent of "DELETE FROM <tbl>" is executed before dropping
 97007  //  ** the table from the database. Triggers are disabled while running this
 97008  //  ** DELETE, but foreign key actions are not.
 97009  //  */
 97010  func _sqlite3FkDropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _pTab *XTable) {
 97011  	var _1_iSkip int32
 97012  	var _db *Xsqlite3
 97013  	var _1_v *TVdbe
 97014  	var _2_p *XFKey
 97015  	_db = (*Xsqlite3)(_pParse.Xdb)
 97016  	if (_db.Xflags&int32(524288)) == 0 || _pTab.XnModuleArg != 0 || _pTab.XpSelect != nil {
 97017  		goto _2
 97018  	}
 97019  	_1_iSkip = int32(0)
 97020  	_1_v = _sqlite3GetVdbe(tls, _pParse)
 97021  	func() {
 97022  		if _1_v == nil {
 97023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108122), unsafe.Pointer(&_sqlite3FkDropTableØ00__func__Ø000), unsafe.Pointer(str(41816)))
 97024  			crt.X__builtin_abort(tls)
 97025  		}
 97026  	}()
 97027  	if _sqlite3FkReferences(tls, _pTab) != nil {
 97028  		goto _5
 97029  	}
 97030  	_2_p = (*XFKey)(_pTab.XpFKey)
 97031  _6:
 97032  	if _2_p == nil {
 97033  		goto _9
 97034  	}
 97035  	if (_2_p.XisDeferred != 0) || (_db.Xflags&int32(33554432)) != 0 {
 97036  		goto _9
 97037  	}
 97038  	_2_p = (*XFKey)(_2_p.XpNextFrom)
 97039  	goto _6
 97040  _9:
 97041  	if _2_p == nil {
 97042  		return
 97043  	}
 97044  	_1_iSkip = _sqlite3VdbeMakeLabel(tls, _1_v)
 97045  	_sqlite3VdbeAddOp2(tls, _1_v, int32(45), int32(1), _1_iSkip)
 97046  _5:
 97047  	_pParse.XdisableTriggers = uint8(1)
 97048  	_sqlite3DeleteFrom(tls, _pParse, _sqlite3SrcListDup(tls, _db, _pName, int32(0)), nil)
 97049  	_pParse.XdisableTriggers = 0
 97050  	if (_db.Xflags & int32(33554432)) == int32(0) {
 97051  		_sqlite3VdbeAddOp2(tls, _1_v, int32(45), int32(0), _sqlite3VdbeCurrentAddr(tls, _1_v)+int32(2))
 97052  		_sqlite3HaltConstraint(tls, _pParse, int32(787), int32(2), nil, int8(-2), uint8(4))
 97053  	}
 97054  	if _1_iSkip != 0 {
 97055  		_sqlite3VdbeResolveLabel(tls, _1_v, _1_iSkip)
 97056  	}
 97057  _2:
 97058  }
 97059  
 97060  var _sqlite3FkDropTableØ00__func__Ø000 [19]int8
 97061  
 97062  func init() {
 97063  	crt.Xstrncpy(nil, &_sqlite3FkDropTableØ00__func__Ø000[0], str(115034), 19)
 97064  }
 97065  
 97066  // C comment
 97067  //  /*
 97068  //  ** This function returns a linked list of FKey objects (connected by
 97069  //  ** FKey.pNextTo) holding all children of table pTab.  For example,
 97070  //  ** given the following schema:
 97071  //  **
 97072  //  **   CREATE TABLE t1(a PRIMARY KEY);
 97073  //  **   CREATE TABLE t2(b REFERENCES t1(a);
 97074  //  **
 97075  //  ** Calling this function with table "t1" as an argument returns a pointer
 97076  //  ** to the FKey structure representing the foreign key constraint on table
 97077  //  ** "t2". Calling this function with "t2" as the argument would return a
 97078  //  ** NULL pointer (as there are no FK constraints for which t2 is the parent
 97079  //  ** table).
 97080  //  */
 97081  func _sqlite3FkReferences(tls *crt.TLS, _pTab *XTable) (r0 *XFKey) {
 97082  	return (*XFKey)(_sqlite3HashFind(tls, &((*XSchema)(_pTab.XpSchema).XfkeyHash), _pTab.XzName))
 97083  }
 97084  
 97085  // C comment
 97086  //  /*
 97087  //  ** Generate code for a DELETE FROM statement.
 97088  //  **
 97089  //  **     DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL;
 97090  //  **                 \________/       \________________/
 97091  //  **                  pTabList              pWhere
 97092  //  */
 97093  func _sqlite3DeleteFrom(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWhere *XExpr) {
 97094  	var _nPk, _nKey int16
 97095  	var _i, _iTabCur, _iDataCur, _iIdxCur, _nIdx, _iDb, _memCnt, _rcauth, _eOnePass, _iPk, _iKey, _iEphCur, _iRowSet, _addrBypass, _addrLoop, _addrEphOpen, _bComplex, _isView, _28_iAddrOnce, _36_count int32
 97096  	var _34_pVTab *int8
 97097  	var _14_wcf uint16
 97098  	var _aToOpen *uint8
 97099  	var _db *Xsqlite3
 97100  	var _pTrigger *XTrigger
 97101  	var _pTab *XTable
 97102  	var _v *TVdbe
 97103  	var _aiCurOnePass [2]int32
 97104  	var _pIdx, _pPk *XIndex
 97105  	var _sNC XNameContext
 97106  	var _sContext XAuthContext
 97107  	var _pWInfo *XWhereInfo
 97108  	_iDataCur = int32(0)
 97109  	_iIdxCur = int32(0)
 97110  	_memCnt = int32(-1)
 97111  	_aToOpen = nil
 97112  	_iPk = int32(0)
 97113  	_nPk = int16(1)
 97114  	_iEphCur = int32(0)
 97115  	_iRowSet = int32(0)
 97116  	_addrBypass = int32(0)
 97117  	_addrLoop = int32(0)
 97118  	_addrEphOpen = int32(0)
 97119  	crt.Xmemset(tls, unsafe.Pointer(&_sContext), int32(0), uint64(16))
 97120  	_db = (*Xsqlite3)(_pParse.Xdb)
 97121  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 97122  		goto _delete_from_cleanup
 97123  	}
 97124  	func() {
 97125  		if _pTabList.XnSrc != int32(1) {
 97126  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104887), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115053)))
 97127  			crt.X__builtin_abort(tls)
 97128  		}
 97129  	}()
 97130  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTabList)
 97131  	if _pTab == nil {
 97132  		goto _delete_from_cleanup
 97133  	}
 97134  	_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, int32(109), nil, nil)
 97135  	_isView = bool2int((*XSelect)(_pTab.XpSelect) != nil)
 97136  	_bComplex = bool2int((_pTrigger != nil) || _sqlite3FkRequired(tls, _pParse, _pTab, nil, int32(0)) != 0)
 97137  	if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
 97138  		goto _delete_from_cleanup
 97139  	}
 97140  	if _sqlite3IsReadOnly(tls, _pParse, _pTab, func() int32 {
 97141  		if _pTrigger != nil {
 97142  			return int32(1)
 97143  		}
 97144  		return int32(0)
 97145  	}()) != 0 {
 97146  		goto _delete_from_cleanup
 97147  	}
 97148  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
 97149  	func() {
 97150  		if _iDb >= _db.XnDb {
 97151  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104923), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(54304)))
 97152  			crt.X__builtin_abort(tls)
 97153  		}
 97154  	}()
 97155  	_rcauth = _sqlite3AuthCheck(tls, _pParse, int32(9), _pTab.XzName, nil, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 97156  	func() {
 97157  		if _rcauth != int32(0) && _rcauth != int32(1) && _rcauth != int32(2) {
 97158  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104926), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115071)))
 97159  			crt.X__builtin_abort(tls)
 97160  		}
 97161  	}()
 97162  	if _rcauth == int32(1) {
 97163  		goto _delete_from_cleanup
 97164  	}
 97165  	func() {
 97166  		if _isView != 0 && _pTrigger == nil {
 97167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104930), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115137)))
 97168  			crt.X__builtin_abort(tls)
 97169  		}
 97170  	}()
 97171  	func() {
 97172  		if _pTabList.XnSrc != int32(1) {
 97173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104934), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115053)))
 97174  			crt.X__builtin_abort(tls)
 97175  		}
 97176  	}()
 97177  	_iTabCur = store2(&(elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XiCursor), postInc2(&_pParse.XnTab, 1))
 97178  	*func() **XIndex { _nIdx = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
 97179  _22:
 97180  	if _pIdx == nil {
 97181  		goto _25
 97182  	}
 97183  	_pParse.XnTab += 1
 97184  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_nIdx }() += 1
 97185  	goto _22
 97186  _25:
 97187  	if _isView != 0 {
 97188  		_sqlite3AuthContextPush(tls, _pParse, &_sContext, _pTab.XzName)
 97189  	}
 97190  	_v = _sqlite3GetVdbe(tls, _pParse)
 97191  	if _v == nil {
 97192  		goto _delete_from_cleanup
 97193  	}
 97194  	if int32(_pParse.Xnested) == int32(0) {
 97195  		_sqlite3VdbeCountChanges(tls, _v)
 97196  	}
 97197  	_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
 97198  	if _isView != 0 {
 97199  		_sqlite3MaterializeView(tls, _pParse, _pTab, _pWhere, _iTabCur)
 97200  		_iDataCur = store2(&_iIdxCur, _iTabCur)
 97201  	}
 97202  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint64(56))
 97203  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pParse
 97204  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = _pTabList
 97205  	if _sqlite3ResolveExprNames(tls, &_sNC, _pWhere) != 0 {
 97206  		goto _delete_from_cleanup
 97207  	}
 97208  	if (_db.Xflags & int32(128)) != 0 {
 97209  		_memCnt = preInc2(&_pParse.XnMem, 1)
 97210  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _memCnt)
 97211  	}
 97212  	if _rcauth != int32(0) || _pWhere != nil || _bComplex != 0 || _pTab.XnModuleArg != 0 {
 97213  		goto _35
 97214  	}
 97215  	func() {
 97216  		if _isView != 0 {
 97217  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105002), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115157)))
 97218  			crt.X__builtin_abort(tls)
 97219  		}
 97220  	}()
 97221  	_sqlite3TableLock(tls, _pParse, _iDb, _pTab.Xtnum, uint8(1), _pTab.XzName)
 97222  	if (_pTab.XtabFlags & uint32(32)) == (0) {
 97223  		_sqlite3VdbeAddOp4(tls, _v, int32(134), _pTab.Xtnum, _iDb, _memCnt, _pTab.XzName, int32(-2))
 97224  	}
 97225  	_pIdx = (*XIndex)(_pTab.XpIndex)
 97226  _39:
 97227  	if _pIdx == nil {
 97228  		goto _42
 97229  	}
 97230  	func() {
 97231  		if (*XSchema)(_pIdx.XpSchema) != (*XSchema)(_pTab.XpSchema) {
 97232  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105009), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115165)))
 97233  			crt.X__builtin_abort(tls)
 97234  		}
 97235  	}()
 97236  	_sqlite3VdbeAddOp2(tls, _v, int32(134), _pIdx.Xtnum, _iDb)
 97237  	_pIdx = (*XIndex)(_pIdx.XpNext)
 97238  	goto _39
 97239  _42:
 97240  	goto _45
 97241  _35:
 97242  	_14_wcf = uint16(1044)
 97243  	if (int32(_sNC.XncFlags) & int32(64)) != 0 {
 97244  		_bComplex = int32(1)
 97245  	}
 97246  	{
 97247  		p := &_14_wcf
 97248  		*p = uint16(int32(*p) | func() int32 {
 97249  			if _bComplex != 0 {
 97250  				return int32(0)
 97251  			}
 97252  			return int32(8)
 97253  		}())
 97254  	}
 97255  	if (_pTab.XtabFlags & uint32(32)) == (0) {
 97256  		_pPk = nil
 97257  		_nPk = int16(1)
 97258  		_iRowSet = preInc2(&_pParse.XnMem, 1)
 97259  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _iRowSet)
 97260  		goto _50
 97261  	}
 97262  	_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 97263  	func() {
 97264  		if _pPk == nil {
 97265  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105028), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(41949)))
 97266  			crt.X__builtin_abort(tls)
 97267  		}
 97268  	}()
 97269  	_nPk = int16(_pPk.XnKeyCol)
 97270  	_iPk = _pParse.XnMem + int32(1)
 97271  	_pParse.XnMem += int32(_nPk)
 97272  	_iEphCur = postInc2(&_pParse.XnTab, 1)
 97273  	_addrEphOpen = _sqlite3VdbeAddOp2(tls, _v, int32(110), _iEphCur, int32(_nPk))
 97274  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pPk)
 97275  _50:
 97276  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, nil, nil, _14_wcf, _iTabCur+int32(1))
 97277  	if _pWInfo == nil {
 97278  		goto _delete_from_cleanup
 97279  	}
 97280  	_eOnePass = _sqlite3WhereOkOnePass(tls, _pWInfo, (*int32)(unsafe.Pointer(&_aiCurOnePass)))
 97281  	func() {
 97282  		if _pTab.XnModuleArg != int32(0) && _eOnePass == int32(2) {
 97283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105048), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115194)))
 97284  			crt.X__builtin_abort(tls)
 97285  		}
 97286  	}()
 97287  	func() {
 97288  		if _pTab.XnModuleArg == 0 && _bComplex == 0 && _eOnePass == int32(0) {
 97289  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105049), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115240)))
 97290  			crt.X__builtin_abort(tls)
 97291  		}
 97292  	}()
 97293  	if (_db.Xflags & int32(128)) != 0 {
 97294  		_sqlite3VdbeAddOp2(tls, _v, int32(73), _memCnt, int32(1))
 97295  	}
 97296  	if _pPk == nil {
 97297  		goto _62
 97298  	}
 97299  	_i = int32(0)
 97300  _63:
 97301  	if _i >= int32(_nPk) {
 97302  		goto _66
 97303  	}
 97304  	func() {
 97305  		if int32(*elem52(_pPk.XaiColumn, uintptr(_i))) < int32(0) {
 97306  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105059), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115293)))
 97307  			crt.X__builtin_abort(tls)
 97308  		}
 97309  	}()
 97310  	_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iTabCur, int32(*elem52(_pPk.XaiColumn, uintptr(_i))), _iPk+_i)
 97311  	_i += 1
 97312  	goto _63
 97313  _66:
 97314  	_iKey = _iPk
 97315  	goto _69
 97316  _62:
 97317  	_iKey = _pParse.XnMem + int32(1)
 97318  	_iKey = _sqlite3ExprCodeGetColumn(tls, _pParse, _pTab, int32(-1), _iTabCur, _iKey, 0)
 97319  	if _iKey > _pParse.XnMem {
 97320  		_pParse.XnMem = _iKey
 97321  	}
 97322  _69:
 97323  	if _eOnePass == int32(0) {
 97324  		goto _71
 97325  	}
 97326  	_nKey = _nPk
 97327  	_aToOpen = (*uint8)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nIdx+int32(2))))
 97328  	if _aToOpen == nil {
 97329  		_sqlite3WhereEnd(tls, _pWInfo)
 97330  		goto _delete_from_cleanup
 97331  	}
 97332  	crt.Xmemset(tls, unsafe.Pointer(_aToOpen), int32(1), uint64(_nIdx+int32(1)))
 97333  	*elem15(_aToOpen, uintptr(_nIdx+int32(1))) = 0
 97334  	if (*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), 0)) >= int32(0) {
 97335  		*elem15(_aToOpen, uintptr((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), 0))-_iTabCur)) = 0
 97336  	}
 97337  	if (*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1))) >= int32(0) {
 97338  		*elem15(_aToOpen, uintptr((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1)))-_iTabCur)) = 0
 97339  	}
 97340  	if _addrEphOpen != 0 {
 97341  		_sqlite3VdbeChangeToNoop(tls, _v, _addrEphOpen)
 97342  	}
 97343  	goto _76
 97344  _71:
 97345  	if _pPk != nil {
 97346  		_iKey = preInc2(&_pParse.XnMem, 1)
 97347  		_nKey = 0
 97348  		_sqlite3VdbeAddOp4(tls, _v, int32(101), _iPk, int32(_nPk), _iKey, _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.Xdb), _pPk), int32(_nPk))
 97349  		_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iEphCur, _iKey, _iPk, int32(_nPk))
 97350  		goto _78
 97351  	}
 97352  	_nKey = int16(1)
 97353  	_sqlite3VdbeAddOp2(tls, _v, int32(145), _iRowSet, _iKey)
 97354  _78:
 97355  _76:
 97356  	if _eOnePass != int32(0) {
 97357  		_addrBypass = _sqlite3VdbeMakeLabel(tls, _v)
 97358  		goto _80
 97359  	}
 97360  	_sqlite3WhereEnd(tls, _pWInfo)
 97361  _80:
 97362  	if _isView != 0 {
 97363  		goto _81
 97364  	}
 97365  	_28_iAddrOnce = int32(0)
 97366  	if _eOnePass == int32(2) {
 97367  		_28_iAddrOnce = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 97368  	}
 97369  	_sqlite3OpenTableAndIndices(tls, _pParse, _pTab, int32(107), uint8(8), _iTabCur, _aToOpen, &_iDataCur, &_iIdxCur)
 97370  	func() {
 97371  		if _pPk == nil && _pTab.XnModuleArg == 0 && _iDataCur != _iTabCur {
 97372  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105121), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115313)))
 97373  			crt.X__builtin_abort(tls)
 97374  		}
 97375  	}()
 97376  	func() {
 97377  		if _pPk == nil && _pTab.XnModuleArg == 0 && _iIdxCur != (_iDataCur+int32(1)) {
 97378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105122), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115357)))
 97379  			crt.X__builtin_abort(tls)
 97380  		}
 97381  	}()
 97382  	if _eOnePass == int32(2) {
 97383  		_sqlite3VdbeJumpHere(tls, _v, _28_iAddrOnce)
 97384  	}
 97385  _81:
 97386  	if _eOnePass == int32(0) {
 97387  		goto _92
 97388  	}
 97389  	func() {
 97390  		if int32(_nKey) != int32(_nPk) {
 97391  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105130), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115403)))
 97392  			crt.X__builtin_abort(tls)
 97393  		}
 97394  	}()
 97395  	if (_pTab.XnModuleArg == 0) && ((*elem15(_aToOpen, uintptr(_iDataCur-_iTabCur))) != 0) {
 97396  		func() {
 97397  			if _pPk == nil && (*XSelect)(_pTab.XpSelect) == nil {
 97398  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105132), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115413)))
 97399  				crt.X__builtin_abort(tls)
 97400  			}
 97401  		}()
 97402  		_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iDataCur, _addrBypass, _iKey, int32(_nKey))
 97403  	}
 97404  	goto _104
 97405  _92:
 97406  	if _pPk != nil {
 97407  		_addrLoop = _sqlite3VdbeAddOp1(tls, _v, int32(37), _iEphCur)
 97408  		_sqlite3VdbeAddOp2(tls, _v, int32(124), _iEphCur, _iKey)
 97409  		func() {
 97410  			if int32(_nKey) != int32(0) {
 97411  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105139), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115440)))
 97412  				crt.X__builtin_abort(tls)
 97413  			}
 97414  		}()
 97415  		goto _104
 97416  	}
 97417  	_addrLoop = _sqlite3VdbeAddOp3(tls, _v, int32(42), _iRowSet, int32(0), _iKey)
 97418  	func() {
 97419  		if int32(_nKey) != int32(1) {
 97420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105143), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115448)))
 97421  			crt.X__builtin_abort(tls)
 97422  		}
 97423  	}()
 97424  _104:
 97425  	if _pTab.XnModuleArg == 0 {
 97426  		goto _107
 97427  	}
 97428  	_34_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab)))
 97429  	_sqlite3VtabMakeWritable(tls, _pParse, _pTab)
 97430  	_sqlite3VdbeAddOp4(tls, _v, int32(12), int32(0), int32(1), _iKey, _34_pVTab, int32(-8))
 97431  	_sqlite3VdbeChangeP5(tls, _v, uint16(2))
 97432  	func() {
 97433  		if _eOnePass != int32(0) && _eOnePass != int32(1) {
 97434  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105153), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115456)))
 97435  			crt.X__builtin_abort(tls)
 97436  		}
 97437  	}()
 97438  	_sqlite3MayAbort(tls, _pParse)
 97439  	if (_eOnePass == int32(1)) && ((*XParse)(_pParse.XpToplevel) == nil) {
 97440  		_pParse.XisMultiWrite = 0
 97441  	}
 97442  	goto _113
 97443  _107:
 97444  	_36_count = bool2int(int32(_pParse.Xnested) == int32(0))
 97445  	_sqlite3GenerateRowDelete(tls, _pParse, _pTab, _pTrigger, _iDataCur, _iIdxCur, _iKey, _nKey, uint8(_36_count), uint8(10), uint8(_eOnePass), *elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1)))
 97446  _113:
 97447  	if _eOnePass != int32(0) {
 97448  		_sqlite3VdbeResolveLabel(tls, _v, _addrBypass)
 97449  		_sqlite3WhereEnd(tls, _pWInfo)
 97450  		goto _117
 97451  	}
 97452  	if _pPk != nil {
 97453  		_sqlite3VdbeAddOp2(tls, _v, int32(7), _iEphCur, _addrLoop+int32(1))
 97454  		_sqlite3VdbeJumpHere(tls, _v, _addrLoop)
 97455  		goto _117
 97456  	}
 97457  	_sqlite3VdbeGoto(tls, _v, _addrLoop)
 97458  	_sqlite3VdbeJumpHere(tls, _v, _addrLoop)
 97459  _117:
 97460  _45:
 97461  	if (int32(_pParse.Xnested) == int32(0)) && ((*XTable)(_pParse.XpTriggerTab) == nil) {
 97462  		_sqlite3AutoincrementEnd(tls, _pParse)
 97463  	}
 97464  	if ((_db.Xflags&int32(128)) != 0 && (_pParse.Xnested == 0)) && (_pParse.XpTriggerTab == nil) {
 97465  		_sqlite3VdbeAddOp2(tls, _v, int32(67), _memCnt, int32(1))
 97466  		_sqlite3VdbeSetNumCols(tls, _v, int32(1))
 97467  		_sqlite3VdbeSetColName(tls, _v, int32(0), int32(0), str(115506), nil)
 97468  	}
 97469  _delete_from_cleanup:
 97470  	_sqlite3AuthContextPop(tls, &_sContext)
 97471  	_sqlite3SrcListDelete(tls, _db, _pTabList)
 97472  	_sqlite3ExprDelete(tls, _db, _pWhere)
 97473  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_aToOpen))
 97474  	_ = _aiCurOnePass
 97475  }
 97476  
 97477  var _sqlite3DeleteFromØ00__func__Ø000 [18]int8
 97478  
 97479  func init() {
 97480  	crt.Xstrncpy(nil, &_sqlite3DeleteFromØ00__func__Ø000[0], str(115519), 18)
 97481  }
 97482  
 97483  // C comment
 97484  //  /*
 97485  //  ** Return a list of all triggers on table pTab if there exists at least
 97486  //  ** one trigger that must be fired when an operation of type 'op' is
 97487  //  ** performed on the table, and, if that operation is an UPDATE, if at
 97488  //  ** least one of the columns in pChanges is being modified.
 97489  //  */
 97490  func _sqlite3TriggersExist(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _op int32, _pChanges *XExprList, _pMask *int32) (r0 *XTrigger) {
 97491  	var _mask int32
 97492  	var _pList, _p *XTrigger
 97493  	_mask = int32(0)
 97494  	_pList = nil
 97495  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(16777216)) != int32(0) {
 97496  		_pList = _sqlite3TriggerList(tls, _pParse, _pTab)
 97497  	}
 97498  	func() {
 97499  		if _pList != nil && _pTab.XnModuleArg != int32(0) {
 97500  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123273), unsafe.Pointer(&_sqlite3TriggersExistØ00__func__Ø000), unsafe.Pointer(str(115537)))
 97501  			crt.X__builtin_abort(tls)
 97502  		}
 97503  	}()
 97504  	_p = _pList
 97505  _4:
 97506  	if _p == nil {
 97507  		goto _7
 97508  	}
 97509  	if (int32(_p.Xop) == _op) && _checkColumnOverlap(tls, (*XIdList)(_p.XpColumns), _pChanges) != 0 {
 97510  		_mask |= int32(_p.Xtr_tm)
 97511  	}
 97512  	_p = (*XTrigger)(_p.XpNext)
 97513  	goto _4
 97514  _7:
 97515  	if _pMask != nil {
 97516  		*_pMask = _mask
 97517  	}
 97518  	return func() *XTrigger {
 97519  		if _mask != 0 {
 97520  			return _pList
 97521  		}
 97522  		return nil
 97523  	}()
 97524  }
 97525  
 97526  // C comment
 97527  //  /*
 97528  //  ** Given table pTab, return a list of all the triggers attached to
 97529  //  ** the table. The list is connected by Trigger.pNext pointers.
 97530  //  **
 97531  //  ** All of the triggers on pTab that are in the same database as pTab
 97532  //  ** are already attached to pTab->pTrigger.  But there might be additional
 97533  //  ** triggers on pTab in the TEMP schema.  This routine prepends all
 97534  //  ** TEMP triggers on pTab to the beginning of the pTab->pTrigger list
 97535  //  ** and returns the combined list.
 97536  //  **
 97537  //  ** To state it another way:  This routine returns a list of all triggers
 97538  //  ** that fire off of pTab.  The list will include any TEMP triggers on
 97539  //  ** pTab as well as the triggers lised in pTab->pTrigger.
 97540  //  */
 97541  func _sqlite3TriggerList(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *XTrigger) {
 97542  	var _pTmpSchema *XSchema
 97543  	var _2_p *XHashElem
 97544  	var _pList, _3_pTrig *XTrigger
 97545  	_pTmpSchema = (*XSchema)(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(1)).XpSchema)
 97546  	_pList = nil
 97547  	if _pParse.XdisableTriggers != 0 {
 97548  		return nil
 97549  	}
 97550  	if _pTmpSchema == (*XSchema)(_pTab.XpSchema) {
 97551  		goto _1
 97552  	}
 97553  	func() {
 97554  		if _sqlite3SchemaMutexHeld(tls, (*Xsqlite3)(_pParse.Xdb), int32(0), _pTmpSchema) == 0 {
 97555  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122701), unsafe.Pointer(&_sqlite3TriggerListØ00__func__Ø000), unsafe.Pointer(str(115568)))
 97556  			crt.X__builtin_abort(tls)
 97557  		}
 97558  	}()
 97559  	_2_p = (*XHashElem)(_pTmpSchema.XtrigHash.Xfirst)
 97560  _4:
 97561  	if _2_p == nil {
 97562  		goto _7
 97563  	}
 97564  	_3_pTrig = (*XTrigger)(_2_p.Xdata)
 97565  	if ((*XSchema)(_3_pTrig.XpTabSchema) == (*XSchema)(_pTab.XpSchema)) && (int32(0) == _sqlite3StrICmp(tls, _3_pTrig.Xtable, _pTab.XzName)) {
 97566  		*(**XTrigger)(unsafe.Pointer(&_3_pTrig.XpNext)) = func() *XTrigger {
 97567  			if _pList != nil {
 97568  				return _pList
 97569  			}
 97570  			return (*XTrigger)(_pTab.XpTrigger)
 97571  		}()
 97572  		_pList = _3_pTrig
 97573  	}
 97574  	_2_p = (*XHashElem)(_2_p.Xnext)
 97575  	goto _4
 97576  _7:
 97577  _1:
 97578  	return func() *XTrigger {
 97579  		if _pList != nil {
 97580  			return _pList
 97581  		}
 97582  		return (*XTrigger)(_pTab.XpTrigger)
 97583  	}()
 97584  }
 97585  
 97586  var _sqlite3TriggerListØ00__func__Ø000 [19]int8
 97587  
 97588  func init() {
 97589  	crt.Xstrncpy(nil, &_sqlite3TriggerListØ00__func__Ø000[0], str(115618), 19)
 97590  }
 97591  
 97592  var _sqlite3TriggersExistØ00__func__Ø000 [21]int8
 97593  
 97594  func init() {
 97595  	crt.Xstrncpy(nil, &_sqlite3TriggersExistØ00__func__Ø000[0], str(115637), 21)
 97596  }
 97597  
 97598  // C comment
 97599  //  /*
 97600  //  ** pEList is the SET clause of an UPDATE statement.  Each entry
 97601  //  ** in pEList is of the format <id>=<expr>.  If any of the entries
 97602  //  ** in pEList have an <id> which matches an identifier in pIdList,
 97603  //  ** then return TRUE.  If pIdList==NULL, then it is considered a
 97604  //  ** wildcard that matches anything.  Likewise if pEList==NULL then
 97605  //  ** it matches anything so always return true.  Return false only
 97606  //  ** if there is no match.
 97607  //  */
 97608  func _checkColumnOverlap(tls *crt.TLS, _pIdList *XIdList, _pEList *XExprList) (r0 int32) {
 97609  	var _e int32
 97610  	if (_pIdList == nil) || func() int32 {
 97611  		if _pEList == nil {
 97612  			return func() int32 {
 97613  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123246), unsafe.Pointer(&_checkColumnOverlapØ00__func__Ø000), unsafe.Pointer(str(4809)))
 97614  				crt.X__builtin_abort(tls)
 97615  				return int32(1)
 97616  			}()
 97617  		}
 97618  		return int32(0)
 97619  	}() != 0 {
 97620  		return int32(1)
 97621  	}
 97622  	_e = int32(0)
 97623  _4:
 97624  	if _e >= _pEList.XnExpr {
 97625  		goto _7
 97626  	}
 97627  	if _sqlite3IdListIndex(tls, _pIdList, elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_e)).XzName) >= int32(0) {
 97628  		return int32(1)
 97629  	}
 97630  	_e += 1
 97631  	goto _4
 97632  _7:
 97633  	return int32(0)
 97634  }
 97635  
 97636  var _checkColumnOverlapØ00__func__Ø000 [19]int8
 97637  
 97638  func init() {
 97639  	crt.Xstrncpy(nil, &_checkColumnOverlapØ00__func__Ø000[0], str(115658), 19)
 97640  }
 97641  
 97642  // C comment
 97643  //  /*
 97644  //  ** This function is called before generating code to update or delete a
 97645  //  ** row contained in table pTab. If the operation is a DELETE, then
 97646  //  ** parameter aChange is passed a NULL value. For an UPDATE, aChange points
 97647  //  ** to an array of size N, where N is the number of columns in table pTab.
 97648  //  ** If the i'th column is not modified by the UPDATE, then the corresponding
 97649  //  ** entry in the aChange[] array is set to -1. If the column is modified,
 97650  //  ** the value is 0 or greater. Parameter chngRowid is set to true if the
 97651  //  ** UPDATE statement modifies the rowid fields of the table.
 97652  //  **
 97653  //  ** If any foreign key processing will be required, this function returns
 97654  //  ** non-zero. If there is no foreign key related processing, this function
 97655  //  ** returns zero.
 97656  //  **
 97657  //  ** For an UPDATE, this function returns 2 if:
 97658  //  **
 97659  //  **   * There are any FKs for which pTab is the child and the parent table, or
 97660  //  **   * the UPDATE modifies one or more parent keys for which the action is
 97661  //  **     not "NO ACTION" (i.e. is CASCADE, SET DEFAULT or SET NULL).
 97662  //  **
 97663  //  ** Or, assuming some other foreign key processing is required, 1.
 97664  //  */
 97665  func _sqlite3FkRequired(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _aChange *int32, _chngRowid int32) (r0 int32) {
 97666  	var _eRet int32
 97667  	var _3_p *XFKey
 97668  	_eRet = int32(0)
 97669  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(524288)) == 0 {
 97670  		goto _0
 97671  	}
 97672  	if _aChange == nil {
 97673  		_eRet = bool2int((_sqlite3FkReferences(tls, _pTab) != nil) || (_pTab.XpFKey != nil))
 97674  		goto _3
 97675  	}
 97676  	_3_p = (*XFKey)(_pTab.XpFKey)
 97677  _4:
 97678  	if _3_p == nil {
 97679  		goto _7
 97680  	}
 97681  	if int32(0) == Xsqlite3_stricmp(tls, _pTab.XzName, _3_p.XzTo) {
 97682  		return int32(2)
 97683  	}
 97684  	if _fkChildIsModified(tls, _pTab, _3_p, _aChange, _chngRowid) != 0 {
 97685  		_eRet = int32(1)
 97686  	}
 97687  	_3_p = (*XFKey)(_3_p.XpNextFrom)
 97688  	goto _4
 97689  _7:
 97690  	_3_p = _sqlite3FkReferences(tls, _pTab)
 97691  _10:
 97692  	if _3_p == nil {
 97693  		goto _13
 97694  	}
 97695  	if _fkParentIsModified(tls, _pTab, _3_p, _aChange, _chngRowid) == 0 {
 97696  		goto _14
 97697  	}
 97698  	if int32(*elem15((*uint8)(unsafe.Pointer(&_3_p.XaAction)), uintptr(1))) != int32(0) {
 97699  		return int32(2)
 97700  	}
 97701  	_eRet = int32(1)
 97702  _14:
 97703  	_3_p = (*XFKey)(_3_p.XpNextTo)
 97704  	goto _10
 97705  _13:
 97706  _3:
 97707  _0:
 97708  	return _eRet
 97709  }
 97710  
 97711  // C comment
 97712  //  /*
 97713  //  ** The second argument points to an FKey object representing a foreign key
 97714  //  ** for which pTab is the child table. An UPDATE statement against pTab
 97715  //  ** is currently being processed. For each column of the table that is
 97716  //  ** actually updated, the corresponding element in the aChange[] array
 97717  //  ** is zero or greater (if a column is unmodified the corresponding element
 97718  //  ** is set to -1). If the rowid column is modified by the UPDATE statement
 97719  //  ** the bChngRowid argument is non-zero.
 97720  //  **
 97721  //  ** This function returns true if any of the columns that are part of the
 97722  //  ** child key for FK constraint *p are modified.
 97723  //  */
 97724  func _fkChildIsModified(tls *crt.TLS, _pTab *XTable, _p *XFKey, _aChange *int32, _bChngRowid int32) (r0 int32) {
 97725  	var _i, _1_iChildKey int32
 97726  	_i = int32(0)
 97727  _0:
 97728  	if _i >= _p.XnCol {
 97729  		goto _3
 97730  	}
 97731  	_1_iChildKey = elem117((*t118)(unsafe.Pointer(&_p.XaCol)), uintptr(_i)).XiFrom
 97732  	if (*elem8(_aChange, uintptr(_1_iChildKey))) >= int32(0) {
 97733  		return int32(1)
 97734  	}
 97735  	if (_1_iChildKey == int32(_pTab.XiPKey)) && _bChngRowid != 0 {
 97736  		return int32(1)
 97737  	}
 97738  	_i += 1
 97739  	goto _0
 97740  _3:
 97741  	return int32(0)
 97742  }
 97743  
 97744  // C comment
 97745  //  /*
 97746  //  ** The second argument points to an FKey object representing a foreign key
 97747  //  ** for which pTab is the parent table. An UPDATE statement against pTab
 97748  //  ** is currently being processed. For each column of the table that is
 97749  //  ** actually updated, the corresponding element in the aChange[] array
 97750  //  ** is zero or greater (if a column is unmodified the corresponding element
 97751  //  ** is set to -1). If the rowid column is modified by the UPDATE statement
 97752  //  ** the bChngRowid argument is non-zero.
 97753  //  **
 97754  //  ** This function returns true if any of the columns that are part of the
 97755  //  ** parent key for FK constraint *p are modified.
 97756  //  */
 97757  func _fkParentIsModified(tls *crt.TLS, _pTab *XTable, _p *XFKey, _aChange *int32, _bChngRowid int32) (r0 int32) {
 97758  	var _i, _1_iKey int32
 97759  	var _1_zKey *int8
 97760  	var _3_pCol *XColumn
 97761  	_i = int32(0)
 97762  _0:
 97763  	if _i >= _p.XnCol {
 97764  		goto _3
 97765  	}
 97766  	_1_zKey = elem117((*t118)(unsafe.Pointer(&_p.XaCol)), uintptr(_i)).XzCol
 97767  	_1_iKey = int32(0)
 97768  _4:
 97769  	if _1_iKey >= int32(_pTab.XnCol) {
 97770  		goto _7
 97771  	}
 97772  	if (*elem8(_aChange, uintptr(_1_iKey))) < int32(0) && (_1_iKey != int32(_pTab.XiPKey) || _bChngRowid == 0) {
 97773  		goto _10
 97774  	}
 97775  	_3_pCol = elem43((*XColumn)(_pTab.XaCol), uintptr(_1_iKey))
 97776  	if _1_zKey == nil {
 97777  		goto _11
 97778  	}
 97779  	if int32(0) == _sqlite3StrICmp(tls, _3_pCol.XzName, _1_zKey) {
 97780  		return int32(1)
 97781  	}
 97782  	goto _14
 97783  _11:
 97784  	if (int32(_3_pCol.XcolFlags) & int32(1)) != 0 {
 97785  		return int32(1)
 97786  	}
 97787  _14:
 97788  _10:
 97789  	_1_iKey += 1
 97790  	goto _4
 97791  _7:
 97792  	_i += 1
 97793  	goto _0
 97794  _3:
 97795  	return int32(0)
 97796  }
 97797  
 97798  // C comment
 97799  //  /*
 97800  //  ** Check to make sure the given table is writable.  If it is not
 97801  //  ** writable, generate an error message and return 1.  If it is
 97802  //  ** writable return 0;
 97803  //  */
 97804  func _sqlite3IsReadOnly(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _viewOk int32) (r0 int32) {
 97805  	if (_pTab.XnModuleArg != 0 && (func() func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 {
 97806  		v := (*Xsqlite3_module)((*XModule)(_sqlite3GetVTable(tls, (*Xsqlite3)(_pParse.Xdb), _pTab).XpMod).XpModule).XxUpdate
 97807  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&v))
 97808  	}() == nil)) || ((((_pTab.XtabFlags & uint32(1)) != (0)) && ((((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(2048)) == int32(0))) && (int32(_pParse.Xnested) == int32(0))) {
 97809  		_sqlite3ErrorMsg(tls, _pParse, str(115677), unsafe.Pointer(_pTab.XzName))
 97810  		return int32(1)
 97811  	}
 97812  	if (_viewOk == 0) && (_pTab.XpSelect != nil) {
 97813  		_sqlite3ErrorMsg(tls, _pParse, str(115706), unsafe.Pointer(_pTab.XzName))
 97814  		return int32(1)
 97815  	}
 97816  	return int32(0)
 97817  }
 97818  
 97819  // C comment
 97820  //  /*
 97821  //  ** Push an authorization context.  After this routine is called, the
 97822  //  ** zArg3 argument to authorization callbacks will be zContext until
 97823  //  ** popped.  Or if pParse==0, this routine is a no-op.
 97824  //  */
 97825  func _sqlite3AuthContextPush(tls *crt.TLS, _pParse *XParse, _pContext *XAuthContext, _zContext *int8) {
 97826  	func() {
 97827  		if _pParse == nil {
 97828  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99676), unsafe.Pointer(&_sqlite3AuthContextPushØ00__func__Ø000), unsafe.Pointer(str(115744)))
 97829  			crt.X__builtin_abort(tls)
 97830  		}
 97831  	}()
 97832  	*(**XParse)(unsafe.Pointer(&_pContext.XpParse)) = _pParse
 97833  	_pContext.XzAuthContext = _pParse.XzAuthContext
 97834  	_pParse.XzAuthContext = _zContext
 97835  }
 97836  
 97837  var _sqlite3AuthContextPushØ00__func__Ø000 [23]int8
 97838  
 97839  func init() {
 97840  	crt.Xstrncpy(nil, &_sqlite3AuthContextPushØ00__func__Ø000[0], str(115751), 23)
 97841  }
 97842  
 97843  // C comment
 97844  //  /*
 97845  //  ** Set a flag in the vdbe to update the change counter when it is finalised
 97846  //  ** or reset.
 97847  //  */
 97848  func _sqlite3VdbeCountChanges(tls *crt.TLS, _v *TVdbe) {
 97849  	storebits26(&_v.Xexpired, int16(1), 16, 4)
 97850  }
 97851  
 97852  // C comment
 97853  //  /*
 97854  //  ** Evaluate a view and store its result in an ephemeral table.  The
 97855  //  ** pWhere argument is an optional WHERE clause that restricts the
 97856  //  ** set of rows in the view that are to be added to the ephemeral table.
 97857  //  */
 97858  func _sqlite3MaterializeView(tls *crt.TLS, _pParse *XParse, _pView *XTable, _pWhere *XExpr, _iCur int32) {
 97859  	var _iDb int32
 97860  	var _db *Xsqlite3
 97861  	var _pFrom *XSrcList
 97862  	var _pSel *XSelect
 97863  	var _dest XSelectDest
 97864  	_db = (*Xsqlite3)(_pParse.Xdb)
 97865  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pView.XpSchema))
 97866  	_pWhere = _sqlite3ExprDup(tls, _db, _pWhere, int32(0))
 97867  	_pFrom = _sqlite3SrcListAppend(tls, _db, nil, nil, nil)
 97868  	if _pFrom != nil {
 97869  		func() {
 97870  			if _pFrom.XnSrc != int32(1) {
 97871  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104736), unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000), unsafe.Pointer(str(115774)))
 97872  				crt.X__builtin_abort(tls)
 97873  			}
 97874  		}()
 97875  		elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), 0).XzName = _sqlite3DbStrDup(tls, _db, _pView.XzName)
 97876  		elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), 0).XzDatabase = _sqlite3DbStrDup(tls, _db, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 97877  		func() {
 97878  			if (*XExpr)(elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), 0).XpOn) != nil {
 97879  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104739), unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000), unsafe.Pointer(str(115789)))
 97880  				crt.X__builtin_abort(tls)
 97881  			}
 97882  		}()
 97883  		func() {
 97884  			if (*XIdList)(elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), 0).XpUsing) != nil {
 97885  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104740), unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000), unsafe.Pointer(str(115808)))
 97886  				crt.X__builtin_abort(tls)
 97887  			}
 97888  		}()
 97889  	}
 97890  	_pSel = _sqlite3SelectNew(tls, _pParse, nil, _pFrom, _pWhere, nil, nil, nil, uint32(131072), nil, nil)
 97891  	_sqlite3SelectDestInit(tls, &_dest, int32(12), _iCur)
 97892  	_sqlite3Select(tls, _pParse, _pSel, &_dest)
 97893  	_sqlite3SelectDelete(tls, _db, _pSel)
 97894  }
 97895  
 97896  var _sqlite3MaterializeViewØ00__func__Ø000 [23]int8
 97897  
 97898  func init() {
 97899  	crt.Xstrncpy(nil, &_sqlite3MaterializeViewØ00__func__Ø000[0], str(115830), 23)
 97900  }
 97901  
 97902  // C comment
 97903  //  /*
 97904  //  ** Allocate a new Select structure and return a pointer to that
 97905  //  ** structure.
 97906  //  */
 97907  func _sqlite3SelectNew(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pSrc *XSrcList, _pWhere *XExpr, _pGroupBy *XExprList, _pHaving *XExpr, _pOrderBy *XExprList, _selFlags uint32, _pLimit *XExpr, _pOffset *XExpr) (r0 *XSelect) {
 97908  	var _standin XSelect
 97909  	var _pNew *XSelect
 97910  	_pNew = (*XSelect)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.Xdb), uint64(128)))
 97911  	if _pNew == nil {
 97912  		func() {
 97913  			if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 97914  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116638), unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000), unsafe.Pointer(str(42441)))
 97915  				crt.X__builtin_abort(tls)
 97916  			}
 97917  		}()
 97918  		_pNew = &_standin
 97919  	}
 97920  	if _pEList == nil {
 97921  		_pEList = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3Expr(tls, (*Xsqlite3)(_pParse.Xdb), int32(161), nil))
 97922  	}
 97923  	*(**XExprList)(unsafe.Pointer(&_pNew.XpEList)) = _pEList
 97924  	_pNew.Xop = uint8(119)
 97925  	_pNew.XselFlags = _selFlags
 97926  	_pNew.XiLimit = int32(0)
 97927  	_pNew.XiOffset = int32(0)
 97928  	*elem1((*int8)(unsafe.Pointer(&_pNew.XzSelName)), 0) = 0
 97929  	*elem8((*int32)(unsafe.Pointer(&_pNew.XaddrOpenEphm)), 0) = int32(-1)
 97930  	*elem8((*int32)(unsafe.Pointer(&_pNew.XaddrOpenEphm)), uintptr(1)) = int32(-1)
 97931  	_pNew.XnSelectRow = 0
 97932  	if _pSrc == nil {
 97933  		_pSrc = (*XSrcList)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), uint64(120)))
 97934  	}
 97935  	*(**XSrcList)(unsafe.Pointer(&_pNew.XpSrc)) = _pSrc
 97936  	*(**XExpr)(unsafe.Pointer(&_pNew.XpWhere)) = _pWhere
 97937  	*(**XExprList)(unsafe.Pointer(&_pNew.XpGroupBy)) = _pGroupBy
 97938  	*(**XExpr)(unsafe.Pointer(&_pNew.XpHaving)) = _pHaving
 97939  	*(**XExprList)(unsafe.Pointer(&_pNew.XpOrderBy)) = _pOrderBy
 97940  	*(**XSelect)(unsafe.Pointer(&_pNew.XpPrior)) = nil
 97941  	*(**XSelect)(unsafe.Pointer(&_pNew.XpNext)) = nil
 97942  	*(**XExpr)(unsafe.Pointer(&_pNew.XpLimit)) = _pLimit
 97943  	*(**XExpr)(unsafe.Pointer(&_pNew.XpOffset)) = _pOffset
 97944  	*(**XWith)(unsafe.Pointer(&_pNew.XpWith)) = nil
 97945  	func() {
 97946  		if _pOffset != nil && _pLimit == nil && _pParse.XnErr <= int32(0) && int32((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == int32(0) {
 97947  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116666), unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000), unsafe.Pointer(str(115853)))
 97948  			crt.X__builtin_abort(tls)
 97949  		}
 97950  	}()
 97951  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 97952  		_clearSelect(tls, (*Xsqlite3)(_pParse.Xdb), _pNew, bool2int(_pNew != &_standin))
 97953  		_pNew = nil
 97954  		goto _11
 97955  	}
 97956  	func() {
 97957  		if (*XSrcList)(_pNew.XpSrc) == nil && _pParse.XnErr <= int32(0) {
 97958  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116671), unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000), unsafe.Pointer(str(115926)))
 97959  			crt.X__builtin_abort(tls)
 97960  		}
 97961  	}()
 97962  _11:
 97963  	func() {
 97964  		if _pNew == &_standin {
 97965  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116673), unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000), unsafe.Pointer(str(115958)))
 97966  			crt.X__builtin_abort(tls)
 97967  		}
 97968  	}()
 97969  	return _pNew
 97970  
 97971  	_ = _standin
 97972  	panic(0)
 97973  }
 97974  
 97975  var _sqlite3SelectNewØ00__func__Ø000 [17]int8
 97976  
 97977  func init() {
 97978  	crt.Xstrncpy(nil, &_sqlite3SelectNewØ00__func__Ø000[0], str(115973), 17)
 97979  }
 97980  
 97981  // C comment
 97982  //  /*
 97983  //  ** Return ONEPASS_OFF (0) if an UPDATE or DELETE statement is unable to
 97984  //  ** operate directly on the rowis returned by a WHERE clause.  Return
 97985  //  ** ONEPASS_SINGLE (1) if the statement can operation directly because only
 97986  //  ** a single row is to be changed.  Return ONEPASS_MULTI (2) if the one-pass
 97987  //  ** optimization can be used on multiple
 97988  //  **
 97989  //  ** If the ONEPASS optimization is used (if this routine returns true)
 97990  //  ** then also write the indices of open cursors used by ONEPASS
 97991  //  ** into aiCur[0] and aiCur[1].  iaCur[0] gets the cursor of the data
 97992  //  ** table and iaCur[1] gets the cursor used by an auxiliary index.
 97993  //  ** Either value may be -1, indicating that cursor is not used.
 97994  //  ** Any cursors returned will have been opened for writing.
 97995  //  **
 97996  //  ** aiCur[0] and aiCur[1] both get -1 if the where-clause logic is
 97997  //  ** unable to use the ONEPASS optimization.
 97998  //  */
 97999  func _sqlite3WhereOkOnePass(tls *crt.TLS, _pWInfo *XWhereInfo, _aiCur *int32) (r0 int32) {
 98000  	crt.Xmemcpy(tls, unsafe.Pointer(_aiCur), unsafe.Pointer(&_pWInfo.XaiCurOnePass), uint64(8))
 98001  	return int32(_pWInfo.XeOnePass)
 98002  }
 98003  
 98004  // C comment
 98005  //  /*
 98006  //  ** Allocate cursors for the pTab table and all its indices and generate
 98007  //  ** code to open and initialized those cursors.
 98008  //  **
 98009  //  ** The cursor for the object that contains the complete data (normally
 98010  //  ** the table itself, but the PRIMARY KEY index in the case of a WITHOUT
 98011  //  ** ROWID table) is returned in *piDataCur.  The first index cursor is
 98012  //  ** returned in *piIdxCur.  The number of indices is returned.
 98013  //  **
 98014  //  ** Use iBase as the first cursor (either the *piDataCur for rowid tables
 98015  //  ** or the first index for WITHOUT ROWID tables) if it is non-negative.
 98016  //  ** If iBase is negative, then allocate the next available cursor.
 98017  //  **
 98018  //  ** For a rowid table, *piDataCur will be exactly one less than *piIdxCur.
 98019  //  ** For a WITHOUT ROWID table, *piDataCur will be somewhere in the range
 98020  //  ** of *piIdxCurs, depending on where the PRIMARY KEY index appears on the
 98021  //  ** pTab->pIndex list.
 98022  //  **
 98023  //  ** If pTab is a virtual table, then this routine is a no-op and the
 98024  //  ** *piDataCur and *piIdxCur values are left uninitialized.
 98025  //  */
 98026  func _sqlite3OpenTableAndIndices(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _op int32, _p5 uint8, _iBase int32, _aToOpen *uint8, _piDataCur *int32, _piIdxCur *int32) (r0 int32) {
 98027  	var _i, _iDb, _iDataCur, _4_iIdxCur int32
 98028  	var _v *TVdbe
 98029  	var _pIdx *XIndex
 98030  	func() {
 98031  		if _op != int32(106) && _op != int32(107) {
 98032  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110658), unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000), unsafe.Pointer(str(115990)))
 98033  			crt.X__builtin_abort(tls)
 98034  		}
 98035  	}()
 98036  	func() {
 98037  		if _op != int32(107) && int32(_p5) != int32(0) {
 98038  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110659), unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000), unsafe.Pointer(str(116026)))
 98039  			crt.X__builtin_abort(tls)
 98040  		}
 98041  	}()
 98042  	if _pTab.XnModuleArg != 0 {
 98043  		return int32(0)
 98044  	}
 98045  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
 98046  	_v = _sqlite3GetVdbe(tls, _pParse)
 98047  	func() {
 98048  		if _v == nil {
 98049  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110668), unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000), unsafe.Pointer(str(42019)))
 98050  			crt.X__builtin_abort(tls)
 98051  		}
 98052  	}()
 98053  	if _iBase < int32(0) {
 98054  		_iBase = _pParse.XnTab
 98055  	}
 98056  	_iDataCur = postInc2(&_iBase, 1)
 98057  	if _piDataCur != nil {
 98058  		*_piDataCur = _iDataCur
 98059  	}
 98060  	if ((_pTab.XtabFlags & uint32(32)) == (0)) && ((_aToOpen == nil) || ((*elem15(_aToOpen, 0)) != 0)) {
 98061  		_sqlite3OpenTable(tls, _pParse, _iDataCur, _iDb, _pTab, _op)
 98062  		goto _14
 98063  	}
 98064  	_sqlite3TableLock(tls, _pParse, _iDb, _pTab.Xtnum, uint8(bool2int(_op == int32(107))), _pTab.XzName)
 98065  _14:
 98066  	if _piIdxCur != nil {
 98067  		*_piIdxCur = _iBase
 98068  	}
 98069  	*func() **XIndex { _i = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
 98070  _16:
 98071  	if _pIdx == nil {
 98072  		goto _19
 98073  	}
 98074  	_4_iIdxCur = postInc2(&_iBase, 1)
 98075  	func() {
 98076  		if (*XSchema)(_pIdx.XpSchema) != (*XSchema)(_pTab.XpSchema) {
 98077  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110680), unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000), unsafe.Pointer(str(115165)))
 98078  			crt.X__builtin_abort(tls)
 98079  		}
 98080  	}()
 98081  	if int32((uint32(_pIdx.XidxType)<<30)>>30) != int32(2) || (_pTab.XtabFlags&uint32(32)) == (0) {
 98082  		goto _23
 98083  	}
 98084  	if _piDataCur != nil {
 98085  		*_piDataCur = _4_iIdxCur
 98086  	}
 98087  	_p5 = 0
 98088  _23:
 98089  	if (_aToOpen == nil) || ((*elem15(_aToOpen, uintptr(_i+int32(1)))) != 0) {
 98090  		_sqlite3VdbeAddOp3(tls, _v, _op, _4_iIdxCur, _pIdx.Xtnum, _iDb)
 98091  		_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
 98092  		_sqlite3VdbeChangeP5(tls, _v, uint16(_p5))
 98093  		_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pIdx.XzName))
 98094  	}
 98095  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_i }() += 1
 98096  	goto _16
 98097  _19:
 98098  	if _iBase > _pParse.XnTab {
 98099  		_pParse.XnTab = _iBase
 98100  	}
 98101  	return _i
 98102  }
 98103  
 98104  var _sqlite3OpenTableAndIndicesØ00__func__Ø000 [27]int8
 98105  
 98106  func init() {
 98107  	crt.Xstrncpy(nil, &_sqlite3OpenTableAndIndicesØ00__func__Ø000[0], str(116052), 27)
 98108  }
 98109  
 98110  // C comment
 98111  //  /*
 98112  //  ** Make sure virtual table pTab is contained in the pParse->apVirtualLock[]
 98113  //  ** array so that an OP_VBegin will get generated for it.  Add pTab to the
 98114  //  ** array if it is missing.  If pTab is already in the array, this routine
 98115  //  ** is a no-op.
 98116  //  */
 98117  func _sqlite3VtabMakeWritable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) {
 98118  	var _i, _n int32
 98119  	var _pToplevel *XParse
 98120  	var _apVtabLock **XTable
 98121  	_pToplevel = func() *XParse {
 98122  		if _pParse.XpToplevel != nil {
 98123  			return (*XParse)(_pParse.XpToplevel)
 98124  		}
 98125  		return _pParse
 98126  	}()
 98127  	func() {
 98128  		if _pTab.XnModuleArg == 0 {
 98129  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126093), unsafe.Pointer(&_sqlite3VtabMakeWritableØ00__func__Ø000), unsafe.Pointer(str(24484)))
 98130  			crt.X__builtin_abort(tls)
 98131  		}
 98132  	}()
 98133  	_i = int32(0)
 98134  _4:
 98135  	if _i >= _pToplevel.XnVtabLock {
 98136  		goto _7
 98137  	}
 98138  	if _pTab == (*elem61((**XTable)(unsafe.Pointer(_pToplevel.XapVtabLock)), uintptr(_i))) {
 98139  		return
 98140  	}
 98141  	_i += 1
 98142  	goto _4
 98143  _7:
 98144  	_n = int32(uint64(_pToplevel.XnVtabLock+int32(1)) * uint64(8))
 98145  	_apVtabLock = (**XTable)(Xsqlite3_realloc64(tls, unsafe.Pointer(_pToplevel.XapVtabLock), uint64(_n)))
 98146  	if _apVtabLock != nil {
 98147  		*(***XTable)(unsafe.Pointer(&_pToplevel.XapVtabLock)) = _apVtabLock
 98148  		*elem61((**XTable)(unsafe.Pointer(_pToplevel.XapVtabLock)), uintptr(postInc2(&_pToplevel.XnVtabLock, 1))) = _pTab
 98149  		goto _10
 98150  	}
 98151  	_sqlite3OomFault(tls, (*Xsqlite3)(_pToplevel.Xdb))
 98152  _10:
 98153  }
 98154  
 98155  var _sqlite3VtabMakeWritableØ00__func__Ø000 [24]int8
 98156  
 98157  func init() {
 98158  	crt.Xstrncpy(nil, &_sqlite3VtabMakeWritableØ00__func__Ø000[0], str(116079), 24)
 98159  }
 98160  
 98161  // C comment
 98162  //  /*
 98163  //  ** This routine generates VDBE code that causes a single row of a
 98164  //  ** single table to be deleted.  Both the original table entry and
 98165  //  ** all indices are removed.
 98166  //  **
 98167  //  ** Preconditions:
 98168  //  **
 98169  //  **   1.  iDataCur is an open cursor on the btree that is the canonical data
 98170  //  **       store for the table.  (This will be either the table itself,
 98171  //  **       in the case of a rowid table, or the PRIMARY KEY index in the case
 98172  //  **       of a WITHOUT ROWID table.)
 98173  //  **
 98174  //  **   2.  Read/write cursors for all indices of pTab must be open as
 98175  //  **       cursor number iIdxCur+i for the i-th index.
 98176  //  **
 98177  //  **   3.  The primary key for the row to be deleted must be stored in a
 98178  //  **       sequence of nPk memory cells starting at iPk.  If nPk==0 that means
 98179  //  **       that a search record formed from OP_MakeRecord is contained in the
 98180  //  **       single memory location iPk.
 98181  //  **
 98182  //  ** eMode:
 98183  //  **   Parameter eMode may be passed either ONEPASS_OFF (0), ONEPASS_SINGLE, or
 98184  //  **   ONEPASS_MULTI.  If eMode is not ONEPASS_OFF, then the cursor
 98185  //  **   iDataCur already points to the row to delete. If eMode is ONEPASS_OFF
 98186  //  **   then this function must seek iDataCur to the entry identified by iPk
 98187  //  **   and nPk before reading from it.
 98188  //  **
 98189  //  **   If eMode is ONEPASS_MULTI, then this call is being made as part
 98190  //  **   of a ONEPASS delete that affects multiple rows. In this case, if
 98191  //  **   iIdxNoSeek is a valid cursor number (>=0) and is not the same as
 98192  //  **   iDataCur, then its position should be preserved following the delete
 98193  //  **   operation. Or, if iIdxNoSeek is not a valid cursor number, the
 98194  //  **   position of iDataCur should be preserved instead.
 98195  //  **
 98196  //  ** iIdxNoSeek:
 98197  //  **   If iIdxNoSeek is a valid cursor number (>=0) not equal to iDataCur,
 98198  //  **   then it identifies an index cursor (from within array of cursors
 98199  //  **   starting at iIdxCur) that already points to the index entry to be deleted.
 98200  //  **   Except, this optimization is disabled if there are BEFORE triggers since
 98201  //  **   the trigger body might have moved the cursor.
 98202  //  */
 98203  func _sqlite3GenerateRowDelete(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pTrigger *XTrigger, _iDataCur int32, _iIdxCur int32, _iPk int32, _nPk int16, _count uint8, _onconf uint8, _eMode uint8, _iIdxNoSeek int32) {
 98204  	var _iOld, _iLabel, _2_iCol, _2_addrStart int32
 98205  	var _2_mask uint32
 98206  	var _opSeek, _6_p5 uint8
 98207  	var _v *TVdbe
 98208  	_v = (*TVdbe)(_pParse.XpVdbe)
 98209  	_iOld = int32(0)
 98210  	func() {
 98211  		if _v == nil {
 98212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105274), unsafe.Pointer(&_sqlite3GenerateRowDeleteØ00__func__Ø000), unsafe.Pointer(str(41816)))
 98213  			crt.X__builtin_abort(tls)
 98214  		}
 98215  	}()
 98216  	_iLabel = _sqlite3VdbeMakeLabel(tls, _v)
 98217  	_opSeek = uint8(func() int32 {
 98218  		if (_pTab.XtabFlags & uint32(32)) == (0) {
 98219  			return int32(32)
 98220  		}
 98221  		return int32(29)
 98222  	}())
 98223  	if int32(_eMode) == int32(0) {
 98224  		_sqlite3VdbeAddOp4Int(tls, _v, int32(_opSeek), _iDataCur, _iLabel, _iPk, int32(_nPk))
 98225  	}
 98226  	if _sqlite3FkRequired(tls, _pParse, _pTab, nil, int32(0)) == 0 && _pTrigger == nil {
 98227  		goto _6
 98228  	}
 98229  	_2_mask = _sqlite3TriggerColmask(tls, _pParse, _pTrigger, nil, int32(0), int32(3), _pTab, int32(_onconf))
 98230  	_2_mask |= _sqlite3FkOldmask(tls, _pParse, _pTab)
 98231  	_iOld = _pParse.XnMem + int32(1)
 98232  	_pParse.XnMem += int32(1) + int32(_pTab.XnCol)
 98233  	_sqlite3VdbeAddOp2(tls, _v, int32(64), _iPk, _iOld)
 98234  	_2_iCol = int32(0)
 98235  _7:
 98236  	if _2_iCol >= int32(_pTab.XnCol) {
 98237  		goto _10
 98238  	}
 98239  	if (_2_mask == uint32(4294967295)) || ((_2_iCol <= int32(31)) && ((_2_mask & (uint32(1) << uint(_2_iCol))) != (0))) {
 98240  		_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, _2_iCol, (_iOld+_2_iCol)+int32(1))
 98241  	}
 98242  	_2_iCol += 1
 98243  	goto _7
 98244  _10:
 98245  	_2_addrStart = _sqlite3VdbeCurrentAddr(tls, _v)
 98246  	_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(109), nil, int32(1), _pTab, _iOld, int32(_onconf), _iLabel)
 98247  	if _2_addrStart < _sqlite3VdbeCurrentAddr(tls, _v) {
 98248  		_sqlite3VdbeAddOp4Int(tls, _v, int32(_opSeek), _iDataCur, _iLabel, _iPk, int32(_nPk))
 98249  		_iIdxNoSeek = int32(-1)
 98250  	}
 98251  	_sqlite3FkCheck(tls, _pParse, _pTab, _iOld, int32(0), nil, int32(0))
 98252  _6:
 98253  	if (*XSelect)(_pTab.XpSelect) != nil {
 98254  		goto _15
 98255  	}
 98256  	_6_p5 = uint8(0)
 98257  	_sqlite3GenerateRowIndexDelete(tls, _pParse, _pTab, _iDataCur, _iIdxCur, nil, _iIdxNoSeek)
 98258  	_sqlite3VdbeAddOp2(tls, _v, int32(120), _iDataCur, func() int32 {
 98259  		if _count != 0 {
 98260  			return int32(1)
 98261  		}
 98262  		return int32(0)
 98263  	}())
 98264  	if int32(_pParse.Xnested) == int32(0) {
 98265  		_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_pTab), int32(-15))
 98266  	}
 98267  	if int32(_eMode) != int32(0) {
 98268  		_sqlite3VdbeChangeP5(tls, _v, uint16(4))
 98269  	}
 98270  	if (_iIdxNoSeek >= int32(0)) && (_iIdxNoSeek != _iDataCur) {
 98271  		_sqlite3VdbeAddOp1(tls, _v, int32(120), _iIdxNoSeek)
 98272  	}
 98273  	if int32(_eMode) == int32(2) {
 98274  		{
 98275  			p := &_6_p5
 98276  			*p = uint8(int32(*p) | int32(2))
 98277  		}
 98278  	}
 98279  	_sqlite3VdbeChangeP5(tls, _v, uint16(_6_p5))
 98280  _15:
 98281  	_sqlite3FkActions(tls, _pParse, _pTab, nil, _iOld, nil, int32(0))
 98282  	_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(109), nil, int32(2), _pTab, _iOld, int32(_onconf), _iLabel)
 98283  	_sqlite3VdbeResolveLabel(tls, _v, _iLabel)
 98284  }
 98285  
 98286  var _sqlite3GenerateRowDeleteØ00__func__Ø000 [25]int8
 98287  
 98288  func init() {
 98289  	crt.Xstrncpy(nil, &_sqlite3GenerateRowDeleteØ00__func__Ø000[0], str(116103), 25)
 98290  }
 98291  
 98292  // C comment
 98293  //  /*
 98294  //  ** Triggers may access values stored in the old.* or new.* pseudo-table.
 98295  //  ** This function returns a 32-bit bitmask indicating which columns of the
 98296  //  ** old.* or new.* tables actually are used by triggers. This information
 98297  //  ** may be used by the caller, for example, to avoid having to load the entire
 98298  //  ** old.* record into memory when executing an UPDATE or DELETE command.
 98299  //  **
 98300  //  ** Bit 0 of the returned mask is set if the left-most column of the
 98301  //  ** table may be accessed using an [old|new].<col> reference. Bit 1 is set if
 98302  //  ** the second leftmost column value is required, and so on. If there
 98303  //  ** are more than 32 columns in the table, and at least one of the columns
 98304  //  ** with an index greater than 32 may be accessed, 0xffffffff is returned.
 98305  //  **
 98306  //  ** It is not possible to determine if the old.rowid or new.rowid column is
 98307  //  ** accessed by triggers. The caller must always assume that it is.
 98308  //  **
 98309  //  ** Parameter isNew must be either 1 or 0. If it is 0, then the mask returned
 98310  //  ** applies to the old.* table. If 1, the new.* table.
 98311  //  **
 98312  //  ** Parameter tr_tm must be a mask with one or both of the TRIGGER_BEFORE
 98313  //  ** and TRIGGER_AFTER bits set. Values accessed by BEFORE triggers are only
 98314  //  ** included in the returned mask if the TRIGGER_BEFORE bit is set in the
 98315  //  ** tr_tm parameter. Similarly, values accessed by AFTER triggers are only
 98316  //  ** included in the returned mask if the TRIGGER_AFTER bit is set in tr_tm.
 98317  //  */
 98318  func _sqlite3TriggerColmask(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pChanges *XExprList, _isNew int32, _tr_tm int32, _pTab *XTable, _orconf int32) (r0 uint32) {
 98319  	var _op int32
 98320  	var _mask uint32
 98321  	var _p *XTrigger
 98322  	var _2_pPrg *XTriggerPrg
 98323  	_op = func() int32 {
 98324  		if _pChanges != nil {
 98325  			return int32(110)
 98326  		}
 98327  		return int32(109)
 98328  	}()
 98329  	_mask = uint32(0)
 98330  	func() {
 98331  		if _isNew != int32(1) && _isNew != int32(0) {
 98332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123727), unsafe.Pointer(&_sqlite3TriggerColmaskØ00__func__Ø000), unsafe.Pointer(str(116128)))
 98333  			crt.X__builtin_abort(tls)
 98334  		}
 98335  	}()
 98336  	_p = _pTrigger
 98337  _5:
 98338  	if _p == nil {
 98339  		goto _8
 98340  	}
 98341  	if int32(_p.Xop) != _op || (_tr_tm&int32(_p.Xtr_tm)) == 0 || _checkColumnOverlap(tls, (*XIdList)(_p.XpColumns), _pChanges) == 0 {
 98342  		goto _11
 98343  	}
 98344  	_2_pPrg = _getRowTrigger(tls, _pParse, _p, _pTab, _orconf)
 98345  	if _2_pPrg != nil {
 98346  		_mask |= *elem31((*uint32)(unsafe.Pointer(&_2_pPrg.XaColmask)), uintptr(_isNew))
 98347  	}
 98348  _11:
 98349  	_p = (*XTrigger)(_p.XpNext)
 98350  	goto _5
 98351  _8:
 98352  	return _mask
 98353  }
 98354  
 98355  var _sqlite3TriggerColmaskØ00__func__Ø000 [22]int8
 98356  
 98357  func init() {
 98358  	crt.Xstrncpy(nil, &_sqlite3TriggerColmaskØ00__func__Ø000[0], str(116149), 22)
 98359  }
 98360  
 98361  // C comment
 98362  //  /*
 98363  //  ** Return a pointer to a TriggerPrg object containing the sub-program for
 98364  //  ** trigger pTrigger with default ON CONFLICT algorithm orconf. If no such
 98365  //  ** TriggerPrg object exists, a new object is allocated and populated before
 98366  //  ** being returned.
 98367  //  */
 98368  func _getRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab *XTable, _orconf int32) (r0 *XTriggerPrg) {
 98369  	var _pRoot *XParse
 98370  	var _pPrg *XTriggerPrg
 98371  	_pRoot = func() *XParse {
 98372  		if _pParse.XpToplevel != nil {
 98373  			return (*XParse)(_pParse.XpToplevel)
 98374  		}
 98375  		return _pParse
 98376  	}()
 98377  	func() {
 98378  		if _pTrigger.XzName != nil && _pTab != _tableOfTrigger(tls, _pTrigger) {
 98379  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123555), unsafe.Pointer(&_getRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116171)))
 98380  			crt.X__builtin_abort(tls)
 98381  		}
 98382  	}()
 98383  	_pPrg = (*XTriggerPrg)(_pRoot.XpTriggerPrg)
 98384  _5:
 98385  	if _pPrg == nil || (*XTrigger)(_pPrg.XpTrigger) == _pTrigger && _pPrg.Xorconf == _orconf {
 98386  		goto _10
 98387  	}
 98388  	_pPrg = (*XTriggerPrg)(_pPrg.XpNext)
 98389  	goto _5
 98390  _10:
 98391  	if _pPrg == nil {
 98392  		_pPrg = _codeRowTrigger(tls, _pParse, _pTrigger, _pTab, _orconf)
 98393  	}
 98394  	return _pPrg
 98395  }
 98396  
 98397  var _getRowTriggerØ00__func__Ø000 [14]int8
 98398  
 98399  func init() {
 98400  	crt.Xstrncpy(nil, &_getRowTriggerØ00__func__Ø000[0], str(116224), 14)
 98401  }
 98402  
 98403  // C comment
 98404  //  /*
 98405  //  ** Create and populate a new TriggerPrg object with a sub-program
 98406  //  ** implementing trigger pTrigger with ON CONFLICT policy orconf.
 98407  //  */
 98408  func _codeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab *XTable, _orconf int32) (r0 *XTriggerPrg) {
 98409  	var _iEndTrigger int32
 98410  	var _db *Xsqlite3
 98411  	var _v *TVdbe
 98412  	var _pWhen *XExpr
 98413  	var _pTop, _pSubParse *XParse
 98414  	var _pProgram *XSubProgram
 98415  	var _sNC XNameContext
 98416  	var _pPrg *XTriggerPrg
 98417  	_pTop = func() *XParse {
 98418  		if _pParse.XpToplevel != nil {
 98419  			return (*XParse)(_pParse.XpToplevel)
 98420  		}
 98421  		return _pParse
 98422  	}()
 98423  	_db = (*Xsqlite3)(_pParse.Xdb)
 98424  	_pWhen = nil
 98425  	_pProgram = nil
 98426  	_iEndTrigger = int32(0)
 98427  	func() {
 98428  		if _pTrigger.XzName != nil && _pTab != _tableOfTrigger(tls, _pTrigger) {
 98429  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123449), unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116171)))
 98430  			crt.X__builtin_abort(tls)
 98431  		}
 98432  	}()
 98433  	func() {
 98434  		if _pTop.XpVdbe == nil {
 98435  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123450), unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116238)))
 98436  			crt.X__builtin_abort(tls)
 98437  		}
 98438  	}()
 98439  	_pPrg = (*XTriggerPrg)(_sqlite3DbMallocZero(tls, _db, uint64(40)))
 98440  	if _pPrg == nil {
 98441  		return nil
 98442  	}
 98443  	*(**XTriggerPrg)(unsafe.Pointer(&_pPrg.XpNext)) = (*XTriggerPrg)(_pTop.XpTriggerPrg)
 98444  	*(**XTriggerPrg)(unsafe.Pointer(&_pTop.XpTriggerPrg)) = _pPrg
 98445  	*(**XSubProgram)(unsafe.Pointer(&_pPrg.XpProgram)) = store120(&_pProgram, (*XSubProgram)(_sqlite3DbMallocZero(tls, _db, uint64(48))))
 98446  	if _pProgram == nil {
 98447  		return nil
 98448  	}
 98449  	_sqlite3VdbeLinkSubProgram(tls, (*TVdbe)(_pTop.XpVdbe), _pProgram)
 98450  	*(**XTrigger)(unsafe.Pointer(&_pPrg.XpTrigger)) = _pTrigger
 98451  	_pPrg.Xorconf = _orconf
 98452  	*elem31((*uint32)(unsafe.Pointer(&_pPrg.XaColmask)), 0) = uint32(4294967295)
 98453  	*elem31((*uint32)(unsafe.Pointer(&_pPrg.XaColmask)), uintptr(1)) = uint32(4294967295)
 98454  	_pSubParse = (*XParse)(_sqlite3DbMallocZero(tls, _db, uint64(600)))
 98455  	if _pSubParse == nil {
 98456  		return nil
 98457  	}
 98458  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint64(56))
 98459  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pSubParse
 98460  	*(**Xsqlite3)(unsafe.Pointer(&_pSubParse.Xdb)) = _db
 98461  	*(**XTable)(unsafe.Pointer(&_pSubParse.XpTriggerTab)) = _pTab
 98462  	*(**XParse)(unsafe.Pointer(&_pSubParse.XpToplevel)) = _pTop
 98463  	_pSubParse.XzAuthContext = _pTrigger.XzName
 98464  	_pSubParse.XeTriggerOp = _pTrigger.Xop
 98465  	_pSubParse.XnQueryLoop = _pParse.XnQueryLoop
 98466  	_v = _sqlite3GetVdbe(tls, _pSubParse)
 98467  	if _v == nil {
 98468  		goto _10
 98469  	}
 98470  	_sqlite3VdbeComment(tls, _v, str(116250), unsafe.Pointer(_pTrigger.XzName), unsafe.Pointer(_onErrorText(tls, _orconf)), unsafe.Pointer(func() *int8 {
 98471  		if int32(_pTrigger.Xtr_tm) == int32(1) {
 98472  			return str(25122)
 98473  		}
 98474  		return str(25097)
 98475  	}()), unsafe.Pointer(func() *int8 {
 98476  		if int32(_pTrigger.Xop) == int32(110) {
 98477  			return str(25595)
 98478  		}
 98479  		return str(284)
 98480  	}()), unsafe.Pointer(func() *int8 {
 98481  		if int32(_pTrigger.Xop) == int32(108) {
 98482  			return str(25581)
 98483  		}
 98484  		return str(284)
 98485  	}()), unsafe.Pointer(func() *int8 {
 98486  		if int32(_pTrigger.Xop) == int32(109) {
 98487  			return str(25588)
 98488  		}
 98489  		return str(284)
 98490  	}()), unsafe.Pointer(_pTab.XzName))
 98491  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), _sqlite3MPrintf(tls, _db, str(116281), unsafe.Pointer(_pTrigger.XzName)), int32(-1))
 98492  	if _pTrigger.XpWhen == nil {
 98493  		goto _19
 98494  	}
 98495  	_pWhen = _sqlite3ExprDup(tls, _db, (*XExpr)(_pTrigger.XpWhen), int32(0))
 98496  	if (int32(0) == _sqlite3ResolveExprNames(tls, &_sNC, _pWhen)) && (int32(_db.XmallocFailed) == int32(0)) {
 98497  		_iEndTrigger = _sqlite3VdbeMakeLabel(tls, _v)
 98498  		_sqlite3ExprIfFalse(tls, _pSubParse, _pWhen, _iEndTrigger, int32(16))
 98499  	}
 98500  	_sqlite3ExprDelete(tls, _db, _pWhen)
 98501  _19:
 98502  	_codeTriggerProgram(tls, _pSubParse, (*XTriggerStep)(_pTrigger.Xstep_list), _orconf)
 98503  	if _iEndTrigger != 0 {
 98504  		_sqlite3VdbeResolveLabel(tls, _v, _iEndTrigger)
 98505  	}
 98506  	_sqlite3VdbeAddOp0(tls, _v, int32(55))
 98507  	_sqlite3VdbeComment(tls, _v, str(116295), unsafe.Pointer(_pTrigger.XzName), unsafe.Pointer(_onErrorText(tls, _orconf)))
 98508  	_transferParseError(tls, _pParse, _pSubParse)
 98509  	if int32(_db.XmallocFailed) == int32(0) {
 98510  		*(**XVdbeOp)(unsafe.Pointer(&_pProgram.XaOp)) = _sqlite3VdbeTakeOpArray(tls, _v, &_pProgram.XnOp, &_pTop.XnMaxArg)
 98511  	}
 98512  	_pProgram.XnMem = _pSubParse.XnMem
 98513  	_pProgram.XnCsr = _pSubParse.XnTab
 98514  	_pProgram.Xtoken = unsafe.Pointer(_pTrigger)
 98515  	*elem31((*uint32)(unsafe.Pointer(&_pPrg.XaColmask)), 0) = _pSubParse.Xoldmask
 98516  	*elem31((*uint32)(unsafe.Pointer(&_pPrg.XaColmask)), uintptr(1)) = _pSubParse.Xnewmask
 98517  	_sqlite3VdbeDelete(tls, _v)
 98518  _10:
 98519  	func() {
 98520  		if _pSubParse.XpAinc != nil || _pSubParse.XpZombieTab != nil {
 98521  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123532), unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116306)))
 98522  			crt.X__builtin_abort(tls)
 98523  		}
 98524  	}()
 98525  	func() {
 98526  		if _pSubParse.XpTriggerPrg != nil || _pSubParse.XnMaxArg != 0 {
 98527  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123533), unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116350)))
 98528  			crt.X__builtin_abort(tls)
 98529  		}
 98530  	}()
 98531  	_sqlite3ParserReset(tls, _pSubParse)
 98532  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubParse))
 98533  	return _pPrg
 98534  }
 98535  
 98536  var _codeRowTriggerØ00__func__Ø000 [15]int8
 98537  
 98538  func init() {
 98539  	crt.Xstrncpy(nil, &_codeRowTriggerØ00__func__Ø000[0], str(116397), 15)
 98540  }
 98541  
 98542  // C comment
 98543  //  /*
 98544  //  ** Link the SubProgram object passed as the second argument into the linked
 98545  //  ** list at Vdbe.pSubProgram. This list is used to delete all sub-program
 98546  //  ** objects when the VM is no longer required.
 98547  //  */
 98548  func _sqlite3VdbeLinkSubProgram(tls *crt.TLS, _pVdbe *TVdbe, _p *XSubProgram) {
 98549  	*(**XSubProgram)(unsafe.Pointer(&_p.XpNext)) = (*XSubProgram)(_pVdbe.XpProgram)
 98550  	*(**XSubProgram)(unsafe.Pointer(&_pVdbe.XpProgram)) = _p
 98551  }
 98552  
 98553  // C comment
 98554  //  /*
 98555  //  ** This function is used to add VdbeComment() annotations to a VDBE
 98556  //  ** program. It is not used in production code, only for debugging.
 98557  //  */
 98558  func _onErrorText(tls *crt.TLS, _onError int32) (r0 *int8) {
 98559  	switch _onError {
 98560  	case int32(1):
 98561  		goto _2
 98562  	case int32(2):
 98563  		goto _1
 98564  	case int32(3):
 98565  		goto _3
 98566  	case int32(4):
 98567  		goto _5
 98568  	case int32(5):
 98569  		goto _4
 98570  	case int32(10):
 98571  		goto _6
 98572  	default:
 98573  		goto _7
 98574  	}
 98575  
 98576  _1:
 98577  	return str(47486)
 98578  
 98579  _2:
 98580  	return str(47477)
 98581  
 98582  _3:
 98583  	return str(47492)
 98584  
 98585  _4:
 98586  	return str(7805)
 98587  
 98588  _5:
 98589  	return str(47497)
 98590  
 98591  _6:
 98592  	return str(116412)
 98593  
 98594  _7:
 98595  	return str(116420)
 98596  }
 98597  
 98598  // C comment
 98599  //  /*
 98600  //  ** Generate VDBE code for the statements inside the body of a single
 98601  //  ** trigger.
 98602  //  */
 98603  func _codeTriggerProgram(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerStep, _orconf int32) (r0 int32) {
 98604  	var _db *Xsqlite3
 98605  	var _v *TVdbe
 98606  	var _6_pSelect *XSelect
 98607  	var _6_sDest XSelectDest
 98608  	var _pStep *XTriggerStep
 98609  	_v = (*TVdbe)(_pParse.XpVdbe)
 98610  	_db = (*Xsqlite3)(_pParse.Xdb)
 98611  	func() {
 98612  		if _pParse.XpTriggerTab == nil || _pParse.XpToplevel == nil {
 98613  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123331), unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000), unsafe.Pointer(str(116424)))
 98614  			crt.X__builtin_abort(tls)
 98615  		}
 98616  	}()
 98617  	func() {
 98618  		if _pStepList == nil {
 98619  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123332), unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000), unsafe.Pointer(str(116465)))
 98620  			crt.X__builtin_abort(tls)
 98621  		}
 98622  	}()
 98623  	func() {
 98624  		if _v == nil {
 98625  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123333), unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000), unsafe.Pointer(str(42019)))
 98626  			crt.X__builtin_abort(tls)
 98627  		}
 98628  	}()
 98629  	_pStep = _pStepList
 98630  _7:
 98631  	if _pStep == nil {
 98632  		goto _10
 98633  	}
 98634  	_pParse.XeOrconf = func() uint8 {
 98635  		if _orconf == int32(10) {
 98636  			return _pStep.Xorconf
 98637  		}
 98638  		return uint8(_orconf)
 98639  	}()
 98640  	func() {
 98641  		if int32(_pParse.XokConstFactor) != int32(0) {
 98642  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123349), unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000), unsafe.Pointer(str(116475)))
 98643  			crt.X__builtin_abort(tls)
 98644  		}
 98645  	}()
 98646  	switch int32(_pStep.Xop) {
 98647  	case int32(108):
 98648  		goto _17
 98649  	case int32(109):
 98650  		goto _18
 98651  	case int32(110):
 98652  		goto _16
 98653  	default:
 98654  		goto _19
 98655  	}
 98656  
 98657  _16:
 98658  	_sqlite3Update(tls, _pParse, _targetSrcList(tls, _pParse, _pStep), _sqlite3ExprListDup(tls, _db, (*XExprList)(_pStep.XpExprList), int32(0)), _sqlite3ExprDup(tls, _db, (*XExpr)(_pStep.XpWhere), int32(0)), int32(_pParse.XeOrconf))
 98659  	goto _20
 98660  _17:
 98661  	_sqlite3Insert(tls, _pParse, _targetSrcList(tls, _pParse, _pStep), _sqlite3SelectDup(tls, _db, (*XSelect)(_pStep.XpSelect), int32(0)), _sqlite3IdListDup(tls, _db, (*XIdList)(_pStep.XpIdList)), int32(_pParse.XeOrconf))
 98662  	goto _20
 98663  _18:
 98664  	_sqlite3DeleteFrom(tls, _pParse, _targetSrcList(tls, _pParse, _pStep), _sqlite3ExprDup(tls, _db, (*XExpr)(_pStep.XpWhere), int32(0)))
 98665  	goto _20
 98666  _19:
 98667  	func() {
 98668  		if int32(_pStep.Xop) != int32(119) {
 98669  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123377), unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000), unsafe.Pointer(str(116500)))
 98670  			crt.X__builtin_abort(tls)
 98671  		}
 98672  	}()
 98673  	_6_pSelect = _sqlite3SelectDup(tls, _db, (*XSelect)(_pStep.XpSelect), int32(0))
 98674  	_sqlite3SelectDestInit(tls, &_6_sDest, int32(4), int32(0))
 98675  	_sqlite3Select(tls, _pParse, _6_pSelect, &_6_sDest)
 98676  	_sqlite3SelectDelete(tls, _db, _6_pSelect)
 98677  	goto _20
 98678  _20:
 98679  	if int32(_pStep.Xop) != int32(119) {
 98680  		_sqlite3VdbeAddOp0(tls, _v, int32(121))
 98681  	}
 98682  	_pStep = (*XTriggerStep)(_pStep.XpNext)
 98683  	goto _7
 98684  _10:
 98685  	return int32(0)
 98686  }
 98687  
 98688  var _codeTriggerProgramØ00__func__Ø000 [19]int8
 98689  
 98690  func init() {
 98691  	crt.Xstrncpy(nil, &_codeTriggerProgramØ00__func__Ø000[0], str(116521), 19)
 98692  }
 98693  
 98694  // C comment
 98695  //  /*
 98696  //  ** Process an UPDATE statement.
 98697  //  **
 98698  //  **   UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL;
 98699  //  **          \_______/ \________/     \______/       \________________/
 98700  //  *            onError   pTabList      pChanges             pWhere
 98701  //  */
 98702  func _sqlite3Update(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pChanges *XExprList, _pWhere *XExpr, _onError int32) {
 98703  	var _nPk, _21_iIdxCol int16
 98704  	var _i, _j, _addrTop, _nIdx, _iBaseCur, _iDataCur, _iIdxCur, _iDb, _eOnePass, _hasFK, _labelBreak, _labelContinue, _flags, _isView, _tmask, _newmask, _iEph, _nKey, _addrOpen, _iPk, _bReplace, _regRowCount, _regOldRowid, _regNewRowid, _regNew, _regOld, _regRowSet, _regKey, _15_rc, _18_reg, _36_iCur, _45_addrOnce, _71_addr1 int32
 98705  	var _55_oldmask uint32
 98706  	var _aRegIdx, _aXRef *int32
 98707  	var _chngPk, _chngRowid, _chngKey uint8
 98708  	var _aToOpen *uint8
 98709  	var _db *Xsqlite3
 98710  	var _pTrigger *XTrigger
 98711  	var _pTab *XTable
 98712  	var _v *TVdbe
 98713  	var _aiCurOnePass [2]int32
 98714  	var _pRowidExpr *XExpr
 98715  	var _pIdx, _pPk *XIndex
 98716  	var _sNC XNameContext
 98717  	var _sContext XAuthContext
 98718  	var _pWInfo *XWhereInfo
 98719  	_addrTop = int32(0)
 98720  	_aRegIdx = nil
 98721  	_aXRef = nil
 98722  	_pRowidExpr = nil
 98723  	_iEph = int32(0)
 98724  	_nKey = int32(0)
 98725  	_addrOpen = int32(0)
 98726  	_iPk = int32(0)
 98727  	_nPk = int16(0)
 98728  	_bReplace = int32(0)
 98729  	_regRowCount = int32(0)
 98730  	_regOldRowid = int32(0)
 98731  	_regNewRowid = int32(0)
 98732  	_regNew = int32(0)
 98733  	_regOld = int32(0)
 98734  	_regRowSet = int32(0)
 98735  	_regKey = int32(0)
 98736  	crt.Xmemset(tls, unsafe.Pointer(&_sContext), int32(0), uint64(16))
 98737  	_db = (*Xsqlite3)(_pParse.Xdb)
 98738  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 98739  		goto _update_cleanup
 98740  	}
 98741  	func() {
 98742  		if _pTabList.XnSrc != int32(1) {
 98743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123900), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(115053)))
 98744  			crt.X__builtin_abort(tls)
 98745  		}
 98746  	}()
 98747  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTabList)
 98748  	if _pTab == nil {
 98749  		goto _update_cleanup
 98750  	}
 98751  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
 98752  	_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, int32(110), _pChanges, &_tmask)
 98753  	_isView = bool2int((*XSelect)(_pTab.XpSelect) != nil)
 98754  	func() {
 98755  		if _pTrigger == nil && _tmask != int32(0) {
 98756  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123914), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116540)))
 98757  			crt.X__builtin_abort(tls)
 98758  		}
 98759  	}()
 98760  	if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
 98761  		goto _update_cleanup
 98762  	}
 98763  	if _sqlite3IsReadOnly(tls, _pParse, _pTab, _tmask) != 0 {
 98764  		goto _update_cleanup
 98765  	}
 98766  	elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XiCursor = store2(&_iBaseCur, store2(&_iDataCur, postInc2(&_pParse.XnTab, 1)))
 98767  	_iIdxCur = _iDataCur + int32(1)
 98768  	_pPk = func() *XIndex {
 98769  		if (_pTab.XtabFlags & uint32(32)) == (0) {
 98770  			return nil
 98771  		}
 98772  		return _sqlite3PrimaryKeyIndex(tls, _pTab)
 98773  	}()
 98774  	*func() **XIndex { _nIdx = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
 98775  _12:
 98776  	if _pIdx == nil {
 98777  		goto _15
 98778  	}
 98779  	if (int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2)) && (_pPk != nil) {
 98780  		_iDataCur = _pParse.XnTab
 98781  		elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XiCursor = _iDataCur
 98782  	}
 98783  	_pParse.XnTab += 1
 98784  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_nIdx }() += 1
 98785  	goto _12
 98786  _15:
 98787  	_aXRef = (*int32)(_sqlite3DbMallocRawNN(tls, _db, ((uint64(4)*uint64(int32(_pTab.XnCol)+_nIdx))+uint64(_nIdx))+uint64(2)))
 98788  	if _aXRef == nil {
 98789  		goto _update_cleanup
 98790  	}
 98791  	_aRegIdx = (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(_pTab.XnCol)*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4)))))))))))
 98792  	_aToOpen = (*uint8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(_nIdx)*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4)))))))))))))
 98793  	crt.Xmemset(tls, unsafe.Pointer(_aToOpen), int32(1), uint64(_nIdx+int32(1)))
 98794  	*elem15(_aToOpen, uintptr(_nIdx+int32(1))) = 0
 98795  	_i = int32(0)
 98796  _19:
 98797  	if _i >= int32(_pTab.XnCol) {
 98798  		goto _22
 98799  	}
 98800  	*elem8(_aXRef, uintptr(_i)) = int32(-1)
 98801  	_i += 1
 98802  	goto _19
 98803  _22:
 98804  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint64(56))
 98805  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pParse
 98806  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = _pTabList
 98807  	_chngRowid = store3(&_chngPk, 0)
 98808  	_i = int32(0)
 98809  _23:
 98810  	if _i >= _pChanges.XnExpr {
 98811  		goto _26
 98812  	}
 98813  	if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XpExpr)) != 0 {
 98814  		goto _update_cleanup
 98815  	}
 98816  	_j = int32(0)
 98817  _28:
 98818  	if _j >= int32(_pTab.XnCol) {
 98819  		goto _31
 98820  	}
 98821  	if _sqlite3StrICmp(tls, elem43((*XColumn)(_pTab.XaCol), uintptr(_j)).XzName, elem59((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XzName) != int32(0) {
 98822  		goto _32
 98823  	}
 98824  	if _j == int32(_pTab.XiPKey) {
 98825  		_chngRowid = uint8(1)
 98826  		_pRowidExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XpExpr)
 98827  		goto _36
 98828  	}
 98829  	if (_pPk != nil) && ((int32(elem43((*XColumn)(_pTab.XaCol), uintptr(_j)).XcolFlags) & int32(1)) != int32(0)) {
 98830  		_chngPk = uint8(1)
 98831  	}
 98832  _36:
 98833  	*elem8(_aXRef, uintptr(_j)) = _i
 98834  	goto _31
 98835  _32:
 98836  	_j += 1
 98837  	goto _28
 98838  _31:
 98839  	if _j < int32(_pTab.XnCol) {
 98840  		goto _37
 98841  	}
 98842  	if (_pPk == nil) && _sqlite3IsRowid(tls, elem59((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XzName) != 0 {
 98843  		_j = int32(-1)
 98844  		_chngRowid = uint8(1)
 98845  		_pRowidExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XpExpr)
 98846  		goto _40
 98847  	}
 98848  	_sqlite3ErrorMsg(tls, _pParse, str(116561), unsafe.Pointer(elem59((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XzName))
 98849  	_pParse.XcheckSchema = uint8(1)
 98850  	goto _update_cleanup
 98851  _40:
 98852  _37:
 98853  	_15_rc = _sqlite3AuthCheck(tls, _pParse, int32(23), _pTab.XzName, func() *int8 {
 98854  		if _j < int32(0) {
 98855  			return str(96484)
 98856  		}
 98857  		return (elem43((*XColumn)(_pTab.XaCol), uintptr(_j)).XzName)
 98858  	}(), elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 98859  	if _15_rc == int32(1) {
 98860  		goto _update_cleanup
 98861  	}
 98862  	if _15_rc == int32(2) {
 98863  		*elem8(_aXRef, uintptr(_j)) = int32(-1)
 98864  	}
 98865  	_i += 1
 98866  	goto _23
 98867  _26:
 98868  	func() {
 98869  		if (int32(_chngRowid) & int32(_chngPk)) != int32(0) {
 98870  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124012), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116580)))
 98871  			crt.X__builtin_abort(tls)
 98872  		}
 98873  	}()
 98874  	func() {
 98875  		if int32(_chngRowid) != int32(0) && int32(_chngRowid) != int32(1) {
 98876  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124013), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116604)))
 98877  			crt.X__builtin_abort(tls)
 98878  		}
 98879  	}()
 98880  	func() {
 98881  		if int32(_chngPk) != int32(0) && int32(_chngPk) != int32(1) {
 98882  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124014), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116633)))
 98883  			crt.X__builtin_abort(tls)
 98884  		}
 98885  	}()
 98886  	_chngKey = uint8(int32(_chngRowid) + int32(_chngPk))
 98887  	elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XcolUsed = func() uint64 {
 98888  		if _pTab.XnModuleArg != 0 {
 98889  			return uint64(18446744073709551615)
 98890  		}
 98891  		return (0)
 98892  	}()
 98893  	_hasFK = _sqlite3FkRequired(tls, _pParse, _pTab, _aXRef, int32(_chngKey))
 98894  	*func() **XIndex { _j = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
 98895  _56:
 98896  	if _pIdx == nil {
 98897  		goto _59
 98898  	}
 98899  	if (((_chngKey != 0) || (_hasFK > int32(1))) || (_pIdx.XpPartIdxWhere != nil)) || (_pIdx == _pPk) {
 98900  		_18_reg = preInc2(&_pParse.XnMem, 1)
 98901  		_pParse.XnMem += int32(_pIdx.XnColumn)
 98902  		goto _64
 98903  	}
 98904  	_18_reg = int32(0)
 98905  	_i = int32(0)
 98906  _65:
 98907  	if _i >= int32(_pIdx.XnKeyCol) {
 98908  		goto _68
 98909  	}
 98910  	_21_iIdxCol = *elem52(_pIdx.XaiColumn, uintptr(_i))
 98911  	if int32(_21_iIdxCol) >= int32(0) && (*elem8(_aXRef, uintptr(_21_iIdxCol))) < int32(0) {
 98912  		goto _70
 98913  	}
 98914  	_18_reg = preInc2(&_pParse.XnMem, 1)
 98915  	_pParse.XnMem += int32(_pIdx.XnColumn)
 98916  	if (_onError == int32(5)) || ((_onError == int32(10)) && (int32(_pIdx.XonError) == int32(5))) {
 98917  		_bReplace = int32(1)
 98918  	}
 98919  	goto _68
 98920  _70:
 98921  	_i += 1
 98922  	goto _65
 98923  _68:
 98924  _64:
 98925  	if _18_reg == int32(0) {
 98926  		*elem15(_aToOpen, uintptr(_j+int32(1))) = 0
 98927  	}
 98928  	*elem8(_aRegIdx, uintptr(_j)) = _18_reg
 98929  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_j }() += 1
 98930  	goto _56
 98931  _59:
 98932  	if _bReplace != 0 {
 98933  		crt.Xmemset(tls, unsafe.Pointer(_aToOpen), int32(1), uint64(_nIdx+int32(1)))
 98934  	}
 98935  	_v = _sqlite3GetVdbe(tls, _pParse)
 98936  	if _v == nil {
 98937  		goto _update_cleanup
 98938  	}
 98939  	if int32(_pParse.Xnested) == int32(0) {
 98940  		_sqlite3VdbeCountChanges(tls, _v)
 98941  	}
 98942  	_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
 98943  	if _pTab.XnModuleArg != 0 {
 98944  		goto _78
 98945  	}
 98946  	_regRowSet = preInc2(&_pParse.XnMem, 1)
 98947  	_regOldRowid = store2(&_regNewRowid, preInc2(&_pParse.XnMem, 1))
 98948  	if ((_chngPk != 0) || (_pTrigger != nil)) || _hasFK != 0 {
 98949  		_regOld = _pParse.XnMem + int32(1)
 98950  		_pParse.XnMem += int32(_pTab.XnCol)
 98951  	}
 98952  	if ((_chngKey != 0) || (_pTrigger != nil)) || _hasFK != 0 {
 98953  		_regNewRowid = preInc2(&_pParse.XnMem, 1)
 98954  	}
 98955  	_regNew = _pParse.XnMem + int32(1)
 98956  	_pParse.XnMem += int32(_pTab.XnCol)
 98957  _78:
 98958  	if _isView != 0 {
 98959  		_sqlite3AuthContextPush(tls, _pParse, &_sContext, _pTab.XzName)
 98960  	}
 98961  	if _isView != 0 {
 98962  		_sqlite3MaterializeView(tls, _pParse, _pTab, _pWhere, _iDataCur)
 98963  	}
 98964  	if _sqlite3ResolveExprNames(tls, &_sNC, _pWhere) != 0 {
 98965  		goto _update_cleanup
 98966  	}
 98967  	if _pTab.XnModuleArg != 0 {
 98968  		_updateVirtualTable(tls, _pParse, _pTabList, _pTab, _pChanges, _pRowidExpr, _aXRef, _pWhere, _onError)
 98969  		goto _update_cleanup
 98970  	}
 98971  	if (_db.Xflags&int32(128)) != 0 && (_pParse.XpTriggerTab == nil) {
 98972  		_regRowCount = preInc2(&_pParse.XnMem, 1)
 98973  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _regRowCount)
 98974  	}
 98975  	if (_pTab.XtabFlags & uint32(32)) == (0) {
 98976  		_sqlite3VdbeAddOp3(tls, _v, int32(59), int32(0), _regRowSet, _regOldRowid)
 98977  		goto _92
 98978  	}
 98979  	func() {
 98980  		if _pPk == nil {
 98981  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124122), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(41949)))
 98982  			crt.X__builtin_abort(tls)
 98983  		}
 98984  	}()
 98985  	_nPk = int16(_pPk.XnKeyCol)
 98986  	_iPk = _pParse.XnMem + int32(1)
 98987  	_pParse.XnMem += int32(_nPk)
 98988  	_regKey = preInc2(&_pParse.XnMem, 1)
 98989  	_iEph = postInc2(&_pParse.XnTab, 1)
 98990  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _iPk)
 98991  	_addrOpen = _sqlite3VdbeAddOp2(tls, _v, int32(110), _iEph, int32(_nPk))
 98992  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pPk)
 98993  _92:
 98994  	_flags = int32(4100)
 98995  	if ((((_pParse.Xnested == 0) && (_pTrigger == nil)) && (_hasFK == 0)) && (_chngKey == 0)) && (_bReplace == 0) {
 98996  		_flags |= int32(8)
 98997  	}
 98998  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, nil, nil, uint16(_flags), _iIdxCur)
 98999  	if _pWInfo == nil {
 99000  		goto _update_cleanup
 99001  	}
 99002  	_eOnePass = _sqlite3WhereOkOnePass(tls, _pWInfo, (*int32)(unsafe.Pointer(&_aiCurOnePass)))
 99003  	if _eOnePass != int32(2) {
 99004  		goto _101
 99005  	}
 99006  	_36_iCur = *elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1))
 99007  	if ((_36_iCur >= int32(0)) && (_36_iCur != _iDataCur)) && ((*elem15(_aToOpen, uintptr(_36_iCur-_iBaseCur))) != 0) {
 99008  		_eOnePass = int32(0)
 99009  	}
 99010  	func() {
 99011  		if _36_iCur == _iDataCur && (_pTab.XtabFlags&uint32(32)) == (0) {
 99012  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124164), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116656)))
 99013  			crt.X__builtin_abort(tls)
 99014  		}
 99015  	}()
 99016  _101:
 99017  	if (_pTab.XtabFlags & uint32(32)) != (0) {
 99018  		goto _108
 99019  	}
 99020  	_sqlite3VdbeAddOp2(tls, _v, int32(125), _iDataCur, _regOldRowid)
 99021  	if _eOnePass == int32(0) {
 99022  		_sqlite3VdbeAddOp2(tls, _v, int32(145), _regRowSet, _regOldRowid)
 99023  	}
 99024  	goto _110
 99025  _108:
 99026  	_i = int32(0)
 99027  _111:
 99028  	if _i >= int32(_nPk) {
 99029  		goto _114
 99030  	}
 99031  	func() {
 99032  		if int32(*elem52(_pPk.XaiColumn, uintptr(_i))) < int32(0) {
 99033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124182), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(115293)))
 99034  			crt.X__builtin_abort(tls)
 99035  		}
 99036  	}()
 99037  	_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, int32(*elem52(_pPk.XaiColumn, uintptr(_i))), _iPk+_i)
 99038  	_i += 1
 99039  	goto _111
 99040  _114:
 99041  	if _eOnePass != 0 {
 99042  		_sqlite3VdbeChangeToNoop(tls, _v, _addrOpen)
 99043  		_nKey = int32(_nPk)
 99044  		_regKey = _iPk
 99045  		goto _118
 99046  	}
 99047  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _iPk, int32(_nPk), _regKey, _sqlite3IndexAffinityStr(tls, _db, _pPk), int32(_nPk))
 99048  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iEph, _regKey, _iPk, int32(_nPk))
 99049  _118:
 99050  _110:
 99051  	if _eOnePass != int32(2) {
 99052  		_sqlite3WhereEnd(tls, _pWInfo)
 99053  	}
 99054  	_labelBreak = _sqlite3VdbeMakeLabel(tls, _v)
 99055  	if _isView != 0 {
 99056  		goto _120
 99057  	}
 99058  	_45_addrOnce = int32(0)
 99059  	if _eOnePass == int32(0) {
 99060  		goto _121
 99061  	}
 99062  	if (*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), 0)) >= int32(0) {
 99063  		*elem15(_aToOpen, uintptr((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), 0))-_iBaseCur)) = 0
 99064  	}
 99065  	if (*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1))) >= int32(0) {
 99066  		*elem15(_aToOpen, uintptr((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1)))-_iBaseCur)) = 0
 99067  	}
 99068  _121:
 99069  	if (_eOnePass == int32(2)) && ((_nIdx - bool2int((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1))) >= int32(0))) > int32(0)) {
 99070  		_45_addrOnce = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 99071  	}
 99072  	_sqlite3OpenTableAndIndices(tls, _pParse, _pTab, int32(107), 0, _iBaseCur, _aToOpen, nil, nil)
 99073  	if _45_addrOnce != 0 {
 99074  		_sqlite3VdbeJumpHere(tls, _v, _45_addrOnce)
 99075  	}
 99076  _120:
 99077  	if _eOnePass == int32(0) {
 99078  		goto _127
 99079  	}
 99080  	if ((_isView == 0) && ((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), 0)) != _iDataCur)) && ((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1))) != _iDataCur) {
 99081  		func() {
 99082  			if _pPk == nil {
 99083  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124221), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116690)))
 99084  				crt.X__builtin_abort(tls)
 99085  			}
 99086  		}()
 99087  		_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iDataCur, _labelBreak, _regKey, _nKey)
 99088  	}
 99089  	if _eOnePass == int32(1) {
 99090  		_labelContinue = _labelBreak
 99091  		goto _134
 99092  	}
 99093  	_labelContinue = _sqlite3VdbeMakeLabel(tls, _v)
 99094  _134:
 99095  	_sqlite3VdbeAddOp2(tls, _v, int32(75), func() int32 {
 99096  		if _pPk != nil {
 99097  			return _regKey
 99098  		}
 99099  		return _regOldRowid
 99100  	}(), _labelBreak)
 99101  	goto _139
 99102  _127:
 99103  	if _pPk != nil {
 99104  		_labelContinue = _sqlite3VdbeMakeLabel(tls, _v)
 99105  		_sqlite3VdbeAddOp2(tls, _v, int32(37), _iEph, _labelBreak)
 99106  		_addrTop = _sqlite3VdbeAddOp2(tls, _v, int32(124), _iEph, _regKey)
 99107  		_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iDataCur, _labelContinue, _regKey, int32(0))
 99108  		goto _139
 99109  	}
 99110  	_labelContinue = _sqlite3VdbeAddOp3(tls, _v, int32(42), _regRowSet, _labelBreak, _regOldRowid)
 99111  	_sqlite3VdbeAddOp3(tls, _v, int32(32), _iDataCur, _labelContinue, _regOldRowid)
 99112  _139:
 99113  	func() {
 99114  		if _chngKey == 0 && _pTrigger == nil && _hasFK == 0 && _regOldRowid != _regNewRowid {
 99115  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124251), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116694)))
 99116  			crt.X__builtin_abort(tls)
 99117  		}
 99118  	}()
 99119  	if _chngRowid != 0 {
 99120  		_sqlite3ExprCode(tls, _pParse, _pRowidExpr, _regNewRowid)
 99121  		_sqlite3VdbeAddOp1(tls, _v, int32(17), _regNewRowid)
 99122  	}
 99123  	if _chngPk == 0 && _hasFK == 0 && _pTrigger == nil {
 99124  		goto _148
 99125  	}
 99126  	_55_oldmask = func() uint32 {
 99127  		if _hasFK != 0 {
 99128  			return _sqlite3FkOldmask(tls, _pParse, _pTab)
 99129  		}
 99130  		return (0)
 99131  	}()
 99132  	_55_oldmask |= _sqlite3TriggerColmask(tls, _pParse, _pTrigger, _pChanges, int32(0), int32(3), _pTab, _onError)
 99133  	_i = int32(0)
 99134  _151:
 99135  	if _i >= int32(_pTab.XnCol) {
 99136  		goto _154
 99137  	}
 99138  	if ((_55_oldmask == uint32(4294967295)) || ((_i < int32(32)) && ((_55_oldmask & (uint32(1) << uint(_i))) != (0)))) || ((int32(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XcolFlags) & int32(1)) != int32(0)) {
 99139  		_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, _i, _regOld+_i)
 99140  		goto _159
 99141  	}
 99142  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regOld+_i)
 99143  _159:
 99144  	_i += 1
 99145  	goto _151
 99146  _154:
 99147  	if (int32(_chngRowid) == int32(0)) && (_pPk == nil) {
 99148  		_sqlite3VdbeAddOp2(tls, _v, int32(64), _regOldRowid, _regNewRowid)
 99149  	}
 99150  _148:
 99151  	_newmask = int32(_sqlite3TriggerColmask(tls, _pParse, _pTrigger, _pChanges, int32(1), int32(1), _pTab, _onError))
 99152  	_i = int32(0)
 99153  _162:
 99154  	if _i >= int32(_pTab.XnCol) {
 99155  		goto _165
 99156  	}
 99157  	if _i == int32(_pTab.XiPKey) {
 99158  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regNew+_i)
 99159  		goto _167
 99160  	}
 99161  	_j = *elem8(_aXRef, uintptr(_i))
 99162  	if _j >= int32(0) {
 99163  		_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_j)).XpExpr), _regNew+_i)
 99164  		goto _173
 99165  	}
 99166  	if ((int32(0) == (_tmask & int32(1))) || (_i > int32(31))) || ((uint32(_newmask) & (uint32(1) << uint(_i))) != 0) {
 99167  		_sqlite3ExprCodeGetColumnToReg(tls, _pParse, _pTab, _i, _iDataCur, _regNew+_i)
 99168  		goto _173
 99169  	}
 99170  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regNew+_i)
 99171  _173:
 99172  _167:
 99173  	_i += 1
 99174  	goto _162
 99175  _165:
 99176  	if (_tmask & int32(1)) == 0 {
 99177  		goto _174
 99178  	}
 99179  	_sqlite3TableAffinity(tls, _v, _pTab, _regNew)
 99180  	_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(110), _pChanges, int32(1), _pTab, _regOldRowid, _onError, _labelContinue)
 99181  	if _pPk != nil {
 99182  		_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iDataCur, _labelContinue, _regKey, _nKey)
 99183  		goto _176
 99184  	}
 99185  	_sqlite3VdbeAddOp3(tls, _v, int32(32), _iDataCur, _labelContinue, _regOldRowid)
 99186  _176:
 99187  	_i = int32(0)
 99188  _177:
 99189  	if _i >= int32(_pTab.XnCol) {
 99190  		goto _180
 99191  	}
 99192  	if ((*elem8(_aXRef, uintptr(_i))) < int32(0)) && (_i != int32(_pTab.XiPKey)) {
 99193  		_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, _i, _regNew+_i)
 99194  	}
 99195  	_i += 1
 99196  	goto _177
 99197  _180:
 99198  _174:
 99199  	if _isView != 0 {
 99200  		goto _183
 99201  	}
 99202  	_71_addr1 = int32(0)
 99203  	func() {
 99204  		if _regOldRowid <= int32(0) {
 99205  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124356), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116751)))
 99206  			crt.X__builtin_abort(tls)
 99207  		}
 99208  	}()
 99209  	_sqlite3GenerateConstraintChecks(tls, _pParse, _pTab, _aRegIdx, _iDataCur, _iIdxCur, _regNewRowid, _regOldRowid, _chngKey, uint8(_onError), _labelContinue, &_bReplace, _aXRef)
 99210  	if _hasFK != 0 {
 99211  		_sqlite3FkCheck(tls, _pParse, _pTab, _regOldRowid, int32(0), _aXRef, int32(_chngKey))
 99212  	}
 99213  	if _bReplace == 0 && _chngKey == 0 {
 99214  		goto _188
 99215  	}
 99216  	if _pPk != nil {
 99217  		_71_addr1 = _sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iDataCur, int32(0), _regKey, _nKey)
 99218  		goto _190
 99219  	}
 99220  	_71_addr1 = _sqlite3VdbeAddOp3(tls, _v, int32(32), _iDataCur, int32(0), _regOldRowid)
 99221  _190:
 99222  _188:
 99223  	_sqlite3GenerateRowIndexDelete(tls, _pParse, _pTab, _iDataCur, _iIdxCur, _aRegIdx, int32(-1))
 99224  	func() {
 99225  		if _regNew != (_regNewRowid + int32(1)) {
 99226  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124386), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116765)))
 99227  			crt.X__builtin_abort(tls)
 99228  		}
 99229  	}()
 99230  	if (_hasFK > int32(1)) || (_chngKey != 0) {
 99231  		_sqlite3VdbeAddOp2(tls, _v, int32(120), _iDataCur, int32(0))
 99232  	}
 99233  	if _bReplace != 0 || (_chngKey != 0) {
 99234  		_sqlite3VdbeJumpHere(tls, _v, _71_addr1)
 99235  	}
 99236  	if _hasFK != 0 {
 99237  		_sqlite3FkCheck(tls, _pParse, _pTab, int32(0), _regNewRowid, _aXRef, int32(_chngKey))
 99238  	}
 99239  	_sqlite3CompleteInsertion(tls, _pParse, _pTab, _iDataCur, _iIdxCur, _regNewRowid, _aRegIdx, int32(4)|func() int32 {
 99240  		if _eOnePass == int32(2) {
 99241  			return int32(2)
 99242  		}
 99243  		return int32(0)
 99244  	}(), int32(0), int32(0))
 99245  	if _hasFK != 0 {
 99246  		_sqlite3FkActions(tls, _pParse, _pTab, _pChanges, _regOldRowid, _aXRef, int32(_chngKey))
 99247  	}
 99248  _183:
 99249  	if (_db.Xflags&int32(128)) != 0 && (_pParse.XpTriggerTab == nil) {
 99250  		_sqlite3VdbeAddOp2(tls, _v, int32(73), _regRowCount, int32(1))
 99251  	}
 99252  	_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(110), _pChanges, int32(2), _pTab, _regOldRowid, _onError, _labelContinue)
 99253  	if _eOnePass == int32(1) {
 99254  		goto _208
 99255  	}
 99256  	if _eOnePass == int32(2) {
 99257  		_sqlite3VdbeResolveLabel(tls, _v, _labelContinue)
 99258  		_sqlite3WhereEnd(tls, _pWInfo)
 99259  		goto _208
 99260  	}
 99261  	if _pPk != nil {
 99262  		_sqlite3VdbeResolveLabel(tls, _v, _labelContinue)
 99263  		_sqlite3VdbeAddOp2(tls, _v, int32(7), _iEph, _addrTop)
 99264  		goto _208
 99265  	}
 99266  	_sqlite3VdbeGoto(tls, _v, _labelContinue)
 99267  _208:
 99268  	_sqlite3VdbeResolveLabel(tls, _v, _labelBreak)
 99269  	if (int32(_pParse.Xnested) == int32(0)) && ((*XTable)(_pParse.XpTriggerTab) == nil) {
 99270  		_sqlite3AutoincrementEnd(tls, _pParse)
 99271  	}
 99272  	if ((_db.Xflags&int32(128)) != 0 && (_pParse.XpTriggerTab == nil)) && (_pParse.Xnested == 0) {
 99273  		_sqlite3VdbeAddOp2(tls, _v, int32(67), _regRowCount, int32(1))
 99274  		_sqlite3VdbeSetNumCols(tls, _v, int32(1))
 99275  		_sqlite3VdbeSetColName(tls, _v, int32(0), int32(0), str(116787), nil)
 99276  	}
 99277  _update_cleanup:
 99278  	_sqlite3AuthContextPop(tls, &_sContext)
 99279  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_aXRef))
 99280  	_sqlite3SrcListDelete(tls, _db, _pTabList)
 99281  	_sqlite3ExprListDelete(tls, _db, _pChanges)
 99282  	_sqlite3ExprDelete(tls, _db, _pWhere)
 99283  	_ = _aiCurOnePass
 99284  }
 99285  
 99286  var _sqlite3UpdateØ00__func__Ø000 [14]int8
 99287  
 99288  func init() {
 99289  	crt.Xstrncpy(nil, &_sqlite3UpdateØ00__func__Ø000[0], str(116800), 14)
 99290  }
 99291  
 99292  // C comment
 99293  //  /*
 99294  //  ** Generate code for an UPDATE of a virtual table.
 99295  //  **
 99296  //  ** There are two possible strategies - the default and the special
 99297  //  ** "onepass" strategy. Onepass is only used if the virtual table
 99298  //  ** implementation indicates that pWhere may match at most one row.
 99299  //  **
 99300  //  ** The default strategy is to create an ephemeral table that contains
 99301  //  ** for each row to be changed:
 99302  //  **
 99303  //  **   (A)  The original rowid of that row.
 99304  //  **   (B)  The revised rowid for the row.
 99305  //  **   (C)  The content of every column in the row.
 99306  //  **
 99307  //  ** Then loop through the contents of this ephemeral table executing a
 99308  //  ** VUpdate for each row. When finished, drop the ephemeral table.
 99309  //  **
 99310  //  ** The "onepass" strategy does not use an ephemeral table. Instead, it
 99311  //  ** stores the same values (A, B and C above) in a register array and
 99312  //  ** makes a single invocation of VUpdate.
 99313  //  */
 99314  func _updateVirtualTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab *XTable, _pChanges *XExprList, _pRowid *XExpr, _aXRef *int32, _pWhere *XExpr, _onError int32) {
 99315  	var _ephemTab, _i, _nArg, _regArg, _regRec, _regRowid, _iCsr, _bOnePass, _addr int32
 99316  	var _pVTab *int8
 99317  	var _db *Xsqlite3
 99318  	var _v *TVdbe
 99319  	var _aDummy [2]int32
 99320  	var _pWInfo *XWhereInfo
 99321  	_v = (*TVdbe)(_pParse.XpVdbe)
 99322  	_db = (*Xsqlite3)(_pParse.Xdb)
 99323  	_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab)))
 99324  	_nArg = int32(2) + int32(_pTab.XnCol)
 99325  	_iCsr = elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XiCursor
 99326  	func() {
 99327  		if _v == nil {
 99328  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124539), unsafe.Pointer(&_updateVirtualTableØ00__func__Ø000), unsafe.Pointer(str(41816)))
 99329  			crt.X__builtin_abort(tls)
 99330  		}
 99331  	}()
 99332  	_ephemTab = postInc2(&_pParse.XnTab, 1)
 99333  	_addr = _sqlite3VdbeAddOp2(tls, _v, int32(110), _ephemTab, _nArg)
 99334  	_regArg = _pParse.XnMem + int32(1)
 99335  	_pParse.XnMem += _nArg
 99336  	_regRec = preInc2(&_pParse.XnMem, 1)
 99337  	_regRowid = preInc2(&_pParse.XnMem, 1)
 99338  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pSrc, _pWhere, nil, nil, uint16(4), int32(0))
 99339  	if _pWInfo == nil {
 99340  		return
 99341  	}
 99342  	_sqlite3VdbeAddOp2(tls, _v, int32(125), _iCsr, _regArg)
 99343  	if _pRowid != nil {
 99344  		_sqlite3ExprCode(tls, _pParse, _pRowid, _regArg+int32(1))
 99345  		goto _4
 99346  	}
 99347  	_sqlite3VdbeAddOp2(tls, _v, int32(125), _iCsr, _regArg+int32(1))
 99348  _4:
 99349  	_i = int32(0)
 99350  _5:
 99351  	if _i >= int32(_pTab.XnCol) {
 99352  		goto _8
 99353  	}
 99354  	if (*elem8(_aXRef, uintptr(_i))) >= int32(0) {
 99355  		_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(*elem8(_aXRef, uintptr(_i)))).XpExpr), (_regArg+int32(2))+_i)
 99356  		goto _10
 99357  	}
 99358  	_sqlite3VdbeAddOp3(tls, _v, int32(159), _iCsr, _i, (_regArg+int32(2))+_i)
 99359  _10:
 99360  	_i += 1
 99361  	goto _5
 99362  _8:
 99363  	_bOnePass = _sqlite3WhereOkOnePass(tls, _pWInfo, (*int32)(unsafe.Pointer(&_aDummy)))
 99364  	if _bOnePass == 0 {
 99365  		goto _11
 99366  	}
 99367  	_sqlite3VdbeChangeToNoop(tls, _v, _addr)
 99368  	if (*XParse)(_pParse.XpToplevel) == nil {
 99369  		_pParse.XisMultiWrite = 0
 99370  	}
 99371  	goto _13
 99372  _11:
 99373  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regArg, _nArg, _regRec)
 99374  	_sqlite3VdbeAddOp2(tls, _v, int32(117), _ephemTab, _regRowid)
 99375  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _ephemTab, _regRec, _regRowid)
 99376  _13:
 99377  	if _bOnePass != int32(0) {
 99378  		goto _14
 99379  	}
 99380  	_sqlite3WhereEnd(tls, _pWInfo)
 99381  	_addr = _sqlite3VdbeAddOp1(tls, _v, int32(37), _ephemTab)
 99382  	_i = int32(0)
 99383  _15:
 99384  	if _i >= _nArg {
 99385  		goto _18
 99386  	}
 99387  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _ephemTab, _i, _regArg+_i)
 99388  	_i += 1
 99389  	goto _15
 99390  _18:
 99391  _14:
 99392  	_sqlite3VtabMakeWritable(tls, _pParse, _pTab)
 99393  	_sqlite3VdbeAddOp4(tls, _v, int32(12), int32(0), _nArg, _regArg, _pVTab, int32(-8))
 99394  	_sqlite3VdbeChangeP5(tls, _v, uint16(func() int32 {
 99395  		if _onError == int32(10) {
 99396  			return int32(2)
 99397  		}
 99398  		return _onError
 99399  	}()))
 99400  	_sqlite3MayAbort(tls, _pParse)
 99401  	if _bOnePass == int32(0) {
 99402  		_sqlite3VdbeAddOp2(tls, _v, int32(7), _ephemTab, _addr+int32(1))
 99403  		_sqlite3VdbeJumpHere(tls, _v, _addr)
 99404  		_sqlite3VdbeAddOp2(tls, _v, int32(114), _ephemTab, int32(0))
 99405  		goto _22
 99406  	}
 99407  	_sqlite3WhereEnd(tls, _pWInfo)
 99408  _22:
 99409  	_ = _aDummy
 99410  }
 99411  
 99412  var _updateVirtualTableØ00__func__Ø000 [19]int8
 99413  
 99414  func init() {
 99415  	crt.Xstrncpy(nil, &_updateVirtualTableØ00__func__Ø000[0], str(116814), 19)
 99416  }
 99417  
 99418  // C comment
 99419  //  /*
 99420  //  ** This function is called before generating code to update or delete a
 99421  //  ** row contained in table pTab.
 99422  //  */
 99423  func _sqlite3FkOldmask(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 uint32) {
 99424  	var _1_i int32
 99425  	var _mask uint32
 99426  	var _3_pIdx *XIndex
 99427  	var _1_p *XFKey
 99428  	_mask = uint32(0)
 99429  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(524288)) == 0 {
 99430  		goto _0
 99431  	}
 99432  	_1_p = (*XFKey)(_pTab.XpFKey)
 99433  _1:
 99434  	if _1_p == nil {
 99435  		goto _4
 99436  	}
 99437  	_1_i = int32(0)
 99438  _5:
 99439  	if _1_i >= _1_p.XnCol {
 99440  		goto _8
 99441  	}
 99442  	_mask |= func() uint32 {
 99443  		if (elem117((*t118)(unsafe.Pointer(&_1_p.XaCol)), uintptr(_1_i)).XiFrom) > int32(31) {
 99444  			return uint32(4294967295)
 99445  		}
 99446  		return (uint32(1) << uint(elem117((*t118)(unsafe.Pointer(&_1_p.XaCol)), uintptr(_1_i)).XiFrom))
 99447  	}()
 99448  	_1_i += 1
 99449  	goto _5
 99450  _8:
 99451  	_1_p = (*XFKey)(_1_p.XpNextFrom)
 99452  	goto _1
 99453  _4:
 99454  	_1_p = _sqlite3FkReferences(tls, _pTab)
 99455  _11:
 99456  	if _1_p == nil {
 99457  		goto _14
 99458  	}
 99459  	_3_pIdx = nil
 99460  	_sqlite3FkLocateIndex(tls, _pParse, _pTab, _1_p, &_3_pIdx, nil)
 99461  	if _3_pIdx == nil {
 99462  		goto _15
 99463  	}
 99464  	_1_i = int32(0)
 99465  _16:
 99466  	if _1_i >= int32(_3_pIdx.XnKeyCol) {
 99467  		goto _19
 99468  	}
 99469  	func() {
 99470  		if int32(*elem52(_3_pIdx.XaiColumn, uintptr(_1_i))) < int32(0) {
 99471  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108482), unsafe.Pointer(&_sqlite3FkOldmaskØ00__func__Ø000), unsafe.Pointer(str(116833)))
 99472  			crt.X__builtin_abort(tls)
 99473  		}
 99474  	}()
 99475  	_mask |= func() uint32 {
 99476  		if int32(*elem52(_3_pIdx.XaiColumn, uintptr(_1_i))) > int32(31) {
 99477  			return uint32(4294967295)
 99478  		}
 99479  		return (uint32(1) << uint(int32(*elem52(_3_pIdx.XaiColumn, uintptr(_1_i)))))
 99480  	}()
 99481  	_1_i += 1
 99482  	goto _16
 99483  _19:
 99484  _15:
 99485  	_1_p = (*XFKey)(_1_p.XpNextTo)
 99486  	goto _11
 99487  _14:
 99488  _0:
 99489  	return _mask
 99490  }
 99491  
 99492  // C comment
 99493  //  /*
 99494  //  ** A foreign key constraint requires that the key columns in the parent
 99495  //  ** table are collectively subject to a UNIQUE or PRIMARY KEY constraint.
 99496  //  ** Given that pParent is the parent table for foreign key constraint pFKey,
 99497  //  ** search the schema for a unique index on the parent key columns.
 99498  //  **
 99499  //  ** If successful, zero is returned. If the parent key is an INTEGER PRIMARY
 99500  //  ** KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx
 99501  //  ** is set to point to the unique index.
 99502  //  **
 99503  //  ** If the parent key consists of a single column (the foreign key constraint
 99504  //  ** is not a composite foreign key), output variable *paiCol is set to NULL.
 99505  //  ** Otherwise, it is set to point to an allocated array of size N, where
 99506  //  ** N is the number of columns in the parent key. The first element of the
 99507  //  ** array is the index of the child table column that is mapped by the FK
 99508  //  ** constraint to the parent table column stored in the left-most column
 99509  //  ** of index *ppIdx. The second element of the array is the index of the
 99510  //  ** child table column that corresponds to the second left-most column of
 99511  //  ** *ppIdx, and so on.
 99512  //  **
 99513  //  ** If the required index cannot be found, either because:
 99514  //  **
 99515  //  **   1) The named parent key columns do not exist, or
 99516  //  **
 99517  //  **   2) The named parent key columns do exist, but are not subject to a
 99518  //  **      UNIQUE or PRIMARY KEY constraint, or
 99519  //  **
 99520  //  **   3) No parent key columns were provided explicitly as part of the
 99521  //  **      foreign key definition, and the parent table does not have a
 99522  //  **      PRIMARY KEY, or
 99523  //  **
 99524  //  **   4) No parent key columns were provided explicitly as part of the
 99525  //  **      foreign key definition, and the PRIMARY KEY of the parent table
 99526  //  **      consists of a different number of columns to the child key in
 99527  //  **      the child table.
 99528  //  **
 99529  //  ** then non-zero is returned, and a "foreign key mismatch" error loaded
 99530  //  ** into pParse. If an OOM error occurs, non-zero is returned and the
 99531  //  ** pParse->db->mallocFailed flag is set.
 99532  //  */
 99533  func _sqlite3FkLocateIndex(tls *crt.TLS, _pParse *XParse, _pParent *XTable, _pFKey *XFKey, _ppIdx **XIndex, _paiCol **int32) (r0 int32) {
 99534  	var _10_iCol int16
 99535  	var _nCol, _8_i, _9_i, _9_j int32
 99536  	var _aiCol *int32
 99537  	var _zKey, _10_zDfltColl, _10_zIdxCol *int8
 99538  	var _pIdx *XIndex
 99539  	_pIdx = nil
 99540  	_aiCol = nil
 99541  	_nCol = _pFKey.XnCol
 99542  	_zKey = elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), 0).XzCol
 99543  	func() {
 99544  		if _ppIdx == nil || (*_ppIdx) != nil {
 99545  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107609), unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000), unsafe.Pointer(str(116854)))
 99546  			crt.X__builtin_abort(tls)
 99547  		}
 99548  	}()
 99549  	func() {
 99550  		if _paiCol != nil && (*_paiCol) != nil {
 99551  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107610), unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000), unsafe.Pointer(str(116873)))
 99552  			crt.X__builtin_abort(tls)
 99553  		}
 99554  	}()
 99555  	func() {
 99556  		if _pParse == nil {
 99557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107611), unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000), unsafe.Pointer(str(115744)))
 99558  			crt.X__builtin_abort(tls)
 99559  		}
 99560  	}()
 99561  	if _nCol != int32(1) {
 99562  		goto _8
 99563  	}
 99564  	if int32(_pParent.XiPKey) < int32(0) {
 99565  		goto _9
 99566  	}
 99567  	if _zKey == nil {
 99568  		return int32(0)
 99569  	}
 99570  	if _sqlite3StrICmp(tls, elem43((*XColumn)(_pParent.XaCol), uintptr(_pParent.XiPKey)).XzName, _zKey) == 0 {
 99571  		return int32(0)
 99572  	}
 99573  _9:
 99574  	goto _13
 99575  _8:
 99576  	if _paiCol == nil {
 99577  		goto _13
 99578  	}
 99579  	func() {
 99580  		if _nCol <= int32(1) {
 99581  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107634), unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000), unsafe.Pointer(str(116895)))
 99582  			crt.X__builtin_abort(tls)
 99583  		}
 99584  	}()
 99585  	_aiCol = (*int32)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.Xdb), uint64(_nCol)*uint64(4)))
 99586  	if _aiCol == nil {
 99587  		return int32(1)
 99588  	}
 99589  	*_paiCol = _aiCol
 99590  _13:
 99591  	_pIdx = (*XIndex)(_pParent.XpIndex)
 99592  _17:
 99593  	if _pIdx == nil {
 99594  		goto _20
 99595  	}
 99596  	if int32(_pIdx.XnKeyCol) != _nCol || int32(_pIdx.XonError) == int32(0) || (*XExpr)(_pIdx.XpPartIdxWhere) != nil {
 99597  		goto _23
 99598  	}
 99599  	if _zKey != nil {
 99600  		goto _24
 99601  	}
 99602  	if int32((uint32(_pIdx.XidxType)<<30)>>30) != int32(2) {
 99603  		goto _25
 99604  	}
 99605  	if _aiCol == nil {
 99606  		goto _26
 99607  	}
 99608  	_8_i = int32(0)
 99609  _27:
 99610  	if _8_i >= _nCol {
 99611  		goto _30
 99612  	}
 99613  	*elem8(_aiCol, uintptr(_8_i)) = elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_8_i)).XiFrom
 99614  	_8_i += 1
 99615  	goto _27
 99616  _30:
 99617  _26:
 99618  	goto _20
 99619  _25:
 99620  	goto _31
 99621  _24:
 99622  	_9_i = int32(0)
 99623  _32:
 99624  	if _9_i >= _nCol {
 99625  		goto _35
 99626  	}
 99627  	_10_iCol = *elem52(_pIdx.XaiColumn, uintptr(_9_i))
 99628  	if int32(_10_iCol) < int32(0) {
 99629  		goto _35
 99630  	}
 99631  	_10_zDfltColl = elem43((*XColumn)(_pParent.XaCol), uintptr(_10_iCol)).XzColl
 99632  	if _10_zDfltColl == nil {
 99633  		_10_zDfltColl = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 99634  	}
 99635  	if _sqlite3StrICmp(tls, *elem0(_pIdx.XazColl, uintptr(_9_i)), _10_zDfltColl) != 0 {
 99636  		goto _35
 99637  	}
 99638  	_10_zIdxCol = elem43((*XColumn)(_pParent.XaCol), uintptr(_10_iCol)).XzName
 99639  	_9_j = int32(0)
 99640  _39:
 99641  	if _9_j >= _nCol {
 99642  		goto _42
 99643  	}
 99644  	if _sqlite3StrICmp(tls, elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_9_j)).XzCol, _10_zIdxCol) != int32(0) {
 99645  		goto _43
 99646  	}
 99647  	if _aiCol != nil {
 99648  		*elem8(_aiCol, uintptr(_9_i)) = elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_9_j)).XiFrom
 99649  	}
 99650  	goto _42
 99651  _43:
 99652  	_9_j += 1
 99653  	goto _39
 99654  _42:
 99655  	if _9_j == _nCol {
 99656  		goto _35
 99657  	}
 99658  	_9_i += 1
 99659  	goto _32
 99660  _35:
 99661  	if _9_i == _nCol {
 99662  		goto _20
 99663  	}
 99664  _31:
 99665  _23:
 99666  	_pIdx = (*XIndex)(_pIdx.XpNext)
 99667  	goto _17
 99668  _20:
 99669  	if _pIdx != nil {
 99670  		goto _47
 99671  	}
 99672  	if _pParse.XdisableTriggers == 0 {
 99673  		_sqlite3ErrorMsg(tls, _pParse, str(116902), unsafe.Pointer((*XTable)(_pFKey.XpFrom).XzName), unsafe.Pointer(_pFKey.XzTo))
 99674  	}
 99675  	_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_aiCol))
 99676  	return int32(1)
 99677  
 99678  _47:
 99679  	*_ppIdx = _pIdx
 99680  	return int32(0)
 99681  }
 99682  
 99683  var _sqlite3FkLocateIndexØ00__func__Ø000 [21]int8
 99684  
 99685  func init() {
 99686  	crt.Xstrncpy(nil, &_sqlite3FkLocateIndexØ00__func__Ø000[0], str(116947), 21)
 99687  }
 99688  
 99689  var _sqlite3FkOldmaskØ00__func__Ø000 [17]int8
 99690  
 99691  func init() {
 99692  	crt.Xstrncpy(nil, &_sqlite3FkOldmaskØ00__func__Ø000[0], str(116968), 17)
 99693  }
 99694  
 99695  // C comment
 99696  //  /*
 99697  //  ** This is called to code the required FOR EACH ROW triggers for an operation
 99698  //  ** on table pTab. The operation to code triggers for (INSERT, UPDATE or DELETE)
 99699  //  ** is given by the op parameter. The tr_tm parameter determines whether the
 99700  //  ** BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then
 99701  //  ** parameter pChanges is passed the list of columns being modified.
 99702  //  **
 99703  //  ** If there are no triggers that fire at the specified time for the specified
 99704  //  ** operation on pTab, this function is a no-op.
 99705  //  **
 99706  //  ** The reg argument is the address of the first in an array of registers
 99707  //  ** that contain the values substituted for the new.* and old.* references
 99708  //  ** in the trigger program. If N is the number of columns in table pTab
 99709  //  ** (a copy of pTab->nCol), then registers are populated as follows:
 99710  //  **
 99711  //  **   Register       Contains
 99712  //  **   ------------------------------------------------------
 99713  //  **   reg+0          OLD.rowid
 99714  //  **   reg+1          OLD.* value of left-most column of pTab
 99715  //  **   ...            ...
 99716  //  **   reg+N          OLD.* value of right-most column of pTab
 99717  //  **   reg+N+1        NEW.rowid
 99718  //  **   reg+N+2        OLD.* value of left-most column of pTab
 99719  //  **   ...            ...
 99720  //  **   reg+N+N+1      NEW.* value of right-most column of pTab
 99721  //  **
 99722  //  ** For ON DELETE triggers, the registers containing the NEW.* values will
 99723  //  ** never be accessed by the trigger program, so they are not allocated or
 99724  //  ** populated by the caller (there is no data to populate them with anyway).
 99725  //  ** Similarly, for ON INSERT triggers the values stored in the OLD.* registers
 99726  //  ** are never accessed, and so are not allocated by the caller. So, for an
 99727  //  ** ON INSERT trigger, the value passed to this function as parameter reg
 99728  //  ** is not a readable register, although registers (reg+N) through
 99729  //  ** (reg+N+N+1) are.
 99730  //  **
 99731  //  ** Parameter orconf is the default conflict resolution algorithm for the
 99732  //  ** trigger program to use (REPLACE, IGNORE etc.). Parameter ignoreJump
 99733  //  ** is the instruction that control should jump to if a trigger program
 99734  //  ** raises an IGNORE exception.
 99735  //  */
 99736  func _sqlite3CodeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _op int32, _pChanges *XExprList, _tr_tm int32, _pTab *XTable, _reg int32, _orconf int32, _ignoreJump int32) {
 99737  	var _p *XTrigger
 99738  	func() {
 99739  		if _op != int32(110) && _op != int32(108) && _op != int32(109) {
 99740  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123665), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116985)))
 99741  			crt.X__builtin_abort(tls)
 99742  		}
 99743  	}()
 99744  	func() {
 99745  		if _tr_tm != int32(1) && _tr_tm != int32(2) {
 99746  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123666), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(117033)))
 99747  			crt.X__builtin_abort(tls)
 99748  		}
 99749  	}()
 99750  	func() {
 99751  		if (_op == int32(110)) != (_pChanges != nil) {
 99752  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123667), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(117079)))
 99753  			crt.X__builtin_abort(tls)
 99754  		}
 99755  	}()
 99756  	_p = _pTrigger
 99757  _9:
 99758  	if _p == nil {
 99759  		goto _12
 99760  	}
 99761  	func() {
 99762  		if (*XSchema)(_p.XpSchema) == nil {
 99763  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123674), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(117110)))
 99764  			crt.X__builtin_abort(tls)
 99765  		}
 99766  	}()
 99767  	func() {
 99768  		if (*XSchema)(_p.XpTabSchema) == nil {
 99769  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123675), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(117124)))
 99770  			crt.X__builtin_abort(tls)
 99771  		}
 99772  	}()
 99773  	func() {
 99774  		if (*XSchema)(_p.XpSchema) != (*XSchema)(_p.XpTabSchema) && (*XSchema)(_p.XpSchema) != (*XSchema)(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(1)).XpSchema) {
 99775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123676), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(117141)))
 99776  			crt.X__builtin_abort(tls)
 99777  		}
 99778  	}()
 99779  	if ((int32(_p.Xop) == _op) && (int32(_p.Xtr_tm) == _tr_tm)) && _checkColumnOverlap(tls, (*XIdList)(_p.XpColumns), _pChanges) != 0 {
 99780  		_sqlite3CodeRowTriggerDirect(tls, _pParse, _p, _pTab, _reg, _orconf, _ignoreJump)
 99781  	}
 99782  	_p = (*XTrigger)(_p.XpNext)
 99783  	goto _9
 99784  _12:
 99785  }
 99786  
 99787  var _sqlite3CodeRowTriggerØ00__func__Ø000 [22]int8
 99788  
 99789  func init() {
 99790  	crt.Xstrncpy(nil, &_sqlite3CodeRowTriggerØ00__func__Ø000[0], str(117209), 22)
 99791  }
 99792  
 99793  // C comment
 99794  //  /*
 99795  //  ** Generate code for the trigger program associated with trigger p on
 99796  //  ** table pTab. The reg, orconf and ignoreJump parameters passed to this
 99797  //  ** function are the same as those described in the header function for
 99798  //  ** sqlite3CodeRowTrigger()
 99799  //  */
 99800  func _sqlite3CodeRowTriggerDirect(tls *crt.TLS, _pParse *XParse, _p *XTrigger, _pTab *XTable, _reg int32, _orconf int32, _ignoreJump int32) {
 99801  	var _1_bRecursive int32
 99802  	var _v *TVdbe
 99803  	var _pPrg *XTriggerPrg
 99804  	_v = _sqlite3GetVdbe(tls, _pParse)
 99805  	_pPrg = _getRowTrigger(tls, _pParse, _p, _pTab, _orconf)
 99806  	func() {
 99807  		if _pPrg == nil && _pParse.XnErr == 0 && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 99808  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123591), unsafe.Pointer(&_sqlite3CodeRowTriggerDirectØ00__func__Ø000), unsafe.Pointer(str(117231)))
 99809  			crt.X__builtin_abort(tls)
 99810  		}
 99811  	}()
 99812  	if _pPrg != nil {
 99813  		_1_bRecursive = bool2int((_p.XzName != nil) && (int32(0) == (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(262144))))
 99814  		_sqlite3VdbeAddOp4(tls, _v, int32(44), _reg, _ignoreJump, preInc2(&_pParse.XnMem, 1), (*int8)(unsafe.Pointer((*XSubProgram)(_pPrg.XpProgram))), int32(-13))
 99815  		_sqlite3VdbeComment(tls, _v, str(117280), unsafe.Pointer(func() *int8 {
 99816  			if _p.XzName != nil {
 99817  				return _p.XzName
 99818  			}
 99819  			return str(117292)
 99820  		}()), unsafe.Pointer(_onErrorText(tls, _orconf)))
 99821  		_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_1_bRecursive)))
 99822  	}
 99823  }
 99824  
 99825  var _sqlite3CodeRowTriggerDirectØ00__func__Ø000 [28]int8
 99826  
 99827  func init() {
 99828  	crt.Xstrncpy(nil, &_sqlite3CodeRowTriggerDirectØ00__func__Ø000[0], str(117297), 28)
 99829  }
 99830  
 99831  // C comment
 99832  //  /*
 99833  //  ** Generate code to do constraint checks prior to an INSERT or an UPDATE
 99834  //  ** on table pTab.
 99835  //  **
 99836  //  ** The regNewData parameter is the first register in a range that contains
 99837  //  ** the data to be inserted or the data after the update.  There will be
 99838  //  ** pTab->nCol+1 registers in this range.  The first register (the one
 99839  //  ** that regNewData points to) will contain the new rowid, or NULL in the
 99840  //  ** case of a WITHOUT ROWID table.  The second register in the range will
 99841  //  ** contain the content of the first table column.  The third register will
 99842  //  ** contain the content of the second table column.  And so forth.
 99843  //  **
 99844  //  ** The regOldData parameter is similar to regNewData except that it contains
 99845  //  ** the data prior to an UPDATE rather than afterwards.  regOldData is zero
 99846  //  ** for an INSERT.  This routine can distinguish between UPDATE and INSERT by
 99847  //  ** checking regOldData for zero.
 99848  //  **
 99849  //  ** For an UPDATE, the pkChng boolean is true if the true primary key (the
 99850  //  ** rowid for a normal table or the PRIMARY KEY for a WITHOUT ROWID table)
 99851  //  ** might be modified by the UPDATE.  If pkChng is false, then the key of
 99852  //  ** the iDataCur content table is guaranteed to be unchanged by the UPDATE.
 99853  //  **
 99854  //  ** For an INSERT, the pkChng boolean indicates whether or not the rowid
 99855  //  ** was explicitly specified as part of the INSERT statement.  If pkChng
 99856  //  ** is zero, it means that the either rowid is computed automatically or
 99857  //  ** that the table is a WITHOUT ROWID table and has no rowid.  On an INSERT,
 99858  //  ** pkChng will only be true if the INSERT statement provides an integer
 99859  //  ** value for either the rowid column or its INTEGER PRIMARY KEY alias.
 99860  //  **
 99861  //  ** The code generated by this routine will store new index entries into
 99862  //  ** registers identified by aRegIdx[].  No index entry is created for
 99863  //  ** indices where aRegIdx[i]==0.  The order of indices in aRegIdx[] is
 99864  //  ** the same as the order of indices on the linked list of indices
 99865  //  ** at pTab->pIndex.
 99866  //  **
 99867  //  ** The caller must have already opened writeable cursors on the main
 99868  //  ** table and all applicable indices (that is to say, all indices for which
 99869  //  ** aRegIdx[] is not zero).  iDataCur is the cursor for the main table when
 99870  //  ** inserting or updating a rowid table, or the cursor for the PRIMARY KEY
 99871  //  ** index when operating on a WITHOUT ROWID table.  iIdxCur is the cursor
 99872  //  ** for the first index in the pTab->pIndex list.  Cursors for other indices
 99873  //  ** are at iIdxCur+N for the N-th element of the pTab->pIndex list.
 99874  //  **
 99875  //  ** This routine also generates code to check constraints.  NOT NULL,
 99876  //  ** CHECK, and UNIQUE constraints are all checked.  If a constraint fails,
 99877  //  ** then the appropriate action is performed.  There are five possible
 99878  //  ** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
 99879  //  **
 99880  //  **  Constraint type  Action       What Happens
 99881  //  **  ---------------  ----------   ----------------------------------------
 99882  //  **  any              ROLLBACK     The current transaction is rolled back and
 99883  //  **                                sqlite3_step() returns immediately with a
 99884  //  **                                return code of SQLITE_CONSTRAINT.
 99885  //  **
 99886  //  **  any              ABORT        Back out changes from the current command
 99887  //  **                                only (do not do a complete rollback) then
 99888  //  **                                cause sqlite3_step() to return immediately
 99889  //  **                                with SQLITE_CONSTRAINT.
 99890  //  **
 99891  //  **  any              FAIL         Sqlite3_step() returns immediately with a
 99892  //  **                                return code of SQLITE_CONSTRAINT.  The
 99893  //  **                                transaction is not rolled back and any
 99894  //  **                                changes to prior rows are retained.
 99895  //  **
 99896  //  **  any              IGNORE       The attempt in insert or update the current
 99897  //  **                                row is skipped, without throwing an error.
 99898  //  **                                Processing continues with the next row.
 99899  //  **                                (There is an immediate jump to ignoreDest.)
 99900  //  **
 99901  //  **  NOT NULL         REPLACE      The NULL value is replace by the default
 99902  //  **                                value for that column.  If the default value
 99903  //  **                                is NULL, the action is the same as ABORT.
 99904  //  **
 99905  //  **  UNIQUE           REPLACE      The other row that conflicts with the row
 99906  //  **                                being inserted is removed.
 99907  //  **
 99908  //  **  CHECK            REPLACE      Illegal.  The results in an exception.
 99909  //  **
 99910  //  ** Which action to take is determined by the overrideError parameter.
 99911  //  ** Or if overrideError==OE_Default, then the pParse->onError parameter
 99912  //  ** is used.  Or if pParse->onError==OE_Default then the onError value
 99913  //  ** for the constraint is used.
 99914  //  */
 99915  func _sqlite3GenerateConstraintChecks(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _aRegIdx *int32, _iDataCur int32, _iIdxCur int32, _regNewData int32, _regOldData int32, _pkChng uint8, _overrideError uint8, _ignoreDest int32, _pbMayReplace *int32, _aiChng *int32) {
 99916  	var _i, _ix, _nCol, _onError, _addr1, _seenReplace, _nPkField, _ipkTop, _ipkBottom, _14_allOk, _17_addrRowidOk, _34_regIdx, _34_regR, _34_iThisCur, _34_addrUniqueOk, _37_iField, _37_x, _50_x, _53_addrJump, _53_op, _53_regCmp int32
 99917  	var _10_zMsg, _16_zName, _54_p4 *int8
 99918  	var _isUpdate, _bAffinityDone uint8
 99919  	var _db *Xsqlite3
 99920  	var _27_pTrigger, _59_pTrigger *XTrigger
 99921  	var _v *TVdbe
 99922  	var _13_pCheck *XExprList
 99923  	var _14_pExpr *XExpr
 99924  	var _pIdx, _pPk *XIndex
 99925  	_pPk = nil
 99926  	_seenReplace = int32(0)
 99927  	_ipkTop = int32(0)
 99928  	_ipkBottom = int32(0)
 99929  	_bAffinityDone = uint8(0)
 99930  	_isUpdate = uint8(bool2int(_regOldData != int32(0)))
 99931  	_db = (*Xsqlite3)(_pParse.Xdb)
 99932  	_v = _sqlite3GetVdbe(tls, _pParse)
 99933  	func() {
 99934  		if _v == nil {
 99935  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110093), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(42019)))
 99936  			crt.X__builtin_abort(tls)
 99937  		}
 99938  	}()
 99939  	func() {
 99940  		if (*XSelect)(_pTab.XpSelect) != nil {
 99941  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110094), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(102296)))
 99942  			crt.X__builtin_abort(tls)
 99943  		}
 99944  	}()
 99945  	_nCol = int32(_pTab.XnCol)
 99946  	if (_pTab.XtabFlags & uint32(32)) == (0) {
 99947  		_pPk = nil
 99948  		_nPkField = int32(1)
 99949  		goto _5
 99950  	}
 99951  	_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 99952  	_nPkField = int32(_pPk.XnKeyCol)
 99953  _5:
 99954  	_i = int32(0)
 99955  _6:
 99956  	if _i >= _nCol {
 99957  		goto _9
 99958  	}
 99959  	if _i == int32(_pTab.XiPKey) {
 99960  		goto _7
 99961  	}
 99962  	if (_aiChng != nil) && ((*elem8(_aiChng, uintptr(_i))) < int32(0)) {
 99963  		goto _7
 99964  	}
 99965  	_onError = int32(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XnotNull)
 99966  	if _onError == int32(0) {
 99967  		goto _7
 99968  	}
 99969  	if int32(_overrideError) != int32(10) {
 99970  		_onError = int32(_overrideError)
 99971  		goto _16
 99972  	}
 99973  	if _onError == int32(10) {
 99974  		_onError = int32(2)
 99975  	}
 99976  _16:
 99977  	if (_onError == int32(5)) && ((*XExpr)(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XpDflt) == nil) {
 99978  		_onError = int32(2)
 99979  	}
 99980  	func() {
 99981  		if _onError != int32(1) && _onError != int32(2) && _onError != int32(3) && _onError != int32(4) && _onError != int32(5) {
 99982  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110133), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(117325)))
 99983  			crt.X__builtin_abort(tls)
 99984  		}
 99985  	}()
 99986  	switch _onError {
 99987  	case int32(1):
 99988  		goto _27
 99989  	case int32(2):
 99990  		goto _26
 99991  	case int32(3):
 99992  		goto _27
 99993  	case int32(4):
 99994  		goto _29
 99995  	default:
 99996  		goto _30
 99997  	}
 99998  
 99999  _26:
100000  	_sqlite3MayAbort(tls, _pParse)
100001  _27:
100002  	_10_zMsg = _sqlite3MPrintf(tls, _db, str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XzName))
100003  	_sqlite3VdbeAddOp3(tls, _v, int32(54), int32(1299), _onError, (_regNewData+int32(1))+_i)
100004  	_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_10_zMsg), int32(-1))
100005  	_sqlite3VdbeChangeP5(tls, _v, uint16(1))
100006  	goto _31
100007  _29:
100008  	_sqlite3VdbeAddOp2(tls, _v, int32(75), (_regNewData+int32(1))+_i, _ignoreDest)
100009  	goto _31
100010  _30:
100011  	func() {
100012  		if _onError != int32(5) {
100013  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110156), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(117432)))
100014  			crt.X__builtin_abort(tls)
100015  		}
100016  	}()
100017  	_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(76), (_regNewData+int32(1))+_i)
100018  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XpDflt), (_regNewData+int32(1))+_i)
100019  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
100020  	goto _31
100021  _31:
100022  _7:
100023  	_i += 1
100024  	goto _6
100025  _9:
100026  	if _pTab.XpCheck == nil || (_db.Xflags&int32(8192)) != int32(0) {
100027  		goto _35
100028  	}
100029  	_13_pCheck = (*XExprList)(_pTab.XpCheck)
100030  	_pParse.XckBase = _regNewData + int32(1)
100031  	_onError = func() int32 {
100032  		if int32(_overrideError) != int32(10) {
100033  			return int32(_overrideError)
100034  		}
100035  		return int32(2)
100036  	}()
100037  	_i = int32(0)
100038  _38:
100039  	if _i >= _13_pCheck.XnExpr {
100040  		goto _41
100041  	}
100042  	_14_pExpr = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_13_pCheck.Xa)), uintptr(_i)).XpExpr)
100043  	if (_aiChng != nil) && _checkConstraintUnchanged(tls, _14_pExpr, _aiChng, int32(_pkChng)) != 0 {
100044  		goto _39
100045  	}
100046  	_14_allOk = _sqlite3VdbeMakeLabel(tls, _v)
100047  	_sqlite3ExprIfTrue(tls, _pParse, _14_pExpr, _14_allOk, int32(16))
100048  	if _onError == int32(4) {
100049  		_sqlite3VdbeGoto(tls, _v, _ignoreDest)
100050  		goto _45
100051  	}
100052  	_16_zName = elem59((*TExprList_item)(unsafe.Pointer(&_13_pCheck.Xa)), uintptr(_i)).XzName
100053  	if _16_zName == nil {
100054  		_16_zName = _pTab.XzName
100055  	}
100056  	if _onError == int32(5) {
100057  		_onError = int32(2)
100058  	}
100059  	_sqlite3HaltConstraint(tls, _pParse, int32(275), _onError, _16_zName, 0, uint8(3))
100060  _45:
100061  	_sqlite3VdbeResolveLabel(tls, _v, _14_allOk)
100062  _39:
100063  	_i += 1
100064  	goto _38
100065  _41:
100066  _35:
100067  	if _pkChng == 0 || _pPk != nil {
100068  		goto _49
100069  	}
100070  	_17_addrRowidOk = _sqlite3VdbeMakeLabel(tls, _v)
100071  	_onError = int32(_pTab.XkeyConf)
100072  	if int32(_overrideError) != int32(10) {
100073  		_onError = int32(_overrideError)
100074  		goto _52
100075  	}
100076  	if _onError == int32(10) {
100077  		_onError = int32(2)
100078  	}
100079  _52:
100080  	if _isUpdate != 0 {
100081  		_sqlite3VdbeAddOp3(tls, _v, int32(78), _regNewData, _17_addrRowidOk, _regOldData)
100082  		_sqlite3VdbeChangeP5(tls, _v, uint16(144))
100083  	}
100084  	if _onError != int32(5) || int32(_overrideError) == int32(5) {
100085  		goto _55
100086  	}
100087  	_pIdx = (*XIndex)(_pTab.XpIndex)
100088  _56:
100089  	if _pIdx == nil {
100090  		goto _59
100091  	}
100092  	if (int32(_pIdx.XonError) == int32(4)) || (int32(_pIdx.XonError) == int32(3)) {
100093  		_ipkTop = _sqlite3VdbeAddOp0(tls, _v, int32(13))
100094  		goto _59
100095  	}
100096  	_pIdx = (*XIndex)(_pIdx.XpNext)
100097  	goto _56
100098  _59:
100099  _55:
100100  	_sqlite3VdbeAddOp3(tls, _v, int32(32), _iDataCur, _17_addrRowidOk, _regNewData)
100101  	switch _onError {
100102  	case int32(1):
100103  		goto _64
100104  	case int32(2):
100105  		goto _64
100106  	case int32(3):
100107  		goto _64
100108  	case int32(4):
100109  		goto _68
100110  	case int32(5):
100111  		goto _67
100112  	default:
100113  		goto _63
100114  	}
100115  
100116  _63:
100117  	_onError = int32(2)
100118  _64:
100119  	_sqlite3RowidConstraint(tls, _pParse, _onError, _pTab)
100120  	goto _69
100121  _67:
100122  	_27_pTrigger = nil
100123  	if (_db.Xflags & int32(262144)) != 0 {
100124  		_27_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, int32(109), nil, nil)
100125  	}
100126  	if (_27_pTrigger != nil) || _sqlite3FkRequired(tls, _pParse, _pTab, nil, int32(0)) != 0 {
100127  		_sqlite3MultiWrite(tls, _pParse)
100128  		_sqlite3GenerateRowDelete(tls, _pParse, _pTab, _27_pTrigger, _iDataCur, _iIdxCur, _regNewData, int16(1), 0, uint8(5), uint8(1), int32(-1))
100129  		goto _73
100130  	}
100131  	if _pTab.XpIndex != nil {
100132  		_sqlite3MultiWrite(tls, _pParse)
100133  		_sqlite3GenerateRowIndexDelete(tls, _pParse, _pTab, _iDataCur, _iIdxCur, nil, int32(-1))
100134  	}
100135  _73:
100136  	_seenReplace = int32(1)
100137  	goto _69
100138  _68:
100139  	_sqlite3VdbeGoto(tls, _v, _ignoreDest)
100140  	goto _69
100141  _69:
100142  	_sqlite3VdbeResolveLabel(tls, _v, _17_addrRowidOk)
100143  	if _ipkTop != 0 {
100144  		_ipkBottom = _sqlite3VdbeAddOp0(tls, _v, int32(13))
100145  		_sqlite3VdbeJumpHere(tls, _v, _ipkTop)
100146  	}
100147  _49:
100148  	*func() **XIndex { _ix = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
100149  _76:
100150  	if _pIdx == nil {
100151  		goto _79
100152  	}
100153  	if (*elem8(_aRegIdx, uintptr(_ix))) == int32(0) {
100154  		goto _77
100155  	}
100156  	if int32(_bAffinityDone) == int32(0) {
100157  		_sqlite3TableAffinity(tls, _v, _pTab, _regNewData+int32(1))
100158  		_bAffinityDone = uint8(1)
100159  	}
100160  	_34_iThisCur = _iIdxCur + _ix
100161  	_34_addrUniqueOk = _sqlite3VdbeMakeLabel(tls, _v)
100162  	if _pIdx.XpPartIdxWhere != nil {
100163  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), *elem8(_aRegIdx, uintptr(_ix)))
100164  		_pParse.XckBase = _regNewData + int32(1)
100165  		_sqlite3ExprIfFalseDup(tls, _pParse, (*XExpr)(_pIdx.XpPartIdxWhere), _34_addrUniqueOk, int32(16))
100166  		_pParse.XckBase = int32(0)
100167  	}
100168  	_34_regIdx = (*elem8(_aRegIdx, uintptr(_ix))) + int32(1)
100169  	_i = int32(0)
100170  _83:
100171  	if _i >= int32(_pIdx.XnColumn) {
100172  		goto _86
100173  	}
100174  	_37_iField = int32(*elem52(_pIdx.XaiColumn, uintptr(_i)))
100175  	if _37_iField == int32(-2) {
100176  		_pParse.XckBase = _regNewData + int32(1)
100177  		_sqlite3ExprCodeCopy(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.XaColExpr).Xa))), uintptr(_i)).XpExpr), _34_regIdx+_i)
100178  		_pParse.XckBase = int32(0)
100179  		_sqlite3VdbeComment(tls, _v, str(117452), unsafe.Pointer(_pIdx.XzName), _i)
100180  		goto _88
100181  	}
100182  	if (_37_iField == int32(-1)) || (_37_iField == int32(_pTab.XiPKey)) {
100183  		_37_x = _regNewData
100184  		goto _91
100185  	}
100186  	_37_x = (_37_iField + _regNewData) + int32(1)
100187  _91:
100188  	_sqlite3VdbeAddOp2(tls, _v, func() int32 {
100189  		if _37_iField < int32(0) {
100190  			return int32(66)
100191  		}
100192  		return int32(65)
100193  	}(), _37_x, _34_regIdx+_i)
100194  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(func() *int8 {
100195  		if _37_iField < int32(0) {
100196  			return str(27182)
100197  		}
100198  		return (elem43((*XColumn)(_pTab.XaCol), uintptr(_37_iField)).XzName)
100199  	}()))
100200  _88:
100201  	_i += 1
100202  	goto _83
100203  _86:
100204  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _34_regIdx, int32(_pIdx.XnColumn), *elem8(_aRegIdx, uintptr(_ix)))
100205  	_sqlite3VdbeComment(tls, _v, str(107216), unsafe.Pointer(_pIdx.XzName))
100206  	if ((_isUpdate != 0) && (_pPk == _pIdx)) && (int32(_pkChng) == int32(0)) {
100207  		_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
100208  		goto _77
100209  	}
100210  	_onError = int32(_pIdx.XonError)
100211  	if _onError == int32(0) {
100212  		_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
100213  		goto _77
100214  	}
100215  	if int32(_overrideError) != int32(10) {
100216  		_onError = int32(_overrideError)
100217  		goto _102
100218  	}
100219  	if _onError == int32(10) {
100220  		_onError = int32(2)
100221  	}
100222  _102:
100223  	if (((((_ix == int32(0)) && ((*XIndex)(_pIdx.XpNext) == nil)) && (_pPk == _pIdx)) && (_onError == int32(5))) && ((int32(0) == (_db.Xflags & int32(262144))) || (nil == _sqlite3TriggersExist(tls, _pParse, _pTab, int32(109), nil, nil)))) && ((int32(0) == (_db.Xflags & int32(524288))) || ((nil == (*XFKey)(_pTab.XpFKey)) && (nil == _sqlite3FkReferences(tls, _pTab)))) {
100224  		_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
100225  		goto _77
100226  	}
100227  	_sqlite3VdbeAddOp4Int(tls, _v, int32(28), _34_iThisCur, _34_addrUniqueOk, _34_regIdx, int32(_pIdx.XnKeyCol))
100228  	_34_regR = func() int32 {
100229  		if _pIdx == _pPk {
100230  			return _34_regIdx
100231  		}
100232  		return _sqlite3GetTempRange(tls, _pParse, _nPkField)
100233  	}()
100234  	if _isUpdate == 0 && _onError != int32(5) {
100235  		goto _115
100236  	}
100237  	if (_pTab.XtabFlags & uint32(32)) != (0) {
100238  		goto _116
100239  	}
100240  	_sqlite3VdbeAddOp2(tls, _v, int32(131), _34_iThisCur, _34_regR)
100241  	if _isUpdate != 0 {
100242  		_sqlite3VdbeAddOp3(tls, _v, int32(78), _34_regR, _34_addrUniqueOk, _regOldData)
100243  		_sqlite3VdbeChangeP5(tls, _v, uint16(144))
100244  	}
100245  	goto _118
100246  _116:
100247  	if _pIdx == _pPk {
100248  		goto _119
100249  	}
100250  	_i = int32(0)
100251  _120:
100252  	if _i >= int32(_pPk.XnKeyCol) {
100253  		goto _123
100254  	}
100255  	func() {
100256  		if int32(*elem52(_pPk.XaiColumn, uintptr(_i))) < int32(0) {
100257  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110431), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(115293)))
100258  			crt.X__builtin_abort(tls)
100259  		}
100260  	}()
100261  	_50_x = int32(_sqlite3ColumnOfIndex(tls, _pIdx, *elem52(_pPk.XaiColumn, uintptr(_i))))
100262  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _34_iThisCur, _50_x, _34_regR+_i)
100263  	_sqlite3VdbeComment(tls, _v, str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(elem43((*XColumn)(_pTab.XaCol), uintptr(*elem52(_pPk.XaiColumn, uintptr(_i)))).XzName))
100264  	_i += 1
100265  	goto _120
100266  _123:
100267  _119:
100268  	if _isUpdate == 0 {
100269  		goto _126
100270  	}
100271  	_53_addrJump = _sqlite3VdbeCurrentAddr(tls, _v) + int32(_pPk.XnKeyCol)
100272  	_53_op = int32(77)
100273  	_53_regCmp = func() int32 {
100274  		if int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2) {
100275  			return _34_regIdx
100276  		}
100277  		return _34_regR
100278  	}()
100279  	_i = int32(0)
100280  _129:
100281  	if _i >= int32(_pPk.XnKeyCol) {
100282  		goto _132
100283  	}
100284  	_54_p4 = (*int8)(unsafe.Pointer(_sqlite3LocateCollSeq(tls, _pParse, *elem0(_pPk.XazColl, uintptr(_i)))))
100285  	_50_x = int32(*elem52(_pPk.XaiColumn, uintptr(_i)))
100286  	func() {
100287  		if _50_x < int32(0) {
100288  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110453), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(109771)))
100289  			crt.X__builtin_abort(tls)
100290  		}
100291  	}()
100292  	if _i == (int32(_pPk.XnKeyCol) - int32(1)) {
100293  		_53_addrJump = _34_addrUniqueOk
100294  		_53_op = int32(78)
100295  	}
100296  	_sqlite3VdbeAddOp4(tls, _v, _53_op, (_regOldData+int32(1))+_50_x, _53_addrJump, _53_regCmp+_i, _54_p4, int32(-3))
100297  	_sqlite3VdbeChangeP5(tls, _v, uint16(144))
100298  	_i += 1
100299  	goto _129
100300  _132:
100301  _126:
100302  _118:
100303  _115:
100304  	func() {
100305  		if _onError != int32(1) && _onError != int32(2) && _onError != int32(3) && _onError != int32(4) && _onError != int32(5) {
100306  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110470), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(117325)))
100307  			crt.X__builtin_abort(tls)
100308  		}
100309  	}()
100310  	switch _onError {
100311  	case int32(1):
100312  		goto _143
100313  	case int32(2):
100314  		goto _143
100315  	case int32(3):
100316  		goto _143
100317  	case int32(4):
100318  		goto _146
100319  	default:
100320  		goto _147
100321  	}
100322  
100323  _143:
100324  	_sqlite3UniqueConstraint(tls, _pParse, _onError, _pIdx)
100325  	goto _148
100326  _146:
100327  	_sqlite3VdbeGoto(tls, _v, _ignoreDest)
100328  	goto _148
100329  _147:
100330  	_59_pTrigger = nil
100331  	func() {
100332  		if _onError != int32(5) {
100333  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110485), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(117432)))
100334  			crt.X__builtin_abort(tls)
100335  		}
100336  	}()
100337  	_sqlite3MultiWrite(tls, _pParse)
100338  	if (_db.Xflags & int32(262144)) != 0 {
100339  		_59_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, int32(109), nil, nil)
100340  	}
100341  	_sqlite3GenerateRowDelete(tls, _pParse, _pTab, _59_pTrigger, _iDataCur, _iIdxCur, _34_regR, int16(_nPkField), 0, uint8(5), uint8(func() int32 {
100342  		if _pIdx == _pPk {
100343  			return int32(1)
100344  		}
100345  		return int32(0)
100346  	}()), _34_iThisCur)
100347  	_seenReplace = int32(1)
100348  	goto _148
100349  _148:
100350  	_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
100351  	if _34_regR != _34_regIdx {
100352  		_sqlite3ReleaseTempRange(tls, _pParse, _34_regR, _nPkField)
100353  	}
100354  _77:
100355  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_ix }() += 1
100356  	goto _76
100357  _79:
100358  	if _ipkTop != 0 {
100359  		_sqlite3VdbeGoto(tls, _v, _ipkTop+int32(1))
100360  		_sqlite3VdbeJumpHere(tls, _v, _ipkBottom)
100361  	}
100362  	*_pbMayReplace = _seenReplace
100363  }
100364  
100365  var _sqlite3GenerateConstraintChecksØ00__func__Ø000 [32]int8
100366  
100367  func init() {
100368  	crt.Xstrncpy(nil, &_sqlite3GenerateConstraintChecksØ00__func__Ø000[0], str(117465), 32)
100369  }
100370  
100371  // C comment
100372  //  /*
100373  //  ** pExpr is a CHECK constraint on a row that is being UPDATE-ed.  The
100374  //  ** only columns that are modified by the UPDATE are those for which
100375  //  ** aiChng[i]>=0, and also the ROWID is modified if chngRowid is true.
100376  //  **
100377  //  ** Return true if CHECK constraint pExpr does not use any of the
100378  //  ** changing columns (or the rowid if it is changing).  In other words,
100379  //  ** return true if this CHECK constraint can be skipped when validating
100380  //  ** the new row in the UPDATE statement.
100381  //  */
100382  func _checkConstraintUnchanged(tls *crt.TLS, _pExpr *XExpr, _aiChng *int32, _chngRowid int32) (r0 int32) {
100383  	var _w XWalker
100384  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint64(48))
100385  	_w.XeCode = 0
100386  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _checkConstraintExprNode
100387  	*(**int32)(unsafe.Pointer(&_w.Xu)) = _aiChng
100388  	_sqlite3WalkExpr(tls, &_w, _pExpr)
100389  	if _chngRowid == 0 {
100390  		{
100391  			p := &_w.XeCode
100392  			*p = uint8(int32(*p) & int32(-3))
100393  		}
100394  	}
100395  	return bool2int(_w.XeCode == 0)
100396  }
100397  
100398  // C comment
100399  //  /* This is the Walker callback from checkConstraintUnchanged().  Set
100400  //  ** bit 0x01 of pWalker->eCode if
100401  //  ** pWalker->eCode to 0 if this expression node references any of the
100402  //  ** columns that are being modifed by an UPDATE statement.
100403  //  */
100404  func _checkConstraintExprNode(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
100405  	if int32(_pExpr.Xop) != int32(152) {
100406  		goto _0
100407  	}
100408  	func() {
100409  		if int32(_pExpr.XiColumn) < int32(0) && int32(_pExpr.XiColumn) != int32(-1) {
100410  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109937), unsafe.Pointer(&_checkConstraintExprNodeØ00__func__Ø000), unsafe.Pointer(str(117497)))
100411  			crt.X__builtin_abort(tls)
100412  		}
100413  	}()
100414  	if int32(_pExpr.XiColumn) < int32(0) {
100415  		goto _4
100416  	}
100417  	if (*elem8(*(**int32)(unsafe.Pointer(&_pWalker.Xu)), uintptr(_pExpr.XiColumn))) >= int32(0) {
100418  		{
100419  			p := &_pWalker.XeCode
100420  			*p = uint8(int32(*p) | int32(1))
100421  		}
100422  	}
100423  	goto _6
100424  _4:
100425  	{
100426  		p := &_pWalker.XeCode
100427  		*p = uint8(int32(*p) | int32(2))
100428  	}
100429  _6:
100430  _0:
100431  	return int32(0)
100432  }
100433  
100434  var _checkConstraintExprNodeØ00__func__Ø000 [24]int8
100435  
100436  func init() {
100437  	crt.Xstrncpy(nil, &_checkConstraintExprNodeØ00__func__Ø000[0], str(117537), 24)
100438  }
100439  
100440  // C comment
100441  //  /*
100442  //  ** Code an OP_Halt due to non-unique rowid.
100443  //  */
100444  func _sqlite3RowidConstraint(tls *crt.TLS, _pParse *XParse, _onError int32, _pTab *XTable) {
100445  	var _rc int32
100446  	var _zMsg *int8
100447  	if int32(_pTab.XiPKey) >= int32(0) {
100448  		_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(elem43((*XColumn)(_pTab.XaCol), uintptr(_pTab.XiPKey)).XzName))
100449  		_rc = int32(1555)
100450  		goto _1
100451  	}
100452  	_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(117561), unsafe.Pointer(_pTab.XzName))
100453  	_rc = int32(2579)
100454  _1:
100455  	_sqlite3HaltConstraint(tls, _pParse, _rc, _onError, _zMsg, int8(-1), uint8(2))
100456  }
100457  
100458  // C comment
100459  //  /*
100460  //  ** Indicate that the statement currently under construction might write
100461  //  ** more than one entry (example: deleting one row then inserting another,
100462  //  ** inserting multiple rows in a table, or inserting a row and index entries.)
100463  //  ** If an abort occurs after some of these writes have completed, then it will
100464  //  ** be necessary to undo the completed writes.
100465  //  */
100466  func _sqlite3MultiWrite(tls *crt.TLS, _pParse *XParse) {
100467  	var _pToplevel *XParse
100468  	_pToplevel = func() *XParse {
100469  		if _pParse.XpToplevel != nil {
100470  			return (*XParse)(_pParse.XpToplevel)
100471  		}
100472  		return _pParse
100473  	}()
100474  	_pToplevel.XisMultiWrite = uint8(1)
100475  }
100476  
100477  // C comment
100478  //  /*
100479  //  ** This routine generates VDBE code that causes the deletion of all
100480  //  ** index entries associated with a single row of a single table, pTab
100481  //  **
100482  //  ** Preconditions:
100483  //  **
100484  //  **   1.  A read/write cursor "iDataCur" must be open on the canonical storage
100485  //  **       btree for the table pTab.  (This will be either the table itself
100486  //  **       for rowid tables or to the primary key index for WITHOUT ROWID
100487  //  **       tables.)
100488  //  **
100489  //  **   2.  Read/write cursors for all indices of pTab must be open as
100490  //  **       cursor number iIdxCur+i for the i-th index.  (The pTab->pIndex
100491  //  **       index is the 0-th index.)
100492  //  **
100493  //  **   3.  The "iDataCur" cursor must be already be positioned on the row
100494  //  **       that is to be deleted.
100495  //  */
100496  func _sqlite3GenerateRowIndexDelete(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDataCur int32, _iIdxCur int32, _aRegIdx *int32, _iIdxNoSeek int32) {
100497  	var _i, _r1, _iPartIdxLabel int32
100498  	var _v *TVdbe
100499  	var _pIdx, _pPrior, _pPk *XIndex
100500  	_r1 = int32(-1)
100501  	_pPrior = nil
100502  	_v = (*TVdbe)(_pParse.XpVdbe)
100503  	_pPk = func() *XIndex {
100504  		if (_pTab.XtabFlags & uint32(32)) == (0) {
100505  			return nil
100506  		}
100507  		return _sqlite3PrimaryKeyIndex(tls, _pTab)
100508  	}()
100509  	*func() **XIndex { _i = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
100510  _2:
100511  	if _pIdx == nil {
100512  		goto _5
100513  	}
100514  	func() {
100515  		if (_iIdxCur+_i) == _iDataCur && _pPk != _pIdx {
100516  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105425), unsafe.Pointer(&_sqlite3GenerateRowIndexDeleteØ00__func__Ø000), unsafe.Pointer(str(117570)))
100517  			crt.X__builtin_abort(tls)
100518  		}
100519  	}()
100520  	if (_aRegIdx != nil) && ((*elem8(_aRegIdx, uintptr(_i))) == int32(0)) {
100521  		goto _3
100522  	}
100523  	if _pIdx == _pPk {
100524  		goto _3
100525  	}
100526  	if (_iIdxCur + _i) == _iIdxNoSeek {
100527  		goto _3
100528  	}
100529  	_r1 = _sqlite3GenerateIndexKey(tls, _pParse, _pIdx, _iDataCur, int32(0), int32(1), &_iPartIdxLabel, _pPrior, _r1)
100530  	_sqlite3VdbeAddOp3(tls, _v, int32(129), _iIdxCur+_i, _r1, int32(func() uint16 {
100531  		if ((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0 {
100532  			return _pIdx.XnKeyCol
100533  		}
100534  		return _pIdx.XnColumn
100535  	}()))
100536  	_sqlite3ResolvePartIdxLabel(tls, _pParse, _iPartIdxLabel)
100537  	_pPrior = _pIdx
100538  _3:
100539  	*func() **XIndex { _i += 1; return &_pIdx }() = (*XIndex)(_pIdx.XpNext)
100540  	goto _2
100541  _5:
100542  }
100543  
100544  var _sqlite3GenerateRowIndexDeleteØ00__func__Ø000 [30]int8
100545  
100546  func init() {
100547  	crt.Xstrncpy(nil, &_sqlite3GenerateRowIndexDeleteØ00__func__Ø000[0], str(117603), 30)
100548  }
100549  
100550  // C comment
100551  //  /*
100552  //  ** This function is called when inserting, deleting or updating a row of
100553  //  ** table pTab to generate VDBE code to perform foreign key constraint
100554  //  ** processing for the operation.
100555  //  **
100556  //  ** For a DELETE operation, parameter regOld is passed the index of the
100557  //  ** first register in an array of (pTab->nCol+1) registers containing the
100558  //  ** rowid of the row being deleted, followed by each of the column values
100559  //  ** of the row being deleted, from left to right. Parameter regNew is passed
100560  //  ** zero in this case.
100561  //  **
100562  //  ** For an INSERT operation, regOld is passed zero and regNew is passed the
100563  //  ** first register of an array of (pTab->nCol+1) registers containing the new
100564  //  ** row data.
100565  //  **
100566  //  ** For an UPDATE operation, this function is called twice. Once before
100567  //  ** the original record is deleted from the table using the calling convention
100568  //  ** described for DELETE. Then again after the original record is deleted
100569  //  ** but before the new record is inserted using the INSERT convention.
100570  //  */
100571  func _sqlite3FkCheck(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regOld int32, _regNew int32, _aChange *int32, _bChngRowid int32) {
100572  	var _iDb, _isIgnoreErrors, _1_iCol, _1_i, _1_bIgnore, _6_iJump, _7_iReg, _12_rcauth, _21_eAction int32
100573  	var _1_aiFree, _1_aiCol, _15_aiCol *int32
100574  	var _zDb, _12_zCol *int8
100575  	var _db *Xsqlite3
100576  	var _1_pTo *XTable
100577  	var _6_v *TVdbe
100578  	var _15_pSrc *XSrcList
100579  	var _19_pItem *TSrcList_item
100580  	var _1_pIdx, _15_pIdx *XIndex
100581  	var _pFKey *XFKey
100582  	_db = (*Xsqlite3)(_pParse.Xdb)
100583  	_isIgnoreErrors = int32(_pParse.XdisableTriggers)
100584  	func() {
100585  		if (_regOld == int32(0)) == (_regNew == int32(0)) {
100586  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108281), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117633)))
100587  			crt.X__builtin_abort(tls)
100588  		}
100589  	}()
100590  	if (_db.Xflags & int32(524288)) == int32(0) {
100591  		return
100592  	}
100593  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
100594  	_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
100595  	_pFKey = (*XFKey)(_pTab.XpFKey)
100596  _3:
100597  	if _pFKey == nil {
100598  		goto _6
100599  	}
100600  	_1_pIdx = nil
100601  	_1_aiFree = nil
100602  	_1_bIgnore = int32(0)
100603  	if ((_aChange != nil) && (Xsqlite3_stricmp(tls, _pTab.XzName, _pFKey.XzTo) != int32(0))) && (_fkChildIsModified(tls, _pTab, _pFKey, _aChange, _bChngRowid) == int32(0)) {
100604  		goto _4
100605  	}
100606  	if _pParse.XdisableTriggers != 0 {
100607  		_1_pTo = _sqlite3FindTable(tls, _db, _pFKey.XzTo, _zDb)
100608  		goto _11
100609  	}
100610  	_1_pTo = _sqlite3LocateTable(tls, _pParse, 0, _pFKey.XzTo, _zDb)
100611  _11:
100612  	if _1_pTo != nil && _sqlite3FkLocateIndex(tls, _pParse, _1_pTo, _pFKey, &_1_pIdx, &_1_aiFree) == 0 {
100613  		goto _13
100614  	}
100615  	func() {
100616  		if _isIgnoreErrors != int32(0) && (_regOld == int32(0) || _regNew != int32(0)) {
100617  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108317), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117658)))
100618  			crt.X__builtin_abort(tls)
100619  		}
100620  	}()
100621  	if (_isIgnoreErrors == 0) || (_db.XmallocFailed != 0) {
100622  		return
100623  	}
100624  	if _1_pTo != nil {
100625  		goto _20
100626  	}
100627  	_6_v = _sqlite3GetVdbe(tls, _pParse)
100628  	_6_iJump = (_sqlite3VdbeCurrentAddr(tls, _6_v) + _pFKey.XnCol) + int32(1)
100629  	_1_i = int32(0)
100630  _21:
100631  	if _1_i >= _pFKey.XnCol {
100632  		goto _24
100633  	}
100634  	_7_iReg = ((elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_1_i)).XiFrom) + _regOld) + int32(1)
100635  	_sqlite3VdbeAddOp2(tls, _6_v, int32(75), _7_iReg, _6_iJump)
100636  	_1_i += 1
100637  	goto _21
100638  _24:
100639  	_sqlite3VdbeAddOp2(tls, _6_v, int32(147), int32(_pFKey.XisDeferred), int32(-1))
100640  _20:
100641  	goto _4
100642  _13:
100643  	func() {
100644  		if _pFKey.XnCol != int32(1) && (_1_aiFree == nil || _1_pIdx == nil) {
100645  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108337), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117704)))
100646  			crt.X__builtin_abort(tls)
100647  		}
100648  	}()
100649  	if _1_aiFree != nil {
100650  		_1_aiCol = _1_aiFree
100651  		goto _30
100652  	}
100653  	_1_iCol = elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), 0).XiFrom
100654  	_1_aiCol = &_1_iCol
100655  _30:
100656  	_1_i = int32(0)
100657  _31:
100658  	if _1_i >= _pFKey.XnCol {
100659  		goto _34
100660  	}
100661  	if (*elem8(_1_aiCol, uintptr(_1_i))) == int32(_pTab.XiPKey) {
100662  		*elem8(_1_aiCol, uintptr(_1_i)) = int32(-1)
100663  	}
100664  	func() {
100665  		if _1_pIdx != nil && int32(*elem52(_1_pIdx.XaiColumn, uintptr(_1_i))) < int32(0) {
100666  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108349), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117739)))
100667  			crt.X__builtin_abort(tls)
100668  		}
100669  	}()
100670  	if _db.XxAuth != nil {
100671  		_12_zCol = elem43((*XColumn)(_1_pTo.XaCol), uintptr(func() int16 {
100672  			if _1_pIdx != nil {
100673  				return (*elem52(_1_pIdx.XaiColumn, uintptr(_1_i)))
100674  			}
100675  			return _1_pTo.XiPKey
100676  		}())).XzName
100677  		_12_rcauth = _sqlite3AuthReadCol(tls, _pParse, _1_pTo.XzName, _12_zCol, _iDb)
100678  		_1_bIgnore = bool2int(_12_rcauth == int32(2))
100679  	}
100680  	_1_i += 1
100681  	goto _31
100682  _34:
100683  	_sqlite3TableLock(tls, _pParse, _iDb, _1_pTo.Xtnum, 0, _1_pTo.XzName)
100684  	_pParse.XnTab += 1
100685  	if _regOld != int32(0) {
100686  		_fkLookupParent(tls, _pParse, _iDb, _1_pTo, _1_pIdx, _pFKey, _1_aiCol, _regOld, int32(-1), _1_bIgnore)
100687  	}
100688  	if (_regNew != int32(0)) && (_isSetNullAction(tls, _pParse, _pFKey) == 0) {
100689  		_fkLookupParent(tls, _pParse, _iDb, _1_pTo, _1_pIdx, _pFKey, _1_aiCol, _regNew, int32(1), _1_bIgnore)
100690  	}
100691  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_aiFree))
100692  _4:
100693  	_pFKey = (*XFKey)(_pFKey.XpNextFrom)
100694  	goto _3
100695  _6:
100696  	_pFKey = _sqlite3FkReferences(tls, _pTab)
100697  _45:
100698  	if _pFKey == nil {
100699  		goto _48
100700  	}
100701  	_15_pIdx = nil
100702  	_15_aiCol = nil
100703  	if (_aChange != nil) && (_fkParentIsModified(tls, _pTab, _pFKey, _aChange, _bChngRowid) == int32(0)) {
100704  		goto _46
100705  	}
100706  	if (((_pFKey.XisDeferred == 0) && ((_db.Xflags & int32(33554432)) == 0)) && (_pParse.XpToplevel == nil)) && (_pParse.XisMultiWrite == 0) {
100707  		func() {
100708  			if _regOld != int32(0) || _regNew == int32(0) {
100709  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108404), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117771)))
100710  				crt.X__builtin_abort(tls)
100711  			}
100712  		}()
100713  		goto _46
100714  	}
100715  	if _sqlite3FkLocateIndex(tls, _pParse, _pTab, _pFKey, &_15_pIdx, &_15_aiCol) == 0 {
100716  		goto _58
100717  	}
100718  	if (_isIgnoreErrors == 0) || (_db.XmallocFailed != 0) {
100719  		return
100720  	}
100721  	goto _46
100722  _58:
100723  	func() {
100724  		if _15_aiCol == nil && _pFKey.XnCol != int32(1) {
100725  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108414), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117794)))
100726  			crt.X__builtin_abort(tls)
100727  		}
100728  	}()
100729  	_15_pSrc = _sqlite3SrcListAppend(tls, _db, nil, nil, nil)
100730  	if _15_pSrc == nil {
100731  		goto _64
100732  	}
100733  	_19_pItem = (*TSrcList_item)(unsafe.Pointer(&_15_pSrc.Xa))
100734  	*(**XTable)(unsafe.Pointer(&_19_pItem.XpTab)) = (*XTable)(_pFKey.XpFrom)
100735  	_19_pItem.XzName = (*XTable)(_pFKey.XpFrom).XzName
100736  	(*XTable)(_19_pItem.XpTab).XnTabRef += 1
100737  	_19_pItem.XiCursor = postInc2(&_pParse.XnTab, 1)
100738  	if _regNew != int32(0) {
100739  		_fkScanChildren(tls, _pParse, _15_pSrc, _pTab, _15_pIdx, _pFKey, _15_aiCol, _regNew, int32(-1))
100740  	}
100741  	if _regOld == int32(0) {
100742  		goto _66
100743  	}
100744  	_21_eAction = int32(*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), uintptr(bool2int(_aChange != nil))))
100745  	_fkScanChildren(tls, _pParse, _15_pSrc, _pTab, _15_pIdx, _pFKey, _15_aiCol, _regOld, int32(1))
100746  	if ((_pFKey.XisDeferred == 0) && (_21_eAction != int32(9))) && (_21_eAction != int32(7)) {
100747  		_sqlite3MayAbort(tls, _pParse)
100748  	}
100749  _66:
100750  	_19_pItem.XzName = nil
100751  	_sqlite3SrcListDelete(tls, _db, _15_pSrc)
100752  _64:
100753  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_15_aiCol))
100754  _46:
100755  	_pFKey = (*XFKey)(_pFKey.XpNextTo)
100756  	goto _45
100757  _48:
100758  	_ = _1_iCol
100759  }
100760  
100761  var _sqlite3FkCheckØ00__func__Ø000 [15]int8
100762  
100763  func init() {
100764  	crt.Xstrncpy(nil, &_sqlite3FkCheckØ00__func__Ø000[0], str(117818), 15)
100765  }
100766  
100767  // C comment
100768  //  /*
100769  //  ** This function is called when a row is inserted into or deleted from the
100770  //  ** child table of foreign key constraint pFKey. If an SQL UPDATE is executed
100771  //  ** on the child table of pFKey, this function is invoked twice for each row
100772  //  ** affected - once to "delete" the old row, and then again to "insert" the
100773  //  ** new row.
100774  //  **
100775  //  ** Each time it is called, this function generates VDBE code to locate the
100776  //  ** row in the parent table that corresponds to the row being inserted into
100777  //  ** or deleted from the child table. If the parent row can be found, no
100778  //  ** special action is taken. Otherwise, if the parent row can *not* be
100779  //  ** found in the parent table:
100780  //  **
100781  //  **   Operation | FK type   | Action taken
100782  //  **   --------------------------------------------------------------------------
100783  //  **   INSERT      immediate   Increment the "immediate constraint counter".
100784  //  **
100785  //  **   DELETE      immediate   Decrement the "immediate constraint counter".
100786  //  **
100787  //  **   INSERT      deferred    Increment the "deferred constraint counter".
100788  //  **
100789  //  **   DELETE      deferred    Decrement the "deferred constraint counter".
100790  //  **
100791  //  ** These operations are identified in the comment at the top of this file
100792  //  ** (fkey.c) as "I.1" and "D.1".
100793  //  */
100794  func _fkLookupParent(tls *crt.TLS, _pParse *XParse, _iDb int32, _pTab *XTable, _pIdx *XIndex, _pFKey *XFKey, _aiCol *int32, _regData int32, _nIncr int32, _isIgnore int32) {
100795  	var _i, _iCur, _iOk, _2_iReg, _4_iMustBeInt, _4_regTemp, _6_nCol, _6_regTemp, _6_regRec, _8_iJump, _9_iChild, _9_iParent int32
100796  	var _v *TVdbe
100797  	_v = _sqlite3GetVdbe(tls, _pParse)
100798  	_iCur = _pParse.XnTab - int32(1)
100799  	_iOk = _sqlite3VdbeMakeLabel(tls, _v)
100800  	if _nIncr < int32(0) {
100801  		_sqlite3VdbeAddOp2(tls, _v, int32(45), int32(_pFKey.XisDeferred), _iOk)
100802  	}
100803  	_i = int32(0)
100804  _1:
100805  	if _i >= _pFKey.XnCol {
100806  		goto _4
100807  	}
100808  	_2_iReg = ((*elem8(_aiCol, uintptr(_i))) + _regData) + int32(1)
100809  	_sqlite3VdbeAddOp2(tls, _v, int32(75), _2_iReg, _iOk)
100810  	_i += 1
100811  	goto _1
100812  _4:
100813  	if _isIgnore != int32(0) {
100814  		goto _5
100815  	}
100816  	if _pIdx != nil {
100817  		goto _6
100818  	}
100819  	_4_regTemp = _sqlite3GetTempReg(tls, _pParse)
100820  	_sqlite3VdbeAddOp2(tls, _v, int32(65), ((*elem8(_aiCol, 0))+int32(1))+_regData, _4_regTemp)
100821  	_4_iMustBeInt = _sqlite3VdbeAddOp2(tls, _v, int32(17), _4_regTemp, int32(0))
100822  	if (_pTab == (*XTable)(_pFKey.XpFrom)) && (_nIncr == int32(1)) {
100823  		_sqlite3VdbeAddOp3(tls, _v, int32(78), _regData, _iOk, _4_regTemp)
100824  		_sqlite3VdbeChangeP5(tls, _v, uint16(144))
100825  	}
100826  	_sqlite3OpenTable(tls, _pParse, _iCur, _iDb, _pTab, int32(106))
100827  	_sqlite3VdbeAddOp3(tls, _v, int32(32), _iCur, int32(0), _4_regTemp)
100828  	_sqlite3VdbeGoto(tls, _v, _iOk)
100829  	_sqlite3VdbeJumpHere(tls, _v, _sqlite3VdbeCurrentAddr(tls, _v)-int32(2))
100830  	_sqlite3VdbeJumpHere(tls, _v, _4_iMustBeInt)
100831  	_sqlite3ReleaseTempReg(tls, _pParse, _4_regTemp)
100832  	goto _9
100833  _6:
100834  	_6_nCol = _pFKey.XnCol
100835  	_6_regTemp = _sqlite3GetTempRange(tls, _pParse, _6_nCol)
100836  	_6_regRec = _sqlite3GetTempReg(tls, _pParse)
100837  	_sqlite3VdbeAddOp3(tls, _v, int32(106), _iCur, _pIdx.Xtnum, _iDb)
100838  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
100839  	_i = int32(0)
100840  _10:
100841  	if _i >= _6_nCol {
100842  		goto _13
100843  	}
100844  	_sqlite3VdbeAddOp2(tls, _v, int32(64), ((*elem8(_aiCol, uintptr(_i)))+int32(1))+_regData, _6_regTemp+_i)
100845  	_i += 1
100846  	goto _10
100847  _13:
100848  	if _pTab != (*XTable)(_pFKey.XpFrom) || _nIncr != int32(1) {
100849  		goto _15
100850  	}
100851  	_8_iJump = (_sqlite3VdbeCurrentAddr(tls, _v) + _6_nCol) + int32(1)
100852  	_i = int32(0)
100853  _16:
100854  	if _i >= _6_nCol {
100855  		goto _19
100856  	}
100857  	_9_iChild = ((*elem8(_aiCol, uintptr(_i))) + int32(1)) + _regData
100858  	_9_iParent = (int32(*elem52(_pIdx.XaiColumn, uintptr(_i))) + int32(1)) + _regData
100859  	func() {
100860  		if int32(*elem52(_pIdx.XaiColumn, uintptr(_i))) < int32(0) {
100861  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107820), unsafe.Pointer(&_fkLookupParentØ00__func__Ø000), unsafe.Pointer(str(116833)))
100862  			crt.X__builtin_abort(tls)
100863  		}
100864  	}()
100865  	func() {
100866  		if (*elem8(_aiCol, uintptr(_i))) == int32(_pTab.XiPKey) {
100867  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107821), unsafe.Pointer(&_fkLookupParentØ00__func__Ø000), unsafe.Pointer(str(117833)))
100868  			crt.X__builtin_abort(tls)
100869  		}
100870  	}()
100871  	if int32(*elem52(_pIdx.XaiColumn, uintptr(_i))) == int32(_pTab.XiPKey) {
100872  		_9_iParent = _regData
100873  	}
100874  	_sqlite3VdbeAddOp3(tls, _v, int32(77), _9_iChild, _8_iJump, _9_iParent)
100875  	_sqlite3VdbeChangeP5(tls, _v, uint16(16))
100876  	_i += 1
100877  	goto _16
100878  _19:
100879  	_sqlite3VdbeGoto(tls, _v, _iOk)
100880  _15:
100881  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _6_regTemp, _6_nCol, _6_regRec, _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.Xdb), _pIdx), _6_nCol)
100882  	_sqlite3VdbeAddOp4Int(tls, _v, int32(30), _iCur, _iOk, _6_regRec, int32(0))
100883  	_sqlite3ReleaseTempReg(tls, _pParse, _6_regRec)
100884  	_sqlite3ReleaseTempRange(tls, _pParse, _6_regTemp, _6_nCol)
100885  _9:
100886  _5:
100887  	if (((_pFKey.XisDeferred == 0) && ((((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(33554432)) == 0)) && (_pParse.XpToplevel == nil)) && (_pParse.XisMultiWrite == 0) {
100888  		func() {
100889  			if _nIncr != int32(1) {
100890  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107849), unsafe.Pointer(&_fkLookupParentØ00__func__Ø000), unsafe.Pointer(str(117855)))
100891  				crt.X__builtin_abort(tls)
100892  			}
100893  		}()
100894  		_sqlite3HaltConstraint(tls, _pParse, int32(787), int32(2), nil, int8(-2), uint8(4))
100895  		goto _31
100896  	}
100897  	if (_nIncr > int32(0)) && (int32(_pFKey.XisDeferred) == int32(0)) {
100898  		_sqlite3MayAbort(tls, _pParse)
100899  	}
100900  	_sqlite3VdbeAddOp2(tls, _v, int32(147), int32(_pFKey.XisDeferred), _nIncr)
100901  _31:
100902  	_sqlite3VdbeResolveLabel(tls, _v, _iOk)
100903  	_sqlite3VdbeAddOp1(tls, _v, int32(114), _iCur)
100904  }
100905  
100906  var _fkLookupParentØ00__func__Ø000 [15]int8
100907  
100908  func init() {
100909  	crt.Xstrncpy(nil, &_fkLookupParentØ00__func__Ø000[0], str(117864), 15)
100910  }
100911  
100912  // C comment
100913  //  /*
100914  //  ** Return true if the parser passed as the first argument is being
100915  //  ** used to code a trigger that is really a "SET NULL" action belonging
100916  //  ** to trigger pFKey.
100917  //  */
100918  func _isSetNullAction(tls *crt.TLS, _pParse *XParse, _pFKey *XFKey) (r0 int32) {
100919  	var _1_p *XTrigger
100920  	var _pTop *XParse
100921  	_pTop = func() *XParse {
100922  		if _pParse.XpToplevel != nil {
100923  			return (*XParse)(_pParse.XpToplevel)
100924  		}
100925  		return _pParse
100926  	}()
100927  	if _pTop.XpTriggerPrg == nil {
100928  		goto _2
100929  	}
100930  	_1_p = (*XTrigger)((*XTriggerPrg)(_pTop.XpTriggerPrg).XpTrigger)
100931  	if ((_1_p == (*elem42((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), 0))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), 0)) == int32(7))) || ((_1_p == (*elem42((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), uintptr(1)))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), uintptr(1))) == int32(7))) {
100932  		return int32(1)
100933  	}
100934  _2:
100935  	return int32(0)
100936  }
100937  
100938  // C comment
100939  //  /*
100940  //  ** This function is called to generate code executed when a row is deleted
100941  //  ** from the parent table of foreign key constraint pFKey and, if pFKey is
100942  //  ** deferred, when a row is inserted into the same table. When generating
100943  //  ** code for an SQL UPDATE operation, this function may be called twice -
100944  //  ** once to "delete" the old row and once to "insert" the new row.
100945  //  **
100946  //  ** Parameter nIncr is passed -1 when inserting a row (as this may decrease
100947  //  ** the number of FK violations in the db) or +1 when deleting one (as this
100948  //  ** may increase the number of FK constraint problems).
100949  //  **
100950  //  ** The code generated by this function scans through the rows in the child
100951  //  ** table that correspond to the parent table row being deleted or inserted.
100952  //  ** For each child row found, one of the following actions is taken:
100953  //  **
100954  //  **   Operation | FK type   | Action taken
100955  //  **   --------------------------------------------------------------------------
100956  //  **   DELETE      immediate   Increment the "immediate constraint counter".
100957  //  **                           Or, if the ON (UPDATE|DELETE) action is RESTRICT,
100958  //  **                           throw a "FOREIGN KEY constraint failed" exception.
100959  //  **
100960  //  **   INSERT      immediate   Decrement the "immediate constraint counter".
100961  //  **
100962  //  **   DELETE      deferred    Increment the "deferred constraint counter".
100963  //  **                           Or, if the ON (UPDATE|DELETE) action is RESTRICT,
100964  //  **                           throw a "FOREIGN KEY constraint failed" exception.
100965  //  **
100966  //  **   INSERT      deferred    Decrement the "deferred constraint counter".
100967  //  **
100968  //  ** These operations are identified in the comment at the top of this file
100969  //  ** (fkey.c) as "I.2" and "D.2".
100970  //  */
100971  func _fkScanChildren(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab *XTable, _pIdx *XIndex, _pFKey *XFKey, _aiCol *int32, _regData int32, _nIncr int32) {
100972  	var _2_iCol, _6_iCol int16
100973  	var _i, _iFkIfZero int32
100974  	var _2_zCol *int8
100975  	var _db *Xsqlite3
100976  	var _v *TVdbe
100977  	var _pWhere, _2_pLeft, _2_pRight, _2_pEq, _3_pNe, _3_pLeft, _3_pRight, _5_pEq, _5_pAll *XExpr
100978  	var _5_pPk *XIndex
100979  	var _sNameContext XNameContext
100980  	var _pWInfo *XWhereInfo
100981  	_db = (*Xsqlite3)(_pParse.Xdb)
100982  	_pWhere = nil
100983  	_iFkIfZero = int32(0)
100984  	_v = _sqlite3GetVdbe(tls, _pParse)
100985  	func() {
100986  		if _pIdx != nil && (*XTable)(_pIdx.XpTable) != _pTab {
100987  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107969), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(117879)))
100988  			crt.X__builtin_abort(tls)
100989  		}
100990  	}()
100991  	func() {
100992  		if _pIdx != nil && int32(_pIdx.XnKeyCol) != _pFKey.XnCol {
100993  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107970), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(117909)))
100994  			crt.X__builtin_abort(tls)
100995  		}
100996  	}()
100997  	func() {
100998  		if _pIdx == nil && _pFKey.XnCol != int32(1) {
100999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107971), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(117947)))
101000  			crt.X__builtin_abort(tls)
101001  		}
101002  	}()
101003  	func() {
101004  		if _pIdx == nil && (_pTab.XtabFlags&uint32(32)) != (0) {
101005  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107972), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(117973)))
101006  			crt.X__builtin_abort(tls)
101007  		}
101008  	}()
101009  	if _nIncr < int32(0) {
101010  		_iFkIfZero = _sqlite3VdbeAddOp2(tls, _v, int32(45), int32(_pFKey.XisDeferred), int32(0))
101011  	}
101012  	_i = int32(0)
101013  _13:
101014  	if _i >= _pFKey.XnCol {
101015  		goto _16
101016  	}
101017  	_2_iCol = int16(func() int32 {
101018  		if _pIdx != nil {
101019  			return int32(*elem52(_pIdx.XaiColumn, uintptr(_i)))
101020  		}
101021  		return int32(-1)
101022  	}())
101023  	_2_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, _2_iCol)
101024  	_2_iCol = int16(func() int32 {
101025  		if _aiCol != nil {
101026  			return (*elem8(_aiCol, uintptr(_i)))
101027  		}
101028  		return (elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), 0).XiFrom)
101029  	}())
101030  	func() {
101031  		if int32(_2_iCol) < int32(0) {
101032  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107997), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(99210)))
101033  			crt.X__builtin_abort(tls)
101034  		}
101035  	}()
101036  	_2_zCol = elem43((*XColumn)((*XTable)(_pFKey.XpFrom).XaCol), uintptr(_2_iCol)).XzName
101037  	_2_pRight = _sqlite3Expr(tls, _db, int32(27), _2_zCol)
101038  	_2_pEq = _sqlite3PExpr(tls, _pParse, int32(78), _2_pLeft, _2_pRight)
101039  	_pWhere = _sqlite3ExprAnd(tls, _db, _pWhere, _2_pEq)
101040  	_i += 1
101041  	goto _13
101042  _16:
101043  	if _pTab != (*XTable)(_pFKey.XpFrom) || _nIncr <= int32(0) {
101044  		goto _24
101045  	}
101046  	if (_pTab.XtabFlags & uint32(32)) == (0) {
101047  		_3_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, int16(-1))
101048  		_3_pRight = _exprTableColumn(tls, _db, _pTab, elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XiCursor, int16(-1))
101049  		_3_pNe = _sqlite3PExpr(tls, _pParse, int32(77), _3_pLeft, _3_pRight)
101050  		goto _26
101051  	}
101052  	_5_pAll = nil
101053  	_5_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
101054  	func() {
101055  		if _pIdx == nil {
101056  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108026), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(42024)))
101057  			crt.X__builtin_abort(tls)
101058  		}
101059  	}()
101060  	_i = int32(0)
101061  _29:
101062  	if _i >= int32(_5_pPk.XnKeyCol) {
101063  		goto _32
101064  	}
101065  	_6_iCol = *elem52(_pIdx.XaiColumn, uintptr(_i))
101066  	func() {
101067  		if int32(_6_iCol) < int32(0) {
101068  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108029), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(99210)))
101069  			crt.X__builtin_abort(tls)
101070  		}
101071  	}()
101072  	_3_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, _6_iCol)
101073  	_3_pRight = _exprTableColumn(tls, _db, _pTab, elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XiCursor, _6_iCol)
101074  	_5_pEq = _sqlite3PExpr(tls, _pParse, int32(78), _3_pLeft, _3_pRight)
101075  	_5_pAll = _sqlite3ExprAnd(tls, _db, _5_pAll, _5_pEq)
101076  	_i += 1
101077  	goto _29
101078  _32:
101079  	_3_pNe = _sqlite3PExpr(tls, _pParse, int32(19), _5_pAll, nil)
101080  _26:
101081  	_pWhere = _sqlite3ExprAnd(tls, _db, _pWhere, _3_pNe)
101082  _24:
101083  	crt.Xmemset(tls, unsafe.Pointer(&_sNameContext), int32(0), uint64(56))
101084  	*(**XSrcList)(unsafe.Pointer(&_sNameContext.XpSrcList)) = _pSrc
101085  	*(**XParse)(unsafe.Pointer(&_sNameContext.XpParse)) = _pParse
101086  	_sqlite3ResolveExprNames(tls, &_sNameContext, _pWhere)
101087  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pSrc, _pWhere, nil, nil, 0, int32(0))
101088  	_sqlite3VdbeAddOp2(tls, _v, int32(147), int32(_pFKey.XisDeferred), _nIncr)
101089  	if _pWInfo != nil {
101090  		_sqlite3WhereEnd(tls, _pWInfo)
101091  	}
101092  	_sqlite3ExprDelete(tls, _db, _pWhere)
101093  	if _iFkIfZero != 0 {
101094  		_sqlite3VdbeJumpHere(tls, _v, _iFkIfZero)
101095  	}
101096  }
101097  
101098  var _fkScanChildrenØ00__func__Ø000 [15]int8
101099  
101100  func init() {
101101  	crt.Xstrncpy(nil, &_fkScanChildrenØ00__func__Ø000[0], str(117999), 15)
101102  }
101103  
101104  // C comment
101105  //  /*
101106  //  ** Return an Expr object that refers to a memory register corresponding
101107  //  ** to column iCol of table pTab.
101108  //  **
101109  //  ** regBase is the first of an array of register that contains the data
101110  //  ** for pTab.  regBase itself holds the rowid.  regBase+1 holds the first
101111  //  ** column.  regBase+2 holds the second column, and so forth.
101112  //  */
101113  func _exprTableRegister(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regBase int32, _iCol int16) (r0 *XExpr) {
101114  	var _zColl *int8
101115  	var _db *Xsqlite3
101116  	var _pExpr *XExpr
101117  	var _pCol *XColumn
101118  	_db = (*Xsqlite3)(_pParse.Xdb)
101119  	_pExpr = _sqlite3Expr(tls, _db, int32(157), nil)
101120  	if _pExpr == nil {
101121  		goto _0
101122  	}
101123  	if int32(_iCol) < int32(0) || int32(_iCol) == int32(_pTab.XiPKey) {
101124  		goto _2
101125  	}
101126  	_pCol = elem43((*XColumn)(_pTab.XaCol), uintptr(_iCol))
101127  	_pExpr.XiTable = (_regBase + int32(_iCol)) + int32(1)
101128  	_pExpr.Xaffinity = _pCol.Xaffinity
101129  	_zColl = _pCol.XzColl
101130  	if _zColl == nil {
101131  		_zColl = (*XCollSeq)(_db.XpDfltColl).XzName
101132  	}
101133  	_pExpr = _sqlite3ExprAddCollateString(tls, _pParse, _pExpr, _zColl)
101134  	goto _4
101135  _2:
101136  	_pExpr.XiTable = _regBase
101137  	_pExpr.Xaffinity = int8(68)
101138  _4:
101139  _0:
101140  	return _pExpr
101141  }
101142  
101143  // C comment
101144  //  /*
101145  //  ** Return an Expr object that refers to column iCol of table pTab which
101146  //  ** has cursor iCur.
101147  //  */
101148  func _exprTableColumn(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable, _iCursor int32, _iCol int16) (r0 *XExpr) {
101149  	var _pExpr *XExpr
101150  	_pExpr = _sqlite3Expr(tls, _db, int32(152), nil)
101151  	if _pExpr != nil {
101152  		*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = _pTab
101153  		_pExpr.XiTable = _iCursor
101154  		_pExpr.XiColumn = _iCol
101155  	}
101156  	return _pExpr
101157  }
101158  
101159  // C comment
101160  //  /*
101161  //  ** This routine generates code to finish the INSERT or UPDATE operation
101162  //  ** that was started by a prior call to sqlite3GenerateConstraintChecks.
101163  //  ** A consecutive range of registers starting at regNewData contains the
101164  //  ** rowid and the content to be inserted.
101165  //  **
101166  //  ** The arguments to this routine should be the same as the first six
101167  //  ** arguments to sqlite3GenerateConstraintChecks.
101168  //  */
101169  func _sqlite3CompleteInsertion(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDataCur int32, _iIdxCur int32, _regNewData int32, _aRegIdx *int32, _update_flags int32, _appendBias int32, _useSeekResult int32) {
101170  	var _regData, _regRec, _i int32
101171  	var _pik_flags, _bAffinityDone uint8
101172  	var _v *TVdbe
101173  	var _pIdx *XIndex
101174  	_bAffinityDone = uint8(0)
101175  	func() {
101176  		if _update_flags != int32(0) && _update_flags != int32(4) && _update_flags != int32(6) {
101177  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110559), unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000), unsafe.Pointer(str(118014)))
101178  			crt.X__builtin_abort(tls)
101179  		}
101180  	}()
101181  	_v = _sqlite3GetVdbe(tls, _pParse)
101182  	func() {
101183  		if _v == nil {
101184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110565), unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000), unsafe.Pointer(str(42019)))
101185  			crt.X__builtin_abort(tls)
101186  		}
101187  	}()
101188  	func() {
101189  		if (*XSelect)(_pTab.XpSelect) != nil {
101190  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110566), unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000), unsafe.Pointer(str(102296)))
101191  			crt.X__builtin_abort(tls)
101192  		}
101193  	}()
101194  	*func() **XIndex { _i = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
101195  _8:
101196  	if _pIdx == nil {
101197  		goto _11
101198  	}
101199  	if (*elem8(_aRegIdx, uintptr(_i))) == int32(0) {
101200  		goto _9
101201  	}
101202  	_bAffinityDone = uint8(1)
101203  	if _pIdx.XpPartIdxWhere != nil {
101204  		_sqlite3VdbeAddOp2(tls, _v, int32(75), *elem8(_aRegIdx, uintptr(_i)), _sqlite3VdbeCurrentAddr(tls, _v)+int32(2))
101205  	}
101206  	_pik_flags = uint8(func() int32 {
101207  		if _useSeekResult != 0 {
101208  			return int32(16)
101209  		}
101210  		return int32(0)
101211  	}())
101212  	if (int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2)) && ((_pTab.XtabFlags & uint32(32)) != (0)) {
101213  		func() {
101214  			if int32(_pParse.Xnested) != int32(0) {
101215  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110576), unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000), unsafe.Pointer(str(118118)))
101216  				crt.X__builtin_abort(tls)
101217  			}
101218  		}()
101219  		{
101220  			p := &_pik_flags
101221  			*p = uint8(int32(*p) | int32(1))
101222  		}
101223  		{
101224  			p := &_pik_flags
101225  			*p = uint8(int32(*p) | (_update_flags & int32(2)))
101226  		}
101227  	}
101228  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iIdxCur+_i, *elem8(_aRegIdx, uintptr(_i)), (*elem8(_aRegIdx, uintptr(_i)))+int32(1), int32(func() uint16 {
101229  		if ((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0 {
101230  			return _pIdx.XnKeyCol
101231  		}
101232  		return _pIdx.XnColumn
101233  	}()))
101234  	_sqlite3VdbeChangeP5(tls, _v, uint16(_pik_flags))
101235  _9:
101236  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_i }() += 1
101237  	goto _8
101238  _11:
101239  	if (_pTab.XtabFlags & uint32(32)) != (0) {
101240  		return
101241  	}
101242  	_regData = _regNewData + int32(1)
101243  	_regRec = _sqlite3GetTempReg(tls, _pParse)
101244  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regData, int32(_pTab.XnCol), _regRec)
101245  	if _bAffinityDone == 0 {
101246  		_sqlite3TableAffinity(tls, _v, _pTab, int32(0))
101247  		_sqlite3ExprCacheAffinityChange(tls, _pParse, _regData, int32(_pTab.XnCol))
101248  	}
101249  	if _pParse.Xnested != 0 {
101250  		_pik_flags = 0
101251  		goto _25
101252  	}
101253  	_pik_flags = uint8(1)
101254  	{
101255  		p := &_pik_flags
101256  		*p = uint8(int32(*p) | func() int32 {
101257  			if _update_flags != 0 {
101258  				return _update_flags
101259  			}
101260  			return int32(32)
101261  		}())
101262  	}
101263  _25:
101264  	if _appendBias != 0 {
101265  		{
101266  			p := &_pik_flags
101267  			*p = uint8(int32(*p) | int32(8))
101268  		}
101269  	}
101270  	if _useSeekResult != 0 {
101271  		{
101272  			p := &_pik_flags
101273  			*p = uint8(int32(*p) | int32(16))
101274  		}
101275  	}
101276  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _iDataCur, _regRec, _regNewData)
101277  	if _pParse.Xnested == 0 {
101278  		_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_pTab), int32(-15))
101279  	}
101280  	_sqlite3VdbeChangeP5(tls, _v, uint16(_pik_flags))
101281  }
101282  
101283  var _sqlite3CompleteInsertionØ00__func__Ø000 [25]int8
101284  
101285  func init() {
101286  	crt.Xstrncpy(nil, &_sqlite3CompleteInsertionØ00__func__Ø000[0], str(118136), 25)
101287  }
101288  
101289  // C comment
101290  //  /*
101291  //  ** This function is called when deleting or updating a row to implement
101292  //  ** any required CASCADE, SET NULL or SET DEFAULT actions.
101293  //  */
101294  func _sqlite3FkActions(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pChanges *XExprList, _regOld int32, _aChange *int32, _bChngRowid int32) {
101295  	var _3_pAct *XTrigger
101296  	var _1_pFKey *XFKey
101297  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(524288)) == 0 {
101298  		goto _0
101299  	}
101300  	_1_pFKey = _sqlite3FkReferences(tls, _pTab)
101301  _1:
101302  	if _1_pFKey == nil {
101303  		goto _4
101304  	}
101305  	if _aChange != nil && _fkParentIsModified(tls, _pTab, _1_pFKey, _aChange, _bChngRowid) == 0 {
101306  		goto _6
101307  	}
101308  	_3_pAct = _fkActionTrigger(tls, _pParse, _pTab, _1_pFKey, _pChanges)
101309  	if _3_pAct != nil {
101310  		_sqlite3CodeRowTriggerDirect(tls, _pParse, _3_pAct, _pTab, _regOld, int32(2), int32(0))
101311  	}
101312  _6:
101313  	_1_pFKey = (*XFKey)(_1_pFKey.XpNextTo)
101314  	goto _1
101315  _4:
101316  _0:
101317  }
101318  
101319  // C comment
101320  //  /*
101321  //  ** This function is called when an UPDATE or DELETE operation is being
101322  //  ** compiled on table pTab, which is the parent table of foreign-key pFKey.
101323  //  ** If the current operation is an UPDATE, then the pChanges parameter is
101324  //  ** passed a pointer to the list of columns being modified. If it is a
101325  //  ** DELETE, pChanges is passed a NULL pointer.
101326  //  **
101327  //  ** It returns a pointer to a Trigger structure containing a trigger
101328  //  ** equivalent to the ON UPDATE or ON DELETE action specified by pFKey.
101329  //  ** If the action is "NO ACTION" or "RESTRICT", then a NULL pointer is
101330  //  ** returned (these actions require no special handling by the triggers
101331  //  ** sub-system, code for them is created by fkScanChildren()).
101332  //  **
101333  //  ** For example, if pFKey is the foreign key and pTab is table "p" in
101334  //  ** the following schema:
101335  //  **
101336  //  **   CREATE TABLE p(pk PRIMARY KEY);
101337  //  **   CREATE TABLE c(ck REFERENCES p ON DELETE CASCADE);
101338  //  **
101339  //  ** then the returned trigger structure is equivalent to:
101340  //  **
101341  //  **   CREATE TRIGGER ... DELETE ON p BEGIN
101342  //  **     DELETE FROM c WHERE ck = old.pk;
101343  //  **   END;
101344  //  **
101345  //  ** The returned pointer is cached as part of the foreign key object. It
101346  //  ** is eventually freed along with the rest of the foreign key object by
101347  //  ** sqlite3FkDelete().
101348  //  */
101349  func _fkActionTrigger(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pFKey *XFKey, _pChanges *XExprList) (r0 *XTrigger) {
101350  	var _action, _iAction, _2_nFrom, _2_i, _3_iFromCol int32
101351  	var _2_aiCol *int32
101352  	var _2_zFrom *int8
101353  	var _3_tOld, _3_tNew, _3_tFromCol, _3_tToCol, _11_tFrom XToken
101354  	var _db *Xsqlite3
101355  	var _pTrigger *XTrigger
101356  	var _2_pList *XExprList
101357  	var _2_pSelect *XSelect
101358  	var _2_pWhere, _2_pWhen, _3_pEq, _5_pNew, _7_pDflt, _11_pRaise *XExpr
101359  	var _2_pIdx *XIndex
101360  	var _2_pStep *XTriggerStep
101361  	_db = (*Xsqlite3)(_pParse.Xdb)
101362  	_iAction = bool2int(_pChanges != nil)
101363  	_action = int32(*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), uintptr(_iAction)))
101364  	if (_action == int32(6)) && (_db.Xflags&int32(33554432)) != 0 {
101365  		return nil
101366  	}
101367  	_pTrigger = *elem42((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), uintptr(_iAction))
101368  	if _action == int32(0) || _pTrigger != nil {
101369  		goto _3
101370  	}
101371  	_2_pIdx = nil
101372  	_2_aiCol = nil
101373  	_2_pStep = nil
101374  	_2_pWhere = nil
101375  	_2_pList = nil
101376  	_2_pSelect = nil
101377  	_2_pWhen = nil
101378  	if _sqlite3FkLocateIndex(tls, _pParse, _pTab, _pFKey, &_2_pIdx, &_2_aiCol) != 0 {
101379  		return nil
101380  	}
101381  	func() {
101382  		if _2_aiCol == nil && _pFKey.XnCol != int32(1) {
101383  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108611), unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000), unsafe.Pointer(str(117794)))
101384  			crt.X__builtin_abort(tls)
101385  		}
101386  	}()
101387  	_2_i = int32(0)
101388  _8:
101389  	if _2_i >= _pFKey.XnCol {
101390  		goto _11
101391  	}
101392  	_3_tOld = XToken{}
101393  	_3_tOld.Xz = str(43132)
101394  	_3_tOld.Xn = uint32(3)
101395  	_3_tNew = XToken{}
101396  	_3_tNew.Xz = str(43128)
101397  	_3_tNew.Xn = uint32(3)
101398  	_3_iFromCol = func() int32 {
101399  		if _2_aiCol != nil {
101400  			return (*elem8(_2_aiCol, uintptr(_2_i)))
101401  		}
101402  		return (elem117((*t118)(unsafe.Pointer(&_pFKey.XaCol)), 0).XiFrom)
101403  	}()
101404  	func() {
101405  		if _3_iFromCol < int32(0) {
101406  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108622), unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000), unsafe.Pointer(str(118161)))
101407  			crt.X__builtin_abort(tls)
101408  		}
101409  	}()
101410  	func() {
101411  		if _2_pIdx == nil && (int32(_pTab.XiPKey) < int32(0) || int32(_pTab.XiPKey) >= int32(_pTab.XnCol)) {
101412  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108623), unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000), unsafe.Pointer(str(118173)))
101413  			crt.X__builtin_abort(tls)
101414  		}
101415  	}()
101416  	func() {
101417  		if _2_pIdx != nil && int32(*elem52(_2_pIdx.XaiColumn, uintptr(_2_i))) < int32(0) {
101418  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108624), unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000), unsafe.Pointer(str(117739)))
101419  			crt.X__builtin_abort(tls)
101420  		}
101421  	}()
101422  	_sqlite3TokenInit(tls, &_3_tToCol, elem43((*XColumn)(_pTab.XaCol), uintptr(func() int16 {
101423  		if _2_pIdx != nil {
101424  			return (*elem52(_2_pIdx.XaiColumn, uintptr(_2_i)))
101425  		}
101426  		return _pTab.XiPKey
101427  	}())).XzName)
101428  	_sqlite3TokenInit(tls, &_3_tFromCol, elem43((*XColumn)((*XTable)(_pFKey.XpFrom).XaCol), uintptr(_3_iFromCol)).XzName)
101429  	_3_pEq = _sqlite3PExpr(tls, _pParse, int32(78), _sqlite3PExpr(tls, _pParse, int32(122), _sqlite3ExprAlloc(tls, _db, int32(27), &_3_tOld, int32(0)), _sqlite3ExprAlloc(tls, _db, int32(27), &_3_tToCol, int32(0))), _sqlite3ExprAlloc(tls, _db, int32(27), &_3_tFromCol, int32(0)))
101430  	_2_pWhere = _sqlite3ExprAnd(tls, _db, _2_pWhere, _3_pEq)
101431  	if _pChanges != nil {
101432  		_3_pEq = _sqlite3PExpr(tls, _pParse, int32(72), _sqlite3PExpr(tls, _pParse, int32(122), _sqlite3ExprAlloc(tls, _db, int32(27), &_3_tOld, int32(0)), _sqlite3ExprAlloc(tls, _db, int32(27), &_3_tToCol, int32(0))), _sqlite3PExpr(tls, _pParse, int32(122), _sqlite3ExprAlloc(tls, _db, int32(27), &_3_tNew, int32(0)), _sqlite3ExprAlloc(tls, _db, int32(27), &_3_tToCol, int32(0))))
101433  		_2_pWhen = _sqlite3ExprAnd(tls, _db, _2_pWhen, _3_pEq)
101434  	}
101435  	if _action == int32(6) || _action == int32(9) && _pChanges == nil {
101436  		goto _28
101437  	}
101438  	if _action == int32(9) {
101439  		_5_pNew = _sqlite3PExpr(tls, _pParse, int32(122), _sqlite3ExprAlloc(tls, _db, int32(27), &_3_tNew, int32(0)), _sqlite3ExprAlloc(tls, _db, int32(27), &_3_tToCol, int32(0)))
101440  		goto _34
101441  	}
101442  	if _action != int32(8) {
101443  		goto _31
101444  	}
101445  	_7_pDflt = (*XExpr)(elem43((*XColumn)((*XTable)(_pFKey.XpFrom).XaCol), uintptr(_3_iFromCol)).XpDflt)
101446  	if _7_pDflt != nil {
101447  		_5_pNew = _sqlite3ExprDup(tls, _db, _7_pDflt, int32(0))
101448  		goto _33
101449  	}
101450  	_5_pNew = _sqlite3ExprAlloc(tls, _db, int32(101), nil, int32(0))
101451  _33:
101452  	goto _34
101453  _31:
101454  	_5_pNew = _sqlite3ExprAlloc(tls, _db, int32(101), nil, int32(0))
101455  _34:
101456  	_2_pList = _sqlite3ExprListAppend(tls, _pParse, _2_pList, _5_pNew)
101457  	_sqlite3ExprListSetName(tls, _pParse, _2_pList, &_3_tFromCol, int32(0))
101458  _28:
101459  	_2_i += 1
101460  	goto _8
101461  _11:
101462  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_2_aiCol))
101463  	_2_zFrom = (*XTable)(_pFKey.XpFrom).XzName
101464  	_2_nFrom = _sqlite3Strlen30(tls, _2_zFrom)
101465  	if _action != int32(6) {
101466  		goto _35
101467  	}
101468  	_11_tFrom.Xz = _2_zFrom
101469  	_11_tFrom.Xn = uint32(_2_nFrom)
101470  	_11_pRaise = _sqlite3Expr(tls, _db, int32(56), str(58210))
101471  	if _11_pRaise != nil {
101472  		_11_pRaise.Xaffinity = int8(2)
101473  	}
101474  	_2_pSelect = _sqlite3SelectNew(tls, _pParse, _sqlite3ExprListAppend(tls, _pParse, nil, _11_pRaise), _sqlite3SrcListAppend(tls, _db, nil, &_11_tFrom, nil), _2_pWhere, nil, nil, nil, 0, nil, nil)
101475  	_2_pWhere = nil
101476  _35:
101477  	_db.Xlookaside.XbDisable += 1
101478  	_pTrigger = (*XTrigger)(_sqlite3DbMallocZero(tls, _db, (uint64(144)+uint64(_2_nFrom))+uint64(1)))
101479  	if _pTrigger == nil {
101480  		goto _37
101481  	}
101482  	_2_pStep = store121((**XTriggerStep)(unsafe.Pointer(&_pTrigger.Xstep_list)), (*XTriggerStep)(unsafe.Pointer(elem122(_pTrigger, uintptr(1)))))
101483  	_2_pStep.XzTarget = (*int8)(unsafe.Pointer(elem121(_2_pStep, uintptr(1))))
101484  	crt.Xmemcpy(tls, unsafe.Pointer(_2_pStep.XzTarget), unsafe.Pointer(_2_zFrom), uint64(_2_nFrom))
101485  	*(**XExpr)(unsafe.Pointer(&_2_pStep.XpWhere)) = _sqlite3ExprDup(tls, _db, _2_pWhere, int32(1))
101486  	*(**XExprList)(unsafe.Pointer(&_2_pStep.XpExprList)) = _sqlite3ExprListDup(tls, _db, _2_pList, int32(1))
101487  	*(**XSelect)(unsafe.Pointer(&_2_pStep.XpSelect)) = _sqlite3SelectDup(tls, _db, _2_pSelect, int32(1))
101488  	if _2_pWhen != nil {
101489  		_2_pWhen = _sqlite3PExpr(tls, _pParse, int32(19), _2_pWhen, nil)
101490  		*(**XExpr)(unsafe.Pointer(&_pTrigger.XpWhen)) = _sqlite3ExprDup(tls, _db, _2_pWhen, int32(1))
101491  	}
101492  _37:
101493  	_db.Xlookaside.XbDisable -= 1
101494  	_sqlite3ExprDelete(tls, _db, _2_pWhere)
101495  	_sqlite3ExprDelete(tls, _db, _2_pWhen)
101496  	_sqlite3ExprListDelete(tls, _db, _2_pList)
101497  	_sqlite3SelectDelete(tls, _db, _2_pSelect)
101498  	if int32(_db.XmallocFailed) == int32(1) {
101499  		_fkTriggerDelete(tls, _db, _pTrigger)
101500  		return nil
101501  	}
101502  	func() {
101503  		if _2_pStep == nil {
101504  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108735), unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000), unsafe.Pointer(str(118227)))
101505  			crt.X__builtin_abort(tls)
101506  		}
101507  	}()
101508  	switch _action {
101509  	case int32(6):
101510  		goto _43
101511  	case int32(9):
101512  		goto _44
101513  	default:
101514  		goto _47
101515  	}
101516  
101517  _43:
101518  	_2_pStep.Xop = uint8(119)
101519  	goto _46
101520  _44:
101521  	if _pChanges == nil {
101522  		_2_pStep.Xop = uint8(109)
101523  		goto _46
101524  	}
101525  _47:
101526  	_2_pStep.Xop = uint8(110)
101527  _46:
101528  	*(**XTrigger)(unsafe.Pointer(&_2_pStep.XpTrig)) = _pTrigger
101529  	*(**XSchema)(unsafe.Pointer(&_pTrigger.XpSchema)) = (*XSchema)(_pTab.XpSchema)
101530  	*(**XSchema)(unsafe.Pointer(&_pTrigger.XpTabSchema)) = (*XSchema)(_pTab.XpSchema)
101531  	*elem42((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), uintptr(_iAction)) = _pTrigger
101532  	_pTrigger.Xop = uint8(func() int32 {
101533  		if _pChanges != nil {
101534  			return int32(110)
101535  		}
101536  		return int32(109)
101537  	}())
101538  _3:
101539  	return _pTrigger
101540  }
101541  
101542  var _fkActionTriggerØ00__func__Ø000 [16]int8
101543  
101544  func init() {
101545  	crt.Xstrncpy(nil, &_fkActionTriggerØ00__func__Ø000[0], str(118236), 16)
101546  }
101547  
101548  func _sqlite3AutoincrementEnd(tls *crt.TLS, _pParse *XParse) {
101549  	if _pParse.XpAinc != nil {
101550  		_autoIncrementEnd(tls, _pParse)
101551  	}
101552  }
101553  
101554  // C comment
101555  //  /*
101556  //  ** This routine generates the code needed to write autoincrement
101557  //  ** maximum rowid values back into the sqlite_sequence register.
101558  //  ** Every statement that might do an INSERT into an autoincrement
101559  //  ** table (either directly or through triggers) needs to call this
101560  //  ** routine just before the "exit" code.
101561  //  */
101562  func _autoIncrementEnd(tls *crt.TLS, _pParse *XParse) {
101563  	var _1_iRec, _1_memId int32
101564  	var _db *Xsqlite3
101565  	var _1_pDb *XDb
101566  	var _v *TVdbe
101567  	var _1_aOp *XVdbeOp
101568  	var _p *XAutoincInfo
101569  	_v = (*TVdbe)(_pParse.XpVdbe)
101570  	_db = (*Xsqlite3)(_pParse.Xdb)
101571  	func() {
101572  		if _v == nil {
101573  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109164), unsafe.Pointer(&_autoIncrementEndØ00__func__Ø000), unsafe.Pointer(str(41816)))
101574  			crt.X__builtin_abort(tls)
101575  		}
101576  	}()
101577  	_p = (*XAutoincInfo)(_pParse.XpAinc)
101578  _2:
101579  	if _p == nil {
101580  		goto _5
101581  	}
101582  	_1_pDb = elem27((*XDb)(_db.XaDb), uintptr(_p.XiDb))
101583  	_1_memId = _p.XregCtr
101584  	_1_iRec = _sqlite3GetTempReg(tls, _pParse)
101585  	func() {
101586  		if _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_1_pDb.XpSchema)) == 0 {
101587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109180), unsafe.Pointer(&_autoIncrementEndØ00__func__Ø000), unsafe.Pointer(str(41818)))
101588  			crt.X__builtin_abort(tls)
101589  		}
101590  	}()
101591  	_sqlite3OpenTable(tls, _pParse, int32(0), _p.XiDb, (*XTable)((*XSchema)(_1_pDb.XpSchema).XpSeqTab), int32(107))
101592  	_1_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(5), (*XVdbeOpList)(unsafe.Pointer(&_autoIncrementEndØ00autoIncEndØ002)), _autoIncrementEndØ00iLnØ001)
101593  	if _1_aOp == nil {
101594  		goto _5
101595  	}
101596  	elem63(_1_aOp, 0).Xp1 = _1_memId + int32(1)
101597  	elem63(_1_aOp, uintptr(1)).Xp2 = _1_memId + int32(1)
101598  	elem63(_1_aOp, uintptr(2)).Xp1 = _1_memId - int32(1)
101599  	elem63(_1_aOp, uintptr(2)).Xp3 = _1_iRec
101600  	elem63(_1_aOp, uintptr(3)).Xp2 = _1_iRec
101601  	elem63(_1_aOp, uintptr(3)).Xp3 = _1_memId + int32(1)
101602  	elem63(_1_aOp, uintptr(3)).Xp5 = uint16(8)
101603  	_sqlite3ReleaseTempReg(tls, _pParse, _1_iRec)
101604  	_p = (*XAutoincInfo)(_p.XpNext)
101605  	goto _2
101606  _5:
101607  }
101608  
101609  var _autoIncrementEndØ00__func__Ø000 [17]int8
101610  
101611  func init() {
101612  	crt.Xstrncpy(nil, &_autoIncrementEndØ00__func__Ø000[0], str(118252), 17)
101613  }
101614  
101615  var _autoIncrementEndØ00autoIncEndØ002 [5]XVdbeOpList
101616  
101617  func init() {
101618  	_autoIncrementEndØ00autoIncEndØ002 = [5]XVdbeOpList{XVdbeOpList{Xopcode: uint8(76), Xp2: int8(2)}, XVdbeOpList{Xopcode: uint8(117)}, XVdbeOpList{Xopcode: uint8(101), Xp2: int8(2)}, XVdbeOpList{Xopcode: uint8(118)}, XVdbeOpList{Xopcode: uint8(114)}}
101619  }
101620  
101621  var _autoIncrementEndØ00iLnØ001 int32
101622  
101623  // C comment
101624  //  /*
101625  //  ** Pop an authorization context that was previously pushed
101626  //  ** by sqlite3AuthContextPush
101627  //  */
101628  func _sqlite3AuthContextPop(tls *crt.TLS, _pContext *XAuthContext) {
101629  	if _pContext.XpParse != nil {
101630  		(*XParse)(_pContext.XpParse).XzAuthContext = _pContext.XzAuthContext
101631  		*(**XParse)(unsafe.Pointer(&_pContext.XpParse)) = nil
101632  	}
101633  }
101634  
101635  // C comment
101636  //  /*
101637  //  ** Convert the pStep->zTarget string into a SrcList and return a pointer
101638  //  ** to that SrcList.
101639  //  **
101640  //  ** This routine adds a specific database name, if needed, to the target when
101641  //  ** forming the SrcList.  This prevents a trigger in one database from
101642  //  ** referring to a target in another database.  An exception is when the
101643  //  ** trigger is in TEMP in which case it can refer to any other database it
101644  //  ** wants.
101645  //  */
101646  func _targetSrcList(tls *crt.TLS, _pParse *XParse, _pStep *XTriggerStep) (r0 *XSrcList) {
101647  	var _iDb int32
101648  	var _2_zDb *int8
101649  	var _db *Xsqlite3
101650  	var _pSrc *XSrcList
101651  	_db = (*Xsqlite3)(_pParse.Xdb)
101652  	_pSrc = _sqlite3SrcListAppend(tls, _db, nil, nil, nil)
101653  	if _pSrc == nil {
101654  		goto _0
101655  	}
101656  	func() {
101657  		if _pSrc.XnSrc <= int32(0) {
101658  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123305), unsafe.Pointer(&_targetSrcListØ00__func__Ø000), unsafe.Pointer(str(118269)))
101659  			crt.X__builtin_abort(tls)
101660  		}
101661  	}()
101662  	elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_pSrc.XnSrc-int32(1))).XzName = _sqlite3DbStrDup(tls, _db, _pStep.XzTarget)
101663  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)((*XTrigger)(_pStep.XpTrig).XpSchema))
101664  	if (_iDb == int32(0)) || (_iDb >= int32(2)) {
101665  		func() {
101666  			if _iDb >= _db.XnDb {
101667  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123310), unsafe.Pointer(&_targetSrcListØ00__func__Ø000), unsafe.Pointer(str(54304)))
101668  				crt.X__builtin_abort(tls)
101669  			}
101670  		}()
101671  		_2_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
101672  		elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_pSrc.XnSrc-int32(1))).XzDatabase = _sqlite3DbStrDup(tls, _db, _2_zDb)
101673  	}
101674  _0:
101675  	return _pSrc
101676  }
101677  
101678  var _targetSrcListØ00__func__Ø000 [14]int8
101679  
101680  func init() {
101681  	crt.Xstrncpy(nil, &_targetSrcListØ00__func__Ø000[0], str(118282), 14)
101682  }
101683  
101684  // C comment
101685  //  /*
101686  //  ** This routine is called to handle SQL of the following forms:
101687  //  **
101688  //  **    insert into TABLE (IDLIST) values(EXPRLIST),(EXPRLIST),...
101689  //  **    insert into TABLE (IDLIST) select
101690  //  **    insert into TABLE (IDLIST) default values
101691  //  **
101692  //  ** The IDLIST following the table name is always optional.  If omitted,
101693  //  ** then a list of all (non-hidden) columns for the table is substituted.
101694  //  ** The IDLIST appears in the pColumn parameter.  pColumn is NULL if IDLIST
101695  //  ** is omitted.
101696  //  **
101697  //  ** For the pSelect parameter holds the values to be inserted for the
101698  //  ** first two forms shown above.  A VALUES clause is really just short-hand
101699  //  ** for a SELECT statement that omits the FROM clause and everything else
101700  //  ** that follows.  If the pSelect parameter is NULL, that means that the
101701  //  ** DEFAULT VALUES form of the INSERT statement is intended.
101702  //  **
101703  //  ** The code generated follows one of four templates.  For a simple
101704  //  ** insert with data coming from a single-row VALUES clause, the code executes
101705  //  ** once straight down through.  Pseudo-code follows (we call this
101706  //  ** the "1st template"):
101707  //  **
101708  //  **         open write cursor to <table> and its indices
101709  //  **         put VALUES clause expressions into registers
101710  //  **         write the resulting record into <table>
101711  //  **         cleanup
101712  //  **
101713  //  ** The three remaining templates assume the statement is of the form
101714  //  **
101715  //  **   INSERT INTO <table> SELECT ...
101716  //  **
101717  //  ** If the SELECT clause is of the restricted form "SELECT * FROM <table2>" -
101718  //  ** in other words if the SELECT pulls all columns from a single table
101719  //  ** and there is no WHERE or LIMIT or GROUP BY or ORDER BY clauses, and
101720  //  ** if <table2> and <table1> are distinct tables but have identical
101721  //  ** schemas, including all the same indices, then a special optimization
101722  //  ** is invoked that copies raw records from <table2> over to <table1>.
101723  //  ** See the xferOptimization() function for the implementation of this
101724  //  ** template.  This is the 2nd template.
101725  //  **
101726  //  **         open a write cursor to <table>
101727  //  **         open read cursor on <table2>
101728  //  **         transfer all records in <table2> over to <table>
101729  //  **         close cursors
101730  //  **         foreach index on <table>
101731  //  **           open a write cursor on the <table> index
101732  //  **           open a read cursor on the corresponding <table2> index
101733  //  **           transfer all records from the read to the write cursors
101734  //  **           close cursors
101735  //  **         end foreach
101736  //  **
101737  //  ** The 3rd template is for when the second template does not apply
101738  //  ** and the SELECT clause does not read from <table> at any time.
101739  //  ** The generated code follows this template:
101740  //  **
101741  //  **         X <- A
101742  //  **         goto B
101743  //  **      A: setup for the SELECT
101744  //  **         loop over the rows in the SELECT
101745  //  **           load values into registers R..R+n
101746  //  **           yield X
101747  //  **         end loop
101748  //  **         cleanup after the SELECT
101749  //  **         end-coroutine X
101750  //  **      B: open write cursor to <table> and its indices
101751  //  **      C: yield X, at EOF goto D
101752  //  **         insert the select result into <table> from R..R+n
101753  //  **         goto C
101754  //  **      D: cleanup
101755  //  **
101756  //  ** The 4th template is used if the insert statement takes its
101757  //  ** values from a SELECT but the data is being inserted into a table
101758  //  ** that is also read as part of the SELECT.  In the third form,
101759  //  ** we have to use an intermediate table to store the results of
101760  //  ** the select.  The template is like this:
101761  //  **
101762  //  **         X <- A
101763  //  **         goto B
101764  //  **      A: setup for the SELECT
101765  //  **         loop over the tables in the SELECT
101766  //  **           load value into register R..R+n
101767  //  **           yield X
101768  //  **         end loop
101769  //  **         cleanup after the SELECT
101770  //  **         end co-routine R
101771  //  **      B: open temp table
101772  //  **      L: yield X, at EOF goto M
101773  //  **         insert row from R..R+n into temp table
101774  //  **         goto L
101775  //  **      M: open write cursor to <table> and its indices
101776  //  **         rewind temp table
101777  //  **      C: loop over rows of intermediate table
101778  //  **           transfer values form intermediate table into <table>
101779  //  **         end loop
101780  //  **      D: cleanup
101781  //  */
101782  func _sqlite3Insert(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pSelect *XSelect, _pColumn *XIdList, _onError int32) {
101783  	var _i, _j, _nColumn, _nHidden, _iDataCur, _iIdxCur, _ipkColumn, _endOfLoop, _srcTab, _addrInsTop, _addrCont, _iDb, _regFromSelect, _regAutoinc, _regRowCount, _regIns, _regRowid, _regData, _isView, _tmask, _18_regYield, _18_addrTop, _18_rc, _20_regRec, _20_regTempRowid, _20_addrL, _30_nIdx, _35_regCols, _37_addr1, _54_addr1, _59_iRegStore, _72_isReplace, _72_bUseSeek int32
101784  	var _aRegIdx *int32
101785  	var _zTab, _71_pVTab *int8
101786  	var _useTempTable, _appendFlag, _withoutRowid, _bIdListInOrder uint8
101787  	var _db *Xsqlite3
101788  	var _pTrigger *XTrigger
101789  	var _pTab *XTable
101790  	var _v *TVdbe
101791  	var _pList *XExprList
101792  	var _pIdx *XIndex
101793  	var _52_pOp *XVdbeOp
101794  	var _21_sNC XNameContext
101795  	var _dest XSelectDest
101796  	_nHidden = int32(0)
101797  	_iDataCur = int32(0)
101798  	_iIdxCur = int32(0)
101799  	_ipkColumn = int32(-1)
101800  	_srcTab = int32(0)
101801  	_addrInsTop = int32(0)
101802  	_addrCont = int32(0)
101803  	_useTempTable = uint8(0)
101804  	_appendFlag = uint8(0)
101805  	_pList = nil
101806  	_regFromSelect = int32(0)
101807  	_regAutoinc = int32(0)
101808  	_regRowCount = int32(0)
101809  	_aRegIdx = nil
101810  	_db = (*Xsqlite3)(_pParse.Xdb)
101811  	crt.Xmemset(tls, unsafe.Pointer(&_dest), int32(0), uint64(40))
101812  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
101813  		goto _insert_cleanup
101814  	}
101815  	if ((_pSelect != nil) && ((_pSelect.XselFlags & uint32(512)) != (0))) && ((*XSelect)(_pSelect.XpPrior) == nil) {
101816  		_pList = (*XExprList)(_pSelect.XpEList)
101817  		*(**XExprList)(unsafe.Pointer(&_pSelect.XpEList)) = nil
101818  		_sqlite3SelectDelete(tls, _db, _pSelect)
101819  		_pSelect = nil
101820  	}
101821  	func() {
101822  		if _pTabList.XnSrc != int32(1) {
101823  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109377), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(115053)))
101824  			crt.X__builtin_abort(tls)
101825  		}
101826  	}()
101827  	_zTab = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XzName
101828  	if func() int32 {
101829  		if _zTab == nil {
101830  			return func() int32 {
101831  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109379), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(4809)))
101832  				crt.X__builtin_abort(tls)
101833  				return int32(1)
101834  			}()
101835  		}
101836  		return int32(0)
101837  	}() != 0 {
101838  		goto _insert_cleanup
101839  	}
101840  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTabList)
101841  	if _pTab == nil {
101842  		goto _insert_cleanup
101843  	}
101844  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
101845  	func() {
101846  		if _iDb >= _db.XnDb {
101847  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109385), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(54304)))
101848  			crt.X__builtin_abort(tls)
101849  		}
101850  	}()
101851  	if _sqlite3AuthCheck(tls, _pParse, int32(18), _pTab.XzName, nil, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName) != 0 {
101852  		goto _insert_cleanup
101853  	}
101854  	_withoutRowid = uint8(bool2int((_pTab.XtabFlags & uint32(32)) != (0)))
101855  	_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, int32(108), nil, &_tmask)
101856  	_isView = bool2int((*XSelect)(_pTab.XpSelect) != nil)
101857  	func() {
101858  		if (_pTrigger == nil || _tmask == 0) && (_pTrigger != nil || _tmask != int32(0)) {
101859  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109407), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118296)))
101860  			crt.X__builtin_abort(tls)
101861  		}
101862  	}()
101863  	if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
101864  		goto _insert_cleanup
101865  	}
101866  	if _sqlite3IsReadOnly(tls, _pParse, _pTab, _tmask) != 0 {
101867  		goto _insert_cleanup
101868  	}
101869  	_v = _sqlite3GetVdbe(tls, _pParse)
101870  	if _v == nil {
101871  		goto _insert_cleanup
101872  	}
101873  	if int32(_pParse.Xnested) == int32(0) {
101874  		_sqlite3VdbeCountChanges(tls, _v)
101875  	}
101876  	_sqlite3BeginWriteOperation(tls, _pParse, bool2int((_pSelect != nil) || (_pTrigger != nil)), _iDb)
101877  	if (_pColumn == nil) && _xferOptimization(tls, _pParse, _pTab, _pSelect, _onError, _iDb) != 0 {
101878  		func() {
101879  			if _pTrigger != nil {
101880  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109440), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118345)))
101881  				crt.X__builtin_abort(tls)
101882  			}
101883  		}()
101884  		func() {
101885  			if _pList != nil {
101886  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109441), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118355)))
101887  				crt.X__builtin_abort(tls)
101888  			}
101889  		}()
101890  		goto _insert_end
101891  	}
101892  	_regAutoinc = _autoIncBegin(tls, _pParse, _iDb, _pTab)
101893  	_regRowid = store2(&_regIns, _pParse.XnMem+int32(1))
101894  	_pParse.XnMem += int32(_pTab.XnCol) + int32(1)
101895  	if _pTab.XnModuleArg != 0 {
101896  		_regRowid += 1
101897  		_pParse.XnMem += 1
101898  	}
101899  	_regData = _regRowid + int32(1)
101900  	_bIdListInOrder = uint8(bool2int((_pTab.XtabFlags & uint32(128)) == (0)))
101901  	if _pColumn == nil {
101902  		goto _31
101903  	}
101904  	_i = int32(0)
101905  _32:
101906  	if _i >= _pColumn.XnId {
101907  		goto _35
101908  	}
101909  	elem44((*TIdList_item)(_pColumn.Xa), uintptr(_i)).Xidx = int32(-1)
101910  	_i += 1
101911  	goto _32
101912  _35:
101913  	_i = int32(0)
101914  _36:
101915  	if _i >= _pColumn.XnId {
101916  		goto _39
101917  	}
101918  	_j = int32(0)
101919  _40:
101920  	if _j >= int32(_pTab.XnCol) {
101921  		goto _43
101922  	}
101923  	if _sqlite3StrICmp(tls, elem44((*TIdList_item)(_pColumn.Xa), uintptr(_i)).XzName, elem43((*XColumn)(_pTab.XaCol), uintptr(_j)).XzName) != int32(0) {
101924  		goto _44
101925  	}
101926  	elem44((*TIdList_item)(_pColumn.Xa), uintptr(_i)).Xidx = _j
101927  	if _i != _j {
101928  		_bIdListInOrder = 0
101929  	}
101930  	if _j == int32(_pTab.XiPKey) {
101931  		_ipkColumn = _i
101932  		func() {
101933  			if _withoutRowid != 0 {
101934  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109484), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118364)))
101935  				crt.X__builtin_abort(tls)
101936  			}
101937  		}()
101938  	}
101939  	goto _43
101940  _44:
101941  	_j += 1
101942  	goto _40
101943  _43:
101944  	if _j < int32(_pTab.XnCol) {
101945  		goto _49
101946  	}
101947  	if _sqlite3IsRowid(tls, elem44((*TIdList_item)(_pColumn.Xa), uintptr(_i)).XzName) != 0 && (_withoutRowid == 0) {
101948  		_ipkColumn = _i
101949  		_bIdListInOrder = 0
101950  		goto _52
101951  	}
101952  	_sqlite3ErrorMsg(tls, _pParse, str(118378), unsafe.Pointer(_pTabList), int32(0), unsafe.Pointer(elem44((*TIdList_item)(_pColumn.Xa), uintptr(_i)).XzName))
101953  	_pParse.XcheckSchema = uint8(1)
101954  	goto _insert_cleanup
101955  _52:
101956  _49:
101957  	_i += 1
101958  	goto _36
101959  _39:
101960  _31:
101961  	if _pSelect == nil {
101962  		goto _53
101963  	}
101964  	_18_regYield = preInc2(&_pParse.XnMem, 1)
101965  	_18_addrTop = _sqlite3VdbeCurrentAddr(tls, _v) + int32(1)
101966  	_sqlite3VdbeAddOp3(tls, _v, int32(15), _18_regYield, int32(0), _18_addrTop)
101967  	_sqlite3SelectDestInit(tls, &_dest, int32(13), _18_regYield)
101968  	_dest.XiSdst = func() int32 {
101969  		if _bIdListInOrder != 0 {
101970  			return _regData
101971  		}
101972  		return int32(0)
101973  	}()
101974  	_dest.XnSdst = int32(_pTab.XnCol)
101975  	_18_rc = _sqlite3Select(tls, _pParse, _pSelect, &_dest)
101976  	_regFromSelect = _dest.XiSdst
101977  	if (_18_rc != 0 || (_db.XmallocFailed != 0)) || _pParse.XnErr != 0 {
101978  		goto _insert_cleanup
101979  	}
101980  	_sqlite3VdbeEndCoroutine(tls, _v, _18_regYield)
101981  	_sqlite3VdbeJumpHere(tls, _v, _18_addrTop-int32(1))
101982  	func() {
101983  		if _pSelect.XpEList == nil {
101984  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109526), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118410)))
101985  			crt.X__builtin_abort(tls)
101986  		}
101987  	}()
101988  	_nColumn = (*XExprList)(_pSelect.XpEList).XnExpr
101989  	if (_pTrigger != nil) || _readsTable(tls, _pParse, _iDb, _pTab) != 0 {
101990  		_useTempTable = uint8(1)
101991  	}
101992  	if _useTempTable != 0 {
101993  		_srcTab = postInc2(&_pParse.XnTab, 1)
101994  		_20_regRec = _sqlite3GetTempReg(tls, _pParse)
101995  		_20_regTempRowid = _sqlite3GetTempReg(tls, _pParse)
101996  		_sqlite3VdbeAddOp2(tls, _v, int32(110), _srcTab, _nColumn)
101997  		_20_addrL = _sqlite3VdbeAddOp1(tls, _v, int32(16), _dest.XiSDParm)
101998  		_sqlite3VdbeAddOp3(tls, _v, int32(101), _regFromSelect, _nColumn, _20_regRec)
101999  		_sqlite3VdbeAddOp2(tls, _v, int32(117), _srcTab, _20_regTempRowid)
102000  		_sqlite3VdbeAddOp3(tls, _v, int32(118), _srcTab, _20_regRec, _20_regTempRowid)
102001  		_sqlite3VdbeGoto(tls, _v, _20_addrL)
102002  		_sqlite3VdbeJumpHere(tls, _v, _20_addrL)
102003  		_sqlite3ReleaseTempReg(tls, _pParse, _20_regRec)
102004  		_sqlite3ReleaseTempReg(tls, _pParse, _20_regTempRowid)
102005  	}
102006  	goto _64
102007  _53:
102008  	crt.Xmemset(tls, unsafe.Pointer(&_21_sNC), int32(0), uint64(56))
102009  	*(**XParse)(unsafe.Pointer(&_21_sNC.XpParse)) = _pParse
102010  	_srcTab = int32(-1)
102011  	func() {
102012  		if int32(_useTempTable) != int32(0) {
102013  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109578), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118426)))
102014  			crt.X__builtin_abort(tls)
102015  		}
102016  	}()
102017  	if _pList == nil {
102018  		goto _67
102019  	}
102020  	_nColumn = _pList.XnExpr
102021  	if _sqlite3ResolveExprListNames(tls, &_21_sNC, _pList) != 0 {
102022  		goto _insert_cleanup
102023  	}
102024  	goto _69
102025  _67:
102026  	_nColumn = int32(0)
102027  _69:
102028  _64:
102029  	if (_pColumn == nil) && (_nColumn > int32(0)) {
102030  		_ipkColumn = int32(_pTab.XiPKey)
102031  	}
102032  	_i = int32(0)
102033  _72:
102034  	if _i >= int32(_pTab.XnCol) {
102035  		goto _75
102036  	}
102037  	_nHidden += func() int32 {
102038  		if (int32(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XcolFlags) & int32(2)) != int32(0) {
102039  			return int32(1)
102040  		}
102041  		return int32(0)
102042  	}()
102043  	_i += 1
102044  	goto _72
102045  _75:
102046  	if ((_pColumn == nil) && _nColumn != 0) && (_nColumn != (int32(_pTab.XnCol) - _nHidden)) {
102047  		_sqlite3ErrorMsg(tls, _pParse, str(118442), unsafe.Pointer(_pTabList), int32(0), int32(_pTab.XnCol)-_nHidden, _nColumn)
102048  		goto _insert_cleanup
102049  	}
102050  	if (_pColumn != nil) && (_nColumn != _pColumn.XnId) {
102051  		_sqlite3ErrorMsg(tls, _pParse, str(118494), _nColumn, _pColumn.XnId)
102052  		goto _insert_cleanup
102053  	}
102054  	if (_db.Xflags & int32(128)) != 0 {
102055  		_regRowCount = preInc2(&_pParse.XnMem, 1)
102056  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _regRowCount)
102057  	}
102058  	if _isView != 0 {
102059  		goto _84
102060  	}
102061  	_30_nIdx = _sqlite3OpenTableAndIndices(tls, _pParse, _pTab, int32(107), 0, int32(-1), nil, &_iDataCur, &_iIdxCur)
102062  	_aRegIdx = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(4)*uint64(_30_nIdx+int32(1))))
102063  	if _aRegIdx == nil {
102064  		goto _insert_cleanup
102065  	}
102066  	*func() **XIndex { _i = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
102067  _86:
102068  	if _i >= _30_nIdx {
102069  		goto _89
102070  	}
102071  	func() {
102072  		if _pIdx == nil {
102073  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109631), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118519)))
102074  			crt.X__builtin_abort(tls)
102075  		}
102076  	}()
102077  	*elem8(_aRegIdx, uintptr(_i)) = preInc2(&_pParse.XnMem, 1)
102078  	_pParse.XnMem += int32(_pIdx.XnColumn)
102079  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_i }() += 1
102080  	goto _86
102081  _89:
102082  _84:
102083  	if _useTempTable != 0 {
102084  		_addrInsTop = _sqlite3VdbeAddOp1(tls, _v, int32(37), _srcTab)
102085  		_addrCont = _sqlite3VdbeCurrentAddr(tls, _v)
102086  		goto _94
102087  	}
102088  	if _pSelect != nil {
102089  		_addrInsTop = store2(&_addrCont, _sqlite3VdbeAddOp1(tls, _v, int32(16), _dest.XiSDParm))
102090  	}
102091  _94:
102092  	_endOfLoop = _sqlite3VdbeMakeLabel(tls, _v)
102093  	if (_tmask & int32(1)) == 0 {
102094  		goto _95
102095  	}
102096  	_35_regCols = _sqlite3GetTempRange(tls, _pParse, int32(_pTab.XnCol)+int32(1))
102097  	if _ipkColumn < int32(0) {
102098  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(-1), _35_regCols)
102099  		goto _97
102100  	}
102101  	func() {
102102  		if _withoutRowid != 0 {
102103  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109679), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118364)))
102104  			crt.X__builtin_abort(tls)
102105  		}
102106  	}()
102107  	if _useTempTable != 0 {
102108  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _srcTab, _ipkColumn, _35_regCols)
102109  		goto _101
102110  	}
102111  	func() {
102112  		if _pSelect != nil {
102113  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109683), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118524)))
102114  			crt.X__builtin_abort(tls)
102115  		}
102116  	}()
102117  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_ipkColumn)).XpExpr), _35_regCols)
102118  _101:
102119  	_37_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(76), _35_regCols)
102120  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(-1), _35_regCols)
102121  	_sqlite3VdbeJumpHere(tls, _v, _37_addr1)
102122  	_sqlite3VdbeAddOp1(tls, _v, int32(17), _35_regCols)
102123  _97:
102124  	func() {
102125  		if _pTab.XnModuleArg != 0 {
102126  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109695), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(41888)))
102127  			crt.X__builtin_abort(tls)
102128  		}
102129  	}()
102130  	_i = store2(&_j, int32(0))
102131  _106:
102132  	if _i >= int32(_pTab.XnCol) {
102133  		goto _109
102134  	}
102135  	if _pColumn == nil {
102136  		goto _110
102137  	}
102138  	_j = int32(0)
102139  _111:
102140  	if _j >= _pColumn.XnId {
102141  		goto _114
102142  	}
102143  	if (elem44((*TIdList_item)(_pColumn.Xa), uintptr(_j)).Xidx) == _i {
102144  		goto _114
102145  	}
102146  	_j += 1
102147  	goto _111
102148  _114:
102149  _110:
102150  	if (((_useTempTable == 0) && (_pList == nil)) || ((_pColumn != nil) && (_j >= _pColumn.XnId))) || ((_pColumn == nil) && int32(0) != 0) {
102151  		_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XpDflt), (_35_regCols+_i)+int32(1))
102152  		goto _124
102153  	}
102154  	if _useTempTable != 0 {
102155  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _srcTab, _j, (_35_regCols+_i)+int32(1))
102156  		goto _124
102157  	}
102158  	func() {
102159  		if _pSelect != nil {
102160  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109711), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118524)))
102161  			crt.X__builtin_abort(tls)
102162  		}
102163  	}()
102164  	_sqlite3ExprCodeAndCache(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_j)).XpExpr), (_35_regCols+_i)+int32(1))
102165  _124:
102166  	if (_pColumn == nil) && int32(1) != 0 {
102167  		_j += 1
102168  	}
102169  	_i += 1
102170  	goto _106
102171  _109:
102172  	if _isView == 0 {
102173  		_sqlite3TableAffinity(tls, _v, _pTab, _35_regCols+int32(1))
102174  	}
102175  	_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(108), nil, int32(1), _pTab, (_35_regCols-int32(_pTab.XnCol))-int32(1), _onError, _endOfLoop)
102176  	_sqlite3ReleaseTempRange(tls, _pParse, _35_regCols, int32(_pTab.XnCol)+int32(1))
102177  _95:
102178  	if _isView != 0 {
102179  		goto _130
102180  	}
102181  	if _pTab.XnModuleArg != 0 {
102182  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regIns)
102183  	}
102184  	if _ipkColumn < int32(0) {
102185  		goto _132
102186  	}
102187  	if _useTempTable != 0 {
102188  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _srcTab, _ipkColumn, _regRowid)
102189  		goto _136
102190  	}
102191  	if _pSelect != nil {
102192  		_sqlite3VdbeAddOp2(tls, _v, int32(64), _regFromSelect+_ipkColumn, _regRowid)
102193  		goto _136
102194  	}
102195  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_ipkColumn)).XpExpr), _regRowid)
102196  	_52_pOp = _sqlite3VdbeGetOp(tls, _v, int32(-1))
102197  	if (func() int32 {
102198  		if _52_pOp != nil {
102199  			return int32(1)
102200  		}
102201  		return func() int32 {
102202  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109750), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(4809)))
102203  			crt.X__builtin_abort(tls)
102204  			return int32(0)
102205  		}()
102206  	}() != 0 && (int32(_52_pOp.Xopcode) == int32(59))) && (_pTab.XnModuleArg == 0) {
102207  		_appendFlag = uint8(1)
102208  		_52_pOp.Xopcode = uint8(117)
102209  		_52_pOp.Xp1 = _iDataCur
102210  		_52_pOp.Xp2 = _regRowid
102211  		_52_pOp.Xp3 = _regAutoinc
102212  	}
102213  _136:
102214  	if _appendFlag != 0 {
102215  		goto _142
102216  	}
102217  	if _pTab.XnModuleArg == 0 {
102218  		_54_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(76), _regRowid)
102219  		_sqlite3VdbeAddOp3(tls, _v, int32(117), _iDataCur, _regRowid, _regAutoinc)
102220  		_sqlite3VdbeJumpHere(tls, _v, _54_addr1)
102221  		goto _144
102222  	}
102223  	_54_addr1 = _sqlite3VdbeCurrentAddr(tls, _v)
102224  	_sqlite3VdbeAddOp2(tls, _v, int32(75), _regRowid, _54_addr1+int32(2))
102225  _144:
102226  	_sqlite3VdbeAddOp1(tls, _v, int32(17), _regRowid)
102227  _142:
102228  	goto _148
102229  _132:
102230  	if _pTab.XnModuleArg != 0 || (_withoutRowid != 0) {
102231  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regRowid)
102232  		goto _148
102233  	}
102234  	_sqlite3VdbeAddOp3(tls, _v, int32(117), _iDataCur, _regRowid, _regAutoinc)
102235  	_appendFlag = uint8(1)
102236  _148:
102237  	_autoIncStep(tls, _pParse, _regAutoinc, _regRowid)
102238  	_nHidden = int32(0)
102239  	_i = int32(0)
102240  _149:
102241  	if _i >= int32(_pTab.XnCol) {
102242  		goto _152
102243  	}
102244  	_59_iRegStore = (_regRowid + int32(1)) + _i
102245  	if _i == int32(_pTab.XiPKey) {
102246  		_sqlite3VdbeAddOp1(tls, _v, int32(60), _59_iRegStore)
102247  		goto _150
102248  	}
102249  	if _pColumn != nil {
102250  		goto _154
102251  	}
102252  	if (int32(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XcolFlags) & int32(2)) != int32(0) {
102253  		_j = int32(-1)
102254  		_nHidden += 1
102255  		goto _156
102256  	}
102257  	_j = _i - _nHidden
102258  _156:
102259  	goto _157
102260  _154:
102261  	_j = int32(0)
102262  _158:
102263  	if _j >= _pColumn.XnId {
102264  		goto _161
102265  	}
102266  	if (elem44((*TIdList_item)(_pColumn.Xa), uintptr(_j)).Xidx) == _i {
102267  		goto _161
102268  	}
102269  	_j += 1
102270  	goto _158
102271  _161:
102272  _157:
102273  	if ((_j < int32(0)) || (_nColumn == int32(0))) || ((_pColumn != nil) && (_j >= _pColumn.XnId)) {
102274  		_sqlite3ExprCodeFactorable(tls, _pParse, (*XExpr)(elem43((*XColumn)(_pTab.XaCol), uintptr(_i)).XpDflt), _59_iRegStore)
102275  		goto _172
102276  	}
102277  	if _useTempTable != 0 {
102278  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _srcTab, _j, _59_iRegStore)
102279  		goto _172
102280  	}
102281  	if _pSelect == nil {
102282  		goto _170
102283  	}
102284  	if _regFromSelect != _regData {
102285  		_sqlite3VdbeAddOp2(tls, _v, int32(65), _regFromSelect+_j, _59_iRegStore)
102286  	}
102287  	goto _172
102288  _170:
102289  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_j)).XpExpr), _59_iRegStore)
102290  _172:
102291  _150:
102292  	_i += 1
102293  	goto _149
102294  _152:
102295  	if _pTab.XnModuleArg != 0 {
102296  		_71_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab)))
102297  		_sqlite3VtabMakeWritable(tls, _pParse, _pTab)
102298  		_sqlite3VdbeAddOp4(tls, _v, int32(12), int32(1), int32(_pTab.XnCol)+int32(2), _regIns, _71_pVTab, int32(-8))
102299  		_sqlite3VdbeChangeP5(tls, _v, uint16(func() int32 {
102300  			if _onError == int32(10) {
102301  				return int32(2)
102302  			}
102303  			return _onError
102304  		}()))
102305  		_sqlite3MayAbort(tls, _pParse)
102306  		goto _176
102307  	}
102308  	_sqlite3GenerateConstraintChecks(tls, _pParse, _pTab, _aRegIdx, _iDataCur, _iIdxCur, _regIns, int32(0), uint8(bool2int(_ipkColumn >= int32(0))), uint8(_onError), _endOfLoop, &_72_isReplace, nil)
102309  	_sqlite3FkCheck(tls, _pParse, _pTab, int32(0), _regIns, nil, int32(0))
102310  	_72_bUseSeek = bool2int((_72_isReplace == int32(0)) || ((_pTrigger == nil) && (((_db.Xflags & int32(524288)) == int32(0)) || (_sqlite3FkReferences(tls, _pTab) == nil))))
102311  	_sqlite3CompleteInsertion(tls, _pParse, _pTab, _iDataCur, _iIdxCur, _regIns, _aRegIdx, int32(0), int32(_appendFlag), _72_bUseSeek)
102312  _176:
102313  _130:
102314  	if (_db.Xflags & int32(128)) != int32(0) {
102315  		_sqlite3VdbeAddOp2(tls, _v, int32(73), _regRowCount, int32(1))
102316  	}
102317  	if _pTrigger != nil {
102318  		_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(108), nil, int32(2), _pTab, (_regData-int32(2))-int32(_pTab.XnCol), _onError, _endOfLoop)
102319  	}
102320  	_sqlite3VdbeResolveLabel(tls, _v, _endOfLoop)
102321  	if _useTempTable != 0 {
102322  		_sqlite3VdbeAddOp2(tls, _v, int32(7), _srcTab, _addrCont)
102323  		_sqlite3VdbeJumpHere(tls, _v, _addrInsTop)
102324  		_sqlite3VdbeAddOp1(tls, _v, int32(114), _srcTab)
102325  		goto _insert_end
102326  	}
102327  	if _pSelect != nil {
102328  		_sqlite3VdbeGoto(tls, _v, _addrCont)
102329  		_sqlite3VdbeJumpHere(tls, _v, _addrInsTop)
102330  	}
102331  _insert_end:
102332  	if (int32(_pParse.Xnested) == int32(0)) && ((*XTable)(_pParse.XpTriggerTab) == nil) {
102333  		_sqlite3AutoincrementEnd(tls, _pParse)
102334  	}
102335  	if ((_db.Xflags&int32(128)) != 0 && (_pParse.Xnested == 0)) && (_pParse.XpTriggerTab == nil) {
102336  		_sqlite3VdbeAddOp2(tls, _v, int32(67), _regRowCount, int32(1))
102337  		_sqlite3VdbeSetNumCols(tls, _v, int32(1))
102338  		_sqlite3VdbeSetColName(tls, _v, int32(0), int32(0), str(118535), nil)
102339  	}
102340  _insert_cleanup:
102341  	_sqlite3SrcListDelete(tls, _db, _pTabList)
102342  	_sqlite3ExprListDelete(tls, _db, _pList)
102343  	_sqlite3SelectDelete(tls, _db, _pSelect)
102344  	_sqlite3IdListDelete(tls, _db, _pColumn)
102345  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_aRegIdx))
102346  }
102347  
102348  var _sqlite3InsertØ00__func__Ø000 [14]int8
102349  
102350  func init() {
102351  	crt.Xstrncpy(nil, &_sqlite3InsertØ00__func__Ø000[0], str(118549), 14)
102352  }
102353  
102354  // C comment
102355  //  /*
102356  //  ** Attempt the transfer optimization on INSERTs of the form
102357  //  **
102358  //  **     INSERT INTO tab1 SELECT * FROM tab2;
102359  //  **
102360  //  ** The xfer optimization transfers raw records from tab2 over to tab1.
102361  //  ** Columns are not decoded and reassembled, which greatly improves
102362  //  ** performance.  Raw index records are transferred in the same way.
102363  //  **
102364  //  ** The xfer optimization is only attempted if tab1 and tab2 are compatible.
102365  //  ** There are lots of rules for determining compatibility - see comments
102366  //  ** embedded in the code for details.
102367  //  **
102368  //  ** This routine returns TRUE if the optimization is guaranteed to be used.
102369  //  ** Sometimes the xfer optimization will only work if the destination table
102370  //  ** is empty - a factor that can only be determined at run-time.  In that
102371  //  ** case, this routine generates code for the xfer optimization but also
102372  //  ** does a test to see if the destination table is empty and jumps over the
102373  //  ** xfer optimization code if the test fails.  In that case, this routine
102374  //  ** returns FALSE so that the caller will know to go ahead and generate
102375  //  ** an unoptimized transfer.  This routine also returns FALSE if there
102376  //  ** is no chance that the xfer optimization can be applied.
102377  //  **
102378  //  ** This optimization is particularly useful at making VACUUM run faster.
102379  //  */
102380  func _xferOptimization(tls *crt.TLS, _pParse *XParse, _pDest *XTable, _pSelect *XSelect, _onError int32, _iDbDest int32) (r0 int32) {
102381  	var _i, _iDbSrc, _iSrc, _iDest, _addr1, _addr2, _emptyDestTest, _emptySrcTest, _regAutoinc, _destHasUniqueIdx, _regData, _regRowid int32
102382  	var _47_zColl *int8
102383  	var _37_insFlags, _44_idxInsFlags uint8
102384  	var _db *Xsqlite3
102385  	var _pSrc *XTable
102386  	var _v *TVdbe
102387  	var _pItem *TSrcList_item
102388  	var _pEList *XExprList
102389  	var _23_pDestCol, _23_pSrcCol *XColumn
102390  	var _pSrcIdx, _pDestIdx *XIndex
102391  	_db = (*Xsqlite3)(_pParse.Xdb)
102392  	_emptyDestTest = int32(0)
102393  	_emptySrcTest = int32(0)
102394  	_destHasUniqueIdx = int32(0)
102395  	if _pSelect == nil {
102396  		return int32(0)
102397  	}
102398  	if (_pParse.XpWith != nil) || (_pSelect.XpWith != nil) {
102399  		return int32(0)
102400  	}
102401  	if _sqlite3TriggerList(tls, _pParse, _pDest) != nil {
102402  		return int32(0)
102403  	}
102404  	if _pDest.XnModuleArg != 0 {
102405  		return int32(0)
102406  	}
102407  	if _onError != int32(10) {
102408  		goto _5
102409  	}
102410  	if int32(_pDest.XiPKey) >= int32(0) {
102411  		_onError = int32(_pDest.XkeyConf)
102412  	}
102413  	if _onError == int32(10) {
102414  		_onError = int32(2)
102415  	}
102416  _5:
102417  	func() {
102418  		if _pSelect.XpSrc == nil {
102419  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110825), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118563)))
102420  			crt.X__builtin_abort(tls)
102421  		}
102422  	}()
102423  	if ((*XSrcList)(_pSelect.XpSrc).XnSrc) != int32(1) {
102424  		return int32(0)
102425  	}
102426  	if (elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pSelect.XpSrc).Xa))), 0).XpSelect) != nil {
102427  		return int32(0)
102428  	}
102429  	if _pSelect.XpWhere != nil {
102430  		return int32(0)
102431  	}
102432  	if _pSelect.XpOrderBy != nil {
102433  		return int32(0)
102434  	}
102435  	if _pSelect.XpGroupBy != nil {
102436  		return int32(0)
102437  	}
102438  	if _pSelect.XpLimit != nil {
102439  		return int32(0)
102440  	}
102441  	func() {
102442  		if (*XExpr)(_pSelect.XpOffset) != nil {
102443  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110846), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118577)))
102444  			crt.X__builtin_abort(tls)
102445  		}
102446  	}()
102447  	if _pSelect.XpPrior != nil {
102448  		return int32(0)
102449  	}
102450  	if (_pSelect.XselFlags & uint32(1)) != 0 {
102451  		return int32(0)
102452  	}
102453  	_pEList = (*XExprList)(_pSelect.XpEList)
102454  	func() {
102455  		if _pEList == nil {
102456  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110854), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(45007)))
102457  			crt.X__builtin_abort(tls)
102458  		}
102459  	}()
102460  	if _pEList.XnExpr != int32(1) {
102461  		return int32(0)
102462  	}
102463  	func() {
102464  		if (elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), 0).XpExpr) == nil {
102465  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110858), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118597)))
102466  			crt.X__builtin_abort(tls)
102467  		}
102468  	}()
102469  	if int32((*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), 0).XpExpr).Xop) != int32(161) {
102470  		return int32(0)
102471  	}
102472  	_pItem = (*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pSelect.XpSrc).Xa)))
102473  	_pSrc = _sqlite3LocateTableItem(tls, _pParse, 0, _pItem)
102474  	if _pSrc == nil {
102475  		return int32(0)
102476  	}
102477  	if _pSrc == _pDest {
102478  		return int32(0)
102479  	}
102480  	if ((_pDest.XtabFlags & uint32(32)) == (0)) != ((_pSrc.XtabFlags & uint32(32)) == (0)) {
102481  		return int32(0)
102482  	}
102483  	if _pSrc.XnModuleArg != 0 {
102484  		return int32(0)
102485  	}
102486  	if _pSrc.XpSelect != nil {
102487  		return int32(0)
102488  	}
102489  	if int32(_pDest.XnCol) != int32(_pSrc.XnCol) {
102490  		return int32(0)
102491  	}
102492  	if int32(_pDest.XiPKey) != int32(_pSrc.XiPKey) {
102493  		return int32(0)
102494  	}
102495  	_i = int32(0)
102496  _33:
102497  	if _i >= int32(_pDest.XnCol) {
102498  		goto _36
102499  	}
102500  	_23_pDestCol = elem43((*XColumn)(_pDest.XaCol), uintptr(_i))
102501  	_23_pSrcCol = elem43((*XColumn)(_pSrc.XaCol), uintptr(_i))
102502  	if int32(_23_pDestCol.Xaffinity) != int32(_23_pSrcCol.Xaffinity) {
102503  		return int32(0)
102504  	}
102505  	if Xsqlite3_stricmp(tls, _23_pDestCol.XzColl, _23_pSrcCol.XzColl) != int32(0) {
102506  		return int32(0)
102507  	}
102508  	if (_23_pDestCol.XnotNull != 0) && (_23_pSrcCol.XnotNull == 0) {
102509  		return int32(0)
102510  	}
102511  	if _i <= int32(0) {
102512  		goto _41
102513  	}
102514  	func() {
102515  		if (*XExpr)(_23_pDestCol.XpDflt) != nil && int32((*XExpr)(_23_pDestCol.XpDflt).Xop) != int32(162) {
102516  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110913), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118616)))
102517  			crt.X__builtin_abort(tls)
102518  		}
102519  	}()
102520  	func() {
102521  		if (*XExpr)(_23_pSrcCol.XpDflt) != nil && int32((*XExpr)(_23_pSrcCol.XpDflt).Xop) != int32(162) {
102522  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110914), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118667)))
102523  			crt.X__builtin_abort(tls)
102524  		}
102525  	}()
102526  	if (((*XExpr)(_23_pDestCol.XpDflt) == nil) != ((*XExpr)(_23_pSrcCol.XpDflt) == nil)) || ((_23_pDestCol.XpDflt != nil) && (crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer(&((*XExpr)(_23_pDestCol.XpDflt).Xu))), *(**int8)(unsafe.Pointer(&((*XExpr)(_23_pSrcCol.XpDflt).Xu)))) != int32(0))) {
102527  		return int32(0)
102528  	}
102529  _41:
102530  	_i += 1
102531  	goto _33
102532  _36:
102533  	_pDestIdx = (*XIndex)(_pDest.XpIndex)
102534  _51:
102535  	if _pDestIdx == nil {
102536  		goto _54
102537  	}
102538  	if int32(_pDestIdx.XonError) != int32(0) {
102539  		_destHasUniqueIdx = int32(1)
102540  	}
102541  	_pSrcIdx = (*XIndex)(_pSrc.XpIndex)
102542  _56:
102543  	if _pSrcIdx == nil {
102544  		goto _59
102545  	}
102546  	if _xferCompatibleIndex(tls, _pDestIdx, _pSrcIdx) != 0 {
102547  		goto _59
102548  	}
102549  	_pSrcIdx = (*XIndex)(_pSrcIdx.XpNext)
102550  	goto _56
102551  _59:
102552  	if _pSrcIdx == nil {
102553  		return int32(0)
102554  	}
102555  	_pDestIdx = (*XIndex)(_pDestIdx.XpNext)
102556  	goto _51
102557  _54:
102558  	if (_pDest.XpCheck != nil) && _sqlite3ExprListCompare(tls, (*XExprList)(_pSrc.XpCheck), (*XExprList)(_pDest.XpCheck), int32(-1)) != 0 {
102559  		return int32(0)
102560  	}
102561  	if ((_db.Xflags & int32(524288)) != int32(0)) && ((*XFKey)(_pDest.XpFKey) != nil) {
102562  		return int32(0)
102563  	}
102564  	if (_db.Xflags & int32(128)) != int32(0) {
102565  		return int32(0)
102566  	}
102567  	_iDbSrc = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pSrc.XpSchema))
102568  	_v = _sqlite3GetVdbe(tls, _pParse)
102569  	_sqlite3CodeVerifySchema(tls, _pParse, _iDbSrc)
102570  	_iSrc = postInc2(&_pParse.XnTab, 1)
102571  	_iDest = postInc2(&_pParse.XnTab, 1)
102572  	_regAutoinc = _autoIncBegin(tls, _pParse, _iDbDest, _pDest)
102573  	_regData = _sqlite3GetTempReg(tls, _pParse)
102574  	_regRowid = _sqlite3GetTempReg(tls, _pParse)
102575  	_sqlite3OpenTable(tls, _pParse, _iDest, _iDbDest, _pDest, int32(107))
102576  	func() {
102577  		if (_pDest.XtabFlags&uint32(32)) != (0) && _destHasUniqueIdx == 0 {
102578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110971), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118716)))
102579  			crt.X__builtin_abort(tls)
102580  		}
102581  	}()
102582  	if ((_db.Xflags & int32(268435456)) == int32(0)) && ((((int32(_pDest.XiPKey) < int32(0)) && ((*XIndex)(_pDest.XpIndex) != nil)) || _destHasUniqueIdx != 0) || ((_onError != int32(2)) && (_onError != int32(1)))) {
102583  		_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(37), _iDest, int32(0))
102584  		_emptyDestTest = _sqlite3VdbeAddOp0(tls, _v, int32(13))
102585  		_sqlite3VdbeJumpHere(tls, _v, _addr1)
102586  	}
102587  	if (_pSrc.XtabFlags & uint32(32)) != (0) {
102588  		goto _76
102589  	}
102590  	_sqlite3OpenTable(tls, _pParse, _iSrc, _iDbSrc, _pSrc, int32(106))
102591  	_emptySrcTest = _sqlite3VdbeAddOp2(tls, _v, int32(37), _iSrc, int32(0))
102592  	if int32(_pDest.XiPKey) >= int32(0) {
102593  		_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(125), _iSrc, _regRowid)
102594  		_addr2 = _sqlite3VdbeAddOp3(tls, _v, int32(32), _iDest, int32(0), _regRowid)
102595  		_sqlite3RowidConstraint(tls, _pParse, _onError, _pDest)
102596  		_sqlite3VdbeJumpHere(tls, _v, _addr2)
102597  		_autoIncStep(tls, _pParse, _regAutoinc, _regRowid)
102598  		goto _80
102599  	}
102600  	if (*XIndex)(_pDest.XpIndex) == nil {
102601  		_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(117), _iDest, _regRowid)
102602  		goto _80
102603  	}
102604  	_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(125), _iSrc, _regRowid)
102605  	func() {
102606  		if (_pDest.XtabFlags & uint32(8)) != (0) {
102607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(111013), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118752)))
102608  			crt.X__builtin_abort(tls)
102609  		}
102610  	}()
102611  _80:
102612  	_sqlite3VdbeAddOp3(tls, _v, int32(124), _iSrc, _regData, int32(1))
102613  	if (_db.Xflags & int32(268435456)) != 0 {
102614  		_sqlite3VdbeAddOp3(tls, _v, int32(33), _iDest, int32(0), int32(-1))
102615  		_37_insFlags = uint8(57)
102616  		goto _84
102617  	}
102618  	_37_insFlags = uint8(41)
102619  _84:
102620  	_sqlite3VdbeAddOp4(tls, _v, int32(118), _iDest, _regData, _regRowid, (*int8)(unsafe.Pointer(_pDest)), int32(-15))
102621  	_sqlite3VdbeChangeP5(tls, _v, uint16(_37_insFlags))
102622  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _iSrc, _addr1)
102623  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _iSrc, int32(0))
102624  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _iDest, int32(0))
102625  	goto _85
102626  _76:
102627  	_sqlite3TableLock(tls, _pParse, _iDbDest, _pDest.Xtnum, uint8(1), _pDest.XzName)
102628  	_sqlite3TableLock(tls, _pParse, _iDbSrc, _pSrc.Xtnum, 0, _pSrc.XzName)
102629  _85:
102630  	_pDestIdx = (*XIndex)(_pDest.XpIndex)
102631  _86:
102632  	if _pDestIdx == nil {
102633  		goto _89
102634  	}
102635  	_44_idxInsFlags = 0
102636  	_pSrcIdx = (*XIndex)(_pSrc.XpIndex)
102637  _90:
102638  	if func() int32 {
102639  		if _pSrcIdx != nil {
102640  			return int32(1)
102641  		}
102642  		return func() int32 {
102643  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(111035), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(4809)))
102644  			crt.X__builtin_abort(tls)
102645  			return int32(0)
102646  		}()
102647  	}() == 0 {
102648  		goto _95
102649  	}
102650  	if _xferCompatibleIndex(tls, _pDestIdx, _pSrcIdx) != 0 {
102651  		goto _95
102652  	}
102653  	_pSrcIdx = (*XIndex)(_pSrcIdx.XpNext)
102654  	goto _90
102655  _95:
102656  	func() {
102657  		if _pSrcIdx == nil {
102658  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(111038), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118792)))
102659  			crt.X__builtin_abort(tls)
102660  		}
102661  	}()
102662  	_sqlite3VdbeAddOp3(tls, _v, int32(106), _iSrc, _pSrcIdx.Xtnum, _iDbSrc)
102663  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pSrcIdx)
102664  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pSrcIdx.XzName))
102665  	_sqlite3VdbeAddOp3(tls, _v, int32(107), _iDest, _pDestIdx.Xtnum, _iDbDest)
102666  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pDestIdx)
102667  	_sqlite3VdbeChangeP5(tls, _v, uint16(1))
102668  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pDestIdx.XzName))
102669  	_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(37), _iSrc, int32(0))
102670  	_sqlite3VdbeAddOp3(tls, _v, int32(124), _iSrc, _regData, int32(1))
102671  	if (_db.Xflags & int32(268435456)) == 0 {
102672  		goto _99
102673  	}
102674  	_i = int32(0)
102675  _100:
102676  	if _i >= int32(_pSrcIdx.XnColumn) {
102677  		goto _103
102678  	}
102679  	_47_zColl = *elem0(_pSrcIdx.XazColl, uintptr(_i))
102680  	if Xsqlite3_stricmp(tls, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), _47_zColl) != 0 {
102681  		goto _103
102682  	}
102683  	_i += 1
102684  	goto _100
102685  _103:
102686  	if _i == int32(_pSrcIdx.XnColumn) {
102687  		_44_idxInsFlags = uint8(16)
102688  		_sqlite3VdbeAddOp3(tls, _v, int32(33), _iDest, int32(0), int32(-1))
102689  	}
102690  _99:
102691  	if ((_pSrc.XtabFlags & uint32(32)) != (0)) && (int32((uint32(_pDestIdx.XidxType)<<30)>>30) == int32(2)) {
102692  		{
102693  			p := &_44_idxInsFlags
102694  			*p = uint8(int32(*p) | int32(1))
102695  		}
102696  	}
102697  	_sqlite3VdbeAddOp2(tls, _v, int32(128), _iDest, _regData)
102698  	_sqlite3VdbeChangeP5(tls, _v, uint16(int32(_44_idxInsFlags)|int32(8)))
102699  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _iSrc, _addr1+int32(1))
102700  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
102701  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _iSrc, int32(0))
102702  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _iDest, int32(0))
102703  	_pDestIdx = (*XIndex)(_pDestIdx.XpNext)
102704  	goto _86
102705  _89:
102706  	if _emptySrcTest != 0 {
102707  		_sqlite3VdbeJumpHere(tls, _v, _emptySrcTest)
102708  	}
102709  	_sqlite3ReleaseTempReg(tls, _pParse, _regRowid)
102710  	_sqlite3ReleaseTempReg(tls, _pParse, _regData)
102711  	if _emptyDestTest != 0 {
102712  		_sqlite3AutoincrementEnd(tls, _pParse)
102713  		_sqlite3VdbeAddOp2(tls, _v, int32(55), int32(0), int32(0))
102714  		_sqlite3VdbeJumpHere(tls, _v, _emptyDestTest)
102715  		_sqlite3VdbeAddOp2(tls, _v, int32(114), _iDest, int32(0))
102716  		return int32(0)
102717  	}
102718  	return int32(1)
102719  }
102720  
102721  var _xferOptimizationØ00__func__Ø000 [17]int8
102722  
102723  func init() {
102724  	crt.Xstrncpy(nil, &_xferOptimizationØ00__func__Ø000[0], str(118800), 17)
102725  }
102726  
102727  // C comment
102728  //  /*
102729  //  ** Check to see if index pSrc is compatible as a source of data
102730  //  ** for index pDest in an insert transfer optimization.  The rules
102731  //  ** for a compatible index:
102732  //  **
102733  //  **    *   The index is over the same set of columns
102734  //  **    *   The same DESC and ASC markings occurs on all columns
102735  //  **    *   The same onError processing (OE_Abort, OE_Ignore, etc)
102736  //  **    *   The same collating sequence on each column
102737  //  **    *   The index has the exact same WHERE clause
102738  //  */
102739  func _xferCompatibleIndex(tls *crt.TLS, _pDest *XIndex, _pSrc *XIndex) (r0 int32) {
102740  	var _i int32
102741  	func() {
102742  		if _pDest == nil || _pSrc == nil {
102743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110722), unsafe.Pointer(&_xferCompatibleIndexØ00__func__Ø000), unsafe.Pointer(str(118817)))
102744  			crt.X__builtin_abort(tls)
102745  		}
102746  	}()
102747  	func() {
102748  		if (*XTable)(_pDest.XpTable) == (*XTable)(_pSrc.XpTable) {
102749  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110723), unsafe.Pointer(&_xferCompatibleIndexØ00__func__Ø000), unsafe.Pointer(str(118831)))
102750  			crt.X__builtin_abort(tls)
102751  		}
102752  	}()
102753  	if int32(_pDest.XnKeyCol) != int32(_pSrc.XnKeyCol) {
102754  		return int32(0)
102755  	}
102756  	if int32(_pDest.XonError) != int32(_pSrc.XonError) {
102757  		return int32(0)
102758  	}
102759  	_i = int32(0)
102760  _7:
102761  	if _i >= int32(_pSrc.XnKeyCol) {
102762  		goto _10
102763  	}
102764  	if int32(*elem52(_pSrc.XaiColumn, uintptr(_i))) != int32(*elem52(_pDest.XaiColumn, uintptr(_i))) {
102765  		return int32(0)
102766  	}
102767  	if int32(*elem52(_pSrc.XaiColumn, uintptr(_i))) != int32(-2) {
102768  		goto _12
102769  	}
102770  	func() {
102771  		if (*XExprList)(_pSrc.XaColExpr) == nil || (*XExprList)(_pDest.XaColExpr) == nil {
102772  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110735), unsafe.Pointer(&_xferCompatibleIndexØ00__func__Ø000), unsafe.Pointer(str(118859)))
102773  			crt.X__builtin_abort(tls)
102774  		}
102775  	}()
102776  	if _sqlite3ExprCompare(tls, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSrc.XaColExpr).Xa))), uintptr(_i)).XpExpr), (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pDest.XaColExpr).Xa))), uintptr(_i)).XpExpr), int32(-1)) != int32(0) {
102777  		return int32(0)
102778  	}
102779  _12:
102780  	if int32(*elem15(_pSrc.XaSortOrder, uintptr(_i))) != int32(*elem15(_pDest.XaSortOrder, uintptr(_i))) {
102781  		return int32(0)
102782  	}
102783  	if Xsqlite3_stricmp(tls, *elem0(_pSrc.XazColl, uintptr(_i)), *elem0(_pDest.XazColl, uintptr(_i))) != int32(0) {
102784  		return int32(0)
102785  	}
102786  	_i += 1
102787  	goto _7
102788  _10:
102789  	if _sqlite3ExprCompare(tls, (*XExpr)(_pSrc.XpPartIdxWhere), (*XExpr)(_pDest.XpPartIdxWhere), int32(-1)) != 0 {
102790  		return int32(0)
102791  	}
102792  	return int32(1)
102793  }
102794  
102795  var _xferCompatibleIndexØ00__func__Ø000 [20]int8
102796  
102797  func init() {
102798  	crt.Xstrncpy(nil, &_xferCompatibleIndexØ00__func__Ø000[0], str(118899), 20)
102799  }
102800  
102801  // C comment
102802  //  /*
102803  //  ** Locate or create an AutoincInfo structure associated with table pTab
102804  //  ** which is in database iDb.  Return the register number for the register
102805  //  ** that holds the maximum rowid.  Return zero if pTab is not an AUTOINCREMENT
102806  //  ** table.  (Also return zero when doing a VACUUM since we do not want to
102807  //  ** update the AUTOINCREMENT counters during a VACUUM.)
102808  //  **
102809  //  ** There is at most one AutoincInfo structure per table even if the
102810  //  ** same table is autoincremented multiple times due to inserts within
102811  //  ** triggers.  A new AutoincInfo structure is created if this is the
102812  //  ** first use of table pTab.  On 2nd and subsequent uses, the original
102813  //  ** AutoincInfo structure is used.
102814  //  **
102815  //  ** Three memory locations are allocated:
102816  //  **
102817  //  **   (1)  Register to hold the name of the pTab table.
102818  //  **   (2)  Register to hold the maximum ROWID of pTab.
102819  //  **   (3)  Register to hold the rowid in sqlite_sequence of pTab
102820  //  **
102821  //  ** The 2nd register is the one that is returned.  That is all the
102822  //  ** insert routine needs to know about.
102823  //  */
102824  func _autoIncBegin(tls *crt.TLS, _pParse *XParse, _iDb int32, _pTab *XTable) (r0 int32) {
102825  	var _memId int32
102826  	var _1_pToplevel *XParse
102827  	var _1_pInfo *XAutoincInfo
102828  	_memId = int32(0)
102829  	if (_pTab.XtabFlags&uint32(8)) == (0) || (((*Xsqlite3)(_pParse.Xdb).Xflags)&int32(268435456)) != int32(0) {
102830  		goto _1
102831  	}
102832  	_1_pToplevel = func() *XParse {
102833  		if _pParse.XpToplevel != nil {
102834  			return (*XParse)(_pParse.XpToplevel)
102835  		}
102836  		return _pParse
102837  	}()
102838  	_1_pInfo = (*XAutoincInfo)(_1_pToplevel.XpAinc)
102839  _4:
102840  	if (_1_pInfo != nil) && ((*XTable)(_1_pInfo.XpTab) != _pTab) {
102841  		_1_pInfo = (*XAutoincInfo)(_1_pInfo.XpNext)
102842  		goto _4
102843  	}
102844  	if _1_pInfo != nil {
102845  		goto _7
102846  	}
102847  	_1_pInfo = (*XAutoincInfo)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.Xdb), uint64(24)))
102848  	if _1_pInfo == nil {
102849  		return int32(0)
102850  	}
102851  	*(**XAutoincInfo)(unsafe.Pointer(&_1_pInfo.XpNext)) = (*XAutoincInfo)(_1_pToplevel.XpAinc)
102852  	*(**XAutoincInfo)(unsafe.Pointer(&_1_pToplevel.XpAinc)) = _1_pInfo
102853  	*(**XTable)(unsafe.Pointer(&_1_pInfo.XpTab)) = _pTab
102854  	_1_pInfo.XiDb = _iDb
102855  	_1_pToplevel.XnMem += 1
102856  	_1_pInfo.XregCtr = preInc2(&_1_pToplevel.XnMem, 1)
102857  	_1_pToplevel.XnMem += 1
102858  _7:
102859  	_memId = _1_pInfo.XregCtr
102860  _1:
102861  	return _memId
102862  }
102863  
102864  // C comment
102865  //  /*
102866  //  ** Update the maximum rowid for an autoincrement calculation.
102867  //  **
102868  //  ** This routine should be called when the regRowid register holds a
102869  //  ** new rowid that is about to be inserted.  If that new rowid is
102870  //  ** larger than the maximum rowid in the memId memory cell, then the
102871  //  ** memory cell is updated.
102872  //  */
102873  func _autoIncStep(tls *crt.TLS, _pParse *XParse, _memId int32, _regRowid int32) {
102874  	if _memId > int32(0) {
102875  		_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.XpVdbe), int32(148), _memId, _regRowid)
102876  	}
102877  }
102878  
102879  // C comment
102880  //  /*
102881  //  ** Return non-zero if the table pTab in database iDb or any of its indices
102882  //  ** have been opened at any point in the VDBE program. This is used to see if
102883  //  ** a statement of the form  "INSERT INTO <iDb, pTab> SELECT ..." can
102884  //  ** run without using a temporary table for the results of the SELECT.
102885  //  */
102886  func _readsTable(tls *crt.TLS, _p *XParse, _iDb int32, _pTab *XTable) (r0 int32) {
102887  	var _i, _iEnd, _2_tnum int32
102888  	var _v *TVdbe
102889  	var _2_pIndex *XIndex
102890  	var _1_pOp *XVdbeOp
102891  	var _pVTab *XVTable
102892  	_v = _sqlite3GetVdbe(tls, _p)
102893  	_iEnd = _sqlite3VdbeCurrentAddr(tls, _v)
102894  	_pVTab = func() *XVTable {
102895  		if _pTab.XnModuleArg != 0 {
102896  			return _sqlite3GetVTable(tls, (*Xsqlite3)(_p.Xdb), _pTab)
102897  		}
102898  		return nil
102899  	}()
102900  	_i = int32(1)
102901  _2:
102902  	if _i >= _iEnd {
102903  		goto _5
102904  	}
102905  	_1_pOp = _sqlite3VdbeGetOp(tls, _v, _i)
102906  	func() {
102907  		if _1_pOp == nil {
102908  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109010), unsafe.Pointer(&_readsTableØ00__func__Ø000), unsafe.Pointer(str(109376)))
102909  			crt.X__builtin_abort(tls)
102910  		}
102911  	}()
102912  	if int32(_1_pOp.Xopcode) != int32(106) || _1_pOp.Xp3 != _iDb {
102913  		goto _9
102914  	}
102915  	_2_tnum = _1_pOp.Xp2
102916  	if _2_tnum == _pTab.Xtnum {
102917  		return int32(1)
102918  	}
102919  	_2_pIndex = (*XIndex)(_pTab.XpIndex)
102920  _11:
102921  	if _2_pIndex == nil {
102922  		goto _14
102923  	}
102924  	if _2_tnum == _2_pIndex.Xtnum {
102925  		return int32(1)
102926  	}
102927  	_2_pIndex = (*XIndex)(_2_pIndex.XpNext)
102928  	goto _11
102929  _14:
102930  _9:
102931  	if (int32(_1_pOp.Xopcode) == int32(158)) && ((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pOp.Xp4))) == _pVTab) {
102932  		func() {
102933  			if (*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pOp.Xp4))) == nil {
102934  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109025), unsafe.Pointer(&_readsTableØ00__func__Ø000), unsafe.Pointer(str(118919)))
102935  				crt.X__builtin_abort(tls)
102936  			}
102937  		}()
102938  		func() {
102939  			if int32(_1_pOp.Xp4type) != int32(-8) {
102940  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109026), unsafe.Pointer(&_readsTableØ00__func__Ø000), unsafe.Pointer(str(70431)))
102941  				crt.X__builtin_abort(tls)
102942  			}
102943  		}()
102944  		return int32(1)
102945  	}
102946  	_i += 1
102947  	goto _2
102948  _5:
102949  	return int32(0)
102950  }
102951  
102952  var _readsTableØ00__func__Ø000 [11]int8
102953  
102954  func init() {
102955  	crt.Xstrncpy(nil, &_readsTableØ00__func__Ø000[0], str(118936), 11)
102956  }
102957  
102958  // C comment
102959  //  /*
102960  //  ** Generate code that evaluates the given expression and puts the result
102961  //  ** in register target.
102962  //  **
102963  //  ** Also make a copy of the expression results into another "cache" register
102964  //  ** and modify the expression so that the next time it is evaluated,
102965  //  ** the result is a copy of the cache register.
102966  //  **
102967  //  ** This routine is used for expressions that are used multiple
102968  //  ** times.  They are evaluated once and the results of the expression
102969  //  ** are reused.
102970  //  */
102971  func _sqlite3ExprCodeAndCache(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
102972  	var _iMem int32
102973  	var _v *TVdbe
102974  	_v = (*TVdbe)(_pParse.XpVdbe)
102975  	func() {
102976  		if _target <= int32(0) {
102977  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95114), unsafe.Pointer(&_sqlite3ExprCodeAndCacheØ00__func__Ø000), unsafe.Pointer(str(99622)))
102978  			crt.X__builtin_abort(tls)
102979  		}
102980  	}()
102981  	func() {
102982  		if int32(_pExpr.Xop) == int32(157) {
102983  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95115), unsafe.Pointer(&_sqlite3ExprCodeAndCacheØ00__func__Ø000), unsafe.Pointer(str(118947)))
102984  			crt.X__builtin_abort(tls)
102985  		}
102986  	}()
102987  	_sqlite3ExprCode(tls, _pParse, _pExpr, _target)
102988  	_iMem = preInc2(&_pParse.XnMem, 1)
102989  	_sqlite3VdbeAddOp2(tls, _v, int32(64), _target, _iMem)
102990  	_exprToRegister(tls, _pExpr, _iMem)
102991  }
102992  
102993  var _sqlite3ExprCodeAndCacheØ00__func__Ø000 [24]int8
102994  
102995  func init() {
102996  	crt.Xstrncpy(nil, &_sqlite3ExprCodeAndCacheØ00__func__Ø000[0], str(118970), 24)
102997  }
102998  
102999  // C comment
103000  //  /*
103001  //  ** Parse context structure pFrom has just been used to create a sub-vdbe
103002  //  ** (trigger program). If an error has occurred, transfer error information
103003  //  ** from pFrom to pTo.
103004  //  */
103005  func _transferParseError(tls *crt.TLS, _pTo *XParse, _pFrom *XParse) {
103006  	func() {
103007  		if _pFrom.XzErrMsg != nil && _pFrom.XnErr == 0 {
103008  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123418), unsafe.Pointer(&_transferParseErrorØ00__func__Ø000), unsafe.Pointer(str(118994)))
103009  			crt.X__builtin_abort(tls)
103010  		}
103011  	}()
103012  	func() {
103013  		if _pTo.XzErrMsg != nil && _pTo.XnErr == 0 {
103014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123419), unsafe.Pointer(&_transferParseErrorØ00__func__Ø000), unsafe.Pointer(str(119027)))
103015  			crt.X__builtin_abort(tls)
103016  		}
103017  	}()
103018  	if _pTo.XnErr == int32(0) {
103019  		_pTo.XzErrMsg = _pFrom.XzErrMsg
103020  		_pTo.XnErr = _pFrom.XnErr
103021  		_pTo.Xrc = _pFrom.Xrc
103022  		goto _7
103023  	}
103024  	_sqlite3DbFree(tls, (*Xsqlite3)(_pFrom.Xdb), unsafe.Pointer(_pFrom.XzErrMsg))
103025  _7:
103026  }
103027  
103028  var _transferParseErrorØ00__func__Ø000 [19]int8
103029  
103030  func init() {
103031  	crt.Xstrncpy(nil, &_transferParseErrorØ00__func__Ø000[0], str(119056), 19)
103032  }
103033  
103034  // C comment
103035  //  /*
103036  //  ** This function returns a pointer to the array of opcodes associated with
103037  //  ** the Vdbe passed as the first argument. It is the callers responsibility
103038  //  ** to arrange for the returned array to be eventually freed using the
103039  //  ** vdbeFreeOpArray() function.
103040  //  **
103041  //  ** Before returning, *pnOp is set to the number of entries in the returned
103042  //  ** array. Also, *pnMaxArg is set to the larger of its current value and
103043  //  ** the number of entries in the Vdbe.apArg[] array required to execute the
103044  //  ** returned program.
103045  //  */
103046  func _sqlite3VdbeTakeOpArray(tls *crt.TLS, _p *TVdbe, _pnOp *int32, _pnMaxArg *int32) (r0 *XVdbeOp) {
103047  	var _aOp *XVdbeOp
103048  	_aOp = (*XVdbeOp)(_p.XaOp)
103049  	func() {
103050  		if _aOp == nil || ((*Xsqlite3)(_p.Xdb).XmallocFailed) != 0 {
103051  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72108), unsafe.Pointer(&_sqlite3VdbeTakeOpArrayØ00__func__Ø000), unsafe.Pointer(str(119075)))
103052  			crt.X__builtin_abort(tls)
103053  		}
103054  	}()
103055  	func() {
103056  		if _p.XbtreeMask != (0) {
103057  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72111), unsafe.Pointer(&_sqlite3VdbeTakeOpArrayØ00__func__Ø000), unsafe.Pointer(str(119103)))
103058  			crt.X__builtin_abort(tls)
103059  		}
103060  	}()
103061  	_resolveP2Values(tls, _p, _pnMaxArg)
103062  	*_pnOp = _p.XnOp
103063  	*(**XVdbeOp)(unsafe.Pointer(&_p.XaOp)) = nil
103064  	return _aOp
103065  }
103066  
103067  var _sqlite3VdbeTakeOpArrayØ00__func__Ø000 [23]int8
103068  
103069  func init() {
103070  	crt.Xstrncpy(nil, &_sqlite3VdbeTakeOpArrayØ00__func__Ø000[0], str(119131), 23)
103071  }
103072  
103073  // C comment
103074  //  /*
103075  //  ** Generate code to drop a table.
103076  //  */
103077  func _sqlite3CodeDropTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDb int32, _isView int32) {
103078  	var _db *Xsqlite3
103079  	var _pDb *XDb
103080  	var _pTrigger *XTrigger
103081  	var _v *TVdbe
103082  	_db = (*Xsqlite3)(_pParse.Xdb)
103083  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
103084  	_v = _sqlite3GetVdbe(tls, _pParse)
103085  	func() {
103086  		if _v == nil {
103087  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102140), unsafe.Pointer(&_sqlite3CodeDropTableØ00__func__Ø000), unsafe.Pointer(str(42019)))
103088  			crt.X__builtin_abort(tls)
103089  		}
103090  	}()
103091  	_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
103092  	if _pTab.XnModuleArg != 0 {
103093  		_sqlite3VdbeAddOp0(tls, _v, int32(155))
103094  	}
103095  	_pTrigger = _sqlite3TriggerList(tls, _pParse, _pTab)
103096  _3:
103097  	if _pTrigger != nil {
103098  		func() {
103099  			if (*XSchema)(_pTrigger.XpSchema) != (*XSchema)(_pTab.XpSchema) && (*XSchema)(_pTrigger.XpSchema) != (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema) {
103100  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102155), unsafe.Pointer(&_sqlite3CodeDropTableØ00__func__Ø000), unsafe.Pointer(str(119154)))
103101  				crt.X__builtin_abort(tls)
103102  			}
103103  		}()
103104  		_sqlite3DropTriggerPtr(tls, _pParse, _pTrigger)
103105  		_pTrigger = (*XTrigger)(_pTrigger.XpNext)
103106  		goto _3
103107  	}
103108  	if (_pTab.XtabFlags & uint32(8)) != 0 {
103109  		_sqlite3NestedParse(tls, _pParse, str(119228), unsafe.Pointer(_pDb.XzDbSName), unsafe.Pointer(_pTab.XzName))
103110  	}
103111  	_sqlite3NestedParse(tls, _pParse, str(119273), unsafe.Pointer(_pDb.XzDbSName), unsafe.Pointer(str(49981)), unsafe.Pointer(_pTab.XzName))
103112  	if (_isView == 0) && (_pTab.XnModuleArg == 0) {
103113  		_destroyTable(tls, _pParse, _pTab)
103114  	}
103115  	if _pTab.XnModuleArg != 0 {
103116  		_sqlite3VdbeAddOp4(tls, _v, int32(157), _iDb, int32(0), int32(0), _pTab.XzName, int32(0))
103117  	}
103118  	_sqlite3VdbeAddOp4(tls, _v, int32(141), _iDb, int32(0), int32(0), _pTab.XzName, int32(0))
103119  	_sqlite3ChangeCookie(tls, _pParse, _iDb)
103120  	_sqliteViewResetAll(tls, _db, _iDb)
103121  }
103122  
103123  var _sqlite3CodeDropTableØ00__func__Ø000 [21]int8
103124  
103125  func init() {
103126  	crt.Xstrncpy(nil, &_sqlite3CodeDropTableØ00__func__Ø000[0], str(119329), 21)
103127  }
103128  
103129  // C comment
103130  //  /*
103131  //  ** Drop a trigger given a pointer to that trigger.
103132  //  */
103133  func _sqlite3DropTriggerPtr(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger) {
103134  	var _iDb, _1_code int32
103135  	var _1_zDb, _1_zTab *int8
103136  	var _db *Xsqlite3
103137  	var _pTable *XTable
103138  	var _v *TVdbe
103139  	_db = (*Xsqlite3)(_pParse.Xdb)
103140  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTrigger.XpSchema))
103141  	func() {
103142  		if _iDb < int32(0) || _iDb >= _db.XnDb {
103143  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123183), unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000), unsafe.Pointer(str(21693)))
103144  			crt.X__builtin_abort(tls)
103145  		}
103146  	}()
103147  	_pTable = _tableOfTrigger(tls, _pTrigger)
103148  	func() {
103149  		if _pTable == nil {
103150  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123185), unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000), unsafe.Pointer(str(94111)))
103151  			crt.X__builtin_abort(tls)
103152  		}
103153  	}()
103154  	func() {
103155  		if (*XSchema)(_pTable.XpSchema) != (*XSchema)(_pTrigger.XpSchema) && _iDb != int32(1) {
103156  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123186), unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000), unsafe.Pointer(str(119350)))
103157  			crt.X__builtin_abort(tls)
103158  		}
103159  	}()
103160  	_1_code = int32(16)
103161  	_1_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
103162  	_1_zTab = func() *int8 {
103163  		if int32(1) != 0 && (_iDb == int32(1)) {
103164  			return str(49962)
103165  		}
103166  		return str(49981)
103167  	}()
103168  	if _iDb == int32(1) {
103169  		_1_code = int32(14)
103170  	}
103171  	if _sqlite3AuthCheck(tls, _pParse, _1_code, _pTrigger.XzName, _pTable.XzName, _1_zDb) != 0 || _sqlite3AuthCheck(tls, _pParse, int32(9), _1_zTab, nil, _1_zDb) != 0 {
103172  		return
103173  	}
103174  	func() {
103175  		if _pTable == nil {
103176  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123202), unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000), unsafe.Pointer(str(21911)))
103177  			crt.X__builtin_abort(tls)
103178  		}
103179  	}()
103180  	if store62(&_v, _sqlite3GetVdbe(tls, _pParse)) != nil {
103181  		_sqlite3NestedParse(tls, _pParse, str(119395), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(str(49981)), unsafe.Pointer(_pTrigger.XzName))
103182  		_sqlite3ChangeCookie(tls, _pParse, _iDb)
103183  		_sqlite3VdbeAddOp4(tls, _v, int32(143), _iDb, int32(0), int32(0), _pTrigger.XzName, int32(0))
103184  	}
103185  }
103186  
103187  var _sqlite3DropTriggerPtrØ00__func__Ø000 [22]int8
103188  
103189  func init() {
103190  	crt.Xstrncpy(nil, &_sqlite3DropTriggerPtrØ00__func__Ø000[0], str(119446), 22)
103191  }
103192  
103193  // C comment
103194  //  /*
103195  //  ** Write VDBE code to erase table pTab and all associated indices on disk.
103196  //  ** Code to update the sqlite_master tables and internal schema definitions
103197  //  ** in case a root-page belonging to another table is moved by the btree layer
103198  //  ** is also added (this can happen with an auto-vacuum database).
103199  //  */
103200  func _destroyTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) {
103201  	var _iTab, _iDestroyed, _1_iLargest, _3_iIdx, _6_iDb int32
103202  	var _1_pIdx *XIndex
103203  	_iTab = _pTab.Xtnum
103204  	_iDestroyed = int32(0)
103205  _0:
103206  	_1_iLargest = int32(0)
103207  	if (_iDestroyed == int32(0)) || (_iTab < _iDestroyed) {
103208  		_1_iLargest = _iTab
103209  	}
103210  	_1_pIdx = (*XIndex)(_pTab.XpIndex)
103211  _4:
103212  	if _1_pIdx == nil {
103213  		goto _7
103214  	}
103215  	_3_iIdx = _1_pIdx.Xtnum
103216  	func() {
103217  		if (*XSchema)(_1_pIdx.XpSchema) != (*XSchema)(_pTab.XpSchema) {
103218  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102089), unsafe.Pointer(&_destroyTableØ00__func__Ø000), unsafe.Pointer(str(115165)))
103219  			crt.X__builtin_abort(tls)
103220  		}
103221  	}()
103222  	if ((_iDestroyed == int32(0)) || (_3_iIdx < _iDestroyed)) && (_3_iIdx > _1_iLargest) {
103223  		_1_iLargest = _3_iIdx
103224  	}
103225  	_1_pIdx = (*XIndex)(_1_pIdx.XpNext)
103226  	goto _4
103227  _7:
103228  	if _1_iLargest == int32(0) {
103229  		return
103230  	}
103231  	_6_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
103232  	func() {
103233  		if _6_iDb < int32(0) || _6_iDb >= ((*Xsqlite3)(_pParse.Xdb).XnDb) {
103234  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102098), unsafe.Pointer(&_destroyTableØ00__func__Ø000), unsafe.Pointer(str(102366)))
103235  			crt.X__builtin_abort(tls)
103236  		}
103237  	}()
103238  	_destroyRootPage(tls, _pParse, _1_iLargest, _6_iDb)
103239  	_iDestroyed = _1_iLargest
103240  	goto _0
103241  }
103242  
103243  var _destroyTableØ00__func__Ø000 [13]int8
103244  
103245  func init() {
103246  	crt.Xstrncpy(nil, &_destroyTableØ00__func__Ø000[0], str(119468), 13)
103247  }
103248  
103249  func _destroyRootPage(tls *crt.TLS, _pParse *XParse, _iTable int32, _iDb int32) {
103250  	var _r1 int32
103251  	var _v *TVdbe
103252  	_v = _sqlite3GetVdbe(tls, _pParse)
103253  	_r1 = _sqlite3GetTempReg(tls, _pParse)
103254  	func() {
103255  		if _iTable <= int32(1) {
103256  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102026), unsafe.Pointer(&_destroyRootPageØ00__func__Ø000), unsafe.Pointer(str(119481)))
103257  			crt.X__builtin_abort(tls)
103258  		}
103259  	}()
103260  	_sqlite3VdbeAddOp3(tls, _v, int32(133), _iTable, _r1, _iDb)
103261  	_sqlite3MayAbort(tls, _pParse)
103262  	_sqlite3NestedParse(tls, _pParse, str(119490), unsafe.Pointer(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(str(49981)), _iTable, _r1, _r1)
103263  	_sqlite3ReleaseTempReg(tls, _pParse, _r1)
103264  }
103265  
103266  var _destroyRootPageØ00__func__Ø000 [16]int8
103267  
103268  func init() {
103269  	crt.Xstrncpy(nil, &_destroyRootPageØ00__func__Ø000[0], str(119546), 16)
103270  }
103271  
103272  // C comment
103273  //  /*
103274  //  ** Clear the column names from every VIEW in database idx.
103275  //  */
103276  func _sqliteViewResetAll(tls *crt.TLS, _db *Xsqlite3, _idx int32) {
103277  	var _i *XHashElem
103278  	var _1_pTab *XTable
103279  	func() {
103280  		if _sqlite3SchemaMutexHeld(tls, _db, _idx, nil) == 0 {
103281  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101959), unsafe.Pointer(&_sqliteViewResetAllØ00__func__Ø000), unsafe.Pointer(str(119562)))
103282  			crt.X__builtin_abort(tls)
103283  		}
103284  	}()
103285  	if (int32((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_idx)).XpSchema).XschemaFlags) & int32(2)) != int32(2) {
103286  		return
103287  	}
103288  	_i = (*XHashElem)(((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_idx)).XpSchema).XtblHash).Xfirst)
103289  _3:
103290  	if _i == nil {
103291  		goto _6
103292  	}
103293  	_1_pTab = (*XTable)(_i.Xdata)
103294  	if _1_pTab.XpSelect != nil {
103295  		_sqlite3DeleteColumnNames(tls, _db, _1_pTab)
103296  		*(**XColumn)(unsafe.Pointer(&_1_pTab.XaCol)) = nil
103297  		_1_pTab.XnCol = 0
103298  	}
103299  	_i = (*XHashElem)(_i.Xnext)
103300  	goto _3
103301  _6:
103302  	{
103303  		p := &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_idx)).XpSchema).XschemaFlags)
103304  		*p = uint16(int32(*p) & int32(-3))
103305  	}
103306  }
103307  
103308  var _sqliteViewResetAllØ00__func__Ø000 [19]int8
103309  
103310  func init() {
103311  	crt.Xstrncpy(nil, &_sqliteViewResetAllØ00__func__Ø000[0], str(119597), 19)
103312  }
103313  
103314  // C comment
103315  //  /*
103316  //  ** The parser calls this routine in order to create a new VIEW
103317  //  */
103318  func _sqlite3CreateView(tls *crt.TLS, _pParse *XParse, _pBegin *XToken, _pName1 *XToken, _pName2 *XToken, _pCNames *XExprList, _pSelect *XSelect, _isTemp int32, _noErr int32) {
103319  	var _n, _iDb int32
103320  	var _z *int8
103321  	var _sEnd XToken
103322  	var _db *Xsqlite3
103323  	var _p *XTable
103324  	var _pName *XToken
103325  	var _sFix XDbFixer
103326  	_pName = nil
103327  	_db = (*Xsqlite3)(_pParse.Xdb)
103328  	if int32(_pParse.XnVar) > int32(0) {
103329  		_sqlite3ErrorMsg(tls, _pParse, str(119616))
103330  		goto _create_view_fail
103331  	}
103332  	_sqlite3StartTable(tls, _pParse, _pName1, _pName2, _isTemp, int32(1), int32(0), _noErr)
103333  	_p = (*XTable)(_pParse.XpNewTable)
103334  	if (_p == nil) || _pParse.XnErr != 0 {
103335  		goto _create_view_fail
103336  	}
103337  	_sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
103338  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_p.XpSchema))
103339  	_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(111849), _pName)
103340  	if _sqlite3FixSelect(tls, &_sFix, _pSelect) != 0 {
103341  		goto _create_view_fail
103342  	}
103343  	*(**XSelect)(unsafe.Pointer(&_p.XpSelect)) = _sqlite3SelectDup(tls, _db, _pSelect, int32(1))
103344  	*(**XExprList)(unsafe.Pointer(&_p.XpCheck)) = _sqlite3ExprListDup(tls, _db, _pCNames, int32(1))
103345  	if _db.XmallocFailed != 0 {
103346  		goto _create_view_fail
103347  	}
103348  	_sEnd = _pParse.XsLastToken
103349  	func() {
103350  		if int32(*elem1(_sEnd.Xz, 0)) == int32(0) {
103351  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101815), unsafe.Pointer(&_sqlite3CreateViewØ00__func__Ø000), unsafe.Pointer(str(119652)))
103352  			crt.X__builtin_abort(tls)
103353  		}
103354  	}()
103355  	if int32(*elem1(_sEnd.Xz, 0)) != int32(59) {
103356  		*(*uintptr)(unsafe.Pointer(&_sEnd.Xz)) += uintptr(_sEnd.Xn)
103357  	}
103358  	_sEnd.Xn = 0
103359  	_n = int32(int64(uintptr(unsafe.Pointer(_sEnd.Xz)) - uintptr(unsafe.Pointer(_pBegin.Xz))))
103360  	func() {
103361  		if _n <= int32(0) {
103362  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101821), unsafe.Pointer(&_sqlite3CreateViewØ00__func__Ø000), unsafe.Pointer(str(1376)))
103363  			crt.X__builtin_abort(tls)
103364  		}
103365  	}()
103366  	_z = _pBegin.Xz
103367  _10:
103368  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_z, uintptr(_n-int32(1))))))) & int32(1)) != 0 {
103369  		_n -= 1
103370  		goto _10
103371  	}
103372  	_sEnd.Xz = elem1(_z, uintptr(_n-int32(1)))
103373  	_sEnd.Xn = uint32(1)
103374  	_sqlite3EndTable(tls, _pParse, nil, &_sEnd, 0, nil)
103375  _create_view_fail:
103376  	_sqlite3SelectDelete(tls, _db, _pSelect)
103377  	_sqlite3ExprListDelete(tls, _db, _pCNames)
103378  }
103379  
103380  var _sqlite3CreateViewØ00__func__Ø000 [18]int8
103381  
103382  func init() {
103383  	crt.Xstrncpy(nil, &_sqlite3CreateViewØ00__func__Ø000[0], str(119665), 18)
103384  }
103385  
103386  func _parserDoubleLinkSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect) {
103387  	var _1_mxSelect, _1_cnt int32
103388  	var _1_pNext, _1_pLoop *XSelect
103389  	if _p.XpPrior == nil {
103390  		goto _0
103391  	}
103392  	_1_pNext = nil
103393  	_1_cnt = int32(0)
103394  	_1_pLoop = _p
103395  _1:
103396  	if _1_pLoop == nil {
103397  		goto _4
103398  	}
103399  	*(**XSelect)(unsafe.Pointer(&_1_pLoop.XpNext)) = _1_pNext
103400  	_1_pLoop.XselFlags |= uint32(256)
103401  	*func() *int32 {
103402  		*func() **XSelect { _1_pNext = _1_pLoop; return &_1_pLoop }() = (*XSelect)(_1_pLoop.XpPrior)
103403  		return &_1_cnt
103404  	}() += 1
103405  	goto _1
103406  _4:
103407  	if (((_p.XselFlags & uint32(1024)) == (0)) && (store2(&_1_mxSelect, *elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.Xdb).XaLimit))), uintptr(4))) > int32(0))) && (_1_cnt > _1_mxSelect) {
103408  		_sqlite3ErrorMsg(tls, _pParse, str(119683))
103409  	}
103410  _0:
103411  }
103412  
103413  var _yy_reduceØ00__func__Ø000 [10]int8
103414  
103415  func init() {
103416  	crt.Xstrncpy(nil, &_yy_reduceØ00__func__Ø000[0], str(119717), 10)
103417  }
103418  
103419  // C comment
103420  //  /*
103421  //  ** Set the ExprList.a[].zSpan element of the most recently added item
103422  //  ** on the expression list.
103423  //  **
103424  //  ** pList might be NULL following an OOM error.  But pSpan should never be
103425  //  ** NULL.  If a memory allocation fails, the pParse->db->mallocFailed flag
103426  //  ** is set.
103427  //  */
103428  func _sqlite3ExprListSetSpan(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pSpan *XExprSpan) {
103429  	var _db *Xsqlite3
103430  	var _1_pItem *TExprList_item
103431  	_db = (*Xsqlite3)(_pParse.Xdb)
103432  	func() {
103433  		if _pList == nil && int32(_db.XmallocFailed) == int32(0) {
103434  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92521), unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000), unsafe.Pointer(str(119727)))
103435  			crt.X__builtin_abort(tls)
103436  		}
103437  	}()
103438  	if _pList != nil {
103439  		_1_pItem = elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_pList.XnExpr-int32(1)))
103440  		func() {
103441  			if _pList.XnExpr <= int32(0) {
103442  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92524), unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000), unsafe.Pointer(str(21290)))
103443  				crt.X__builtin_abort(tls)
103444  			}
103445  		}()
103446  		func() {
103447  			if _db.XmallocFailed == 0 && (*XExpr)(_1_pItem.XpExpr) != (*XExpr)(_pSpan.XpExpr) {
103448  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92525), unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000), unsafe.Pointer(str(119759)))
103449  				crt.X__builtin_abort(tls)
103450  			}
103451  		}()
103452  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pItem.XzSpan))
103453  		_1_pItem.XzSpan = _sqlite3DbStrNDup(tls, _db, _pSpan.XzStart, uint64(int32(int64(uintptr(unsafe.Pointer(_pSpan.XzEnd))-uintptr(unsafe.Pointer(_pSpan.XzStart))))))
103454  	}
103455  }
103456  
103457  var _sqlite3ExprListSetSpanØ00__func__Ø000 [23]int8
103458  
103459  func init() {
103460  	crt.Xstrncpy(nil, &_sqlite3ExprListSetSpanØ00__func__Ø000[0], str(119806), 23)
103461  }
103462  
103463  // C comment
103464  //  /*
103465  //  ** When building up a FROM clause in the parser, the join operator
103466  //  ** is initially attached to the left operand.  But the code generator
103467  //  ** expects the join operator to be on the right operand.  This routine
103468  //  ** Shifts all join operators from left to right for an entire FROM
103469  //  ** clause.
103470  //  **
103471  //  ** Example: Suppose the join is like this:
103472  //  **
103473  //  **           A natural cross join B
103474  //  **
103475  //  ** The operator is "natural cross join".  The A and B operands are stored
103476  //  ** in p->a[0] and p->a[1], respectively.  The parser initially stores the
103477  //  ** operator with A.  This routine shifts that operator over to B.
103478  //  */
103479  func _sqlite3SrcListShiftJoinType(tls *crt.TLS, _p *XSrcList) {
103480  	var _1_i int32
103481  	if _p == nil {
103482  		goto _0
103483  	}
103484  	_1_i = _p.XnSrc - int32(1)
103485  _1:
103486  	if _1_i <= int32(0) {
103487  		goto _4
103488  	}
103489  	(elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_1_i)).Xfg).Xjointype = (elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_1_i-int32(1))).Xfg).Xjointype
103490  	_1_i -= 1
103491  	goto _1
103492  _4:
103493  	(elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), 0).Xfg).Xjointype = 0
103494  _0:
103495  }
103496  
103497  // C comment
103498  //  /*
103499  //  ** Add an INDEXED BY or NOT INDEXED clause to the most recently added
103500  //  ** element of the source-list passed as the second argument.
103501  //  */
103502  func _sqlite3SrcListIndexedBy(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pIndexedBy *XToken) {
103503  	var _1_pItem *TSrcList_item
103504  	func() {
103505  		if _pIndexedBy == nil {
103506  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103576), unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000), unsafe.Pointer(str(119829)))
103507  			crt.X__builtin_abort(tls)
103508  		}
103509  	}()
103510  	if _p == nil || func() int32 {
103511  		if _p.XnSrc > int32(0) {
103512  			return int32(1)
103513  		}
103514  		return func() int32 {
103515  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103577), unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000), unsafe.Pointer(str(4809)))
103516  			crt.X__builtin_abort(tls)
103517  			return int32(0)
103518  		}()
103519  	}() == 0 {
103520  		goto _5
103521  	}
103522  	_1_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnSrc-int32(1)))
103523  	func() {
103524  		if int32((uint32(_1_pItem.Xfg.XnotIndexed)<<31)>>31) != int32(0) {
103525  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103579), unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000), unsafe.Pointer(str(119843)))
103526  			crt.X__builtin_abort(tls)
103527  		}
103528  	}()
103529  	func() {
103530  		if int32((uint32((_1_pItem.Xfg.XnotIndexed)>>1)<<31)>>31) != int32(0) {
103531  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103580), unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000), unsafe.Pointer(str(119867)))
103532  			crt.X__builtin_abort(tls)
103533  		}
103534  	}()
103535  	func() {
103536  		if int32((uint32((_1_pItem.Xfg.XnotIndexed)>>2)<<31)>>31) != int32(0) {
103537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103581), unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000), unsafe.Pointer(str(119892)))
103538  			crt.X__builtin_abort(tls)
103539  		}
103540  	}()
103541  	if (_pIndexedBy.Xn == uint32(1)) && (_pIndexedBy.Xz == nil) {
103542  		storebits5(&(_1_pItem.Xfg.XnotIndexed), int8(1), 1, 0)
103543  		goto _14
103544  	}
103545  	*(**int8)(unsafe.Pointer(&_1_pItem.Xu1)) = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.Xdb), _pIndexedBy)
103546  	storebits5(&(_1_pItem.Xfg.XnotIndexed), int8(bool2int((*(**int8)(unsafe.Pointer(&_1_pItem.Xu1))) != nil)), 2, 1)
103547  _14:
103548  _5:
103549  }
103550  
103551  var _sqlite3SrcListIndexedByØ00__func__Ø000 [24]int8
103552  
103553  func init() {
103554  	crt.Xstrncpy(nil, &_sqlite3SrcListIndexedByØ00__func__Ø000[0], str(119915), 24)
103555  }
103556  
103557  // C comment
103558  //  /*
103559  //  ** Add the list of function arguments to the SrcList entry for a
103560  //  ** table-valued-function.
103561  //  */
103562  func _sqlite3SrcListFuncArgs(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pList *XExprList) {
103563  	var _1_pItem *TSrcList_item
103564  	if _p != nil {
103565  		_1_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnSrc-int32(1)))
103566  		func() {
103567  			if int32((uint32(_1_pItem.Xfg.XnotIndexed)<<31)>>31) != int32(0) {
103568  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103600), unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000), unsafe.Pointer(str(119843)))
103569  				crt.X__builtin_abort(tls)
103570  			}
103571  		}()
103572  		func() {
103573  			if int32((uint32((_1_pItem.Xfg.XnotIndexed)>>1)<<31)>>31) != int32(0) {
103574  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103601), unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000), unsafe.Pointer(str(119867)))
103575  				crt.X__builtin_abort(tls)
103576  			}
103577  		}()
103578  		func() {
103579  			if int32((uint32((_1_pItem.Xfg.XnotIndexed)>>2)<<31)>>31) != int32(0) {
103580  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103602), unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000), unsafe.Pointer(str(119892)))
103581  				crt.X__builtin_abort(tls)
103582  			}
103583  		}()
103584  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pItem.Xu1)))) = _pList
103585  		storebits5(&(_1_pItem.Xfg.XnotIndexed), int8(1), 4, 2)
103586  		goto _7
103587  	}
103588  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _pList)
103589  _7:
103590  }
103591  
103592  var _sqlite3SrcListFuncArgsØ00__func__Ø000 [23]int8
103593  
103594  func init() {
103595  	crt.Xstrncpy(nil, &_sqlite3SrcListFuncArgsØ00__func__Ø000[0], str(119939), 23)
103596  }
103597  
103598  // C comment
103599  //  /*
103600  //  ** Given 1 to 3 identifiers preceding the JOIN keyword, determine the
103601  //  ** type of join.  Return an integer constant that expresses that type
103602  //  ** in terms of the following bit values:
103603  //  **
103604  //  **     JT_INNER
103605  //  **     JT_CROSS
103606  //  **     JT_OUTER
103607  //  **     JT_NATURAL
103608  //  **     JT_LEFT
103609  //  **     JT_RIGHT
103610  //  **
103611  //  ** A full outer join is the combination of JT_LEFT and JT_RIGHT.
103612  //  **
103613  //  ** If an illegal or unsupported join type is seen, then still return
103614  //  ** a join type, but put an error in the pParse structure.
103615  //  */
103616  func _sqlite3JoinType(tls *crt.TLS, _pParse *XParse, _pA *XToken, _pB *XToken, _pC *XToken) (r0 int32) {
103617  	var _jointype, _i, _j int32
103618  	var _5_zSp *int8
103619  	var _p *XToken
103620  	var _apAll [3]*XToken
103621  	_jointype = int32(0)
103622  	*elem123((**XToken)(unsafe.Pointer(&_apAll)), 0) = _pA
103623  	*elem123((**XToken)(unsafe.Pointer(&_apAll)), uintptr(1)) = _pB
103624  	*elem123((**XToken)(unsafe.Pointer(&_apAll)), uintptr(2)) = _pC
103625  	_i = int32(0)
103626  _0:
103627  	if _i >= int32(3) || (*elem123((**XToken)(unsafe.Pointer(&_apAll)), uintptr(_i))) == nil {
103628  		goto _4
103629  	}
103630  	_p = *elem123((**XToken)(unsafe.Pointer(&_apAll)), uintptr(_i))
103631  	_j = int32(0)
103632  _5:
103633  	if _j >= int32(7) {
103634  		goto _8
103635  	}
103636  	if (_p.Xn == uint32(elem124((*t125)(unsafe.Pointer(&_sqlite3JoinTypeØ00aKeywordØ002)), uintptr(_j)).XnChar)) && (Xsqlite3_strnicmp(tls, _p.Xz, elem1((*int8)(unsafe.Pointer(&_sqlite3JoinTypeØ00zKeyTextØ001)), uintptr(elem124((*t125)(unsafe.Pointer(&_sqlite3JoinTypeØ00aKeywordØ002)), uintptr(_j)).Xi)), int32(_p.Xn)) == int32(0)) {
103637  		_jointype |= int32(elem124((*t125)(unsafe.Pointer(&_sqlite3JoinTypeØ00aKeywordØ002)), uintptr(_j)).Xcode)
103638  		goto _8
103639  	}
103640  	_j += 1
103641  	goto _5
103642  _8:
103643  	if _j >= int32(7) {
103644  		_jointype |= int32(64)
103645  		goto _4
103646  	}
103647  	_i += 1
103648  	goto _0
103649  _4:
103650  	if (_jointype&int32(33)) != int32(33) && (_jointype&int32(64)) == int32(0) {
103651  		goto _13
103652  	}
103653  	_5_zSp = str(119962)
103654  	func() {
103655  		if _pB == nil {
103656  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116764), unsafe.Pointer(&_sqlite3JoinTypeØ00__func__Ø000), unsafe.Pointer(str(119964)))
103657  			crt.X__builtin_abort(tls)
103658  		}
103659  	}()
103660  	if _pC == nil {
103661  		*(*uintptr)(unsafe.Pointer(&_5_zSp)) += uintptr(1)
103662  	}
103663  	_sqlite3ErrorMsg(tls, _pParse, str(119970), unsafe.Pointer(_pA), unsafe.Pointer(_pB), unsafe.Pointer(_5_zSp), unsafe.Pointer(_pC))
103664  	_jointype = int32(1)
103665  	goto _19
103666  _13:
103667  	if ((_jointype & int32(32)) != int32(0)) && ((_jointype & int32(24)) != int32(8)) {
103668  		_sqlite3ErrorMsg(tls, _pParse, str(120014))
103669  		_jointype = int32(1)
103670  	}
103671  _19:
103672  	return _jointype
103673  
103674  	_ = _apAll
103675  	panic(0)
103676  }
103677  
103678  var _sqlite3JoinTypeØ00aKeywordØ002 [7]t125
103679  
103680  func init() {
103681  	_sqlite3JoinTypeØ00aKeywordØ002 = [7]t125{t125{XnChar: uint8(7), Xcode: uint8(4)}, t125{Xi: uint8(6), XnChar: uint8(4), Xcode: uint8(40)}, t125{Xi: uint8(10), XnChar: uint8(5), Xcode: uint8(32)}, t125{Xi: uint8(14), XnChar: uint8(5), Xcode: uint8(48)}, t125{Xi: uint8(19), XnChar: uint8(4), Xcode: uint8(56)}, t125{Xi: uint8(23), XnChar: uint8(5), Xcode: uint8(1)}, t125{Xi: uint8(28), XnChar: uint8(5), Xcode: uint8(3)}}
103682  }
103683  
103684  var _sqlite3JoinTypeØ00zKeyTextØ001 [34]int8
103685  
103686  func init() {
103687  	crt.Xstrncpy(nil, &_sqlite3JoinTypeØ00zKeyTextØ001[0], str(120069), 34)
103688  }
103689  
103690  var _sqlite3JoinTypeØ00__func__Ø000 [16]int8
103691  
103692  func init() {
103693  	crt.Xstrncpy(nil, &_sqlite3JoinTypeØ00__func__Ø000[0], str(120103), 16)
103694  }
103695  
103696  // C comment
103697  //  /*
103698  //  ** pColumns and pExpr form a vector assignment which is part of the SET
103699  //  ** clause of an UPDATE statement.  Like this:
103700  //  **
103701  //  **        (a,b,c) = (expr1,expr2,expr3)
103702  //  ** Or:    (a,b,c) = (SELECT x,y,z FROM ....)
103703  //  **
103704  //  ** For each term of the vector assignment, append new entries to the
103705  //  ** expression list pList.  In the case of a subquery on the RHS, append
103706  //  ** TK_SELECT_COLUMN expressions.
103707  //  */
103708  func _sqlite3ExprListAppendVector(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pColumns *XIdList, _pExpr *XExpr) (r0 *XExprList) {
103709  	var _n, _i, _iFirst int32
103710  	var _db *Xsqlite3
103711  	var _2_pSubExpr, _4_pFirst *XExpr
103712  	_db = (*Xsqlite3)(_pParse.Xdb)
103713  	_iFirst = func() int32 {
103714  		if _pList != nil {
103715  			return _pList.XnExpr
103716  		}
103717  		return int32(0)
103718  	}()
103719  	if func() int32 {
103720  		if _pColumns == nil {
103721  			return func() int32 {
103722  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92423), unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000), unsafe.Pointer(str(4809)))
103723  				crt.X__builtin_abort(tls)
103724  				return int32(1)
103725  			}()
103726  		}
103727  		return int32(0)
103728  	}() != 0 {
103729  		goto _vector_append_error
103730  	}
103731  	if _pExpr == nil {
103732  		goto _vector_append_error
103733  	}
103734  	if (int32(_pExpr.Xop) != int32(119)) && (_pColumns.XnId != store2(&_n, _sqlite3ExprVectorSize(tls, _pExpr))) {
103735  		_sqlite3ErrorMsg(tls, _pParse, str(42926), _pColumns.XnId, _n)
103736  		goto _vector_append_error
103737  	}
103738  	_i = int32(0)
103739  _8:
103740  	if _i >= _pColumns.XnId {
103741  		goto _11
103742  	}
103743  	_2_pSubExpr = _sqlite3ExprForVectorField(tls, _pParse, _pExpr, _i)
103744  	_pList = _sqlite3ExprListAppend(tls, _pParse, _pList, _2_pSubExpr)
103745  	if _pList != nil {
103746  		func() {
103747  			if _pList.XnExpr != ((_iFirst + _i) + int32(1)) {
103748  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92441), unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000), unsafe.Pointer(str(120119)))
103749  				crt.X__builtin_abort(tls)
103750  			}
103751  		}()
103752  		elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_pList.XnExpr-int32(1))).XzName = elem44((*TIdList_item)(_pColumns.Xa), uintptr(_i)).XzName
103753  		elem44((*TIdList_item)(_pColumns.Xa), uintptr(_i)).XzName = nil
103754  	}
103755  	_i += 1
103756  	goto _8
103757  _11:
103758  	if ((_db.XmallocFailed == 0) && (int32(_pExpr.Xop) == int32(119))) && func() int32 {
103759  		if _pList != nil {
103760  			return int32(1)
103761  		}
103762  		return func() int32 {
103763  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92447), unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000), unsafe.Pointer(str(4809)))
103764  			crt.X__builtin_abort(tls)
103765  			return int32(0)
103766  		}()
103767  	}() != 0 {
103768  		_4_pFirst = (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_iFirst)).XpExpr)
103769  		func() {
103770  			if _4_pFirst == nil {
103771  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92449), unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000), unsafe.Pointer(str(120144)))
103772  				crt.X__builtin_abort(tls)
103773  			}
103774  		}()
103775  		func() {
103776  			if int32(_4_pFirst.Xop) != int32(159) {
103777  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92450), unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000), unsafe.Pointer(str(120154)))
103778  				crt.X__builtin_abort(tls)
103779  			}
103780  		}()
103781  		*(**XExpr)(unsafe.Pointer(&_4_pFirst.XpRight)) = _pExpr
103782  		_pExpr = nil
103783  		_4_pFirst.XiTable = _pColumns.XnId
103784  	}
103785  _vector_append_error:
103786  	_sqlite3ExprDelete(tls, _db, _pExpr)
103787  	_sqlite3IdListDelete(tls, _db, _pColumns)
103788  	return _pList
103789  }
103790  
103791  var _sqlite3ExprListAppendVectorØ00__func__Ø000 [28]int8
103792  
103793  func init() {
103794  	crt.Xstrncpy(nil, &_sqlite3ExprListAppendVectorØ00__func__Ø000[0], str(120183), 28)
103795  }
103796  
103797  // C comment
103798  //  /*
103799  //  ** Append a new element to the given IdList.  Create a new IdList if
103800  //  ** need be.
103801  //  **
103802  //  ** A new IdList is returned, or NULL if malloc() fails.
103803  //  */
103804  func _sqlite3IdListAppend(tls *crt.TLS, _db *Xsqlite3, _pList *XIdList, _pToken *XToken) (r0 *XIdList) {
103805  	var _i int32
103806  	if _pList != nil {
103807  		goto _0
103808  	}
103809  	_pList = (*XIdList)(_sqlite3DbMallocZero(tls, _db, uint64(16)))
103810  	if _pList == nil {
103811  		return nil
103812  	}
103813  _0:
103814  	*(**TIdList_item)(unsafe.Pointer(&_pList.Xa)) = (*TIdList_item)(_sqlite3ArrayAllocate(tls, _db, _pList.Xa, int32(16), &_pList.XnId, &_i))
103815  	if _i < int32(0) {
103816  		_sqlite3IdListDelete(tls, _db, _pList)
103817  		return nil
103818  	}
103819  	elem44((*TIdList_item)(_pList.Xa), uintptr(_i)).XzName = _sqlite3NameFromToken(tls, _db, _pToken)
103820  	return _pList
103821  }
103822  
103823  func _spanSet(tls *crt.TLS, _pOut *XExprSpan, _pStart *XToken, _pEnd *XToken) {
103824  	_pOut.XzStart = _pStart.Xz
103825  	_pOut.XzEnd = elem1(_pEnd.Xz, uintptr(_pEnd.Xn))
103826  }
103827  
103828  // C comment
103829  //  /*
103830  //  ** Assign a variable number to an expression that encodes a wildcard
103831  //  ** in the original SQL statement.
103832  //  **
103833  //  ** Wildcards consisting of a single "?" are assigned the next sequential
103834  //  ** variable number.
103835  //  **
103836  //  ** Wildcards of the form "?nnn" are assigned the number "nnn".  We make
103837  //  ** sure "nnn" is not too big to avoid a denial of service attack when
103838  //  ** the SQL statement comes from an external source.
103839  //  **
103840  //  ** Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number
103841  //  ** as the previous instance of the same wildcard.  Or if this is the first
103842  //  ** instance of the wildcard, the next sequential variable number is
103843  //  ** assigned.
103844  //  */
103845  func _sqlite3ExprAssignVarNumber(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _n uint32) {
103846  	var _x int16
103847  	var _2_doAdd, _3_bOk int32
103848  	var _3_i int64
103849  	var _z *int8
103850  	var _db *Xsqlite3
103851  	_db = (*Xsqlite3)(_pParse.Xdb)
103852  	if _pExpr == nil {
103853  		return
103854  	}
103855  	func() {
103856  		if (_pExpr.Xflags & uint32(25600)) != (0) {
103857  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91849), unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000), unsafe.Pointer(str(120211)))
103858  			crt.X__builtin_abort(tls)
103859  		}
103860  	}()
103861  	_z = *(**int8)(unsafe.Pointer(&_pExpr.Xu))
103862  	func() {
103863  		if _z == nil {
103864  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91851), unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000), unsafe.Pointer(str(44406)))
103865  			crt.X__builtin_abort(tls)
103866  		}
103867  	}()
103868  	func() {
103869  		if int32(*elem1(_z, 0)) == int32(0) {
103870  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91852), unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000), unsafe.Pointer(str(120272)))
103871  			crt.X__builtin_abort(tls)
103872  		}
103873  	}()
103874  	func() {
103875  		if _n != uint32(_sqlite3Strlen30(tls, _z)) {
103876  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91853), unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000), unsafe.Pointer(str(120280)))
103877  			crt.X__builtin_abort(tls)
103878  		}
103879  	}()
103880  	if int32(*elem1(_z, uintptr(1))) == int32(0) {
103881  		func() {
103882  			if int32(*elem1(_z, 0)) != int32(63) {
103883  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91856), unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000), unsafe.Pointer(str(120307)))
103884  				crt.X__builtin_abort(tls)
103885  			}
103886  		}()
103887  		_x = preInc26(&_pParse.XnVar, 1)
103888  		goto _12
103889  	}
103890  	_2_doAdd = int32(0)
103891  	if int32(*elem1(_z, 0)) != int32(63) {
103892  		goto _13
103893  	}
103894  	if _n == uint32(2) {
103895  		_3_i = int64(int32(*elem1(_z, uintptr(1))) - int32(48))
103896  		_3_bOk = int32(1)
103897  		goto _15
103898  	}
103899  	_3_bOk = bool2int(int32(0) == _sqlite3Atoi64(tls, elem1(_z, uintptr(1)), &_3_i, int32(_n-uint32(1)), uint8(1)))
103900  _15:
103901  	if ((_3_bOk == int32(0)) || (_3_i < int64(1))) || (_3_i > int64(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(9)))) {
103902  		_sqlite3ErrorMsg(tls, _pParse, str(120317), *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(9)))
103903  		return
103904  	}
103905  	_x = int16(_3_i)
103906  	if int32(_x) > int32(_pParse.XnVar) {
103907  		_pParse.XnVar = int16(int32(_x))
103908  		_2_doAdd = int32(1)
103909  		goto _21
103910  	}
103911  	if _sqlite3VListNumToName(tls, _pParse.XpVList, int32(_x)) == nil {
103912  		_2_doAdd = int32(1)
103913  	}
103914  _21:
103915  	goto _22
103916  _13:
103917  	_x = int16(_sqlite3VListNameToNum(tls, _pParse.XpVList, _z, int32(_n)))
103918  	if int32(_x) == int32(0) {
103919  		_x = preInc26(&_pParse.XnVar, 1)
103920  		_2_doAdd = int32(1)
103921  	}
103922  _22:
103923  	if _2_doAdd != 0 {
103924  		_pParse.XpVList = _sqlite3VListAdd(tls, _db, _pParse.XpVList, _z, int32(_n), int32(_x))
103925  	}
103926  _12:
103927  	_pExpr.XiColumn = _x
103928  	if int32(_x) > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(9))) {
103929  		_sqlite3ErrorMsg(tls, _pParse, str(120360))
103930  	}
103931  }
103932  
103933  var _sqlite3ExprAssignVarNumberØ00__func__Ø000 [27]int8
103934  
103935  func init() {
103936  	crt.Xstrncpy(nil, &_sqlite3ExprAssignVarNumberØ00__func__Ø000[0], str(120383), 27)
103937  }
103938  
103939  // C comment
103940  //  /*
103941  //  ** Add a new name/number pair to a VList.  This might require that the
103942  //  ** VList object be reallocated, so return the new VList.  If an OOM
103943  //  ** error occurs, the original VList returned and the
103944  //  ** db->mallocFailed flag is set.
103945  //  **
103946  //  ** A VList is really just an array of integers.  To destroy a VList,
103947  //  ** simply pass it to sqlite3DbFree().
103948  //  **
103949  //  ** The first integer is the number of integers allocated for the whole
103950  //  ** VList.  The second integer is the number of integers actually used.
103951  //  ** Each name/number pair is encoded by subsequent groups of 3 or more
103952  //  ** integers.
103953  //  **
103954  //  ** Each name/number pair starts with two integers which are the numeric
103955  //  ** value for the pair and the size of the name/number pair, respectively.
103956  //  ** The text name overlays one or more following integers.  The text name
103957  //  ** is always zero-terminated.
103958  //  **
103959  //  ** Conceptually:
103960  //  **
103961  //  **    struct VList {
103962  //  **      int nAlloc;   // Number of allocated slots
103963  //  **      int nUsed;    // Number of used slots
103964  //  **      struct VListEntry {
103965  //  **        int iValue;    // Value for this entry
103966  //  **        int nSlot;     // Slots used by this entry
103967  //  **        // ... variable name goes here
103968  //  **      } a[0];
103969  //  **    }
103970  //  **
103971  //  ** During code generation, pointers to the variable names within the
103972  //  ** VList are taken.  When that happens, nAlloc is set to zero as an
103973  //  ** indication that the VList may never again be enlarged, since the
103974  //  ** accompanying realloc() would invalidate the pointers.
103975  //  */
103976  func _sqlite3VListAdd(tls *crt.TLS, _db *Xsqlite3, _pIn *int32, _zName *int8, _nName int32, _iVal int32) (r0 *int32) {
103977  	var _nInt, _i, _1_nAlloc int32
103978  	var _1_pOut *int32
103979  	var _z *int8
103980  	_nInt = (_nName / int32(4)) + int32(3)
103981  	func() {
103982  		if _pIn != nil && (*elem8(_pIn, 0)) < int32(3) {
103983  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29170), unsafe.Pointer(&_sqlite3VListAddØ00__func__Ø000), unsafe.Pointer(str(120410)))
103984  			crt.X__builtin_abort(tls)
103985  		}
103986  	}()
103987  	if _pIn != nil && ((*elem8(_pIn, uintptr(1)))+_nInt) <= (*elem8(_pIn, 0)) {
103988  		goto _4
103989  	}
103990  	_1_nAlloc = func() int32 {
103991  		if _pIn != nil {
103992  			return ((*elem8(_pIn, 0)) * int32(2))
103993  		}
103994  		return int32(10)
103995  	}() + _nInt
103996  	_1_pOut = (*int32)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pIn), uint64(_1_nAlloc)*uint64(4)))
103997  	if _1_pOut == nil {
103998  		return _pIn
103999  	}
104000  	if _pIn == nil {
104001  		*elem8(_1_pOut, uintptr(1)) = int32(2)
104002  	}
104003  	_pIn = _1_pOut
104004  	*elem8(_pIn, 0) = _1_nAlloc
104005  _4:
104006  	_i = *elem8(_pIn, uintptr(1))
104007  	*elem8(_pIn, uintptr(_i)) = _iVal
104008  	*elem8(_pIn, uintptr(_i+int32(1))) = _nInt
104009  	_z = (*int8)(unsafe.Pointer(elem8(_pIn, uintptr(_i+int32(2)))))
104010  	*elem8(_pIn, uintptr(1)) = _i + _nInt
104011  	func() {
104012  		if (*elem8(_pIn, uintptr(1))) > (*elem8(_pIn, 0)) {
104013  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29185), unsafe.Pointer(&_sqlite3VListAddØ00__func__Ø000), unsafe.Pointer(str(120430)))
104014  			crt.X__builtin_abort(tls)
104015  		}
104016  	}()
104017  	crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(_zName), uint64(_nName))
104018  	*elem1(_z, uintptr(_nName)) = 0
104019  	return _pIn
104020  }
104021  
104022  var _sqlite3VListAddØ00__func__Ø000 [16]int8
104023  
104024  func init() {
104025  	crt.Xstrncpy(nil, &_sqlite3VListAddØ00__func__Ø000[0], str(120445), 16)
104026  }
104027  
104028  // C comment
104029  //  /*
104030  //  ** Construct a new expression node for a function with multiple
104031  //  ** arguments.
104032  //  */
104033  func _sqlite3ExprFunction(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pToken *XToken) (r0 *XExpr) {
104034  	var _db *Xsqlite3
104035  	var _pNew *XExpr
104036  	_db = (*Xsqlite3)(_pParse.Xdb)
104037  	func() {
104038  		if _pToken == nil {
104039  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91815), unsafe.Pointer(&_sqlite3ExprFunctionØ00__func__Ø000), unsafe.Pointer(str(120461)))
104040  			crt.X__builtin_abort(tls)
104041  		}
104042  	}()
104043  	_pNew = _sqlite3ExprAlloc(tls, _db, int32(151), _pToken, int32(1))
104044  	if _pNew == nil {
104045  		_sqlite3ExprListDelete(tls, _db, _pList)
104046  		return nil
104047  	}
104048  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.Xx)))) = _pList
104049  	func() {
104050  		if (_pNew.Xflags & uint32(2048)) != (0) {
104051  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91822), unsafe.Pointer(&_sqlite3ExprFunctionØ00__func__Ø000), unsafe.Pointer(str(103903)))
104052  			crt.X__builtin_abort(tls)
104053  		}
104054  	}()
104055  	_sqlite3ExprSetHeightAndFlags(tls, _pParse, _pNew)
104056  	return _pNew
104057  }
104058  
104059  var _sqlite3ExprFunctionØ00__func__Ø000 [20]int8
104060  
104061  func init() {
104062  	crt.Xstrncpy(nil, &_sqlite3ExprFunctionØ00__func__Ø000[0], str(120468), 20)
104063  }
104064  
104065  // C comment
104066  //  /*
104067  //  ** Set the Expr.nHeight variable using the exprSetHeight() function. If
104068  //  ** the height is greater than the maximum allowed expression depth,
104069  //  ** leave an error in pParse.
104070  //  **
104071  //  ** Also propagate all EP_Propagate flags from the Expr.x.pList into
104072  //  ** Expr.flags.
104073  //  */
104074  func _sqlite3ExprSetHeightAndFlags(tls *crt.TLS, _pParse *XParse, _p *XExpr) {
104075  	if _pParse.XnErr != 0 {
104076  		return
104077  	}
104078  	_exprSetHeight(tls, _p)
104079  	_sqlite3ExprCheckHeight(tls, _pParse, _p.XnHeight)
104080  }
104081  
104082  func _spanBinaryExpr(tls *crt.TLS, _pParse *XParse, _op int32, _pLeft *XExprSpan, _pRight *XExprSpan) {
104083  	*(**XExpr)(unsafe.Pointer(&_pLeft.XpExpr)) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pLeft.XpExpr), (*XExpr)(_pRight.XpExpr))
104084  	_pLeft.XzEnd = _pRight.XzEnd
104085  }
104086  
104087  func _exprNot(tls *crt.TLS, _pParse *XParse, _doNot int32, _pSpan *XExprSpan) {
104088  	if _doNot != 0 {
104089  		*(**XExpr)(unsafe.Pointer(&_pSpan.XpExpr)) = _sqlite3PExpr(tls, _pParse, int32(19), (*XExpr)(_pSpan.XpExpr), nil)
104090  	}
104091  }
104092  
104093  func _spanUnaryPostfix(tls *crt.TLS, _pParse *XParse, _op int32, _pOperand *XExprSpan, _pPostOp *XToken) {
104094  	*(**XExpr)(unsafe.Pointer(&_pOperand.XpExpr)) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pOperand.XpExpr), nil)
104095  	_pOperand.XzEnd = elem1(_pPostOp.Xz, uintptr(_pPostOp.Xn))
104096  }
104097  
104098  func _binaryToUnaryIfNull(tls *crt.TLS, _pParse *XParse, _pY *XExpr, _pA *XExpr, _op int32) {
104099  	var _db *Xsqlite3
104100  	_db = (*Xsqlite3)(_pParse.Xdb)
104101  	if ((_pA != nil) && (_pY != nil)) && (int32(_pY.Xop) == int32(101)) {
104102  		_pA.Xop = uint8(_op)
104103  		_sqlite3ExprDelete(tls, _db, (*XExpr)(_pA.XpRight))
104104  		*(**XExpr)(unsafe.Pointer(&_pA.XpRight)) = nil
104105  	}
104106  }
104107  
104108  func _spanUnaryPrefix(tls *crt.TLS, _pOut *XExprSpan, _pParse *XParse, _op int32, _pOperand *XExprSpan, _pPreOp *XToken) {
104109  	_pOut.XzStart = _pPreOp.Xz
104110  	*(**XExpr)(unsafe.Pointer(&_pOut.XpExpr)) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pOperand.XpExpr), nil)
104111  	_pOut.XzEnd = _pOperand.XzEnd
104112  }
104113  
104114  // C comment
104115  //  /*
104116  //  ** Add pSelect to the Expr.x.pSelect field.  Or, if pExpr is NULL (due
104117  //  ** do a memory allocation failure) then delete the pSelect object.
104118  //  */
104119  func _sqlite3PExprAddSelect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pSelect *XSelect) {
104120  	if _pExpr != nil {
104121  		*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))) = _pSelect
104122  		_pExpr.Xflags |= uint32(2099200)
104123  		_sqlite3ExprSetHeightAndFlags(tls, _pParse, _pExpr)
104124  		goto _1
104125  	}
104126  	func() {
104127  		if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
104128  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91751), unsafe.Pointer(&_sqlite3PExprAddSelectØ00__func__Ø000), unsafe.Pointer(str(42441)))
104129  			crt.X__builtin_abort(tls)
104130  		}
104131  	}()
104132  	_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.Xdb), _pSelect)
104133  _1:
104134  }
104135  
104136  var _sqlite3PExprAddSelectØ00__func__Ø000 [22]int8
104137  
104138  func init() {
104139  	crt.Xstrncpy(nil, &_sqlite3PExprAddSelectØ00__func__Ø000[0], str(120488), 22)
104140  }
104141  
104142  func _parserAddExprIdListTerm(tls *crt.TLS, _pParse *XParse, _pPrior *XExprList, _pIdToken *XToken, _hasCollate int32, _sortOrder int32) (r0 *XExprList) {
104143  	var _p *XExprList
104144  	_p = _sqlite3ExprListAppend(tls, _pParse, _pPrior, nil)
104145  	if (_hasCollate != 0 || (_sortOrder != int32(-1))) && (int32(((*Xsqlite3)(_pParse.Xdb).Xinit).Xbusy) == int32(0)) {
104146  		_sqlite3ErrorMsg(tls, _pParse, str(120510), _pIdToken.Xn, unsafe.Pointer(_pIdToken.Xz))
104147  	}
104148  	_sqlite3ExprListSetName(tls, _pParse, _p, _pIdToken, int32(1))
104149  	return _p
104150  }
104151  
104152  // C comment
104153  //  /*
104154  //  ** This routine will drop an existing named index.  This routine
104155  //  ** implements the DROP INDEX statement.
104156  //  */
104157  func _sqlite3DropIndex(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _ifExists int32) {
104158  	var _iDb, _7_code int32
104159  	var _7_zDb, _7_zTab *int8
104160  	var _db *Xsqlite3
104161  	var _7_pTab *XTable
104162  	var _v *TVdbe
104163  	var _pIndex *XIndex
104164  	_db = (*Xsqlite3)(_pParse.Xdb)
104165  	func() {
104166  		if _pParse.XnErr != int32(0) {
104167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103185), unsafe.Pointer(&_sqlite3DropIndexØ00__func__Ø000), unsafe.Pointer(str(112394)))
104168  			crt.X__builtin_abort(tls)
104169  		}
104170  	}()
104171  	if _db.XmallocFailed != 0 {
104172  		goto _exit_drop_index
104173  	}
104174  	func() {
104175  		if _pName.XnSrc != int32(1) {
104176  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103189), unsafe.Pointer(&_sqlite3DropIndexØ00__func__Ø000), unsafe.Pointer(str(114819)))
104177  			crt.X__builtin_abort(tls)
104178  		}
104179  	}()
104180  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
104181  		goto _exit_drop_index
104182  	}
104183  	_pIndex = _sqlite3FindIndex(tls, _db, elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzName, elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzDatabase)
104184  	if _pIndex != nil {
104185  		goto _6
104186  	}
104187  	if _ifExists == 0 {
104188  		_sqlite3ErrorMsg(tls, _pParse, str(120548), unsafe.Pointer(_pName), int32(0))
104189  		goto _8
104190  	}
104191  	_sqlite3CodeVerifyNamedSchema(tls, _pParse, elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzDatabase)
104192  _8:
104193  	_pParse.XcheckSchema = uint8(1)
104194  	goto _exit_drop_index
104195  _6:
104196  	if int32((uint32(_pIndex.XidxType)<<30)>>30) != int32(0) {
104197  		_sqlite3ErrorMsg(tls, _pParse, str(120566), int32(0))
104198  		goto _exit_drop_index
104199  	}
104200  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pIndex.XpSchema))
104201  	_7_code = int32(10)
104202  	_7_pTab = (*XTable)(_pIndex.XpTable)
104203  	_7_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
104204  	_7_zTab = func() *int8 {
104205  		if int32(1) != 0 && (_iDb == int32(1)) {
104206  			return str(49962)
104207  		}
104208  		return str(49981)
104209  	}()
104210  	if _sqlite3AuthCheck(tls, _pParse, int32(9), _7_zTab, nil, _7_zDb) != 0 {
104211  		goto _exit_drop_index
104212  	}
104213  	if int32(1) != 0 && _iDb != 0 {
104214  		_7_code = int32(12)
104215  	}
104216  	if _sqlite3AuthCheck(tls, _pParse, _7_code, _pIndex.XzName, _7_pTab.XzName, _7_zDb) != 0 {
104217  		goto _exit_drop_index
104218  	}
104219  	_v = _sqlite3GetVdbe(tls, _pParse)
104220  	if _v != nil {
104221  		_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
104222  		_sqlite3NestedParse(tls, _pParse, str(120639), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(str(49981)), unsafe.Pointer(_pIndex.XzName))
104223  		_sqlite3ClearStatTables(tls, _pParse, _iDb, str(93743), _pIndex.XzName)
104224  		_sqlite3ChangeCookie(tls, _pParse, _iDb)
104225  		_destroyRootPage(tls, _pParse, _pIndex.Xtnum, _iDb)
104226  		_sqlite3VdbeAddOp4(tls, _v, int32(142), _iDb, int32(0), int32(0), _pIndex.XzName, int32(0))
104227  	}
104228  _exit_drop_index:
104229  	_sqlite3SrcListDelete(tls, _db, _pName)
104230  }
104231  
104232  var _sqlite3DropIndexØ00__func__Ø000 [17]int8
104233  
104234  func init() {
104235  	crt.Xstrncpy(nil, &_sqlite3DropIndexØ00__func__Ø000[0], str(120688), 17)
104236  }
104237  
104238  // C comment
104239  //  /*
104240  //  ** The VACUUM command is used to clean up the database,
104241  //  ** collapse free space, etc.  It is modelled after the VACUUM command
104242  //  ** in PostgreSQL.  The VACUUM command works as follows:
104243  //  **
104244  //  **   (1)  Create a new transient database file
104245  //  **   (2)  Copy all content from the database being vacuumed into
104246  //  **        the new transient database file
104247  //  **   (3)  Copy content from the transient database back into the
104248  //  **        original database.
104249  //  **
104250  //  ** The transient database requires temporary disk space approximately
104251  //  ** equal to the size of the original database.  The copy operation of
104252  //  ** step (3) requires additional temporary disk space approximately equal
104253  //  ** to the size of the original database for the rollback journal.
104254  //  ** Hence, temporary disk space that is approximately 2x the size of the
104255  //  ** original database is required.  Every page of the database is written
104256  //  ** approximately 3 times:  Once for step (2) and twice for step (3).
104257  //  ** Two writes per page are required in step (3) because the original
104258  //  ** database content must be written into the rollback journal prior to
104259  //  ** overwriting the database with the vacuumed content.
104260  //  **
104261  //  ** Only 1x temporary space and only 1x writes would be required if
104262  //  ** the copy of step (3) were replaced by deleting the original database
104263  //  ** and renaming the transient database as the original.  But that will
104264  //  ** not work if other processes are attached to the original database.
104265  //  ** And a power loss in between deleting the original and renaming the
104266  //  ** transient would cause the database file to appear to be deleted
104267  //  ** following reboot.
104268  //  */
104269  func _sqlite3Vacuum(tls *crt.TLS, _pParse *XParse, _pNm *XToken) {
104270  	var _iDb int32
104271  	var _v *TVdbe
104272  	_v = _sqlite3GetVdbe(tls, _pParse)
104273  	_iDb = int32(0)
104274  	if _v == nil {
104275  		return
104276  	}
104277  	if _pNm == nil {
104278  		goto _1
104279  	}
104280  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pNm, _pNm, &_pNm)
104281  	if _iDb < int32(0) {
104282  		return
104283  	}
104284  _1:
104285  	if _iDb != int32(1) {
104286  		_sqlite3VdbeAddOp1(tls, _v, int32(10), _iDb)
104287  		_sqlite3VdbeUsesBtree(tls, _v, _iDb)
104288  	}
104289  }
104290  
104291  // C comment
104292  //  /*
104293  //  ** Process a pragma statement.
104294  //  **
104295  //  ** Pragmas are of this form:
104296  //  **
104297  //  **      PRAGMA [schema.]id [= value]
104298  //  **
104299  //  ** The identifier might also be a string.  The value is a string, and
104300  //  ** identifier, or a number.  If minusFlag is true, then the value is
104301  //  ** a number that was preceded by a minus sign.
104302  //  **
104303  //  ** If the left side is "database.id" then pId1 is the database name
104304  //  ** and pId2 is the id.  If the left side is just "id" then pId1 is the
104305  //  ** id and pId2 is any empty string.
104306  //  */
104307  func _sqlite3Pragma(tls *crt.TLS, _pParse *XParse, _pId1 *XToken, _pId2 *XToken, _pValue *XToken, _minusFlag int32) {
104308  	var _99_cnum, _177_szThreshold int16
104309  	var _iDb, _rc, _13_size, _15_size, _18_b, _20_ii, _22_iReg, _25_eMode, _28_ii, _31_eMode, _31_ii, _33_n, _43_eAuto, _44_iAddr, _45_iLimit, _45_addr, _49_size, _52_size, _57_ii, _68_res, _77_iLevel, _80_mask, _85_i, _85_k, _85_nHidden, _96_i, _96_mx, _101_i, _104_i, _106_i, _110_i, _111_j, _113_i, _113_j, _113_x, _113_regResult, _113_regKey, _113_regRow, _113_addrTop, _113_addrOk, _124_iCol, _126_jmp, _135_i, _135_j, _135_addr, _135_mxErr, _135_isQuick, _138_cnt, _138_mxIdx, _138_nIdx, _143_loopTop, _143_iDataCur, _143_iIdxCur, _143_r1, _146_jmp2, _148_addrCkFault, _148_addrCkOk, _148_k, _150_jmp2, _150_jmp3, _150_jmp4, _150_jmp5, _150_ckUniq, _151_uniqOk, _151_jmp6, _151_kk, _152_iCol, _164_iCookie, _167_i, _169_iBt, _169_eMode, _177_iDbLast, _177_iTabCur, _185_r1, _193_i, _194_j int32
104310  	var _39_iLimit, _56_sz, _189_N, _191_N int64
104311  	var _177_opMask uint32
104312  	var _113_aiCols, _138_aRoot *int32
104313  	var _zLeft, _zRight, _zDb, _25_zRet, _33_zMode, _146_zErr, _148_zErr, _167_zOpt, _177_zSubSql, _194_zState *int8
104314  	var _db *Xsqlite3
104315  	var _14_pBt, _18_pBt, _41_pBt, _194_pBt *XBtree
104316  	var _pDb *XDb
104317  	var _27_pPager, _39_pPager *XPager
104318  	var _177_pSchema *XSchema
104319  	var _92_i, _106_p, _113_k, _138_x, _177_k *XHashElem
104320  	var _138_pTbls *XHash
104321  	var _84_pTab, _93_pTab, _95_pTab, _101_pTab, _108_pTab, _113_pTab, _113_pParent, _139_pTab, _141_pTab, _143_pTab, _177_pTab *XTable
104322  	var _v *TVdbe
104323  	var _pId *XToken
104324  	var _147_pCheck *XExprList
104325  	var _85_pCol *XColumn
104326  	var _85_pPk, _92_pIdx, _95_pIdx, _101_pIdx, _113_pIdx, _139_pIdx, _141_pIdx, _143_pIdx, _143_pPk, _143_pPrior, _177_pIdx *XIndex
104327  	var _11_aOp, _44_aOp, _155_aOp, _165_aOp, _166_aOp *XVdbeOp
104328  	var _107_pColl *XCollSeq
104329  	var _aFcntl [4]*int8
104330  	var _108_pFK, _113_pFK *XFKey
104331  	var _103_azOrigin [3]*int8
104332  	var _pPragma *XPragmaName
104333  	var _157_pEnc *TEncName
104334  	_zLeft = nil
104335  	_zRight = nil
104336  	_zDb = nil
104337  	_db = (*Xsqlite3)(_pParse.Xdb)
104338  	_v = _sqlite3GetVdbe(tls, _pParse)
104339  	if _v == nil {
104340  		return
104341  	}
104342  	_sqlite3VdbeRunOnlyOnce(tls, _v)
104343  	_pParse.XnMem = int32(2)
104344  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pId1, _pId2, &_pId)
104345  	if _iDb < int32(0) {
104346  		return
104347  	}
104348  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
104349  	if (_iDb == int32(1)) && _sqlite3OpenTempDatabase(tls, _pParse) != 0 {
104350  		return
104351  	}
104352  	_zLeft = _sqlite3NameFromToken(tls, _db, _pId)
104353  	if _zLeft == nil {
104354  		return
104355  	}
104356  	if _minusFlag != 0 {
104357  		_zRight = _sqlite3MPrintf(tls, _db, str(120705), unsafe.Pointer(_pValue))
104358  		goto _6
104359  	}
104360  	_zRight = _sqlite3NameFromToken(tls, _db, _pValue)
104361  _6:
104362  	func() {
104363  		if _pId2 == nil {
104364  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113600), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120709)))
104365  			crt.X__builtin_abort(tls)
104366  		}
104367  	}()
104368  	_zDb = func() *int8 {
104369  		if _pId2.Xn > (0) {
104370  			return _pDb.XzDbSName
104371  		}
104372  		return nil
104373  	}()
104374  	if _sqlite3AuthCheck(tls, _pParse, int32(19), _zLeft, _zRight, _zDb) != 0 {
104375  		goto _pragma_out
104376  	}
104377  	*elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0) = nil
104378  	*elem0((**int8)(unsafe.Pointer(&_aFcntl)), uintptr(1)) = _zLeft
104379  	*elem0((**int8)(unsafe.Pointer(&_aFcntl)), uintptr(2)) = _zRight
104380  	*elem0((**int8)(unsafe.Pointer(&_aFcntl)), uintptr(3)) = nil
104381  	_db.XbusyHandler.XnBusy = int32(0)
104382  	_rc = Xsqlite3_file_control(tls, _db, _zDb, int32(14), unsafe.Pointer(&_aFcntl))
104383  	if _rc == int32(0) {
104384  		_sqlite3VdbeSetNumCols(tls, _v, int32(1))
104385  		_sqlite3VdbeSetColName(tls, _v, int32(0), int32(0), *elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0), func() func(*crt.TLS, unsafe.Pointer) {
104386  			v := uint64(18446744073709551615)
104387  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
104388  		}())
104389  		_returnSingleText(tls, _v, *elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0))
104390  		Xsqlite3_free(tls, unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0)))
104391  		goto _pragma_out
104392  	}
104393  	if _rc == int32(12) {
104394  		goto _13
104395  	}
104396  	if (*elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0)) != nil {
104397  		_sqlite3ErrorMsg(tls, _pParse, str(24531), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0)))
104398  		Xsqlite3_free(tls, unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0)))
104399  	}
104400  	_pParse.XnErr += 1
104401  	_pParse.Xrc = _rc
104402  	goto _pragma_out
104403  _13:
104404  	_pPragma = _pragmaLocate(tls, _zLeft)
104405  	if _pPragma == nil {
104406  		goto _pragma_out
104407  	}
104408  	if (int32(_pPragma.XmPragFlg) & int32(1)) == int32(0) {
104409  		goto _16
104410  	}
104411  	if _sqlite3ReadSchema(tls, _pParse) != 0 {
104412  		goto _pragma_out
104413  	}
104414  _16:
104415  	if ((int32(_pPragma.XmPragFlg) & int32(2)) == int32(0)) && (((int32(_pPragma.XmPragFlg) & int32(4)) == int32(0)) || (_zRight == nil)) {
104416  		_setPragmaResultColumnNames(tls, _v, _pPragma)
104417  	}
104418  	switch int32(_pPragma.XePragTyp) {
104419  	case int32(0):
104420  		goto _50
104421  	case int32(1):
104422  		goto _29
104423  	case int32(2):
104424  		goto _37
104425  	case int32(4):
104426  		goto _31
104427  	case int32(5):
104428  		goto _32
104429  	case int32(6):
104430  		goto _47
104431  	case int32(7):
104432  		goto _43
104433  	case int32(8):
104434  		goto _51
104435  	case int32(10):
104436  		goto _42
104437  	case int32(11):
104438  		goto _22
104439  	case int32(12):
104440  		goto _49
104441  	case int32(13):
104442  		goto _45
104443  	case int32(14):
104444  		goto _44
104445  	case int32(15):
104446  		goto _30
104447  	case int32(16):
104448  		goto _40
104449  	case int32(17):
104450  		goto _41
104451  	case int32(18):
104452  		goto _48
104453  	case int32(19):
104454  		goto _27
104455  	case int32(20):
104456  		goto _28
104457  	case int32(22):
104458  		goto _26
104459  	case int32(23):
104460  		goto _25
104461  	case int32(24):
104462  		goto _33
104463  	case int32(25):
104464  		goto _55
104465  	case int32(26):
104466  		goto _23
104467  	case int32(27):
104468  		goto _24
104469  	case int32(28):
104470  		goto _54
104471  	case int32(29):
104472  		goto _57
104473  	case int32(30):
104474  		goto _36
104475  	case int32(31):
104476  		goto _38
104477  	case int32(32):
104478  		goto _34
104479  	case int32(33):
104480  		goto _35
104481  	case int32(34):
104482  		goto _58
104483  	case int32(35):
104484  		goto _53
104485  	case int32(36):
104486  		goto _52
104487  	case int32(41):
104488  		goto _59
104489  	case int32(42):
104490  		goto _46
104491  	case int32(43):
104492  		goto _39
104493  	default:
104494  		goto _56
104495  	}
104496  
104497  _22:
104498  	_sqlite3VdbeUsesBtree(tls, _v, _iDb)
104499  	if _zRight != nil {
104500  		goto _60
104501  	}
104502  	_pParse.XnMem += int32(2)
104503  	_sqlite3VdbeVerifyNoMallocRequired(tls, _v, int32(9))
104504  	_11_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(9), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00getCacheSizeØ002)), _sqlite3PragmaØ00iLnØ001)
104505  	if func() int32 {
104506  		if _11_aOp == nil {
104507  			return func() int32 {
104508  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113699), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(4809)))
104509  				crt.X__builtin_abort(tls)
104510  				return int32(1)
104511  			}()
104512  		}
104513  		return int32(0)
104514  	}() != 0 {
104515  		goto _64
104516  	}
104517  	elem63(_11_aOp, 0).Xp1 = _iDb
104518  	elem63(_11_aOp, uintptr(1)).Xp1 = _iDb
104519  	elem63(_11_aOp, uintptr(6)).Xp1 = int32(-2000)
104520  	goto _65
104521  _60:
104522  	_13_size = _sqlite3AbsInt32(tls, _sqlite3Atoi(tls, _zRight))
104523  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
104524  	_sqlite3VdbeAddOp3(tls, _v, int32(104), _iDb, int32(3), _13_size)
104525  	func() {
104526  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
104527  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113707), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(51126)))
104528  			crt.X__builtin_abort(tls)
104529  		}
104530  	}()
104531  	(*XSchema)(_pDb.XpSchema).Xcache_size = _13_size
104532  	_sqlite3BtreeSetCacheSize(tls, (*XBtree)(_pDb.XpBt), (*XSchema)(_pDb.XpSchema).Xcache_size)
104533  _65:
104534  	goto _64
104535  _23:
104536  	_14_pBt = (*XBtree)(_pDb.XpBt)
104537  	func() {
104538  		if _14_pBt == nil {
104539  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113727), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120714)))
104540  			crt.X__builtin_abort(tls)
104541  		}
104542  	}()
104543  	if _zRight == nil {
104544  		_15_size = func() int32 {
104545  			if func() int32 {
104546  				if _14_pBt != nil {
104547  					return int32(1)
104548  				}
104549  				return func() int32 {
104550  					crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113729), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(4809)))
104551  					crt.X__builtin_abort(tls)
104552  					return int32(0)
104553  				}()
104554  			}() != 0 {
104555  				return _sqlite3BtreeGetPageSize(tls, _14_pBt)
104556  			}
104557  			return int32(0)
104558  		}()
104559  		_returnSingleInt(tls, _v, int64(_15_size))
104560  		goto _75
104561  	}
104562  	_db.XnextPagesize = _sqlite3Atoi(tls, _zRight)
104563  	if int32(7) == _sqlite3BtreeSetPageSize(tls, _14_pBt, _db.XnextPagesize, int32(-1), int32(0)) {
104564  		_sqlite3OomFault(tls, _db)
104565  	}
104566  _75:
104567  	goto _64
104568  _24:
104569  	_18_pBt = (*XBtree)(_pDb.XpBt)
104570  	_18_b = int32(-1)
104571  	func() {
104572  		if _18_pBt == nil {
104573  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113754), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120714)))
104574  			crt.X__builtin_abort(tls)
104575  		}
104576  	}()
104577  	if _zRight != nil {
104578  		_18_b = int32(_sqlite3GetBoolean(tls, _zRight, 0))
104579  	}
104580  	if _pId2.Xn != (0) || _18_b < int32(0) {
104581  		goto _81
104582  	}
104583  	_20_ii = int32(0)
104584  _82:
104585  	if _20_ii >= _db.XnDb {
104586  		goto _85
104587  	}
104588  	_sqlite3BtreeSecureDelete(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_20_ii)).XpBt), _18_b)
104589  	_20_ii += 1
104590  	goto _82
104591  _85:
104592  _81:
104593  	_18_b = _sqlite3BtreeSecureDelete(tls, _18_pBt, _18_b)
104594  	_returnSingleInt(tls, _v, int64(_18_b))
104595  	goto _64
104596  _25:
104597  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
104598  	_22_iReg = preInc2(&_pParse.XnMem, 1)
104599  	if int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_zLeft, 0))))) == int32(112) {
104600  		_sqlite3VdbeAddOp2(tls, _v, int32(161), _iDb, _22_iReg)
104601  		goto _87
104602  	}
104603  	_sqlite3VdbeAddOp3(tls, _v, int32(162), _iDb, _22_iReg, _sqlite3AbsInt32(tls, _sqlite3Atoi(tls, _zRight)))
104604  _87:
104605  	_sqlite3VdbeAddOp2(tls, _v, int32(67), _22_iReg, int32(1))
104606  	goto _64
104607  _26:
104608  	_25_zRet = str(89670)
104609  	_25_eMode = _getLockingMode(tls, _zRight)
104610  	if (_pId2.Xn == (0)) && (_25_eMode == int32(-1)) {
104611  		_25_eMode = int32(_db.XdfltLockMode)
104612  		goto _90
104613  	}
104614  	if _pId2.Xn != (0) {
104615  		goto _91
104616  	}
104617  	func() {
104618  		if _pDb != elem27((*XDb)(_db.XaDb), 0) {
104619  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113826), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120721)))
104620  			crt.X__builtin_abort(tls)
104621  		}
104622  	}()
104623  	_28_ii = int32(2)
104624  _94:
104625  	if _28_ii >= _db.XnDb {
104626  		goto _97
104627  	}
104628  	_27_pPager = _sqlite3BtreePager(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_28_ii)).XpBt))
104629  	_sqlite3PagerLockingMode(tls, _27_pPager, _25_eMode)
104630  	_28_ii += 1
104631  	goto _94
104632  _97:
104633  	_db.XdfltLockMode = uint8(_25_eMode)
104634  _91:
104635  	_27_pPager = _sqlite3BtreePager(tls, (*XBtree)(_pDb.XpBt))
104636  	_25_eMode = _sqlite3PagerLockingMode(tls, _27_pPager, _25_eMode)
104637  _90:
104638  	func() {
104639  		if _25_eMode != int32(0) && _25_eMode != int32(1) {
104640  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113837), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120738)))
104641  			crt.X__builtin_abort(tls)
104642  		}
104643  	}()
104644  	if _25_eMode == int32(1) {
104645  		_25_zRet = str(89660)
104646  	}
104647  	_returnSingleText(tls, _v, _25_zRet)
104648  	goto _64
104649  _27:
104650  	if _zRight == nil {
104651  		_31_eMode = int32(-1)
104652  		goto _103
104653  	}
104654  	_33_n = _sqlite3Strlen30(tls, _zRight)
104655  	_31_eMode = int32(0)
104656  _104:
104657  	if store1(&_33_zMode, _sqlite3JournalModename(tls, _31_eMode)) == nil {
104658  		goto _107
104659  	}
104660  	if Xsqlite3_strnicmp(tls, _zRight, _33_zMode, _33_n) == int32(0) {
104661  		goto _107
104662  	}
104663  	_31_eMode += 1
104664  	goto _104
104665  _107:
104666  	if _33_zMode == nil {
104667  		_31_eMode = int32(-1)
104668  	}
104669  _103:
104670  	if (_31_eMode == int32(-1)) && (_pId2.Xn == (0)) {
104671  		_iDb = int32(0)
104672  		_pId2.Xn = uint32(1)
104673  	}
104674  	_31_ii = _db.XnDb - int32(1)
104675  _112:
104676  	if _31_ii < int32(0) {
104677  		goto _115
104678  	}
104679  	if ((elem27((*XDb)(_db.XaDb), uintptr(_31_ii)).XpBt) != nil) && ((_31_ii == _iDb) || (_pId2.Xn == (0))) {
104680  		_sqlite3VdbeUsesBtree(tls, _v, _31_ii)
104681  		_sqlite3VdbeAddOp3(tls, _v, int32(9), _31_ii, int32(1), _31_eMode)
104682  	}
104683  	_31_ii -= 1
104684  	goto _112
104685  _115:
104686  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(1))
104687  	goto _64
104688  _28:
104689  	_39_pPager = _sqlite3BtreePager(tls, (*XBtree)(_pDb.XpBt))
104690  	_39_iLimit = int64(-2)
104691  	if _zRight == nil {
104692  		goto _119
104693  	}
104694  	_sqlite3DecOrHexToI64(tls, _zRight, &_39_iLimit)
104695  	if _39_iLimit < int64(-1) {
104696  		_39_iLimit = int64(-1)
104697  	}
104698  _119:
104699  	_39_iLimit = _sqlite3PagerJournalSizeLimit(tls, _39_pPager, _39_iLimit)
104700  	_returnSingleInt(tls, _v, _39_iLimit)
104701  	goto _64
104702  _29:
104703  	_41_pBt = (*XBtree)(_pDb.XpBt)
104704  	func() {
104705  		if _41_pBt == nil {
104706  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113916), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120714)))
104707  			crt.X__builtin_abort(tls)
104708  		}
104709  	}()
104710  	if _zRight == nil {
104711  		_returnSingleInt(tls, _v, int64(_sqlite3BtreeGetAutoVacuum(tls, _41_pBt)))
104712  		goto _124
104713  	}
104714  	_43_eAuto = _getAutoVacuum(tls, _zRight)
104715  	func() {
104716  		if _43_eAuto < int32(0) || _43_eAuto > int32(2) {
104717  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113921), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120808)))
104718  			crt.X__builtin_abort(tls)
104719  		}
104720  	}()
104721  	_db.XnextAutovac = int8(uint8(_43_eAuto))
104722  	_rc = _sqlite3BtreeSetAutoVacuum(tls, _41_pBt, _43_eAuto)
104723  	if _rc != int32(0) || _43_eAuto != int32(1) && _43_eAuto != int32(2) {
104724  		goto _130
104725  	}
104726  	_44_iAddr = _sqlite3VdbeCurrentAddr(tls, _v)
104727  	_sqlite3VdbeVerifyNoMallocRequired(tls, _v, int32(5))
104728  	_44_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(5), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00setMeta6Ø004)), _sqlite3PragmaØ00iLnØ003)
104729  	if func() int32 {
104730  		if _44_aOp == nil {
104731  			return func() int32 {
104732  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113947), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(4809)))
104733  				crt.X__builtin_abort(tls)
104734  				return int32(1)
104735  			}()
104736  		}
104737  		return int32(0)
104738  	}() != 0 {
104739  		goto _64
104740  	}
104741  	elem63(_44_aOp, 0).Xp1 = _iDb
104742  	elem63(_44_aOp, uintptr(1)).Xp1 = _iDb
104743  	elem63(_44_aOp, uintptr(2)).Xp2 = _44_iAddr + int32(4)
104744  	elem63(_44_aOp, uintptr(4)).Xp1 = _iDb
104745  	elem63(_44_aOp, uintptr(4)).Xp3 = _43_eAuto - int32(1)
104746  	_sqlite3VdbeUsesBtree(tls, _v, _iDb)
104747  _130:
104748  _124:
104749  	goto _64
104750  _30:
104751  	if ((_zRight == nil) || (_sqlite3GetInt32(tls, _zRight, &_45_iLimit) == 0)) || (_45_iLimit <= int32(0)) {
104752  		_45_iLimit = int32(2147483647)
104753  	}
104754  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
104755  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _45_iLimit, int32(1))
104756  	_45_addr = _sqlite3VdbeAddOp1(tls, _v, int32(49), _iDb)
104757  	_sqlite3VdbeAddOp1(tls, _v, int32(67), int32(1))
104758  	_sqlite3VdbeAddOp2(tls, _v, int32(73), int32(1), int32(-1))
104759  	_sqlite3VdbeAddOp2(tls, _v, int32(46), int32(1), _45_addr)
104760  	_sqlite3VdbeJumpHere(tls, _v, _45_addr)
104761  	goto _64
104762  _31:
104763  	func() {
104764  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
104765  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113995), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(51126)))
104766  			crt.X__builtin_abort(tls)
104767  		}
104768  	}()
104769  	if _zRight == nil {
104770  		_returnSingleInt(tls, _v, int64((*XSchema)(_pDb.XpSchema).Xcache_size))
104771  		goto _140
104772  	}
104773  	_49_size = _sqlite3Atoi(tls, _zRight)
104774  	(*XSchema)(_pDb.XpSchema).Xcache_size = _49_size
104775  	_sqlite3BtreeSetCacheSize(tls, (*XBtree)(_pDb.XpBt), (*XSchema)(_pDb.XpSchema).Xcache_size)
104776  _140:
104777  	goto _64
104778  _32:
104779  	func() {
104780  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
104781  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114029), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(51126)))
104782  			crt.X__builtin_abort(tls)
104783  		}
104784  	}()
104785  	if _zRight == nil {
104786  		_returnSingleInt(tls, _v, int64(func() int32 {
104787  			if (_db.Xflags & int32(32)) == int32(0) {
104788  				return int32(0)
104789  			}
104790  			return _sqlite3BtreeSetSpillSize(tls, (*XBtree)(_pDb.XpBt), int32(0))
104791  		}()))
104792  		goto _146
104793  	}
104794  	_52_size = int32(1)
104795  	if _sqlite3GetInt32(tls, _zRight, &_52_size) != 0 {
104796  		_sqlite3BtreeSetSpillSize(tls, (*XBtree)(_pDb.XpBt), _52_size)
104797  	}
104798  	if _sqlite3GetBoolean(tls, _zRight, uint8(bool2int(_52_size != int32(0)))) != 0 {
104799  		_db.Xflags |= int32(32)
104800  		goto _149
104801  	}
104802  	_db.Xflags &= int32(-33)
104803  _149:
104804  	_setAllPagerFlags(tls, _db)
104805  _146:
104806  	goto _64
104807  _33:
104808  	func() {
104809  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
104810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114066), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(51126)))
104811  			crt.X__builtin_abort(tls)
104812  		}
104813  	}()
104814  	if _zRight == nil {
104815  		goto _152
104816  	}
104817  	_sqlite3DecOrHexToI64(tls, _zRight, &_56_sz)
104818  	if _56_sz < (0) {
104819  		_56_sz = _sqlite3Config.XszMmap
104820  	}
104821  	if _pId2.Xn == (0) {
104822  		_db.XszMmap = _56_sz
104823  	}
104824  	_57_ii = _db.XnDb - int32(1)
104825  _155:
104826  	if _57_ii < int32(0) {
104827  		goto _158
104828  	}
104829  	if ((elem27((*XDb)(_db.XaDb), uintptr(_57_ii)).XpBt) != nil) && ((_57_ii == _iDb) || (_pId2.Xn == (0))) {
104830  		_sqlite3BtreeSetMmapLimit(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_57_ii)).XpBt), _56_sz)
104831  	}
104832  	_57_ii -= 1
104833  	goto _155
104834  _158:
104835  _152:
104836  	_56_sz = int64(-1)
104837  	_rc = Xsqlite3_file_control(tls, _db, _zDb, int32(18), unsafe.Pointer(&_56_sz))
104838  	if _rc == int32(0) {
104839  		_returnSingleInt(tls, _v, _56_sz)
104840  		goto _164
104841  	}
104842  	if _rc != int32(12) {
104843  		_pParse.XnErr += 1
104844  		_pParse.Xrc = _rc
104845  	}
104846  _164:
104847  	goto _64
104848  _34:
104849  	if _zRight == nil {
104850  		_returnSingleInt(tls, _v, int64(_db.Xtemp_store))
104851  		goto _166
104852  	}
104853  	_changeTempStorage(tls, _pParse, _zRight)
104854  _166:
104855  	goto _64
104856  _35:
104857  	if _zRight == nil {
104858  		_returnSingleText(tls, _v, Xsqlite3_temp_directory)
104859  		goto _168
104860  	}
104861  	if (*elem1(_zRight, 0)) == 0 {
104862  		goto _169
104863  	}
104864  	_rc = _sqlite3OsAccess(tls, (*Xsqlite3_vfs)(_db.XpVfs), _zRight, int32(1), &_68_res)
104865  	if (_rc != int32(0)) || (_68_res == int32(0)) {
104866  		_sqlite3ErrorMsg(tls, _pParse, str(120829))
104867  		goto _pragma_out
104868  	}
104869  _169:
104870  	if (int32(0) != 0 || (int32(1) != 0 && (int32(_db.Xtemp_store) <= int32(1)))) || int32(0) != 0 {
104871  		_invalidateTempStorage(tls, _pParse)
104872  	}
104873  	Xsqlite3_free(tls, unsafe.Pointer(Xsqlite3_temp_directory))
104874  	if (*elem1(_zRight, 0)) != 0 {
104875  		Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(_zRight))
104876  		bug20530(Xsqlite3_temp_directory)
104877  		goto _177
104878  	}
104879  	Xsqlite3_temp_directory = nil
104880  	bug20530(Xsqlite3_temp_directory)
104881  _177:
104882  _168:
104883  	goto _64
104884  _36:
104885  	if _zRight == nil {
104886  		_returnSingleInt(tls, _v, int64(int32(_pDb.Xsafety_level)-int32(1)))
104887  		goto _179
104888  	}
104889  	if _db.XautoCommit == 0 {
104890  		_sqlite3ErrorMsg(tls, _pParse, str(120854))
104891  		goto _182
104892  	}
104893  	if _iDb == int32(1) {
104894  		goto _182
104895  	}
104896  	_77_iLevel = (int32(_getSafetyLevel(tls, _zRight, int32(0), uint8(1))) + int32(1)) & int32(7)
104897  	if _77_iLevel == int32(0) {
104898  		_77_iLevel = int32(1)
104899  	}
104900  	_pDb.Xsafety_level = uint8(_77_iLevel)
104901  	_pDb.XbSyncSet = uint8(1)
104902  	_setAllPagerFlags(tls, _db)
104903  _182:
104904  _179:
104905  	goto _64
104906  _37:
104907  	if _zRight == nil {
104908  		_setPragmaResultColumnNames(tls, _v, _pPragma)
104909  		_returnSingleInt(tls, _v, int64(bool2int((uint32(_db.Xflags)&_pPragma.XiArg) != (0))))
104910  		goto _185
104911  	}
104912  	_80_mask = int32(_pPragma.XiArg)
104913  	if int32(_db.XautoCommit) == int32(0) {
104914  		_80_mask &= int32(-524289)
104915  	}
104916  	if _sqlite3GetBoolean(tls, _zRight, 0) != 0 {
104917  		_db.Xflags |= _80_mask
104918  		goto _188
104919  	}
104920  	_db.Xflags &= ^_80_mask
104921  	if _80_mask == int32(33554432) {
104922  		_db.XnDeferredImmCons = 0
104923  	}
104924  _188:
104925  	_sqlite3VdbeAddOp0(tls, _v, int32(153))
104926  	_setAllPagerFlags(tls, _db)
104927  _185:
104928  	goto _64
104929  _38:
104930  	if _zRight == nil {
104931  		goto _190
104932  	}
104933  	_84_pTab = _sqlite3LocateTable(tls, _pParse, uint32(2), _zRight, _zDb)
104934  	if _84_pTab == nil {
104935  		goto _191
104936  	}
104937  	_85_nHidden = int32(0)
104938  	_85_pPk = _sqlite3PrimaryKeyIndex(tls, _84_pTab)
104939  	_pParse.XnMem = int32(6)
104940  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
104941  	_sqlite3ViewGetColumnNames(tls, _pParse, _84_pTab)
104942  	*func() **XColumn { _85_i = int32(0); return &_85_pCol }() = (*XColumn)(_84_pTab.XaCol)
104943  _192:
104944  	if _85_i >= int32(_84_pTab.XnCol) {
104945  		goto _195
104946  	}
104947  	if (int32(_85_pCol.XcolFlags) & int32(2)) != int32(0) {
104948  		_85_nHidden += 1
104949  		goto _193
104950  	}
104951  	if (int32(_85_pCol.XcolFlags) & int32(1)) == int32(0) {
104952  		_85_k = int32(0)
104953  		goto _200
104954  	}
104955  	if _85_pPk == nil {
104956  		_85_k = int32(1)
104957  		goto _200
104958  	}
104959  	_85_k = int32(1)
104960  _201:
104961  	if _85_k > int32(_84_pTab.XnCol) || int32(*elem52(_85_pPk.XaiColumn, uintptr(_85_k-int32(1)))) == _85_i {
104962  		goto _205
104963  	}
104964  	_85_k += 1
104965  	goto _201
104966  _205:
104967  _200:
104968  	func() {
104969  		if (*XExpr)(_85_pCol.XpDflt) != nil && int32((*XExpr)(_85_pCol.XpDflt).Xop) != int32(162) {
104970  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114330), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120907)))
104971  			crt.X__builtin_abort(tls)
104972  		}
104973  	}()
104974  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(120950), _85_i-_85_nHidden, unsafe.Pointer(_85_pCol.XzName), unsafe.Pointer(_sqlite3ColumnType(tls, _85_pCol, str(284))), func() int32 {
104975  		if _85_pCol.XnotNull != 0 {
104976  			return int32(1)
104977  		}
104978  		return int32(0)
104979  	}(), unsafe.Pointer(func() *int8 {
104980  		if _85_pCol.XpDflt != nil {
104981  			return (*(**int8)(unsafe.Pointer(&((*XExpr)(_85_pCol.XpDflt).Xu))))
104982  		}
104983  		return nil
104984  	}()), _85_k)
104985  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(6))
104986  _193:
104987  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _85_i += 1; return &_85_pCol }())) += uintptr(32)
104988  	goto _192
104989  _195:
104990  _191:
104991  _190:
104992  	goto _64
104993  _39:
104994  	_pParse.XnMem = int32(5)
104995  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
104996  	_92_i = (*XHashElem)(((*XSchema)(_pDb.XpSchema).XtblHash).Xfirst)
104997  _213:
104998  	if _92_i == nil {
104999  		goto _216
105000  	}
105001  	_93_pTab = (*XTable)(_92_i.Xdata)
105002  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(120957), unsafe.Pointer(_93_pTab.XzName), int32(0), int32(_93_pTab.XszTabRow), int32(_93_pTab.XnRowLogEst), _93_pTab.XtabFlags)
105003  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(5))
105004  	_92_pIdx = (*XIndex)(_93_pTab.XpIndex)
105005  _217:
105006  	if _92_pIdx == nil {
105007  		goto _220
105008  	}
105009  	_sqlite3VdbeMultiLoad(tls, _v, int32(2), str(120963), unsafe.Pointer(_92_pIdx.XzName), int32(_92_pIdx.XszIdxRow), int32(*elem52(_92_pIdx.XaiRowLogEst, 0)), (uint32(_92_pIdx.XidxType>>7)<<31)>>31)
105010  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(5))
105011  	_92_pIdx = (*XIndex)(_92_pIdx.XpNext)
105012  	goto _217
105013  _220:
105014  	_92_i = (*XHashElem)(_92_i.Xnext)
105015  	goto _213
105016  _216:
105017  	goto _64
105018  _40:
105019  	if _zRight == nil {
105020  		goto _221
105021  	}
105022  	_95_pIdx = _sqlite3FindIndex(tls, _db, _zRight, _zDb)
105023  	if _95_pIdx == nil {
105024  		goto _222
105025  	}
105026  	if _pPragma.XiArg != 0 {
105027  		_96_mx = int32(_95_pIdx.XnColumn)
105028  		_pParse.XnMem = int32(6)
105029  		goto _224
105030  	}
105031  	_96_mx = int32(_95_pIdx.XnKeyCol)
105032  	_pParse.XnMem = int32(3)
105033  _224:
105034  	_95_pTab = (*XTable)(_95_pIdx.XpTable)
105035  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
105036  	func() {
105037  		if _pParse.XnMem > int32(_pPragma.XnPragCName) {
105038  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114390), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120968)))
105039  			crt.X__builtin_abort(tls)
105040  		}
105041  	}()
105042  	_96_i = int32(0)
105043  _227:
105044  	if _96_i >= _96_mx {
105045  		goto _230
105046  	}
105047  	_99_cnum = *elem52(_95_pIdx.XaiColumn, uintptr(_96_i))
105048  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(121002), _96_i, int32(_99_cnum), unsafe.Pointer(func() *int8 {
105049  		if int32(_99_cnum) < int32(0) {
105050  			return nil
105051  		}
105052  		return (elem43((*XColumn)(_95_pTab.XaCol), uintptr(_99_cnum)).XzName)
105053  	}()))
105054  	if _pPragma.XiArg != 0 {
105055  		_sqlite3VdbeMultiLoad(tls, _v, int32(4), str(121006), int32(*elem15(_95_pIdx.XaSortOrder, uintptr(_96_i))), unsafe.Pointer(*elem0(_95_pIdx.XazColl, uintptr(_96_i))), bool2int(_96_i < int32(_95_pIdx.XnKeyCol)))
105056  	}
105057  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), _pParse.XnMem)
105058  	_96_i += 1
105059  	goto _227
105060  _230:
105061  _222:
105062  _221:
105063  	goto _64
105064  _41:
105065  	if _zRight == nil {
105066  		goto _234
105067  	}
105068  	_101_pTab = _sqlite3FindTable(tls, _db, _zRight, _zDb)
105069  	if _101_pTab == nil {
105070  		goto _235
105071  	}
105072  	_pParse.XnMem = int32(5)
105073  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
105074  	*func() *int32 { _101_pIdx = (*XIndex)(_101_pTab.XpIndex); return &_101_i }() = int32(0)
105075  _236:
105076  	if _101_pIdx == nil {
105077  		goto _239
105078  	}
105079  	_103_azOrigin = [3]*int8{}
105080  	*elem0((**int8)(unsafe.Pointer(&_103_azOrigin)), 0) = str(121010)
105081  	*elem0((**int8)(unsafe.Pointer(&_103_azOrigin)), uintptr(1)) = str(121012)
105082  	*elem0((**int8)(unsafe.Pointer(&_103_azOrigin)), uintptr(2)) = str(93736)
105083  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(121014), _101_i, unsafe.Pointer(_101_pIdx.XzName), bool2int(int32(_101_pIdx.XonError) != int32(0)), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_103_azOrigin)), uintptr((uint32(_101_pIdx.XidxType)<<30)>>30))), bool2int((*XExpr)(_101_pIdx.XpPartIdxWhere) != nil))
105084  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(5))
105085  	*func() *int32 { _101_pIdx = (*XIndex)(_101_pIdx.XpNext); return &_101_i }() += 1
105086  	goto _236
105087  _239:
105088  _235:
105089  _234:
105090  	goto _64
105091  _42:
105092  	_pParse.XnMem = int32(3)
105093  	_104_i = int32(0)
105094  _240:
105095  	if _104_i >= _db.XnDb {
105096  		goto _243
105097  	}
105098  	if (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_104_i)).XpBt) == nil {
105099  		goto _241
105100  	}
105101  	func() {
105102  		if (elem27((*XDb)(_db.XaDb), uintptr(_104_i)).XzDbSName) == nil {
105103  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114434), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121020)))
105104  			crt.X__builtin_abort(tls)
105105  		}
105106  	}()
105107  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(121043), _104_i, unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_104_i)).XzDbSName), unsafe.Pointer(_sqlite3BtreeGetFilename(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_104_i)).XpBt))))
105108  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(3))
105109  _241:
105110  	_104_i += 1
105111  	goto _240
105112  _243:
105113  	goto _64
105114  _43:
105115  	_106_i = int32(0)
105116  	_pParse.XnMem = int32(2)
105117  	_106_p = (*XHashElem)(_db.XaCollSeq.Xfirst)
105118  _247:
105119  	if _106_p == nil {
105120  		goto _250
105121  	}
105122  	_107_pColl = (*XCollSeq)(_106_p.Xdata)
105123  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(121047), postInc2(&_106_i, 1), unsafe.Pointer(_107_pColl.XzName))
105124  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(2))
105125  	_106_p = (*XHashElem)(_106_p.Xnext)
105126  	goto _247
105127  _250:
105128  	goto _64
105129  _44:
105130  	if _zRight == nil {
105131  		goto _251
105132  	}
105133  	_108_pTab = _sqlite3FindTable(tls, _db, _zRight, _zDb)
105134  	if _108_pTab == nil {
105135  		goto _252
105136  	}
105137  	_108_pFK = (*XFKey)(_108_pTab.XpFKey)
105138  	if _108_pFK == nil {
105139  		goto _253
105140  	}
105141  	_110_i = int32(0)
105142  	_pParse.XnMem = int32(8)
105143  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
105144  _254:
105145  	if _108_pFK == nil {
105146  		goto _255
105147  	}
105148  	_111_j = int32(0)
105149  _256:
105150  	if _111_j >= _108_pFK.XnCol {
105151  		goto _259
105152  	}
105153  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(121050), _110_i, _111_j, unsafe.Pointer(_108_pFK.XzTo), unsafe.Pointer(elem43((*XColumn)(_108_pTab.XaCol), uintptr(elem117((*t118)(unsafe.Pointer(&_108_pFK.XaCol)), uintptr(_111_j)).XiFrom)).XzName), unsafe.Pointer(elem117((*t118)(unsafe.Pointer(&_108_pFK.XaCol)), uintptr(_111_j)).XzCol), unsafe.Pointer(_actionName(tls, *elem15((*uint8)(unsafe.Pointer(&_108_pFK.XaAction)), uintptr(1)))), unsafe.Pointer(_actionName(tls, *elem15((*uint8)(unsafe.Pointer(&_108_pFK.XaAction)), 0))), unsafe.Pointer(str(121059)))
105154  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(8))
105155  	_111_j += 1
105156  	goto _256
105157  _259:
105158  	_110_i += 1
105159  	_108_pFK = (*XFKey)(_108_pFK.XpNextFrom)
105160  	goto _254
105161  _255:
105162  _253:
105163  _252:
105164  _251:
105165  	goto _64
105166  _45:
105167  	_113_regResult = _pParse.XnMem + int32(1)
105168  	_pParse.XnMem += int32(4)
105169  	_113_regKey = preInc2(&_pParse.XnMem, 1)
105170  	_113_regRow = preInc2(&_pParse.XnMem, 1)
105171  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
105172  	_113_k = (*XHashElem)(((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XtblHash).Xfirst)
105173  _260:
105174  	if _113_k == nil {
105175  		goto _261
105176  	}
105177  	if _zRight != nil {
105178  		_113_pTab = _sqlite3LocateTable(tls, _pParse, 0, _zRight, _zDb)
105179  		_113_k = nil
105180  		goto _263
105181  	}
105182  	_113_pTab = (*XTable)(_113_k.Xdata)
105183  	_113_k = (*XHashElem)(_113_k.Xnext)
105184  _263:
105185  	if (_113_pTab == nil) || ((*XFKey)(_113_pTab.XpFKey) == nil) {
105186  		goto _260
105187  	}
105188  	_sqlite3TableLock(tls, _pParse, _iDb, _113_pTab.Xtnum, 0, _113_pTab.XzName)
105189  	if (int32(_113_pTab.XnCol) + _113_regRow) > _pParse.XnMem {
105190  		_pParse.XnMem = int32(_113_pTab.XnCol) + _113_regRow
105191  	}
105192  	_sqlite3OpenTable(tls, _pParse, int32(0), _iDb, _113_pTab, int32(106))
105193  	_sqlite3VdbeLoadString(tls, _v, _113_regResult, _113_pTab.XzName)
105194  	*func() **XFKey { _113_i = int32(1); return &_113_pFK }() = (*XFKey)(_113_pTab.XpFKey)
105195  _267:
105196  	if _113_pFK == nil {
105197  		goto _270
105198  	}
105199  	_113_pParent = _sqlite3FindTable(tls, _db, _113_pFK.XzTo, _zDb)
105200  	if _113_pParent == nil {
105201  		goto _268
105202  	}
105203  	_113_pIdx = nil
105204  	_sqlite3TableLock(tls, _pParse, _iDb, _113_pParent.Xtnum, 0, _113_pParent.XzName)
105205  	_113_x = _sqlite3FkLocateIndex(tls, _pParse, _113_pParent, _113_pFK, &_113_pIdx, nil)
105206  	if _113_x != int32(0) {
105207  		goto _272
105208  	}
105209  	if _113_pIdx == nil {
105210  		_sqlite3OpenTable(tls, _pParse, _113_i, _iDb, _113_pParent, int32(106))
105211  		goto _274
105212  	}
105213  	_sqlite3VdbeAddOp3(tls, _v, int32(106), _113_i, _113_pIdx.Xtnum, _iDb)
105214  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _113_pIdx)
105215  _274:
105216  	goto _275
105217  _272:
105218  	_113_k = nil
105219  	goto _270
105220  _275:
105221  _268:
105222  	*func() **XFKey { _113_i += 1; return &_113_pFK }() = (*XFKey)(_113_pFK.XpNextFrom)
105223  	goto _267
105224  _270:
105225  	func() {
105226  		if _pParse.XnErr <= int32(0) && _113_pFK != nil {
105227  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114546), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121064)))
105228  			crt.X__builtin_abort(tls)
105229  		}
105230  	}()
105231  	if _113_pFK != nil {
105232  		goto _261
105233  	}
105234  	if _pParse.XnTab < _113_i {
105235  		_pParse.XnTab = _113_i
105236  	}
105237  	_113_addrTop = _sqlite3VdbeAddOp1(tls, _v, int32(37), int32(0))
105238  	*func() **XFKey { _113_i = int32(1); return &_113_pFK }() = (*XFKey)(_113_pTab.XpFKey)
105239  _281:
105240  	if _113_pFK == nil {
105241  		goto _284
105242  	}
105243  	_113_pParent = _sqlite3FindTable(tls, _db, _113_pFK.XzTo, _zDb)
105244  	_113_pIdx = nil
105245  	_113_aiCols = nil
105246  	if _113_pParent != nil {
105247  		_113_x = _sqlite3FkLocateIndex(tls, _pParse, _113_pParent, _113_pFK, &_113_pIdx, &_113_aiCols)
105248  		func() {
105249  			if _113_x != int32(0) {
105250  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114556), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121089)))
105251  				crt.X__builtin_abort(tls)
105252  			}
105253  		}()
105254  	}
105255  	_113_addrOk = _sqlite3VdbeMakeLabel(tls, _v)
105256  	_113_j = int32(0)
105257  _288:
105258  	if _113_j >= _113_pFK.XnCol {
105259  		goto _291
105260  	}
105261  	_124_iCol = func() int32 {
105262  		if _113_aiCols != nil {
105263  			return (*elem8(_113_aiCols, uintptr(_113_j)))
105264  		}
105265  		return (elem117((*t118)(unsafe.Pointer(&_113_pFK.XaCol)), uintptr(_113_j)).XiFrom)
105266  	}()
105267  	_sqlite3ExprCodeGetColumnOfTable(tls, _v, _113_pTab, int32(0), _124_iCol, _113_regRow+_113_j)
105268  	_sqlite3VdbeAddOp2(tls, _v, int32(75), _113_regRow+_113_j, _113_addrOk)
105269  	_113_j += 1
105270  	goto _288
105271  _291:
105272  	if _113_pIdx != nil {
105273  		_sqlite3VdbeAddOp4(tls, _v, int32(101), _113_regRow, _113_pFK.XnCol, _113_regKey, _sqlite3IndexAffinityStr(tls, _db, _113_pIdx), _113_pFK.XnCol)
105274  		_sqlite3VdbeAddOp4Int(tls, _v, int32(30), _113_i, _113_addrOk, _113_regKey, int32(0))
105275  		goto _296
105276  	}
105277  	if _113_pParent != nil {
105278  		_126_jmp = _sqlite3VdbeCurrentAddr(tls, _v) + int32(2)
105279  		_sqlite3VdbeAddOp3(tls, _v, int32(31), _113_i, _126_jmp, _113_regRow)
105280  		_sqlite3VdbeGoto(tls, _v, _113_addrOk)
105281  		func() {
105282  			if _113_pFK.XnCol != int32(1) {
105283  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114581), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121094)))
105284  				crt.X__builtin_abort(tls)
105285  			}
105286  		}()
105287  	}
105288  _296:
105289  	if (_113_pTab.XtabFlags & uint32(32)) == (0) {
105290  		_sqlite3VdbeAddOp2(tls, _v, int32(125), int32(0), _113_regResult+int32(1))
105291  		goto _300
105292  	}
105293  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _113_regResult+int32(1))
105294  _300:
105295  	_sqlite3VdbeMultiLoad(tls, _v, _113_regResult+int32(2), str(121107), unsafe.Pointer(_113_pFK.XzTo), _113_i-int32(1))
105296  	_sqlite3VdbeAddOp2(tls, _v, int32(67), _113_regResult, int32(4))
105297  	_sqlite3VdbeResolveLabel(tls, _v, _113_addrOk)
105298  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_113_aiCols))
105299  	*func() **XFKey { _113_i += 1; return &_113_pFK }() = (*XFKey)(_113_pFK.XpNextFrom)
105300  	goto _281
105301  _284:
105302  	_sqlite3VdbeAddOp2(tls, _v, int32(7), int32(0), _113_addrTop+int32(1))
105303  	_sqlite3VdbeJumpHere(tls, _v, _113_addrTop)
105304  	goto _260
105305  _261:
105306  	goto _64
105307  _46:
105308  	if _zRight == nil {
105309  		goto _301
105310  	}
105311  	if _sqlite3GetBoolean(tls, _zRight, 0) != 0 {
105312  		_sqlite3ParserTrace(tls, (*crt.XFILE)(Xstdout), str(121110))
105313  		goto _303
105314  	}
105315  	_sqlite3ParserTrace(tls, nil, nil)
105316  _303:
105317  _301:
105318  	goto _64
105319  _47:
105320  	if _zRight != nil {
105321  		_sqlite3RegisterLikeFunctions(tls, _db, int32(_sqlite3GetBoolean(tls, _zRight, 0)))
105322  	}
105323  	goto _64
105324  _48:
105325  	_135_isQuick = bool2int(int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_zLeft, 0))))) == int32(113))
105326  	func() {
105327  		if _iDb < int32(0) {
105328  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114657), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(41995)))
105329  			crt.X__builtin_abort(tls)
105330  		}
105331  	}()
105332  	func() {
105333  		if _iDb != int32(0) && _pId2.Xz == nil {
105334  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114658), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121119)))
105335  			crt.X__builtin_abort(tls)
105336  		}
105337  	}()
105338  	if _pId2.Xz == nil {
105339  		_iDb = int32(-1)
105340  	}
105341  	_pParse.XnMem = int32(6)
105342  	_135_mxErr = int32(100)
105343  	if _zRight == nil {
105344  		goto _311
105345  	}
105346  	_sqlite3GetInt32(tls, _zRight, &_135_mxErr)
105347  	if _135_mxErr <= int32(0) {
105348  		_135_mxErr = int32(100)
105349  	}
105350  _311:
105351  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _135_mxErr-int32(1), int32(1))
105352  	_135_i = int32(0)
105353  _313:
105354  	if _135_i >= _db.XnDb {
105355  		goto _316
105356  	}
105357  	_138_cnt = int32(0)
105358  	_138_mxIdx = int32(0)
105359  	goto _317
105360  _317:
105361  	if (_iDb >= int32(0)) && (_135_i != _iDb) {
105362  		goto _314
105363  	}
105364  	_sqlite3CodeVerifySchema(tls, _pParse, _135_i)
105365  	func() {
105366  		if _sqlite3SchemaMutexHeld(tls, _db, _135_i, nil) == 0 {
105367  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114693), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121137)))
105368  			crt.X__builtin_abort(tls)
105369  		}
105370  	}()
105371  	_138_pTbls = &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_135_i)).XpSchema).XtblHash)
105372  	*func() **XHashElem { _138_cnt = int32(0); return &_138_x }() = (*XHashElem)(_138_pTbls.Xfirst)
105373  _322:
105374  	if _138_x == nil {
105375  		goto _325
105376  	}
105377  	_139_pTab = (*XTable)(_138_x.Xdata)
105378  	if (_139_pTab.XtabFlags & uint32(32)) == (0) {
105379  		_138_cnt += 1
105380  	}
105381  	*func() **XIndex { _138_nIdx = int32(0); return &_139_pIdx }() = (*XIndex)(_139_pTab.XpIndex)
105382  _327:
105383  	if _139_pIdx == nil {
105384  		goto _330
105385  	}
105386  	_138_cnt += 1
105387  	*func() *int32 { _139_pIdx = (*XIndex)(_139_pIdx.XpNext); return &_138_nIdx }() += 1
105388  	goto _327
105389  _330:
105390  	if _138_nIdx > _138_mxIdx {
105391  		_138_mxIdx = _138_nIdx
105392  	}
105393  	_138_x = (*XHashElem)(_138_x.Xnext)
105394  	goto _322
105395  _325:
105396  	_138_aRoot = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(4)*uint64(_138_cnt+int32(1))))
105397  	if _138_aRoot == nil {
105398  		goto _316
105399  	}
105400  	*func() **XHashElem { _138_cnt = int32(0); return &_138_x }() = (*XHashElem)(_138_pTbls.Xfirst)
105401  _333:
105402  	if _138_x == nil {
105403  		goto _336
105404  	}
105405  	_141_pTab = (*XTable)(_138_x.Xdata)
105406  	if (_141_pTab.XtabFlags & uint32(32)) == (0) {
105407  		*elem8(_138_aRoot, uintptr(postInc2(&_138_cnt, 1))) = _141_pTab.Xtnum
105408  	}
105409  	_141_pIdx = (*XIndex)(_141_pTab.XpIndex)
105410  _338:
105411  	if _141_pIdx == nil {
105412  		goto _341
105413  	}
105414  	*elem8(_138_aRoot, uintptr(postInc2(&_138_cnt, 1))) = _141_pIdx.Xtnum
105415  	_141_pIdx = (*XIndex)(_141_pIdx.XpNext)
105416  	goto _338
105417  _341:
105418  	_138_x = (*XHashElem)(_138_x.Xnext)
105419  	goto _333
105420  _336:
105421  	*elem8(_138_aRoot, uintptr(_138_cnt)) = int32(0)
105422  	_pParse.XnMem = func() int32 {
105423  		if _pParse.XnMem > (int32(8) + _138_mxIdx) {
105424  			return _pParse.XnMem
105425  		}
105426  		return (int32(8) + _138_mxIdx)
105427  	}()
105428  	_sqlite3VdbeAddOp4(tls, _v, int32(144), int32(2), _138_cnt, int32(1), (*int8)(unsafe.Pointer(_138_aRoot)), int32(-12))
105429  	_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_135_i)))
105430  	_135_addr = _sqlite3VdbeAddOp1(tls, _v, int32(75), int32(2))
105431  	_sqlite3VdbeAddOp4(tls, _v, int32(97), int32(0), int32(3), int32(0), _sqlite3MPrintf(tls, _db, str(121170), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_135_i)).XzDbSName)), int32(-1))
105432  	_sqlite3VdbeAddOp3(tls, _v, int32(63), int32(2), int32(4), int32(1))
105433  	_sqlite3VdbeAddOp3(tls, _v, int32(93), int32(4), int32(3), int32(2))
105434  	_integrityCheckResultRow(tls, _v, int32(2))
105435  	_sqlite3VdbeJumpHere(tls, _v, _135_addr)
105436  	_138_x = (*XHashElem)(_138_pTbls.Xfirst)
105437  _344:
105438  	if _138_x == nil {
105439  		goto _347
105440  	}
105441  	_143_pTab = (*XTable)(_138_x.Xdata)
105442  	_143_pPrior = nil
105443  	_143_r1 = int32(-1)
105444  	if _143_pTab.Xtnum < int32(1) {
105445  		goto _345
105446  	}
105447  	if (((*XExprList)(_143_pTab.XpCheck) == nil) && ((_143_pTab.XtabFlags & uint32(512)) == (0))) && (((*XIndex)(_143_pTab.XpIndex) == nil) || _135_isQuick != 0) {
105448  		goto _345
105449  	}
105450  	_143_pPk = func() *XIndex {
105451  		if (_143_pTab.XtabFlags & uint32(32)) == (0) {
105452  			return nil
105453  		}
105454  		return _sqlite3PrimaryKeyIndex(tls, _143_pTab)
105455  	}()
105456  	_sqlite3ExprCacheClear(tls, _pParse)
105457  	_sqlite3OpenTableAndIndices(tls, _pParse, _143_pTab, int32(106), 0, int32(1), nil, &_143_iDataCur, &_143_iIdxCur)
105458  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), int32(7))
105459  	*func() **XIndex { _135_j = int32(0); return &_143_pIdx }() = (*XIndex)(_143_pTab.XpIndex)
105460  _355:
105461  	if _143_pIdx == nil {
105462  		goto _358
105463  	}
105464  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), int32(8)+_135_j)
105465  	*func() *int32 { _143_pIdx = (*XIndex)(_143_pIdx.XpNext); return &_135_j }() += 1
105466  	goto _355
105467  _358:
105468  	func() {
105469  		if _pParse.XnMem < (int32(8) + _135_j) {
105470  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114754), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121194)))
105471  			crt.X__builtin_abort(tls)
105472  		}
105473  	}()
105474  	func() {
105475  		if _sqlite3NoTempsInRange(tls, _pParse, int32(1), int32(7)+_135_j) == 0 {
105476  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114755), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121212)))
105477  			crt.X__builtin_abort(tls)
105478  		}
105479  	}()
105480  	_sqlite3VdbeAddOp2(tls, _v, int32(37), _143_iDataCur, int32(0))
105481  	_143_loopTop = _sqlite3VdbeAddOp2(tls, _v, int32(73), int32(7), int32(1))
105482  	_135_j = int32(0)
105483  _363:
105484  	if _135_j >= int32(_143_pTab.XnCol) {
105485  		goto _366
105486  	}
105487  	if _135_j == int32(_143_pTab.XiPKey) {
105488  		goto _364
105489  	}
105490  	if int32(elem43((*XColumn)(_143_pTab.XaCol), uintptr(_135_j)).XnotNull) == int32(0) {
105491  		goto _364
105492  	}
105493  	_sqlite3ExprCodeGetColumnOfTable(tls, _v, _143_pTab, _143_iDataCur, _135_j, int32(3))
105494  	_sqlite3VdbeChangeP5(tls, _v, uint16(128))
105495  	_146_jmp2 = _sqlite3VdbeAddOp1(tls, _v, int32(76), int32(3))
105496  	_146_zErr = _sqlite3MPrintf(tls, _db, str(121248), unsafe.Pointer(_143_pTab.XzName), unsafe.Pointer(elem43((*XColumn)(_143_pTab.XaCol), uintptr(_135_j)).XzName))
105497  	_sqlite3VdbeAddOp4(tls, _v, int32(97), int32(0), int32(3), int32(0), _146_zErr, int32(-1))
105498  	_integrityCheckResultRow(tls, _v, int32(3))
105499  	_sqlite3VdbeJumpHere(tls, _v, _146_jmp2)
105500  _364:
105501  	_135_j += 1
105502  	goto _363
105503  _366:
105504  	if _143_pTab.XpCheck == nil || (_db.Xflags&int32(8192)) != int32(0) {
105505  		goto _370
105506  	}
105507  	_147_pCheck = _sqlite3ExprListDup(tls, _db, (*XExprList)(_143_pTab.XpCheck), int32(0))
105508  	if int32(_db.XmallocFailed) != int32(0) {
105509  		goto _371
105510  	}
105511  	_148_addrCkFault = _sqlite3VdbeMakeLabel(tls, _v)
105512  	_148_addrCkOk = _sqlite3VdbeMakeLabel(tls, _v)
105513  	_pParse.XiSelfTab = _143_iDataCur
105514  	_sqlite3ExprCachePush(tls, _pParse)
105515  	_148_k = _147_pCheck.XnExpr - int32(1)
105516  _372:
105517  	if _148_k <= int32(0) {
105518  		goto _375
105519  	}
105520  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_147_pCheck.Xa)), uintptr(_148_k)).XpExpr), _148_addrCkFault, int32(0))
105521  	_148_k -= 1
105522  	goto _372
105523  _375:
105524  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(elem59((*TExprList_item)(unsafe.Pointer(&_147_pCheck.Xa)), 0).XpExpr), _148_addrCkOk, int32(16))
105525  	_sqlite3VdbeResolveLabel(tls, _v, _148_addrCkFault)
105526  	_148_zErr = _sqlite3MPrintf(tls, _db, str(121268), unsafe.Pointer(_143_pTab.XzName))
105527  	_sqlite3VdbeAddOp4(tls, _v, int32(97), int32(0), int32(3), int32(0), _148_zErr, int32(-1))
105528  	_integrityCheckResultRow(tls, _v, int32(3))
105529  	_sqlite3VdbeResolveLabel(tls, _v, _148_addrCkOk)
105530  	_sqlite3ExprCachePop(tls, _pParse)
105531  _371:
105532  	_sqlite3ExprListDelete(tls, _db, _147_pCheck)
105533  _370:
105534  	*func() **XIndex { _135_j = int32(0); return &_143_pIdx }() = (*XIndex)(_143_pTab.XpIndex)
105535  _376:
105536  	if _143_pIdx == nil || _135_isQuick != 0 {
105537  		goto _380
105538  	}
105539  	_150_ckUniq = _sqlite3VdbeMakeLabel(tls, _v)
105540  	if _143_pPk == _143_pIdx {
105541  		goto _377
105542  	}
105543  	_143_r1 = _sqlite3GenerateIndexKey(tls, _pParse, _143_pIdx, _143_iDataCur, int32(0), int32(0), &_150_jmp3, _143_pPrior, _143_r1)
105544  	_143_pPrior = _143_pIdx
105545  	_sqlite3VdbeAddOp2(tls, _v, int32(73), int32(8)+_135_j, int32(1))
105546  	_150_jmp2 = _sqlite3VdbeAddOp4Int(tls, _v, int32(30), _143_iIdxCur+_135_j, _150_ckUniq, _143_r1, int32(_143_pIdx.XnColumn))
105547  	_sqlite3VdbeLoadString(tls, _v, int32(3), str(121298))
105548  	_sqlite3VdbeAddOp3(tls, _v, int32(93), int32(7), int32(3), int32(3))
105549  	_sqlite3VdbeLoadString(tls, _v, int32(4), str(121303))
105550  	_sqlite3VdbeAddOp3(tls, _v, int32(93), int32(4), int32(3), int32(3))
105551  	_150_jmp5 = _sqlite3VdbeLoadString(tls, _v, int32(4), _143_pIdx.XzName)
105552  	_sqlite3VdbeAddOp3(tls, _v, int32(93), int32(4), int32(3), int32(3))
105553  	_150_jmp4 = _integrityCheckResultRow(tls, _v, int32(3))
105554  	_sqlite3VdbeJumpHere(tls, _v, _150_jmp2)
105555  	if int32(_143_pIdx.XonError) == int32(0) {
105556  		goto _382
105557  	}
105558  	_151_uniqOk = _sqlite3VdbeMakeLabel(tls, _v)
105559  	_151_kk = int32(0)
105560  _383:
105561  	if _151_kk >= int32(_143_pIdx.XnKeyCol) {
105562  		goto _386
105563  	}
105564  	_152_iCol = int32(*elem52(_143_pIdx.XaiColumn, uintptr(_151_kk)))
105565  	func() {
105566  		if _152_iCol == int32(-1) || _152_iCol >= int32(_143_pTab.XnCol) {
105567  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114827), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121324)))
105568  			crt.X__builtin_abort(tls)
105569  		}
105570  	}()
105571  	if (_152_iCol >= int32(0)) && ((elem43((*XColumn)(_143_pTab.XaCol), uintptr(_152_iCol)).XnotNull) != 0) {
105572  		goto _384
105573  	}
105574  	_sqlite3VdbeAddOp2(tls, _v, int32(75), _143_r1+_151_kk, _151_uniqOk)
105575  _384:
105576  	_151_kk += 1
105577  	goto _383
105578  _386:
105579  	_151_jmp6 = _sqlite3VdbeAddOp1(tls, _v, int32(7), _143_iIdxCur+_135_j)
105580  	_sqlite3VdbeGoto(tls, _v, _151_uniqOk)
105581  	_sqlite3VdbeJumpHere(tls, _v, _151_jmp6)
105582  	_sqlite3VdbeAddOp4Int(tls, _v, int32(39), _143_iIdxCur+_135_j, _151_uniqOk, _143_r1, int32(_143_pIdx.XnKeyCol))
105583  	_sqlite3VdbeLoadString(tls, _v, int32(3), str(121358))
105584  	_sqlite3VdbeGoto(tls, _v, _150_jmp5)
105585  	_sqlite3VdbeResolveLabel(tls, _v, _151_uniqOk)
105586  _382:
105587  	_sqlite3VdbeJumpHere(tls, _v, _150_jmp4)
105588  	_sqlite3ResolvePartIdxLabel(tls, _pParse, _150_jmp3)
105589  _377:
105590  	*func() *int32 { _143_pIdx = (*XIndex)(_143_pIdx.XpNext); return &_135_j }() += 1
105591  	goto _376
105592  _380:
105593  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _143_iDataCur, _143_loopTop)
105594  	_sqlite3VdbeJumpHere(tls, _v, _143_loopTop-int32(1))
105595  	if _135_isQuick != 0 {
105596  		goto _392
105597  	}
105598  	_sqlite3VdbeLoadString(tls, _v, int32(2), str(121385))
105599  	*func() **XIndex { _135_j = int32(0); return &_143_pIdx }() = (*XIndex)(_143_pTab.XpIndex)
105600  _393:
105601  	if _143_pIdx == nil {
105602  		goto _396
105603  	}
105604  	if _143_pPk == _143_pIdx {
105605  		goto _394
105606  	}
105607  	_sqlite3VdbeAddOp2(tls, _v, int32(102), _143_iIdxCur+_135_j, int32(3))
105608  	_135_addr = _sqlite3VdbeAddOp3(tls, _v, int32(78), int32(8)+_135_j, int32(0), int32(3))
105609  	_sqlite3VdbeChangeP5(tls, _v, uint16(144))
105610  	_sqlite3VdbeLoadString(tls, _v, int32(3), _143_pIdx.XzName)
105611  	_sqlite3VdbeAddOp3(tls, _v, int32(93), int32(3), int32(2), int32(7))
105612  	_integrityCheckResultRow(tls, _v, int32(7))
105613  	_sqlite3VdbeJumpHere(tls, _v, _135_addr)
105614  _394:
105615  	*func() *int32 { _143_pIdx = (*XIndex)(_143_pIdx.XpNext); return &_135_j }() += 1
105616  	goto _393
105617  _396:
105618  _392:
105619  _345:
105620  	_138_x = (*XHashElem)(_138_x.Xnext)
105621  	goto _344
105622  _347:
105623  _314:
105624  	_135_i += 1
105625  	goto _313
105626  _316:
105627  	_155_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(4), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00endCodeØ006)), _sqlite3PragmaØ00iLnØ005)
105628  	if _155_aOp != nil {
105629  		elem63(_155_aOp, 0).Xp2 = int32(1) - _135_mxErr
105630  		elem63(_155_aOp, uintptr(2)).Xp4type = int8(-2)
105631  		*(**int8)(unsafe.Pointer(&(elem63(_155_aOp, uintptr(2)).Xp4))) = str(121414)
105632  	}
105633  	goto _64
105634  _49:
105635  	if _zRight != nil {
105636  		goto _399
105637  	}
105638  	if _sqlite3ReadSchema(tls, _pParse) != 0 {
105639  		goto _pragma_out
105640  	}
105641  	func() {
105642  		if int32(elem126((*TEncName)(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)), uintptr(1)).Xenc) != int32(1) {
105643  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114925), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121417)))
105644  			crt.X__builtin_abort(tls)
105645  		}
105646  	}()
105647  	func() {
105648  		if int32(elem126((*TEncName)(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)), uintptr(2)).Xenc) != int32(2) {
105649  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114926), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121456)))
105650  			crt.X__builtin_abort(tls)
105651  		}
105652  	}()
105653  	func() {
105654  		if int32(elem126((*TEncName)(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)), uintptr(3)).Xenc) != int32(3) {
105655  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114927), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121501)))
105656  			crt.X__builtin_abort(tls)
105657  		}
105658  	}()
105659  	_returnSingleText(tls, _v, elem126((*TEncName)(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)), uintptr((*Xsqlite3)(_pParse.Xdb).Xenc)).XzName)
105660  	goto _407
105661  _399:
105662  	if (int32((*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema).XschemaFlags)&int32(1)) == int32(1) && (int32((*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema).XschemaFlags)&int32(4)) != int32(4) {
105663  		goto _409
105664  	}
105665  	_157_pEnc = elem126((*TEncName)(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)), 0)
105666  _410:
105667  	if _157_pEnc.XzName == nil {
105668  		goto _413
105669  	}
105670  	if int32(0) == _sqlite3StrICmp(tls, _zRight, _157_pEnc.XzName) {
105671  		(*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema).Xenc = store3(&_db.Xenc, uint8(func() int32 {
105672  			if _157_pEnc.Xenc != 0 {
105673  				return int32(_157_pEnc.Xenc)
105674  			}
105675  			return int32(2)
105676  		}()))
105677  		goto _413
105678  	}
105679  	*(*uintptr)(unsafe.Pointer(&_157_pEnc)) += uintptr(16)
105680  	goto _410
105681  _413:
105682  	if _157_pEnc.XzName == nil {
105683  		_sqlite3ErrorMsg(tls, _pParse, str(121546), unsafe.Pointer(_zRight))
105684  	}
105685  _409:
105686  _407:
105687  	goto _64
105688  _50:
105689  	_164_iCookie = int32(_pPragma.XiArg)
105690  	_sqlite3VdbeUsesBtree(tls, _v, _iDb)
105691  	if _zRight == nil || (int32(_pPragma.XmPragFlg)&int32(8)) != int32(0) {
105692  		goto _419
105693  	}
105694  	_sqlite3VdbeVerifyNoMallocRequired(tls, _v, int32(2))
105695  	_165_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(2), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00setCookieØ008)), int32(0))
105696  	if func() int32 {
105697  		if _165_aOp == nil {
105698  			return func() int32 {
105699  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115000), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(4809)))
105700  				crt.X__builtin_abort(tls)
105701  				return int32(1)
105702  			}()
105703  		}
105704  		return int32(0)
105705  	}() != 0 {
105706  		goto _64
105707  	}
105708  	elem63(_165_aOp, 0).Xp1 = _iDb
105709  	elem63(_165_aOp, uintptr(1)).Xp1 = _iDb
105710  	elem63(_165_aOp, uintptr(1)).Xp2 = _164_iCookie
105711  	elem63(_165_aOp, uintptr(1)).Xp3 = _sqlite3Atoi(tls, _zRight)
105712  	goto _423
105713  _419:
105714  	_sqlite3VdbeVerifyNoMallocRequired(tls, _v, int32(3))
105715  	_166_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(3), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00readCookieØ009)), int32(0))
105716  	if func() int32 {
105717  		if _166_aOp == nil {
105718  			return func() int32 {
105719  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115015), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(4809)))
105720  				crt.X__builtin_abort(tls)
105721  				return int32(1)
105722  			}()
105723  		}
105724  		return int32(0)
105725  	}() != 0 {
105726  		goto _64
105727  	}
105728  	elem63(_166_aOp, 0).Xp1 = _iDb
105729  	elem63(_166_aOp, uintptr(1)).Xp1 = _iDb
105730  	elem63(_166_aOp, uintptr(1)).Xp3 = _164_iCookie
105731  	_sqlite3VdbeReusable(tls, _v)
105732  _423:
105733  	goto _64
105734  _51:
105735  	_167_i = int32(0)
105736  	_pParse.XnMem = int32(1)
105737  _427:
105738  	if store1(&_167_zOpt, Xsqlite3_compileoption_get(tls, postInc2(&_167_i, 1))) != nil {
105739  		_sqlite3VdbeLoadString(tls, _v, int32(1), _167_zOpt)
105740  		_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(1))
105741  		goto _427
105742  	}
105743  	_sqlite3VdbeReusable(tls, _v)
105744  	goto _64
105745  _52:
105746  	_169_iBt = func() int32 {
105747  		if _pId2.Xz != nil {
105748  			return _iDb
105749  		}
105750  		return int32(10)
105751  	}()
105752  	_169_eMode = int32(0)
105753  	if _zRight == nil {
105754  		goto _431
105755  	}
105756  	if _sqlite3StrICmp(tls, _zRight, str(121571)) == int32(0) {
105757  		_169_eMode = int32(1)
105758  		goto _436
105759  	}
105760  	if _sqlite3StrICmp(tls, _zRight, str(121576)) == int32(0) {
105761  		_169_eMode = int32(2)
105762  		goto _436
105763  	}
105764  	if _sqlite3StrICmp(tls, _zRight, str(89703)) == int32(0) {
105765  		_169_eMode = int32(3)
105766  	}
105767  _436:
105768  _431:
105769  	_pParse.XnMem = int32(3)
105770  	_sqlite3VdbeAddOp3(tls, _v, int32(8), _169_iBt, _169_eMode, int32(1))
105771  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(3))
105772  	goto _64
105773  _53:
105774  	if _zRight != nil {
105775  		Xsqlite3_wal_autocheckpoint(tls, _db, _sqlite3Atoi(tls, _zRight))
105776  	}
105777  	_returnSingleInt(tls, _v, int64(func() int32 {
105778  		if *(*uintptr)(unsafe.Pointer(&struct {
105779  			f func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32
105780  		}{func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32 {
105781  			v := _db.XxWalCallback
105782  			return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&v))
105783  		}()})) == *(*uintptr)(unsafe.Pointer(&struct {
105784  			f func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32
105785  		}{_sqlite3WalDefaultHook})) {
105786  			return int32(int64(crt.P2U(_db.XpWalArg)))
105787  		}
105788  		return int32(0)
105789  	}()))
105790  	goto _64
105791  _54:
105792  	Xsqlite3_db_release_memory(tls, _db)
105793  	goto _64
105794  _55:
105795  	if _zRight == nil {
105796  		goto _440
105797  	}
105798  	_177_opMask = uint32(_sqlite3Atoi(tls, _zRight))
105799  	if (_177_opMask & uint32(2)) == (0) {
105800  		goto _64
105801  	}
105802  	goto _442
105803  _440:
105804  	_177_opMask = uint32(65534)
105805  _442:
105806  	_177_iTabCur = postInc2(&_pParse.XnTab, 1)
105807  	_177_iDbLast = func() int32 {
105808  		if _zDb != nil {
105809  			return _iDb
105810  		}
105811  		return (_db.XnDb - int32(1))
105812  	}()
105813  _445:
105814  	if _iDb > _177_iDbLast {
105815  		goto _448
105816  	}
105817  	if _iDb == int32(1) {
105818  		goto _446
105819  	}
105820  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
105821  	_177_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
105822  	_177_k = (*XHashElem)(_177_pSchema.XtblHash.Xfirst)
105823  _450:
105824  	if _177_k == nil {
105825  		goto _453
105826  	}
105827  	_177_pTab = (*XTable)(_177_k.Xdata)
105828  	if (_177_pTab.XtabFlags & uint32(256)) == (0) {
105829  		goto _451
105830  	}
105831  	_177_szThreshold = int16(int32(_177_pTab.XnRowLogEst) + int32(46))
105832  	func() {
105833  		if int32(_sqlite3LogEst(tls, uint64(25))) != int32(46) {
105834  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115184), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121584)))
105835  			crt.X__builtin_abort(tls)
105836  		}
105837  	}()
105838  	_177_pIdx = (*XIndex)(_177_pTab.XpIndex)
105839  _457:
105840  	if _177_pIdx == nil {
105841  		goto _460
105842  	}
105843  	if ((uint32(_177_pIdx.XidxType>>7) << 31) >> 31) == 0 {
105844  		_177_szThreshold = 0
105845  		goto _460
105846  	}
105847  	_177_pIdx = (*XIndex)(_177_pIdx.XpNext)
105848  	goto _457
105849  _460:
105850  	if _177_szThreshold != 0 {
105851  		_sqlite3OpenTable(tls, _pParse, _177_iTabCur, _iDb, _177_pTab, int32(106))
105852  		_sqlite3VdbeAddOp3(tls, _v, int32(34), _177_iTabCur, int32(uint32(_sqlite3VdbeCurrentAddr(tls, _v)+int32(2))+(_177_opMask&uint32(1))), int32(_177_szThreshold))
105853  	}
105854  	_177_zSubSql = _sqlite3MPrintf(tls, _db, str(121606), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(_177_pTab.XzName))
105855  	if (_177_opMask & uint32(1)) != 0 {
105856  		_185_r1 = _sqlite3GetTempReg(tls, _pParse)
105857  		_sqlite3VdbeAddOp4(tls, _v, int32(97), int32(0), _185_r1, int32(0), _177_zSubSql, int32(-1))
105858  		_sqlite3VdbeAddOp2(tls, _v, int32(67), _185_r1, int32(1))
105859  		goto _464
105860  	}
105861  	_sqlite3VdbeAddOp4(tls, _v, int32(138), int32(0), int32(0), int32(0), _177_zSubSql, int32(-1))
105862  _464:
105863  _451:
105864  	_177_k = (*XHashElem)(_177_k.Xnext)
105865  	goto _450
105866  _453:
105867  _446:
105868  	_iDb += 1
105869  	goto _445
105870  _448:
105871  	_sqlite3VdbeAddOp0(tls, _v, int32(153))
105872  	goto _64
105873  _56:
105874  	func() {
105875  		if int32(_pPragma.XePragTyp) != int32(3) {
105876  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115222), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121624)))
105877  			crt.X__builtin_abort(tls)
105878  		}
105879  	}()
105880  	if _zRight != nil {
105881  		Xsqlite3_busy_timeout(tls, _db, _sqlite3Atoi(tls, _zRight))
105882  	}
105883  	_returnSingleInt(tls, _v, int64(_db.XbusyTimeout))
105884  	goto _64
105885  _57:
105886  	if (_zRight != nil) && (_sqlite3DecOrHexToI64(tls, _zRight, &_189_N) == int32(0)) {
105887  		Xsqlite3_soft_heap_limit64(tls, _189_N)
105888  	}
105889  	_returnSingleInt(tls, _v, Xsqlite3_soft_heap_limit64(tls, int64(-1)))
105890  	goto _64
105891  _58:
105892  	if ((_zRight != nil) && (_sqlite3DecOrHexToI64(tls, _zRight, &_191_N) == int32(0))) && (_191_N >= (0)) {
105893  		Xsqlite3_limit(tls, _db, int32(11), int32(_191_N&int64(2147483647)))
105894  	}
105895  	_returnSingleInt(tls, _v, int64(Xsqlite3_limit(tls, _db, int32(11), int32(-1))))
105896  	goto _64
105897  _59:
105898  	_pParse.XnMem = int32(2)
105899  	_193_i = int32(0)
105900  _473:
105901  	if _193_i >= _db.XnDb {
105902  		goto _476
105903  	}
105904  	_194_zState = str(121664)
105905  	if (elem27((*XDb)(_db.XaDb), uintptr(_193_i)).XzDbSName) == nil {
105906  		goto _474
105907  	}
105908  	_194_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_193_i)).XpBt)
105909  	if (_194_pBt == nil) || (_sqlite3BtreePager(tls, _194_pBt) == nil) {
105910  		_194_zState = str(121672)
105911  		goto _483
105912  	}
105913  	if Xsqlite3_file_control(tls, _db, func() *int8 {
105914  		if _193_i != 0 {
105915  			return (elem27((*XDb)(_db.XaDb), uintptr(_193_i)).XzDbSName)
105916  		}
105917  		return nil
105918  	}(), int32(1), unsafe.Pointer(&_194_j)) == int32(0) {
105919  		_194_zState = *elem0((**int8)(unsafe.Pointer(&_sqlite3PragmaØ00azLockNameØ0010)), uintptr(_194_j))
105920  	}
105921  _483:
105922  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(121679), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_193_i)).XzDbSName), unsafe.Pointer(_194_zState))
105923  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(2))
105924  _474:
105925  	_193_i += 1
105926  	goto _473
105927  _476:
105928  	goto _64
105929  _64:
105930  	if (int32(_pPragma.XmPragFlg)&int32(4)) != 0 && (_zRight != nil) {
105931  		_sqlite3VdbeVerifyNoResultRow(tls, _v)
105932  	}
105933  _pragma_out:
105934  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zLeft))
105935  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zRight))
105936  	_ = _aFcntl
105937  	_ = _103_azOrigin
105938  	_ = _106_i
105939  	_ = _167_i
105940  }
105941  
105942  // C comment
105943  //  /*
105944  //  ** Mark the VDBE as one that can only be run one time.
105945  //  */
105946  func _sqlite3VdbeRunOnlyOnce(tls *crt.TLS, _p *TVdbe) {
105947  	storebits26(&_p.Xexpired, int16(1), 32, 5)
105948  }
105949  
105950  var _sqlite3PragmaØ00__func__Ø000 [14]int8
105951  
105952  func init() {
105953  	crt.Xstrncpy(nil, &_sqlite3PragmaØ00__func__Ø000[0], str(121682), 14)
105954  }
105955  
105956  // C comment
105957  //  /*
105958  //  ** Invoke the xFileControl method on a particular database.
105959  //  */
105960  func Xsqlite3_file_control(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8, _op int32, _pArg unsafe.Pointer) (r0 int32) {
105961  	var _rc int32
105962  	var _pBtree *XBtree
105963  	var _1_pPager *XPager
105964  	var _1_fd *Xsqlite3_file
105965  	_rc = int32(1)
105966  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
105967  		return _sqlite3MisuseError(tls, int32(143986))
105968  	}
105969  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
105970  	_pBtree = _sqlite3DbNameToBtree(tls, _db, _zDbName)
105971  	if _pBtree == nil {
105972  		goto _1
105973  	}
105974  	_sqlite3BtreeEnter(tls, _pBtree)
105975  	_1_pPager = _sqlite3BtreePager(tls, _pBtree)
105976  	func() {
105977  		if _1_pPager == nil {
105978  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143995), unsafe.Pointer(&_sqlite3_file_controlØ00__func__Ø000), unsafe.Pointer(str(15819)))
105979  			crt.X__builtin_abort(tls)
105980  		}
105981  	}()
105982  	_1_fd = _sqlite3PagerFile(tls, _1_pPager)
105983  	func() {
105984  		if _1_fd == nil {
105985  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143997), unsafe.Pointer(&_sqlite3_file_controlØ00__func__Ø000), unsafe.Pointer(str(121696)))
105986  			crt.X__builtin_abort(tls)
105987  		}
105988  	}()
105989  	if _op == int32(7) {
105990  		*(**Xsqlite3_file)(_pArg) = _1_fd
105991  		_rc = int32(0)
105992  		goto _13
105993  	}
105994  	if _op == int32(27) {
105995  		*(**Xsqlite3_vfs)(_pArg) = _sqlite3PagerVfs(tls, _1_pPager)
105996  		_rc = int32(0)
105997  		goto _13
105998  	}
105999  	if _op == int32(28) {
106000  		*(**Xsqlite3_file)(_pArg) = _sqlite3PagerJrnlFile(tls, _1_pPager)
106001  		_rc = int32(0)
106002  		goto _13
106003  	}
106004  	if _1_fd.XpMethods != nil {
106005  		_rc = _sqlite3OsFileControl(tls, _1_fd, _op, _pArg)
106006  		goto _13
106007  	}
106008  	_rc = int32(12)
106009  _13:
106010  	_sqlite3BtreeLeave(tls, _pBtree)
106011  _1:
106012  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106013  	return _rc
106014  }
106015  
106016  // C comment
106017  //  /*
106018  //  ** Return the Btree pointer identified by zDbName.  Return NULL if not found.
106019  //  */
106020  func _sqlite3DbNameToBtree(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 *XBtree) {
106021  	var _iDb int32
106022  	_iDb = func() int32 {
106023  		if _zDbName != nil {
106024  			return _sqlite3FindDbName(tls, _db, _zDbName)
106025  		}
106026  		return int32(0)
106027  	}()
106028  	return func() *XBtree {
106029  		if _iDb < int32(0) {
106030  			return nil
106031  		}
106032  		return (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt)
106033  	}()
106034  }
106035  
106036  var _sqlite3_file_controlØ00__func__Ø000 [21]int8
106037  
106038  func init() {
106039  	crt.Xstrncpy(nil, &_sqlite3_file_controlØ00__func__Ø000[0], str(121702), 21)
106040  }
106041  
106042  // C comment
106043  //  /*
106044  //  ** Return the file handle for the journal file (if it exists).
106045  //  ** This will be either the rollback journal or the WAL file.
106046  //  */
106047  func _sqlite3PagerJrnlFile(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_file) {
106048  	return func() *Xsqlite3_file {
106049  		if _pPager.XpWal != nil {
106050  			return _sqlite3WalFile(tls, (*XWal)(_pPager.XpWal))
106051  		}
106052  		return (*Xsqlite3_file)(_pPager.Xjfd)
106053  	}()
106054  }
106055  
106056  // C comment
106057  //  /* Return the sqlite3_file object for the WAL file
106058  //  */
106059  func _sqlite3WalFile(tls *crt.TLS, _pWal *XWal) (r0 *Xsqlite3_file) {
106060  	return (*Xsqlite3_file)(_pWal.XpWalFd)
106061  }
106062  
106063  // C comment
106064  //  /*
106065  //  ** Generate code to return a single text value.
106066  //  */
106067  func _returnSingleText(tls *crt.TLS, _v *TVdbe, _zValue *int8) {
106068  	if _zValue != nil {
106069  		_sqlite3VdbeLoadString(tls, _v, int32(1), _zValue)
106070  		_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(1))
106071  	}
106072  }
106073  
106074  // C comment
106075  //  /*
106076  //  ** Set result column names for a pragma.
106077  //  */
106078  func _setPragmaResultColumnNames(tls *crt.TLS, _v *TVdbe, _pPragma *XPragmaName) {
106079  	var _2_i, _2_j int32
106080  	var _n uint8
106081  	_n = _pPragma.XnPragCName
106082  	_sqlite3VdbeSetNumCols(tls, _v, func() int32 {
106083  		if int32(_n) == int32(0) {
106084  			return int32(1)
106085  		}
106086  		return int32(_n)
106087  	}())
106088  	if int32(_n) == int32(0) {
106089  		_sqlite3VdbeSetColName(tls, _v, int32(0), int32(0), _pPragma.XzName, nil)
106090  		goto _3
106091  	}
106092  	*func() *int32 { _2_i = int32(0); return &_2_j }() = int32(_pPragma.XiPragCName)
106093  _4:
106094  	if _2_i >= int32(_n) {
106095  		goto _7
106096  	}
106097  	_sqlite3VdbeSetColName(tls, _v, _2_i, int32(0), *elem0((**int8)(unsafe.Pointer(&_pragCName)), uintptr(_2_j)), nil)
106098  	*func() *int32 { _2_i += 1; return &_2_j }() += 1
106099  	goto _4
106100  _7:
106101  _3:
106102  }
106103  
106104  func _sqlite3VdbeVerifyNoMallocRequired(tls *crt.TLS, _p *TVdbe, _N int32) {
106105  	func() {
106106  		if (_p.XnOp + _N) > ((*XParse)(_p.XpParse).XnOpAlloc) {
106107  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72075), unsafe.Pointer(&_sqlite3VdbeVerifyNoMallocRequiredØ00__func__Ø000), unsafe.Pointer(str(121723)))
106108  			crt.X__builtin_abort(tls)
106109  		}
106110  	}()
106111  }
106112  
106113  var _sqlite3VdbeVerifyNoMallocRequiredØ00__func__Ø000 [34]int8
106114  
106115  func init() {
106116  	crt.Xstrncpy(nil, &_sqlite3VdbeVerifyNoMallocRequiredØ00__func__Ø000[0], str(121757), 34)
106117  }
106118  
106119  var _sqlite3PragmaØ00getCacheSizeØ002 [9]XVdbeOpList
106120  
106121  func init() {
106122  	_sqlite3PragmaØ00getCacheSizeØ002 = [9]XVdbeOpList{XVdbeOpList{Xopcode: uint8(2)}, XVdbeOpList{Xopcode: uint8(103), Xp2: int8(1), Xp3: int8(3)}, XVdbeOpList{Xopcode: uint8(46), Xp1: int8(1), Xp2: int8(8)}, XVdbeOpList{Xopcode: uint8(56), Xp2: int8(2)}, XVdbeOpList{Xopcode: uint8(89), Xp1: int8(1), Xp2: int8(2), Xp3: int8(1)}, XVdbeOpList{Xopcode: uint8(46), Xp1: int8(1), Xp2: int8(8)}, XVdbeOpList{Xopcode: uint8(56), Xp2: int8(1)}, XVdbeOpList{Xopcode: uint8(164)}, XVdbeOpList{Xopcode: uint8(67), Xp1: int8(1), Xp2: int8(1)}}
106123  }
106124  
106125  var _sqlite3PragmaØ00iLnØ001 int32
106126  
106127  // C comment
106128  //  /*
106129  //  ** Generate code to return a single integer value.
106130  //  */
106131  func _returnSingleInt(tls *crt.TLS, _v *TVdbe, _value int64) {
106132  	_sqlite3VdbeAddOp4Dup8(tls, _v, int32(57), int32(0), int32(1), int32(0), (*uint8)(unsafe.Pointer(&_value)), int32(-10))
106133  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(1))
106134  }
106135  
106136  // C comment
106137  //  /*
106138  //  ** Set the BTS_SECURE_DELETE flag if newFlag is 0 or 1.  If newFlag is -1,
106139  //  ** then make no changes.  Always return the value of the BTS_SECURE_DELETE
106140  //  ** setting after the change.
106141  //  */
106142  func _sqlite3BtreeSecureDelete(tls *crt.TLS, _p *XBtree, _newFlag int32) (r0 int32) {
106143  	var _b int32
106144  	if _p == nil {
106145  		return int32(0)
106146  	}
106147  	_sqlite3BtreeEnter(tls, _p)
106148  	if _newFlag < int32(0) {
106149  		goto _1
106150  	}
106151  	{
106152  		p := &((*XBtShared)(_p.XpBt).XbtsFlags)
106153  		*p = uint16(int32(*p) & int32(-5))
106154  	}
106155  	if _newFlag != 0 {
106156  		{
106157  			p := &((*XBtShared)(_p.XpBt).XbtsFlags)
106158  			*p = uint16(int32(*p) | int32(4))
106159  		}
106160  	}
106161  _1:
106162  	_b = bool2int((int32((*XBtShared)(_p.XpBt).XbtsFlags) & int32(4)) != int32(0))
106163  	_sqlite3BtreeLeave(tls, _p)
106164  	return _b
106165  }
106166  
106167  // C comment
106168  //  /*
106169  //  ** Interpret the given string as a locking mode value.
106170  //  */
106171  func _getLockingMode(tls *crt.TLS, _z *int8) (r0 int32) {
106172  	if _z == nil {
106173  		goto _0
106174  	}
106175  	if int32(0) == _sqlite3StrICmp(tls, _z, str(89660)) {
106176  		return int32(1)
106177  	}
106178  	if int32(0) == _sqlite3StrICmp(tls, _z, str(89670)) {
106179  		return int32(0)
106180  	}
106181  _0:
106182  	return int32(-1)
106183  }
106184  
106185  // C comment
106186  //  /*
106187  //  ** Get/set the locking-mode for this pager. Parameter eMode must be one
106188  //  ** of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or
106189  //  ** PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _QUERY, then
106190  //  ** the locking-mode is set to the value specified.
106191  //  **
106192  //  ** The returned value is either PAGER_LOCKINGMODE_NORMAL or
106193  //  ** PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated)
106194  //  ** locking-mode.
106195  //  */
106196  func _sqlite3PagerLockingMode(tls *crt.TLS, _pPager *XPager, _eMode int32) (r0 int32) {
106197  	func() {
106198  		if _eMode != int32(-1) && _eMode != int32(0) && _eMode != int32(1) {
106199  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54047), unsafe.Pointer(&_sqlite3PagerLockingModeØ00__func__Ø000), unsafe.Pointer(str(121791)))
106200  			crt.X__builtin_abort(tls)
106201  		}
106202  	}()
106203  
106204  	func() {
106205  		if _pPager.XexclusiveMode == 0 && int32(0) != _sqlite3WalHeapMemory(tls, (*XWal)(_pPager.XpWal)) {
106206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54052), unsafe.Pointer(&_sqlite3PagerLockingModeØ00__func__Ø000), unsafe.Pointer(str(121895)))
106207  			crt.X__builtin_abort(tls)
106208  		}
106209  	}()
106210  	if ((_eMode >= int32(0)) && (_pPager.XtempFile == 0)) && (_sqlite3WalHeapMemory(tls, (*XWal)(_pPager.XpWal)) == 0) {
106211  		_pPager.XexclusiveMode = uint8(_eMode)
106212  	}
106213  	return int32(_pPager.XexclusiveMode)
106214  }
106215  
106216  var _sqlite3PagerLockingModeØ00__func__Ø000 [24]int8
106217  
106218  func init() {
106219  	crt.Xstrncpy(nil, &_sqlite3PagerLockingModeØ00__func__Ø000[0], str(121958), 24)
106220  }
106221  
106222  // C comment
106223  //  /*
106224  //  ** Return true if the argument is non-NULL and the WAL module is using
106225  //  ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the
106226  //  ** WAL module is using shared-memory, return false.
106227  //  */
106228  func _sqlite3WalHeapMemory(tls *crt.TLS, _pWal *XWal) (r0 int32) {
106229  	return bool2int((_pWal != nil) && (int32(_pWal.XexclusiveMode) == int32(2)))
106230  }
106231  
106232  // C comment
106233  //  /*
106234  //  ** Get/set the size-limit used for persistent journal files.
106235  //  **
106236  //  ** Setting the size limit to -1 means no limit is enforced.
106237  //  ** An attempt to set a limit smaller than -1 is a no-op.
106238  //  */
106239  func _sqlite3PagerJournalSizeLimit(tls *crt.TLS, _pPager *XPager, _iLimit int64) (r0 int64) {
106240  	if _iLimit >= int64(-1) {
106241  		_pPager.XjournalSizeLimit = _iLimit
106242  		_sqlite3WalLimit(tls, (*XWal)(_pPager.XpWal), _iLimit)
106243  	}
106244  	return _pPager.XjournalSizeLimit
106245  }
106246  
106247  // C comment
106248  //  /*
106249  //  ** Change the size to which the WAL file is trucated on each reset.
106250  //  */
106251  func _sqlite3WalLimit(tls *crt.TLS, _pWal *XWal, _iLimit int64) {
106252  	if _pWal != nil {
106253  		_pWal.XmxWalSize = _iLimit
106254  	}
106255  }
106256  
106257  // C comment
106258  //  /*
106259  //  ** Interpret the given string as an auto-vacuum mode value.
106260  //  **
106261  //  ** The following strings, "none", "full" and "incremental" are
106262  //  ** acceptable, as are their numeric equivalents: 0, 1 and 2 respectively.
106263  //  */
106264  func _getAutoVacuum(tls *crt.TLS, _z *int8) (r0 int32) {
106265  	var _i int32
106266  	if int32(0) == _sqlite3StrICmp(tls, _z, str(42852)) {
106267  		return int32(0)
106268  	}
106269  	if int32(0) == _sqlite3StrICmp(tls, _z, str(121571)) {
106270  		return int32(1)
106271  	}
106272  	if int32(0) == _sqlite3StrICmp(tls, _z, str(121982)) {
106273  		return int32(2)
106274  	}
106275  	_i = _sqlite3Atoi(tls, _z)
106276  	return int32(uint8(func() int32 {
106277  		if (_i >= int32(0)) && (_i <= int32(2)) {
106278  			return _i
106279  		}
106280  		return int32(0)
106281  	}()))
106282  }
106283  
106284  var _sqlite3PragmaØ00setMeta6Ø004 [5]XVdbeOpList
106285  
106286  func init() {
106287  	_sqlite3PragmaØ00setMeta6Ø004 = [5]XVdbeOpList{XVdbeOpList{Xopcode: uint8(2), Xp2: int8(1)}, XVdbeOpList{Xopcode: uint8(103), Xp2: int8(1), Xp3: int8(4)}, XVdbeOpList{Xopcode: uint8(21), Xp1: int8(1)}, XVdbeOpList{Xopcode: uint8(55), Xp2: int8(2)}, XVdbeOpList{Xopcode: uint8(104), Xp2: int8(7)}}
106288  }
106289  
106290  var _sqlite3PragmaØ00iLnØ003 int32
106291  
106292  func _setAllPagerFlags(tls *crt.TLS, _db *Xsqlite3) {
106293  	var _1_n int32
106294  	var _1_pDb *XDb
106295  	if _db.XautoCommit == 0 {
106296  		goto _0
106297  	}
106298  	_1_pDb = (*XDb)(_db.XaDb)
106299  	_1_n = _db.XnDb
106300  
106301  	func() {
106302  		if (int32(_1_pDb.Xsafety_level) & int32(7)) != int32(_1_pDb.Xsafety_level) {
106303  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113447), unsafe.Pointer(&_setAllPagerFlagsØ00__func__Ø000), unsafe.Pointer(str(121994)))
106304  			crt.X__builtin_abort(tls)
106305  		}
106306  	}()
106307  _3:
106308  	if postInc2(&_1_n, -1) <= int32(0) {
106309  		goto _4
106310  	}
106311  	if _1_pDb.XpBt != nil {
106312  		_sqlite3BtreeSetPagerFlags(tls, (*XBtree)(_1_pDb.XpBt), uint32(int32(_1_pDb.Xsafety_level)|(_db.Xflags&int32(56))))
106313  	}
106314  	*(*uintptr)(unsafe.Pointer(&_1_pDb)) += uintptr(32)
106315  	goto _3
106316  _4:
106317  _0:
106318  	_ = _1_n
106319  }
106320  
106321  var _setAllPagerFlagsØ00__func__Ø000 [17]int8
106322  
106323  func init() {
106324  	crt.Xstrncpy(nil, &_setAllPagerFlagsØ00__func__Ø000[0], str(122058), 17)
106325  }
106326  
106327  // C comment
106328  //  /*
106329  //  ** Change the limit on the amount of the database file that may be
106330  //  ** memory mapped.
106331  //  */
106332  func _sqlite3BtreeSetMmapLimit(tls *crt.TLS, _p *XBtree, _szMmap int64) (r0 int32) {
106333  	var _pBt *XBtShared
106334  	_pBt = (*XBtShared)(_p.XpBt)
106335  	func() {
106336  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
106337  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61696), unsafe.Pointer(&_sqlite3BtreeSetMmapLimitØ00__func__Ø000), unsafe.Pointer(str(8939)))
106338  			crt.X__builtin_abort(tls)
106339  		}
106340  	}()
106341  	_sqlite3BtreeEnter(tls, _p)
106342  	_sqlite3PagerSetMmapLimit(tls, (*XPager)(_pBt.XpPager), _szMmap)
106343  	_sqlite3BtreeLeave(tls, _p)
106344  	return int32(0)
106345  }
106346  
106347  var _sqlite3BtreeSetMmapLimitØ00__func__Ø000 [25]int8
106348  
106349  func init() {
106350  	crt.Xstrncpy(nil, &_sqlite3BtreeSetMmapLimitØ00__func__Ø000[0], str(122075), 25)
106351  }
106352  
106353  // C comment
106354  //  /*
106355  //  ** If the TEMP database is open, close it and mark the database schema
106356  //  ** as needing reloading.  This must be done when using the SQLITE_TEMP_STORE
106357  //  ** or DEFAULT_TEMP_STORE pragmas.
106358  //  */
106359  func _changeTempStorage(tls *crt.TLS, _pParse *XParse, _zStorageType *int8) (r0 int32) {
106360  	var _ts int32
106361  	var _db *Xsqlite3
106362  	_ts = _getTempStore(tls, _zStorageType)
106363  	_db = (*Xsqlite3)(_pParse.Xdb)
106364  	if int32(_db.Xtemp_store) == _ts {
106365  		return int32(0)
106366  	}
106367  	if _invalidateTempStorage(tls, _pParse) != int32(0) {
106368  		return int32(1)
106369  	}
106370  	_db.Xtemp_store = uint8(_ts)
106371  	return int32(0)
106372  }
106373  
106374  // C comment
106375  //  /*
106376  //  ** Interpret the given string as a temp db location. Return 1 for file
106377  //  ** backed temporary databases, 2 for the Red-Black tree in memory database
106378  //  ** and 0 to use the compile-time default.
106379  //  */
106380  func _getTempStore(tls *crt.TLS, _z *int8) (r0 int32) {
106381  	if (int32(*elem1(_z, 0)) >= int32(48)) && (int32(*elem1(_z, 0)) <= int32(50)) {
106382  		return int32(*elem1(_z, 0)) - int32(48)
106383  	}
106384  	if _sqlite3StrICmp(tls, _z, str(93808)) == int32(0) {
106385  		return int32(1)
106386  	}
106387  	if _sqlite3StrICmp(tls, _z, str(89677)) == int32(0) {
106388  		return int32(2)
106389  	}
106390  	return int32(0)
106391  }
106392  
106393  // C comment
106394  //  /*
106395  //  ** Invalidate temp storage, either when the temp storage is changed
106396  //  ** from default, or when 'file' and the temp_store_directory has changed
106397  //  */
106398  func _invalidateTempStorage(tls *crt.TLS, _pParse *XParse) (r0 int32) {
106399  	var _db *Xsqlite3
106400  	_db = (*Xsqlite3)(_pParse.Xdb)
106401  	if (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt) == nil {
106402  		goto _0
106403  	}
106404  	if (_db.XautoCommit == 0) || _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt)) != 0 {
106405  		_sqlite3ErrorMsg(tls, _pParse, str(122100))
106406  		return int32(1)
106407  	}
106408  	_sqlite3BtreeClose(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt))
106409  	*(**XBtree)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt))) = nil
106410  	_sqlite3ResetAllSchemasOfConnection(tls, _db)
106411  _0:
106412  	return int32(0)
106413  }
106414  
106415  // C comment
106416  //  /*
106417  //  ** CAPI3REF: Name Of The Folder Holding Temporary Files
106418  //  **
106419  //  ** ^(If this global variable is made to point to a string which is
106420  //  ** the name of a folder (a.k.a. directory), then all temporary files
106421  //  ** created by SQLite when using a built-in [sqlite3_vfs | VFS]
106422  //  ** will be placed in that directory.)^  ^If this variable
106423  //  ** is a NULL pointer, then SQLite performs a search for an appropriate
106424  //  ** temporary file directory.
106425  //  **
106426  //  ** Applications are strongly discouraged from using this global variable.
106427  //  ** It is required to set a temporary folder on Windows Runtime (WinRT).
106428  //  ** But for all other platforms, it is highly recommended that applications
106429  //  ** neither read nor write this variable.  This global variable is a relic
106430  //  ** that exists for backwards compatibility of legacy applications and should
106431  //  ** be avoided in new projects.
106432  //  **
106433  //  ** It is not safe to read or modify this variable in more than one
106434  //  ** thread at a time.  It is not safe to read or modify this variable
106435  //  ** if a [database connection] is being used at the same time in a separate
106436  //  ** thread.
106437  //  ** It is intended that this variable be set once
106438  //  ** as part of process initialization and before any SQLite interface
106439  //  ** routines have been called and that this variable remain unchanged
106440  //  ** thereafter.
106441  //  **
106442  //  ** ^The [temp_store_directory pragma] may modify this variable and cause
106443  //  ** it to point to memory obtained from [sqlite3_malloc].  ^Furthermore,
106444  //  ** the [temp_store_directory pragma] always assumes that any string
106445  //  ** that this variable points to is held in memory obtained from
106446  //  ** [sqlite3_malloc] and the pragma may attempt to free that memory
106447  //  ** using [sqlite3_free].
106448  //  ** Hence, if this variable is modified directly, either it should be
106449  //  ** made NULL or made to point to memory obtained from [sqlite3_malloc]
106450  //  ** or else the use of the [temp_store_directory pragma] should be avoided.
106451  //  ** Except when requested by the [temp_store_directory pragma], SQLite
106452  //  ** does not free the memory that sqlite3_temp_directory points to.  If
106453  //  ** the application wants that memory to be freed, it must do
106454  //  ** so itself, taking care to only do so after all [database connection]
106455  //  ** objects have been destroyed.
106456  //  **
106457  //  ** <b>Note to Windows Runtime users:</b>  The temporary directory must be set
106458  //  ** prior to calling [sqlite3_open] or [sqlite3_open_v2].  Otherwise, various
106459  //  ** features that require the use of temporary files may fail.  Here is an
106460  //  ** example of how to do this using C++ with the Windows Runtime:
106461  //  **
106462  //  ** <blockquote><pre>
106463  //  ** LPCWSTR zPath = Windows::Storage::ApplicationData::Current->
106464  //  ** &nbsp;     TemporaryFolder->Path->Data();
106465  //  ** char zPathBuf&#91;MAX_PATH + 1&#93;;
106466  //  ** memset(zPathBuf, 0, sizeof(zPathBuf));
106467  //  ** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf),
106468  //  ** &nbsp;     NULL, NULL);
106469  //  ** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf);
106470  //  ** </pre></blockquote>
106471  //  */
106472  var Xsqlite3_temp_directory *int8
106473  
106474  // C comment
106475  //  /*
106476  //  ** Generate code that initializes multiple registers to string or integer
106477  //  ** constants.  The registers begin with iDest and increase consecutively.
106478  //  ** One register is initialized for each characgter in zTypes[].  For each
106479  //  ** "s" character in zTypes[], the register is a string if the argument is
106480  //  ** not NULL, or OP_Null if the value is a null pointer.  For each "i" character
106481  //  ** in zTypes[], the register is initialized to an integer.
106482  //  */
106483  func _sqlite3VdbeMultiLoad(tls *crt.TLS, _p *TVdbe, _iDest int32, _zTypes *int8, args ...interface{}) {
106484  	var _i int32
106485  	var _c int8
106486  	var _2_z *int8
106487  	var _ap []interface{}
106488  	_ap = args
106489  	_i = int32(0)
106490  _0:
106491  	if int32(store5(&_c, *elem1(_zTypes, uintptr(_i)))) == int32(0) {
106492  		goto _3
106493  	}
106494  	if int32(_c) == int32(115) {
106495  		_2_z = (*int8)(crt.VAPointer(&_ap))
106496  		_sqlite3VdbeAddOp4(tls, _p, func() int32 {
106497  			if _2_z == nil {
106498  				return int32(59)
106499  			}
106500  			return int32(97)
106501  		}(), int32(0), postInc2(&_iDest, 1), int32(0), _2_z, int32(0))
106502  		goto _7
106503  	}
106504  	func() {
106505  		if int32(_c) != int32(105) {
106506  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71676), unsafe.Pointer(&_sqlite3VdbeMultiLoadØ00__func__Ø000), unsafe.Pointer(str(122162)))
106507  			crt.X__builtin_abort(tls)
106508  		}
106509  	}()
106510  	_sqlite3VdbeAddOp2(tls, _p, int32(56), crt.VAInt32(&_ap), postInc2(&_iDest, 1))
106511  _7:
106512  	_i += 1
106513  	goto _0
106514  _3:
106515  	_ap = nil
106516  }
106517  
106518  var _sqlite3VdbeMultiLoadØ00__func__Ø000 [21]int8
106519  
106520  func init() {
106521  	crt.Xstrncpy(nil, &_sqlite3VdbeMultiLoadØ00__func__Ø000[0], str(122169), 21)
106522  }
106523  
106524  func _actionName(tls *crt.TLS, _action uint8) (r0 *int8) {
106525  	var _zName *int8
106526  	switch int32(_action) {
106527  	case int32(6):
106528  		goto _4
106529  	case int32(7):
106530  		goto _1
106531  	case int32(8):
106532  		goto _2
106533  	case int32(9):
106534  		goto _3
106535  	default:
106536  		goto _5
106537  	}
106538  
106539  _1:
106540  	_zName = str(122190)
106541  	goto _6
106542  _2:
106543  	_zName = str(122199)
106544  	goto _6
106545  _3:
106546  	_zName = str(25132)
106547  	goto _6
106548  _4:
106549  	_zName = str(25285)
106550  	goto _6
106551  _5:
106552  	_zName = str(122211)
106553  	func() {
106554  		if int32(_action) != int32(0) {
106555  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113474), unsafe.Pointer(&_actionNameØ00__func__Ø000), unsafe.Pointer(str(122221)))
106556  			crt.X__builtin_abort(tls)
106557  		}
106558  	}()
106559  	goto _6
106560  _6:
106561  	return _zName
106562  }
106563  
106564  var _actionNameØ00__func__Ø000 [11]int8
106565  
106566  func init() {
106567  	crt.Xstrncpy(nil, &_actionNameØ00__func__Ø000[0], str(122237), 11)
106568  }
106569  
106570  // C comment
106571  //  /*
106572  //  ** Turn parser tracing on by giving a stream to which to write the trace
106573  //  ** and a prompt to preface each trace message.  Tracing is turned off
106574  //  ** by making either argument NULL
106575  //  **
106576  //  ** Inputs:
106577  //  ** <ul>
106578  //  ** <li> A FILE* to which trace output should be written.
106579  //  **      If NULL, then tracing is turned off.
106580  //  ** <li> A prefix string written at the beginning of every
106581  //  **      line of trace output.  If NULL, then tracing is
106582  //  **      turned off.
106583  //  ** </ul>
106584  //  **
106585  //  ** Outputs:
106586  //  ** None.
106587  //  */
106588  func _sqlite3ParserTrace(tls *crt.TLS, _TraceFILE *crt.XFILE, _zTracePrompt *int8) {
106589  	_yyTraceFILE = _TraceFILE
106590  	bug20530(_yyTraceFILE)
106591  	_yyTracePrompt = _zTracePrompt
106592  	bug20530(_yyTracePrompt)
106593  	if _yyTraceFILE == nil {
106594  		_yyTracePrompt = nil
106595  		bug20530(_yyTracePrompt)
106596  		goto _2
106597  	}
106598  	if _yyTracePrompt == nil {
106599  		_yyTraceFILE = nil
106600  		bug20530(_yyTraceFILE)
106601  	}
106602  _2:
106603  }
106604  
106605  // C comment
106606  //  /*
106607  //  ** Register the built-in LIKE and GLOB functions.  The caseSensitive
106608  //  ** parameter determines whether or not the LIKE operator is case
106609  //  ** sensitive.  GLOB is always case sensitive.
106610  //  */
106611  func _sqlite3RegisterLikeFunctions(tls *crt.TLS, _db *Xsqlite3, _caseSensitive int32) {
106612  	var _pInfo *TcompareInfo
106613  	if _caseSensitive != 0 {
106614  		_pInfo = &_likeInfoAlt
106615  		goto _1
106616  	}
106617  	_pInfo = &_likeInfoNorm
106618  _1:
106619  	_sqlite3CreateFunc(tls, _db, str(7867), int32(2), int32(1), unsafe.Pointer(_pInfo), _likeFunc, nil, nil, nil)
106620  	_sqlite3CreateFunc(tls, _db, str(7867), int32(3), int32(1), unsafe.Pointer(_pInfo), _likeFunc, nil, nil, nil)
106621  	_sqlite3CreateFunc(tls, _db, str(7862), int32(2), int32(1), unsafe.Pointer(&_globInfo), _likeFunc, nil, nil, nil)
106622  	_setLikeOptFlag(tls, _db, str(7862), uint8(12))
106623  	_setLikeOptFlag(tls, _db, str(7867), uint8(func() int32 {
106624  		if _caseSensitive != 0 {
106625  			return int32(12)
106626  		}
106627  		return int32(4)
106628  	}()))
106629  }
106630  
106631  // C comment
106632  //  /*
106633  //  ** Implementation of the like() SQL function.  This function implements
106634  //  ** the build-in LIKE operator.  The first argument to the function is the
106635  //  ** pattern and the second argument is the string.  So, the SQL statements:
106636  //  **
106637  //  **       A LIKE B
106638  //  **
106639  //  ** is implemented as like(B,A).
106640  //  **
106641  //  ** This same function (with a different compareInfo structure) computes
106642  //  ** the GLOB operator.
106643  //  */
106644  func _likeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
106645  	var _nPat int32
106646  	var _escape uint32
106647  	var _zA, _zB, _2_zEsc *uint8
106648  	var _db *Xsqlite3
106649  	var _pInfo *TcompareInfo
106650  	_db = Xsqlite3_context_db_handle(tls, _context)
106651  	_pInfo = (*TcompareInfo)(Xsqlite3_user_data(tls, _context))
106652  	_zB = Xsqlite3_value_text(tls, *elem19(_argv, 0))
106653  	_zA = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
106654  	_nPat = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
106655  	if _nPat > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(8))) {
106656  		Xsqlite3_result_error(tls, _context, str(122248), int32(-1))
106657  		return
106658  	}
106659  	func() {
106660  		if _zB != Xsqlite3_value_text(tls, *elem19(_argv, 0)) {
106661  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106383), unsafe.Pointer(&_likeFuncØ00__func__Ø000), unsafe.Pointer(str(122281)))
106662  			crt.X__builtin_abort(tls)
106663  		}
106664  	}()
106665  	if _argc != int32(3) {
106666  		goto _3
106667  	}
106668  	_2_zEsc = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(2)))
106669  	if _2_zEsc == nil {
106670  		return
106671  	}
106672  	if _sqlite3Utf8CharLen(tls, (*int8)(unsafe.Pointer(_2_zEsc)), int32(-1)) != int32(1) {
106673  		Xsqlite3_result_error(tls, _context, str(122313), int32(-1))
106674  		return
106675  	}
106676  	_escape = _sqlite3Utf8Read(tls, &_2_zEsc)
106677  	goto _6
106678  _3:
106679  	_escape = uint32(_pInfo.XmatchSet)
106680  _6:
106681  	if (_zA != nil) && (_zB != nil) {
106682  		Xsqlite3_result_int(tls, _context, bool2int(_patternCompare(tls, _zB, _zA, _pInfo, _escape) == int32(0)))
106683  	}
106684  }
106685  
106686  // C comment
106687  //  /*
106688  //  ** Extract the user data from a sqlite3_context structure and return a
106689  //  ** pointer to it.
106690  //  */
106691  func Xsqlite3_user_data(tls *crt.TLS, _p *Xsqlite3_context) (r0 unsafe.Pointer) {
106692  	func() {
106693  		if _p == nil || _p.XpFunc == nil {
106694  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76799), unsafe.Pointer(&_sqlite3_user_dataØ00__func__Ø000), unsafe.Pointer(str(122358)))
106695  			crt.X__builtin_abort(tls)
106696  		}
106697  	}()
106698  	return (*XFuncDef)(_p.XpFunc).XpUserData
106699  }
106700  
106701  var _sqlite3_user_dataØ00__func__Ø000 [18]int8
106702  
106703  func init() {
106704  	crt.Xstrncpy(nil, &_sqlite3_user_dataØ00__func__Ø000[0], str(122372), 18)
106705  }
106706  
106707  var _likeFuncØ00__func__Ø000 [9]int8
106708  
106709  func init() {
106710  	crt.Xstrncpy(nil, &_likeFuncØ00__func__Ø000[0], str(122390), 9)
106711  }
106712  
106713  func Xsqlite3_result_int(tls *crt.TLS, _pCtx *Xsqlite3_context, _iVal int32) {
106714  	func() {
106715  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
106716  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76465), unsafe.Pointer(&_sqlite3_result_intØ00__func__Ø000), unsafe.Pointer(str(6567)))
106717  			crt.X__builtin_abort(tls)
106718  		}
106719  	}()
106720  	_sqlite3VdbeMemSetInt64(tls, (*XMem)(_pCtx.XpOut), int64(_iVal))
106721  }
106722  
106723  var _sqlite3_result_intØ00__func__Ø000 [19]int8
106724  
106725  func init() {
106726  	crt.Xstrncpy(nil, &_sqlite3_result_intØ00__func__Ø000[0], str(122399), 19)
106727  }
106728  
106729  // C comment
106730  //  /*
106731  //  ** Set the LIKEOPT flag on the 2-argument function with the given name.
106732  //  */
106733  func _setLikeOptFlag(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _flagVal uint8) {
106734  	var _pDef *XFuncDef
106735  	_pDef = _sqlite3FindFunction(tls, _db, _zName, int32(2), uint8(1), 0)
106736  	if func() int32 {
106737  		if _pDef != nil {
106738  			return int32(1)
106739  		}
106740  		return func() int32 {
106741  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107216), unsafe.Pointer(&_setLikeOptFlagØ00__func__Ø000), unsafe.Pointer(str(4809)))
106742  			crt.X__builtin_abort(tls)
106743  			return int32(0)
106744  		}()
106745  	}() != 0 {
106746  		{
106747  			p := &_pDef.XfuncFlags
106748  			*p = uint16(int32(*p) | int32(_flagVal))
106749  		}
106750  	}
106751  }
106752  
106753  var _setLikeOptFlagØ00__func__Ø000 [15]int8
106754  
106755  func init() {
106756  	crt.Xstrncpy(nil, &_setLikeOptFlagØ00__func__Ø000[0], str(122418), 15)
106757  }
106758  
106759  // C comment
106760  //  /*
106761  //  ** Helper subroutine for PRAGMA integrity_check:
106762  //  **
106763  //  ** Generate code to output a single-column result row with the result
106764  //  ** held in register regResult.  Decrement the result count and halt if
106765  //  ** the maximum number of result rows have been issued.
106766  //  */
106767  func _integrityCheckResultRow(tls *crt.TLS, _v *TVdbe, _regResult int32) (r0 int32) {
106768  	var _addr int32
106769  	_sqlite3VdbeAddOp2(tls, _v, int32(67), _regResult, int32(1))
106770  	_addr = _sqlite3VdbeAddOp3(tls, _v, int32(46), int32(1), _sqlite3VdbeCurrentAddr(tls, _v)+int32(2), int32(1))
106771  	_sqlite3VdbeAddOp2(tls, _v, int32(55), int32(0), int32(0))
106772  	return _addr
106773  }
106774  
106775  func _sqlite3NoTempsInRange(tls *crt.TLS, _pParse *XParse, _iFirst int32, _iLast int32) (r0 int32) {
106776  	var _i int32
106777  	if ((_pParse.XnRangeReg > int32(0)) && ((_pParse.XiRangeReg + _pParse.XnRangeReg) < _iLast)) && (_pParse.XiRangeReg >= _iFirst) {
106778  		return int32(0)
106779  	}
106780  	_i = int32(0)
106781  _3:
106782  	if _i >= int32(_pParse.XnTempReg) {
106783  		goto _6
106784  	}
106785  	if ((*elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(_i))) >= _iFirst) && ((*elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(_i))) <= _iLast) {
106786  		return int32(0)
106787  	}
106788  	_i += 1
106789  	goto _3
106790  _6:
106791  	return int32(1)
106792  }
106793  
106794  var _sqlite3PragmaØ00endCodeØ006 [4]XVdbeOpList
106795  
106796  func init() {
106797  	_sqlite3PragmaØ00endCodeØ006 = [4]XVdbeOpList{XVdbeOpList{Xopcode: uint8(73), Xp1: int8(1)}, XVdbeOpList{Xopcode: uint8(47), Xp1: int8(1), Xp2: int8(4)}, XVdbeOpList{Xopcode: uint8(97), Xp2: int8(3)}, XVdbeOpList{Xopcode: uint8(67), Xp1: int8(3), Xp2: int8(1)}}
106798  }
106799  
106800  var _sqlite3PragmaØ00iLnØ005 int32
106801  
106802  var _sqlite3PragmaØ00encnamesØ007 [9]TEncName
106803  
106804  func init() {
106805  	_sqlite3PragmaØ00encnamesØ007 = [9]TEncName{TEncName{XzName: str(122433), Xenc: uint8(1)}, TEncName{XzName: str(122438), Xenc: uint8(1)}, TEncName{XzName: str(122444), Xenc: uint8(2)}, TEncName{XzName: str(122453), Xenc: uint8(3)}, TEncName{XzName: str(122462), Xenc: uint8(2)}, TEncName{XzName: str(122470), Xenc: uint8(3)}, TEncName{XzName: str(122478)}, TEncName{XzName: str(122485)}, TEncName{}}
106806  }
106807  
106808  var _sqlite3PragmaØ00setCookieØ008 [2]XVdbeOpList
106809  
106810  func init() {
106811  	_sqlite3PragmaØ00setCookieØ008 = [2]XVdbeOpList{XVdbeOpList{Xopcode: uint8(2), Xp2: int8(1)}, XVdbeOpList{Xopcode: uint8(104)}}
106812  }
106813  
106814  var _sqlite3PragmaØ00readCookieØ009 [3]XVdbeOpList
106815  
106816  func init() {
106817  	_sqlite3PragmaØ00readCookieØ009 = [3]XVdbeOpList{XVdbeOpList{Xopcode: uint8(2)}, XVdbeOpList{Xopcode: uint8(103), Xp2: int8(1)}, XVdbeOpList{Xopcode: uint8(67), Xp1: int8(1), Xp2: int8(1)}}
106818  }
106819  
106820  // C comment
106821  //  /*
106822  //  ** Mark the VDBE as one that can only be run multiple times.
106823  //  */
106824  func _sqlite3VdbeReusable(tls *crt.TLS, _p *TVdbe) {
106825  	storebits26(&_p.Xexpired, 0, 32, 5)
106826  }
106827  
106828  // C comment
106829  //  /*
106830  //  ** Return the N-th compile-time option string.  If N is out of range,
106831  //  ** return a NULL pointer.
106832  //  */
106833  func Xsqlite3_compileoption_get(tls *crt.TLS, _N int32) (r0 *int8) {
106834  	if (_N >= int32(0)) && (_N < int32(6)) {
106835  		return *elem0((**int8)(unsafe.Pointer(&_azCompileOpt)), uintptr(_N))
106836  	}
106837  	return nil
106838  }
106839  
106840  // C comment
106841  //  /*
106842  //  ** An array of names of all compile-time options.  This array should
106843  //  ** be sorted A-Z.
106844  //  **
106845  //  ** This array looks large, but in a typical installation actually uses
106846  //  ** only a handful of compile-time options, so most times this array is usually
106847  //  ** rather short and uses little memory space.
106848  //  */
106849  var _azCompileOpt [6]*int8
106850  
106851  func init() {
106852  	_azCompileOpt = [6]*int8{str(122491), str(122497), str(122519), str(122545), str(122562), str(122576)}
106853  }
106854  
106855  // C comment
106856  //  /*
106857  //  ** Configure an sqlite3_wal_hook() callback to automatically checkpoint
106858  //  ** a database after committing a transaction if there are nFrame or
106859  //  ** more frames in the log file. Passing zero or a negative value as the
106860  //  ** nFrame parameter disables automatic checkpoints entirely.
106861  //  **
106862  //  ** The callback registered by this function replaces any existing callback
106863  //  ** registered using sqlite3_wal_hook(). Likewise, registering a callback
106864  //  ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
106865  //  ** configured by this function.
106866  //  */
106867  func Xsqlite3_wal_autocheckpoint(tls *crt.TLS, _db *Xsqlite3, _nFrame int32) (r0 int32) {
106868  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
106869  		return _sqlite3MisuseError(tls, int32(142507))
106870  	}
106871  	if _nFrame > int32(0) {
106872  		Xsqlite3_wal_hook(tls, _db, _sqlite3WalDefaultHook, crt.U2P(uintptr(int64(_nFrame))))
106873  		goto _2
106874  	}
106875  	Xsqlite3_wal_hook(tls, _db, nil, nil)
106876  _2:
106877  	return int32(0)
106878  }
106879  
106880  // C comment
106881  //  /*
106882  //  ** Register a callback to be invoked each time a transaction is written
106883  //  ** into the write-ahead-log by this database connection.
106884  //  */
106885  func Xsqlite3_wal_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32, _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
106886  	var _pRet unsafe.Pointer
106887  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
106888  		_sqlite3MisuseError(tls, int32(142531))
106889  		return nil
106890  	}
106891  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106892  	_pRet = _db.XpWalArg
106893  	*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&_db.XxWalCallback)) = _xCallback
106894  	_db.XpWalArg = _pArg
106895  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106896  	return _pRet
106897  }
106898  
106899  func _sqlite3WalDefaultHook(tls *crt.TLS, _pClientData unsafe.Pointer, _db *Xsqlite3, _zDb *int8, _nFrame int32) (r0 int32) {
106900  	if _nFrame >= int32(int64(crt.P2U(_pClientData))) {
106901  		_sqlite3BeginBenignMalloc(tls)
106902  		Xsqlite3_wal_checkpoint(tls, _db, _zDb)
106903  		_sqlite3EndBenignMalloc(tls)
106904  	}
106905  	return int32(0)
106906  }
106907  
106908  // C comment
106909  //  /*
106910  //  ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
106911  //  ** to contains a zero-length string, all attached databases are
106912  //  ** checkpointed.
106913  //  */
106914  func Xsqlite3_wal_checkpoint(tls *crt.TLS, _db *Xsqlite3, _zDb *int8) (r0 int32) {
106915  	return Xsqlite3_wal_checkpoint_v2(tls, _db, _zDb, int32(0), nil, nil)
106916  }
106917  
106918  // C comment
106919  //  /*
106920  //  ** Checkpoint database zDb.
106921  //  */
106922  func Xsqlite3_wal_checkpoint_v2(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
106923  	var _rc, _iDb int32
106924  	_iDb = int32(10)
106925  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
106926  		return _sqlite3MisuseError(tls, int32(142563))
106927  	}
106928  	if _pnLog != nil {
106929  		*_pnLog = int32(-1)
106930  	}
106931  	if _pnCkpt != nil {
106932  		*_pnCkpt = int32(-1)
106933  	}
106934  
106935  	if (_eMode < int32(0)) || (_eMode > int32(3)) {
106936  		return int32(21)
106937  	}
106938  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106939  	if (_zDb != nil) && ((*elem1(_zDb, 0)) != 0) {
106940  		_iDb = _sqlite3FindDbName(tls, _db, _zDb)
106941  	}
106942  	if _iDb < int32(0) {
106943  		_rc = int32(1)
106944  		_sqlite3ErrorWithMsg(tls, _db, int32(1), str(122589), unsafe.Pointer(_zDb))
106945  		goto _8
106946  	}
106947  	_db.XbusyHandler.XnBusy = int32(0)
106948  	_rc = _sqlite3Checkpoint(tls, _db, _iDb, _eMode, _pnLog, _pnCkpt)
106949  	_sqlite3Error(tls, _db, _rc)
106950  _8:
106951  	_rc = _sqlite3ApiExit(tls, _db, _rc)
106952  	if _db.XnVdbeActive == int32(0) {
106953  		*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(0)
106954  	}
106955  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106956  	return _rc
106957  }
106958  
106959  // C comment
106960  //  /*
106961  //  ** Free up as much memory as we can from the given database
106962  //  ** connection.
106963  //  */
106964  func Xsqlite3_db_release_memory(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
106965  	var _i int32
106966  	var _1_pBt *XBtree
106967  	var _2_pPager *XPager
106968  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
106969  		return _sqlite3MisuseError(tls, int32(141206))
106970  	}
106971  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106972  	_sqlite3BtreeEnterAll(tls, _db)
106973  	_i = int32(0)
106974  _1:
106975  	if _i >= _db.XnDb {
106976  		goto _4
106977  	}
106978  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
106979  	if _1_pBt != nil {
106980  		_2_pPager = _sqlite3BtreePager(tls, _1_pBt)
106981  		_sqlite3PagerShrink(tls, _2_pPager)
106982  	}
106983  	_i += 1
106984  	goto _1
106985  _4:
106986  	_sqlite3BtreeLeaveAll(tls, _db)
106987  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106988  	return int32(0)
106989  }
106990  
106991  // C comment
106992  //  /*
106993  //  ** Free as much memory as possible from the pager.
106994  //  */
106995  func _sqlite3PagerShrink(tls *crt.TLS, _pPager *XPager) {
106996  	_sqlite3PcacheShrink(tls, (*XPCache)(_pPager.XpPCache))
106997  }
106998  
106999  // C comment
107000  //  /*
107001  //  ** Free up as much memory as possible from the page cache.
107002  //  */
107003  func _sqlite3PcacheShrink(tls *crt.TLS, _pCache *XPCache) {
107004  	func() {
107005  		if _pCache.XpCache == nil {
107006  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44968), unsafe.Pointer(&_sqlite3PcacheShrinkØ00__func__Ø000), unsafe.Pointer(str(15913)))
107007  			crt.X__builtin_abort(tls)
107008  		}
107009  	}()
107010  	(_sqlite3Config.Xpcache2.XxShrink)(tls, _pCache.XpCache)
107011  }
107012  
107013  var _sqlite3PcacheShrinkØ00__func__Ø000 [20]int8
107014  
107015  func init() {
107016  	crt.Xstrncpy(nil, &_sqlite3PcacheShrinkØ00__func__Ø000[0], str(122610), 20)
107017  }
107018  
107019  // C comment
107020  //  /*
107021  //  ** Set the soft heap-size limit for the library. Passing a zero or
107022  //  ** negative value indicates no limit.
107023  //  */
107024  func Xsqlite3_soft_heap_limit64(tls *crt.TLS, _n int64) (r0 int64) {
107025  	var _rc int32
107026  	var _priorLimit, _excess, _nUsed int64
107027  	_rc = Xsqlite3_initialize(tls)
107028  	if _rc != 0 {
107029  		return int64(-1)
107030  	}
107031  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
107032  	_priorLimit = _mem0.XalarmThreshold
107033  	if _n < (0) {
107034  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
107035  		return _priorLimit
107036  	}
107037  	_mem0.XalarmThreshold = _n
107038  	_nUsed = _sqlite3StatusValue(tls, int32(0))
107039  	_mem0.XnearlyFull = bool2int((_n > (0)) && (_n <= _nUsed))
107040  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
107041  	_excess = Xsqlite3_memory_used(tls) - _n
107042  	if _excess > (0) {
107043  		Xsqlite3_release_memory(tls, int32(_excess&int64(2147483647)))
107044  	}
107045  	return _priorLimit
107046  }
107047  
107048  // C comment
107049  //  /*
107050  //  ** Return the amount of memory currently checked out.
107051  //  */
107052  func Xsqlite3_memory_used(tls *crt.TLS) (r0 int64) {
107053  	var _res, _mx int64
107054  	Xsqlite3_status64(tls, int32(0), &_res, &_mx, int32(0))
107055  	return _res
107056  }
107057  
107058  // C comment
107059  //  /*
107060  //  ** Query status information.
107061  //  */
107062  func Xsqlite3_status64(tls *crt.TLS, _op int32, _pCurrent *int64, _pHighwater *int64, _resetFlag int32) (r0 int32) {
107063  	var _pMutex *Xsqlite3_mutex
107064  	if (_op < int32(0)) || (_op >= int32(10)) {
107065  		return _sqlite3MisuseError(tls, int32(18616))
107066  	}
107067  	if (_pCurrent == nil) || (_pHighwater == nil) {
107068  		return _sqlite3MisuseError(tls, int32(18619))
107069  	}
107070  	_pMutex = func() *Xsqlite3_mutex {
107071  		if (*elem1((*int8)(unsafe.Pointer(&_statMutex)), uintptr(_op))) != 0 {
107072  			return _sqlite3Pcache1Mutex(tls)
107073  		}
107074  		return _sqlite3MallocMutex(tls)
107075  	}()
107076  	Xsqlite3_mutex_enter(tls, _pMutex)
107077  	*_pCurrent = *elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op))
107078  	*_pHighwater = *elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op))
107079  	if _resetFlag != 0 {
107080  		*elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op)) = *elem7((*int64)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op))
107081  	}
107082  	Xsqlite3_mutex_leave(tls, _pMutex)
107083  	return int32(0)
107084  }
107085  
107086  // C comment
107087  //  /*
107088  //  ** Change the value of a limit.  Report the old value.
107089  //  ** If an invalid limit index is supplied, report -1.
107090  //  ** Make no changes but still report the old value if the
107091  //  ** new limit is negative.
107092  //  **
107093  //  ** A new lower limit does not shrink existing constructs.
107094  //  ** It merely prevents new constructs that exceed the limit
107095  //  ** from forming.
107096  //  */
107097  func Xsqlite3_limit(tls *crt.TLS, _db *Xsqlite3, _limitId int32, _newLimit int32) (r0 int32) {
107098  	var _oldLimit int32
107099  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
107100  		_sqlite3MisuseError(tls, int32(142955))
107101  		return int32(-1)
107102  	}
107103  	func() {
107104  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), 0)) != int32(1000000000) {
107105  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142965), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(122630)))
107106  			crt.X__builtin_abort(tls)
107107  		}
107108  	}()
107109  	func() {
107110  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(1))) != int32(1000000000) {
107111  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142966), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(122681)))
107112  			crt.X__builtin_abort(tls)
107113  		}
107114  	}()
107115  	func() {
107116  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(2))) != int32(2000) {
107117  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142967), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(122740)))
107118  			crt.X__builtin_abort(tls)
107119  		}
107120  	}()
107121  	func() {
107122  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(3))) != int32(1000) {
107123  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142968), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(122791)))
107124  			crt.X__builtin_abort(tls)
107125  		}
107126  	}()
107127  	func() {
107128  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(4))) != int32(500) {
107129  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142969), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(122850)))
107130  			crt.X__builtin_abort(tls)
107131  		}
107132  	}()
107133  	func() {
107134  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(5))) != int32(250000000) {
107135  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142970), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(122919)))
107136  			crt.X__builtin_abort(tls)
107137  		}
107138  	}()
107139  	func() {
107140  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(6))) != int32(127) {
107141  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142971), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(122972)))
107142  			crt.X__builtin_abort(tls)
107143  		}
107144  	}()
107145  	func() {
107146  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(7))) != int32(10) {
107147  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142972), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(123035)))
107148  			crt.X__builtin_abort(tls)
107149  		}
107150  	}()
107151  	func() {
107152  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(8))) != int32(50000) {
107153  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142973), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(123090)))
107154  			crt.X__builtin_abort(tls)
107155  		}
107156  	}()
107157  	func() {
107158  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(9))) != int32(999) {
107159  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142975), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(123168)))
107160  			crt.X__builtin_abort(tls)
107161  		}
107162  	}()
107163  	func() {
107164  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(10))) != int32(1000) {
107165  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142976), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(123237)))
107166  			crt.X__builtin_abort(tls)
107167  		}
107168  	}()
107169  	func() {
107170  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(11))) != int32(8) {
107171  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142977), unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000), unsafe.Pointer(str(123302)))
107172  			crt.X__builtin_abort(tls)
107173  		}
107174  	}()
107175  
107176  	if (_limitId < int32(0)) || (_limitId >= int32(12)) {
107177  		return int32(-1)
107178  	}
107179  	_oldLimit = *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(_limitId))
107180  	if _newLimit < int32(0) {
107181  		goto _27
107182  	}
107183  	if _newLimit > (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(_limitId))) {
107184  		_newLimit = *elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(_limitId))
107185  	}
107186  	*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(_limitId)) = _newLimit
107187  _27:
107188  	return _oldLimit
107189  }
107190  
107191  // C comment
107192  //  /*
107193  //  ** This array defines hard upper bounds on limit values.  The
107194  //  ** initializer must be kept in sync with the SQLITE_LIMIT_*
107195  //  ** #defines in sqlite3.h.
107196  //  */
107197  var _aHardLimit [12]int32
107198  
107199  func init() {
107200  	_aHardLimit = [12]int32{int32(1000000000), int32(1000000000), int32(2000), int32(1000), int32(500), int32(250000000), int32(127), int32(10), int32(50000), int32(999), int32(1000), int32(8)}
107201  }
107202  
107203  var _sqlite3_limitØ00__func__Ø000 [14]int8
107204  
107205  func init() {
107206  	crt.Xstrncpy(nil, &_sqlite3_limitØ00__func__Ø000[0], str(123369), 14)
107207  }
107208  
107209  var _sqlite3PragmaØ00azLockNameØ0010 [5]*int8
107210  
107211  func init() {
107212  	_sqlite3PragmaØ00azLockNameØ0010 = [5]*int8{str(123383), str(123392), str(123399), str(123408), str(89660)}
107213  }
107214  
107215  func _sqlite3VdbeVerifyNoResultRow(tls *crt.TLS, _p *TVdbe) {
107216  	var _i int32
107217  	_i = int32(0)
107218  _0:
107219  	if _i >= _p.XnOp {
107220  		goto _3
107221  	}
107222  	func() {
107223  		if int32(elem63((*XVdbeOp)(_p.XaOp), uintptr(_i)).Xopcode) == int32(67) {
107224  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72090), unsafe.Pointer(&_sqlite3VdbeVerifyNoResultRowØ00__func__Ø000), unsafe.Pointer(str(123416)))
107225  			crt.X__builtin_abort(tls)
107226  		}
107227  	}()
107228  	_i += 1
107229  	goto _0
107230  _3:
107231  }
107232  
107233  var _sqlite3VdbeVerifyNoResultRowØ00__func__Ø000 [29]int8
107234  
107235  func init() {
107236  	crt.Xstrncpy(nil, &_sqlite3VdbeVerifyNoResultRowØ00__func__Ø000[0], str(123447), 29)
107237  }
107238  
107239  // C comment
107240  //  /*
107241  //  ** This routine is called after all of the trigger actions have been parsed
107242  //  ** in order to complete the process of building the trigger.
107243  //  */
107244  func _sqlite3FinishTrigger(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerStep, _pAll *XToken) {
107245  	var _iDb int32
107246  	var _zName, _3_z *int8
107247  	var _nameToken XToken
107248  	var _db *Xsqlite3
107249  	var _4_pHash *XHash
107250  	var _pTrig, _4_pLink *XTrigger
107251  	var _6_pTab *XTable
107252  	var _3_v *TVdbe
107253  	var _sFix XDbFixer
107254  	_pTrig = (*XTrigger)(_pParse.XpNewTrigger)
107255  	_db = (*Xsqlite3)(_pParse.Xdb)
107256  	*(**XTrigger)(unsafe.Pointer(&_pParse.XpNewTrigger)) = nil
107257  	if func() int32 {
107258  		if _pParse.XnErr != 0 {
107259  			return func() int32 {
107260  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122925), unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000), unsafe.Pointer(str(4809)))
107261  				crt.X__builtin_abort(tls)
107262  				return int32(1)
107263  			}()
107264  		}
107265  		return int32(0)
107266  	}() != 0 || (_pTrig == nil) {
107267  		goto _triggerfinish_cleanup
107268  	}
107269  	_zName = _pTrig.XzName
107270  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTrig.XpSchema))
107271  	*(**XTriggerStep)(unsafe.Pointer(&_pTrig.Xstep_list)) = _pStepList
107272  _4:
107273  	if _pStepList != nil {
107274  		*(**XTrigger)(unsafe.Pointer(&_pStepList.XpTrig)) = _pTrig
107275  		_pStepList = (*XTriggerStep)(_pStepList.XpNext)
107276  		goto _4
107277  	}
107278  	_sqlite3TokenInit(tls, &_nameToken, _pTrig.XzName)
107279  	_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(23789), &_nameToken)
107280  	if _sqlite3FixTriggerStep(tls, &_sFix, (*XTriggerStep)(_pTrig.Xstep_list)) != 0 || _sqlite3FixExpr(tls, &_sFix, (*XExpr)(_pTrig.XpWhen)) != 0 {
107281  		goto _triggerfinish_cleanup
107282  	}
107283  	if (_db.Xinit.Xbusy) != 0 {
107284  		goto _8
107285  	}
107286  	_3_v = _sqlite3GetVdbe(tls, _pParse)
107287  	if _3_v == nil {
107288  		goto _triggerfinish_cleanup
107289  	}
107290  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
107291  	_3_z = _sqlite3DbStrNDup(tls, _db, _pAll.Xz, uint64(_pAll.Xn))
107292  	_sqlite3NestedParse(tls, _pParse, str(123476), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(str(49981)), unsafe.Pointer(_zName), unsafe.Pointer(_pTrig.Xtable), unsafe.Pointer(_3_z))
107293  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_3_z))
107294  	_sqlite3ChangeCookie(tls, _pParse, _iDb)
107295  	_sqlite3VdbeAddParseSchemaOp(tls, _3_v, _iDb, _sqlite3MPrintf(tls, _db, str(123540), unsafe.Pointer(_zName)))
107296  _8:
107297  	if (_db.Xinit.Xbusy) == 0 {
107298  		goto _triggerfinish_cleanup
107299  	}
107300  	_4_pLink = _pTrig
107301  	_4_pHash = &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XtrigHash)
107302  	func() {
107303  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
107304  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122966), unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000), unsafe.Pointer(str(51126)))
107305  			crt.X__builtin_abort(tls)
107306  		}
107307  	}()
107308  	_pTrig = (*XTrigger)(_sqlite3HashInsert(tls, _4_pHash, _zName, unsafe.Pointer(_pTrig)))
107309  	if _pTrig != nil {
107310  		_sqlite3OomFault(tls, _db)
107311  		goto _15
107312  	}
107313  	if (*XSchema)(_4_pLink.XpSchema) == (*XSchema)(_4_pLink.XpTabSchema) {
107314  		_6_pTab = (*XTable)(_sqlite3HashFind(tls, &((*XSchema)(_4_pLink.XpTabSchema).XtblHash), _4_pLink.Xtable))
107315  		func() {
107316  			if _6_pTab == nil {
107317  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122973), unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000), unsafe.Pointer(str(43549)))
107318  				crt.X__builtin_abort(tls)
107319  			}
107320  		}()
107321  		*(**XTrigger)(unsafe.Pointer(&_4_pLink.XpNext)) = (*XTrigger)(_6_pTab.XpTrigger)
107322  		*(**XTrigger)(unsafe.Pointer(&_6_pTab.XpTrigger)) = _4_pLink
107323  	}
107324  _15:
107325  _triggerfinish_cleanup:
107326  	_sqlite3DeleteTrigger(tls, _db, _pTrig)
107327  	func() {
107328  		if _pParse.XpNewTrigger != nil {
107329  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122981), unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000), unsafe.Pointer(str(123569)))
107330  			crt.X__builtin_abort(tls)
107331  		}
107332  	}()
107333  	_sqlite3DeleteTriggerStep(tls, _db, _pStepList)
107334  }
107335  
107336  var _sqlite3FinishTriggerØ00__func__Ø000 [21]int8
107337  
107338  func init() {
107339  	crt.Xstrncpy(nil, &_sqlite3FinishTriggerØ00__func__Ø000[0], str(123590), 21)
107340  }
107341  
107342  func _sqlite3FixTriggerStep(tls *crt.TLS, _pFix *XDbFixer, _pStep *XTriggerStep) (r0 int32) {
107343  _0:
107344  	if _pStep == nil {
107345  		goto _1
107346  	}
107347  	if _sqlite3FixSelect(tls, _pFix, (*XSelect)(_pStep.XpSelect)) != 0 {
107348  		return int32(1)
107349  	}
107350  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pStep.XpWhere)) != 0 {
107351  		return int32(1)
107352  	}
107353  	if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pStep.XpExprList)) != 0 {
107354  		return int32(1)
107355  	}
107356  	_pStep = (*XTriggerStep)(_pStep.XpNext)
107357  	goto _0
107358  _1:
107359  	return int32(0)
107360  }
107361  
107362  // C comment
107363  //  /*
107364  //  ** This is called by the parser when it sees a CREATE TRIGGER statement
107365  //  ** up to the point of the BEGIN before the trigger actions.  A Trigger
107366  //  ** structure is generated based on the information available and stored
107367  //  ** in pParse->pNewTrigger.  After the trigger actions have been parsed, the
107368  //  ** sqlite3FinishTrigger() function is called to complete the trigger
107369  //  ** construction process.
107370  //  */
107371  func _sqlite3BeginTrigger(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _tr_tm int32, _op int32, _pColumns *XIdList, _pTableName *XSrcList, _pWhen *XExpr, _isTemp int32, _noErr int32) {
107372  	var _iDb, _19_iTabDb, _19_code int32
107373  	var _zName, _19_zDb, _19_zDbTrig *int8
107374  	var _db *Xsqlite3
107375  	var _pTrigger *XTrigger
107376  	var _pTab *XTable
107377  	var _pName *XToken
107378  	var _sFix XDbFixer
107379  	_pTrigger = nil
107380  	_zName = nil
107381  	_db = (*Xsqlite3)(_pParse.Xdb)
107382  	func() {
107383  		if _pName1 == nil {
107384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122744), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(123611)))
107385  			crt.X__builtin_abort(tls)
107386  		}
107387  	}()
107388  	func() {
107389  		if _pName2 == nil {
107390  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122745), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(111539)))
107391  			crt.X__builtin_abort(tls)
107392  		}
107393  	}()
107394  	func() {
107395  		if _op != int32(108) && _op != int32(110) && _op != int32(109) {
107396  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122746), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(123621)))
107397  			crt.X__builtin_abort(tls)
107398  		}
107399  	}()
107400  	func() {
107401  		if _op <= int32(0) || _op >= int32(255) {
107402  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122747), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(123669)))
107403  			crt.X__builtin_abort(tls)
107404  		}
107405  	}()
107406  	if _isTemp == 0 {
107407  		goto _11
107408  	}
107409  	if _pName2.Xn > (0) {
107410  		_sqlite3ErrorMsg(tls, _pParse, str(123685))
107411  		goto _trigger_cleanup
107412  	}
107413  	_iDb = int32(1)
107414  	_pName = _pName1
107415  	goto _13
107416  _11:
107417  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
107418  	if _iDb < int32(0) {
107419  		goto _trigger_cleanup
107420  	}
107421  _13:
107422  	if (_pTableName == nil) || (_db.XmallocFailed != 0) {
107423  		goto _trigger_cleanup
107424  	}
107425  	if ((_db.Xinit.Xbusy) != 0) && (_iDb != int32(1)) {
107426  		_sqlite3DbFree(tls, _db, unsafe.Pointer(elem6((*TSrcList_item)(unsafe.Pointer(&_pTableName.Xa)), 0).XzDatabase))
107427  		elem6((*TSrcList_item)(unsafe.Pointer(&_pTableName.Xa)), 0).XzDatabase = nil
107428  	}
107429  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTableName)
107430  	if (((int32(_db.Xinit.Xbusy) == int32(0)) && (_pName2.Xn == (0))) && (_pTab != nil)) && ((*XSchema)(_pTab.XpSchema) == (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema)) {
107431  		_iDb = int32(1)
107432  	}
107433  	if _db.XmallocFailed != 0 {
107434  		goto _trigger_cleanup
107435  	}
107436  	func() {
107437  		if _pTableName.XnSrc != int32(1) {
107438  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122793), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(123731)))
107439  			crt.X__builtin_abort(tls)
107440  		}
107441  	}()
107442  	_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(23789), _pName)
107443  	if _sqlite3FixSrcList(tls, &_sFix, _pTableName) != 0 {
107444  		goto _trigger_cleanup
107445  	}
107446  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTableName)
107447  	if _pTab != nil {
107448  		goto _27
107449  	}
107450  	if int32(_db.Xinit.XiDb) == int32(1) {
107451  		_db.Xinit.XorphanTrigger = uint8(1)
107452  	}
107453  	goto _trigger_cleanup
107454  _27:
107455  	if _pTab.XnModuleArg != 0 {
107456  		_sqlite3ErrorMsg(tls, _pParse, str(123751))
107457  		goto _trigger_cleanup
107458  	}
107459  	_zName = _sqlite3NameFromToken(tls, _db, _pName)
107460  	if (_zName == nil) || (int32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName)) {
107461  		goto _trigger_cleanup
107462  	}
107463  	func() {
107464  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
107465  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122825), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(51126)))
107466  			crt.X__builtin_abort(tls)
107467  		}
107468  	}()
107469  	if _sqlite3HashFind(tls, &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XtrigHash), _zName) == nil {
107470  		goto _34
107471  	}
107472  	if _noErr == 0 {
107473  		_sqlite3ErrorMsg(tls, _pParse, str(123792), unsafe.Pointer(_pName))
107474  		goto _36
107475  	}
107476  	func() {
107477  		if (_db.Xinit.Xbusy) != 0 {
107478  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122830), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(112577)))
107479  			crt.X__builtin_abort(tls)
107480  		}
107481  	}()
107482  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
107483  _36:
107484  	goto _trigger_cleanup
107485  _34:
107486  	if Xsqlite3_strnicmp(tls, _pTab.XzName, str(111672), int32(7)) == int32(0) {
107487  		_sqlite3ErrorMsg(tls, _pParse, str(123818))
107488  		goto _trigger_cleanup
107489  	}
107490  	if (_pTab.XpSelect != nil) && (_tr_tm != int32(48)) {
107491  		_sqlite3ErrorMsg(tls, _pParse, str(123856), unsafe.Pointer(func() *int8 {
107492  			if _tr_tm == int32(34) {
107493  				return str(25122)
107494  			}
107495  			return str(25097)
107496  		}()), unsafe.Pointer(_pTableName), int32(0))
107497  		goto _trigger_cleanup
107498  	}
107499  	if (_pTab.XpSelect == nil) && (_tr_tm == int32(48)) {
107500  		_sqlite3ErrorMsg(tls, _pParse, str(123893), unsafe.Pointer(_pTableName), int32(0))
107501  		goto _trigger_cleanup
107502  	}
107503  	_19_iTabDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
107504  	_19_code = int32(7)
107505  	_19_zDb = elem27((*XDb)(_db.XaDb), uintptr(_19_iTabDb)).XzDbSName
107506  	_19_zDbTrig = func() *int8 {
107507  		if _isTemp != 0 {
107508  			return (elem27((*XDb)(_db.XaDb), uintptr(1)).XzDbSName)
107509  		}
107510  		return _19_zDb
107511  	}()
107512  	if (_19_iTabDb == int32(1)) || _isTemp != 0 {
107513  		_19_code = int32(5)
107514  	}
107515  	if _sqlite3AuthCheck(tls, _pParse, _19_code, _zName, _pTab.XzName, _19_zDbTrig) != 0 {
107516  		goto _trigger_cleanup
107517  	}
107518  	if _sqlite3AuthCheck(tls, _pParse, int32(18), func() *int8 {
107519  		if int32(1) != 0 && (_19_iTabDb == int32(1)) {
107520  			return str(49962)
107521  		}
107522  		return str(49981)
107523  	}(), nil, _19_zDb) != 0 {
107524  		goto _trigger_cleanup
107525  	}
107526  	if _tr_tm == int32(48) {
107527  		_tr_tm = int32(34)
107528  	}
107529  	_pTrigger = (*XTrigger)(_sqlite3DbMallocZero(tls, _db, uint64(72)))
107530  	if _pTrigger == nil {
107531  		goto _trigger_cleanup
107532  	}
107533  	_pTrigger.XzName = _zName
107534  	_zName = nil
107535  	_pTrigger.Xtable = _sqlite3DbStrDup(tls, _db, elem6((*TSrcList_item)(unsafe.Pointer(&_pTableName.Xa)), 0).XzName)
107536  	*(**XSchema)(unsafe.Pointer(&_pTrigger.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
107537  	*(**XSchema)(unsafe.Pointer(&_pTrigger.XpTabSchema)) = (*XSchema)(_pTab.XpSchema)
107538  	_pTrigger.Xop = uint8(_op)
107539  	_pTrigger.Xtr_tm = uint8(func() int32 {
107540  		if _tr_tm == int32(34) {
107541  			return int32(1)
107542  		}
107543  		return int32(2)
107544  	}())
107545  	*(**XExpr)(unsafe.Pointer(&_pTrigger.XpWhen)) = _sqlite3ExprDup(tls, _db, _pWhen, int32(1))
107546  	*(**XIdList)(unsafe.Pointer(&_pTrigger.XpColumns)) = _sqlite3IdListDup(tls, _db, _pColumns)
107547  	func() {
107548  		if (*XTrigger)(_pParse.XpNewTrigger) != nil {
107549  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122893), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(24610)))
107550  			crt.X__builtin_abort(tls)
107551  		}
107552  	}()
107553  	*(**XTrigger)(unsafe.Pointer(&_pParse.XpNewTrigger)) = _pTrigger
107554  _trigger_cleanup:
107555  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
107556  	_sqlite3SrcListDelete(tls, _db, _pTableName)
107557  	_sqlite3IdListDelete(tls, _db, _pColumns)
107558  	_sqlite3ExprDelete(tls, _db, _pWhen)
107559  	if _pParse.XpNewTrigger == nil {
107560  		_sqlite3DeleteTrigger(tls, _db, _pTrigger)
107561  		goto _62
107562  	}
107563  	func() {
107564  		if (*XTrigger)(_pParse.XpNewTrigger) != _pTrigger {
107565  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122904), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(123939)))
107566  			crt.X__builtin_abort(tls)
107567  		}
107568  	}()
107569  _62:
107570  }
107571  
107572  var _sqlite3BeginTriggerØ00__func__Ø000 [20]int8
107573  
107574  func init() {
107575  	crt.Xstrncpy(nil, &_sqlite3BeginTriggerØ00__func__Ø000[0], str(123969), 20)
107576  }
107577  
107578  // C comment
107579  //  /*
107580  //  ** Construct a trigger step that implements an UPDATE statement and return
107581  //  ** a pointer to that trigger step.  The parser calls this routine when it
107582  //  ** sees an UPDATE statement inside the body of a CREATE TRIGGER.
107583  //  */
107584  func _sqlite3TriggerUpdateStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pEList *XExprList, _pWhere *XExpr, _orconf uint8) (r0 *XTriggerStep) {
107585  	var _pTriggerStep *XTriggerStep
107586  	_pTriggerStep = _triggerStepAllocate(tls, _db, uint8(110), _pTableName)
107587  	if _pTriggerStep != nil {
107588  		*(**XExprList)(unsafe.Pointer(&_pTriggerStep.XpExprList)) = _sqlite3ExprListDup(tls, _db, _pEList, int32(1))
107589  		*(**XExpr)(unsafe.Pointer(&_pTriggerStep.XpWhere)) = _sqlite3ExprDup(tls, _db, _pWhere, int32(1))
107590  		_pTriggerStep.Xorconf = _orconf
107591  	}
107592  	_sqlite3ExprListDelete(tls, _db, _pEList)
107593  	_sqlite3ExprDelete(tls, _db, _pWhere)
107594  	return _pTriggerStep
107595  }
107596  
107597  // C comment
107598  //  /*
107599  //  ** Allocate space to hold a new trigger step.  The allocated space
107600  //  ** holds both the TriggerStep object and the TriggerStep.target.z string.
107601  //  **
107602  //  ** If an OOM error occurs, NULL is returned and db->mallocFailed is set.
107603  //  */
107604  func _triggerStepAllocate(tls *crt.TLS, _db *Xsqlite3, _op uint8, _pName *XToken) (r0 *XTriggerStep) {
107605  	var _1_z *int8
107606  	var _pTriggerStep *XTriggerStep
107607  	_pTriggerStep = (*XTriggerStep)(_sqlite3DbMallocZero(tls, _db, (uint64(72)+uint64(_pName.Xn))+uint64(1)))
107608  	if _pTriggerStep != nil {
107609  		_1_z = (*int8)(unsafe.Pointer(elem121(_pTriggerStep, uintptr(1))))
107610  		crt.Xmemcpy(tls, unsafe.Pointer(_1_z), unsafe.Pointer(_pName.Xz), uint64(_pName.Xn))
107611  		_sqlite3Dequote(tls, _1_z)
107612  		_pTriggerStep.XzTarget = _1_z
107613  		_pTriggerStep.Xop = _op
107614  	}
107615  	return _pTriggerStep
107616  }
107617  
107618  // C comment
107619  //  /*
107620  //  ** Build a trigger step out of an INSERT statement.  Return a pointer
107621  //  ** to the new trigger step.
107622  //  **
107623  //  ** The parser calls this routine when it sees an INSERT inside the
107624  //  ** body of a trigger.
107625  //  */
107626  func _sqlite3TriggerInsertStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pColumn *XIdList, _pSelect *XSelect, _orconf uint8) (r0 *XTriggerStep) {
107627  	var _pTriggerStep *XTriggerStep
107628  	func() {
107629  		if _pSelect == nil && _db.XmallocFailed == 0 {
107630  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123044), unsafe.Pointer(&_sqlite3TriggerInsertStepØ00__func__Ø000), unsafe.Pointer(str(123989)))
107631  			crt.X__builtin_abort(tls)
107632  		}
107633  	}()
107634  	_pTriggerStep = _triggerStepAllocate(tls, _db, uint8(108), _pTableName)
107635  	if _pTriggerStep != nil {
107636  		*(**XSelect)(unsafe.Pointer(&_pTriggerStep.XpSelect)) = _sqlite3SelectDup(tls, _db, _pSelect, int32(1))
107637  		*(**XIdList)(unsafe.Pointer(&_pTriggerStep.XpIdList)) = _pColumn
107638  		_pTriggerStep.Xorconf = _orconf
107639  		goto _4
107640  	}
107641  	_sqlite3IdListDelete(tls, _db, _pColumn)
107642  _4:
107643  	_sqlite3SelectDelete(tls, _db, _pSelect)
107644  	return _pTriggerStep
107645  }
107646  
107647  var _sqlite3TriggerInsertStepØ00__func__Ø000 [25]int8
107648  
107649  func init() {
107650  	crt.Xstrncpy(nil, &_sqlite3TriggerInsertStepØ00__func__Ø000[0], str(124022), 25)
107651  }
107652  
107653  // C comment
107654  //  /*
107655  //  ** Construct a trigger step that implements a DELETE statement and return
107656  //  ** a pointer to that trigger step.  The parser calls this routine when it
107657  //  ** sees a DELETE statement inside the body of a CREATE TRIGGER.
107658  //  */
107659  func _sqlite3TriggerDeleteStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pWhere *XExpr) (r0 *XTriggerStep) {
107660  	var _pTriggerStep *XTriggerStep
107661  	_pTriggerStep = _triggerStepAllocate(tls, _db, uint8(109), _pTableName)
107662  	if _pTriggerStep != nil {
107663  		*(**XExpr)(unsafe.Pointer(&_pTriggerStep.XpWhere)) = _sqlite3ExprDup(tls, _db, _pWhere, int32(1))
107664  		_pTriggerStep.Xorconf = uint8(10)
107665  	}
107666  	_sqlite3ExprDelete(tls, _db, _pWhere)
107667  	return _pTriggerStep
107668  }
107669  
107670  // C comment
107671  //  /*
107672  //  ** Turn a SELECT statement (that the pSelect parameter points to) into
107673  //  ** a trigger step.  Return a pointer to a TriggerStep structure.
107674  //  **
107675  //  ** The parser calls this routine when it finds a SELECT statement in
107676  //  ** body of a TRIGGER.
107677  //  */
107678  func _sqlite3TriggerSelectStep(tls *crt.TLS, _db *Xsqlite3, _pSelect *XSelect) (r0 *XTriggerStep) {
107679  	var _pTriggerStep *XTriggerStep
107680  	_pTriggerStep = (*XTriggerStep)(_sqlite3DbMallocZero(tls, _db, uint64(72)))
107681  	if _pTriggerStep == nil {
107682  		_sqlite3SelectDelete(tls, _db, _pSelect)
107683  		return nil
107684  	}
107685  	_pTriggerStep.Xop = uint8(119)
107686  	*(**XSelect)(unsafe.Pointer(&_pTriggerStep.XpSelect)) = _pSelect
107687  	_pTriggerStep.Xorconf = uint8(10)
107688  	return _pTriggerStep
107689  }
107690  
107691  // C comment
107692  //  /*
107693  //  ** This function is called to drop a trigger from the database schema.
107694  //  **
107695  //  ** This may be called directly from the parser and therefore identifies
107696  //  ** the trigger by name.  The sqlite3DropTriggerPtr() routine does the
107697  //  ** same job as this routine except it takes a pointer to the trigger
107698  //  ** instead of the trigger name.
107699  //  **/
107700  func _sqlite3DropTrigger(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _noErr int32) {
107701  	var _i, _2_j int32
107702  	var _zDb, _zName *int8
107703  	var _db *Xsqlite3
107704  	var _pTrigger *XTrigger
107705  	_pTrigger = nil
107706  	_db = (*Xsqlite3)(_pParse.Xdb)
107707  	if _db.XmallocFailed != 0 {
107708  		goto _drop_trigger_cleanup
107709  	}
107710  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
107711  		goto _drop_trigger_cleanup
107712  	}
107713  	func() {
107714  		if _pName.XnSrc != int32(1) {
107715  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123138), unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000), unsafe.Pointer(str(114819)))
107716  			crt.X__builtin_abort(tls)
107717  		}
107718  	}()
107719  	_zDb = elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzDatabase
107720  	_zName = elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzName
107721  	func() {
107722  		if _zDb == nil && _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
107723  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123141), unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000), unsafe.Pointer(str(59893)))
107724  			crt.X__builtin_abort(tls)
107725  		}
107726  	}()
107727  	_i = int32(0)
107728  _7:
107729  	if _i >= _db.XnDb {
107730  		goto _10
107731  	}
107732  	_2_j = func() int32 {
107733  		if _i < int32(2) {
107734  			return (_i ^ int32(1))
107735  		}
107736  		return _i
107737  	}()
107738  	if (_zDb != nil) && _sqlite3StrICmp(tls, elem27((*XDb)(_db.XaDb), uintptr(_2_j)).XzDbSName, _zDb) != 0 {
107739  		goto _8
107740  	}
107741  	func() {
107742  		if _sqlite3SchemaMutexHeld(tls, _db, _2_j, nil) == 0 {
107743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123145), unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000), unsafe.Pointer(str(59943)))
107744  			crt.X__builtin_abort(tls)
107745  		}
107746  	}()
107747  	_pTrigger = (*XTrigger)(_sqlite3HashFind(tls, &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_2_j)).XpSchema).XtrigHash), _zName))
107748  	if _pTrigger != nil {
107749  		goto _10
107750  	}
107751  _8:
107752  	_i += 1
107753  	goto _7
107754  _10:
107755  	if _pTrigger != nil {
107756  		goto _18
107757  	}
107758  	if _noErr == 0 {
107759  		_sqlite3ErrorMsg(tls, _pParse, str(124047), unsafe.Pointer(_pName), int32(0))
107760  		goto _20
107761  	}
107762  	_sqlite3CodeVerifyNamedSchema(tls, _pParse, _zDb)
107763  _20:
107764  	_pParse.XcheckSchema = uint8(1)
107765  	goto _drop_trigger_cleanup
107766  _18:
107767  	_sqlite3DropTriggerPtr(tls, _pParse, _pTrigger)
107768  _drop_trigger_cleanup:
107769  	_sqlite3SrcListDelete(tls, _db, _pName)
107770  }
107771  
107772  var _sqlite3DropTriggerØ00__func__Ø000 [19]int8
107773  
107774  func init() {
107775  	crt.Xstrncpy(nil, &_sqlite3DropTriggerØ00__func__Ø000[0], str(124067), 19)
107776  }
107777  
107778  // C comment
107779  //  /*
107780  //  ** Called by the parser to compile an ATTACH statement.
107781  //  **
107782  //  **     ATTACH p AS pDbname KEY pKey
107783  //  */
107784  func _sqlite3Attach(tls *crt.TLS, _pParse *XParse, _p *XExpr, _pDbname *XExpr, _pKey *XExpr) {
107785  	_codeAttach(tls, _pParse, int32(24), &_sqlite3AttachØ00attach_funcØ001, _p, _p, _pDbname, _pKey)
107786  }
107787  
107788  // C comment
107789  //  /*
107790  //  ** This procedure generates VDBE code for a single invocation of either the
107791  //  ** sqlite_detach() or sqlite_attach() SQL user functions.
107792  //  */
107793  func _codeAttach(tls *crt.TLS, _pParse *XParse, _type int32, _pFunc *XFuncDef, _pAuthArg *XExpr, _pFilename *XExpr, _pDbname *XExpr, _pKey *XExpr) {
107794  	var _rc, _regArgs int32
107795  	var _2_zAuthArg *int8
107796  	var _db *Xsqlite3
107797  	var _v *TVdbe
107798  	var _sName XNameContext
107799  	_db = (*Xsqlite3)(_pParse.Xdb)
107800  	if _pParse.XnErr != 0 {
107801  		goto _attach_end
107802  	}
107803  	crt.Xmemset(tls, unsafe.Pointer(&_sName), int32(0), uint64(56))
107804  	*(**XParse)(unsafe.Pointer(&_sName.XpParse)) = _pParse
107805  	if ((int32(0) != store2(&_rc, _resolveAttachExpr(tls, &_sName, _pFilename))) || (int32(0) != store2(&_rc, _resolveAttachExpr(tls, &_sName, _pDbname)))) || (int32(0) != store2(&_rc, _resolveAttachExpr(tls, &_sName, _pKey))) {
107806  		goto _attach_end
107807  	}
107808  	if _pAuthArg == nil {
107809  		goto _4
107810  	}
107811  	if int32(_pAuthArg.Xop) == int32(97) {
107812  		_2_zAuthArg = *(**int8)(unsafe.Pointer(&_pAuthArg.Xu))
107813  		goto _6
107814  	}
107815  	_2_zAuthArg = nil
107816  _6:
107817  	_rc = _sqlite3AuthCheck(tls, _pParse, _type, _2_zAuthArg, nil, nil)
107818  	if _rc != int32(0) {
107819  		goto _attach_end
107820  	}
107821  _4:
107822  	_v = _sqlite3GetVdbe(tls, _pParse)
107823  	_regArgs = _sqlite3GetTempRange(tls, _pParse, int32(4))
107824  	_sqlite3ExprCode(tls, _pParse, _pFilename, _regArgs)
107825  	_sqlite3ExprCode(tls, _pParse, _pDbname, _regArgs+int32(1))
107826  	_sqlite3ExprCode(tls, _pParse, _pKey, _regArgs+int32(2))
107827  	func() {
107828  		if _v == nil && _db.XmallocFailed == 0 {
107829  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99197), unsafe.Pointer(&_codeAttachØ00__func__Ø000), unsafe.Pointer(str(124086)))
107830  			crt.X__builtin_abort(tls)
107831  		}
107832  	}()
107833  	if _v != nil {
107834  		_sqlite3VdbeAddOp4(tls, _v, int32(69), int32(0), (_regArgs+int32(3))-int32(_pFunc.XnArg), _regArgs+int32(3), (*int8)(unsafe.Pointer(_pFunc)), int32(-4))
107835  		func() {
107836  			if int32(_pFunc.XnArg) != int32(-1) && (int32(_pFunc.XnArg)&int32(255)) != int32(_pFunc.XnArg) {
107837  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99201), unsafe.Pointer(&_codeAttachØ00__func__Ø000), unsafe.Pointer(str(124108)))
107838  				crt.X__builtin_abort(tls)
107839  			}
107840  		}()
107841  		_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_pFunc.XnArg)))
107842  		_sqlite3VdbeAddOp1(tls, _v, int32(153), bool2int(_type == int32(24)))
107843  	}
107844  _attach_end:
107845  	_sqlite3ExprDelete(tls, _db, _pFilename)
107846  	_sqlite3ExprDelete(tls, _db, _pDbname)
107847  	_sqlite3ExprDelete(tls, _db, _pKey)
107848  }
107849  
107850  // C comment
107851  //  /*
107852  //  ** Resolve an expression that was part of an ATTACH or DETACH statement. This
107853  //  ** is slightly different from resolving a normal SQL expression, because simple
107854  //  ** identifiers are treated as strings, not possible column names or aliases.
107855  //  **
107856  //  ** i.e. if the parser sees:
107857  //  **
107858  //  **     ATTACH DATABASE abc AS def
107859  //  **
107860  //  ** it treats the two expressions as literal strings 'abc' and 'def' instead of
107861  //  ** looking for columns of the same name.
107862  //  **
107863  //  ** This only applies to the root node of pExpr, so the statement:
107864  //  **
107865  //  **     ATTACH DATABASE abc||def AS 'db2'
107866  //  **
107867  //  ** will fail because neither abc or def can be resolved.
107868  //  */
107869  func _resolveAttachExpr(tls *crt.TLS, _pName *XNameContext, _pExpr *XExpr) (r0 int32) {
107870  	var _rc int32
107871  	_rc = int32(0)
107872  	if _pExpr == nil {
107873  		goto _0
107874  	}
107875  	if int32(_pExpr.Xop) != int32(27) {
107876  		_rc = _sqlite3ResolveExprNames(tls, _pName, _pExpr)
107877  		goto _2
107878  	}
107879  	_pExpr.Xop = uint8(97)
107880  _2:
107881  _0:
107882  	return _rc
107883  }
107884  
107885  var _codeAttachØ00__func__Ø000 [11]int8
107886  
107887  func init() {
107888  	crt.Xstrncpy(nil, &_codeAttachØ00__func__Ø000[0], str(124159), 11)
107889  }
107890  
107891  var _sqlite3AttachØ00attach_funcØ001 XFuncDef
107892  
107893  func init() {
107894  	_sqlite3AttachØ00attach_funcØ001 = XFuncDef{XnArg: int8(3), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
107895  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
107896  	}{_attachFunc})), XzName: str(124170)}
107897  }
107898  
107899  // C comment
107900  //  /*
107901  //  ** An SQL user-function registered to do the work of an ATTACH statement. The
107902  //  ** three arguments to the function come directly from an attach statement:
107903  //  **
107904  //  **     ATTACH DATABASE x AS y KEY z
107905  //  **
107906  //  **     SELECT sqlite_attach(x, y, z)
107907  //  **
107908  //  ** If the optional "KEY z" syntax is omitted, an SQL NULL is passed as the
107909  //  ** third argument.
107910  //  */
107911  func _attachFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
107912  	var _i, _rc, _14_iDb int32
107913  	var _flags uint32
107914  	var _zName, _zFile, _zPath, _zErr, _zErrDyn, _3_z *int8
107915  	var _db *Xsqlite3
107916  	var _aNew *XDb
107917  	var _9_pPager *XPager
107918  	var _pVfs *Xsqlite3_vfs
107919  	_rc = int32(0)
107920  	_db = Xsqlite3_context_db_handle(tls, _context)
107921  	_zPath = nil
107922  	_zErr = nil
107923  	_zErrDyn = nil
107924  
107925  	_zFile = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
107926  	_zName = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))))
107927  	if _zFile == nil {
107928  		_zFile = str(284)
107929  	}
107930  	if _zName == nil {
107931  		_zName = str(284)
107932  	}
107933  	if _db.XnDb >= ((*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(7))) + int32(2)) {
107934  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(124184), *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(7)))
107935  		goto _attach_error
107936  	}
107937  	if _db.XautoCommit == 0 {
107938  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(124221))
107939  		goto _attach_error
107940  	}
107941  	_i = int32(0)
107942  _4:
107943  	if _i >= _db.XnDb {
107944  		goto _7
107945  	}
107946  	_3_z = elem27((*XDb)(_db.XaDb), uintptr(_i)).XzDbSName
107947  	func() {
107948  		if _3_z == nil || _zName == nil {
107949  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98935), unsafe.Pointer(&_attachFuncØ00__func__Ø000), unsafe.Pointer(str(124263)))
107950  			crt.X__builtin_abort(tls)
107951  		}
107952  	}()
107953  	if _sqlite3StrICmp(tls, _3_z, _zName) == int32(0) {
107954  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(124274), unsafe.Pointer(_zName))
107955  		goto _attach_error
107956  	}
107957  	_i += 1
107958  	goto _4
107959  _7:
107960  	if (*XDb)(_db.XaDb) != (*XDb)(unsafe.Pointer(&_db.XaDbStatic)) {
107961  		goto _12
107962  	}
107963  	_aNew = (*XDb)(_sqlite3DbMallocRawNN(tls, _db, uint64(96)))
107964  	if _aNew == nil {
107965  		return
107966  	}
107967  	crt.Xmemcpy(tls, unsafe.Pointer(_aNew), _db.XaDb, uint64(64))
107968  	goto _14
107969  _12:
107970  	_aNew = (*XDb)(_sqlite3DbRealloc(tls, _db, _db.XaDb, uint64(32)*uint64(_db.XnDb+int32(1))))
107971  	if _aNew == nil {
107972  		return
107973  	}
107974  _14:
107975  	*(**XDb)(unsafe.Pointer(&_db.XaDb)) = _aNew
107976  	_aNew = elem27((*XDb)(_db.XaDb), uintptr(_db.XnDb))
107977  	crt.Xmemset(tls, unsafe.Pointer(_aNew), int32(0), uint64(32))
107978  	_flags = _db.XopenFlags
107979  	_rc = _sqlite3ParseUri(tls, (*Xsqlite3_vfs)(_db.XpVfs).XzName, _zFile, &_flags, &_pVfs, &_zPath, &_zErr)
107980  	if _rc == int32(0) {
107981  		goto _16
107982  	}
107983  	if _rc == int32(7) {
107984  		_sqlite3OomFault(tls, _db)
107985  	}
107986  	Xsqlite3_result_error(tls, _context, _zErr, int32(-1))
107987  	Xsqlite3_free(tls, unsafe.Pointer(_zErr))
107988  	return
107989  _16:
107990  	func() {
107991  		if _pVfs == nil {
107992  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98969), unsafe.Pointer(&_attachFuncØ00__func__Ø000), unsafe.Pointer(str(124304)))
107993  			crt.X__builtin_abort(tls)
107994  		}
107995  	}()
107996  	_flags |= uint32(256)
107997  	_rc = _sqlite3BtreeOpen(tls, _pVfs, _zPath, _db, (**XBtree)(unsafe.Pointer(&_aNew.XpBt)), int32(0), int32(_flags))
107998  	Xsqlite3_free(tls, unsafe.Pointer(_zPath))
107999  	_db.XnDb += 1
108000  	_db.XskipBtreeMutex = 0
108001  	if _rc == int32(19) {
108002  		_rc = int32(1)
108003  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(124309))
108004  		goto _22
108005  	}
108006  	if _rc != int32(0) {
108007  		goto _22
108008  	}
108009  	*(**XSchema)(unsafe.Pointer(&_aNew.XpSchema)) = _sqlite3SchemaGet(tls, _db, (*XBtree)(_aNew.XpBt))
108010  	if _aNew.XpSchema == nil {
108011  		_rc = _sqlite3NomemError(tls, int32(98982))
108012  		goto _26
108013  	}
108014  	if (((*XSchema)(_aNew.XpSchema).Xfile_format) != 0) && (int32((*XSchema)(_aNew.XpSchema).Xenc) != int32(_db.Xenc)) {
108015  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(50073))
108016  		_rc = int32(1)
108017  	}
108018  _26:
108019  	_sqlite3BtreeEnter(tls, (*XBtree)(_aNew.XpBt))
108020  	_9_pPager = _sqlite3BtreePager(tls, (*XBtree)(_aNew.XpBt))
108021  	_sqlite3PagerLockingMode(tls, _9_pPager, int32(_db.XdfltLockMode))
108022  	_sqlite3BtreeSecureDelete(tls, (*XBtree)(_aNew.XpBt), _sqlite3BtreeSecureDelete(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt), int32(-1)))
108023  	_sqlite3BtreeSetPagerFlags(tls, (*XBtree)(_aNew.XpBt), uint32(int32(3)|(_db.Xflags&int32(56))))
108024  	_sqlite3BtreeLeave(tls, (*XBtree)(_aNew.XpBt))
108025  _22:
108026  	_aNew.Xsafety_level = uint8(3)
108027  	_aNew.XzDbSName = _sqlite3DbStrDup(tls, _db, _zName)
108028  	if (_rc == int32(0)) && (_aNew.XzDbSName == nil) {
108029  		_rc = _sqlite3NomemError(tls, int32(99002))
108030  	}
108031  	if _rc == int32(0) {
108032  		_sqlite3BtreeEnterAll(tls, _db)
108033  		_rc = _sqlite3Init(tls, _db, &_zErrDyn)
108034  		_sqlite3BtreeLeaveAll(tls, _db)
108035  	}
108036  	if _rc == 0 {
108037  		goto _30
108038  	}
108039  	_14_iDb = _db.XnDb - int32(1)
108040  	func() {
108041  		if _14_iDb < int32(2) {
108042  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99059), unsafe.Pointer(&_attachFuncØ00__func__Ø000), unsafe.Pointer(str(124338)))
108043  			crt.X__builtin_abort(tls)
108044  		}
108045  	}()
108046  	if (elem27((*XDb)(_db.XaDb), uintptr(_14_iDb)).XpBt) != nil {
108047  		_sqlite3BtreeClose(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_14_iDb)).XpBt))
108048  		*(**XBtree)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), uintptr(_14_iDb)).XpBt))) = nil
108049  		*(**XSchema)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), uintptr(_14_iDb)).XpSchema))) = nil
108050  	}
108051  	_sqlite3ResetAllSchemasOfConnection(tls, _db)
108052  	_db.XnDb = _14_iDb
108053  	if (_rc == int32(7)) || (_rc == int32(3082)) {
108054  		_sqlite3OomFault(tls, _db)
108055  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrDyn))
108056  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(59395))
108057  		goto _37
108058  	}
108059  	if _zErrDyn == nil {
108060  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(124345), unsafe.Pointer(_zFile))
108061  	}
108062  _37:
108063  	goto _attach_error
108064  _30:
108065  	return
108066  _attach_error:
108067  	if _zErrDyn != nil {
108068  		Xsqlite3_result_error(tls, _context, _zErrDyn, int32(-1))
108069  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrDyn))
108070  	}
108071  	if _rc != 0 {
108072  		Xsqlite3_result_error_code(tls, _context, _rc)
108073  	}
108074  }
108075  
108076  var _attachFuncØ00__func__Ø000 [11]int8
108077  
108078  func init() {
108079  	crt.Xstrncpy(nil, &_attachFuncØ00__func__Ø000[0], str(124373), 11)
108080  }
108081  
108082  // C comment
108083  //  /*
108084  //  ** This function is used to parse both URIs and non-URI filenames passed by the
108085  //  ** user to API functions sqlite3_open() or sqlite3_open_v2(), and for database
108086  //  ** URIs specified as part of ATTACH statements.
108087  //  **
108088  //  ** The first argument to this function is the name of the VFS to use (or
108089  //  ** a NULL to signify the default VFS) if the URI does not contain a "vfs=xxx"
108090  //  ** query parameter. The second argument contains the URI (or non-URI filename)
108091  //  ** itself. When this function is called the *pFlags variable should contain
108092  //  ** the default flags to open the database handle with. The value stored in
108093  //  ** *pFlags may be updated before returning if the URI filename contains
108094  //  ** "cache=xxx" or "mode=xxx" query parameters.
108095  //  **
108096  //  ** If successful, SQLITE_OK is returned. In this case *ppVfs is set to point to
108097  //  ** the VFS that should be used to open the database file. *pzFile is set to
108098  //  ** point to a buffer containing the name of the file to open. It is the
108099  //  ** responsibility of the caller to eventually call sqlite3_free() to release
108100  //  ** this buffer.
108101  //  **
108102  //  ** If an error occurs, then an SQLite error code is returned and *pzErrMsg
108103  //  ** may be set to point to a buffer containing an English language error
108104  //  ** message. It is the responsibility of the caller to eventually release
108105  //  ** this buffer by calling sqlite3_free().
108106  //  */
108107  func _sqlite3ParseUri(tls *crt.TLS, _zDefaultVfs *int8, _zUri *int8, _pFlags *uint32, _ppVfs **Xsqlite3_vfs, _pzFile **int8, _pzErrMsg **int8) (r0 int32) {
108108  	var _rc, _nUri, _1_eState, _1_iIn, _1_iOut, _5_octet, _13_nOpt, _13_nVal, _15_mask, _15_limit, _18_i, _18_mode int32
108109  	var _c int8
108110  	var _flags uint32
108111  	var _1_nByte uint64
108112  	var _zVfs, _zFile, _1_zOpt, _13_zVal, _15_zModeType, _19_z *int8
108113  	var _15_aMode *TOpenMode
108114  	_rc = int32(0)
108115  	_flags = *_pFlags
108116  	_zVfs = _zDefaultVfs
108117  	_nUri = _sqlite3Strlen30(tls, _zUri)
108118  	func() {
108119  		if (*_pzErrMsg) != nil {
108120  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143033), unsafe.Pointer(&_sqlite3ParseUriØ00__func__Ø000), unsafe.Pointer(str(124384)))
108121  			crt.X__builtin_abort(tls)
108122  		}
108123  	}()
108124  	if (_flags&uint32(64)) == 0 && _sqlite3Config.XbOpenUri == 0 || _nUri < int32(5) || crt.Xmemcmp(tls, unsafe.Pointer(_zUri), unsafe.Pointer(str(124397)), uint64(5)) != int32(0) {
108125  		goto _5
108126  	}
108127  	_1_iOut = int32(0)
108128  	_1_nByte = uint64(_nUri + int32(2))
108129  	_flags |= uint32(64)
108130  	_1_iIn = int32(0)
108131  _6:
108132  	if _1_iIn >= _nUri {
108133  		goto _9
108134  	}
108135  	_1_nByte += uint64(bool2int(int32(*elem1(_zUri, uintptr(_1_iIn))) == int32(38)))
108136  	_1_iIn += 1
108137  	goto _6
108138  _9:
108139  	_zFile = (*int8)(Xsqlite3_malloc64(tls, _1_nByte))
108140  	if _zFile == nil {
108141  		return _sqlite3NomemError(tls, int32(143051))
108142  	}
108143  	_1_iIn = int32(5)
108144  	if int32(*elem1(_zUri, uintptr(5))) != int32(47) || int32(*elem1(_zUri, uintptr(6))) != int32(47) {
108145  		goto _12
108146  	}
108147  	_1_iIn = int32(7)
108148  _13:
108149  	if ((*elem1(_zUri, uintptr(_1_iIn))) != 0) && (int32(*elem1(_zUri, uintptr(_1_iIn))) != int32(47)) {
108150  		_1_iIn += 1
108151  		goto _13
108152  	}
108153  	if (_1_iIn != int32(7)) && ((_1_iIn != int32(16)) || crt.Xmemcmp(tls, unsafe.Pointer(str(124403)), unsafe.Pointer(elem1(_zUri, uintptr(7))), uint64(9)) != 0) {
108154  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(124413), _1_iIn-int32(7), unsafe.Pointer(elem1(_zUri, uintptr(7))))
108155  		_rc = int32(1)
108156  		goto _parse_uri_out
108157  	}
108158  _12:
108159  	_1_eState = int32(0)
108160  _19:
108161  	if int32(store5(&_c, *elem1(_zUri, uintptr(_1_iIn)))) == int32(0) || int32(_c) == int32(35) {
108162  		goto _20
108163  	}
108164  	_1_iIn += 1
108165  	if int32(_c) != int32(37) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zUri, uintptr(_1_iIn))))))&int32(8)) == 0 || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zUri, uintptr(_1_iIn+int32(1)))))))&int32(8)) == 0 {
108166  		goto _24
108167  	}
108168  	_5_octet = int32(_sqlite3HexToInt(tls, int32(*elem1(_zUri, uintptr(postInc2(&_1_iIn, 1)))))) << 4
108169  	_5_octet += int32(_sqlite3HexToInt(tls, int32(*elem1(_zUri, uintptr(postInc2(&_1_iIn, 1))))))
108170  	func() {
108171  		if _5_octet < int32(0) || _5_octet >= int32(256) {
108172  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143100), unsafe.Pointer(&_sqlite3ParseUriØ00__func__Ø000), unsafe.Pointer(str(124441)))
108173  			crt.X__builtin_abort(tls)
108174  		}
108175  	}()
108176  	if _5_octet != int32(0) {
108177  		goto _28
108178  	}
108179  _29:
108180  	if ((((int32(store5(&_c, *elem1(_zUri, uintptr(_1_iIn)))) != int32(0)) && (int32(_c) != int32(35))) && ((_1_eState != int32(0)) || (int32(_c) != int32(63)))) && ((_1_eState != int32(1)) || ((int32(_c) != int32(61)) && (int32(_c) != int32(38))))) && ((_1_eState != int32(2)) || (int32(_c) != int32(38))) {
108181  		_1_iIn += 1
108182  		goto _29
108183  	}
108184  	goto _19
108185  _28:
108186  	_c = int8(_5_octet)
108187  	goto _54
108188  _24:
108189  	if _1_eState != int32(1) || int32(_c) != int32(38) && int32(_c) != int32(61) {
108190  		goto _42
108191  	}
108192  	if int32(*elem1(_zFile, uintptr(_1_iOut-int32(1)))) != int32(0) {
108193  		goto _43
108194  	}
108195  _44:
108196  	if (((*elem1(_zUri, uintptr(_1_iIn))) != 0) && (int32(*elem1(_zUri, uintptr(_1_iIn))) != int32(35))) && (int32(*elem1(_zUri, uintptr(_1_iIn-int32(1)))) != int32(38)) {
108197  		_1_iIn += 1
108198  		goto _44
108199  	}
108200  	goto _19
108201  _43:
108202  	if int32(_c) == int32(38) {
108203  		*elem1(_zFile, uintptr(postInc2(&_1_iOut, 1))) = 0
108204  		goto _49
108205  	}
108206  	_1_eState = int32(2)
108207  _49:
108208  	_c = 0
108209  	goto _54
108210  _42:
108211  	if ((_1_eState == int32(0)) && (int32(_c) == int32(63))) || ((_1_eState == int32(2)) && (int32(_c) == int32(38))) {
108212  		_c = 0
108213  		_1_eState = int32(1)
108214  	}
108215  _54:
108216  	*elem1(_zFile, uintptr(postInc2(&_1_iOut, 1))) = _c
108217  	goto _19
108218  _20:
108219  	if _1_eState == int32(1) {
108220  		*elem1(_zFile, uintptr(postInc2(&_1_iOut, 1))) = 0
108221  	}
108222  	*elem1(_zFile, uintptr(postInc2(&_1_iOut, 1))) = 0
108223  	*elem1(_zFile, uintptr(postInc2(&_1_iOut, 1))) = 0
108224  	_1_zOpt = elem1(_zFile, uintptr(_sqlite3Strlen30(tls, _zFile)+int32(1)))
108225  _56:
108226  	if (*elem1(_1_zOpt, 0)) == 0 {
108227  		goto _57
108228  	}
108229  	_13_nOpt = _sqlite3Strlen30(tls, _1_zOpt)
108230  	_13_zVal = elem1(_1_zOpt, uintptr(_13_nOpt+int32(1)))
108231  	_13_nVal = _sqlite3Strlen30(tls, _13_zVal)
108232  	if (_13_nOpt == int32(3)) && (crt.Xmemcmp(tls, unsafe.Pointer(str(124463)), unsafe.Pointer(_1_zOpt), uint64(3)) == int32(0)) {
108233  		_zVfs = _13_zVal
108234  		goto _60
108235  	}
108236  	_15_aMode = nil
108237  	_15_zModeType = nil
108238  	_15_mask = int32(0)
108239  	_15_limit = int32(0)
108240  	if (_13_nOpt == int32(5)) && (crt.Xmemcmp(tls, unsafe.Pointer(str(124467)), unsafe.Pointer(_1_zOpt), uint64(5)) == int32(0)) {
108241  		_15_mask = int32(393216)
108242  		_15_aMode = (*TOpenMode)(unsafe.Pointer(&_sqlite3ParseUriØ00aCacheModeØ001))
108243  		_15_limit = _15_mask
108244  		_15_zModeType = str(124467)
108245  	}
108246  	if (_13_nOpt == int32(4)) && (crt.Xmemcmp(tls, unsafe.Pointer(str(124473)), unsafe.Pointer(_1_zOpt), uint64(4)) == int32(0)) {
108247  		_15_mask = int32(135)
108248  		_15_aMode = (*TOpenMode)(unsafe.Pointer(&_sqlite3ParseUriØ00aOpenModeØ002))
108249  		_15_limit = int32(uint32(_15_mask) & _flags)
108250  		_15_zModeType = str(124478)
108251  	}
108252  	if _15_aMode == nil {
108253  		goto _65
108254  	}
108255  	_18_mode = int32(0)
108256  	_18_i = int32(0)
108257  _66:
108258  	if (elem127(_15_aMode, uintptr(_18_i)).Xz) == nil {
108259  		goto _69
108260  	}
108261  	_19_z = elem127(_15_aMode, uintptr(_18_i)).Xz
108262  	if (_13_nVal == _sqlite3Strlen30(tls, _19_z)) && (int32(0) == crt.Xmemcmp(tls, unsafe.Pointer(_13_zVal), unsafe.Pointer(_19_z), uint64(_13_nVal))) {
108263  		_18_mode = elem127(_15_aMode, uintptr(_18_i)).Xmode
108264  		goto _69
108265  	}
108266  	_18_i += 1
108267  	goto _66
108268  _69:
108269  	if _18_mode == int32(0) {
108270  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(124485), unsafe.Pointer(_15_zModeType), unsafe.Pointer(_13_zVal))
108271  		_rc = int32(1)
108272  		goto _parse_uri_out
108273  	}
108274  	if (_18_mode & int32(-129)) > _15_limit {
108275  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(124505), unsafe.Pointer(_15_zModeType), unsafe.Pointer(_13_zVal))
108276  		_rc = int32(3)
108277  		goto _parse_uri_out
108278  	}
108279  	_flags = (_flags & uint32(^_15_mask)) | uint32(_18_mode)
108280  _65:
108281  _60:
108282  	_1_zOpt = elem1(_13_zVal, uintptr(_13_nVal+int32(1)))
108283  	goto _56
108284  _57:
108285  	goto _74
108286  _5:
108287  	_zFile = (*int8)(Xsqlite3_malloc64(tls, uint64(_nUri+int32(2))))
108288  	if _zFile == nil {
108289  		return _sqlite3NomemError(tls, int32(143224))
108290  	}
108291  	if _nUri != 0 {
108292  		crt.Xmemcpy(tls, unsafe.Pointer(_zFile), unsafe.Pointer(_zUri), uint64(_nUri))
108293  	}
108294  	*elem1(_zFile, uintptr(_nUri)) = 0
108295  	*elem1(_zFile, uintptr(_nUri+int32(1))) = 0
108296  	_flags &= uint32(4294967231)
108297  _74:
108298  	*_ppVfs = Xsqlite3_vfs_find(tls, _zVfs)
108299  	if (*_ppVfs) == nil {
108300  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(124529), unsafe.Pointer(_zVfs))
108301  		_rc = int32(1)
108302  	}
108303  _parse_uri_out:
108304  	if _rc != int32(0) {
108305  		Xsqlite3_free(tls, unsafe.Pointer(_zFile))
108306  		_zFile = nil
108307  	}
108308  	*_pFlags = _flags
108309  	*_pzFile = _zFile
108310  	return _rc
108311  }
108312  
108313  var _sqlite3ParseUriØ00__func__Ø000 [16]int8
108314  
108315  func init() {
108316  	crt.Xstrncpy(nil, &_sqlite3ParseUriØ00__func__Ø000[0], str(124545), 16)
108317  }
108318  
108319  var _sqlite3ParseUriØ00aCacheModeØ001 [3]TOpenMode
108320  
108321  func init() {
108322  	_sqlite3ParseUriØ00aCacheModeØ001 = [3]TOpenMode{TOpenMode{Xz: str(123392), Xmode: int32(131072)}, TOpenMode{Xz: str(124561), Xmode: int32(262144)}, TOpenMode{}}
108323  }
108324  
108325  var _sqlite3ParseUriØ00aOpenModeØ002 [5]TOpenMode
108326  
108327  func init() {
108328  	_sqlite3ParseUriØ00aOpenModeØ002 = [5]TOpenMode{TOpenMode{Xz: str(124569), Xmode: int32(1)}, TOpenMode{Xz: str(124572), Xmode: int32(2)}, TOpenMode{Xz: str(124575), Xmode: int32(6)}, TOpenMode{Xz: str(89677), Xmode: int32(128)}, TOpenMode{}}
108329  }
108330  
108331  // C comment
108332  //  /*
108333  //  ** Find and return the schema associated with a BTree.  Create
108334  //  ** a new one if necessary.
108335  //  */
108336  func _sqlite3SchemaGet(tls *crt.TLS, _db *Xsqlite3, _pBt *XBtree) (r0 *XSchema) {
108337  	var _p *XSchema
108338  	if _pBt != nil {
108339  		_p = (*XSchema)(_sqlite3BtreeSchema(tls, _pBt, int32(120), _sqlite3SchemaClear))
108340  		goto _1
108341  	}
108342  	_p = (*XSchema)(_sqlite3DbMallocZero(tls, nil, uint64(120)))
108343  _1:
108344  	if _p == nil {
108345  		_sqlite3OomFault(tls, _db)
108346  		goto _4
108347  	}
108348  	if int32(0) == int32(_p.Xfile_format) {
108349  		_sqlite3HashInit(tls, &_p.XtblHash)
108350  		_sqlite3HashInit(tls, &_p.XidxHash)
108351  		_sqlite3HashInit(tls, &_p.XtrigHash)
108352  		_sqlite3HashInit(tls, &_p.XfkeyHash)
108353  		_p.Xenc = uint8(1)
108354  	}
108355  _4:
108356  	return _p
108357  }
108358  
108359  func Xsqlite3_result_error_code(tls *crt.TLS, _pCtx *Xsqlite3_context, _errCode int32) {
108360  	_pCtx.XisError = _errCode
108361  	_pCtx.XfErrorOrAux = uint8(1)
108362  	if _pCtx.XpVdbe != nil {
108363  		(*TVdbe)(_pCtx.XpVdbe).XrcApp = _errCode
108364  	}
108365  	if (int32((*XMem)(_pCtx.XpOut).Xflags) & int32(1)) != 0 {
108366  		_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.XpOut), _sqlite3ErrStr(tls, _errCode), int32(-1), uint8(1), nil)
108367  	}
108368  }
108369  
108370  // C comment
108371  //  /*
108372  //  ** Called by the parser to compile a DETACH statement.
108373  //  **
108374  //  **     DETACH pDbname
108375  //  */
108376  func _sqlite3Detach(tls *crt.TLS, _pParse *XParse, _pDbname *XExpr) {
108377  	_codeAttach(tls, _pParse, int32(25), &_sqlite3DetachØ00detach_funcØ001, _pDbname, nil, nil, _pDbname)
108378  }
108379  
108380  var _sqlite3DetachØ00detach_funcØ001 XFuncDef
108381  
108382  func init() {
108383  	_sqlite3DetachØ00detach_funcØ001 = XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
108384  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
108385  	}{_detachFunc})), XzName: str(124579)}
108386  }
108387  
108388  // C comment
108389  //  /*
108390  //  ** An SQL user-function registered to do the work of an DETACH statement. The
108391  //  ** three arguments to the function come directly from a detach statement:
108392  //  **
108393  //  **     DETACH DATABASE x
108394  //  **
108395  //  **     SELECT sqlite_detach(x)
108396  //  */
108397  func _detachFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
108398  	var _i int32
108399  	var _zName *int8
108400  	var _db *Xsqlite3
108401  	var _pDb *XDb
108402  	var _zErr [128]int8
108403  	_zName = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
108404  	_db = Xsqlite3_context_db_handle(tls, _context)
108405  	_pDb = nil
108406  
108407  	if _zName == nil {
108408  		_zName = str(284)
108409  	}
108410  	_i = int32(0)
108411  _1:
108412  	if _i >= _db.XnDb {
108413  		goto _4
108414  	}
108415  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_i))
108416  	if (*XBtree)(_pDb.XpBt) == nil {
108417  		goto _2
108418  	}
108419  	if _sqlite3StrICmp(tls, _pDb.XzDbSName, _zName) == int32(0) {
108420  		goto _4
108421  	}
108422  _2:
108423  	_i += 1
108424  	goto _1
108425  _4:
108426  	if _i >= _db.XnDb {
108427  		Xsqlite3_snprintf(tls, int32(128), (*int8)(unsafe.Pointer(&_zErr)), str(124593), unsafe.Pointer(_zName))
108428  		goto _detach_error
108429  	}
108430  	if _i < int32(2) {
108431  		Xsqlite3_snprintf(tls, int32(128), (*int8)(unsafe.Pointer(&_zErr)), str(124614), unsafe.Pointer(_zName))
108432  		goto _detach_error
108433  	}
108434  	if _db.XautoCommit == 0 {
108435  		Xsqlite3_snprintf(tls, int32(128), (*int8)(unsafe.Pointer(&_zErr)), str(124640))
108436  		goto _detach_error
108437  	}
108438  	if _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(_pDb.XpBt)) != 0 || _sqlite3BtreeIsInBackup(tls, (*XBtree)(_pDb.XpBt)) != 0 {
108439  		Xsqlite3_snprintf(tls, int32(128), (*int8)(unsafe.Pointer(&_zErr)), str(124682), unsafe.Pointer(_zName))
108440  		goto _detach_error
108441  	}
108442  	_sqlite3BtreeClose(tls, (*XBtree)(_pDb.XpBt))
108443  	*(**XBtree)(unsafe.Pointer(&_pDb.XpBt)) = nil
108444  	*(**XSchema)(unsafe.Pointer(&_pDb.XpSchema)) = nil
108445  	_sqlite3CollapseDatabaseArray(tls, _db)
108446  	return
108447  _detach_error:
108448  	Xsqlite3_result_error(tls, _context, (*int8)(unsafe.Pointer(&_zErr)), int32(-1))
108449  	_ = _zErr
108450  }
108451  
108452  func _sqlite3Reindex(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken) {
108453  	var _iDb int32
108454  	var _z, _zDb, _3_zColl *int8
108455  	var _db *Xsqlite3
108456  	var _pTab *XTable
108457  	var _pObjName *XToken
108458  	var _pIndex *XIndex
108459  	var _pColl *XCollSeq
108460  	_db = (*Xsqlite3)(_pParse.Xdb)
108461  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
108462  		return
108463  	}
108464  	if _pName1 == nil {
108465  		_reindexDatabases(tls, _pParse, nil)
108466  		return
108467  	}
108468  	if func() int32 {
108469  		if _pName2 == nil {
108470  			return func() int32 {
108471  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104007), unsafe.Pointer(&_sqlite3ReindexØ00__func__Ø000), unsafe.Pointer(str(4809)))
108472  				crt.X__builtin_abort(tls)
108473  				return int32(1)
108474  			}()
108475  		}
108476  		return int32(0)
108477  	}() == 0 && _pName2.Xz != nil {
108478  		goto _6
108479  	}
108480  	func() {
108481  		if _pName1.Xz == nil {
108482  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104009), unsafe.Pointer(&_sqlite3ReindexØ00__func__Ø000), unsafe.Pointer(str(124704)))
108483  			crt.X__builtin_abort(tls)
108484  		}
108485  	}()
108486  	_3_zColl = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.Xdb), _pName1)
108487  	if _3_zColl == nil {
108488  		return
108489  	}
108490  	_pColl = _sqlite3FindCollSeq(tls, _db, _db.Xenc, _3_zColl, int32(0))
108491  	if _pColl != nil {
108492  		_reindexDatabases(tls, _pParse, _3_zColl)
108493  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_3_zColl))
108494  		return
108495  	}
108496  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_3_zColl))
108497  _6:
108498  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pObjName)
108499  	if _iDb < int32(0) {
108500  		return
108501  	}
108502  	_z = _sqlite3NameFromToken(tls, _db, _pObjName)
108503  	if _z == nil {
108504  		return
108505  	}
108506  	_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
108507  	_pTab = _sqlite3FindTable(tls, _db, _z, _zDb)
108508  	if _pTab != nil {
108509  		_reindexTable(tls, _pParse, _pTab, nil)
108510  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
108511  		return
108512  	}
108513  	_pIndex = _sqlite3FindIndex(tls, _db, _z, _zDb)
108514  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
108515  	if _pIndex != nil {
108516  		_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
108517  		_sqlite3RefillIndex(tls, _pParse, _pIndex, int32(-1))
108518  		return
108519  	}
108520  	_sqlite3ErrorMsg(tls, _pParse, str(124714))
108521  }
108522  
108523  func _reindexDatabases(tls *crt.TLS, _pParse *XParse, _zColl *int8) {
108524  	var _iDb int32
108525  	var _db *Xsqlite3
108526  	var _pDb *XDb
108527  	var _k *XHashElem
108528  	var _pTab *XTable
108529  	_db = (*Xsqlite3)(_pParse.Xdb)
108530  	func() {
108531  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
108532  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103963), unsafe.Pointer(&_reindexDatabasesØ00__func__Ø000), unsafe.Pointer(str(9376)))
108533  			crt.X__builtin_abort(tls)
108534  		}
108535  	}()
108536  	*func() **XDb { _iDb = int32(0); return &_pDb }() = (*XDb)(_db.XaDb)
108537  _2:
108538  	if _iDb >= _db.XnDb {
108539  		goto _5
108540  	}
108541  	func() {
108542  		if _pDb == nil {
108543  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103965), unsafe.Pointer(&_reindexDatabasesØ00__func__Ø000), unsafe.Pointer(str(124760)))
108544  			crt.X__builtin_abort(tls)
108545  		}
108546  	}()
108547  	_k = (*XHashElem)(((*XSchema)(_pDb.XpSchema).XtblHash).Xfirst)
108548  _8:
108549  	if _k == nil {
108550  		goto _11
108551  	}
108552  	_pTab = (*XTable)(_k.Xdata)
108553  	_reindexTable(tls, _pParse, _pTab, _zColl)
108554  	_k = (*XHashElem)(_k.Xnext)
108555  	goto _8
108556  _11:
108557  	*(*uintptr)(unsafe.Pointer(func() **XDb { _iDb += 1; return &_pDb }())) += uintptr(32)
108558  	goto _2
108559  _5:
108560  }
108561  
108562  var _reindexDatabasesØ00__func__Ø000 [17]int8
108563  
108564  func init() {
108565  	crt.Xstrncpy(nil, &_reindexDatabasesØ00__func__Ø000[0], str(124767), 17)
108566  }
108567  
108568  func _reindexTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _zColl *int8) {
108569  	var _2_iDb int32
108570  	var _pIndex *XIndex
108571  	_pIndex = (*XIndex)(_pTab.XpIndex)
108572  _0:
108573  	if _pIndex == nil {
108574  		goto _3
108575  	}
108576  	if (_zColl == nil) || _collationMatch(tls, _zColl, _pIndex) != 0 {
108577  		_2_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
108578  		_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _2_iDb)
108579  		_sqlite3RefillIndex(tls, _pParse, _pIndex, int32(-1))
108580  	}
108581  	_pIndex = (*XIndex)(_pIndex.XpNext)
108582  	goto _0
108583  _3:
108584  }
108585  
108586  func _collationMatch(tls *crt.TLS, _zColl *int8, _pIndex *XIndex) (r0 int32) {
108587  	var _i int32
108588  	var _1_z *int8
108589  	func() {
108590  		if _zColl == nil {
108591  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103920), unsafe.Pointer(&_collationMatchØ00__func__Ø000), unsafe.Pointer(str(124784)))
108592  			crt.X__builtin_abort(tls)
108593  		}
108594  	}()
108595  	_i = int32(0)
108596  _2:
108597  	if _i >= int32(_pIndex.XnColumn) {
108598  		goto _5
108599  	}
108600  	_1_z = *elem0(_pIndex.XazColl, uintptr(_i))
108601  	func() {
108602  		if _1_z == nil && int32(*elem52(_pIndex.XaiColumn, uintptr(_i))) >= int32(0) {
108603  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103923), unsafe.Pointer(&_collationMatchØ00__func__Ø000), unsafe.Pointer(str(124793)))
108604  			crt.X__builtin_abort(tls)
108605  		}
108606  	}()
108607  	if (int32(*elem52(_pIndex.XaiColumn, uintptr(_i))) >= int32(0)) && (int32(0) == _sqlite3StrICmp(tls, _1_z, _zColl)) {
108608  		return int32(1)
108609  	}
108610  	_i += 1
108611  	goto _2
108612  _5:
108613  	return int32(0)
108614  }
108615  
108616  var _collationMatchØ00__func__Ø000 [15]int8
108617  
108618  func init() {
108619  	crt.Xstrncpy(nil, &_collationMatchØ00__func__Ø000[0], str(124823), 15)
108620  }
108621  
108622  var _sqlite3ReindexØ00__func__Ø000 [15]int8
108623  
108624  func init() {
108625  	crt.Xstrncpy(nil, &_sqlite3ReindexØ00__func__Ø000[0], str(124838), 15)
108626  }
108627  
108628  // C comment
108629  //  /*
108630  //  ** Generate code for the ANALYZE command.  The parser calls this routine
108631  //  ** when it recognizes an ANALYZE command.
108632  //  **
108633  //  **        ANALYZE                            -- 1
108634  //  **        ANALYZE  <database>                -- 2
108635  //  **        ANALYZE  ?<database>.?<tablename>  -- 3
108636  //  **
108637  //  ** Form 1 causes all indices in all attached databases to be analyzed.
108638  //  ** Form 2 analyzes all indices the single database named.
108639  //  ** Form 3 analyzes all indices associated with the named table.
108640  //  */
108641  func _sqlite3Analyze(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken) {
108642  	var _iDb, _i int32
108643  	var _z, _zDb *int8
108644  	var _db *Xsqlite3
108645  	var _pTab *XTable
108646  	var _v *TVdbe
108647  	var _pTableName *XToken
108648  	var _pIdx *XIndex
108649  	_db = (*Xsqlite3)(_pParse.Xdb)
108650  	func() {
108651  		if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.Xdb)) == 0 {
108652  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98299), unsafe.Pointer(&_sqlite3AnalyzeØ00__func__Ø000), unsafe.Pointer(str(124853)))
108653  			crt.X__builtin_abort(tls)
108654  		}
108655  	}()
108656  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
108657  		return
108658  	}
108659  	func() {
108660  		if _pName2 == nil && _pName1 != nil {
108661  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98304), unsafe.Pointer(&_sqlite3AnalyzeØ00__func__Ø000), unsafe.Pointer(str(124893)))
108662  			crt.X__builtin_abort(tls)
108663  		}
108664  	}()
108665  	if _pName1 != nil {
108666  		goto _6
108667  	}
108668  	_i = int32(0)
108669  _7:
108670  	if _i >= _db.XnDb {
108671  		goto _10
108672  	}
108673  	if _i == int32(1) {
108674  		goto _8
108675  	}
108676  	_analyzeDatabase(tls, _pParse, _i)
108677  _8:
108678  	_i += 1
108679  	goto _7
108680  _10:
108681  	goto _15
108682  _6:
108683  	if (_pName2.Xn == (0)) && (store2(&_iDb, _sqlite3FindDb(tls, _db, _pName1)) >= int32(0)) {
108684  		_analyzeDatabase(tls, _pParse, _iDb)
108685  		goto _15
108686  	}
108687  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pTableName)
108688  	if _iDb < int32(0) {
108689  		goto _16
108690  	}
108691  	_zDb = func() *int8 {
108692  		if _pName2.Xn != 0 {
108693  			return (elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
108694  		}
108695  		return nil
108696  	}()
108697  	_z = _sqlite3NameFromToken(tls, _db, _pTableName)
108698  	if _z == nil {
108699  		goto _19
108700  	}
108701  	if store114(&_pIdx, _sqlite3FindIndex(tls, _db, _z, _zDb)) != nil {
108702  		_analyzeTable(tls, _pParse, (*XTable)(_pIdx.XpTable), _pIdx)
108703  		goto _22
108704  	}
108705  	if store74(&_pTab, _sqlite3LocateTable(tls, _pParse, 0, _z, _zDb)) != nil {
108706  		_analyzeTable(tls, _pParse, _pTab, nil)
108707  	}
108708  _22:
108709  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
108710  _19:
108711  _16:
108712  _15:
108713  	if (int32(_db.XnSqlExec) == int32(0)) && (store62(&_v, _sqlite3GetVdbe(tls, _pParse)) != nil) {
108714  		_sqlite3VdbeAddOp0(tls, _v, int32(153))
108715  	}
108716  }
108717  
108718  var _sqlite3AnalyzeØ00__func__Ø000 [15]int8
108719  
108720  func init() {
108721  	crt.Xstrncpy(nil, &_sqlite3AnalyzeØ00__func__Ø000[0], str(124916), 15)
108722  }
108723  
108724  // C comment
108725  //  /*
108726  //  ** Generate code that will do an analysis of an entire database
108727  //  */
108728  func _analyzeDatabase(tls *crt.TLS, _pParse *XParse, _iDb int32) {
108729  	var _iStatCur, _iMem, _iTab int32
108730  	var _db *Xsqlite3
108731  	var _pSchema *XSchema
108732  	var _k *XHashElem
108733  	var _1_pTab *XTable
108734  	_db = (*Xsqlite3)(_pParse.Xdb)
108735  	_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
108736  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
108737  	_iStatCur = _pParse.XnTab
108738  	_pParse.XnTab += int32(3)
108739  	_openStatTable(tls, _pParse, _iDb, _iStatCur, nil, nil)
108740  	_iMem = _pParse.XnMem + int32(1)
108741  	_iTab = _pParse.XnTab
108742  	func() {
108743  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
108744  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98243), unsafe.Pointer(&_analyzeDatabaseØ00__func__Ø000), unsafe.Pointer(str(51126)))
108745  			crt.X__builtin_abort(tls)
108746  		}
108747  	}()
108748  	_k = (*XHashElem)(_pSchema.XtblHash.Xfirst)
108749  _2:
108750  	if _k == nil {
108751  		goto _5
108752  	}
108753  	_1_pTab = (*XTable)(_k.Xdata)
108754  	_analyzeOneTable(tls, _pParse, _1_pTab, nil, _iStatCur, _iMem, _iTab)
108755  	_k = (*XHashElem)(_k.Xnext)
108756  	goto _2
108757  _5:
108758  	_loadAnalysis(tls, _pParse, _iDb)
108759  }
108760  
108761  // C comment
108762  //  /*
108763  //  ** This routine generates code that opens the sqlite_statN tables.
108764  //  ** The sqlite_stat1 table is always relevant.  sqlite_stat2 is now
108765  //  ** obsolete.  sqlite_stat3 and sqlite_stat4 are only opened when
108766  //  ** appropriate compile-time options are provided.
108767  //  **
108768  //  ** If the sqlite_statN tables do not previously exist, it is created.
108769  //  **
108770  //  ** Argument zWhere may be a pointer to a buffer containing a table name,
108771  //  ** or it may be a NULL pointer. If it is not NULL, then all entries in
108772  //  ** the sqlite_statN tables associated with the named table are deleted.
108773  //  ** If zWhere==0, then code is generated to delete all stat table entries.
108774  //  */
108775  func _openStatTable(tls *crt.TLS, _pParse *XParse, _iDb int32, _iStatCur int32, _zWhere *int8, _zWhereType *int8) {
108776  	var _i int32
108777  	var _1_zTab *int8
108778  	var _aRoot [3]int32
108779  	var _db *Xsqlite3
108780  	var _pDb *XDb
108781  	var _1_pStat *XTable
108782  	var _v *TVdbe
108783  	var _aCreateTbl [3]uint8
108784  	_db = (*Xsqlite3)(_pParse.Xdb)
108785  	_v = _sqlite3GetVdbe(tls, _pParse)
108786  	if _v == nil {
108787  		return
108788  	}
108789  	func() {
108790  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
108791  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97123), unsafe.Pointer(&_openStatTableØ00__func__Ø000), unsafe.Pointer(str(9376)))
108792  			crt.X__builtin_abort(tls)
108793  		}
108794  	}()
108795  	func() {
108796  		if _sqlite3VdbeDb(tls, _v) != _db {
108797  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97124), unsafe.Pointer(&_openStatTableØ00__func__Ø000), unsafe.Pointer(str(124931)))
108798  			crt.X__builtin_abort(tls)
108799  		}
108800  	}()
108801  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
108802  	_i = int32(0)
108803  _5:
108804  	if _i >= int32(3) {
108805  		goto _8
108806  	}
108807  	_1_zTab = elem128((*t129)(unsafe.Pointer(&_openStatTableØ00aTableØ001)), uintptr(_i)).XzName
108808  	if store74(&_1_pStat, _sqlite3FindTable(tls, _db, _1_zTab, _pDb.XzDbSName)) != nil {
108809  		goto _9
108810  	}
108811  	if (elem128((*t129)(unsafe.Pointer(&_openStatTableØ00aTableØ001)), uintptr(_i)).XzCols) != nil {
108812  		_sqlite3NestedParse(tls, _pParse, str(124952), unsafe.Pointer(_pDb.XzDbSName), unsafe.Pointer(_1_zTab), unsafe.Pointer(elem128((*t129)(unsafe.Pointer(&_openStatTableØ00aTableØ001)), uintptr(_i)).XzCols))
108813  		*elem8((*int32)(unsafe.Pointer(&_aRoot)), uintptr(_i)) = _pParse.XregRoot
108814  		*elem15((*uint8)(unsafe.Pointer(&_aCreateTbl)), uintptr(_i)) = uint8(16)
108815  	}
108816  	goto _11
108817  _9:
108818  	*elem8((*int32)(unsafe.Pointer(&_aRoot)), uintptr(_i)) = _1_pStat.Xtnum
108819  	*elem15((*uint8)(unsafe.Pointer(&_aCreateTbl)), uintptr(_i)) = 0
108820  	_sqlite3TableLock(tls, _pParse, _iDb, *elem8((*int32)(unsafe.Pointer(&_aRoot)), uintptr(_i)), uint8(1), _1_zTab)
108821  	if _zWhere != nil {
108822  		_sqlite3NestedParse(tls, _pParse, str(115004), unsafe.Pointer(_pDb.XzDbSName), unsafe.Pointer(_1_zTab), unsafe.Pointer(_zWhereType), unsafe.Pointer(_zWhere))
108823  		goto _13
108824  	}
108825  	_sqlite3VdbeAddOp2(tls, _v, int32(134), *elem8((*int32)(unsafe.Pointer(&_aRoot)), uintptr(_i)), _iDb)
108826  _13:
108827  _11:
108828  	_i += 1
108829  	goto _5
108830  _8:
108831  	_i = int32(0)
108832  _14:
108833  	if (elem128((*t129)(unsafe.Pointer(&_openStatTableØ00aTableØ001)), uintptr(_i)).XzCols) == nil {
108834  		goto _17
108835  	}
108836  	func() {
108837  		if _i >= int32(3) {
108838  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97166), unsafe.Pointer(&_openStatTableØ00__func__Ø000), unsafe.Pointer(str(124975)))
108839  			crt.X__builtin_abort(tls)
108840  		}
108841  	}()
108842  	_sqlite3VdbeAddOp4Int(tls, _v, int32(107), _iStatCur+_i, *elem8((*int32)(unsafe.Pointer(&_aRoot)), uintptr(_i)), _iDb, int32(3))
108843  	_sqlite3VdbeChangeP5(tls, _v, uint16(*elem15((*uint8)(unsafe.Pointer(&_aCreateTbl)), uintptr(_i))))
108844  	_sqlite3VdbeComment(tls, _v, elem128((*t129)(unsafe.Pointer(&_openStatTableØ00aTableØ001)), uintptr(_i)).XzName)
108845  	_i += 1
108846  	goto _14
108847  _17:
108848  	_ = _aRoot
108849  	_ = _aCreateTbl
108850  }
108851  
108852  var _openStatTableØ00__func__Ø000 [14]int8
108853  
108854  func init() {
108855  	crt.Xstrncpy(nil, &_openStatTableØ00__func__Ø000[0], str(124995), 14)
108856  }
108857  
108858  var _openStatTableØ00aTableØ001 [3]t129
108859  
108860  func init() {
108861  	_openStatTableØ00aTableØ001 = [3]t129{t129{XzName: str(86613), XzCols: str(125009)}, t129{XzName: str(125022)}, t129{XzName: str(125035)}}
108862  }
108863  
108864  var _analyzeDatabaseØ00__func__Ø000 [16]int8
108865  
108866  func init() {
108867  	crt.Xstrncpy(nil, &_analyzeDatabaseØ00__func__Ø000[0], str(125048), 16)
108868  }
108869  
108870  // C comment
108871  //  /*
108872  //  ** Generate code to do an analysis of all indices associated with
108873  //  ** a single table.
108874  //  */
108875  func _analyzeOneTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *XIndex, _iStatCur int32, _iMem int32, _iTab int32) {
108876  	var _iIdxCur, _iTabCur, _i, _jZeroRows, _iDb, _regNewRowid, _regStat4, _regChng, _regTemp, _regTabname, _regIdxname, _regStat1, _regPrev, _5_nCol, _5_addrRewind, _5_addrNextRow, _5_nColTest, _8_endDistinctTest int32
108877  	var _8_aGotoChng *int32
108878  	var _5_zIdxName, _10_pColl *int8
108879  	var _needTableCnt uint8
108880  	var _db *Xsqlite3
108881  	var _v *TVdbe
108882  	var _pIdx *XIndex
108883  	_db = (*Xsqlite3)(_pParse.Xdb)
108884  	_jZeroRows = int32(-1)
108885  	_needTableCnt = uint8(1)
108886  	_regNewRowid = postInc2(&_iMem, 1)
108887  	_regStat4 = postInc2(&_iMem, 1)
108888  	_regChng = postInc2(&_iMem, 1)
108889  	_regTemp = postInc2(&_iMem, 1)
108890  	_regTabname = postInc2(&_iMem, 1)
108891  	_regIdxname = postInc2(&_iMem, 1)
108892  	_regStat1 = postInc2(&_iMem, 1)
108893  	_regPrev = _iMem
108894  	_pParse.XnMem = func() int32 {
108895  		if _pParse.XnMem > _iMem {
108896  			return _pParse.XnMem
108897  		}
108898  		return _iMem
108899  	}()
108900  	_v = _sqlite3GetVdbe(tls, _pParse)
108901  	if (_v == nil) || func() int32 {
108902  		if _pTab == nil {
108903  			return func() int32 {
108904  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97924), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(4809)))
108905  				crt.X__builtin_abort(tls)
108906  				return int32(1)
108907  			}()
108908  		}
108909  		return int32(0)
108910  	}() != 0 {
108911  		return
108912  	}
108913  	if _pTab.Xtnum == int32(0) {
108914  		return
108915  	}
108916  	if Xsqlite3_strlike(tls, str(125064), _pTab.XzName, 0) == int32(0) {
108917  		return
108918  	}
108919  	func() {
108920  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
108921  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97935), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(9376)))
108922  			crt.X__builtin_abort(tls)
108923  		}
108924  	}()
108925  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
108926  	func() {
108927  		if _iDb < int32(0) {
108928  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97937), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(41995)))
108929  			crt.X__builtin_abort(tls)
108930  		}
108931  	}()
108932  	func() {
108933  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
108934  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97938), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(51126)))
108935  			crt.X__builtin_abort(tls)
108936  		}
108937  	}()
108938  	if _sqlite3AuthCheck(tls, _pParse, int32(28), _pTab.XzName, nil, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName) != 0 {
108939  		return
108940  	}
108941  	_sqlite3TableLock(tls, _pParse, _iDb, _pTab.Xtnum, 0, _pTab.XzName)
108942  	_iTabCur = postInc2(&_iTab, 1)
108943  	_iIdxCur = postInc2(&_iTab, 1)
108944  	_pParse.XnTab = func() int32 {
108945  		if _pParse.XnTab > _iTab {
108946  			return _pParse.XnTab
108947  		}
108948  		return _iTab
108949  	}()
108950  	_sqlite3OpenTable(tls, _pParse, _iTabCur, _iDb, _pTab, int32(106))
108951  	_sqlite3VdbeLoadString(tls, _v, _regTabname, _pTab.XzName)
108952  	_pIdx = (*XIndex)(_pTab.XpIndex)
108953  _17:
108954  	if _pIdx == nil {
108955  		goto _20
108956  	}
108957  	if (_pOnlyIdx != nil) && (_pOnlyIdx != _pIdx) {
108958  		goto _18
108959  	}
108960  	if (*XExpr)(_pIdx.XpPartIdxWhere) == nil {
108961  		_needTableCnt = 0
108962  	}
108963  	if ((_pTab.XtabFlags & uint32(32)) != (0)) && (int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2)) {
108964  		_5_nCol = int32(_pIdx.XnKeyCol)
108965  		_5_zIdxName = _pTab.XzName
108966  		_5_nColTest = _5_nCol - int32(1)
108967  		goto _26
108968  	}
108969  	_5_nCol = int32(_pIdx.XnColumn)
108970  	_5_zIdxName = _pIdx.XzName
108971  	_5_nColTest = func() int32 {
108972  		if ((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0 {
108973  			return (int32(_pIdx.XnKeyCol) - int32(1))
108974  		}
108975  		return (_5_nCol - int32(1))
108976  	}()
108977  _26:
108978  	_sqlite3VdbeLoadString(tls, _v, _regIdxname, _5_zIdxName)
108979  	_sqlite3VdbeComment(tls, _v, str(125073), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(_5_zIdxName))
108980  	_pParse.XnMem = func() int32 {
108981  		if _pParse.XnMem > (_regPrev + _5_nColTest) {
108982  			return _pParse.XnMem
108983  		}
108984  		return (_regPrev + _5_nColTest)
108985  	}()
108986  	func() {
108987  		if _iDb != _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pIdx.XpSchema)) {
108988  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98019), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(125092)))
108989  			crt.X__builtin_abort(tls)
108990  		}
108991  	}()
108992  	_sqlite3VdbeAddOp3(tls, _v, int32(106), _iIdxCur, _pIdx.Xtnum, _iDb)
108993  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
108994  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pIdx.XzName))
108995  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _5_nCol, _regStat4+int32(1))
108996  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(_pIdx.XnKeyCol), _regStat4+int32(2))
108997  	_sqlite3VdbeAddOp4(tls, _v, int32(69), int32(0), _regStat4+int32(1), _regStat4, (*int8)(unsafe.Pointer(&_statInitFuncdef)), int32(-4))
108998  	_sqlite3VdbeChangeP5(tls, _v, uint16(2))
108999  	_5_addrRewind = _sqlite3VdbeAddOp1(tls, _v, int32(37), _iIdxCur)
109000  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _regChng)
109001  	_5_addrNextRow = _sqlite3VdbeCurrentAddr(tls, _v)
109002  	if _5_nColTest <= int32(0) {
109003  		goto _33
109004  	}
109005  	_8_endDistinctTest = _sqlite3VdbeMakeLabel(tls, _v)
109006  	_8_aGotoChng = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(4)*uint64(_5_nColTest)))
109007  	if _8_aGotoChng == nil {
109008  		goto _18
109009  	}
109010  	_sqlite3VdbeAddOp0(tls, _v, int32(13))
109011  	_5_addrNextRow = _sqlite3VdbeCurrentAddr(tls, _v)
109012  	if ((_5_nColTest == int32(1)) && (int32(_pIdx.XnKeyCol) == int32(1))) && (int32(_pIdx.XonError) != int32(0)) {
109013  		_sqlite3VdbeAddOp2(tls, _v, int32(76), _regPrev, _8_endDistinctTest)
109014  	}
109015  	_i = int32(0)
109016  _38:
109017  	if _i >= _5_nColTest {
109018  		goto _41
109019  	}
109020  	_10_pColl = (*int8)(unsafe.Pointer(_sqlite3LocateCollSeq(tls, _pParse, *elem0(_pIdx.XazColl, uintptr(_i)))))
109021  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _i, _regChng)
109022  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _iIdxCur, _i, _regTemp)
109023  	*elem8(_8_aGotoChng, uintptr(_i)) = _sqlite3VdbeAddOp4(tls, _v, int32(77), _regTemp, int32(0), _regPrev+_i, _10_pColl, int32(-3))
109024  	_sqlite3VdbeChangeP5(tls, _v, uint16(128))
109025  	_i += 1
109026  	goto _38
109027  _41:
109028  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _5_nColTest, _regChng)
109029  	_sqlite3VdbeGoto(tls, _v, _8_endDistinctTest)
109030  	_sqlite3VdbeJumpHere(tls, _v, _5_addrNextRow-int32(1))
109031  	_i = int32(0)
109032  _42:
109033  	if _i >= _5_nColTest {
109034  		goto _45
109035  	}
109036  	_sqlite3VdbeJumpHere(tls, _v, *elem8(_8_aGotoChng, uintptr(_i)))
109037  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _iIdxCur, _i, _regPrev+_i)
109038  	_i += 1
109039  	goto _42
109040  _45:
109041  	_sqlite3VdbeResolveLabel(tls, _v, _8_endDistinctTest)
109042  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_8_aGotoChng))
109043  _33:
109044  	func() {
109045  		if _regChng != (_regStat4 + int32(1)) {
109046  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98135), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(125137)))
109047  			crt.X__builtin_abort(tls)
109048  		}
109049  	}()
109050  	_sqlite3VdbeAddOp4(tls, _v, int32(69), int32(1), _regStat4, _regTemp, (*int8)(unsafe.Pointer(&_statPushFuncdef)), int32(-4))
109051  	_sqlite3VdbeChangeP5(tls, _v, uint16(2))
109052  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _iIdxCur, _5_addrNextRow)
109053  	_callStatGet(tls, _v, _regStat4, int32(0), _regStat1)
109054  	func() {
109055  		if int32(*elem1(str(125159), 0)) != int32(66) {
109056  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98143), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(125163)))
109057  			crt.X__builtin_abort(tls)
109058  		}
109059  	}()
109060  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _regTabname, int32(3), _regTemp, str(125159), int32(0))
109061  	_sqlite3VdbeAddOp2(tls, _v, int32(117), _iStatCur, _regNewRowid)
109062  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _iStatCur, _regTemp, _regNewRowid)
109063  	_sqlite3VdbeChangeP5(tls, _v, uint16(8))
109064  	_sqlite3VdbeJumpHere(tls, _v, _5_addrRewind)
109065  _18:
109066  	_pIdx = (*XIndex)(_pIdx.XpNext)
109067  	goto _17
109068  _20:
109069  	if (_pOnlyIdx == nil) && (_needTableCnt != 0) {
109070  		_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pTab.XzName))
109071  		_sqlite3VdbeAddOp2(tls, _v, int32(102), _iTabCur, _regStat1)
109072  		_jZeroRows = _sqlite3VdbeAddOp1(tls, _v, int32(22), _regStat1)
109073  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regIdxname)
109074  		func() {
109075  			if int32(*elem1(str(125159), 0)) != int32(66) {
109076  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98205), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(125163)))
109077  				crt.X__builtin_abort(tls)
109078  			}
109079  		}()
109080  		_sqlite3VdbeAddOp4(tls, _v, int32(101), _regTabname, int32(3), _regTemp, str(125159), int32(0))
109081  		_sqlite3VdbeAddOp2(tls, _v, int32(117), _iStatCur, _regNewRowid)
109082  		_sqlite3VdbeAddOp3(tls, _v, int32(118), _iStatCur, _regTemp, _regNewRowid)
109083  		_sqlite3VdbeChangeP5(tls, _v, uint16(8))
109084  		_sqlite3VdbeJumpHere(tls, _v, _jZeroRows)
109085  	}
109086  }
109087  
109088  var _analyzeOneTableØ00__func__Ø000 [16]int8
109089  
109090  func init() {
109091  	crt.Xstrncpy(nil, &_analyzeOneTableØ00__func__Ø000[0], str(125189), 16)
109092  }
109093  
109094  var _statInitFuncdef XFuncDef
109095  
109096  func init() {
109097  	_statInitFuncdef = XFuncDef{XnArg: int8(2), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
109098  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
109099  	}{_statInit})), XzName: str(125205)}
109100  }
109101  
109102  // C comment
109103  //  /*
109104  //  ** Implementation of the stat_init(N,K,C) SQL function. The three parameters
109105  //  ** are:
109106  //  **     N:    The number of columns in the index including the rowid/pk (note 1)
109107  //  **     K:    The number of columns in the index excluding the rowid/pk.
109108  //  **     C:    The number of rows in the index (note 2)
109109  //  **
109110  //  ** Note 1:  In the special case of the covering index that implements a
109111  //  ** WITHOUT ROWID table, N is the number of PRIMARY KEY columns, not the
109112  //  ** total number of columns in the table.
109113  //  **
109114  //  ** Note 2:  C is only used for STAT3 and STAT4.
109115  //  **
109116  //  ** For indexes on ordinary rowid tables, N==K+1.  But for indexes on
109117  //  ** WITHOUT ROWID tables, N=K+P where P is the number of columns in the
109118  //  ** PRIMARY KEY of the table.  The covering index that implements the
109119  //  ** original WITHOUT ROWID table as N==K as a special case.
109120  //  **
109121  //  ** This routine allocates the Stat4Accum object in heap memory. The return
109122  //  ** value is a pointer to the Stat4Accum object.  The datatype of the
109123  //  ** return value is BLOB, but it is really just a pointer to the Stat4Accum
109124  //  ** object.
109125  //  */
109126  func _statInit(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
109127  	var _nCol, _nKeyCol, _nColUp, _n int32
109128  	var _db *Xsqlite3
109129  	var _p *XStat4Accum
109130  
109131  	_nCol = Xsqlite3_value_int(tls, *elem19(_argv, 0))
109132  	func() {
109133  		if _nCol <= int32(0) {
109134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97333), unsafe.Pointer(&_statInitØ00__func__Ø000), unsafe.Pointer(str(125215)))
109135  			crt.X__builtin_abort(tls)
109136  		}
109137  	}()
109138  	_nColUp = (_nCol + int32(1)) & int32(-2)
109139  	_nKeyCol = Xsqlite3_value_int(tls, *elem19(_argv, uintptr(1)))
109140  	func() {
109141  		if _nKeyCol > _nCol {
109142  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97336), unsafe.Pointer(&_statInitØ00__func__Ø000), unsafe.Pointer(str(125222)))
109143  			crt.X__builtin_abort(tls)
109144  		}
109145  	}()
109146  	func() {
109147  		if _nKeyCol <= int32(0) {
109148  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97337), unsafe.Pointer(&_statInitØ00__func__Ø000), unsafe.Pointer(str(107138)))
109149  			crt.X__builtin_abort(tls)
109150  		}
109151  	}()
109152  	_n = int32((uint64(88) + (uint64(4) * uint64(_nColUp))) + (uint64(4) * uint64(_nColUp)))
109153  	_db = Xsqlite3_context_db_handle(tls, _context)
109154  	_p = (*XStat4Accum)(_sqlite3DbMallocZero(tls, _db, uint64(_n)))
109155  	if _p == nil {
109156  		Xsqlite3_result_error_nomem(tls, _context)
109157  		return
109158  	}
109159  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
109160  	_p.XnRow = 0
109161  	_p.XnCol = _nCol
109162  	_p.XnKeyCol = _nKeyCol
109163  	_p.Xcurrent.XanDLt = (*uint32)(unsafe.Pointer(elem130(_p, uintptr(1))))
109164  	_p.Xcurrent.XanEq = elem31(_p.Xcurrent.XanDLt, uintptr(_nColUp))
109165  	Xsqlite3_result_blob(tls, _context, unsafe.Pointer(_p), int32(88), _stat4Destructor)
109166  }
109167  
109168  var _statInitØ00__func__Ø000 [9]int8
109169  
109170  func init() {
109171  	crt.Xstrncpy(nil, &_statInitØ00__func__Ø000[0], str(125236), 9)
109172  }
109173  
109174  // C comment
109175  //  /*
109176  //  ** CAPI3REF: Setting The Result Of An SQL Function
109177  //  ** METHOD: sqlite3_context
109178  //  **
109179  //  ** These routines are used by the xFunc or xFinal callbacks that
109180  //  ** implement SQL functions and aggregates.  See
109181  //  ** [sqlite3_create_function()] and [sqlite3_create_function16()]
109182  //  ** for additional information.
109183  //  **
109184  //  ** These functions work very much like the [parameter binding] family of
109185  //  ** functions used to bind values to host parameters in prepared statements.
109186  //  ** Refer to the [SQL parameter] documentation for additional information.
109187  //  **
109188  //  ** ^The sqlite3_result_blob() interface sets the result from
109189  //  ** an application-defined function to be the BLOB whose content is pointed
109190  //  ** to by the second parameter and which is N bytes long where N is the
109191  //  ** third parameter.
109192  //  **
109193  //  ** ^The sqlite3_result_zeroblob(C,N) and sqlite3_result_zeroblob64(C,N)
109194  //  ** interfaces set the result of the application-defined function to be
109195  //  ** a BLOB containing all zero bytes and N bytes in size.
109196  //  **
109197  //  ** ^The sqlite3_result_double() interface sets the result from
109198  //  ** an application-defined function to be a floating point value specified
109199  //  ** by its 2nd argument.
109200  //  **
109201  //  ** ^The sqlite3_result_error() and sqlite3_result_error16() functions
109202  //  ** cause the implemented SQL function to throw an exception.
109203  //  ** ^SQLite uses the string pointed to by the
109204  //  ** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16()
109205  //  ** as the text of an error message.  ^SQLite interprets the error
109206  //  ** message string from sqlite3_result_error() as UTF-8. ^SQLite
109207  //  ** interprets the string from sqlite3_result_error16() as UTF-16 in native
109208  //  ** byte order.  ^If the third parameter to sqlite3_result_error()
109209  //  ** or sqlite3_result_error16() is negative then SQLite takes as the error
109210  //  ** message all text up through the first zero character.
109211  //  ** ^If the third parameter to sqlite3_result_error() or
109212  //  ** sqlite3_result_error16() is non-negative then SQLite takes that many
109213  //  ** bytes (not characters) from the 2nd parameter as the error message.
109214  //  ** ^The sqlite3_result_error() and sqlite3_result_error16()
109215  //  ** routines make a private copy of the error message text before
109216  //  ** they return.  Hence, the calling function can deallocate or
109217  //  ** modify the text after they return without harm.
109218  //  ** ^The sqlite3_result_error_code() function changes the error code
109219  //  ** returned by SQLite as a result of an error in a function.  ^By default,
109220  //  ** the error code is SQLITE_ERROR.  ^A subsequent call to sqlite3_result_error()
109221  //  ** or sqlite3_result_error16() resets the error code to SQLITE_ERROR.
109222  //  **
109223  //  ** ^The sqlite3_result_error_toobig() interface causes SQLite to throw an
109224  //  ** error indicating that a string or BLOB is too long to represent.
109225  //  **
109226  //  ** ^The sqlite3_result_error_nomem() interface causes SQLite to throw an
109227  //  ** error indicating that a memory allocation failed.
109228  //  **
109229  //  ** ^The sqlite3_result_int() interface sets the return value
109230  //  ** of the application-defined function to be the 32-bit signed integer
109231  //  ** value given in the 2nd argument.
109232  //  ** ^The sqlite3_result_int64() interface sets the return value
109233  //  ** of the application-defined function to be the 64-bit signed integer
109234  //  ** value given in the 2nd argument.
109235  //  **
109236  //  ** ^The sqlite3_result_null() interface sets the return value
109237  //  ** of the application-defined function to be NULL.
109238  //  **
109239  //  ** ^The sqlite3_result_text(), sqlite3_result_text16(),
109240  //  ** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces
109241  //  ** set the return value of the application-defined function to be
109242  //  ** a text string which is represented as UTF-8, UTF-16 native byte order,
109243  //  ** UTF-16 little endian, or UTF-16 big endian, respectively.
109244  //  ** ^The sqlite3_result_text64() interface sets the return value of an
109245  //  ** application-defined function to be a text string in an encoding
109246  //  ** specified by the fifth (and last) parameter, which must be one
109247  //  ** of [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE].
109248  //  ** ^SQLite takes the text result from the application from
109249  //  ** the 2nd parameter of the sqlite3_result_text* interfaces.
109250  //  ** ^If the 3rd parameter to the sqlite3_result_text* interfaces
109251  //  ** is negative, then SQLite takes result text from the 2nd parameter
109252  //  ** through the first zero character.
109253  //  ** ^If the 3rd parameter to the sqlite3_result_text* interfaces
109254  //  ** is non-negative, then as many bytes (not characters) of the text
109255  //  ** pointed to by the 2nd parameter are taken as the application-defined
109256  //  ** function result.  If the 3rd parameter is non-negative, then it
109257  //  ** must be the byte offset into the string where the NUL terminator would
109258  //  ** appear if the string where NUL terminated.  If any NUL characters occur
109259  //  ** in the string at a byte offset that is less than the value of the 3rd
109260  //  ** parameter, then the resulting string will contain embedded NULs and the
109261  //  ** result of expressions operating on strings with embedded NULs is undefined.
109262  //  ** ^If the 4th parameter to the sqlite3_result_text* interfaces
109263  //  ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that
109264  //  ** function as the destructor on the text or BLOB result when it has
109265  //  ** finished using that result.
109266  //  ** ^If the 4th parameter to the sqlite3_result_text* interfaces or to
109267  //  ** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite
109268  //  ** assumes that the text or BLOB result is in constant space and does not
109269  //  ** copy the content of the parameter nor call a destructor on the content
109270  //  ** when it has finished using that result.
109271  //  ** ^If the 4th parameter to the sqlite3_result_text* interfaces
109272  //  ** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT
109273  //  ** then SQLite makes a copy of the result into space obtained from
109274  //  ** from [sqlite3_malloc()] before it returns.
109275  //  **
109276  //  ** ^The sqlite3_result_value() interface sets the result of
109277  //  ** the application-defined function to be a copy of the
109278  //  ** [unprotected sqlite3_value] object specified by the 2nd parameter.  ^The
109279  //  ** sqlite3_result_value() interface makes a copy of the [sqlite3_value]
109280  //  ** so that the [sqlite3_value] specified in the parameter may change or
109281  //  ** be deallocated after sqlite3_result_value() returns without harm.
109282  //  ** ^A [protected sqlite3_value] object may always be used where an
109283  //  ** [unprotected sqlite3_value] object is required, so either
109284  //  ** kind of [sqlite3_value] object can be used with this interface.
109285  //  **
109286  //  ** If these routines are called from within the different thread
109287  //  ** than the one containing the application-defined function that received
109288  //  ** the [sqlite3_context] pointer, the results are undefined.
109289  //  */
109290  func Xsqlite3_result_blob(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
109291  	func() {
109292  		if _n < int32(0) {
109293  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76428), unsafe.Pointer(&_sqlite3_result_blobØ00__func__Ø000), unsafe.Pointer(str(125245)))
109294  			crt.X__builtin_abort(tls)
109295  		}
109296  	}()
109297  	func() {
109298  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
109299  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76429), unsafe.Pointer(&_sqlite3_result_blobØ00__func__Ø000), unsafe.Pointer(str(6567)))
109300  			crt.X__builtin_abort(tls)
109301  		}
109302  	}()
109303  	_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, 0, _xDel)
109304  }
109305  
109306  var _sqlite3_result_blobØ00__func__Ø000 [20]int8
109307  
109308  func init() {
109309  	crt.Xstrncpy(nil, &_sqlite3_result_blobØ00__func__Ø000[0], str(125250), 20)
109310  }
109311  
109312  // C comment
109313  //  /*
109314  //  ** Reclaim all memory of a Stat4Accum structure.
109315  //  */
109316  func _stat4Destructor(tls *crt.TLS, _pOld unsafe.Pointer) {
109317  	var _p *XStat4Accum
109318  	_p = (*XStat4Accum)(_pOld)
109319  	_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p))
109320  }
109321  
109322  var _statPushFuncdef XFuncDef
109323  
109324  func init() {
109325  	_statPushFuncdef = XFuncDef{XnArg: int8(2), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
109326  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
109327  	}{_statPush})), XzName: str(125270)}
109328  }
109329  
109330  // C comment
109331  //  /*
109332  //  ** Implementation of the stat_push SQL function:  stat_push(P,C,R)
109333  //  ** Arguments:
109334  //  **
109335  //  **    P     Pointer to the Stat4Accum object created by stat_init()
109336  //  **    C     Index of left-most column to differ from previous row
109337  //  **    R     Rowid for the current row.  Might be a key record for
109338  //  **          WITHOUT ROWID tables.
109339  //  **
109340  //  ** This SQL function always returns NULL.  It's purpose it to accumulate
109341  //  ** statistical data and/or samples in the Stat4Accum object about the
109342  //  ** index being analyzed.  The stat_get() SQL function will later be used to
109343  //  ** extract relevant information for constructing the sqlite_statN tables.
109344  //  **
109345  //  ** The R parameter is only used for STAT3 and STAT4
109346  //  */
109347  func _statPush(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
109348  	var _i, _iChng int32
109349  	var _p *XStat4Accum
109350  	_p = (*XStat4Accum)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
109351  	_iChng = Xsqlite3_value_int(tls, *elem19(_argv, uintptr(1)))
109352  
109353  	func() {
109354  		if _p.XnCol <= int32(0) {
109355  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97657), unsafe.Pointer(&_statPushØ00__func__Ø000), unsafe.Pointer(str(125280)))
109356  			crt.X__builtin_abort(tls)
109357  		}
109358  	}()
109359  	func() {
109360  		if _iChng >= _p.XnCol {
109361  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97658), unsafe.Pointer(&_statPushØ00__func__Ø000), unsafe.Pointer(str(125290)))
109362  			crt.X__builtin_abort(tls)
109363  		}
109364  	}()
109365  	if _p.XnRow != (0) {
109366  		goto _4
109367  	}
109368  	_i = int32(0)
109369  _5:
109370  	if _i >= _p.XnCol {
109371  		goto _8
109372  	}
109373  	*elem31(_p.Xcurrent.XanEq, uintptr(_i)) = uint32(1)
109374  	_i += 1
109375  	goto _5
109376  _8:
109377  	goto _9
109378  _4:
109379  	_samplePushPrevious(tls, _p, _iChng)
109380  	_i = int32(0)
109381  _10:
109382  	if _i >= _iChng {
109383  		goto _13
109384  	}
109385  	*elem31(_p.Xcurrent.XanEq, uintptr(_i)) += 1
109386  	_i += 1
109387  	goto _10
109388  _13:
109389  	_i = _iChng
109390  _14:
109391  	if _i >= _p.XnCol {
109392  		goto _17
109393  	}
109394  	*elem31(_p.Xcurrent.XanDLt, uintptr(_i)) += 1
109395  	*elem31(_p.Xcurrent.XanEq, uintptr(_i)) = uint32(1)
109396  	_i += 1
109397  	goto _14
109398  _17:
109399  _9:
109400  	_p.XnRow += 1
109401  }
109402  
109403  var _statPushØ00__func__Ø000 [9]int8
109404  
109405  func init() {
109406  	crt.Xstrncpy(nil, &_statPushØ00__func__Ø000[0], str(125304), 9)
109407  }
109408  
109409  // C comment
109410  //  /*
109411  //  ** Field iChng of the index being scanned has changed. So at this point
109412  //  ** p->current contains a sample that reflects the previous row of the
109413  //  ** index. The value of anEq[iChng] and subsequent anEq[] elements are
109414  //  ** correct at this point.
109415  //  */
109416  func _samplePushPrevious(tls *crt.TLS, _p *XStat4Accum, _iChng int32) {
109417  }
109418  
109419  func _callStatGet(tls *crt.TLS, _v *TVdbe, _regStat4 int32, _iParam int32, _regOut int32) {
109420  	func() {
109421  		if _regOut == _regStat4 || _regOut == (_regStat4+int32(1)) {
109422  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97876), unsafe.Pointer(&_callStatGetØ00__func__Ø000), unsafe.Pointer(str(125313)))
109423  			crt.X__builtin_abort(tls)
109424  		}
109425  	}()
109426  	func() {
109427  		if _iParam != int32(0) {
109428  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97880), unsafe.Pointer(&_callStatGetØ00__func__Ø000), unsafe.Pointer(str(125352)))
109429  			crt.X__builtin_abort(tls)
109430  		}
109431  	}()
109432  	_sqlite3VdbeAddOp4(tls, _v, int32(69), int32(0), _regStat4, _regOut, (*int8)(unsafe.Pointer(&_statGetFuncdef)), int32(-4))
109433  	_sqlite3VdbeChangeP5(tls, _v, uint16(1))
109434  }
109435  
109436  var _callStatGetØ00__func__Ø000 [12]int8
109437  
109438  func init() {
109439  	crt.Xstrncpy(nil, &_callStatGetØ00__func__Ø000[0], str(125375), 12)
109440  }
109441  
109442  var _statGetFuncdef XFuncDef
109443  
109444  func init() {
109445  	_statGetFuncdef = XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
109446  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
109447  	}{_statGet})), XzName: str(125387)}
109448  }
109449  
109450  // C comment
109451  //  /*
109452  //  ** Implementation of the stat_get(P,J) SQL function.  This routine is
109453  //  ** used to query statistical information that has been gathered into
109454  //  ** the Stat4Accum object by prior calls to stat_push().  The P parameter
109455  //  ** has type BLOB but it is really just a pointer to the Stat4Accum object.
109456  //  ** The content to returned is determined by the parameter J
109457  //  ** which is one of the STAT_GET_xxxx values defined above.
109458  //  **
109459  //  ** The stat_get(P,J) function is not available to generic SQL.  It is
109460  //  ** inserted as part of a manually constructed bytecode program.  (See
109461  //  ** the callStatGet() routine below.)  It is guaranteed that the P
109462  //  ** parameter will always be a poiner to a Stat4Accum object, never a
109463  //  ** NULL.
109464  //  **
109465  //  ** If neither STAT3 nor STAT4 are enabled, then J is always
109466  //  ** STAT_GET_STAT1 and is hence omitted and this routine becomes
109467  //  ** a one-parameter function, stat_get(P), that always returns the
109468  //  ** stat1 table entry information.
109469  //  */
109470  func _statGet(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
109471  	var _1_i int32
109472  	var _3_nDistinct, _3_iVal uint64
109473  	var _1_z, _1_zRet *int8
109474  	var _p *XStat4Accum
109475  	_p = (*XStat4Accum)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
109476  	func() {
109477  		if _argc != int32(1) {
109478  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97765), unsafe.Pointer(&_statGetØ00__func__Ø000), unsafe.Pointer(str(125396)))
109479  			crt.X__builtin_abort(tls)
109480  		}
109481  	}()
109482  	_1_zRet = (*int8)(_sqlite3MallocZero(tls, uint64((_p.XnKeyCol+int32(1))*int32(25))))
109483  	if _1_zRet == nil {
109484  		Xsqlite3_result_error_nomem(tls, _context)
109485  		return
109486  	}
109487  	Xsqlite3_snprintf(tls, int32(24), _1_zRet, str(125404), uint64(_p.XnRow))
109488  	_1_z = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_zRet)) + uintptr(_sqlite3Strlen30(tls, _1_zRet))))
109489  	_1_i = int32(0)
109490  _3:
109491  	if _1_i >= _p.XnKeyCol {
109492  		goto _6
109493  	}
109494  	_3_nDistinct = uint64((*elem31(_p.Xcurrent.XanDLt, uintptr(_1_i))) + uint32(1))
109495  	_3_iVal = ((uint64(_p.XnRow) + _3_nDistinct) - uint64(1)) / _3_nDistinct
109496  	Xsqlite3_snprintf(tls, int32(24), _1_z, str(125409), _3_iVal)
109497  	*(*uintptr)(unsafe.Pointer(&_1_z)) += uintptr(_sqlite3Strlen30(tls, _1_z))
109498  	func() {
109499  		if (*elem31(_p.Xcurrent.XanEq, uintptr(_1_i))) == 0 {
109500  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97805), unsafe.Pointer(&_statGetØ00__func__Ø000), unsafe.Pointer(str(125415)))
109501  			crt.X__builtin_abort(tls)
109502  		}
109503  	}()
109504  	_1_i += 1
109505  	goto _3
109506  _6:
109507  	func() {
109508  		if int32(*elem1(_1_z, 0)) != int32(0) || crt.P2U(unsafe.Pointer(_1_z)) <= crt.P2U(unsafe.Pointer(_1_zRet)) {
109509  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97807), unsafe.Pointer(&_statGetØ00__func__Ø000), unsafe.Pointer(str(125434)))
109510  			crt.X__builtin_abort(tls)
109511  		}
109512  	}()
109513  	Xsqlite3_result_text(tls, _context, _1_zRet, int32(-1), Xsqlite3_free)
109514  }
109515  
109516  var _statGetØ00__func__Ø000 [8]int8
109517  
109518  func init() {
109519  	crt.Xstrncpy(nil, &_statGetØ00__func__Ø000[0], str(125455), 8)
109520  }
109521  
109522  // C comment
109523  //  /*
109524  //  ** Generate code that will cause the most recent index analysis to
109525  //  ** be loaded into internal hash tables where is can be used.
109526  //  */
109527  func _loadAnalysis(tls *crt.TLS, _pParse *XParse, _iDb int32) {
109528  	var _v *TVdbe
109529  	_v = _sqlite3GetVdbe(tls, _pParse)
109530  	if _v != nil {
109531  		_sqlite3VdbeAddOp1(tls, _v, int32(140), _iDb)
109532  	}
109533  }
109534  
109535  // C comment
109536  //  /*
109537  //  ** Generate code that will do an analysis of a single table in
109538  //  ** a database.  If pOnlyIdx is not NULL then it is a single index
109539  //  ** in pTab that should be analyzed.
109540  //  */
109541  func _analyzeTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *XIndex) {
109542  	var _iDb, _iStatCur int32
109543  	func() {
109544  		if _pTab == nil {
109545  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98260), unsafe.Pointer(&_analyzeTableØ00__func__Ø000), unsafe.Pointer(str(43549)))
109546  			crt.X__builtin_abort(tls)
109547  		}
109548  	}()
109549  	func() {
109550  		if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.Xdb)) == 0 {
109551  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98261), unsafe.Pointer(&_analyzeTableØ00__func__Ø000), unsafe.Pointer(str(124853)))
109552  			crt.X__builtin_abort(tls)
109553  		}
109554  	}()
109555  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
109556  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
109557  	_iStatCur = _pParse.XnTab
109558  	_pParse.XnTab += int32(3)
109559  	if _pOnlyIdx != nil {
109560  		_openStatTable(tls, _pParse, _iDb, _iStatCur, _pOnlyIdx.XzName, str(93743))
109561  		goto _5
109562  	}
109563  	_openStatTable(tls, _pParse, _iDb, _iStatCur, _pTab.XzName, str(93739))
109564  _5:
109565  	_analyzeOneTable(tls, _pParse, _pTab, _pOnlyIdx, _iStatCur, _pParse.XnMem+int32(1), _pParse.XnTab)
109566  	_loadAnalysis(tls, _pParse, _iDb)
109567  }
109568  
109569  var _analyzeTableØ00__func__Ø000 [13]int8
109570  
109571  func init() {
109572  	crt.Xstrncpy(nil, &_analyzeTableØ00__func__Ø000[0], str(125463), 13)
109573  }
109574  
109575  // C comment
109576  //  /*
109577  //  ** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy"
109578  //  ** command.
109579  //  */
109580  func _sqlite3AlterRenameTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pName *XToken) {
109581  	var _iDb, _nTabName, _savedDbFlags, _10_i int32
109582  	var _zDb, _zName, _zTabName, _zWhere *int8
109583  	var _db *Xsqlite3
109584  	var _pTab, _16_pFrom *XTable
109585  	var _v *TVdbe
109586  	var _pVTab *XVTable
109587  	var _15_p *XFKey
109588  	_zName = nil
109589  	_db = (*Xsqlite3)(_pParse.Xdb)
109590  	_zWhere = nil
109591  	_pVTab = nil
109592  	_savedDbFlags = _db.Xflags
109593  	if func() int32 {
109594  		if _db.XmallocFailed != 0 {
109595  			return func() int32 {
109596  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96518), unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000), unsafe.Pointer(str(4809)))
109597  				crt.X__builtin_abort(tls)
109598  				return int32(1)
109599  			}()
109600  		}
109601  		return int32(0)
109602  	}() != 0 {
109603  		goto _exit_rename_table
109604  	}
109605  	func() {
109606  		if _pSrc.XnSrc != int32(1) {
109607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96519), unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000), unsafe.Pointer(str(125476)))
109608  			crt.X__builtin_abort(tls)
109609  		}
109610  	}()
109611  	func() {
109612  		if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.Xdb)) == 0 {
109613  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96520), unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000), unsafe.Pointer(str(124853)))
109614  			crt.X__builtin_abort(tls)
109615  		}
109616  	}()
109617  	_pTab = _sqlite3LocateTableItem(tls, _pParse, 0, elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0))
109618  	if _pTab == nil {
109619  		goto _exit_rename_table
109620  	}
109621  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
109622  	_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
109623  	_db.Xflags |= int32(2097152)
109624  	_zName = _sqlite3NameFromToken(tls, _db, _pName)
109625  	if _zName == nil {
109626  		goto _exit_rename_table
109627  	}
109628  	if (_sqlite3FindTable(tls, _db, _zName, _zDb) != nil) || (_sqlite3FindIndex(tls, _db, _zName, _zDb) != nil) {
109629  		_sqlite3ErrorMsg(tls, _pParse, str(125490), unsafe.Pointer(_zName))
109630  		goto _exit_rename_table
109631  	}
109632  	if int32(0) != _isSystemTable(tls, _pParse, _pTab.XzName) {
109633  		goto _exit_rename_table
109634  	}
109635  	if int32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) {
109636  		goto _exit_rename_table
109637  	}
109638  	if _pTab.XpSelect != nil {
109639  		_sqlite3ErrorMsg(tls, _pParse, str(125549), unsafe.Pointer(_pTab.XzName))
109640  		goto _exit_rename_table
109641  	}
109642  	if _sqlite3AuthCheck(tls, _pParse, int32(26), _zDb, _pTab.XzName, nil) != 0 {
109643  		goto _exit_rename_table
109644  	}
109645  	if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
109646  		goto _exit_rename_table
109647  	}
109648  	if _pTab.XnModuleArg == 0 {
109649  		goto _16
109650  	}
109651  	_pVTab = _sqlite3GetVTable(tls, _db, _pTab)
109652  	if func() func(*crt.TLS, *Xsqlite3_vtab, *int8) int32 {
109653  		v := (*Xsqlite3_module)((*Xsqlite3_vtab)(_pVTab.XpVtab).XpModule).XxRename
109654  		return *(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&v))
109655  	}() == nil {
109656  		_pVTab = nil
109657  	}
109658  _16:
109659  	_v = _sqlite3GetVdbe(tls, _pParse)
109660  	if _v == nil {
109661  		goto _exit_rename_table
109662  	}
109663  	_sqlite3BeginWriteOperation(tls, _pParse, bool2int(_pVTab != nil), _iDb)
109664  	_sqlite3ChangeCookie(tls, _pParse, _iDb)
109665  	if _pVTab != nil {
109666  		_10_i = preInc2(&_pParse.XnMem, 1)
109667  		_sqlite3VdbeLoadString(tls, _v, _10_i, _zName)
109668  		_sqlite3VdbeAddOp4(tls, _v, int32(160), _10_i, int32(0), int32(0), (*int8)(unsafe.Pointer(_pVTab)), int32(-8))
109669  		_sqlite3MayAbort(tls, _pParse)
109670  	}
109671  	_zTabName = _pTab.XzName
109672  	_nTabName = _sqlite3Utf8CharLen(tls, _zTabName, int32(-1))
109673  	if (_db.Xflags & int32(524288)) == 0 {
109674  		goto _20
109675  	}
109676  	if store1(&_zWhere, _whereForeignKeys(tls, _pParse, _pTab)) != nil {
109677  		_sqlite3NestedParse(tls, _pParse, str(125576), unsafe.Pointer(_zDb), unsafe.Pointer(str(49981)), unsafe.Pointer(_zTabName), unsafe.Pointer(_zName), unsafe.Pointer(_zWhere))
109678  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zWhere))
109679  	}
109680  _20:
109681  	_sqlite3NestedParse(tls, _pParse, str(125645), unsafe.Pointer(_zDb), unsafe.Pointer(str(49981)), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zName), _nTabName, unsafe.Pointer(_zTabName))
109682  	if _sqlite3FindTable(tls, _db, str(111523), _zDb) != nil {
109683  		_sqlite3NestedParse(tls, _pParse, str(126029), unsafe.Pointer(_zDb), unsafe.Pointer(_zName), unsafe.Pointer(_pTab.XzName))
109684  	}
109685  	if store1(&_zWhere, _whereTempTriggers(tls, _pParse, _pTab)) != nil {
109686  		_sqlite3NestedParse(tls, _pParse, str(126087), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zWhere))
109687  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zWhere))
109688  	}
109689  	if (_db.Xflags & int32(524288)) == 0 {
109690  		goto _24
109691  	}
109692  	_15_p = _sqlite3FkReferences(tls, _pTab)
109693  _25:
109694  	if _15_p == nil {
109695  		goto _28
109696  	}
109697  	_16_pFrom = (*XTable)(_15_p.XpFrom)
109698  	if _16_pFrom != _pTab {
109699  		_reloadTableSchema(tls, _pParse, (*XTable)(_15_p.XpFrom), _16_pFrom.XzName)
109700  	}
109701  	_15_p = (*XFKey)(_15_p.XpNextTo)
109702  	goto _25
109703  _28:
109704  _24:
109705  	_reloadTableSchema(tls, _pParse, _pTab, _zName)
109706  _exit_rename_table:
109707  	_sqlite3SrcListDelete(tls, _db, _pSrc)
109708  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
109709  	_db.Xflags = _savedDbFlags
109710  }
109711  
109712  var _sqlite3AlterRenameTableØ00__func__Ø000 [24]int8
109713  
109714  func init() {
109715  	crt.Xstrncpy(nil, &_sqlite3AlterRenameTableØ00__func__Ø000[0], str(126179), 24)
109716  }
109717  
109718  // C comment
109719  //  /*
109720  //  ** Parameter zName is the name of a table that is about to be altered
109721  //  ** (either with ALTER TABLE ... RENAME TO or ALTER TABLE ... ADD COLUMN).
109722  //  ** If the table is a system table, this function leaves an error message
109723  //  ** in pParse->zErr (system tables may not be altered) and returns non-zero.
109724  //  **
109725  //  ** Or, if zName is not a system table, zero is returned.
109726  //  */
109727  func _isSystemTable(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 int32) {
109728  	if (_sqlite3Strlen30(tls, _zName) > int32(6)) && (int32(0) == Xsqlite3_strnicmp(tls, _zName, str(111672), int32(7))) {
109729  		_sqlite3ErrorMsg(tls, _pParse, str(126203), unsafe.Pointer(_zName))
109730  		return int32(1)
109731  	}
109732  	return int32(0)
109733  }
109734  
109735  // C comment
109736  //  /*
109737  //  ** Generate the text of a WHERE expression which can be used to select all
109738  //  ** tables that have foreign key constraints that refer to table pTab (i.e.
109739  //  ** constraints for which pTab is the parent table) from the sqlite_master
109740  //  ** table.
109741  //  */
109742  func _whereForeignKeys(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *int8) {
109743  	var _zWhere *int8
109744  	var _p *XFKey
109745  	_zWhere = nil
109746  	_p = _sqlite3FkReferences(tls, _pTab)
109747  _0:
109748  	if _p == nil {
109749  		goto _3
109750  	}
109751  	_zWhere = _whereOrName(tls, (*Xsqlite3)(_pParse.Xdb), _zWhere, (*XTable)(_p.XpFrom).XzName)
109752  	_p = (*XFKey)(_p.XpNextTo)
109753  	goto _0
109754  _3:
109755  	return _zWhere
109756  }
109757  
109758  // C comment
109759  //  /*
109760  //  ** This function is used to create the text of expressions of the form:
109761  //  **
109762  //  **   name=<constant1> OR name=<constant2> OR ...
109763  //  **
109764  //  ** If argument zWhere is NULL, then a pointer string containing the text
109765  //  ** "name=<constant>" is returned, where <constant> is the quoted version
109766  //  ** of the string passed as argument zConstant. The returned buffer is
109767  //  ** allocated using sqlite3DbMalloc(). It is the responsibility of the
109768  //  ** caller to ensure that it is eventually freed.
109769  //  **
109770  //  ** If argument zWhere is not NULL, then the string returned is
109771  //  ** "<where> OR name=<constant>", where <where> is the contents of zWhere.
109772  //  ** In this case zWhere is passed to sqlite3DbFree() before returning.
109773  //  **
109774  //  */
109775  func _whereOrName(tls *crt.TLS, _db *Xsqlite3, _zWhere *int8, _zConstant *int8) (r0 *int8) {
109776  	var _zNew *int8
109777  	if _zWhere == nil {
109778  		_zNew = _sqlite3MPrintf(tls, _db, str(126231), unsafe.Pointer(_zConstant))
109779  		goto _1
109780  	}
109781  	_zNew = _sqlite3MPrintf(tls, _db, str(126239), unsafe.Pointer(_zWhere), unsafe.Pointer(_zConstant))
109782  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zWhere))
109783  _1:
109784  	return _zNew
109785  }
109786  
109787  // C comment
109788  //  /*
109789  //  ** Generate the text of a WHERE expression which can be used to select all
109790  //  ** temporary triggers on table pTab from the sqlite_temp_master table. If
109791  //  ** table pTab has no temporary triggers, or is itself stored in the
109792  //  ** temporary database, NULL is returned.
109793  //  */
109794  func _whereTempTriggers(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *int8) {
109795  	var _zWhere, _4_zNew *int8
109796  	var _1_db *Xsqlite3
109797  	var _pTempSchema *XSchema
109798  	var _pTrig *XTrigger
109799  	_zWhere = nil
109800  	_pTempSchema = (*XSchema)(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(1)).XpSchema)
109801  	if (*XSchema)(_pTab.XpSchema) == _pTempSchema {
109802  		goto _0
109803  	}
109804  	_1_db = (*Xsqlite3)(_pParse.Xdb)
109805  	_pTrig = _sqlite3TriggerList(tls, _pParse, _pTab)
109806  _1:
109807  	if _pTrig == nil {
109808  		goto _4
109809  	}
109810  	if (*XSchema)(_pTrig.XpSchema) == _pTempSchema {
109811  		_zWhere = _whereOrName(tls, _1_db, _zWhere, _pTrig.XzName)
109812  	}
109813  	_pTrig = (*XTrigger)(_pTrig.XpNext)
109814  	goto _1
109815  _4:
109816  _0:
109817  	if _zWhere != nil {
109818  		_4_zNew = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(126253), unsafe.Pointer(_zWhere))
109819  		_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_zWhere))
109820  		_zWhere = _4_zNew
109821  	}
109822  	return _zWhere
109823  }
109824  
109825  // C comment
109826  //  /*
109827  //  ** Generate code to drop and reload the internal representation of table
109828  //  ** pTab from the database, including triggers and temporary triggers.
109829  //  ** Argument zName is the name of the table in the database schema at
109830  //  ** the time the generated code is executed. This can be different from
109831  //  ** pTab->zName if this function is being called to code part of an
109832  //  ** "ALTER TABLE RENAME TO" statement.
109833  //  */
109834  func _reloadTableSchema(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _zName *int8) {
109835  	var _iDb, _1_iTrigDb int32
109836  	var _zWhere *int8
109837  	var _pTrig *XTrigger
109838  	var _v *TVdbe
109839  	_v = _sqlite3GetVdbe(tls, _pParse)
109840  	if func() int32 {
109841  		if _v == nil {
109842  			return func() int32 {
109843  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96446), unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000), unsafe.Pointer(str(4809)))
109844  				crt.X__builtin_abort(tls)
109845  				return int32(1)
109846  			}()
109847  		}
109848  		return int32(0)
109849  	}() != 0 {
109850  		return
109851  	}
109852  	func() {
109853  		if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.Xdb)) == 0 {
109854  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96447), unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000), unsafe.Pointer(str(124853)))
109855  			crt.X__builtin_abort(tls)
109856  		}
109857  	}()
109858  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
109859  	func() {
109860  		if _iDb < int32(0) {
109861  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96449), unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000), unsafe.Pointer(str(41995)))
109862  			crt.X__builtin_abort(tls)
109863  		}
109864  	}()
109865  	_pTrig = _sqlite3TriggerList(tls, _pParse, _pTab)
109866  _7:
109867  	if _pTrig == nil {
109868  		goto _10
109869  	}
109870  	_1_iTrigDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTrig.XpSchema))
109871  	func() {
109872  		if _1_iTrigDb != _iDb && _1_iTrigDb != int32(1) {
109873  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96455), unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000), unsafe.Pointer(str(126277)))
109874  			crt.X__builtin_abort(tls)
109875  		}
109876  	}()
109877  	_sqlite3VdbeAddOp4(tls, _v, int32(143), _1_iTrigDb, int32(0), int32(0), _pTrig.XzName, int32(0))
109878  	_pTrig = (*XTrigger)(_pTrig.XpNext)
109879  	goto _7
109880  _10:
109881  	_sqlite3VdbeAddOp4(tls, _v, int32(141), _iDb, int32(0), int32(0), _pTab.XzName, int32(0))
109882  	_zWhere = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(126304), unsafe.Pointer(_zName))
109883  	if _zWhere == nil {
109884  		return
109885  	}
109886  	_sqlite3VdbeAddParseSchemaOp(tls, _v, _iDb, _zWhere)
109887  	if store1(&_zWhere, _whereTempTriggers(tls, _pParse, _pTab)) != nil {
109888  		_sqlite3VdbeAddParseSchemaOp(tls, _v, int32(1), _zWhere)
109889  	}
109890  }
109891  
109892  var _reloadTableSchemaØ00__func__Ø000 [18]int8
109893  
109894  func init() {
109895  	crt.Xstrncpy(nil, &_reloadTableSchemaØ00__func__Ø000[0], str(126316), 18)
109896  }
109897  
109898  // C comment
109899  //  /*
109900  //  ** This function is called after an "ALTER TABLE ... ADD" statement
109901  //  ** has been parsed. Argument pColDef contains the text of the new
109902  //  ** column definition.
109903  //  **
109904  //  ** The Table structure pParse->pNewTable was extended to include
109905  //  ** the new column during parsing.
109906  //  */
109907  func _sqlite3AlterFinishAddColumn(tls *crt.TLS, _pParse *XParse, _pColDef *XToken) {
109908  	var _iDb, _r1, _7_rc, _10_savedDbFlags int32
109909  	var _zDb, _zTab, _zCol, _10_zEnd *int8
109910  	var _db *Xsqlite3
109911  	var _pNew, _pTab *XTable
109912  	var _v *TVdbe
109913  	var _7_pVal *XMem
109914  	var _pDflt *XExpr
109915  	var _pCol *XColumn
109916  	_v = (*TVdbe)(_pParse.XpVdbe)
109917  	_db = (*Xsqlite3)(_pParse.Xdb)
109918  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
109919  		return
109920  	}
109921  	func() {
109922  		if _v == nil {
109923  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96717), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(42019)))
109924  			crt.X__builtin_abort(tls)
109925  		}
109926  	}()
109927  	_pNew = (*XTable)(_pParse.XpNewTable)
109928  	func() {
109929  		if _pNew == nil {
109930  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96719), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(126334)))
109931  			crt.X__builtin_abort(tls)
109932  		}
109933  	}()
109934  	func() {
109935  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
109936  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96721), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(9376)))
109937  			crt.X__builtin_abort(tls)
109938  		}
109939  	}()
109940  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pNew.XpSchema))
109941  	_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
109942  	_zTab = elem1(_pNew.XzName, uintptr(16))
109943  	_pCol = elem43((*XColumn)(_pNew.XaCol), uintptr(int32(_pNew.XnCol)-int32(1)))
109944  	_pDflt = (*XExpr)(_pCol.XpDflt)
109945  	_pTab = _sqlite3FindTable(tls, _db, _zTab, _zDb)
109946  	func() {
109947  		if _pTab == nil {
109948  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96728), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(94269)))
109949  			crt.X__builtin_abort(tls)
109950  		}
109951  	}()
109952  	if _sqlite3AuthCheck(tls, _pParse, int32(26), _zDb, _pTab.XzName, nil) != 0 {
109953  		return
109954  	}
109955  	func() {
109956  		if _pDflt != nil && int32(_pDflt.Xop) != int32(162) {
109957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96741), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(126339)))
109958  			crt.X__builtin_abort(tls)
109959  		}
109960  	}()
109961  	if (_pDflt != nil) && (int32((*XExpr)(_pDflt.XpLeft).Xop) == int32(101)) {
109962  		_pDflt = nil
109963  	}
109964  	if (int32(_pCol.XcolFlags) & int32(1)) != 0 {
109965  		_sqlite3ErrorMsg(tls, _pParse, str(126370))
109966  		return
109967  	}
109968  	if _pNew.XpIndex != nil {
109969  		_sqlite3ErrorMsg(tls, _pParse, str(126402))
109970  		return
109971  	}
109972  	if ((_db.Xflags&int32(524288)) != 0 && (_pNew.XpFKey != nil)) && (_pDflt != nil) {
109973  		_sqlite3ErrorMsg(tls, _pParse, str(126429))
109974  		return
109975  	}
109976  	if (_pCol.XnotNull != 0) && (_pDflt == nil) {
109977  		_sqlite3ErrorMsg(tls, _pParse, str(126488))
109978  		return
109979  	}
109980  	if _pDflt == nil {
109981  		goto _23
109982  	}
109983  	_7_pVal = nil
109984  	_7_rc = _sqlite3ValueFromExpr(tls, _db, _pDflt, uint8(1), uint8(65), &_7_pVal)
109985  	func() {
109986  		if _7_rc != int32(0) && _7_rc != int32(7) {
109987  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96776), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(5706)))
109988  			crt.X__builtin_abort(tls)
109989  		}
109990  	}()
109991  	if _7_rc != int32(0) {
109992  		func() {
109993  			if int32(_db.XmallocFailed) != int32(1) {
109994  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96778), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(126541)))
109995  				crt.X__builtin_abort(tls)
109996  			}
109997  		}()
109998  		return
109999  	}
110000  	if _7_pVal == nil {
110001  		_sqlite3ErrorMsg(tls, _pParse, str(126563))
110002  		return
110003  	}
110004  	_sqlite3ValueFree(tls, _7_pVal)
110005  _23:
110006  	_zCol = _sqlite3DbStrNDup(tls, _db, _pColDef.Xz, uint64(_pColDef.Xn))
110007  	if _zCol == nil {
110008  		goto _31
110009  	}
110010  	_10_zEnd = elem1(_zCol, uintptr(_pColDef.Xn-uint32(1)))
110011  	_10_savedDbFlags = _db.Xflags
110012  _32:
110013  	if (crt.P2U(unsafe.Pointer(_10_zEnd)) > crt.P2U(unsafe.Pointer(_zCol))) && ((int32(*_10_zEnd) == int32(59)) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_10_zEnd))))&int32(1)) != 0) {
110014  		*postInc1(&_10_zEnd, -1) = 0
110015  		goto _32
110016  	}
110017  	_db.Xflags |= int32(2097152)
110018  	_sqlite3NestedParse(tls, _pParse, str(126609), unsafe.Pointer(_zDb), unsafe.Pointer(str(49981)), _pNew.XaddColOffset, unsafe.Pointer(_zCol), _pNew.XaddColOffset+int32(1), unsafe.Pointer(_zTab))
110019  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zCol))
110020  	_db.Xflags = _10_savedDbFlags
110021  _31:
110022  	_r1 = _sqlite3GetTempReg(tls, _pParse)
110023  	_sqlite3VdbeAddOp3(tls, _v, int32(103), _iDb, _r1, int32(2))
110024  	_sqlite3VdbeUsesBtree(tls, _v, _iDb)
110025  	_sqlite3VdbeAddOp2(tls, _v, int32(73), _r1, int32(-2))
110026  	_sqlite3VdbeAddOp2(tls, _v, int32(46), _r1, _sqlite3VdbeCurrentAddr(tls, _v)+int32(2))
110027  	_sqlite3VdbeAddOp3(tls, _v, int32(104), _iDb, int32(2), int32(3))
110028  	_sqlite3ReleaseTempReg(tls, _pParse, _r1)
110029  	_reloadTableSchema(tls, _pParse, _pTab, _pTab.XzName)
110030  }
110031  
110032  var _sqlite3AlterFinishAddColumnØ00__func__Ø000 [28]int8
110033  
110034  func init() {
110035  	crt.Xstrncpy(nil, &_sqlite3AlterFinishAddColumnØ00__func__Ø000[0], str(126718), 28)
110036  }
110037  
110038  // C comment
110039  //  /*
110040  //  ** This function is called by the parser after the table-name in
110041  //  ** an "ALTER TABLE <table-name> ADD" statement is parsed. Argument
110042  //  ** pSrc is the full-name of the table being altered.
110043  //  **
110044  //  ** This routine makes a (partial) copy of the Table structure
110045  //  ** for the table being altered and sets Parse.pNewTable to point
110046  //  ** to it. Routines called by the parser as the column definition
110047  //  ** is parsed (i.e. sqlite3AddColumn()) add the new Column data to
110048  //  ** the copy. The copy of the Table structure is deleted by tokenize.c
110049  //  ** after parsing is finished.
110050  //  **
110051  //  ** Routine sqlite3AlterFinishAddColumn() will be called to complete
110052  //  ** coding the "ALTER TABLE ... ADD" statement.
110053  //  */
110054  func _sqlite3AlterBeginAddColumn(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) {
110055  	var _iDb, _i, _nAlloc int32
110056  	var _db *Xsqlite3
110057  	var _pNew, _pTab *XTable
110058  	var _v *TVdbe
110059  	var _5_pCol *XColumn
110060  	_db = (*Xsqlite3)(_pParse.Xdb)
110061  	func() {
110062  		if (*XTable)(_pParse.XpNewTable) != nil {
110063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96850), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(24589)))
110064  			crt.X__builtin_abort(tls)
110065  		}
110066  	}()
110067  	func() {
110068  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
110069  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96851), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(9376)))
110070  			crt.X__builtin_abort(tls)
110071  		}
110072  	}()
110073  	if _db.XmallocFailed != 0 {
110074  		goto _exit_begin_add_column
110075  	}
110076  	_pTab = _sqlite3LocateTableItem(tls, _pParse, 0, elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0))
110077  	if _pTab == nil {
110078  		goto _exit_begin_add_column
110079  	}
110080  	if _pTab.XnModuleArg != 0 {
110081  		_sqlite3ErrorMsg(tls, _pParse, str(126746))
110082  		goto _exit_begin_add_column
110083  	}
110084  	if _pTab.XpSelect != nil {
110085  		_sqlite3ErrorMsg(tls, _pParse, str(126780))
110086  		goto _exit_begin_add_column
110087  	}
110088  	if int32(0) != _isSystemTable(tls, _pParse, _pTab.XzName) {
110089  		goto _exit_begin_add_column
110090  	}
110091  	func() {
110092  		if _pTab.XaddColOffset <= int32(0) {
110093  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96872), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(126810)))
110094  			crt.X__builtin_abort(tls)
110095  		}
110096  	}()
110097  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
110098  	_pNew = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(128)))
110099  	if _pNew == nil {
110100  		goto _exit_begin_add_column
110101  	}
110102  	*(**XTable)(unsafe.Pointer(&_pParse.XpNewTable)) = _pNew
110103  	_pNew.XnTabRef = uint32(1)
110104  	_pNew.XnCol = _pTab.XnCol
110105  	func() {
110106  		if int32(_pNew.XnCol) <= int32(0) {
110107  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96887), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(126831)))
110108  			crt.X__builtin_abort(tls)
110109  		}
110110  	}()
110111  	_nAlloc = (((int32(_pNew.XnCol) - int32(1)) / int32(8)) * int32(8)) + int32(8)
110112  	func() {
110113  		if _nAlloc < int32(_pNew.XnCol) || (_nAlloc%int32(8)) != int32(0) || (_nAlloc-int32(_pNew.XnCol)) >= int32(8) {
110114  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96889), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(126844)))
110115  			crt.X__builtin_abort(tls)
110116  		}
110117  	}()
110118  	*(**XColumn)(unsafe.Pointer(&_pNew.XaCol)) = (*XColumn)(_sqlite3DbMallocZero(tls, _db, uint64(32)*uint64(_nAlloc)))
110119  	_pNew.XzName = _sqlite3MPrintf(tls, _db, str(126901), unsafe.Pointer(_pTab.XzName))
110120  	if (_pNew.XaCol == nil) || (_pNew.XzName == nil) {
110121  		func() {
110122  			if _db.XmallocFailed == 0 {
110123  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96893), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(47803)))
110124  				crt.X__builtin_abort(tls)
110125  			}
110126  		}()
110127  		goto _exit_begin_add_column
110128  	}
110129  	crt.Xmemcpy(tls, _pNew.XaCol, _pTab.XaCol, uint64(32)*uint64(_pNew.XnCol))
110130  	_i = int32(0)
110131  _22:
110132  	if _i >= int32(_pNew.XnCol) {
110133  		goto _25
110134  	}
110135  	_5_pCol = elem43((*XColumn)(_pNew.XaCol), uintptr(_i))
110136  	_5_pCol.XzName = _sqlite3DbStrDup(tls, _db, _5_pCol.XzName)
110137  	_5_pCol.XzColl = nil
110138  	*(**XExpr)(unsafe.Pointer(&_5_pCol.XpDflt)) = nil
110139  	_i += 1
110140  	goto _22
110141  _25:
110142  	*(**XSchema)(unsafe.Pointer(&_pNew.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
110143  	_pNew.XaddColOffset = _pTab.XaddColOffset
110144  	_pNew.XnTabRef = uint32(1)
110145  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
110146  	_v = _sqlite3GetVdbe(tls, _pParse)
110147  	if _v == nil {
110148  		goto _exit_begin_add_column
110149  	}
110150  	_sqlite3ChangeCookie(tls, _pParse, _iDb)
110151  _exit_begin_add_column:
110152  	_sqlite3SrcListDelete(tls, _db, _pSrc)
110153  }
110154  
110155  var _sqlite3AlterBeginAddColumnØ00__func__Ø000 [27]int8
110156  
110157  func init() {
110158  	crt.Xstrncpy(nil, &_sqlite3AlterBeginAddColumnØ00__func__Ø000[0], str(126920), 27)
110159  }
110160  
110161  // C comment
110162  //  /*
110163  //  ** The parser calls this routine after the CREATE VIRTUAL TABLE statement
110164  //  ** has been completely parsed.
110165  //  */
110166  func _sqlite3VtabFinishParse(tls *crt.TLS, _pParse *XParse, _pEnd *XToken) {
110167  	var _1_iDb, _1_iReg int32
110168  	var _1_zStmt, _1_zWhere, _3_zName *int8
110169  	var _db *Xsqlite3
110170  	var _3_pSchema *XSchema
110171  	var _pTab, _3_pOld *XTable
110172  	var _1_v *TVdbe
110173  	_pTab = (*XTable)(_pParse.XpNewTable)
110174  	_db = (*Xsqlite3)(_pParse.Xdb)
110175  	if _pTab == nil {
110176  		return
110177  	}
110178  	_addArgumentToVtab(tls, _pParse)
110179  	_pParse.XsArg.Xz = nil
110180  	if _pTab.XnModuleArg < int32(1) {
110181  		return
110182  	}
110183  	if (_db.Xinit.Xbusy) != 0 {
110184  		goto _2
110185  	}
110186  	if _pEnd != nil {
110187  		_pParse.XsNameToken.Xn = uint32(int32(int64(uintptr(unsafe.Pointer(_pEnd.Xz))-uintptr(unsafe.Pointer(_pParse.XsNameToken.Xz))))) + _pEnd.Xn
110188  	}
110189  	_1_zStmt = _sqlite3MPrintf(tls, _db, str(126947), unsafe.Pointer(&_pParse.XsNameToken))
110190  	_1_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
110191  	_sqlite3NestedParse(tls, _pParse, str(126971), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_1_iDb)).XzDbSName), unsafe.Pointer(str(49981)), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(_1_zStmt), _pParse.XregRowid)
110192  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_zStmt))
110193  	_1_v = _sqlite3GetVdbe(tls, _pParse)
110194  	_sqlite3ChangeCookie(tls, _pParse, _1_iDb)
110195  	_sqlite3VdbeAddOp0(tls, _1_v, int32(153))
110196  	_1_zWhere = _sqlite3MPrintf(tls, _db, str(127059), unsafe.Pointer(_pTab.XzName))
110197  	_sqlite3VdbeAddParseSchemaOp(tls, _1_v, _1_iDb, _1_zWhere)
110198  	_1_iReg = preInc2(&_pParse.XnMem, 1)
110199  	_sqlite3VdbeLoadString(tls, _1_v, _1_iReg, _pTab.XzName)
110200  	_sqlite3VdbeAddOp2(tls, _1_v, int32(156), _1_iDb, _1_iReg)
110201  	goto _4
110202  _2:
110203  	_3_pSchema = (*XSchema)(_pTab.XpSchema)
110204  	_3_zName = _pTab.XzName
110205  	func() {
110206  		if _sqlite3SchemaMutexHeld(tls, _db, int32(0), _3_pSchema) == 0 {
110207  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125440), unsafe.Pointer(&_sqlite3VtabFinishParseØ00__func__Ø000), unsafe.Pointer(str(127086)))
110208  			crt.X__builtin_abort(tls)
110209  		}
110210  	}()
110211  	_3_pOld = (*XTable)(_sqlite3HashInsert(tls, &_3_pSchema.XtblHash, _3_zName, unsafe.Pointer(_pTab)))
110212  	if _3_pOld != nil {
110213  		_sqlite3OomFault(tls, _db)
110214  		func() {
110215  			if _pTab != _3_pOld {
110216  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125444), unsafe.Pointer(&_sqlite3VtabFinishParseØ00__func__Ø000), unsafe.Pointer(str(127125)))
110217  				crt.X__builtin_abort(tls)
110218  			}
110219  		}()
110220  		return
110221  	}
110222  	*(**XTable)(unsafe.Pointer(&_pParse.XpNewTable)) = nil
110223  _4:
110224  }
110225  
110226  // C comment
110227  //  /*
110228  //  ** This routine takes the module argument that has been accumulating
110229  //  ** in pParse->zArg[] and appends it to the list of arguments on the
110230  //  ** virtual table currently under construction in pParse->pTable.
110231  //  */
110232  func _addArgumentToVtab(tls *crt.TLS, _pParse *XParse) {
110233  	var _1_n int32
110234  	var _1_z *int8
110235  	var _1_db *Xsqlite3
110236  	if ((_pParse.XsArg.Xz) != nil) && (_pParse.XpNewTable != nil) {
110237  		_1_z = _pParse.XsArg.Xz
110238  		_1_n = int32(_pParse.XsArg.Xn)
110239  		_1_db = (*Xsqlite3)(_pParse.Xdb)
110240  		_addModuleArgument(tls, _1_db, (*XTable)(_pParse.XpNewTable), _sqlite3DbStrNDup(tls, _1_db, _1_z, uint64(_1_n)))
110241  	}
110242  }
110243  
110244  var _sqlite3VtabFinishParseØ00__func__Ø000 [23]int8
110245  
110246  func init() {
110247  	crt.Xstrncpy(nil, &_sqlite3VtabFinishParseØ00__func__Ø000[0], str(127136), 23)
110248  }
110249  
110250  // C comment
110251  //  /*
110252  //  ** The parser calls this routine when it first sees a CREATE VIRTUAL TABLE
110253  //  ** statement.  The module name has been parsed, but the optional list
110254  //  ** of parameters that follow the module name are still pending.
110255  //  */
110256  func _sqlite3VtabBeginParse(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pModuleName *XToken, _ifNotExists int32) {
110257  	var _iDb int32
110258  	var _db *Xsqlite3
110259  	var _pTable *XTable
110260  	_sqlite3StartTable(tls, _pParse, _pName1, _pName2, int32(0), int32(0), int32(1), _ifNotExists)
110261  	_pTable = (*XTable)(_pParse.XpNewTable)
110262  	if _pTable == nil {
110263  		return
110264  	}
110265  	func() {
110266  		if nil != (*XIndex)(_pTable.XpIndex) {
110267  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125323), unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000), unsafe.Pointer(str(127159)))
110268  			crt.X__builtin_abort(tls)
110269  		}
110270  	}()
110271  	_db = (*Xsqlite3)(_pParse.Xdb)
110272  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTable.XpSchema))
110273  	func() {
110274  		if _iDb < int32(0) {
110275  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125327), unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000), unsafe.Pointer(str(41995)))
110276  			crt.X__builtin_abort(tls)
110277  		}
110278  	}()
110279  	func() {
110280  		if _pTable.XnModuleArg != int32(0) {
110281  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125329), unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000), unsafe.Pointer(str(127177)))
110282  			crt.X__builtin_abort(tls)
110283  		}
110284  	}()
110285  	_addModuleArgument(tls, _db, _pTable, _sqlite3NameFromToken(tls, _db, _pModuleName))
110286  	_addModuleArgument(tls, _db, _pTable, nil)
110287  	_addModuleArgument(tls, _db, _pTable, _sqlite3DbStrDup(tls, _db, _pTable.XzName))
110288  	func() {
110289  		if ((_pParse.XsNameToken.Xz) != _pName2.Xz || _pName2.Xz == nil) && ((_pParse.XsNameToken.Xz) != _pName1.Xz || _pName2.Xz != nil) {
110290  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125333), unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000), unsafe.Pointer(str(127199)))
110291  			crt.X__builtin_abort(tls)
110292  		}
110293  	}()
110294  	_pParse.XsNameToken.Xn = uint32(int32(int64(uintptr(unsafe.Pointer(elem1(_pModuleName.Xz, uintptr(_pModuleName.Xn)))) - uintptr(unsafe.Pointer(_pParse.XsNameToken.Xz)))))
110295  	if _pTable.XazModuleArg != nil {
110296  		_sqlite3AuthCheck(tls, _pParse, int32(29), _pTable.XzName, *elem0(_pTable.XazModuleArg, 0), elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_iDb)).XzDbSName)
110297  	}
110298  }
110299  
110300  var _sqlite3VtabBeginParseØ00__func__Ø000 [22]int8
110301  
110302  func init() {
110303  	crt.Xstrncpy(nil, &_sqlite3VtabBeginParseØ00__func__Ø000[0], str(127302), 22)
110304  }
110305  
110306  // C comment
110307  //  /*
110308  //  ** The parser calls this routine when it sees the first token
110309  //  ** of an argument to the module name in a CREATE VIRTUAL TABLE statement.
110310  //  */
110311  func _sqlite3VtabArgInit(tls *crt.TLS, _pParse *XParse) {
110312  	_addArgumentToVtab(tls, _pParse)
110313  	_pParse.XsArg.Xz = nil
110314  	_pParse.XsArg.Xn = 0
110315  }
110316  
110317  // C comment
110318  //  /*
110319  //  ** The parser calls this routine for each token after the first token
110320  //  ** in an argument to the module name in a CREATE VIRTUAL TABLE statement.
110321  //  */
110322  func _sqlite3VtabArgExtend(tls *crt.TLS, _pParse *XParse, _p *XToken) {
110323  	var _pArg *XToken
110324  	_pArg = &_pParse.XsArg
110325  	if _pArg.Xz == nil {
110326  		_pArg.Xz = _p.Xz
110327  		_pArg.Xn = _p.Xn
110328  		goto _1
110329  	}
110330  	func() {
110331  		if crt.P2U(unsafe.Pointer(_pArg.Xz)) > crt.P2U(unsafe.Pointer(_p.Xz)) {
110332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125471), unsafe.Pointer(&_sqlite3VtabArgExtendØ00__func__Ø000), unsafe.Pointer(str(127324)))
110333  			crt.X__builtin_abort(tls)
110334  		}
110335  	}()
110336  	_pArg.Xn = uint32(int32(int64(uintptr(unsafe.Pointer(elem1(_p.Xz, uintptr(_p.Xn)))) - uintptr(unsafe.Pointer(_pArg.Xz)))))
110337  _1:
110338  }
110339  
110340  var _sqlite3VtabArgExtendØ00__func__Ø000 [21]int8
110341  
110342  func init() {
110343  	crt.Xstrncpy(nil, &_sqlite3VtabArgExtendØ00__func__Ø000[0], str(127340), 21)
110344  }
110345  
110346  // C comment
110347  //  /*
110348  //  ** This routine is invoked once per CTE by the parser while parsing a
110349  //  ** WITH clause.
110350  //  */
110351  func _sqlite3WithAdd(tls *crt.TLS, _pParse *XParse, _pWith *XWith, _pName *XToken, _pArglist *XExprList, _pQuery *XSelect) (r0 *XWith) {
110352  	var _1_i, _4_nByte int32
110353  	var _zName *int8
110354  	var _db *Xsqlite3
110355  	var _pNew *XWith
110356  	_db = (*Xsqlite3)(_pParse.Xdb)
110357  	_zName = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.Xdb), _pName)
110358  	if _zName == nil || _pWith == nil {
110359  		goto _1
110360  	}
110361  	_1_i = int32(0)
110362  _2:
110363  	if _1_i >= _pWith.XnCte {
110364  		goto _5
110365  	}
110366  	if _sqlite3StrICmp(tls, _zName, elem45((*TCte)(unsafe.Pointer(&_pWith.Xa)), uintptr(_1_i)).XzName) == int32(0) {
110367  		_sqlite3ErrorMsg(tls, _pParse, str(127361), unsafe.Pointer(_zName))
110368  	}
110369  	_1_i += 1
110370  	goto _2
110371  _5:
110372  _1:
110373  	if _pWith != nil {
110374  		_4_nByte = int32(uint64(48) + (uint64(32) * uint64(_pWith.XnCte)))
110375  		_pNew = (*XWith)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pWith), uint64(_4_nByte)))
110376  		goto _8
110377  	}
110378  	_pNew = (*XWith)(_sqlite3DbMallocZero(tls, _db, uint64(48)))
110379  _8:
110380  	func() {
110381  		if (_pNew == nil || _zName == nil) && _db.XmallocFailed == 0 {
110382  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104109), unsafe.Pointer(&_sqlite3WithAddØ00__func__Ø000), unsafe.Pointer(str(127391)))
110383  			crt.X__builtin_abort(tls)
110384  		}
110385  	}()
110386  	if _db.XmallocFailed != 0 {
110387  		_sqlite3ExprListDelete(tls, _db, _pArglist)
110388  		_sqlite3SelectDelete(tls, _db, _pQuery)
110389  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
110390  		_pNew = _pWith
110391  		goto _14
110392  	}
110393  	*(**XSelect)(unsafe.Pointer(&(elem45((*TCte)(unsafe.Pointer(&_pNew.Xa)), uintptr(_pNew.XnCte)).XpSelect))) = _pQuery
110394  	*(**XExprList)(unsafe.Pointer(&(elem45((*TCte)(unsafe.Pointer(&_pNew.Xa)), uintptr(_pNew.XnCte)).XpCols))) = _pArglist
110395  	elem45((*TCte)(unsafe.Pointer(&_pNew.Xa)), uintptr(_pNew.XnCte)).XzName = _zName
110396  	elem45((*TCte)(unsafe.Pointer(&_pNew.Xa)), uintptr(_pNew.XnCte)).XzCteErr = nil
110397  	_pNew.XnCte += 1
110398  _14:
110399  	return _pNew
110400  }
110401  
110402  var _sqlite3WithAddØ00__func__Ø000 [15]int8
110403  
110404  func init() {
110405  	crt.Xstrncpy(nil, &_sqlite3WithAddØ00__func__Ø000[0], str(127433), 15)
110406  }
110407  
110408  // C comment
110409  //  /*
110410  //  ** Find the appropriate action for a parser given the non-terminal
110411  //  ** look-ahead token iLookAhead.
110412  //  */
110413  func _yy_find_reduce_action(tls *crt.TLS, _stateno int32, _iLookAhead uint8) (r0 int32) {
110414  	var _i int32
110415  	func() {
110416  		if _stateno > int32(324) {
110417  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137186), unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000), unsafe.Pointer(str(127448)))
110418  			crt.X__builtin_abort(tls)
110419  		}
110420  	}()
110421  	_i = int32(*elem52((*int16)(unsafe.Pointer(&_yy_reduce_ofst)), uintptr(_stateno)))
110422  	func() {
110423  		if _i == int32(-174) {
110424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137189), unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000), unsafe.Pointer(str(127473)))
110425  			crt.X__builtin_abort(tls)
110426  		}
110427  	}()
110428  	func() {
110429  		if int32(_iLookAhead) == int32(252) {
110430  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137190), unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000), unsafe.Pointer(str(26870)))
110431  			crt.X__builtin_abort(tls)
110432  		}
110433  	}()
110434  	_i += int32(_iLookAhead)
110435  	func() {
110436  		if _i < int32(0) || _i >= int32(1566) {
110437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137197), unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000), unsafe.Pointer(str(127495)))
110438  			crt.X__builtin_abort(tls)
110439  		}
110440  	}()
110441  	func() {
110442  		if int32(*elem15((*uint8)(unsafe.Pointer(&_yy_lookahead)), uintptr(_i))) != int32(_iLookAhead) {
110443  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(137198), unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000), unsafe.Pointer(str(127521)))
110444  			crt.X__builtin_abort(tls)
110445  		}
110446  	}()
110447  	return int32(*elem20((*uint16)(unsafe.Pointer(&_yy_action)), uintptr(_i)))
110448  }
110449  
110450  var _yy_find_reduce_actionØ00__func__Ø000 [22]int8
110451  
110452  func init() {
110453  	crt.Xstrncpy(nil, &_yy_find_reduce_actionØ00__func__Ø000[0], str(127549), 22)
110454  }
110455  
110456  var _yy_reduce_ofst [325]int16
110457  
110458  func init() {
110459  	_yy_reduce_ofst = [325]int16{int16(-119), int16(1014), int16(131), int16(1031), int16(-12), int16(225), int16(228), int16(300), int16(-40), int16(-45), int16(243), int16(256), int16(293), int16(129), int16(218), int16(418), int16(79), int16(376), int16(433), int16(298), int16(16), int16(137), int16(367), int16(323), int16(-38), int16(391), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(374), int16(437), int16(443), int16(508), int16(513), int16(522), int16(532), int16(582), int16(584), int16(620), int16(633), int16(635), int16(637), int16(644), int16(646), int16(648), int16(650), int16(652), int16(659), int16(661), int16(696), int16(709), int16(711), int16(714), int16(720), int16(722), int16(724), int16(726), int16(728), int16(733), int16(772), int16(784), int16(786), int16(822), int16(834), int16(836), int16(884), int16(886), int16(922), int16(934), int16(936), int16(986), int16(989), int16(1008), int16(1016), int16(1018), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(-173), int16(544), int16(-37), int16(274), int16(299), int16(501), int16(161), int16(-173), int16(193), int16(-173), int16(-173), int16(-173), int16(-173), int16(22), int16(22), int16(22), int16(64), int16(141), int16(212), int16(342), int16(208), int16(504), int16(504), int16(132), int16(494), int16(606), int16(677), int16(678), int16(750), int16(794), int16(796), int16(-58), int16(32), int16(383), int16(660), int16(737), int16(386), int16(787), int16(800), int16(441), int16(872), int16(224), int16(850), int16(803), int16(949), int16(624), int16(830), int16(669), int16(961), int16(979), int16(983), int16(1011), int16(1013), int16(1032), int16(753), int16(789), int16(321), int16(94), int16(116), int16(304), int16(375), int16(210), int16(388), int16(392), int16(478), int16(545), int16(649), int16(721), int16(727), int16(736), int16(752), int16(795), int16(853), int16(952), int16(958), int16(1004), int16(1040), int16(1046), int16(1049), int16(1050), int16(1056), int16(1059), int16(1067), int16(559), int16(774), int16(811), int16(1068), int16(1080), int16(938), int16(1082), int16(1083), int16(1088), int16(962), int16(1089), int16(1090), int16(1052), int16(1093), int16(1094), int16(1095), int16(388), int16(1096), int16(1103), int16(1104), int16(1105), int16(1106), int16(1107), int16(965), int16(998), int16(1055), int16(1057), int16(1058), int16(938), int16(1069), int16(1071), int16(1120), int16(1073), int16(1061), int16(1062), int16(1033), int16(1076), int16(1039), int16(1108), int16(1087), int16(1099), int16(1111), int16(1066), int16(1054), int16(1112), int16(1113), int16(1091), int16(1084), int16(1135), int16(1060), int16(1133), int16(1138), int16(1064), int16(1081), int16(1139), int16(1100), int16(1119), int16(1109), int16(1124), int16(1127), int16(1140), int16(1142), int16(1168), int16(1173), int16(1132), int16(1115), int16(1147), int16(1148), int16(1137), int16(1180), int16(1182), int16(1110), int16(1121), int16(1188), int16(1189), int16(1197), int16(1181), int16(1200), int16(1202), int16(1205), int16(1203), int16(1191), int16(1192), int16(1199), int16(1206), int16(1207), int16(1209), int16(1210), int16(1211), int16(1214), int16(1212), int16(1218), int16(1219), int16(1175), int16(1183), int16(1185), int16(1184), int16(1186), int16(1190), int16(1187), int16(1196), int16(1237), int16(1193), int16(1253), int16(1194), int16(1236), int16(1195), int16(1198), int16(1238), int16(1213), int16(1221), int16(1220), int16(1227), int16(1229), int16(1271), int16(1275), int16(1284), int16(1285), int16(1289), int16(1290), int16(1292), int16(1293), int16(1201), int16(1208), int16(1216), int16(1280), int16(1281), int16(1264), int16(1269), int16(1283)}
110460  }
110461  
110462  // C comment
110463  //  /*
110464  //  ** The following is executed when the parser accepts
110465  //  */
110466  func _yy_accept(tls *crt.TLS, _yypParser *XyyParser) {
110467  	var _pParse *XParse
110468  	_pParse = (*XParse)(_yypParser.XpParse)
110469  	if _yyTraceFILE != nil {
110470  		crt.Xfprintf(tls, _yyTraceFILE, str(127571), unsafe.Pointer(_yyTracePrompt))
110471  	}
110472  	func() {
110473  		if (*XyyStackEntry)(_yypParser.Xyytos) != (*XyyStackEntry)(unsafe.Pointer(&_yypParser.Xyystack)) {
110474  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138991), unsafe.Pointer(&_yy_acceptØ00__func__Ø000), unsafe.Pointer(str(127582)))
110475  			crt.X__builtin_abort(tls)
110476  		}
110477  	}()
110478  	*(**XParse)(unsafe.Pointer(&_yypParser.XpParse)) = _pParse
110479  }
110480  
110481  var _yy_acceptØ00__func__Ø000 [10]int8
110482  
110483  func init() {
110484  	crt.Xstrncpy(nil, &_yy_acceptØ00__func__Ø000[0], str(127619), 10)
110485  }
110486  
110487  // C comment
110488  //  /*
110489  //  ** The following code executes when a syntax error first occurs.
110490  //  */
110491  func _yy_syntax_error(tls *crt.TLS, _yypParser *XyyParser, _yymajor int32, _yyminor XToken) {
110492  	var _pParse *XParse
110493  	_pParse = (*XParse)(_yypParser.XpParse)
110494  
110495  	func() {
110496  		if (*elem1(_yyminor.Xz, 0)) == 0 {
110497  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(138970), unsafe.Pointer(&_yy_syntax_errorØ00__func__Ø000), unsafe.Pointer(str(127629)))
110498  			crt.X__builtin_abort(tls)
110499  		}
110500  	}()
110501  	_sqlite3ErrorMsg(tls, _pParse, str(27240), unsafe.Pointer(&_yyminor))
110502  	*(**XParse)(unsafe.Pointer(&_yypParser.XpParse)) = _pParse
110503  }
110504  
110505  var _yy_syntax_errorØ00__func__Ø000 [16]int8
110506  
110507  func init() {
110508  	crt.Xstrncpy(nil, &_yy_syntax_errorØ00__func__Ø000[0], str(127640), 16)
110509  }
110510  
110511  // C comment
110512  //  /*
110513  //  ** Clear all secondary memory allocations from the parser
110514  //  */
110515  func _sqlite3ParserFinalize(tls *crt.TLS, _p unsafe.Pointer) {
110516  	var _pParser *XyyParser
110517  	_pParser = (*XyyParser)(_p)
110518  _0:
110519  	if crt.P2U(_pParser.Xyytos) > crt.P2U(unsafe.Pointer(&_pParser.Xyystack)) {
110520  		_yy_pop_parser_stack(tls, _pParser)
110521  		goto _0
110522  	}
110523  }
110524  
110525  // C comment
110526  //  /*
110527  //  ** Enable or disable the shared pager and schema features.
110528  //  **
110529  //  ** This routine has no effect on existing database connections.
110530  //  ** The shared cache setting effects only future calls to
110531  //  ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
110532  //  */
110533  func Xsqlite3_enable_shared_cache(tls *crt.TLS, _enable int32) (r0 int32) {
110534  	_sqlite3Config.XsharedCacheEnabled = _enable
110535  	return int32(0)
110536  }
110537  
110538  // C comment
110539  //  /*
110540  //  ** Return the most recent error code generated by an SQLite routine. If NULL is
110541  //  ** passed to this function, we assume a malloc() failed during sqlite3_open().
110542  //  */
110543  func Xsqlite3_errcode(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
110544  	if (_db != nil) && (_sqlite3SafetyCheckSickOrOk(tls, _db) == 0) {
110545  		return _sqlite3MisuseError(tls, int32(142777))
110546  	}
110547  	if (_db == nil) || (_db.XmallocFailed != 0) {
110548  		return _sqlite3NomemError(tls, int32(142780))
110549  	}
110550  	return _db.XerrCode & _db.XerrMask
110551  }
110552  
110553  // C comment
110554  //  /*
110555  //  ** Return UTF-16 encoded English language explanation of the most recent
110556  //  ** error.
110557  //  */
110558  func Xsqlite3_errmsg16(tls *crt.TLS, _db *Xsqlite3) (r0 unsafe.Pointer) {
110559  	var _z unsafe.Pointer
110560  	if _db == nil {
110561  		return unsafe.Pointer(&_sqlite3_errmsg16Ø00outOfMemØ001)
110562  	}
110563  	if _sqlite3SafetyCheckSickOrOk(tls, _db) == 0 {
110564  		return unsafe.Pointer(&_sqlite3_errmsg16Ø00misuseØ002)
110565  	}
110566  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
110567  	if _db.XmallocFailed != 0 {
110568  		_z = unsafe.Pointer(&_sqlite3_errmsg16Ø00outOfMemØ001)
110569  		goto _3
110570  	}
110571  	_z = Xsqlite3_value_text16(tls, (*XMem)(_db.XpErr))
110572  	if _z == nil {
110573  		_sqlite3ErrorWithMsg(tls, _db, _db.XerrCode, _sqlite3ErrStr(tls, _db.XerrCode))
110574  		_z = Xsqlite3_value_text16(tls, (*XMem)(_db.XpErr))
110575  	}
110576  	_sqlite3OomClear(tls, _db)
110577  _3:
110578  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
110579  	return _z
110580  }
110581  
110582  var _sqlite3_errmsg16Ø00outOfMemØ001 [14]uint16
110583  
110584  func init() {
110585  	_sqlite3_errmsg16Ø00outOfMemØ001 = [14]uint16{uint16(111), uint16(117), uint16(116), uint16(32), uint16(111), uint16(102), uint16(32), uint16(109), uint16(101), uint16(109), uint16(111), uint16(114), uint16(121), uint16(0)}
110586  }
110587  
110588  var _sqlite3_errmsg16Ø00misuseØ002 [39]uint16
110589  
110590  func init() {
110591  	_sqlite3_errmsg16Ø00misuseØ002 = [39]uint16{uint16(108), uint16(105), uint16(98), uint16(114), uint16(97), uint16(114), uint16(121), uint16(32), uint16(114), uint16(111), uint16(117), uint16(116), uint16(105), uint16(110), uint16(101), uint16(32), uint16(99), uint16(97), uint16(108), uint16(108), uint16(101), uint16(100), uint16(32), uint16(111), uint16(117), uint16(116), uint16(32), uint16(111), uint16(102), uint16(32), uint16(115), uint16(101), uint16(113), uint16(117), uint16(101), uint16(110), uint16(99), uint16(101), uint16(0)}
110592  }
110593  
110594  // C comment
110595  //  /*
110596  //  ** Return TRUE (non-zero) of the statement supplied as an argument needs
110597  //  ** to be recompiled.  A statement needs to be recompiled whenever the
110598  //  ** execution environment changes in a way that would alter the program
110599  //  ** that sqlite3_prepare() generates.  For example, if new functions or
110600  //  ** collating sequences are registered or if an authorizer function is
110601  //  ** added or changed.
110602  //  */
110603  func Xsqlite3_expired(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
110604  	var _p *TVdbe
110605  	_p = (*TVdbe)(_pStmt)
110606  	return bool2int((_p == nil) || (((uint32(_p.Xexpired) << 31) >> 31) != 0))
110607  }
110608  
110609  // C comment
110610  //  /*
110611  //  ** This routine frees the space the sqlite3_get_table() malloced.
110612  //  */
110613  func Xsqlite3_free_table(tls *crt.TLS, _azResult **int8) {
110614  	var _1_i, _1_n int32
110615  	if _azResult == nil {
110616  		goto _0
110617  	}
110618  	*(*uintptr)(unsafe.Pointer(&_azResult)) += uintptr(18446744073709551608)
110619  	func() {
110620  		if _azResult == nil {
110621  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122634), unsafe.Pointer(&_sqlite3_free_tableØ00__func__Ø000), unsafe.Pointer(str(127656)))
110622  			crt.X__builtin_abort(tls)
110623  		}
110624  	}()
110625  	_1_n = int32(int64(crt.P2U(unsafe.Pointer(*elem0(_azResult, 0)))))
110626  	_1_i = int32(1)
110627  _3:
110628  	if _1_i >= _1_n {
110629  		goto _6
110630  	}
110631  	if (*elem0(_azResult, uintptr(_1_i))) != nil {
110632  		Xsqlite3_free(tls, unsafe.Pointer(*elem0(_azResult, uintptr(_1_i))))
110633  	}
110634  	_1_i += 1
110635  	goto _3
110636  _6:
110637  	Xsqlite3_free(tls, unsafe.Pointer(_azResult))
110638  _0:
110639  }
110640  
110641  var _sqlite3_free_tableØ00__func__Ø000 [19]int8
110642  
110643  func init() {
110644  	crt.Xstrncpy(nil, &_sqlite3_free_tableØ00__func__Ø000[0], str(127668), 19)
110645  }
110646  
110647  // C comment
110648  //  /*
110649  //  ** Test to see whether or not the database connection is in autocommit
110650  //  ** mode.  Return TRUE if it is and FALSE if not.  Autocommit mode is on
110651  //  ** by default.  Autocommit is disabled by a BEGIN statement and reenabled
110652  //  ** by the next COMMIT or ROLLBACK.
110653  //  */
110654  func Xsqlite3_get_autocommit(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
110655  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
110656  		_sqlite3MisuseError(tls, int32(143772))
110657  		return int32(0)
110658  	}
110659  	return int32(_db.XautoCommit)
110660  }
110661  
110662  // C comment
110663  //  /*
110664  //  ** Return the auxiliary data pointer, if any, for the iArg'th argument to
110665  //  ** the user-function defined by pCtx.
110666  //  **
110667  //  ** The left-most argument is 0.
110668  //  **
110669  //  ** Undocumented behavior:  If iArg is negative then access a cache of
110670  //  ** auxiliary data pointers that is available to all functions within a
110671  //  ** single prepared statement.  The iArg values must match.
110672  //  */
110673  func Xsqlite3_get_auxdata(tls *crt.TLS, _pCtx *Xsqlite3_context, _iArg int32) (r0 unsafe.Pointer) {
110674  	var _pAuxData *XAuxData
110675  	func() {
110676  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
110677  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76913), unsafe.Pointer(&_sqlite3_get_auxdataØ00__func__Ø000), unsafe.Pointer(str(6567)))
110678  			crt.X__builtin_abort(tls)
110679  		}
110680  	}()
110681  	func() {
110682  		if (*TVdbe)(_pCtx.XpVdbe) == nil {
110683  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76917), unsafe.Pointer(&_sqlite3_get_auxdataØ00__func__Ø000), unsafe.Pointer(str(127687)))
110684  			crt.X__builtin_abort(tls)
110685  		}
110686  	}()
110687  	_pAuxData = (*XAuxData)((*TVdbe)(_pCtx.XpVdbe).XpAuxData)
110688  _4:
110689  	if _pAuxData == nil {
110690  		goto _7
110691  	}
110692  	if (_pAuxData.XiAuxArg == _iArg) && ((_pAuxData.XiAuxOp == _pCtx.XiOp) || (_iArg < int32(0))) {
110693  		return _pAuxData.XpAux
110694  	}
110695  	_pAuxData = (*XAuxData)(_pAuxData.XpNextAux)
110696  	goto _4
110697  _7:
110698  	return nil
110699  }
110700  
110701  var _sqlite3_get_auxdataØ00__func__Ø000 [20]int8
110702  
110703  func init() {
110704  	crt.Xstrncpy(nil, &_sqlite3_get_auxdataØ00__func__Ø000[0], str(127702), 20)
110705  }
110706  
110707  // C comment
110708  //  /*
110709  //  ** Query the database.  But instead of invoking a callback for each row,
110710  //  ** malloc() for space to hold the result and return the entire results
110711  //  ** at the conclusion of the call.
110712  //  **
110713  //  ** The result that is written to ***pazResult is held in memory obtained
110714  //  ** from malloc().  But the caller cannot free this memory directly.
110715  //  ** Instead, the entire table should be passed to sqlite3_free_table() when
110716  //  ** the calling procedure is finished using it.
110717  //  */
110718  func Xsqlite3_get_table(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _pazResult ***int8, _pnRow *int32, _pnColumn *int32, _pzErrMsg **int8) (r0 int32) {
110719  	var _rc int32
110720  	var _6_azNew **int8
110721  	var _res XTabResult
110722  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_pazResult == nil) {
110723  		return _sqlite3MisuseError(tls, int32(122571))
110724  	}
110725  	*_pazResult = nil
110726  	if _pnColumn != nil {
110727  		*_pnColumn = int32(0)
110728  	}
110729  	if _pnRow != nil {
110730  		*_pnRow = int32(0)
110731  	}
110732  	if _pzErrMsg != nil {
110733  		*_pzErrMsg = nil
110734  	}
110735  	_res.XzErrMsg = nil
110736  	_res.XnRow = 0
110737  	_res.XnColumn = 0
110738  	_res.XnData = uint32(1)
110739  	_res.XnAlloc = uint32(20)
110740  	_res.Xrc = int32(0)
110741  	_res.XazResult = (**int8)(Xsqlite3_malloc64(tls, uint64(8)*uint64(_res.XnAlloc)))
110742  	if _res.XazResult == nil {
110743  		_db.XerrCode = int32(7)
110744  		return _sqlite3NomemError(tls, int32(122586))
110745  	}
110746  	*elem0(_res.XazResult, 0) = nil
110747  	_rc = Xsqlite3_exec(tls, _db, _zSql, _sqlite3_get_table_cb, unsafe.Pointer(&_res), _pzErrMsg)
110748  
110749  	*elem0(_res.XazResult, 0) = (*int8)(crt.U2P(uintptr(int64(_res.XnData))))
110750  	if (_rc & int32(255)) != int32(4) {
110751  		goto _6
110752  	}
110753  	Xsqlite3_free_table(tls, elem0(_res.XazResult, uintptr(1)))
110754  	if _res.XzErrMsg == nil {
110755  		goto _7
110756  	}
110757  	if _pzErrMsg != nil {
110758  		Xsqlite3_free(tls, unsafe.Pointer(*_pzErrMsg))
110759  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(_res.XzErrMsg))
110760  	}
110761  	Xsqlite3_free(tls, unsafe.Pointer(_res.XzErrMsg))
110762  _7:
110763  	_db.XerrCode = _res.Xrc
110764  	return _res.Xrc
110765  
110766  _6:
110767  	Xsqlite3_free(tls, unsafe.Pointer(_res.XzErrMsg))
110768  	if _rc != int32(0) {
110769  		Xsqlite3_free_table(tls, elem0(_res.XazResult, uintptr(1)))
110770  		return _rc
110771  	}
110772  	if _res.XnAlloc <= _res.XnData {
110773  		goto _10
110774  	}
110775  	_6_azNew = (**int8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_res.XazResult), uint64(8)*uint64(_res.XnData)))
110776  	if _6_azNew == nil {
110777  		Xsqlite3_free_table(tls, elem0(_res.XazResult, uintptr(1)))
110778  		_db.XerrCode = int32(7)
110779  		return _sqlite3NomemError(tls, int32(122615))
110780  	}
110781  	_res.XazResult = _6_azNew
110782  _10:
110783  	*_pazResult = elem0(_res.XazResult, uintptr(1))
110784  	if _pnColumn != nil {
110785  		*_pnColumn = int32(_res.XnColumn)
110786  	}
110787  	if _pnRow != nil {
110788  		*_pnRow = int32(_res.XnRow)
110789  	}
110790  	return _rc
110791  }
110792  
110793  // C comment
110794  //  /*
110795  //  ** This routine is called once for each row in the result table.  Its job
110796  //  ** is to fill in the TabResult structure appropriately, allocating new
110797  //  ** memory as necessary.
110798  //  */
110799  func _sqlite3_get_table_cb(tls *crt.TLS, _pArg unsafe.Pointer, _nCol int32, _argv **int8, _colv **int8) (r0 int32) {
110800  	var _need, _i, _10_n int32
110801  	var _z *int8
110802  	var _3_azNew **int8
110803  	var _p *XTabResult
110804  	_p = (*XTabResult)(_pArg)
110805  	if (_p.XnRow == (0)) && (_argv != nil) {
110806  		_need = _nCol * int32(2)
110807  		goto _2
110808  	}
110809  	_need = _nCol
110810  _2:
110811  	if (_p.XnData + uint32(_need)) <= _p.XnAlloc {
110812  		goto _3
110813  	}
110814  	_p.XnAlloc = (_p.XnAlloc * uint32(2)) + uint32(_need)
110815  	_3_azNew = (**int8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_p.XazResult), uint64(8)*uint64(_p.XnAlloc)))
110816  	if _3_azNew == nil {
110817  		goto _malloc_failed
110818  	}
110819  	_p.XazResult = _3_azNew
110820  _3:
110821  	if _p.XnRow != (0) {
110822  		goto _5
110823  	}
110824  	_p.XnColumn = uint32(_nCol)
110825  	_i = int32(0)
110826  _6:
110827  	if _i >= _nCol {
110828  		goto _9
110829  	}
110830  	_z = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(*elem0(_colv, uintptr(_i))))
110831  	if _z == nil {
110832  		goto _malloc_failed
110833  	}
110834  	*elem0(_p.XazResult, uintptr(postInc34(&_p.XnData, uint32(1)))) = _z
110835  	_i += 1
110836  	goto _6
110837  _9:
110838  	goto _12
110839  _5:
110840  	if int32(_p.XnColumn) != _nCol {
110841  		Xsqlite3_free(tls, unsafe.Pointer(_p.XzErrMsg))
110842  		_p.XzErrMsg = Xsqlite3_mprintf(tls, str(127722))
110843  		_p.Xrc = int32(1)
110844  		return int32(1)
110845  	}
110846  _12:
110847  	if _argv == nil {
110848  		goto _13
110849  	}
110850  	_i = int32(0)
110851  _14:
110852  	if _i >= _nCol {
110853  		goto _17
110854  	}
110855  	if (*elem0(_argv, uintptr(_i))) == nil {
110856  		_z = nil
110857  		goto _19
110858  	}
110859  	_10_n = _sqlite3Strlen30(tls, *elem0(_argv, uintptr(_i))) + int32(1)
110860  	_z = (*int8)(Xsqlite3_malloc64(tls, uint64(_10_n)))
110861  	if _z == nil {
110862  		goto _malloc_failed
110863  	}
110864  	crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(*elem0(_argv, uintptr(_i))), uint64(_10_n))
110865  _19:
110866  	*elem0(_p.XazResult, uintptr(postInc34(&_p.XnData, uint32(1)))) = _z
110867  	_i += 1
110868  	goto _14
110869  _17:
110870  	_p.XnRow += 1
110871  _13:
110872  	return int32(0)
110873  
110874  _malloc_failed:
110875  	_p.Xrc = _sqlite3NomemError(tls, int32(122545))
110876  	return int32(1)
110877  }
110878  
110879  // C comment
110880  //  /*
110881  //  ** Cause any pending operation to stop at its earliest opportunity.
110882  //  */
110883  func Xsqlite3_interrupt(tls *crt.TLS, _db *Xsqlite3) {
110884  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) && ((_db == nil) || (_db.Xmagic != uint32(1691352191))) {
110885  		_sqlite3MisuseError(tls, int32(142055))
110886  		return
110887  	}
110888  	*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(1)
110889  }
110890  
110891  // C comment
110892  //  /*
110893  //  ** Return the ROWID of the most recent insert
110894  //  */
110895  func Xsqlite3_last_insert_rowid(tls *crt.TLS, _db *Xsqlite3) (r0 int64) {
110896  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
110897  		_sqlite3MisuseError(tls, int32(141385))
110898  		return 0
110899  	}
110900  	return _db.XlastRowid
110901  }
110902  
110903  // C comment
110904  //  /*
110905  //  ** Open a new database handle.
110906  //  */
110907  func Xsqlite3_open(tls *crt.TLS, _zFilename *int8, _ppDb **Xsqlite3) (r0 int32) {
110908  	return _openDatabase(tls, _zFilename, _ppDb, uint32(6), nil)
110909  }
110910  
110911  // C comment
110912  //  /*
110913  //  ** This routine does the work of opening a database on behalf of
110914  //  ** sqlite3_open() and sqlite3_open16(). The database filename "zFilename"
110915  //  ** is UTF-8 encoded.
110916  //  */
110917  func _openDatabase(tls *crt.TLS, _zFilename *int8, _ppDb **Xsqlite3, _flags uint32, _zVfs *int8) (r0 int32) {
110918  	var _rc, _isThreadsafe int32
110919  	var _zOpen, _zErrMsg *int8
110920  	var _db *Xsqlite3
110921  	_zOpen = nil
110922  	_zErrMsg = nil
110923  	if _ppDb == nil {
110924  		return _sqlite3MisuseError(tls, int32(143267))
110925  	}
110926  	*_ppDb = nil
110927  	_rc = Xsqlite3_initialize(tls)
110928  	if _rc != 0 {
110929  		return _rc
110930  	}
110931  
110932  	if ((int32(1) << uint(int32(_flags&uint32(7)))) & int32(70)) == int32(0) {
110933  		return _sqlite3MisuseError(tls, int32(143292))
110934  	}
110935  	if _sqlite3Config.XbCoreMutex == int32(0) {
110936  		_isThreadsafe = int32(0)
110937  		goto _8
110938  	}
110939  	if (_flags & uint32(32768)) != 0 {
110940  		_isThreadsafe = int32(0)
110941  		goto _8
110942  	}
110943  	if (_flags & uint32(65536)) != 0 {
110944  		_isThreadsafe = int32(1)
110945  		goto _8
110946  	}
110947  	_isThreadsafe = _sqlite3Config.XbFullMutex
110948  _8:
110949  	if (_flags & uint32(262144)) != 0 {
110950  		_flags &= uint32(4294836223)
110951  		goto _11
110952  	}
110953  	if _sqlite3Config.XsharedCacheEnabled != 0 {
110954  		_flags |= uint32(131072)
110955  	}
110956  _11:
110957  	_flags &= uint32(4294312167)
110958  	_db = (*Xsqlite3)(_sqlite3MallocZero(tls, uint64(672)))
110959  	if _db == nil {
110960  		goto _opendb_out
110961  	}
110962  	if _isThreadsafe == 0 {
110963  		goto _13
110964  	}
110965  	*(**Xsqlite3_mutex)(unsafe.Pointer(&_db.Xmutex)) = _sqlite3MutexAlloc(tls, int32(1))
110966  	if (*Xsqlite3_mutex)(_db.Xmutex) == nil {
110967  		Xsqlite3_free(tls, unsafe.Pointer(_db))
110968  		_db = nil
110969  		goto _opendb_out
110970  	}
110971  _13:
110972  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
110973  	_db.XerrMask = int32(255)
110974  	_db.XnDb = int32(2)
110975  	_db.Xmagic = uint32(4030429446)
110976  	*(**XDb)(unsafe.Pointer(&_db.XaDb)) = (*XDb)(unsafe.Pointer(&_db.XaDbStatic))
110977  
110978  	crt.Xmemcpy(tls, unsafe.Pointer(&_db.XaLimit), unsafe.Pointer(&_aHardLimit), uint64(48))
110979  	*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(11)) = int32(0)
110980  	_db.XautoCommit = uint8(1)
110981  	_db.XnextAutovac = int8(-1)
110982  	_db.XszMmap = _sqlite3Config.XszMmap
110983  	_db.XnextPagesize = int32(0)
110984  	_db.XnMaxSorterMmap = int32(2147483647)
110985  	_db.Xflags |= int32(17825888)
110986  	_sqlite3HashInit(tls, &_db.XaCollSeq)
110987  	_sqlite3HashInit(tls, &_db.XaModule)
110988  	_createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(1), nil, _binCollFunc, nil)
110989  	_createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(3), nil, _binCollFunc, nil)
110990  	_createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(2), nil, _binCollFunc, nil)
110991  	_createCollation(tls, _db, str(103063), uint8(1), nil, _nocaseCollatingFunc, nil)
110992  	_createCollation(tls, _db, str(127787), uint8(1), crt.U2P(uintptr(uint32(1))), _binCollFunc, nil)
110993  	if _db.XmallocFailed != 0 {
110994  		goto _opendb_out
110995  	}
110996  	*(**XCollSeq)(unsafe.Pointer(&_db.XpDfltColl)) = _sqlite3FindCollSeq(tls, _db, uint8(1), (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), int32(0))
110997  	func() {
110998  		if (*XCollSeq)(_db.XpDfltColl) == nil {
110999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143411), unsafe.Pointer(&_openDatabaseØ00__func__Ø000), unsafe.Pointer(str(127793)))
111000  			crt.X__builtin_abort(tls)
111001  		}
111002  	}()
111003  	_db.XopenFlags = _flags
111004  	_rc = _sqlite3ParseUri(tls, _zVfs, _zFilename, &_flags, (**Xsqlite3_vfs)(unsafe.Pointer(&_db.XpVfs)), &_zOpen, &_zErrMsg)
111005  	if _rc == int32(0) {
111006  		goto _18
111007  	}
111008  	if _rc == int32(7) {
111009  		_sqlite3OomFault(tls, _db)
111010  	}
111011  	_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
111012  		if _zErrMsg != nil {
111013  			return str(24531)
111014  		}
111015  		return nil
111016  	}(), unsafe.Pointer(_zErrMsg))
111017  	Xsqlite3_free(tls, unsafe.Pointer(_zErrMsg))
111018  	goto _opendb_out
111019  _18:
111020  	_rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.XpVfs), _zOpen, _db, (**XBtree)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), 0).XpBt))), int32(0), int32(_flags|uint32(256)))
111021  	if _rc == int32(0) {
111022  		goto _22
111023  	}
111024  	if _rc == int32(3082) {
111025  		_rc = _sqlite3NomemError(tls, int32(143428))
111026  	}
111027  	_sqlite3Error(tls, _db, _rc)
111028  	goto _opendb_out
111029  _22:
111030  	_sqlite3BtreeEnter(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt))
111031  	*(**XSchema)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), 0).XpSchema))) = _sqlite3SchemaGet(tls, _db, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt))
111032  	if _db.XmallocFailed == 0 {
111033  		_db.Xenc = (*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema).Xenc
111034  	}
111035  	_sqlite3BtreeLeave(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt))
111036  	*(**XSchema)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema))) = _sqlite3SchemaGet(tls, _db, nil)
111037  	elem27((*XDb)(_db.XaDb), 0).XzDbSName = str(92534)
111038  	elem27((*XDb)(_db.XaDb), 0).Xsafety_level = uint8(3)
111039  	elem27((*XDb)(_db.XaDb), uintptr(1)).XzDbSName = str(23797)
111040  	elem27((*XDb)(_db.XaDb), uintptr(1)).Xsafety_level = uint8(1)
111041  	_db.Xmagic = uint32(2687084183)
111042  	if _db.XmallocFailed != 0 {
111043  		goto _opendb_out
111044  	}
111045  	_sqlite3Error(tls, _db, int32(0))
111046  	_sqlite3RegisterPerConnectionBuiltinFunctions(tls, _db)
111047  	_rc = Xsqlite3_errcode(tls, _db)
111048  	if _rc != int32(0) {
111049  		goto _26
111050  	}
111051  	_sqlite3AutoLoadExtensions(tls, _db)
111052  	_rc = Xsqlite3_errcode(tls, _db)
111053  	if _rc != int32(0) {
111054  		goto _opendb_out
111055  	}
111056  _26:
111057  	if _rc != 0 {
111058  		_sqlite3Error(tls, _db, _rc)
111059  	}
111060  	_setupLookaside(tls, _db, nil, _sqlite3Config.XszLookaside, _sqlite3Config.XnLookaside)
111061  	Xsqlite3_wal_autocheckpoint(tls, _db, int32(1000))
111062  _opendb_out:
111063  	if _db != nil {
111064  		func() {
111065  			if (*Xsqlite3_mutex)(_db.Xmutex) == nil && _isThreadsafe != int32(0) && _sqlite3Config.XbFullMutex != int32(0) {
111066  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143544), unsafe.Pointer(&_openDatabaseØ00__func__Ø000), unsafe.Pointer(str(127810)))
111067  				crt.X__builtin_abort(tls)
111068  			}
111069  		}()
111070  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111071  	}
111072  	_rc = Xsqlite3_errcode(tls, _db)
111073  	func() {
111074  		if _db == nil && _rc != int32(7) {
111075  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143549), unsafe.Pointer(&_openDatabaseØ00__func__Ø000), unsafe.Pointer(str(127879)))
111076  			crt.X__builtin_abort(tls)
111077  		}
111078  	}()
111079  	if _rc == int32(7) {
111080  		Xsqlite3_close(tls, _db)
111081  		_db = nil
111082  		goto _39
111083  	}
111084  	if _rc != int32(0) {
111085  		_db.Xmagic = uint32(1266094736)
111086  	}
111087  _39:
111088  	*_ppDb = _db
111089  	Xsqlite3_free(tls, unsafe.Pointer(_zOpen))
111090  	return _rc & int32(255)
111091  }
111092  
111093  // C comment
111094  //  /*
111095  //  ** This is the default collating function named "BINARY" which is always
111096  //  ** available.
111097  //  **
111098  //  ** If the padFlag argument is not NULL then space padding at the end
111099  //  ** of strings is ignored.  This implements the RTRIM collation.
111100  //  */
111101  func _binCollFunc(tls *crt.TLS, _padFlag unsafe.Pointer, _nKey1 int32, _pKey1 unsafe.Pointer, _nKey2 int32, _pKey2 unsafe.Pointer) (r0 int32) {
111102  	var _rc, _n int32
111103  	_n = func() int32 {
111104  		if _nKey1 < _nKey2 {
111105  			return _nKey1
111106  		}
111107  		return _nKey2
111108  	}()
111109  	_rc = crt.Xmemcmp(tls, _pKey1, _pKey2, uint64(_n))
111110  	if _rc != int32(0) {
111111  		goto _2
111112  	}
111113  	if ((_padFlag != nil) && _allSpaces(tls, (*int8)(unsafe.Pointer(uintptr(_pKey1)+uintptr(_n))), _nKey1-_n) != 0) && _allSpaces(tls, (*int8)(unsafe.Pointer(uintptr(_pKey2)+uintptr(_n))), _nKey2-_n) != 0 {
111114  		goto _6
111115  	}
111116  	_rc = _nKey1 - _nKey2
111117  _6:
111118  _2:
111119  	return _rc
111120  }
111121  
111122  // C comment
111123  //  /*
111124  //  ** Return true if the buffer z[0..n-1] contains all spaces.
111125  //  */
111126  func _allSpaces(tls *crt.TLS, _z *int8, _n int32) (r0 int32) {
111127  _0:
111128  	if (_n > int32(0)) && (int32(*elem1(_z, uintptr(_n-int32(1)))) == int32(32)) {
111129  		_n -= 1
111130  		goto _0
111131  	}
111132  	return bool2int(_n == int32(0))
111133  }
111134  
111135  // C comment
111136  //  /*
111137  //  ** Another built-in collating sequence: NOCASE.
111138  //  **
111139  //  ** This collating sequence is intended to be used for "case independent
111140  //  ** comparison". SQLite's knowledge of upper and lower case equivalents
111141  //  ** extends only to the 26 characters used in the English language.
111142  //  **
111143  //  ** At the moment there is only a UTF-8 implementation.
111144  //  */
111145  func _nocaseCollatingFunc(tls *crt.TLS, _NotUsed unsafe.Pointer, _nKey1 int32, _pKey1 unsafe.Pointer, _nKey2 int32, _pKey2 unsafe.Pointer) (r0 int32) {
111146  	var _r int32
111147  	_r = Xsqlite3_strnicmp(tls, (*int8)(_pKey1), (*int8)(_pKey2), func() int32 {
111148  		if _nKey1 < _nKey2 {
111149  			return _nKey1
111150  		}
111151  		return _nKey2
111152  	}())
111153  
111154  	if int32(0) == _r {
111155  		_r = _nKey1 - _nKey2
111156  	}
111157  	return _r
111158  }
111159  
111160  var _openDatabaseØ00__func__Ø000 [13]int8
111161  
111162  func init() {
111163  	crt.Xstrncpy(nil, &_openDatabaseØ00__func__Ø000[0], str(127905), 13)
111164  }
111165  
111166  // C comment
111167  //  /*
111168  //  ** This routine does per-connection function registration.  Most
111169  //  ** of the built-in functions above are part of the global function set.
111170  //  ** This routine only deals with those that are not global.
111171  //  */
111172  func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *crt.TLS, _db *Xsqlite3) {
111173  	var _rc int32
111174  	_rc = Xsqlite3_overload_function(tls, _db, str(25231), int32(2))
111175  	func() {
111176  		if _rc != int32(7) && _rc != int32(0) {
111177  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107204), unsafe.Pointer(&_sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000), unsafe.Pointer(str(127918)))
111178  			crt.X__builtin_abort(tls)
111179  		}
111180  	}()
111181  	if _rc == int32(7) {
111182  		_sqlite3OomFault(tls, _db)
111183  	}
111184  }
111185  
111186  // C comment
111187  //  /*
111188  //  ** Declare that a function has been overloaded by a virtual table.
111189  //  **
111190  //  ** If the function already exists as a regular global function, then
111191  //  ** this routine is a no-op.  If the function does not exist, then create
111192  //  ** a new one that always throws a run-time error.
111193  //  **
111194  //  ** When virtual tables intend to provide an overloaded function, they
111195  //  ** should call this routine to make sure the global function exists.
111196  //  ** A global function must exist in order for name resolution to work
111197  //  ** properly.
111198  //  */
111199  func Xsqlite3_overload_function(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _nArg int32) (r0 int32) {
111200  	var _rc int32
111201  	_rc = int32(0)
111202  	if ((_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil)) || (_nArg < int32(-2)) {
111203  		return _sqlite3MisuseError(tls, int32(142274))
111204  	}
111205  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111206  	if _sqlite3FindFunction(tls, _db, _zName, _nArg, uint8(1), 0) == nil {
111207  		_rc = _sqlite3CreateFunc(tls, _db, _zName, _nArg, int32(1), nil, _sqlite3InvalidFunction, nil, nil, nil)
111208  	}
111209  	_rc = _sqlite3ApiExit(tls, _db, _rc)
111210  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111211  	return _rc
111212  }
111213  
111214  // C comment
111215  //  /*
111216  //  ** The following is the implementation of an SQL function that always
111217  //  ** fails with an error message stating that the function is used in the
111218  //  ** wrong context.  The sqlite3_overload_function() API might construct
111219  //  ** SQL function that use this routine so that the functions will exist
111220  //  ** for name resolution but are actually overloaded by the xFindFunction
111221  //  ** method of virtual tables.
111222  //  */
111223  func _sqlite3InvalidFunction(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
111224  	var _zName, _zErr *int8
111225  	_zName = (*XFuncDef)(_context.XpFunc).XzName
111226  	_ = _NotUsed2
111227  
111228  	_zErr = Xsqlite3_mprintf(tls, str(127952), unsafe.Pointer(_zName))
111229  	Xsqlite3_result_error(tls, _context, _zErr, int32(-1))
111230  	Xsqlite3_free(tls, unsafe.Pointer(_zErr))
111231  }
111232  
111233  var _sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000 [45]int8
111234  
111235  func init() {
111236  	crt.Xstrncpy(nil, &_sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000[0], str(128003), 45)
111237  }
111238  
111239  // C comment
111240  //  /*
111241  //  ** Load all automatic extensions.
111242  //  **
111243  //  ** If anything goes wrong, set an error in the database connection.
111244  //  */
111245  func _sqlite3AutoLoadExtensions(tls *crt.TLS, _db *Xsqlite3) {
111246  	var _go, _rc int32
111247  	var _i uint32
111248  	var _2_zErrmsg *int8
111249  	var _2_mutex *Xsqlite3_mutex
111250  	var _xInit func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32
111251  	var _2_pThunk *Xsqlite3_api_routines
111252  	_go = int32(1)
111253  	if _sqlite3Autoext.XnExt == (0) {
111254  		return
111255  	}
111256  	_i = 0
111257  _1:
111258  	if _go == 0 {
111259  		goto _4
111260  	}
111261  	_2_mutex = _sqlite3MutexAlloc(tls, int32(2))
111262  	_2_pThunk = &_sqlite3Apis
111263  	Xsqlite3_mutex_enter(tls, _2_mutex)
111264  	if _i >= _sqlite3Autoext.XnExt {
111265  		_xInit = nil
111266  		_go = int32(0)
111267  		goto _6
111268  	}
111269  	_xInit = func() func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 {
111270  		v := *elem131(_sqlite3Autoext.XaExt, uintptr(_i))
111271  		return *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&v))
111272  	}()
111273  _6:
111274  	Xsqlite3_mutex_leave(tls, _2_mutex)
111275  	_2_zErrmsg = nil
111276  	if (_xInit != nil) && (store2(&_rc, _xInit(tls, _db, &_2_zErrmsg, _2_pThunk)) != int32(0)) {
111277  		_sqlite3ErrorWithMsg(tls, _db, _rc, str(128048), unsafe.Pointer(_2_zErrmsg))
111278  		_go = int32(0)
111279  	}
111280  	Xsqlite3_free(tls, unsafe.Pointer(_2_zErrmsg))
111281  	_i += 1
111282  	goto _1
111283  _4:
111284  }
111285  
111286  var _sqlite3Autoext Tsqlite3AutoExtList
111287  
111288  // C comment
111289  //  /*
111290  //  ** Set up the lookaside buffers for a database connection.
111291  //  ** Return SQLITE_OK on success.
111292  //  ** If lookaside is already active, return SQLITE_BUSY.
111293  //  **
111294  //  ** The sz parameter is the number of bytes in each lookaside slot.
111295  //  ** The cnt parameter is the number of slots.  If pStart is NULL the
111296  //  ** space for the lookaside memory is obtained from sqlite3_malloc().
111297  //  ** If pStart is not NULL then it is sz*cnt bytes of memory to use for
111298  //  ** the lookaside memory.
111299  //  */
111300  func _setupLookaside(tls *crt.TLS, _db *Xsqlite3, _pBuf unsafe.Pointer, _sz int32, _cnt int32) (r0 int32) {
111301  	var _6_i int32
111302  	var _pStart unsafe.Pointer
111303  	var _6_p *XScratchFreeslot
111304  	if (_db.Xlookaside.XnOut) != 0 {
111305  		return int32(5)
111306  	}
111307  	if (_db.Xlookaside.XbMalloced) != 0 {
111308  		Xsqlite3_free(tls, _db.Xlookaside.XpStart)
111309  	}
111310  	_sz = _sz & int32(-8)
111311  	if _sz <= int32(8) {
111312  		_sz = int32(0)
111313  	}
111314  	if _cnt < int32(0) {
111315  		_cnt = int32(0)
111316  	}
111317  	if (_sz == int32(0)) || (_cnt == int32(0)) {
111318  		_sz = int32(0)
111319  		_pStart = nil
111320  		goto _9
111321  	}
111322  	if _pBuf != nil {
111323  		goto _7
111324  	}
111325  	_sqlite3BeginBenignMalloc(tls)
111326  	_pStart = _sqlite3Malloc(tls, uint64(_sz*_cnt))
111327  	_sqlite3EndBenignMalloc(tls)
111328  	if _pStart != nil {
111329  		_cnt = _sqlite3MallocSize(tls, _pStart) / _sz
111330  	}
111331  	goto _9
111332  _7:
111333  	_pStart = _pBuf
111334  _9:
111335  	_db.Xlookaside.XpStart = _pStart
111336  	*(**XScratchFreeslot)(unsafe.Pointer(&(_db.Xlookaside.XpFree))) = nil
111337  	_db.Xlookaside.Xsz = uint16(_sz)
111338  	if _pStart == nil {
111339  		goto _10
111340  	}
111341  	func() {
111342  		if _sz <= int32(8) {
111343  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141165), unsafe.Pointer(&_setupLookasideØ00__func__Ø000), unsafe.Pointer(str(128087)))
111344  			crt.X__builtin_abort(tls)
111345  		}
111346  	}()
111347  	_6_p = (*XScratchFreeslot)(_pStart)
111348  	_6_i = _cnt - int32(1)
111349  _13:
111350  	if _6_i < int32(0) {
111351  		goto _16
111352  	}
111353  	*(**XScratchFreeslot)(unsafe.Pointer(&_6_p.XpNext)) = (*XScratchFreeslot)(_db.Xlookaside.XpFree)
111354  	*(**XScratchFreeslot)(unsafe.Pointer(&(_db.Xlookaside.XpFree))) = _6_p
111355  	_6_p = (*XScratchFreeslot)(unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(_6_p)), uintptr(_sz))))
111356  	_6_i -= 1
111357  	goto _13
111358  _16:
111359  	_db.Xlookaside.XpEnd = unsafe.Pointer(_6_p)
111360  	_db.Xlookaside.XbDisable = 0
111361  	_db.Xlookaside.XbMalloced = uint8(func() int32 {
111362  		if _pBuf == nil {
111363  			return int32(1)
111364  		}
111365  		return int32(0)
111366  	}())
111367  	goto _19
111368  _10:
111369  	_db.Xlookaside.XpStart = unsafe.Pointer(_db)
111370  	_db.Xlookaside.XpEnd = unsafe.Pointer(_db)
111371  	_db.Xlookaside.XbDisable = uint32(1)
111372  	_db.Xlookaside.XbMalloced = 0
111373  _19:
111374  	return int32(0)
111375  }
111376  
111377  var _setupLookasideØ00__func__Ø000 [15]int8
111378  
111379  func init() {
111380  	crt.Xstrncpy(nil, &_setupLookasideØ00__func__Ø000[0], str(128120), 15)
111381  }
111382  
111383  // C comment
111384  //  /*
111385  //  ** Open a new database handle.
111386  //  */
111387  func Xsqlite3_open16(tls *crt.TLS, _zFilename unsafe.Pointer, _ppDb **Xsqlite3) (r0 int32) {
111388  	var _rc int32
111389  	var _zFilename8 *int8
111390  	var _pVal *XMem
111391  	if _ppDb == nil {
111392  		return _sqlite3MisuseError(tls, int32(143617))
111393  	}
111394  	*_ppDb = nil
111395  	_rc = Xsqlite3_initialize(tls)
111396  	if _rc != 0 {
111397  		return _rc
111398  	}
111399  	if _zFilename == nil {
111400  		_zFilename = unsafe.Pointer(str(128135))
111401  	}
111402  	_pVal = _sqlite3ValueNew(tls, nil)
111403  	_sqlite3ValueSetStr(tls, _pVal, int32(-1), _zFilename, uint8(2), nil)
111404  	_zFilename8 = (*int8)(_sqlite3ValueText(tls, _pVal, uint8(1)))
111405  	if _zFilename8 == nil {
111406  		goto _3
111407  	}
111408  	_rc = _openDatabase(tls, _zFilename8, _ppDb, uint32(6), nil)
111409  	func() {
111410  		if (*_ppDb) == nil && _rc != int32(7) {
111411  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143631), unsafe.Pointer(&_sqlite3_open16Ø00__func__Ø000), unsafe.Pointer(str(128138)))
111412  			crt.X__builtin_abort(tls)
111413  		}
111414  	}()
111415  	if (_rc == int32(0)) && ((int32((*XSchema)(elem27((*XDb)((*_ppDb).XaDb), 0).XpSchema).XschemaFlags) & int32(1)) != int32(1)) {
111416  		(*XSchema)(elem27((*XDb)((*_ppDb).XaDb), 0).XpSchema).Xenc = store3(&((*_ppDb).Xenc), uint8(2))
111417  	}
111418  	goto _9
111419  _3:
111420  	_rc = _sqlite3NomemError(tls, int32(143636))
111421  _9:
111422  	_sqlite3ValueFree(tls, _pVal)
111423  	return _rc & int32(255)
111424  }
111425  
111426  var _sqlite3_open16Ø00__func__Ø000 [15]int8
111427  
111428  func init() {
111429  	crt.Xstrncpy(nil, &_sqlite3_open16Ø00__func__Ø000[0], str(128164), 15)
111430  }
111431  
111432  // C comment
111433  //  /*
111434  //  ** Two versions of the official API.  Legacy and new use.  In the legacy
111435  //  ** version, the original SQL text is not saved in the prepared statement
111436  //  ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
111437  //  ** sqlite3_step().  In the new version, the original SQL text is retained
111438  //  ** and the statement is automatically recompiled if an schema change
111439  //  ** occurs.
111440  //  */
111441  func Xsqlite3_prepare16(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) {
111442  	var _rc int32
111443  	_rc = _sqlite3Prepare16(tls, _db, _zSql, _nBytes, int32(0), _ppStmt, _pzTail)
111444  	func() {
111445  		if _rc != int32(0) && _ppStmt != nil && (*_ppStmt) != nil {
111446  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116502), unsafe.Pointer(&_sqlite3_prepare16Ø00__func__Ø000), unsafe.Pointer(str(50419)))
111447  			crt.X__builtin_abort(tls)
111448  		}
111449  	}()
111450  	return _rc
111451  }
111452  
111453  // C comment
111454  //  /*
111455  //  ** Compile the UTF-16 encoded SQL statement zSql into a statement handle.
111456  //  */
111457  func _sqlite3Prepare16(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _saveSqlFlag int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) {
111458  	var _rc, _2_sz, _5_chars_parsed int32
111459  	var _zSql8, _zTail8, _2_z *int8
111460  	_zTail8 = nil
111461  	_rc = int32(0)
111462  	if _ppStmt == nil {
111463  		return _sqlite3MisuseError(tls, int32(116452))
111464  	}
111465  	*_ppStmt = nil
111466  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zSql == nil) {
111467  		return _sqlite3MisuseError(tls, int32(116456))
111468  	}
111469  	if _nBytes < int32(0) {
111470  		goto _3
111471  	}
111472  	_2_z = (*int8)(_zSql)
111473  	_2_sz = int32(0)
111474  _4:
111475  	if _2_sz >= _nBytes || int32(*elem1(_2_z, uintptr(_2_sz))) == int32(0) && int32(*elem1(_2_z, uintptr(_2_sz+int32(1)))) == int32(0) {
111476  		goto _9
111477  	}
111478  	_2_sz += int32(2)
111479  	goto _4
111480  _9:
111481  	_nBytes = _2_sz
111482  _3:
111483  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111484  	_zSql8 = _sqlite3Utf16to8(tls, _db, _zSql, _nBytes, uint8(2))
111485  	if _zSql8 != nil {
111486  		_rc = _sqlite3LockAndPrepare(tls, _db, _zSql8, int32(-1), _saveSqlFlag, nil, _ppStmt, &_zTail8)
111487  	}
111488  	if (_zTail8 != nil) && (_pzTail != nil) {
111489  		_5_chars_parsed = _sqlite3Utf8CharLen(tls, _zSql8, int32(int64(uintptr(unsafe.Pointer(_zTail8))-uintptr(unsafe.Pointer(_zSql8)))))
111490  		*_pzTail = unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_zSql) + uintptr(_sqlite3Utf16ByteLen(tls, _zSql, _5_chars_parsed)))))
111491  	}
111492  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zSql8))
111493  	_rc = _sqlite3ApiExit(tls, _db, _rc)
111494  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111495  	return _rc
111496  }
111497  
111498  // C comment
111499  //  /*
111500  //  ** zIn is a UTF-16 encoded unicode string at least nChar characters long.
111501  //  ** Return the number of bytes in the first nChar unicode characters
111502  //  ** in pZ.  nChar must be non-negative.
111503  //  */
111504  func _sqlite3Utf16ByteLen(tls *crt.TLS, _zIn unsafe.Pointer, _nChar int32) (r0 int32) {
111505  	var _c, _n, _4_c2, _8_c2 int32
111506  	var _z *uint8
111507  	_z = (*uint8)(_zIn)
111508  	_n = int32(0)
111509  	goto _0
111510  _0:
111511  _7:
111512  	if _n >= _nChar {
111513  		goto _8
111514  	}
111515  	_c = int32(*postInc15(&_z, 1))
111516  	_c += int32(*postInc15(&_z, 1)) << 8
111517  	if ((_c >= int32(55296)) && (_c < int32(57344))) && int32(1) != 0 {
111518  		_8_c2 = int32(*postInc15(&_z, 1))
111519  		_8_c2 += int32(*postInc15(&_z, 1)) << 8
111520  		_c = ((_8_c2 & int32(1023)) + ((_c & int32(63)) << 10)) + (((_c & int32(960)) + int32(64)) << 10)
111521  	}
111522  	_n += 1
111523  	goto _7
111524  _8:
111525  	return int32(int64(uintptr(unsafe.Pointer(_z)) - uintptr(_zIn)))
111526  
111527  	_ = _4_c2
111528  	panic(0)
111529  }
111530  
111531  var _sqlite3_prepare16Ø00__func__Ø000 [18]int8
111532  
111533  func init() {
111534  	crt.Xstrncpy(nil, &_sqlite3_prepare16Ø00__func__Ø000[0], str(128179), 18)
111535  }
111536  
111537  // C comment
111538  //  /*
111539  //  ** Register a profile function.  The pArg from the previously registered
111540  //  ** profile function is returned.
111541  //  **
111542  //  ** A NULL profile function means that no profiling is executes.  A non-NULL
111543  //  ** profile is a pointer to a function that is invoked at the conclusion of
111544  //  ** each SQL statement that is run.
111545  //  */
111546  func Xsqlite3_profile(tls *crt.TLS, _db *Xsqlite3, _xProfile func(*crt.TLS, unsafe.Pointer, *int8, uint64), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
111547  	var _pOld unsafe.Pointer
111548  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111549  		_sqlite3MisuseError(tls, int32(142357))
111550  		return nil
111551  	}
111552  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111553  	_pOld = _db.XpProfileArg
111554  	_db.XxProfile = _xProfile
111555  	_db.XpProfileArg = _pArg
111556  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111557  	return _pOld
111558  }
111559  
111560  // C comment
111561  //  /*
111562  //  ** This routine sets the progress callback for an Sqlite database to the
111563  //  ** given callback function with the given argument. The progress callback will
111564  //  ** be invoked every nOps opcodes.
111565  //  */
111566  func Xsqlite3_progress_handler(tls *crt.TLS, _db *Xsqlite3, _nOps int32, _xProgress func(*crt.TLS, unsafe.Pointer) int32, _pArg unsafe.Pointer) {
111567  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111568  		_sqlite3MisuseError(tls, int32(142013))
111569  		return
111570  	}
111571  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111572  	if _nOps > int32(0) {
111573  		_db.XxProgress = _xProgress
111574  		_db.XnProgressOps = uint32(_nOps)
111575  		_db.XpProgressArg = _pArg
111576  		goto _2
111577  	}
111578  	_db.XxProgress = nil
111579  	_db.XnProgressOps = 0
111580  	_db.XpProgressArg = nil
111581  _2:
111582  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111583  }
111584  
111585  // C comment
111586  //  /*
111587  //  ** The public interface to sqlite3Realloc.  Make sure that the memory
111588  //  ** subsystem is initialized prior to invoking sqliteRealloc.
111589  //  */
111590  func Xsqlite3_realloc(tls *crt.TLS, _pOld unsafe.Pointer, _n int32) (r0 unsafe.Pointer) {
111591  	if Xsqlite3_initialize(tls) != 0 {
111592  		return nil
111593  	}
111594  	if _n < int32(0) {
111595  		_n = int32(0)
111596  	}
111597  	return _sqlite3Realloc(tls, _pOld, uint64(_n))
111598  }
111599  
111600  func Xsqlite3_result_error16(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32) {
111601  	func() {
111602  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111603  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76458), unsafe.Pointer(&_sqlite3_result_error16Ø00__func__Ø000), unsafe.Pointer(str(6567)))
111604  			crt.X__builtin_abort(tls)
111605  		}
111606  	}()
111607  	_pCtx.XisError = int32(1)
111608  	_pCtx.XfErrorOrAux = uint8(1)
111609  	_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.XpOut), (*int8)(_z), _n, uint8(2), func() func(*crt.TLS, unsafe.Pointer) {
111610  		v := uint64(18446744073709551615)
111611  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
111612  	}())
111613  }
111614  
111615  var _sqlite3_result_error16Ø00__func__Ø000 [23]int8
111616  
111617  func init() {
111618  	crt.Xstrncpy(nil, &_sqlite3_result_error16Ø00__func__Ø000[0], str(128197), 23)
111619  }
111620  
111621  func Xsqlite3_result_int64(tls *crt.TLS, _pCtx *Xsqlite3_context, _iVal int64) {
111622  	func() {
111623  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111624  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76469), unsafe.Pointer(&_sqlite3_result_int64Ø00__func__Ø000), unsafe.Pointer(str(6567)))
111625  			crt.X__builtin_abort(tls)
111626  		}
111627  	}()
111628  	_sqlite3VdbeMemSetInt64(tls, (*XMem)(_pCtx.XpOut), _iVal)
111629  }
111630  
111631  var _sqlite3_result_int64Ø00__func__Ø000 [21]int8
111632  
111633  func init() {
111634  	crt.Xstrncpy(nil, &_sqlite3_result_int64Ø00__func__Ø000[0], str(128220), 21)
111635  }
111636  
111637  func Xsqlite3_result_null(tls *crt.TLS, _pCtx *Xsqlite3_context) {
111638  	func() {
111639  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111640  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76473), unsafe.Pointer(&_sqlite3_result_nullØ00__func__Ø000), unsafe.Pointer(str(6567)))
111641  			crt.X__builtin_abort(tls)
111642  		}
111643  	}()
111644  	_sqlite3VdbeMemSetNull(tls, (*XMem)(_pCtx.XpOut))
111645  }
111646  
111647  var _sqlite3_result_nullØ00__func__Ø000 [20]int8
111648  
111649  func init() {
111650  	crt.Xstrncpy(nil, &_sqlite3_result_nullØ00__func__Ø000[0], str(128241), 20)
111651  }
111652  
111653  func Xsqlite3_result_text16(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
111654  	func() {
111655  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111656  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76514), unsafe.Pointer(&_sqlite3_result_text16Ø00__func__Ø000), unsafe.Pointer(str(6567)))
111657  			crt.X__builtin_abort(tls)
111658  		}
111659  	}()
111660  	_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, uint8(2), _xDel)
111661  }
111662  
111663  var _sqlite3_result_text16Ø00__func__Ø000 [22]int8
111664  
111665  func init() {
111666  	crt.Xstrncpy(nil, &_sqlite3_result_text16Ø00__func__Ø000[0], str(128261), 22)
111667  }
111668  
111669  func Xsqlite3_result_text16be(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
111670  	func() {
111671  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111672  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76523), unsafe.Pointer(&_sqlite3_result_text16beØ00__func__Ø000), unsafe.Pointer(str(6567)))
111673  			crt.X__builtin_abort(tls)
111674  		}
111675  	}()
111676  	_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, uint8(3), _xDel)
111677  }
111678  
111679  var _sqlite3_result_text16beØ00__func__Ø000 [24]int8
111680  
111681  func init() {
111682  	crt.Xstrncpy(nil, &_sqlite3_result_text16beØ00__func__Ø000[0], str(128283), 24)
111683  }
111684  
111685  func Xsqlite3_result_text16le(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
111686  	func() {
111687  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111688  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76532), unsafe.Pointer(&_sqlite3_result_text16leØ00__func__Ø000), unsafe.Pointer(str(6567)))
111689  			crt.X__builtin_abort(tls)
111690  		}
111691  	}()
111692  	_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, uint8(2), _xDel)
111693  }
111694  
111695  var _sqlite3_result_text16leØ00__func__Ø000 [24]int8
111696  
111697  func init() {
111698  	crt.Xstrncpy(nil, &_sqlite3_result_text16leØ00__func__Ø000[0], str(128307), 24)
111699  }
111700  
111701  // C comment
111702  //  /*
111703  //  ** Register a callback to be invoked each time a transaction is rolled
111704  //  ** back by this database connection.
111705  //  */
111706  func Xsqlite3_rollback_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
111707  	var _pRet unsafe.Pointer
111708  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111709  		_sqlite3MisuseError(tls, int32(142435))
111710  		return nil
111711  	}
111712  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111713  	_pRet = _db.XpRollbackArg
111714  	_db.XxRollbackCallback = _xCallback
111715  	_db.XpRollbackArg = _pArg
111716  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111717  	return _pRet
111718  }
111719  
111720  // C comment
111721  //  /*
111722  //  ** Set or clear the access authorization function.
111723  //  **
111724  //  ** The access authorization function is be called during the compilation
111725  //  ** phase to verify that the user has read and/or write access permission on
111726  //  ** various fields of the database.  The first argument to the auth function
111727  //  ** is a copy of the 3rd argument to this routine.  The second argument
111728  //  ** to the auth function is one of these constants:
111729  //  **
111730  //  **       SQLITE_CREATE_INDEX
111731  //  **       SQLITE_CREATE_TABLE
111732  //  **       SQLITE_CREATE_TEMP_INDEX
111733  //  **       SQLITE_CREATE_TEMP_TABLE
111734  //  **       SQLITE_CREATE_TEMP_TRIGGER
111735  //  **       SQLITE_CREATE_TEMP_VIEW
111736  //  **       SQLITE_CREATE_TRIGGER
111737  //  **       SQLITE_CREATE_VIEW
111738  //  **       SQLITE_DELETE
111739  //  **       SQLITE_DROP_INDEX
111740  //  **       SQLITE_DROP_TABLE
111741  //  **       SQLITE_DROP_TEMP_INDEX
111742  //  **       SQLITE_DROP_TEMP_TABLE
111743  //  **       SQLITE_DROP_TEMP_TRIGGER
111744  //  **       SQLITE_DROP_TEMP_VIEW
111745  //  **       SQLITE_DROP_TRIGGER
111746  //  **       SQLITE_DROP_VIEW
111747  //  **       SQLITE_INSERT
111748  //  **       SQLITE_PRAGMA
111749  //  **       SQLITE_READ
111750  //  **       SQLITE_SELECT
111751  //  **       SQLITE_TRANSACTION
111752  //  **       SQLITE_UPDATE
111753  //  **
111754  //  ** The third and fourth arguments to the auth function are the name of
111755  //  ** the table and the column that are being accessed.  The auth function
111756  //  ** should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE.  If
111757  //  ** SQLITE_OK is returned, it means that access is allowed.  SQLITE_DENY
111758  //  ** means that the SQL statement will never-run - the sqlite3_exec() call
111759  //  ** will return with an error.  SQLITE_IGNORE means that the SQL statement
111760  //  ** should run but attempts to read the specified column will return NULL
111761  //  ** and attempts to write the column will be ignored.
111762  //  **
111763  //  ** Setting the auth function to NULL disables this hook.  The default
111764  //  ** setting of the auth function is NULL.
111765  //  */
111766  func Xsqlite3_set_authorizer(tls *crt.TLS, _db *Xsqlite3, _xAuth func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, _pArg unsafe.Pointer) (r0 int32) {
111767  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111768  		return _sqlite3MisuseError(tls, int32(99496))
111769  	}
111770  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111771  	_db.XxAuth = _xAuth
111772  	_db.XpAuthArg = _pArg
111773  	_sqlite3ExpirePreparedStatements(tls, _db)
111774  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111775  	return int32(0)
111776  }
111777  
111778  // C comment
111779  //  /*
111780  //  ** Set the auxiliary data pointer and delete function, for the iArg'th
111781  //  ** argument to the user-function defined by pCtx. Any previous value is
111782  //  ** deleted by calling the delete function specified when it was set.
111783  //  **
111784  //  ** The left-most argument is 0.
111785  //  **
111786  //  ** Undocumented behavior:  If iArg is negative then make the data available
111787  //  ** to all functions within the current prepared statement using iArg as an
111788  //  ** access code.
111789  //  */
111790  func Xsqlite3_set_auxdata(tls *crt.TLS, _pCtx *Xsqlite3_context, _iArg int32, _pAux unsafe.Pointer, _xDelete func(*crt.TLS, unsafe.Pointer)) {
111791  	var _pVdbe *TVdbe
111792  	var _pAuxData *XAuxData
111793  	_pVdbe = (*TVdbe)(_pCtx.XpVdbe)
111794  	func() {
111795  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111796  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76947), unsafe.Pointer(&_sqlite3_set_auxdataØ00__func__Ø000), unsafe.Pointer(str(6567)))
111797  			crt.X__builtin_abort(tls)
111798  		}
111799  	}()
111800  	func() {
111801  		if _pVdbe == nil {
111802  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76951), unsafe.Pointer(&_sqlite3_set_auxdataØ00__func__Ø000), unsafe.Pointer(str(41743)))
111803  			crt.X__builtin_abort(tls)
111804  		}
111805  	}()
111806  	_pAuxData = (*XAuxData)(_pVdbe.XpAuxData)
111807  _4:
111808  	if _pAuxData == nil {
111809  		goto _7
111810  	}
111811  	if (_pAuxData.XiAuxArg == _iArg) && ((_pAuxData.XiAuxOp == _pCtx.XiOp) || (_iArg < int32(0))) {
111812  		goto _7
111813  	}
111814  	_pAuxData = (*XAuxData)(_pAuxData.XpNextAux)
111815  	goto _4
111816  _7:
111817  	if _pAuxData != nil {
111818  		goto _11
111819  	}
111820  	_pAuxData = (*XAuxData)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pVdbe.Xdb), uint64(32)))
111821  	if _pAuxData == nil {
111822  		goto _failed
111823  	}
111824  	_pAuxData.XiAuxOp = _pCtx.XiOp
111825  	_pAuxData.XiAuxArg = _iArg
111826  	*(**XAuxData)(unsafe.Pointer(&_pAuxData.XpNextAux)) = (*XAuxData)(_pVdbe.XpAuxData)
111827  	*(**XAuxData)(unsafe.Pointer(&_pVdbe.XpAuxData)) = _pAuxData
111828  	if int32(_pCtx.XfErrorOrAux) == int32(0) {
111829  		_pCtx.XisError = int32(0)
111830  		_pCtx.XfErrorOrAux = uint8(1)
111831  	}
111832  	goto _15
111833  _11:
111834  	if _pAuxData.XxDeleteAux != nil {
111835  		_pAuxData.XxDeleteAux(tls, _pAuxData.XpAux)
111836  	}
111837  _15:
111838  	_pAuxData.XpAux = _pAux
111839  	_pAuxData.XxDeleteAux = _xDelete
111840  	return
111841  _failed:
111842  	if _xDelete != nil {
111843  		_xDelete(tls, _pAux)
111844  	}
111845  }
111846  
111847  var _sqlite3_set_auxdataØ00__func__Ø000 [20]int8
111848  
111849  func init() {
111850  	crt.Xstrncpy(nil, &_sqlite3_set_auxdataØ00__func__Ø000[0], str(128331), 20)
111851  }
111852  
111853  // C comment
111854  //  /*
111855  //  ** Return meta information about a specific column of a database table.
111856  //  ** See comment in sqlite3.h (sqlite.h.in) for details.
111857  //  */
111858  func Xsqlite3_table_column_metadata(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8, _zTableName *int8, _zColumnName *int8, _pzDataType **int8, _pzCollSeq **int8, _pNotNull *int32, _pPrimaryKey *int32, _pAutoinc *int32) (r0 int32) {
111859  	var _rc, _iCol, _notnull, _primarykey, _autoinc int32
111860  	var _zErrMsg, _zDataType, _zCollSeq *int8
111861  	var _pTab *XTable
111862  	var _pCol *XColumn
111863  	_zErrMsg = nil
111864  	_pTab = nil
111865  	_pCol = nil
111866  	_iCol = int32(0)
111867  	_zDataType = nil
111868  	_zCollSeq = nil
111869  	_notnull = int32(0)
111870  	_primarykey = int32(0)
111871  	_autoinc = int32(0)
111872  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zTableName == nil) {
111873  		return _sqlite3MisuseError(tls, int32(143859))
111874  	}
111875  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111876  	_sqlite3BtreeEnterAll(tls, _db)
111877  	_rc = _sqlite3Init(tls, _db, &_zErrMsg)
111878  	if int32(0) != _rc {
111879  		goto _error_out
111880  	}
111881  	_pTab = _sqlite3FindTable(tls, _db, _zTableName, _zDbName)
111882  	if (_pTab == nil) || (_pTab.XpSelect != nil) {
111883  		_pTab = nil
111884  		goto _error_out
111885  	}
111886  	if _zColumnName == nil {
111887  		goto _6
111888  	}
111889  	_iCol = int32(0)
111890  _7:
111891  	if _iCol >= int32(_pTab.XnCol) {
111892  		goto _10
111893  	}
111894  	_pCol = elem43((*XColumn)(_pTab.XaCol), uintptr(_iCol))
111895  	if int32(0) == _sqlite3StrICmp(tls, _pCol.XzName, _zColumnName) {
111896  		goto _10
111897  	}
111898  	_iCol += 1
111899  	goto _7
111900  _10:
111901  	if _iCol != int32(_pTab.XnCol) {
111902  		goto _12
111903  	}
111904  	if ((_pTab.XtabFlags & uint32(32)) == (0)) && _sqlite3IsRowid(tls, _zColumnName) != 0 {
111905  		_iCol = int32(_pTab.XiPKey)
111906  		_pCol = func() *XColumn {
111907  			if _iCol >= int32(0) {
111908  				return elem43((*XColumn)(_pTab.XaCol), uintptr(_iCol))
111909  			}
111910  			return nil
111911  		}()
111912  		goto _17
111913  	}
111914  	_pTab = nil
111915  	goto _error_out
111916  _17:
111917  _12:
111918  _6:
111919  	if _pCol != nil {
111920  		_zDataType = _sqlite3ColumnType(tls, _pCol, nil)
111921  		_zCollSeq = _pCol.XzColl
111922  		_notnull = bool2int(int32(_pCol.XnotNull) != int32(0))
111923  		_primarykey = bool2int((int32(_pCol.XcolFlags) & int32(1)) != int32(0))
111924  		_autoinc = bool2int((int32(_pTab.XiPKey) == _iCol) && ((_pTab.XtabFlags & uint32(8)) != (0)))
111925  		goto _20
111926  	}
111927  	_zDataType = str(25747)
111928  	_primarykey = int32(1)
111929  _20:
111930  	if _zCollSeq == nil {
111931  		_zCollSeq = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
111932  	}
111933  _error_out:
111934  	_sqlite3BtreeLeaveAll(tls, _db)
111935  	if _pzDataType != nil {
111936  		*_pzDataType = _zDataType
111937  	}
111938  	if _pzCollSeq != nil {
111939  		*_pzCollSeq = _zCollSeq
111940  	}
111941  	if _pNotNull != nil {
111942  		*_pNotNull = _notnull
111943  	}
111944  	if _pPrimaryKey != nil {
111945  		*_pPrimaryKey = _primarykey
111946  	}
111947  	if _pAutoinc != nil {
111948  		*_pAutoinc = _autoinc
111949  	}
111950  	if (int32(0) == _rc) && (_pTab == nil) {
111951  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg))
111952  		_zErrMsg = _sqlite3MPrintf(tls, _db, str(128351), unsafe.Pointer(_zTableName), unsafe.Pointer(_zColumnName))
111953  		_rc = int32(1)
111954  	}
111955  	_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
111956  		if _zErrMsg != nil {
111957  			return str(24531)
111958  		}
111959  		return nil
111960  	}(), unsafe.Pointer(_zErrMsg))
111961  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg))
111962  	_rc = _sqlite3ApiExit(tls, _db, _rc)
111963  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111964  	return _rc
111965  }
111966  
111967  // C comment
111968  //  /*
111969  //  ** This is a convenience routine that makes sure that all thread-specific
111970  //  ** data for this thread has been deallocated.
111971  //  **
111972  //  ** SQLite no longer uses thread-specific data so this routine is now a
111973  //  ** no-op.  It is retained for historical compatibility.
111974  //  */
111975  func Xsqlite3_thread_cleanup(tls *crt.TLS) {
111976  }
111977  
111978  // C comment
111979  //  /*
111980  //  ** Return the number of changes since the database handle was opened.
111981  //  */
111982  func Xsqlite3_total_changes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
111983  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111984  		_sqlite3MisuseError(tls, int32(141426))
111985  		return int32(0)
111986  	}
111987  	return _db.XnTotalChange
111988  }
111989  
111990  func Xsqlite3_trace(tls *crt.TLS, _db *Xsqlite3, _xTrace func(*crt.TLS, unsafe.Pointer, *int8), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
111991  	var _pOld unsafe.Pointer
111992  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111993  		_sqlite3MisuseError(tls, int32(142302))
111994  		return nil
111995  	}
111996  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111997  	_pOld = _db.XpTraceArg
111998  	_db.XmTrace = uint8(func() int32 {
111999  		if _xTrace != nil {
112000  			return int32(128)
112001  		}
112002  		return int32(0)
112003  	}())
112004  	_db.XxTrace = func() func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32 {
112005  		v := _xTrace
112006  		return *(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&v))
112007  	}()
112008  	_db.XpTraceArg = _pArg
112009  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112010  	return _pOld
112011  }
112012  
112013  // C comment
112014  //  /*
112015  //  ** Deprecated external interface.  Internal/core SQLite code
112016  //  ** should call sqlite3TransferBindings.
112017  //  **
112018  //  ** It is misuse to call this routine with statements from different
112019  //  ** database connections.  But as this is a deprecated interface, we
112020  //  ** will not bother to check for that condition.
112021  //  **
112022  //  ** If the two statements contain a different number of bindings, then
112023  //  ** an SQLITE_ERROR is returned.  Nothing else can go wrong, so otherwise
112024  //  ** SQLITE_OK is returned.
112025  //  */
112026  func Xsqlite3_transfer_bindings(tls *crt.TLS, _pFromStmt unsafe.Pointer, _pToStmt unsafe.Pointer) (r0 int32) {
112027  	var _pFrom, _pTo *TVdbe
112028  	_pFrom = (*TVdbe)(_pFromStmt)
112029  	_pTo = (*TVdbe)(_pToStmt)
112030  	if int32(_pFrom.XnVar) != int32(_pTo.XnVar) {
112031  		return int32(1)
112032  	}
112033  	func() {
112034  		if ((uint32(_pTo.Xexpired>>9)<<31)>>31) == 0 && _pTo.Xexpmask != (0) {
112035  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77636), unsafe.Pointer(&_sqlite3_transfer_bindingsØ00__func__Ø000), unsafe.Pointer(str(128379)))
112036  			crt.X__builtin_abort(tls)
112037  		}
112038  	}()
112039  	if _pTo.Xexpmask != 0 {
112040  		storebits26(&_pTo.Xexpired, int16(1), 1, 0)
112041  	}
112042  	func() {
112043  		if ((uint32(_pFrom.Xexpired>>9)<<31)>>31) == 0 && _pFrom.Xexpmask != (0) {
112044  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77640), unsafe.Pointer(&_sqlite3_transfer_bindingsØ00__func__Ø000), unsafe.Pointer(str(128415)))
112045  			crt.X__builtin_abort(tls)
112046  		}
112047  	}()
112048  	if _pFrom.Xexpmask != 0 {
112049  		storebits26(&_pFrom.Xexpired, int16(1), 1, 0)
112050  	}
112051  	return _sqlite3TransferBindings(tls, _pFromStmt, _pToStmt)
112052  }
112053  
112054  var _sqlite3_transfer_bindingsØ00__func__Ø000 [26]int8
112055  
112056  func init() {
112057  	crt.Xstrncpy(nil, &_sqlite3_transfer_bindingsØ00__func__Ø000[0], str(128455), 26)
112058  }
112059  
112060  // C comment
112061  //  /*
112062  //  ** Register a callback to be invoked each time a row is updated,
112063  //  ** inserted or deleted using this database connection.
112064  //  */
112065  func Xsqlite3_update_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
112066  	var _pRet unsafe.Pointer
112067  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
112068  		_sqlite3MisuseError(tls, int32(142410))
112069  		return nil
112070  	}
112071  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112072  	_pRet = _db.XpUpdateArg
112073  	_db.XxUpdateCallback = _xCallback
112074  	_db.XpUpdateArg = _pArg
112075  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112076  	return _pRet
112077  }
112078  
112079  // C comment
112080  //  /*
112081  //  ** Try to convert the type of a function argument or a result column
112082  //  ** into a numeric representation.  Use either INTEGER or REAL whichever
112083  //  ** is appropriate.  But only do the conversion if it is possible without
112084  //  ** loss of information and return the revised type of the argument.
112085  //  */
112086  func Xsqlite3_value_numeric_type(tls *crt.TLS, _pVal *XMem) (r0 int32) {
112087  	var _eType int32
112088  	var _1_pMem *XMem
112089  	_eType = Xsqlite3_value_type(tls, _pVal)
112090  	if _eType == int32(3) {
112091  		_1_pMem = _pVal
112092  		_applyNumericAffinity(tls, _1_pMem, int32(0))
112093  		_eType = Xsqlite3_value_type(tls, _pVal)
112094  	}
112095  	return _eType
112096  }
112097  
112098  func Xsqlite3_value_text16be(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
112099  	return _sqlite3ValueText(tls, _pVal, uint8(3))
112100  }
112101  
112102  func Xsqlite3_value_text16le(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
112103  	return _sqlite3ValueText(tls, _pVal, uint8(2))
112104  }
112105  
112106  func Xsqlite3_prepare16_v2(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) {
112107  	var _rc int32
112108  	_rc = _sqlite3Prepare16(tls, _db, _zSql, _nBytes, int32(1), _ppStmt, _pzTail)
112109  	func() {
112110  		if _rc != int32(0) && _ppStmt != nil && (*_ppStmt) != nil {
112111  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116514), unsafe.Pointer(&_sqlite3_prepare16_v2Ø00__func__Ø000), unsafe.Pointer(str(50419)))
112112  			crt.X__builtin_abort(tls)
112113  		}
112114  	}()
112115  	return _rc
112116  }
112117  
112118  var _sqlite3_prepare16_v2Ø00__func__Ø000 [21]int8
112119  
112120  func init() {
112121  	crt.Xstrncpy(nil, &_sqlite3_prepare16_v2Ø00__func__Ø000[0], str(128481), 21)
112122  }
112123  
112124  // C comment
112125  //  /*
112126  //  ** Set all the parameters in the compiled SQL statement to NULL.
112127  //  */
112128  func Xsqlite3_clear_bindings(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
112129  	var _i, _rc int32
112130  	var _mutex *Xsqlite3_mutex
112131  	var _p *TVdbe
112132  	_rc = int32(0)
112133  	_p = (*TVdbe)(_pStmt)
112134  	_mutex = (*Xsqlite3_mutex)((*Xsqlite3)((*TVdbe)(_pStmt).Xdb).Xmutex)
112135  	Xsqlite3_mutex_enter(tls, _mutex)
112136  	_i = int32(0)
112137  _0:
112138  	if _i >= int32(_p.XnVar) {
112139  		goto _3
112140  	}
112141  	_sqlite3VdbeMemRelease(tls, elem25((*XMem)(_p.XaVar), uintptr(_i)))
112142  	elem25((*XMem)(_p.XaVar), uintptr(_i)).Xflags = uint16(1)
112143  	_i += 1
112144  	goto _0
112145  _3:
112146  	func() {
112147  		if ((uint32(_p.Xexpired>>9)<<31)>>31) == 0 && _p.Xexpmask != (0) {
112148  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76253), unsafe.Pointer(&_sqlite3_clear_bindingsØ00__func__Ø000), unsafe.Pointer(str(8315)))
112149  			crt.X__builtin_abort(tls)
112150  		}
112151  	}()
112152  	if _p.Xexpmask != 0 {
112153  		storebits26(&_p.Xexpired, int16(1), 1, 0)
112154  	}
112155  	Xsqlite3_mutex_leave(tls, _mutex)
112156  	return _rc
112157  }
112158  
112159  var _sqlite3_clear_bindingsØ00__func__Ø000 [23]int8
112160  
112161  func init() {
112162  	crt.Xstrncpy(nil, &_sqlite3_clear_bindingsØ00__func__Ø000[0], str(128502), 23)
112163  }
112164  
112165  // C comment
112166  //  /*
112167  //  ** External API function used to create a new virtual-table module.
112168  //  */
112169  func Xsqlite3_create_module_v2(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
112170  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
112171  		return _sqlite3MisuseError(tls, int32(125106))
112172  	}
112173  	return _createModule(tls, _db, _zName, _pModule, _pAux, _xDestroy)
112174  }
112175  
112176  // C comment
112177  //  /*
112178  //  ** Query a blob handle for the size of the data.
112179  //  **
112180  //  ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
112181  //  ** so no mutex is required for access.
112182  //  */
112183  func Xsqlite3_blob_bytes(tls *crt.TLS, _pBlob unsafe.Pointer) (r0 int32) {
112184  	var _p *XIncrblob
112185  	_p = (*XIncrblob)(_pBlob)
112186  	return func() int32 {
112187  		if (_p != nil) && (_p.XpStmt != nil) {
112188  			return _p.XnByte
112189  		}
112190  		return int32(0)
112191  	}()
112192  }
112193  
112194  // C comment
112195  //  /*
112196  //  ** Close a blob handle that was previously created using
112197  //  ** sqlite3_blob_open().
112198  //  */
112199  func Xsqlite3_blob_close(tls *crt.TLS, _pBlob unsafe.Pointer) (r0 int32) {
112200  	var _rc int32
112201  	var _db *Xsqlite3
112202  	var _p *XIncrblob
112203  	_p = (*XIncrblob)(_pBlob)
112204  	if _p != nil {
112205  		_db = (*Xsqlite3)(_p.Xdb)
112206  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112207  		_rc = Xsqlite3_finalize(tls, _p.XpStmt)
112208  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p))
112209  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112210  		goto _1
112211  	}
112212  	_rc = int32(0)
112213  _1:
112214  	return _rc
112215  }
112216  
112217  // C comment
112218  //  /*
112219  //  ** Open a blob handle.
112220  //  */
112221  func Xsqlite3_blob_open(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _zTable *int8, _zColumn *int8, _iRow int64, _wrFlag int32, _ppBlob *unsafe.Pointer) (r0 int32) {
112222  	var _nAttempt, _iCol, _rc, _14_j, _17_j, _21_iDb int32
112223  	var _zErr, _12_zFault *int8
112224  	var _pTab *XTable
112225  	var _21_v *TVdbe
112226  	var _pParse *XParse
112227  	var _12_pIdx *XIndex
112228  	var _21_aOp *XVdbeOp
112229  	var _pBlob *XIncrblob
112230  	var _13_pFKey *XFKey
112231  	_nAttempt = int32(0)
112232  	_rc = int32(0)
112233  	_zErr = nil
112234  	_pParse = nil
112235  	_pBlob = nil
112236  	if _ppBlob == nil {
112237  		return _sqlite3MisuseError(tls, int32(85639))
112238  	}
112239  	*_ppBlob = nil
112240  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zTable == nil) {
112241  		return _sqlite3MisuseError(tls, int32(85645))
112242  	}
112243  	_wrFlag = bool2int(_wrFlag != 0)
112244  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112245  	_pBlob = (*XIncrblob)(_sqlite3DbMallocZero(tls, _db, uint64(56)))
112246  	if _pBlob == nil {
112247  		goto _blob_open_out
112248  	}
112249  	_pParse = (*XParse)(_sqlite3DbMallocRaw(tls, _db, uint64(600)))
112250  	if _pParse == nil {
112251  		goto _blob_open_out
112252  	}
112253  _4:
112254  	crt.Xmemset(tls, unsafe.Pointer(_pParse), int32(0), uint64(600))
112255  	*(**Xsqlite3)(unsafe.Pointer(&_pParse.Xdb)) = _db
112256  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
112257  	_zErr = nil
112258  	_sqlite3BtreeEnterAll(tls, _db)
112259  	_pTab = _sqlite3LocateTable(tls, _pParse, 0, _zTable, _zDb)
112260  	if (_pTab != nil) && _pTab.XnModuleArg != 0 {
112261  		_pTab = nil
112262  		_sqlite3ErrorMsg(tls, _pParse, str(128525), unsafe.Pointer(_zTable))
112263  	}
112264  	if (_pTab != nil) && ((_pTab.XtabFlags & uint32(32)) != (0)) {
112265  		_pTab = nil
112266  		_sqlite3ErrorMsg(tls, _pParse, str(128555), unsafe.Pointer(_zTable))
112267  	}
112268  	if (_pTab != nil) && (_pTab.XpSelect != nil) {
112269  		_pTab = nil
112270  		_sqlite3ErrorMsg(tls, _pParse, str(128591), unsafe.Pointer(_zTable))
112271  	}
112272  	if _pTab != nil {
112273  		goto _12
112274  	}
112275  	if _pParse.XzErrMsg != nil {
112276  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
112277  		_zErr = _pParse.XzErrMsg
112278  		_pParse.XzErrMsg = nil
112279  	}
112280  	_rc = int32(1)
112281  	_sqlite3BtreeLeaveAll(tls, _db)
112282  	goto _blob_open_out
112283  _12:
112284  	*(**XTable)(unsafe.Pointer(&_pBlob.XpTab)) = _pTab
112285  	_pBlob.XzDb = elem27((*XDb)(_db.XaDb), uintptr(_sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema)))).XzDbSName
112286  	_iCol = int32(0)
112287  _14:
112288  	if _iCol >= int32(_pTab.XnCol) {
112289  		goto _17
112290  	}
112291  	if _sqlite3StrICmp(tls, elem43((*XColumn)(_pTab.XaCol), uintptr(_iCol)).XzName, _zColumn) == int32(0) {
112292  		goto _17
112293  	}
112294  	_iCol += 1
112295  	goto _14
112296  _17:
112297  	if _iCol == int32(_pTab.XnCol) {
112298  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
112299  		_zErr = _sqlite3MPrintf(tls, _db, str(128612), unsafe.Pointer(_zColumn))
112300  		_rc = int32(1)
112301  		_sqlite3BtreeLeaveAll(tls, _db)
112302  		goto _blob_open_out
112303  	}
112304  	if _wrFlag == 0 {
112305  		goto _20
112306  	}
112307  	_12_zFault = nil
112308  	if (_db.Xflags & int32(524288)) == 0 {
112309  		goto _21
112310  	}
112311  	_13_pFKey = (*XFKey)(_pTab.XpFKey)
112312  _22:
112313  	if _13_pFKey == nil {
112314  		goto _25
112315  	}
112316  	_14_j = int32(0)
112317  _26:
112318  	if _14_j >= _13_pFKey.XnCol {
112319  		goto _29
112320  	}
112321  	if (elem117((*t118)(unsafe.Pointer(&_13_pFKey.XaCol)), uintptr(_14_j)).XiFrom) == _iCol {
112322  		_12_zFault = str(128633)
112323  	}
112324  	_14_j += 1
112325  	goto _26
112326  _29:
112327  	_13_pFKey = (*XFKey)(_13_pFKey.XpNextFrom)
112328  	goto _22
112329  _25:
112330  _21:
112331  	_12_pIdx = (*XIndex)(_pTab.XpIndex)
112332  _31:
112333  	if _12_pIdx == nil {
112334  		goto _34
112335  	}
112336  	_17_j = int32(0)
112337  _35:
112338  	if _17_j >= int32(_12_pIdx.XnKeyCol) {
112339  		goto _38
112340  	}
112341  	if (int32(*elem52(_12_pIdx.XaiColumn, uintptr(_17_j))) == _iCol) || (int32(*elem52(_12_pIdx.XaiColumn, uintptr(_17_j))) == int32(-2)) {
112342  		_12_zFault = str(128645)
112343  	}
112344  	_17_j += 1
112345  	goto _35
112346  _38:
112347  	_12_pIdx = (*XIndex)(_12_pIdx.XpNext)
112348  	goto _31
112349  _34:
112350  	if _12_zFault != nil {
112351  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
112352  		_zErr = _sqlite3MPrintf(tls, _db, str(128653), unsafe.Pointer(_12_zFault))
112353  		_rc = int32(1)
112354  		_sqlite3BtreeLeaveAll(tls, _db)
112355  		goto _blob_open_out
112356  	}
112357  _20:
112358  	_pBlob.XpStmt = unsafe.Pointer(_sqlite3VdbeCreate(tls, _pParse))
112359  	func() {
112360  		if _pBlob.XpStmt == nil && _db.XmallocFailed == 0 {
112361  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85748), unsafe.Pointer(&_sqlite3_blob_openØ00__func__Ø000), unsafe.Pointer(str(128687)))
112362  			crt.X__builtin_abort(tls)
112363  		}
112364  	}()
112365  	if _pBlob.XpStmt == nil {
112366  		goto _45
112367  	}
112368  	_21_v = (*TVdbe)(_pBlob.XpStmt)
112369  	_21_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
112370  	_sqlite3VdbeAddOp4Int(tls, _21_v, int32(2), _21_iDb, _wrFlag, (*XSchema)(_pTab.XpSchema).Xschema_cookie, (*XSchema)(_pTab.XpSchema).XiGeneration)
112371  	_sqlite3VdbeChangeP5(tls, _21_v, uint16(1))
112372  	_21_aOp = _sqlite3VdbeAddOpList(tls, _21_v, int32(6), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3_blob_openØ00openBlobØ002)), _sqlite3_blob_openØ00iLnØ001)
112373  	_sqlite3VdbeUsesBtree(tls, _21_v, _21_iDb)
112374  	if int32(_db.XmallocFailed) == int32(0) {
112375  		func() {
112376  			if _21_aOp == nil {
112377  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85790), unsafe.Pointer(&_sqlite3_blob_openØ00__func__Ø000), unsafe.Pointer(str(128720)))
112378  				crt.X__builtin_abort(tls)
112379  			}
112380  		}()
112381  		elem63(_21_aOp, 0).Xp1 = _21_iDb
112382  		elem63(_21_aOp, 0).Xp2 = _pTab.Xtnum
112383  		elem63(_21_aOp, 0).Xp3 = _wrFlag
112384  		_sqlite3VdbeChangeP4(tls, _21_v, int32(1), _pTab.XzName, int32(0))
112385  	}
112386  	if int32(_db.XmallocFailed) != int32(0) {
112387  		goto _49
112388  	}
112389  	if _wrFlag != 0 {
112390  		elem63(_21_aOp, uintptr(1)).Xopcode = uint8(107)
112391  	}
112392  	elem63(_21_aOp, uintptr(1)).Xp2 = _pTab.Xtnum
112393  	elem63(_21_aOp, uintptr(1)).Xp3 = _21_iDb
112394  	elem63(_21_aOp, uintptr(1)).Xp4type = int8(-11)
112395  	*(*int32)(unsafe.Pointer(&(elem63(_21_aOp, uintptr(1)).Xp4))) = int32(_pTab.XnCol) + int32(1)
112396  	elem63(_21_aOp, uintptr(3)).Xp2 = int32(_pTab.XnCol)
112397  	_pParse.XnVar = 0
112398  	_pParse.XnMem = int32(1)
112399  	_pParse.XnTab = int32(1)
112400  	_sqlite3VdbeMakeReady(tls, _21_v, _pParse)
112401  _49:
112402  _45:
112403  	_pBlob.XiCol = uint16(_iCol)
112404  	*(**Xsqlite3)(unsafe.Pointer(&_pBlob.Xdb)) = _db
112405  	_sqlite3BtreeLeaveAll(tls, _db)
112406  	if _db.XmallocFailed != 0 {
112407  		goto _blob_open_out
112408  	}
112409  	_rc = _blobSeekToRow(tls, _pBlob, _iRow, &_zErr)
112410  	if (preInc2(&_nAttempt, 1) < int32(50)) && (_rc == int32(17)) {
112411  		goto _4
112412  	}
112413  _blob_open_out:
112414  	if (_rc == int32(0)) && (int32(_db.XmallocFailed) == int32(0)) {
112415  		*_ppBlob = unsafe.Pointer(_pBlob)
112416  		goto _55
112417  	}
112418  	if (_pBlob != nil) && (_pBlob.XpStmt != nil) {
112419  		_sqlite3VdbeFinalize(tls, (*TVdbe)(_pBlob.XpStmt))
112420  	}
112421  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pBlob))
112422  _55:
112423  	_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
112424  		if _zErr != nil {
112425  			return str(24531)
112426  		}
112427  		return nil
112428  	}(), unsafe.Pointer(_zErr))
112429  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
112430  	_sqlite3ParserReset(tls, _pParse)
112431  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse))
112432  	_rc = _sqlite3ApiExit(tls, _db, _rc)
112433  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112434  	return _rc
112435  
112436  	_ = _nAttempt
112437  	panic(0)
112438  }
112439  
112440  var _sqlite3_blob_openØ00__func__Ø000 [18]int8
112441  
112442  func init() {
112443  	crt.Xstrncpy(nil, &_sqlite3_blob_openØ00__func__Ø000[0], str(128727), 18)
112444  }
112445  
112446  var _sqlite3_blob_openØ00openBlobØ002 [6]XVdbeOpList
112447  
112448  func init() {
112449  	_sqlite3_blob_openØ00openBlobØ002 = [6]XVdbeOpList{XVdbeOpList{Xopcode: uint8(154)}, XVdbeOpList{Xopcode: uint8(106)}, XVdbeOpList{Xopcode: uint8(32), Xp2: int8(5), Xp3: int8(1)}, XVdbeOpList{Xopcode: uint8(99), Xp3: int8(1)}, XVdbeOpList{Xopcode: uint8(67), Xp1: int8(1)}, XVdbeOpList{Xopcode: uint8(55)}}
112450  }
112451  
112452  var _sqlite3_blob_openØ00iLnØ001 int32
112453  
112454  // C comment
112455  //  /*
112456  //  ** This function is used by both blob_open() and blob_reopen(). It seeks
112457  //  ** the b-tree cursor associated with blob handle p to point to row iRow.
112458  //  ** If successful, SQLITE_OK is returned and subsequent calls to
112459  //  ** sqlite3_blob_read() or sqlite3_blob_write() access the specified row.
112460  //  **
112461  //  ** If an error occurs, or if the specified row does not exist or does not
112462  //  ** contain a value of type TEXT or BLOB in the column nominated when the
112463  //  ** blob handle was opened, then an error code is returned and *pzErr may
112464  //  ** be set to point to a buffer containing an error message. It is the
112465  //  ** responsibility of the caller to free the error message buffer using
112466  //  ** sqlite3DbFree().
112467  //  **
112468  //  ** If an error does occur, then the b-tree cursor is closed. All subsequent
112469  //  ** calls to sqlite3_blob_read(), blob_write() or blob_reopen() will
112470  //  ** immediately return SQLITE_ABORT.
112471  //  */
112472  func _blobSeekToRow(tls *crt.TLS, _p *XIncrblob, _iRow int64, _pzErr **int8) (r0 int32) {
112473  	var _rc int32
112474  	var _3_type uint32
112475  	var _zErr *int8
112476  	var _v *TVdbe
112477  	var _3_pC *XVdbeCursor
112478  	_zErr = nil
112479  	_v = (*TVdbe)(_p.XpStmt)
112480  	elem25((*XMem)(_v.XaMem), uintptr(1)).Xflags = uint16(4)
112481  	*(*int64)(unsafe.Pointer(&(elem25((*XMem)(_v.XaMem), uintptr(1)).Xu))) = _iRow
112482  	if _v.Xpc > int32(3) {
112483  		_v.Xpc = int32(3)
112484  		_rc = _sqlite3VdbeExec(tls, _v)
112485  		goto _1
112486  	}
112487  	_rc = Xsqlite3_step(tls, _p.XpStmt)
112488  _1:
112489  	if _rc != int32(100) {
112490  		goto _2
112491  	}
112492  	_3_pC = *elem79((**XVdbeCursor)(unsafe.Pointer(_v.XapCsr)), 0)
112493  	_3_type = func() uint32 {
112494  		if int32(_3_pC.XnHdrParsed) > int32(_p.XiCol) {
112495  			return (*elem31((*uint32)(unsafe.Pointer(&_3_pC.XaType)), uintptr(_p.XiCol)))
112496  		}
112497  		return (0)
112498  	}()
112499  	if _3_type < uint32(12) {
112500  		_zErr = _sqlite3MPrintf(tls, (*Xsqlite3)(_p.Xdb), str(128745), unsafe.Pointer(func() *int8 {
112501  			if _3_type == (0) {
112502  				return str(128774)
112503  			}
112504  			return func() *int8 {
112505  				if _3_type == uint32(7) {
112506  					return str(42838)
112507  				}
112508  				return str(42830)
112509  			}()
112510  		}()))
112511  		_rc = int32(1)
112512  		Xsqlite3_finalize(tls, _p.XpStmt)
112513  		_p.XpStmt = nil
112514  		goto _10
112515  	}
112516  	_p.XiOffset = int32(*elem31((*uint32)(unsafe.Pointer(&_3_pC.XaType)), uintptr(int32(_p.XiCol)+int32(_3_pC.XnField))))
112517  	_p.XnByte = int32(_sqlite3VdbeSerialTypeLen(tls, _3_type))
112518  	*(**XBtCursor)(unsafe.Pointer(&_p.XpCsr)) = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_3_pC.Xuc)))
112519  	_sqlite3BtreeIncrblobCursor(tls, (*XBtCursor)(_p.XpCsr))
112520  _10:
112521  _2:
112522  	if _rc == int32(100) {
112523  		_rc = int32(0)
112524  		goto _13
112525  	}
112526  	if _p.XpStmt == nil {
112527  		goto _13
112528  	}
112529  	_rc = Xsqlite3_finalize(tls, _p.XpStmt)
112530  	_p.XpStmt = nil
112531  	if _rc == int32(0) {
112532  		_zErr = _sqlite3MPrintf(tls, (*Xsqlite3)(_p.Xdb), str(128779), _iRow)
112533  		_rc = int32(1)
112534  		goto _15
112535  	}
112536  	_zErr = _sqlite3MPrintf(tls, (*Xsqlite3)(_p.Xdb), str(24531), unsafe.Pointer(Xsqlite3_errmsg(tls, (*Xsqlite3)(_p.Xdb))))
112537  _15:
112538  _13:
112539  	func() {
112540  		if _rc == int32(0) && _zErr != nil {
112541  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85610), unsafe.Pointer(&_blobSeekToRowØ00__func__Ø000), unsafe.Pointer(str(128799)))
112542  			crt.X__builtin_abort(tls)
112543  		}
112544  	}()
112545  	func() {
112546  		if _rc == int32(100) || _rc == int32(101) {
112547  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85611), unsafe.Pointer(&_blobSeekToRowØ00__func__Ø000), unsafe.Pointer(str(128824)))
112548  			crt.X__builtin_abort(tls)
112549  		}
112550  	}()
112551  	*_pzErr = _zErr
112552  	return _rc
112553  }
112554  
112555  // C comment
112556  //  /*
112557  //  ** Mark this cursor as an incremental blob cursor.
112558  //  */
112559  func _sqlite3BtreeIncrblobCursor(tls *crt.TLS, _pCur *XBtCursor) {
112560  	{
112561  		p := &_pCur.XcurFlags
112562  		*p = uint8(int32(*p) | int32(16))
112563  	}
112564  	(*XBtree)(_pCur.XpBtree).XhasIncrblobCur = uint8(1)
112565  }
112566  
112567  var _blobSeekToRowØ00__func__Ø000 [14]int8
112568  
112569  func init() {
112570  	crt.Xstrncpy(nil, &_blobSeekToRowØ00__func__Ø000[0], str(128858), 14)
112571  }
112572  
112573  // C comment
112574  //  /*
112575  //  ** Read data from a blob handle.
112576  //  */
112577  func Xsqlite3_blob_read(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32) (r0 int32) {
112578  	return _blobReadWrite(tls, _pBlob, _z, _n, _iOffset, _sqlite3BtreePayloadChecked)
112579  }
112580  
112581  // C comment
112582  //  /*
112583  //  ** Perform a read or write operation on a blob
112584  //  */
112585  func _blobReadWrite(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32, _xCall func(*crt.TLS, *XBtCursor, uint32, uint32, unsafe.Pointer) int32) (r0 int32) {
112586  	var _rc int32
112587  	var _db *Xsqlite3
112588  	var _v *TVdbe
112589  	var _p *XIncrblob
112590  	_p = (*XIncrblob)(_pBlob)
112591  	if _p == nil {
112592  		return _sqlite3MisuseError(tls, int32(85888))
112593  	}
112594  	_db = (*Xsqlite3)(_p.Xdb)
112595  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112596  	_v = (*TVdbe)(_p.XpStmt)
112597  	if ((_n < int32(0)) || (_iOffset < int32(0))) || ((int64(_iOffset) + int64(_n)) > int64(_p.XnByte)) {
112598  		_rc = int32(1)
112599  		goto _6
112600  	}
112601  	if _v == nil {
112602  		_rc = int32(4)
112603  		goto _6
112604  	}
112605  	func() {
112606  		if _db != (*Xsqlite3)(_v.Xdb) {
112607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85905), unsafe.Pointer(&_blobReadWriteØ00__func__Ø000), unsafe.Pointer(str(128872)))
112608  			crt.X__builtin_abort(tls)
112609  		}
112610  	}()
112611  	_sqlite3BtreeEnterCursor(tls, (*XBtCursor)(_p.XpCsr))
112612  	_rc = _xCall(tls, (*XBtCursor)(_p.XpCsr), uint32(_iOffset+_p.XiOffset), uint32(_n), _z)
112613  	_sqlite3BtreeLeaveCursor(tls, (*XBtCursor)(_p.XpCsr))
112614  	if _rc == int32(4) {
112615  		_sqlite3VdbeFinalize(tls, _v)
112616  		_p.XpStmt = nil
112617  		goto _10
112618  	}
112619  	_v.Xrc = _rc
112620  _10:
112621  _6:
112622  	_sqlite3Error(tls, _db, _rc)
112623  	_rc = _sqlite3ApiExit(tls, _db, _rc)
112624  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112625  	return _rc
112626  }
112627  
112628  var _blobReadWriteØ00__func__Ø000 [14]int8
112629  
112630  func init() {
112631  	crt.Xstrncpy(nil, &_blobReadWriteØ00__func__Ø000[0], str(128884), 14)
112632  }
112633  
112634  // C comment
112635  //  /*
112636  //  ** Enter a mutex on a Btree given a cursor owned by that Btree.
112637  //  **
112638  //  ** These entry points are used by incremental I/O only. Enter() is required
112639  //  ** any time OMIT_SHARED_CACHE is not defined, regardless of whether or not
112640  //  ** the build is threadsafe. Leave() is only required by threadsafe builds.
112641  //  */
112642  func _sqlite3BtreeEnterCursor(tls *crt.TLS, _pCur *XBtCursor) {
112643  	_sqlite3BtreeEnter(tls, (*XBtree)(_pCur.XpBtree))
112644  }
112645  
112646  func _sqlite3BtreeLeaveCursor(tls *crt.TLS, _pCur *XBtCursor) {
112647  	_sqlite3BtreeLeave(tls, (*XBtree)(_pCur.XpBtree))
112648  }
112649  
112650  func _sqlite3BtreePayloadChecked(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf unsafe.Pointer) (r0 int32) {
112651  	if int32(_pCur.XeState) == int32(1) {
112652  		func() {
112653  			if _cursorOwnsBtShared(tls, _pCur) == 0 {
112654  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63784), unsafe.Pointer(&_sqlite3BtreePayloadCheckedØ00__func__Ø000), unsafe.Pointer(str(71986)))
112655  				crt.X__builtin_abort(tls)
112656  			}
112657  		}()
112658  		return _accessPayload(tls, _pCur, _offset, _amt, (*uint8)(_pBuf), int32(0))
112659  	}
112660  	return _accessPayloadChecked(tls, _pCur, _offset, _amt, _pBuf)
112661  }
112662  
112663  var _sqlite3BtreePayloadCheckedØ00__func__Ø000 [27]int8
112664  
112665  func init() {
112666  	crt.Xstrncpy(nil, &_sqlite3BtreePayloadCheckedØ00__func__Ø000[0], str(128898), 27)
112667  }
112668  
112669  func _accessPayloadChecked(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf unsafe.Pointer) (r0 int32) {
112670  	var _rc int32
112671  	if int32(_pCur.XeState) == int32(0) {
112672  		return int32(4)
112673  	}
112674  	func() {
112675  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
112676  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63778), unsafe.Pointer(&_accessPayloadCheckedØ00__func__Ø000), unsafe.Pointer(str(71986)))
112677  			crt.X__builtin_abort(tls)
112678  		}
112679  	}()
112680  	_rc = _btreeRestoreCursorPosition(tls, _pCur)
112681  	return func() int32 {
112682  		if _rc != 0 {
112683  			return _rc
112684  		}
112685  		return _accessPayload(tls, _pCur, _offset, _amt, (*uint8)(_pBuf), int32(0))
112686  	}()
112687  }
112688  
112689  var _accessPayloadCheckedØ00__func__Ø000 [21]int8
112690  
112691  func init() {
112692  	crt.Xstrncpy(nil, &_accessPayloadCheckedØ00__func__Ø000[0], str(128925), 21)
112693  }
112694  
112695  // C comment
112696  //  /*
112697  //  ** Write data to a blob handle.
112698  //  */
112699  func Xsqlite3_blob_write(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32) (r0 int32) {
112700  	return _blobReadWrite(tls, _pBlob, _z, _n, _iOffset, _sqlite3BtreePutData)
112701  }
112702  
112703  // C comment
112704  //  /*
112705  //  ** Argument pCsr must be a cursor opened for writing on an
112706  //  ** INTKEY table currently pointing at a valid table entry.
112707  //  ** This function modifies the data stored as part of that entry.
112708  //  **
112709  //  ** Only the data content may only be modified, it is not possible to
112710  //  ** change the length of the data stored. If this function is called with
112711  //  ** parameters that attempt to write past the end of the existing data,
112712  //  ** no modifications are made and SQLITE_CORRUPT is returned.
112713  //  */
112714  func _sqlite3BtreePutData(tls *crt.TLS, _pCsr *XBtCursor, _offset uint32, _amt uint32, _z unsafe.Pointer) (r0 int32) {
112715  	var _rc int32
112716  	func() {
112717  		if _cursorOwnsBtShared(tls, _pCsr) == 0 {
112718  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68770), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(128946)))
112719  			crt.X__builtin_abort(tls)
112720  		}
112721  	}()
112722  	func() {
112723  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCsr.XpBtree).Xdb).Xmutex)) == 0 {
112724  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68771), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(128971)))
112725  			crt.X__builtin_abort(tls)
112726  		}
112727  	}()
112728  	func() {
112729  		if (int32(_pCsr.XcurFlags) & int32(16)) == 0 {
112730  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68772), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129015)))
112731  			crt.X__builtin_abort(tls)
112732  		}
112733  	}()
112734  	_rc = func() int32 {
112735  		if int32(_pCsr.XeState) >= int32(3) {
112736  			return _btreeRestoreCursorPosition(tls, _pCsr)
112737  		}
112738  		return int32(0)
112739  	}()
112740  	if _rc != int32(0) {
112741  		return _rc
112742  	}
112743  	func() {
112744  		if int32(_pCsr.XeState) == int32(3) {
112745  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68778), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129046)))
112746  			crt.X__builtin_abort(tls)
112747  		}
112748  	}()
112749  	if int32(_pCsr.XeState) != int32(1) {
112750  		return int32(4)
112751  	}
112752  	_rc = _saveAllCursors(tls, (*XBtShared)(_pCsr.XpBt), _pCsr.XpgnoRoot, _pCsr)
112753  	func() {
112754  		if _rc != int32(0) {
112755  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68792), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(14967)))
112756  			crt.X__builtin_abort(tls)
112757  		}
112758  	}()
112759  	if (int32(_pCsr.XcurFlags) & int32(1)) == int32(0) {
112760  		return int32(8)
112761  	}
112762  	func() {
112763  		if (int32((*XBtShared)(_pCsr.XpBt).XbtsFlags)&int32(1)) != int32(0) || int32((*XBtShared)(_pCsr.XpBt).XinTransaction) != int32(2) {
112764  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68804), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129079)))
112765  			crt.X__builtin_abort(tls)
112766  		}
112767  	}()
112768  	func() {
112769  		if _hasSharedCacheTableLock(tls, (*XBtree)(_pCsr.XpBtree), _pCsr.XpgnoRoot, int32(0), int32(2)) == 0 {
112770  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68806), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129161)))
112771  			crt.X__builtin_abort(tls)
112772  		}
112773  	}()
112774  	func() {
112775  		if _hasReadConflicts(tls, (*XBtree)(_pCsr.XpBtree), _pCsr.XpgnoRoot) != 0 {
112776  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68807), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129221)))
112777  			crt.X__builtin_abort(tls)
112778  		}
112779  	}()
112780  	func() {
112781  		if ((*elem30((**XMemPage)(unsafe.Pointer(&_pCsr.XapPage)), uintptr(_pCsr.XiPage))).XintKey) == 0 {
112782  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68808), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129269)))
112783  			crt.X__builtin_abort(tls)
112784  		}
112785  	}()
112786  	return _accessPayload(tls, _pCsr, _offset, _amt, (*uint8)(_z), int32(1))
112787  }
112788  
112789  var _sqlite3BtreePutDataØ00__func__Ø000 [20]int8
112790  
112791  func init() {
112792  	crt.Xstrncpy(nil, &_sqlite3BtreePutDataØ00__func__Ø000[0], str(129303), 20)
112793  }
112794  
112795  // C comment
112796  //  /*
112797  //  ** Return the maximum amount of memory that has ever been
112798  //  ** checked out since either the beginning of this process
112799  //  ** or since the most recent reset.
112800  //  */
112801  func Xsqlite3_memory_highwater(tls *crt.TLS, _resetFlag int32) (r0 int64) {
112802  	var _res, _mx int64
112803  	Xsqlite3_status64(tls, int32(0), &_res, &_mx, _resetFlag)
112804  	return _mx
112805  }
112806  
112807  // C comment
112808  //  /*
112809  //  ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
112810  //  */
112811  func Xsqlite3_mutex_alloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) {
112812  	if (_id <= int32(1)) && Xsqlite3_initialize(tls) != 0 {
112813  		return nil
112814  	}
112815  	if (_id > int32(1)) && _sqlite3MutexInit(tls) != 0 {
112816  		return nil
112817  	}
112818  	func() {
112819  		if (_sqlite3Config.Xmutex.XxMutexAlloc) == nil {
112820  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22836), unsafe.Pointer(&_sqlite3_mutex_allocØ00__func__Ø000), unsafe.Pointer(str(2193)))
112821  			crt.X__builtin_abort(tls)
112822  		}
112823  	}()
112824  	return func() func(*crt.TLS, int32) *Xsqlite3_mutex {
112825  		v := _sqlite3Config.Xmutex.XxMutexAlloc
112826  		return *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&v))
112827  	}()(tls, _id)
112828  }
112829  
112830  var _sqlite3_mutex_allocØ00__func__Ø000 [20]int8
112831  
112832  func init() {
112833  	crt.Xstrncpy(nil, &_sqlite3_mutex_allocØ00__func__Ø000[0], str(129323), 20)
112834  }
112835  
112836  func Xsqlite3_open_v2(tls *crt.TLS, _filename *int8, _ppDb **Xsqlite3, _flags int32, _zVfs *int8) (r0 int32) {
112837  	return _openDatabase(tls, _filename, _ppDb, uint32(_flags), _zVfs)
112838  }
112839  
112840  // C comment
112841  //  /*
112842  //  ** Sleep for a little while.  Return the amount of time slept.
112843  //  */
112844  func Xsqlite3_sleep(tls *crt.TLS, _ms int32) (r0 int32) {
112845  	var _rc int32
112846  	var _pVfs *Xsqlite3_vfs
112847  	_pVfs = Xsqlite3_vfs_find(tls, nil)
112848  	if _pVfs == nil {
112849  		return int32(0)
112850  	}
112851  	_rc = _sqlite3OsSleep(tls, _pVfs, int32(1000)*_ms) / int32(1000)
112852  	return _rc
112853  }
112854  
112855  // C comment
112856  //  /*
112857  //  ** CAPI3REF: Deprecated Soft Heap Limit Interface
112858  //  ** DEPRECATED
112859  //  **
112860  //  ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
112861  //  ** interface.  This routine is provided for historical compatibility
112862  //  ** only.  All new applications should use the
112863  //  ** [sqlite3_soft_heap_limit64()] interface rather than this one.
112864  //  */
112865  func Xsqlite3_soft_heap_limit(tls *crt.TLS, _n int32) {
112866  	if _n < int32(0) {
112867  		_n = int32(0)
112868  	}
112869  	Xsqlite3_soft_heap_limit64(tls, int64(_n))
112870  }
112871  
112872  // C comment
112873  //  /*
112874  //  ** Register a VFS with the system.  It is harmless to register the same
112875  //  ** VFS multiple times.  The new VFS becomes the default if makeDflt is
112876  //  ** true.
112877  //  */
112878  func Xsqlite3_vfs_register(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _makeDflt int32) (r0 int32) {
112879  	var _rc int32
112880  	var _mutex *Xsqlite3_mutex
112881  	_rc = Xsqlite3_initialize(tls)
112882  	if _rc != 0 {
112883  		return _rc
112884  	}
112885  	if _pVfs == nil {
112886  		return _sqlite3MisuseError(tls, int32(20464))
112887  	}
112888  	_mutex = _sqlite3MutexAlloc(tls, int32(2))
112889  	Xsqlite3_mutex_enter(tls, _mutex)
112890  	_vfsUnlink(tls, _pVfs)
112891  	if _makeDflt != 0 || (_vfsList == nil) {
112892  		*(**Xsqlite3_vfs)(unsafe.Pointer(&_pVfs.XpNext)) = _vfsList
112893  		_vfsList = _pVfs
112894  		bug20530(_vfsList)
112895  		goto _4
112896  	}
112897  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_pVfs.XpNext)) = (*Xsqlite3_vfs)(_vfsList.XpNext)
112898  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_vfsList.XpNext)) = _pVfs
112899  _4:
112900  	func() {
112901  		if _vfsList == nil {
112902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20477), unsafe.Pointer(&_sqlite3_vfs_registerØ00__func__Ø000), unsafe.Pointer(str(129343)))
112903  			crt.X__builtin_abort(tls)
112904  		}
112905  	}()
112906  	Xsqlite3_mutex_leave(tls, _mutex)
112907  	return int32(0)
112908  }
112909  
112910  // C comment
112911  //  /*
112912  //  ** Unlink a VFS from the linked list
112913  //  */
112914  func _vfsUnlink(tls *crt.TLS, _pVfs *Xsqlite3_vfs) {
112915  	var _3_p *Xsqlite3_vfs
112916  	func() {
112917  		if Xsqlite3_mutex_held(tls, _sqlite3MutexAlloc(tls, int32(2))) == 0 {
112918  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20436), unsafe.Pointer(&_vfsUnlinkØ00__func__Ø000), unsafe.Pointer(str(129351)))
112919  			crt.X__builtin_abort(tls)
112920  		}
112921  	}()
112922  	if _pVfs == nil {
112923  		goto _6
112924  	}
112925  	if _vfsList == _pVfs {
112926  		_vfsList = (*Xsqlite3_vfs)(_pVfs.XpNext)
112927  		bug20530(_vfsList)
112928  		goto _6
112929  	}
112930  	if _vfsList == nil {
112931  		goto _6
112932  	}
112933  	_3_p = _vfsList
112934  _7:
112935  	if (_3_p.XpNext != nil) && ((*Xsqlite3_vfs)(_3_p.XpNext) != _pVfs) {
112936  		_3_p = (*Xsqlite3_vfs)(_3_p.XpNext)
112937  		goto _7
112938  	}
112939  	if (*Xsqlite3_vfs)(_3_p.XpNext) == _pVfs {
112940  		*(**Xsqlite3_vfs)(unsafe.Pointer(&_3_p.XpNext)) = (*Xsqlite3_vfs)(_pVfs.XpNext)
112941  	}
112942  _6:
112943  }
112944  
112945  var _vfsUnlinkØ00__func__Ø000 [10]int8
112946  
112947  func init() {
112948  	crt.Xstrncpy(nil, &_vfsUnlinkØ00__func__Ø000[0], str(129417), 10)
112949  }
112950  
112951  var _sqlite3_vfs_registerØ00__func__Ø000 [21]int8
112952  
112953  func init() {
112954  	crt.Xstrncpy(nil, &_sqlite3_vfs_registerØ00__func__Ø000[0], str(129427), 21)
112955  }
112956  
112957  // C comment
112958  //  /*
112959  //  ** Unregister a VFS so that it is no longer accessible.
112960  //  */
112961  func Xsqlite3_vfs_unregister(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) {
112962  	var _mutex *Xsqlite3_mutex
112963  	_mutex = _sqlite3MutexAlloc(tls, int32(2))
112964  	Xsqlite3_mutex_enter(tls, _mutex)
112965  	_vfsUnlink(tls, _pVfs)
112966  	Xsqlite3_mutex_leave(tls, _mutex)
112967  	return int32(0)
112968  }
112969  
112970  // C comment
112971  //  /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
112972  //  ** zero if and only if SQLite was compiled with mutexing code omitted due to
112973  //  ** the SQLITE_THREADSAFE compile-time option being set to 0.
112974  //  */
112975  func Xsqlite3_threadsafe(tls *crt.TLS) (r0 int32) {
112976  	return int32(1)
112977  }
112978  
112979  func Xsqlite3_result_zeroblob(tls *crt.TLS, _pCtx *Xsqlite3_context, _n int32) {
112980  	func() {
112981  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
112982  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76541), unsafe.Pointer(&_sqlite3_result_zeroblobØ00__func__Ø000), unsafe.Pointer(str(6567)))
112983  			crt.X__builtin_abort(tls)
112984  		}
112985  	}()
112986  	_sqlite3VdbeMemSetZeroBlob(tls, (*XMem)(_pCtx.XpOut), _n)
112987  }
112988  
112989  var _sqlite3_result_zeroblobØ00__func__Ø000 [24]int8
112990  
112991  func init() {
112992  	crt.Xstrncpy(nil, &_sqlite3_result_zeroblobØ00__func__Ø000[0], str(129448), 24)
112993  }
112994  
112995  // C comment
112996  //  /*
112997  //  ** Interface to the testing logic.
112998  //  */
112999  func Xsqlite3_test_control(tls *crt.TLS, _op int32, args ...interface{}) (r0 int32) {
113000  	var _rc, _5_sz, _10_x, _11_x, _13_x, _15_n, _16_sz int32
113001  	var _9_newVal uint32
113002  	var _5_aProg *int32
113003  	var _15_zWord *int8
113004  	var _16_pFree unsafe.Pointer
113005  	var _16_ppNew *unsafe.Pointer
113006  	var _ap []interface{}
113007  	var _7_xBenignBegin, _7_xBenignEnd func(*crt.TLS)
113008  	var _13_db, _14_db, _21_db, _23_db *Xsqlite3
113009  	_rc = int32(0)
113010  	_ap = args
113011  	switch _op {
113012  	case int32(5):
113013  		goto _1
113014  	case int32(6):
113015  		goto _2
113016  	case int32(7):
113017  		goto _3
113018  	case int32(8):
113019  		goto _4
113020  	case int32(9):
113021  		goto _5
113022  	case int32(10):
113023  		goto _6
113024  	case int32(11):
113025  		goto _7
113026  	case int32(12):
113027  		goto _8
113028  	case int32(13):
113029  		goto _9
113030  	case int32(14):
113031  		goto _11
113032  	case int32(15):
113033  		goto _12
113034  	case int32(16):
113035  		goto _13
113036  	case int32(17):
113037  		goto _14
113038  	case int32(18):
113039  		goto _15
113040  	case int32(19):
113041  		goto _17
113042  	case int32(20):
113043  		goto _16
113044  	case int32(21):
113045  		goto _18
113046  	case int32(22):
113047  		goto _10
113048  	case int32(23):
113049  		goto _20
113050  	case int32(24):
113051  		goto _19
113052  	case int32(25):
113053  		goto _21
113054  	default:
113055  		goto _22
113056  	}
113057  
113058  _1:
113059  	_sqlite3PrngSaveState(tls)
113060  	goto _22
113061  _2:
113062  	_sqlite3PrngRestoreState(tls)
113063  	goto _22
113064  _3:
113065  	Xsqlite3_randomness(tls, int32(0), nil)
113066  	goto _22
113067  _4:
113068  	_5_sz = crt.VAInt32(&_ap)
113069  	_5_aProg = (*int32)(crt.VAPointer(&_ap))
113070  	_rc = _sqlite3BitvecBuiltinTest(tls, _5_sz, _5_aProg)
113071  	goto _22
113072  _5:
113073  	_sqlite3Config.XxTestCallback = crt.VAOther(&_ap).(func(*crt.TLS, int32) int32)
113074  	_rc = _sqlite3FaultSim(tls, int32(0))
113075  	goto _22
113076  _6:
113077  	_7_xBenignBegin = crt.VAOther(&_ap).(func(*crt.TLS))
113078  	_7_xBenignEnd = crt.VAOther(&_ap).(func(*crt.TLS))
113079  	_sqlite3BenignMallocHooks(tls, _7_xBenignBegin, _7_xBenignEnd)
113080  	goto _22
113081  _7:
113082  	_rc = _sqlite3PendingByte
113083  	_9_newVal = crt.VAUint32(&_ap)
113084  	if _9_newVal != 0 {
113085  		_sqlite3PendingByte = int32(_9_newVal)
113086  		bug20530(_sqlite3PendingByte)
113087  	}
113088  	goto _22
113089  _8:
113090  	_10_x = int32(0)
113091  	func() {
113092  		if store2(&_10_x, crt.VAInt32(&_ap)) == int32(0) {
113093  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(144147), unsafe.Pointer(&_sqlite3_test_controlØ00__func__Ø000), unsafe.Pointer(str(129472)))
113094  			crt.X__builtin_abort(tls)
113095  		}
113096  	}()
113097  	_rc = _10_x
113098  	goto _22
113099  _9:
113100  	_11_x = crt.VAInt32(&_ap)
113101  	_rc = func() int32 {
113102  		if _11_x != 0 {
113103  			return int32(1)
113104  		}
113105  		return func() int32 {
113106  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(144182), unsafe.Pointer(&_sqlite3_test_controlØ00__func__Ø000), unsafe.Pointer(str(4809)))
113107  			crt.X__builtin_abort(tls)
113108  			return int32(0)
113109  		}()
113110  	}()
113111  	goto _22
113112  _10:
113113  	_rc = int32(123410)
113114  	goto _22
113115  _11:
113116  	_13_db = (*Xsqlite3)(crt.VAPointer(&_ap))
113117  	_13_x = crt.VAInt32(&_ap)
113118  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_13_db.Xmutex))
113119  	_sqlite3BtreeSetPageSize(tls, (*XBtree)(elem27((*XDb)(_13_db.XaDb), 0).XpBt), int32(0), _13_x, int32(0))
113120  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_13_db.Xmutex))
113121  	goto _22
113122  _12:
113123  	_14_db = (*Xsqlite3)(crt.VAPointer(&_ap))
113124  	_14_db.XdbOptFlags = uint16(crt.VAInt32(&_ap) & int32(65535))
113125  	goto _22
113126  _13:
113127  	_15_zWord = (*int8)(crt.VAPointer(&_ap))
113128  	_15_n = _sqlite3Strlen30(tls, _15_zWord)
113129  	_rc = func() int32 {
113130  		if _sqlite3KeywordCode(tls, (*uint8)(unsafe.Pointer(_15_zWord)), _15_n) != int32(27) {
113131  			return int32(124)
113132  		}
113133  		return int32(0)
113134  	}()
113135  	goto _22
113136  _14:
113137  	_16_sz = crt.VAInt32(&_ap)
113138  	_16_ppNew = (*unsafe.Pointer)(crt.VAPointer(&_ap))
113139  	_16_pFree = crt.VAPointer(&_ap)
113140  	if _16_sz != 0 {
113141  		*_16_ppNew = _sqlite3ScratchMalloc(tls, _16_sz)
113142  	}
113143  	_sqlite3ScratchFree(tls, _16_pFree)
113144  	goto _22
113145  _15:
113146  	_sqlite3Config.XbLocaltimeFault = crt.VAInt32(&_ap)
113147  	goto _22
113148  _16:
113149  	_sqlite3Config.XneverCorrupt = crt.VAInt32(&_ap)
113150  	goto _22
113151  _17:
113152  	_sqlite3Config.XiOnceResetThreshold = crt.VAInt32(&_ap)
113153  	goto _22
113154  _18:
113155  	goto _22
113156  _19:
113157  	_21_db = (*Xsqlite3)(crt.VAPointer(&_ap))
113158  	_21_db.XnMaxSorterMmap = crt.VAInt32(&_ap)
113159  	goto _22
113160  _20:
113161  	if _sqlite3Config.XisInit == int32(0) {
113162  		_rc = int32(1)
113163  	}
113164  	goto _22
113165  _21:
113166  	_23_db = (*Xsqlite3)(crt.VAPointer(&_ap))
113167  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_23_db.Xmutex))
113168  	_23_db.Xinit.XiDb = uint8(_sqlite3FindDbName(tls, _23_db, (*int8)(crt.VAPointer(&_ap))))
113169  	_23_db.Xinit.Xbusy = store3(&(_23_db.Xinit.XimposterTable), uint8(crt.VAInt32(&_ap)))
113170  	_23_db.Xinit.XnewTnum = crt.VAInt32(&_ap)
113171  	if (int32(_23_db.Xinit.Xbusy) == int32(0)) && ((_23_db.Xinit.XnewTnum) > int32(0)) {
113172  		_sqlite3ResetAllSchemasOfConnection(tls, _23_db)
113173  	}
113174  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_23_db.Xmutex))
113175  	goto _22
113176  _22:
113177  	_ap = nil
113178  	return _rc
113179  }
113180  
113181  func _sqlite3PrngSaveState(tls *crt.TLS) {
113182  	crt.Xmemcpy(tls, unsafe.Pointer(&_sqlite3SavedPrng), unsafe.Pointer(&_sqlite3Prng), uint64(259))
113183  }
113184  
113185  // C comment
113186  //  /*
113187  //  ** For testing purposes, we sometimes want to preserve the state of
113188  //  ** PRNG and restore the PRNG to its saved state at a later time, or
113189  //  ** to reset the PRNG to its initial state.  These routines accomplish
113190  //  ** those tasks.
113191  //  **
113192  //  ** The sqlite3_test_control() interface calls these routines to
113193  //  ** control the PRNG.
113194  //  */
113195  var _sqlite3SavedPrng Tsqlite3PrngType
113196  
113197  func _sqlite3PrngRestoreState(tls *crt.TLS) {
113198  	crt.Xmemcpy(tls, unsafe.Pointer(&_sqlite3Prng), unsafe.Pointer(&_sqlite3SavedPrng), uint64(259))
113199  }
113200  
113201  // C comment
113202  //  /*
113203  //  ** This routine runs an extensive test of the Bitvec code.
113204  //  **
113205  //  ** The input is an array of integers that acts as a program
113206  //  ** to test the Bitvec.  The integers are opcodes followed
113207  //  ** by 0, 1, or 3 operands, depending on the opcode.  Another
113208  //  ** opcode follows immediately after the last operand.
113209  //  **
113210  //  ** There are 6 opcodes numbered from 0 through 5.  0 is the
113211  //  ** "halt" opcode and causes the test to end.
113212  //  **
113213  //  **    0          Halt and return the number of errors
113214  //  **    1 N S X    Set N bits beginning with S and incrementing by X
113215  //  **    2 N S X    Clear N bits beginning with S and incrementing by X
113216  //  **    3 N        Set N randomly chosen bits
113217  //  **    4 N        Clear N randomly chosen bits
113218  //  **    5 N S X    Set N bits from S increment X in array only, not in bitvec
113219  //  **
113220  //  ** The opcodes 1 through 4 perform set and clear operations are performed
113221  //  ** on both a Bitvec object and on a linear array of bits obtained from malloc.
113222  //  ** Opcode 5 works on the linear array only, not on the Bitvec.
113223  //  ** Opcode 5 is used to deliberately induce a fault in order to
113224  //  ** confirm that error detection works.
113225  //  **
113226  //  ** At the conclusion of the test the linear array is compared
113227  //  ** against the Bitvec object.  If there are any differences,
113228  //  ** an error is returned.  If they are the same, zero is returned.
113229  //  **
113230  //  ** If a memory allocation error occurs, return -1.
113231  //  */
113232  func _sqlite3BitvecBuiltinTest(tls *crt.TLS, _sz int32, _aOp *int32) (r0 int32) {
113233  	var _rc, _i, _nx, _pc, _op int32
113234  	var _pTmpSpace unsafe.Pointer
113235  	var _pV *uint8
113236  	var _pBitvec *XBitvec
113237  	_pBitvec = nil
113238  	_pV = nil
113239  	_rc = int32(-1)
113240  	_pBitvec = _sqlite3BitvecCreate(tls, uint32(_sz))
113241  	_pV = (*uint8)(_sqlite3MallocZero(tls, uint64(((_sz+int32(7))/int32(8))+int32(1))))
113242  	_pTmpSpace = Xsqlite3_malloc64(tls, uint64(512))
113243  	if ((_pBitvec == nil) || (_pV == nil)) || (_pTmpSpace == nil) {
113244  		goto _bitvec_end
113245  	}
113246  	_sqlite3BitvecSet(tls, nil, uint32(1))
113247  	_sqlite3BitvecClear(tls, nil, uint32(1), _pTmpSpace)
113248  	_pc = int32(0)
113249  _3:
113250  	if store2(&_op, *elem8(_aOp, uintptr(_pc))) == int32(0) {
113251  		goto _4
113252  	}
113253  	switch _op {
113254  	case int32(1):
113255  		goto _6
113256  	case int32(2):
113257  		goto _6
113258  	case int32(3):
113259  		goto _9
113260  	case int32(4):
113261  		goto _9
113262  	case int32(5):
113263  		goto _6
113264  	default:
113265  		goto _9
113266  	}
113267  
113268  _6:
113269  	_nx = int32(4)
113270  	_i = (*elem8(_aOp, uintptr(_pc+int32(2)))) - int32(1)
113271  	*elem8(_aOp, uintptr(_pc+int32(2))) += *elem8(_aOp, uintptr(_pc+int32(3)))
113272  	goto _12
113273  _9:
113274  	_nx = int32(2)
113275  	Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_i))
113276  	goto _12
113277  _12:
113278  	if preInc2(elem8(_aOp, uintptr(_pc+int32(1))), -1) > int32(0) {
113279  		_nx = int32(0)
113280  	}
113281  	_pc += _nx
113282  	_i = (_i & int32(2147483647)) % _sz
113283  	if (_op & int32(1)) == int32(0) {
113284  		goto _14
113285  	}
113286  	{
113287  		p := elem15(_pV, uintptr((_i+int32(1))>>3))
113288  		*p = uint8(int32(*p) | (int32(1) << uint((_i+int32(1))&int32(7))))
113289  	}
113290  	if _op == int32(5) {
113291  		goto _15
113292  	}
113293  	if _sqlite3BitvecSet(tls, _pBitvec, uint32(_i+int32(1))) != 0 {
113294  		goto _bitvec_end
113295  	}
113296  _15:
113297  	goto _17
113298  _14:
113299  	{
113300  		p := elem15(_pV, uintptr((_i+int32(1))>>3))
113301  		*p = uint8(int32(*p) & (^(int32(1) << uint((_i+int32(1))&int32(7)))))
113302  	}
113303  	_sqlite3BitvecClear(tls, _pBitvec, uint32(_i+int32(1)), _pTmpSpace)
113304  _17:
113305  	goto _3
113306  _4:
113307  	_rc = int32(uint32((_sqlite3BitvecTest(tls, nil, 0)+_sqlite3BitvecTest(tls, _pBitvec, uint32(_sz+int32(1))))+_sqlite3BitvecTest(tls, _pBitvec, 0)) + (_sqlite3BitvecSize(tls, _pBitvec) - uint32(_sz)))
113308  	_i = int32(1)
113309  _18:
113310  	if _i > _sz {
113311  		goto _bitvec_end
113312  	}
113313  	if bool2int((int32(*elem15(_pV, uintptr(_i>>3)))&(int32(1)<<uint(_i&int32(7)))) != int32(0)) != _sqlite3BitvecTest(tls, _pBitvec, uint32(_i)) {
113314  		_rc = _i
113315  		goto _bitvec_end
113316  	}
113317  	_i += 1
113318  	goto _18
113319  _bitvec_end:
113320  	Xsqlite3_free(tls, _pTmpSpace)
113321  	Xsqlite3_free(tls, unsafe.Pointer(_pV))
113322  	_sqlite3BitvecDestroy(tls, _pBitvec)
113323  	return _rc
113324  }
113325  
113326  // C comment
113327  //  /*
113328  //  ** Register hooks to call when sqlite3BeginBenignMalloc() and
113329  //  ** sqlite3EndBenignMalloc() are called, respectively.
113330  //  */
113331  func _sqlite3BenignMallocHooks(tls *crt.TLS, _xBenignBegin func(*crt.TLS), _xBenignEnd func(*crt.TLS)) {
113332  	_sqlite3Hooks.XxBenignBegin = _xBenignBegin
113333  	_sqlite3Hooks.XxBenignEnd = _xBenignEnd
113334  }
113335  
113336  var _sqlite3_test_controlØ00__func__Ø000 [21]int8
113337  
113338  func init() {
113339  	crt.Xstrncpy(nil, &_sqlite3_test_controlØ00__func__Ø000[0], str(129496), 21)
113340  }
113341  
113342  // C comment
113343  //  /*
113344  //  ** Enable or disable the extended result codes.
113345  //  */
113346  func Xsqlite3_extended_result_codes(tls *crt.TLS, _db *Xsqlite3, _onoff int32) (r0 int32) {
113347  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
113348  		return _sqlite3MisuseError(tls, int32(143970))
113349  	}
113350  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113351  	_db.XerrMask = int32(func() uint32 {
113352  		if _onoff != 0 {
113353  			return uint32(4294967295)
113354  		}
113355  		return uint32(255)
113356  	}())
113357  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113358  	return int32(0)
113359  }
113360  
113361  // C comment
113362  //  /*
113363  //  ** Return a pointer to the next prepared statement after pStmt associated
113364  //  ** with database connection pDb.  If pStmt is NULL, return the first
113365  //  ** prepared statement for the database connection.  Return NULL if there
113366  //  ** are no more.
113367  //  */
113368  func Xsqlite3_next_stmt(tls *crt.TLS, _pDb *Xsqlite3, _pStmt unsafe.Pointer) (r0 unsafe.Pointer) {
113369  	var _pNext unsafe.Pointer
113370  	if _sqlite3SafetyCheckOk(tls, _pDb) == 0 {
113371  		_sqlite3MisuseError(tls, int32(77684))
113372  		return nil
113373  	}
113374  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pDb.Xmutex))
113375  	if _pStmt == nil {
113376  		_pNext = _pDb.XpVdbe
113377  		goto _2
113378  	}
113379  	_pNext = (*TVdbe)(_pStmt).XpNext
113380  _2:
113381  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pDb.Xmutex))
113382  	return _pNext
113383  }
113384  
113385  // C comment
113386  //  /*
113387  //  ** CAPI3REF: SQLite Runtime Status
113388  //  **
113389  //  ** ^These interfaces are used to retrieve runtime status information
113390  //  ** about the performance of SQLite, and optionally to reset various
113391  //  ** highwater marks.  ^The first argument is an integer code for
113392  //  ** the specific parameter to measure.  ^(Recognized integer codes
113393  //  ** are of the form [status parameters | SQLITE_STATUS_...].)^
113394  //  ** ^The current value of the parameter is returned into *pCurrent.
113395  //  ** ^The highest recorded value is returned in *pHighwater.  ^If the
113396  //  ** resetFlag is true, then the highest record value is reset after
113397  //  ** *pHighwater is written.  ^(Some parameters do not record the highest
113398  //  ** value.  For those parameters
113399  //  ** nothing is written into *pHighwater and the resetFlag is ignored.)^
113400  //  ** ^(Other parameters record only the highwater mark and not the current
113401  //  ** value.  For these latter parameters nothing is written into *pCurrent.)^
113402  //  **
113403  //  ** ^The sqlite3_status() and sqlite3_status64() routines return
113404  //  ** SQLITE_OK on success and a non-zero [error code] on failure.
113405  //  **
113406  //  ** If either the current value or the highwater mark is too large to
113407  //  ** be represented by a 32-bit integer, then the values returned by
113408  //  ** sqlite3_status() are undefined.
113409  //  **
113410  //  ** See also: [sqlite3_db_status()]
113411  //  */
113412  func Xsqlite3_status(tls *crt.TLS, _op int32, _pCurrent *int32, _pHighwater *int32, _resetFlag int32) (r0 int32) {
113413  	var _rc int32
113414  	var _iCur, _iHwtr int64
113415  	_iCur = int64(0)
113416  	_iHwtr = int64(0)
113417  	if (_pCurrent == nil) || (_pHighwater == nil) {
113418  		return _sqlite3MisuseError(tls, int32(18636))
113419  	}
113420  	_rc = Xsqlite3_status64(tls, _op, &_iCur, &_iHwtr, _resetFlag)
113421  	if _rc == int32(0) {
113422  		*_pCurrent = int32(_iCur)
113423  		*_pHighwater = int32(_iHwtr)
113424  	}
113425  	return _rc
113426  }
113427  
113428  // C comment
113429  //  /*
113430  //  ** Create an sqlite3_backup process to copy the contents of zSrcDb from
113431  //  ** connection handle pSrcDb to zDestDb in pDestDb. If successful, return
113432  //  ** a pointer to the new sqlite3_backup object.
113433  //  **
113434  //  ** If an error occurs, NULL is returned and an error code and error message
113435  //  ** stored in database handle pDestDb.
113436  //  */
113437  func Xsqlite3_backup_init(tls *crt.TLS, _pDestDb *Xsqlite3, _zDestDb *int8, _pSrcDb *Xsqlite3, _zSrcDb *int8) (r0 *Xsqlite3_backup) {
113438  	var _p *Xsqlite3_backup
113439  	if (_sqlite3SafetyCheckOk(tls, _pSrcDb) == 0) || (_sqlite3SafetyCheckOk(tls, _pDestDb) == 0) {
113440  		_sqlite3MisuseError(tls, int32(69049))
113441  		return nil
113442  	}
113443  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pSrcDb.Xmutex))
113444  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pDestDb.Xmutex))
113445  	if _pSrcDb == _pDestDb {
113446  		_sqlite3ErrorWithMsg(tls, _pDestDb, int32(1), str(129517))
113447  		_p = nil
113448  		goto _3
113449  	}
113450  	_p = (*Xsqlite3_backup)(_sqlite3MallocZero(tls, uint64(72)))
113451  	if _p == nil {
113452  		_sqlite3Error(tls, _pDestDb, _sqlite3NomemError(tls, int32(69077)))
113453  	}
113454  _3:
113455  	if _p == nil {
113456  		goto _5
113457  	}
113458  	*(**XBtree)(unsafe.Pointer(&_p.XpSrc)) = _findBtree(tls, _pDestDb, _pSrcDb, _zSrcDb)
113459  	*(**XBtree)(unsafe.Pointer(&_p.XpDest)) = _findBtree(tls, _pDestDb, _pDestDb, _zDestDb)
113460  	*(**Xsqlite3)(unsafe.Pointer(&_p.XpDestDb)) = _pDestDb
113461  	*(**Xsqlite3)(unsafe.Pointer(&_p.XpSrcDb)) = _pSrcDb
113462  	_p.XiNext = uint32(1)
113463  	_p.XisAttached = int32(0)
113464  	if ((nil == (*XBtree)(_p.XpSrc)) || (nil == (*XBtree)(_p.XpDest))) || (_checkReadTransaction(tls, _pDestDb, (*XBtree)(_p.XpDest)) != int32(0)) {
113465  		Xsqlite3_free(tls, unsafe.Pointer(_p))
113466  		_p = nil
113467  	}
113468  _5:
113469  	if _p != nil {
113470  		(*XBtree)(_p.XpSrc).XnBackup += 1
113471  	}
113472  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pDestDb.Xmutex))
113473  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pSrcDb.Xmutex))
113474  	return _p
113475  }
113476  
113477  // C comment
113478  //  /*
113479  //  ** Return a pointer corresponding to database zDb (i.e. "main", "temp")
113480  //  ** in connection handle pDb. If such a database cannot be found, return
113481  //  ** a NULL pointer and write an error message to pErrorDb.
113482  //  **
113483  //  ** If the "temp" database is requested, it may need to be opened by this
113484  //  ** function. If an error occurs while doing so, return 0 and write an
113485  //  ** error message to pErrorDb.
113486  //  */
113487  func _findBtree(tls *crt.TLS, _pErrorDb *Xsqlite3, _pDb *Xsqlite3, _zDb *int8) (r0 *XBtree) {
113488  	var _i, _1_rc int32
113489  	var _1_sParse XParse
113490  	_i = _sqlite3FindDbName(tls, _pDb, _zDb)
113491  	if _i != int32(1) {
113492  		goto _0
113493  	}
113494  	_1_rc = int32(0)
113495  	crt.Xmemset(tls, unsafe.Pointer(&_1_sParse), int32(0), uint64(600))
113496  	*(**Xsqlite3)(unsafe.Pointer(&_1_sParse.Xdb)) = _pDb
113497  	if _sqlite3OpenTempDatabase(tls, &_1_sParse) != 0 {
113498  		_sqlite3ErrorWithMsg(tls, _pErrorDb, _1_sParse.Xrc, str(24531), unsafe.Pointer(_1_sParse.XzErrMsg))
113499  		_1_rc = int32(1)
113500  	}
113501  	_sqlite3DbFree(tls, _pErrorDb, unsafe.Pointer(_1_sParse.XzErrMsg))
113502  	_sqlite3ParserReset(tls, &_1_sParse)
113503  	if _1_rc != 0 {
113504  		return nil
113505  	}
113506  _0:
113507  	if _i < int32(0) {
113508  		_sqlite3ErrorWithMsg(tls, _pErrorDb, int32(1), str(129557), unsafe.Pointer(_zDb))
113509  		return nil
113510  	}
113511  	return (*XBtree)(elem27((*XDb)(_pDb.XaDb), uintptr(_i)).XpBt)
113512  }
113513  
113514  // C comment
113515  //  /*
113516  //  ** Check that there is no open read-transaction on the b-tree passed as the
113517  //  ** second argument. If there is not, return SQLITE_OK. Otherwise, if there
113518  //  ** is an open read-transaction, return SQLITE_ERROR and leave an error
113519  //  ** message in database handle db.
113520  //  */
113521  func _checkReadTransaction(tls *crt.TLS, _db *Xsqlite3, _p *XBtree) (r0 int32) {
113522  	if _sqlite3BtreeIsInReadTrans(tls, _p) != 0 {
113523  		_sqlite3ErrorWithMsg(tls, _db, int32(1), str(129577))
113524  		return int32(1)
113525  	}
113526  	return int32(0)
113527  }
113528  
113529  // C comment
113530  //  /*
113531  //  ** Return the total number of pages in the source database as of the most
113532  //  ** recent call to sqlite3_backup_step().
113533  //  */
113534  func Xsqlite3_backup_pagecount(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) {
113535  	if _p == nil {
113536  		_sqlite3MisuseError(tls, int32(69569))
113537  		return int32(0)
113538  	}
113539  	return int32(_p.XnPagecount)
113540  }
113541  
113542  // C comment
113543  //  /*
113544  //  ** Return the number of pages still to be backed up as of the most recent
113545  //  ** call to sqlite3_backup_step().
113546  //  */
113547  func Xsqlite3_backup_remaining(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) {
113548  	if _p == nil {
113549  		_sqlite3MisuseError(tls, int32(69555))
113550  		return int32(0)
113551  	}
113552  	return int32(_p.XnRemaining)
113553  }
113554  
113555  // C comment
113556  //  /*
113557  //  ** Configuration settings for an individual database connection
113558  //  */
113559  func Xsqlite3_db_config(tls *crt.TLS, _db *Xsqlite3, _op int32, args ...interface{}) (r0 int32) {
113560  	var _rc, _3_sz, _3_cnt, _6_onoff, _6_oldFlags int32
113561  	var _4_i uint32
113562  	var _6_pRes *int32
113563  	var _3_pBuf unsafe.Pointer
113564  	var _ap []interface{}
113565  	_ap = args
113566  	switch _op {
113567  	case int32(1000):
113568  		goto _1
113569  	case int32(1001):
113570  		goto _2
113571  	default:
113572  		goto _3
113573  	}
113574  
113575  _1:
113576  	elem27((*XDb)(_db.XaDb), 0).XzDbSName = (*int8)(crt.VAPointer(&_ap))
113577  	_rc = int32(0)
113578  	goto _4
113579  _2:
113580  	_3_pBuf = crt.VAPointer(&_ap)
113581  	_3_sz = crt.VAInt32(&_ap)
113582  	_3_cnt = crt.VAInt32(&_ap)
113583  	_rc = _setupLookaside(tls, _db, _3_pBuf, _3_sz, _3_cnt)
113584  	goto _4
113585  _3:
113586  	_rc = int32(1)
113587  	_4_i = 0
113588  _5:
113589  	if _4_i >= uint32(5) {
113590  		goto _8
113591  	}
113592  	if (elem132((*t133)(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)), uintptr(_4_i)).Xop) != _op {
113593  		goto _9
113594  	}
113595  	_6_onoff = crt.VAInt32(&_ap)
113596  	_6_pRes = (*int32)(crt.VAPointer(&_ap))
113597  	_6_oldFlags = _db.Xflags
113598  	if _6_onoff > int32(0) {
113599  		{
113600  			p := &_db.Xflags
113601  			*p = int32(uint32(*p) | (elem132((*t133)(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)), uintptr(_4_i)).Xmask))
113602  		}
113603  		goto _12
113604  	}
113605  	if _6_onoff == int32(0) {
113606  		{
113607  			p := &_db.Xflags
113608  			*p = int32(uint32(*p) & (^(elem132((*t133)(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)), uintptr(_4_i)).Xmask)))
113609  		}
113610  	}
113611  _12:
113612  	if _6_oldFlags != _db.Xflags {
113613  		_sqlite3ExpirePreparedStatements(tls, _db)
113614  	}
113615  	if _6_pRes != nil {
113616  		*_6_pRes = bool2int((uint32(_db.Xflags) & (elem132((*t133)(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)), uintptr(_4_i)).Xmask)) != (0))
113617  	}
113618  	_rc = int32(0)
113619  	goto _8
113620  _9:
113621  	_4_i += 1
113622  	goto _5
113623  _8:
113624  	goto _4
113625  _4:
113626  	_ap = nil
113627  	return _rc
113628  }
113629  
113630  var _sqlite3_db_configØ00aFlagOpØ001 [5]t133
113631  
113632  func init() {
113633  	_sqlite3_db_configØ00aFlagOpØ001 = [5]t133{t133{Xop: int32(1002), Xmask: uint32(524288)}, t133{Xop: int32(1003), Xmask: uint32(16777216)}, t133{Xop: int32(1004), Xmask: uint32(1073741824)}, t133{Xop: int32(1005), Xmask: uint32(4194304)}, t133{Xop: int32(1006), Xmask: uint32(2147483648)}}
113634  }
113635  
113636  // C comment
113637  //  /*
113638  //  ** Return the mutex associated with a database connection.
113639  //  */
113640  func Xsqlite3_db_mutex(tls *crt.TLS, _db *Xsqlite3) (r0 *Xsqlite3_mutex) {
113641  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
113642  		_sqlite3MisuseError(tls, int32(141191))
113643  		return nil
113644  	}
113645  	return (*Xsqlite3_mutex)(_db.Xmutex)
113646  }
113647  
113648  // C comment
113649  //  /*
113650  //  ** Query status information for a single database connection
113651  //  */
113652  func Xsqlite3_db_status(tls *crt.TLS, _db *Xsqlite3, _op int32, _pCurrent *int32, _pHighwater *int32, _resetFlag int32) (r0 int32) {
113653  	var _rc, _7_totalUsed, _7_i, _9_nByte, _11_i, _11_nByte, _16_nByte, _18_i, _18_nRet int32
113654  	var _8_pBt *XBtree
113655  	var _9_pPager, _20_pPager *XPager
113656  	var _12_pSchema *XSchema
113657  	var _13_p *XHashElem
113658  	var _16_pVdbe *TVdbe
113659  	_rc = int32(0)
113660  	if ((_sqlite3SafetyCheckOk(tls, _db) == 0) || (_pCurrent == nil)) || (_pHighwater == nil) {
113661  		return _sqlite3MisuseError(tls, int32(18659))
113662  	}
113663  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113664  	switch _op {
113665  	case int32(0):
113666  		goto _4
113667  	case int32(1):
113668  		goto _8
113669  	case int32(2):
113670  		goto _10
113671  	case int32(3):
113672  		goto _11
113673  	case int32(4):
113674  		goto _5
113675  	case int32(5):
113676  		goto _5
113677  	case int32(6):
113678  		goto _5
113679  	case int32(7):
113680  		goto _12
113681  	case int32(8):
113682  		goto _12
113683  	case int32(9):
113684  		goto _12
113685  	case int32(10):
113686  		goto _15
113687  	case int32(11):
113688  		goto _8
113689  	default:
113690  		goto _16
113691  	}
113692  
113693  _4:
113694  	*_pCurrent = _db.Xlookaside.XnOut
113695  	*_pHighwater = _db.Xlookaside.XmxOut
113696  	if _resetFlag != 0 {
113697  		_db.Xlookaside.XmxOut = _db.Xlookaside.XnOut
113698  	}
113699  	goto _18
113700  _5:
113701  	func() {
113702  		if (_op - int32(4)) < int32(0) {
113703  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18679), unsafe.Pointer(&_sqlite3_db_statusØ00__func__Ø000), unsafe.Pointer(str(129608)))
113704  			crt.X__builtin_abort(tls)
113705  		}
113706  	}()
113707  	func() {
113708  		if (_op - int32(4)) >= int32(3) {
113709  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18680), unsafe.Pointer(&_sqlite3_db_statusØ00__func__Ø000), unsafe.Pointer(str(129646)))
113710  			crt.X__builtin_abort(tls)
113711  		}
113712  	}()
113713  	*_pCurrent = int32(0)
113714  	*_pHighwater = *elem8((*int32)(unsafe.Pointer(&(_db.Xlookaside.XanStat))), uintptr(_op-int32(4)))
113715  	if _resetFlag != 0 {
113716  		*elem8((*int32)(unsafe.Pointer(&(_db.Xlookaside.XanStat))), uintptr(_op-int32(4))) = int32(0)
113717  	}
113718  	goto _18
113719  _8:
113720  	_7_totalUsed = int32(0)
113721  	_sqlite3BtreeEnterAll(tls, _db)
113722  	_7_i = int32(0)
113723  _24:
113724  	if _7_i >= _db.XnDb {
113725  		goto _27
113726  	}
113727  	_8_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_7_i)).XpBt)
113728  	if _8_pBt == nil {
113729  		goto _28
113730  	}
113731  	_9_pPager = _sqlite3BtreePager(tls, _8_pBt)
113732  	_9_nByte = _sqlite3PagerMemUsed(tls, _9_pPager)
113733  	if _op == int32(11) {
113734  		_9_nByte = _9_nByte / _sqlite3BtreeConnectionCount(tls, _8_pBt)
113735  	}
113736  	_7_totalUsed += _9_nByte
113737  _28:
113738  	_7_i += 1
113739  	goto _24
113740  _27:
113741  	_sqlite3BtreeLeaveAll(tls, _db)
113742  	*_pCurrent = _7_totalUsed
113743  	*_pHighwater = int32(0)
113744  	goto _18
113745  _10:
113746  	_11_nByte = int32(0)
113747  	_sqlite3BtreeEnterAll(tls, _db)
113748  	_db.XpnBytesFreed = &_11_nByte
113749  	_11_i = int32(0)
113750  _30:
113751  	if _11_i >= _db.XnDb {
113752  		goto _33
113753  	}
113754  	_12_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_11_i)).XpSchema)
113755  	if func() int32 {
113756  		if _12_pSchema != nil {
113757  			return int32(1)
113758  		}
113759  		return func() int32 {
113760  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18729), unsafe.Pointer(&_sqlite3_db_statusØ00__func__Ø000), unsafe.Pointer(str(4809)))
113761  			crt.X__builtin_abort(tls)
113762  			return int32(0)
113763  		}()
113764  	}() == 0 {
113765  		goto _36
113766  	}
113767  	{
113768  		p := &_11_nByte
113769  		*p = int32(uint32(*p) + (uint32((_sqlite3Config.Xm.XxRoundup)(tls, int32(32))) * ((((_12_pSchema.XtblHash.Xcount) + (_12_pSchema.XtrigHash.Xcount)) + (_12_pSchema.XidxHash.Xcount)) + (_12_pSchema.XfkeyHash.Xcount))))
113770  	}
113771  	{
113772  		p := &_11_nByte
113773  		*p = int32(uint64(*p) + Xsqlite3_msize(tls, _12_pSchema.XtblHash.Xht))
113774  	}
113775  	{
113776  		p := &_11_nByte
113777  		*p = int32(uint64(*p) + Xsqlite3_msize(tls, _12_pSchema.XtrigHash.Xht))
113778  	}
113779  	{
113780  		p := &_11_nByte
113781  		*p = int32(uint64(*p) + Xsqlite3_msize(tls, _12_pSchema.XidxHash.Xht))
113782  	}
113783  	{
113784  		p := &_11_nByte
113785  		*p = int32(uint64(*p) + Xsqlite3_msize(tls, _12_pSchema.XfkeyHash.Xht))
113786  	}
113787  	_13_p = (*XHashElem)(_12_pSchema.XtrigHash.Xfirst)
113788  _37:
113789  	if _13_p == nil {
113790  		goto _40
113791  	}
113792  	_sqlite3DeleteTrigger(tls, _db, (*XTrigger)(_13_p.Xdata))
113793  	_13_p = (*XHashElem)(_13_p.Xnext)
113794  	goto _37
113795  _40:
113796  	_13_p = (*XHashElem)(_12_pSchema.XtblHash.Xfirst)
113797  _41:
113798  	if _13_p == nil {
113799  		goto _44
113800  	}
113801  	_sqlite3DeleteTable(tls, _db, (*XTable)(_13_p.Xdata))
113802  	_13_p = (*XHashElem)(_13_p.Xnext)
113803  	goto _41
113804  _44:
113805  _36:
113806  	_11_i += 1
113807  	goto _30
113808  _33:
113809  	_db.XpnBytesFreed = nil
113810  	_sqlite3BtreeLeaveAll(tls, _db)
113811  	*_pHighwater = int32(0)
113812  	*_pCurrent = _11_nByte
113813  	goto _18
113814  _11:
113815  	_16_nByte = int32(0)
113816  	_db.XpnBytesFreed = &_16_nByte
113817  	_16_pVdbe = (*TVdbe)(_db.XpVdbe)
113818  _45:
113819  	if _16_pVdbe == nil {
113820  		goto _48
113821  	}
113822  	_sqlite3VdbeClearObject(tls, _db, _16_pVdbe)
113823  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_16_pVdbe))
113824  	_16_pVdbe = (*TVdbe)(_16_pVdbe.XpNext)
113825  	goto _45
113826  _48:
113827  	_db.XpnBytesFreed = nil
113828  	*_pHighwater = int32(0)
113829  	*_pCurrent = _16_nByte
113830  	goto _18
113831  _12:
113832  	_18_nRet = int32(0)
113833  
113834  	_18_i = int32(0)
113835  _49:
113836  	if _18_i >= _db.XnDb {
113837  		goto _52
113838  	}
113839  	if (elem27((*XDb)(_db.XaDb), uintptr(_18_i)).XpBt) != nil {
113840  		_20_pPager = _sqlite3BtreePager(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_18_i)).XpBt))
113841  		_sqlite3PagerCacheStat(tls, _20_pPager, _op, _resetFlag, &_18_nRet)
113842  	}
113843  	_18_i += 1
113844  	goto _49
113845  _52:
113846  	*_pHighwater = int32(0)
113847  	*_pCurrent = _18_nRet
113848  	goto _18
113849  _15:
113850  	*_pHighwater = int32(0)
113851  	*_pCurrent = bool2int((_db.XnDeferredImmCons > (0)) || (_db.XnDeferredCons > (0)))
113852  	goto _18
113853  _16:
113854  	_rc = int32(1)
113855  _18:
113856  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113857  	return _rc
113858  }
113859  
113860  var _sqlite3_db_statusØ00__func__Ø000 [18]int8
113861  
113862  func init() {
113863  	crt.Xstrncpy(nil, &_sqlite3_db_statusØ00__func__Ø000[0], str(129683), 18)
113864  }
113865  
113866  // C comment
113867  //  /*
113868  //  ** Return the approximate number of bytes of memory currently
113869  //  ** used by the pager and its associated cache.
113870  //  */
113871  func _sqlite3PagerMemUsed(tls *crt.TLS, _pPager *XPager) (r0 int32) {
113872  	var _perPageSize int32
113873  	_perPageSize = int32((uint64(_pPager.XpageSize+int32(_pPager.XnExtra)) + uint64(72)) + uint64(40))
113874  	return ((_perPageSize * _sqlite3PcachePagecount(tls, (*XPCache)(_pPager.XpPCache))) + _sqlite3MallocSize(tls, unsafe.Pointer(_pPager))) + _pPager.XpageSize
113875  }
113876  
113877  func Xsqlite3_msize(tls *crt.TLS, _p unsafe.Pointer) (r0 uint64) {
113878  	return uint64(func() int32 {
113879  		if _p != nil {
113880  			return (_sqlite3Config.Xm.XxSize)(tls, _p)
113881  		}
113882  		return int32(0)
113883  	}())
113884  }
113885  
113886  // C comment
113887  //  /*
113888  //  ** Parameter eStat must be either SQLITE_DBSTATUS_CACHE_HIT or
113889  //  ** SQLITE_DBSTATUS_CACHE_MISS. Before returning, *pnVal is incremented by the
113890  //  ** current cache hit or miss count, according to the value of eStat. If the
113891  //  ** reset parameter is non-zero, the cache hit or miss count is zeroed before
113892  //  ** returning.
113893  //  */
113894  func _sqlite3PagerCacheStat(tls *crt.TLS, _pPager *XPager, _eStat int32, _reset int32, _pnVal *int32) {
113895  	func() {
113896  		if _eStat != int32(7) && _eStat != int32(8) && _eStat != int32(9) {
113897  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53576), unsafe.Pointer(&_sqlite3PagerCacheStatØ00__func__Ø000), unsafe.Pointer(str(129701)))
113898  			crt.X__builtin_abort(tls)
113899  		}
113900  	}()
113901  
113902  	*_pnVal += *elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), uintptr(_eStat-int32(7)))
113903  	if _reset != 0 {
113904  		*elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), uintptr(_eStat-int32(7))) = int32(0)
113905  	}
113906  }
113907  
113908  var _sqlite3PagerCacheStatØ00__func__Ø000 [22]int8
113909  
113910  func init() {
113911  	crt.Xstrncpy(nil, &_sqlite3PagerCacheStatØ00__func__Ø000[0], str(129809), 22)
113912  }
113913  
113914  func Xsqlite3_extended_errcode(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
113915  	if (_db != nil) && (_sqlite3SafetyCheckSickOrOk(tls, _db) == 0) {
113916  		return _sqlite3MisuseError(tls, int32(142786))
113917  	}
113918  	if (_db == nil) || (_db.XmallocFailed != 0) {
113919  		return _sqlite3NomemError(tls, int32(142789))
113920  	}
113921  	return _db.XerrCode
113922  }
113923  
113924  // C comment
113925  //  /*
113926  //  ** Return the value of a status counter for a prepared statement
113927  //  */
113928  func Xsqlite3_stmt_status(tls *crt.TLS, _pStmt unsafe.Pointer, _op int32, _resetFlag int32) (r0 int32) {
113929  	var _v uint32
113930  	var _pVdbe *TVdbe
113931  	_pVdbe = (*TVdbe)(_pStmt)
113932  	if _pStmt == nil {
113933  		_sqlite3MisuseError(tls, int32(77706))
113934  		return int32(0)
113935  	}
113936  	_v = *elem31((*uint32)(unsafe.Pointer(&_pVdbe.XaCounter)), uintptr(_op))
113937  	if _resetFlag != 0 {
113938  		*elem31((*uint32)(unsafe.Pointer(&_pVdbe.XaCounter)), uintptr(_op)) = 0
113939  	}
113940  	return int32(_v)
113941  }
113942  
113943  // C comment
113944  //  /*
113945  //  ** Move an existing blob handle to point to a different row of the same
113946  //  ** database table.
113947  //  **
113948  //  ** If an error occurs, or if the specified row does not exist or does not
113949  //  ** contain a blob or text value, then an error code is returned and the
113950  //  ** database handle error code and message set. If this happens, then all
113951  //  ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
113952  //  ** immediately return SQLITE_ABORT.
113953  //  */
113954  func Xsqlite3_blob_reopen(tls *crt.TLS, _pBlob unsafe.Pointer, _iRow int64) (r0 int32) {
113955  	var _rc int32
113956  	var _2_zErr *int8
113957  	var _db *Xsqlite3
113958  	var _p *XIncrblob
113959  	_p = (*XIncrblob)(_pBlob)
113960  	if _p == nil {
113961  		return _sqlite3MisuseError(tls, int32(85986))
113962  	}
113963  	_db = (*Xsqlite3)(_p.Xdb)
113964  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113965  	if _p.XpStmt == nil {
113966  		_rc = int32(4)
113967  		goto _2
113968  	}
113969  	_rc = _blobSeekToRow(tls, _p, _iRow, &_2_zErr)
113970  	if _rc != int32(0) {
113971  		_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
113972  			if _2_zErr != nil {
113973  				return str(24531)
113974  			}
113975  			return nil
113976  		}(), unsafe.Pointer(_2_zErr))
113977  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_2_zErr))
113978  	}
113979  	func() {
113980  		if _rc == int32(17) {
113981  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86002), unsafe.Pointer(&_sqlite3_blob_reopenØ00__func__Ø000), unsafe.Pointer(str(129831)))
113982  			crt.X__builtin_abort(tls)
113983  		}
113984  	}()
113985  _2:
113986  	_rc = _sqlite3ApiExit(tls, _db, _rc)
113987  	func() {
113988  		if _rc != int32(0) && _p.XpStmt != nil {
113989  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86006), unsafe.Pointer(&_sqlite3_blob_reopenØ00__func__Ø000), unsafe.Pointer(str(129849)))
113990  			crt.X__builtin_abort(tls)
113991  		}
113992  	}()
113993  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113994  	return _rc
113995  }
113996  
113997  var _sqlite3_blob_reopenØ00__func__Ø000 [20]int8
113998  
113999  func init() {
114000  	crt.Xstrncpy(nil, &_sqlite3_blob_reopenØ00__func__Ø000[0], str(129878), 20)
114001  }
114002  
114003  // C comment
114004  //  /*
114005  //  ** Call from within the xCreate() or xConnect() methods to provide
114006  //  ** the SQLite core with additional information about the behavior
114007  //  ** of the virtual table being implemented.
114008  //  */
114009  func Xsqlite3_vtab_config(tls *crt.TLS, _db *Xsqlite3, _op int32, args ...interface{}) (r0 int32) {
114010  	var _rc int32
114011  	var _ap []interface{}
114012  	var _2_p *XVtabCtx
114013  	_rc = int32(0)
114014  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114015  		return _sqlite3MisuseError(tls, int32(126200))
114016  	}
114017  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114018  	_ap = args
114019  	switch _op {
114020  	case int32(1):
114021  		goto _2
114022  	default:
114023  		goto _3
114024  	}
114025  
114026  _2:
114027  	_2_p = (*XVtabCtx)(_db.XpVtabCtx)
114028  	if _2_p == nil {
114029  		_rc = _sqlite3MisuseError(tls, int32(126208))
114030  		goto _5
114031  	}
114032  	func() {
114033  		if (*XTable)(_2_p.XpTab) != nil && ((*XTable)(_2_p.XpTab).XnModuleArg) == 0 {
114034  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126210), unsafe.Pointer(&_sqlite3_vtab_configØ00__func__Ø000), unsafe.Pointer(str(129898)))
114035  			crt.X__builtin_abort(tls)
114036  		}
114037  	}()
114038  	(*XVTable)(_2_p.XpVTable).XbConstraint = uint8(crt.VAInt32(&_ap))
114039  _5:
114040  	goto _9
114041  _3:
114042  	_rc = _sqlite3MisuseError(tls, int32(126216))
114043  	goto _9
114044  _9:
114045  	_ap = nil
114046  	if _rc != int32(0) {
114047  		_sqlite3Error(tls, _db, _rc)
114048  	}
114049  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114050  	return _rc
114051  }
114052  
114053  var _sqlite3_vtab_configØ00__func__Ø000 [20]int8
114054  
114055  func init() {
114056  	crt.Xstrncpy(nil, &_sqlite3_vtab_configØ00__func__Ø000[0], str(129931), 20)
114057  }
114058  
114059  // C comment
114060  //  /*
114061  //  ** Return the ON CONFLICT resolution mode in effect for the virtual
114062  //  ** table update operation currently in progress.
114063  //  **
114064  //  ** The results of this routine are undefined unless it is called from
114065  //  ** within an xUpdate method.
114066  //  */
114067  func Xsqlite3_vtab_on_conflict(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
114068  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114069  		return _sqlite3MisuseError(tls, int32(126182))
114070  	}
114071  
114072  	func() {
114073  		if int32(_db.XvtabOnConflict) < int32(1) || int32(_db.XvtabOnConflict) > int32(5) {
114074  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126186), unsafe.Pointer(&_sqlite3_vtab_on_conflictØ00__func__Ø000), unsafe.Pointer(str(129951)))
114075  			crt.X__builtin_abort(tls)
114076  		}
114077  	}()
114078  	return int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3_vtab_on_conflictØ00aMapØ001)), uintptr(int32(_db.XvtabOnConflict)-int32(1))))
114079  }
114080  
114081  var _sqlite3_vtab_on_conflictØ00__func__Ø000 [25]int8
114082  
114083  func init() {
114084  	crt.Xstrncpy(nil, &_sqlite3_vtab_on_conflictØ00__func__Ø000[0], str(129998), 25)
114085  }
114086  
114087  var _sqlite3_vtab_on_conflictØ00aMapØ001 [5]uint8
114088  
114089  func init() {
114090  	_sqlite3_vtab_on_conflictØ00aMapØ001 = [5]uint8{1, 4, 3, 2, 5}
114091  }
114092  
114093  func Xsqlite3_close_v2(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
114094  	return _sqlite3Close(tls, _db, int32(1))
114095  }
114096  
114097  // C comment
114098  //  /*
114099  //  ** Return the filename of the database associated with a database
114100  //  ** connection.
114101  //  */
114102  func Xsqlite3_db_filename(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 *int8) {
114103  	var _pBt *XBtree
114104  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114105  		_sqlite3MisuseError(tls, int32(144428))
114106  		return nil
114107  	}
114108  	_pBt = _sqlite3DbNameToBtree(tls, _db, _zDbName)
114109  	return func() *int8 {
114110  		if _pBt != nil {
114111  			return _sqlite3BtreeGetFilename(tls, _pBt)
114112  		}
114113  		return nil
114114  	}()
114115  }
114116  
114117  // C comment
114118  //  /*
114119  //  ** Return 1 if database is read-only or 0 if read/write.  Return -1 if
114120  //  ** no such database exists.
114121  //  */
114122  func Xsqlite3_db_readonly(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 int32) {
114123  	var _pBt *XBtree
114124  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114125  		_sqlite3MisuseError(tls, int32(144444))
114126  		return int32(-1)
114127  	}
114128  	_pBt = _sqlite3DbNameToBtree(tls, _db, _zDbName)
114129  	return func() int32 {
114130  		if _pBt != nil {
114131  			return _sqlite3BtreeIsReadonly(tls, _pBt)
114132  		}
114133  		return int32(-1)
114134  	}()
114135  }
114136  
114137  // C comment
114138  //  /*
114139  //  ** Return a string that describes the kind of error specified in the
114140  //  ** argument.  For now, this simply calls the internal sqlite3ErrStr()
114141  //  ** function.
114142  //  */
114143  func Xsqlite3_errstr(tls *crt.TLS, _rc int32) (r0 *int8) {
114144  	return _sqlite3ErrStr(tls, _rc)
114145  }
114146  
114147  // C comment
114148  //  /*
114149  //  ** Return true if the prepared statement is guaranteed to not modify the
114150  //  ** database.
114151  //  */
114152  func Xsqlite3_stmt_readonly(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
114153  	return int32(func() uint32 {
114154  		if _pStmt != nil {
114155  			return ((uint32(((*TVdbe)(_pStmt).Xexpired)>>7) << 31) >> 31)
114156  		}
114157  		return uint32(1)
114158  	}())
114159  }
114160  
114161  // C comment
114162  //  /*
114163  //  ** Return a 64-bit integer value for a query parameter.
114164  //  */
114165  func Xsqlite3_uri_int64(tls *crt.TLS, _zFilename *int8, _zParam *int8, _bDflt int64) (r0 int64) {
114166  	var _v int64
114167  	var _z *int8
114168  	_z = Xsqlite3_uri_parameter(tls, _zFilename, _zParam)
114169  	if (_z != nil) && (_sqlite3DecOrHexToI64(tls, _z, &_v) == int32(0)) {
114170  		_bDflt = _v
114171  	}
114172  	return _bDflt
114173  }
114174  
114175  // C comment
114176  //  /*
114177  //  ** Register a statically linked extension that is automatically
114178  //  ** loaded by every new database connection.
114179  //  */
114180  func Xsqlite3_auto_extension(tls *crt.TLS, _xInit func(*crt.TLS)) (r0 int32) {
114181  	var _rc int32
114182  	var _2_i uint32
114183  	var _4_nByte uint64
114184  	var _2_mutex *Xsqlite3_mutex
114185  	var _4_aNew *func(*crt.TLS)
114186  	_rc = int32(0)
114187  	_rc = Xsqlite3_initialize(tls)
114188  	if _rc != 0 {
114189  		return _rc
114190  	}
114191  	_2_mutex = _sqlite3MutexAlloc(tls, int32(2))
114192  	Xsqlite3_mutex_enter(tls, _2_mutex)
114193  	_2_i = 0
114194  _2:
114195  	if _2_i >= _sqlite3Autoext.XnExt {
114196  		goto _5
114197  	}
114198  	if *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*elem131(_sqlite3Autoext.XaExt, uintptr(_2_i)))})) == *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_xInit})) {
114199  		goto _5
114200  	}
114201  	_2_i += 1
114202  	goto _2
114203  _5:
114204  	if _2_i != _sqlite3Autoext.XnExt {
114205  		goto _7
114206  	}
114207  	_4_nByte = uint64(_sqlite3Autoext.XnExt+uint32(1)) * uint64(8)
114208  	_4_aNew = (*func(*crt.TLS))(Xsqlite3_realloc64(tls, unsafe.Pointer(_sqlite3Autoext.XaExt), _4_nByte))
114209  	if _4_aNew == nil {
114210  		_rc = _sqlite3NomemError(tls, int32(112498))
114211  		goto _9
114212  	}
114213  	_sqlite3Autoext.XaExt = _4_aNew
114214  	*elem131(_sqlite3Autoext.XaExt, uintptr(_sqlite3Autoext.XnExt)) = _xInit
114215  	_sqlite3Autoext.XnExt += 1
114216  _9:
114217  _7:
114218  	Xsqlite3_mutex_leave(tls, _2_mutex)
114219  	func() {
114220  		if (_rc & int32(255)) != _rc {
114221  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(112506), unsafe.Pointer(&_sqlite3_auto_extensionØ00__func__Ø000), unsafe.Pointer(str(24534)))
114222  			crt.X__builtin_abort(tls)
114223  		}
114224  	}()
114225  	return _rc
114226  }
114227  
114228  var _sqlite3_auto_extensionØ00__func__Ø000 [23]int8
114229  
114230  func init() {
114231  	crt.Xstrncpy(nil, &_sqlite3_auto_extensionØ00__func__Ø000[0], str(130023), 23)
114232  }
114233  
114234  func Xsqlite3_bind_blob64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData uint64, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
114235  	func() {
114236  		if *(*uintptr)(unsafe.Pointer(&struct {
114237  			f func(*crt.TLS, unsafe.Pointer)
114238  		}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114239  			f func(*crt.TLS, unsafe.Pointer)
114240  		}{func() func(*crt.TLS, unsafe.Pointer) {
114241  			v := _sqlite3MallocSize
114242  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114243  		}()})) {
114244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77435), unsafe.Pointer(&_sqlite3_bind_blob64Ø00__func__Ø000), unsafe.Pointer(str(130046)))
114245  			crt.X__builtin_abort(tls)
114246  		}
114247  	}()
114248  	if _nData > uint64(2147483647) {
114249  		return _invokeValueDestructor(tls, _zData, _xDel, nil)
114250  	}
114251  	return _bindText(tls, _pStmt, _i, _zData, int32(_nData), _xDel, 0)
114252  }
114253  
114254  var _sqlite3_bind_blob64Ø00__func__Ø000 [20]int8
114255  
114256  func init() {
114257  	crt.Xstrncpy(nil, &_sqlite3_bind_blob64Ø00__func__Ø000[0], str(130067), 20)
114258  }
114259  
114260  func _invokeValueDestructor(tls *crt.TLS, _p unsafe.Pointer, _xDel func(*crt.TLS, unsafe.Pointer), _pCtx *Xsqlite3_context) (r0 int32) {
114261  	func() {
114262  		if *(*uintptr)(unsafe.Pointer(&struct {
114263  			f func(*crt.TLS, unsafe.Pointer)
114264  		}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114265  			f func(*crt.TLS, unsafe.Pointer)
114266  		}{func() func(*crt.TLS, unsafe.Pointer) {
114267  			v := _sqlite3MallocSize
114268  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114269  		}()})) {
114270  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76411), unsafe.Pointer(&_invokeValueDestructorØ00__func__Ø000), unsafe.Pointer(str(130046)))
114271  			crt.X__builtin_abort(tls)
114272  		}
114273  	}()
114274  	if _xDel == nil {
114275  		goto _5
114276  	}
114277  	if *(*uintptr)(unsafe.Pointer(&struct {
114278  		f func(*crt.TLS, unsafe.Pointer)
114279  	}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114280  		f func(*crt.TLS, unsafe.Pointer)
114281  	}{func() func(*crt.TLS, unsafe.Pointer) {
114282  		v := uint64(18446744073709551615)
114283  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114284  	}()})) {
114285  		goto _5
114286  	}
114287  	_xDel(tls, _p)
114288  _5:
114289  	if _pCtx != nil {
114290  		Xsqlite3_result_error_toobig(tls, _pCtx)
114291  	}
114292  	return int32(18)
114293  }
114294  
114295  var _invokeValueDestructorØ00__func__Ø000 [22]int8
114296  
114297  func init() {
114298  	crt.Xstrncpy(nil, &_invokeValueDestructorØ00__func__Ø000[0], str(130087), 22)
114299  }
114300  
114301  func Xsqlite3_bind_text64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData *int8, _nData uint64, _xDel func(*crt.TLS, unsafe.Pointer), _enc uint8) (r0 int32) {
114302  	func() {
114303  		if *(*uintptr)(unsafe.Pointer(&struct {
114304  			f func(*crt.TLS, unsafe.Pointer)
114305  		}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114306  			f func(*crt.TLS, unsafe.Pointer)
114307  		}{func() func(*crt.TLS, unsafe.Pointer) {
114308  			v := _sqlite3MallocSize
114309  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114310  		}()})) {
114311  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77491), unsafe.Pointer(&_sqlite3_bind_text64Ø00__func__Ø000), unsafe.Pointer(str(130046)))
114312  			crt.X__builtin_abort(tls)
114313  		}
114314  	}()
114315  	if _nData > uint64(2147483647) {
114316  		return _invokeValueDestructor(tls, unsafe.Pointer(_zData), _xDel, nil)
114317  	}
114318  	if int32(_enc) == int32(4) {
114319  		_enc = uint8(2)
114320  	}
114321  	return _bindText(tls, _pStmt, _i, unsafe.Pointer(_zData), int32(_nData), _xDel, _enc)
114322  }
114323  
114324  var _sqlite3_bind_text64Ø00__func__Ø000 [20]int8
114325  
114326  func init() {
114327  	crt.Xstrncpy(nil, &_sqlite3_bind_text64Ø00__func__Ø000[0], str(130109), 20)
114328  }
114329  
114330  // C comment
114331  //  /*
114332  //  ** Cancel a prior call to sqlite3_auto_extension.  Remove xInit from the
114333  //  ** set of routines that is invoked for each new database connection, if it
114334  //  ** is currently on the list.  If xInit is not on the list, then this
114335  //  ** routine is a no-op.
114336  //  **
114337  //  ** Return 1 if xInit was found on the list and removed.  Return 0 if xInit
114338  //  ** was not on the list.
114339  //  */
114340  func Xsqlite3_cancel_auto_extension(tls *crt.TLS, _xInit func(*crt.TLS)) (r0 int32) {
114341  	var _i, _n int32
114342  	var _mutex *Xsqlite3_mutex
114343  	_mutex = _sqlite3MutexAlloc(tls, int32(2))
114344  	_n = int32(0)
114345  	Xsqlite3_mutex_enter(tls, _mutex)
114346  	_i = int32(_sqlite3Autoext.XnExt) - int32(1)
114347  _0:
114348  	if _i < int32(0) {
114349  		goto _3
114350  	}
114351  	if *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*elem131(_sqlite3Autoext.XaExt, uintptr(_i)))})) == *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_xInit})) {
114352  		_sqlite3Autoext.XnExt -= 1
114353  		*elem131(_sqlite3Autoext.XaExt, uintptr(_i)) = *elem131(_sqlite3Autoext.XaExt, uintptr(_sqlite3Autoext.XnExt))
114354  		_n += 1
114355  		goto _3
114356  	}
114357  	_i -= 1
114358  	goto _0
114359  _3:
114360  	Xsqlite3_mutex_leave(tls, _mutex)
114361  	return _n
114362  }
114363  
114364  // C comment
114365  //  /*
114366  //  ** Reset the automatic extension loading mechanism.
114367  //  */
114368  func Xsqlite3_reset_auto_extension(tls *crt.TLS) {
114369  	var _1_mutex *Xsqlite3_mutex
114370  	if Xsqlite3_initialize(tls) == int32(0) {
114371  		_1_mutex = _sqlite3MutexAlloc(tls, int32(2))
114372  		Xsqlite3_mutex_enter(tls, _1_mutex)
114373  		Xsqlite3_free(tls, unsafe.Pointer(_sqlite3Autoext.XaExt))
114374  		_sqlite3Autoext.XaExt = nil
114375  		_sqlite3Autoext.XnExt = 0
114376  		Xsqlite3_mutex_leave(tls, _1_mutex)
114377  	}
114378  }
114379  
114380  func Xsqlite3_result_blob64(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n uint64, _xDel func(*crt.TLS, unsafe.Pointer)) {
114381  	func() {
114382  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
114383  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76438), unsafe.Pointer(&_sqlite3_result_blob64Ø00__func__Ø000), unsafe.Pointer(str(6567)))
114384  			crt.X__builtin_abort(tls)
114385  		}
114386  	}()
114387  	func() {
114388  		if *(*uintptr)(unsafe.Pointer(&struct {
114389  			f func(*crt.TLS, unsafe.Pointer)
114390  		}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114391  			f func(*crt.TLS, unsafe.Pointer)
114392  		}{func() func(*crt.TLS, unsafe.Pointer) {
114393  			v := _sqlite3MallocSize
114394  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114395  		}()})) {
114396  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76439), unsafe.Pointer(&_sqlite3_result_blob64Ø00__func__Ø000), unsafe.Pointer(str(130046)))
114397  			crt.X__builtin_abort(tls)
114398  		}
114399  	}()
114400  	if _n > uint64(2147483647) {
114401  		_invokeValueDestructor(tls, _z, _xDel, _pCtx)
114402  		goto _5
114403  	}
114404  	_setResultStrOrError(tls, _pCtx, (*int8)(_z), int32(_n), 0, _xDel)
114405  _5:
114406  }
114407  
114408  var _sqlite3_result_blob64Ø00__func__Ø000 [22]int8
114409  
114410  func init() {
114411  	crt.Xstrncpy(nil, &_sqlite3_result_blob64Ø00__func__Ø000[0], str(130129), 22)
114412  }
114413  
114414  func Xsqlite3_result_text64(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n uint64, _xDel func(*crt.TLS, unsafe.Pointer), _enc uint8) {
114415  	func() {
114416  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
114417  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76498), unsafe.Pointer(&_sqlite3_result_text64Ø00__func__Ø000), unsafe.Pointer(str(6567)))
114418  			crt.X__builtin_abort(tls)
114419  		}
114420  	}()
114421  	func() {
114422  		if *(*uintptr)(unsafe.Pointer(&struct {
114423  			f func(*crt.TLS, unsafe.Pointer)
114424  		}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114425  			f func(*crt.TLS, unsafe.Pointer)
114426  		}{func() func(*crt.TLS, unsafe.Pointer) {
114427  			v := _sqlite3MallocSize
114428  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114429  		}()})) {
114430  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76499), unsafe.Pointer(&_sqlite3_result_text64Ø00__func__Ø000), unsafe.Pointer(str(130046)))
114431  			crt.X__builtin_abort(tls)
114432  		}
114433  	}()
114434  	if int32(_enc) == int32(4) {
114435  		_enc = uint8(2)
114436  	}
114437  	if _n > uint64(2147483647) {
114438  		_invokeValueDestructor(tls, unsafe.Pointer(_z), _xDel, _pCtx)
114439  		goto _6
114440  	}
114441  	_setResultStrOrError(tls, _pCtx, _z, int32(_n), _enc, _xDel)
114442  _6:
114443  }
114444  
114445  var _sqlite3_result_text64Ø00__func__Ø000 [22]int8
114446  
114447  func init() {
114448  	crt.Xstrncpy(nil, &_sqlite3_result_text64Ø00__func__Ø000[0], str(130151), 22)
114449  }
114450  
114451  // C comment
114452  //  /* Make a copy of an sqlite3_value object
114453  //  */
114454  func Xsqlite3_value_dup(tls *crt.TLS, _pOrig *XMem) (r0 *XMem) {
114455  	var _pNew *XMem
114456  	if _pOrig == nil {
114457  		return nil
114458  	}
114459  	_pNew = (*XMem)(Xsqlite3_malloc(tls, int32(72)))
114460  	if _pNew == nil {
114461  		return nil
114462  	}
114463  	crt.Xmemset(tls, unsafe.Pointer(_pNew), int32(0), uint64(72))
114464  	crt.Xmemcpy(tls, unsafe.Pointer(_pNew), unsafe.Pointer(_pOrig), uint64(24))
114465  	{
114466  		p := &_pNew.Xflags
114467  		*p = uint16(int32(*p) & int32(-1025))
114468  	}
114469  	*(**Xsqlite3)(unsafe.Pointer(&_pNew.Xdb)) = nil
114470  	if (int32(_pNew.Xflags) & int32(18)) == 0 {
114471  		goto _2
114472  	}
114473  	{
114474  		p := &_pNew.Xflags
114475  		*p = uint16(int32(*p) & int32(-3073))
114476  	}
114477  	{
114478  		p := &_pNew.Xflags
114479  		*p = uint16(int32(*p) | int32(4096))
114480  	}
114481  	if _sqlite3VdbeMemMakeWriteable(tls, _pNew) != int32(0) {
114482  		_sqlite3ValueFree(tls, _pNew)
114483  		_pNew = nil
114484  	}
114485  _2:
114486  	return _pNew
114487  }
114488  
114489  // C comment
114490  //  /* Destroy an sqlite3_value object previously obtained from
114491  //  ** sqlite3_value_dup().
114492  //  */
114493  func Xsqlite3_value_free(tls *crt.TLS, _pOld *XMem) {
114494  	_sqlite3ValueFree(tls, _pOld)
114495  }
114496  
114497  func Xsqlite3_result_zeroblob64(tls *crt.TLS, _pCtx *Xsqlite3_context, _n uint64) (r0 int32) {
114498  	var _pOut *XMem
114499  	_pOut = (*XMem)(_pCtx.XpOut)
114500  	func() {
114501  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pOut.Xdb).Xmutex)) == 0 {
114502  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76546), unsafe.Pointer(&_sqlite3_result_zeroblob64Ø00__func__Ø000), unsafe.Pointer(str(130173)))
114503  			crt.X__builtin_abort(tls)
114504  		}
114505  	}()
114506  	if _n > uint64(*elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pOut.Xdb).XaLimit))), 0)) {
114507  		return int32(18)
114508  	}
114509  	_sqlite3VdbeMemSetZeroBlob(tls, (*XMem)(_pCtx.XpOut), int32(_n))
114510  	return int32(0)
114511  }
114512  
114513  var _sqlite3_result_zeroblob64Ø00__func__Ø000 [26]int8
114514  
114515  func init() {
114516  	crt.Xstrncpy(nil, &_sqlite3_result_zeroblob64Ø00__func__Ø000[0], str(130209), 26)
114517  }
114518  
114519  func Xsqlite3_bind_zeroblob64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _n uint64) (r0 int32) {
114520  	var _rc int32
114521  	var _p *TVdbe
114522  	_p = (*TVdbe)(_pStmt)
114523  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
114524  	if _n > uint64(*elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_p.Xdb).XaLimit))), 0)) {
114525  		_rc = int32(18)
114526  		goto _1
114527  	}
114528  	func() {
114529  		if (_n & uint64(2147483647)) != _n {
114530  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77558), unsafe.Pointer(&_sqlite3_bind_zeroblob64Ø00__func__Ø000), unsafe.Pointer(str(130235)))
114531  			crt.X__builtin_abort(tls)
114532  		}
114533  	}()
114534  	_rc = Xsqlite3_bind_zeroblob(tls, _pStmt, _i, int32(_n))
114535  _1:
114536  	_rc = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.Xdb), _rc)
114537  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
114538  	return _rc
114539  }
114540  
114541  var _sqlite3_bind_zeroblob64Ø00__func__Ø000 [24]int8
114542  
114543  func init() {
114544  	crt.Xstrncpy(nil, &_sqlite3_bind_zeroblob64Ø00__func__Ø000[0], str(130255), 24)
114545  }
114546  
114547  // C comment
114548  //  /*
114549  //  ** CAPI3REF: Finding The Subtype Of SQL Values
114550  //  ** METHOD: sqlite3_value
114551  //  **
114552  //  ** The sqlite3_value_subtype(V) function returns the subtype for
114553  //  ** an [application-defined SQL function] argument V.  The subtype
114554  //  ** information can be used to pass a limited amount of context from
114555  //  ** one SQL function to another.  Use the [sqlite3_result_subtype()]
114556  //  ** routine to set the subtype for the return value of an SQL function.
114557  //  **
114558  //  ** SQLite makes no use of subtype itself.  It merely passes the subtype
114559  //  ** from the result of one [application-defined SQL function] into the
114560  //  ** input of another.
114561  //  */
114562  func Xsqlite3_value_subtype(tls *crt.TLS, _pVal *XMem) (r0 uint32) {
114563  	var _pMem *XMem
114564  	_pMem = _pVal
114565  	return uint32(func() int32 {
114566  		if (int32(_pMem.Xflags) & int32(32768)) != 0 {
114567  			return int32(_pMem.XeSubtype)
114568  		}
114569  		return int32(0)
114570  	}())
114571  }
114572  
114573  // C comment
114574  //  /*
114575  //  ** CAPI3REF: Setting The Subtype Of An SQL Function
114576  //  ** METHOD: sqlite3_context
114577  //  **
114578  //  ** The sqlite3_result_subtype(C,T) function causes the subtype of
114579  //  ** the result from the [application-defined SQL function] with
114580  //  ** [sqlite3_context] C to be the value T.  Only the lower 8 bits
114581  //  ** of the subtype T are preserved in current versions of SQLite;
114582  //  ** higher order bits are discarded.
114583  //  ** The number of subtype bytes preserved by SQLite might increase
114584  //  ** in future releases of SQLite.
114585  //  */
114586  func Xsqlite3_result_subtype(tls *crt.TLS, _pCtx *Xsqlite3_context, _eSubtype uint32) {
114587  	var _pOut *XMem
114588  	_pOut = (*XMem)(_pCtx.XpOut)
114589  	func() {
114590  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pOut.Xdb).Xmutex)) == 0 {
114591  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76478), unsafe.Pointer(&_sqlite3_result_subtypeØ00__func__Ø000), unsafe.Pointer(str(130173)))
114592  			crt.X__builtin_abort(tls)
114593  		}
114594  	}()
114595  	_pOut.XeSubtype = uint8(_eSubtype & uint32(255))
114596  	{
114597  		p := &_pOut.Xflags
114598  		*p = uint16(int32(*p) | int32(32768))
114599  	}
114600  }
114601  
114602  var _sqlite3_result_subtypeØ00__func__Ø000 [23]int8
114603  
114604  func init() {
114605  	crt.Xstrncpy(nil, &_sqlite3_result_subtypeØ00__func__Ø000[0], str(130279), 23)
114606  }
114607  
114608  // C comment
114609  //  /*
114610  //  ** Flush any dirty pages in the pager-cache for any attached database
114611  //  ** to disk.
114612  //  */
114613  func Xsqlite3_db_cacheflush(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
114614  	var _i, _rc, _bSeenBusy int32
114615  	var _1_pBt *XBtree
114616  	var _2_pPager *XPager
114617  	_rc = int32(0)
114618  	_bSeenBusy = int32(0)
114619  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114620  		return _sqlite3MisuseError(tls, int32(141232))
114621  	}
114622  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114623  	_sqlite3BtreeEnterAll(tls, _db)
114624  	_i = int32(0)
114625  _1:
114626  	if _rc != int32(0) || _i >= _db.XnDb {
114627  		goto _5
114628  	}
114629  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
114630  	if _1_pBt == nil || _sqlite3BtreeIsInTrans(tls, _1_pBt) == 0 {
114631  		goto _7
114632  	}
114633  	_2_pPager = _sqlite3BtreePager(tls, _1_pBt)
114634  	_rc = _sqlite3PagerFlush(tls, _2_pPager)
114635  	if _rc == int32(5) {
114636  		_bSeenBusy = int32(1)
114637  		_rc = int32(0)
114638  	}
114639  _7:
114640  	_i += 1
114641  	goto _1
114642  _5:
114643  	_sqlite3BtreeLeaveAll(tls, _db)
114644  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114645  	return func() int32 {
114646  		if (_rc == int32(0)) && _bSeenBusy != 0 {
114647  			return int32(5)
114648  		}
114649  		return _rc
114650  	}()
114651  }
114652  
114653  // C comment
114654  //  /*
114655  //  ** Flush all unreferenced dirty pages to disk.
114656  //  */
114657  func _sqlite3PagerFlush(tls *crt.TLS, _pPager *XPager) (r0 int32) {
114658  	var _rc int32
114659  	var _1_pList, _2_pNext *XPgHdr
114660  	_rc = _pPager.XerrCode
114661  	if _pPager.XmemDb != 0 {
114662  		goto _0
114663  	}
114664  	_1_pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.XpPCache))
114665  	func() {
114666  		if _assert_pager_state(tls, _pPager) == 0 {
114667  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51520), unsafe.Pointer(&_sqlite3PagerFlushØ00__func__Ø000), unsafe.Pointer(str(10971)))
114668  			crt.X__builtin_abort(tls)
114669  		}
114670  	}()
114671  _3:
114672  	if _rc != int32(0) || _1_pList == nil {
114673  		goto _4
114674  	}
114675  	_2_pNext = (*XPgHdr)(_1_pList.XpDirty)
114676  	if int32(_1_pList.XnRef) == int32(0) {
114677  		_rc = _pagerStress(tls, unsafe.Pointer(_pPager), _1_pList)
114678  	}
114679  	_1_pList = _2_pNext
114680  	goto _3
114681  _4:
114682  _0:
114683  	return _rc
114684  }
114685  
114686  var _sqlite3PagerFlushØ00__func__Ø000 [18]int8
114687  
114688  func init() {
114689  	crt.Xstrncpy(nil, &_sqlite3PagerFlushØ00__func__Ø000[0], str(130302), 18)
114690  }
114691  
114692  // C comment
114693  //  /*
114694  //  ** CAPI3REF: Low-level system error code
114695  //  **
114696  //  ** ^Attempt to return the underlying operating system error code or error
114697  //  ** number that caused the most recent I/O error or failure to open a file.
114698  //  ** The return value is OS-dependent.  For example, on unix systems, after
114699  //  ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
114700  //  ** called to get back the underlying "errno" that caused the problem, such
114701  //  ** as ENOSPC, EAUTH, EISDIR, and so forth.
114702  //  */
114703  func Xsqlite3_system_errno(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
114704  	return func() int32 {
114705  		if _db != nil {
114706  			return _db.XiSysErrno
114707  		}
114708  		return int32(0)
114709  	}()
114710  }
114711  
114712  // C comment
114713  //  /* Register a trace callback using the version-2 interface.
114714  //  */
114715  func Xsqlite3_trace_v2(tls *crt.TLS, _db *Xsqlite3, _mTrace uint32, _xTrace func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, _pArg unsafe.Pointer) (r0 int32) {
114716  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114717  		return _sqlite3MisuseError(tls, int32(142326))
114718  	}
114719  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114720  	if _mTrace == (0) {
114721  		_xTrace = nil
114722  	}
114723  	if _xTrace == nil {
114724  		_mTrace = 0
114725  	}
114726  	_db.XmTrace = uint8(_mTrace)
114727  	_db.XxTrace = _xTrace
114728  	_db.XpTraceArg = _pArg
114729  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114730  	return int32(0)
114731  }
114732  
114733  // C comment
114734  //  /*
114735  //  ** Return the SQL associated with a prepared statement with
114736  //  ** bound parameters expanded.  Space to hold the returned string is
114737  //  ** obtained from sqlite3_malloc().  The caller is responsible for
114738  //  ** freeing the returned string by passing it to sqlite3_free().
114739  //  **
114740  //  ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
114741  //  ** expanded bound parameters.
114742  //  */
114743  func Xsqlite3_expanded_sql(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *int8) {
114744  	var _z, _zSql *int8
114745  	var _1_p *TVdbe
114746  	_z = nil
114747  	_zSql = Xsqlite3_sql(tls, _pStmt)
114748  	if _zSql != nil {
114749  		_1_p = (*TVdbe)(_pStmt)
114750  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_1_p.Xdb).Xmutex))
114751  		_z = _sqlite3VdbeExpandSql(tls, _1_p, _zSql)
114752  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_1_p.Xdb).Xmutex))
114753  	}
114754  	return _z
114755  }
114756  
114757  // C comment
114758  //  /*
114759  //  ** Set the value returned by the sqlite3_last_insert_rowid() API function.
114760  //  */
114761  func Xsqlite3_set_last_insert_rowid(tls *crt.TLS, _db *Xsqlite3, _iRowid int64) {
114762  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114763  		_sqlite3MisuseError(tls, int32(141398))
114764  		return
114765  	}
114766  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114767  	_db.XlastRowid = _iRowid
114768  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114769  }
114770  
114771  func _compileoptionusedFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
114772  	var _zOptName *int8
114773  	func() {
114774  		if _argc != int32(1) {
114775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106483), unsafe.Pointer(&_compileoptionusedFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
114776  			crt.X__builtin_abort(tls)
114777  		}
114778  	}()
114779  
114780  	if store1(&_zOptName, (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))) != nil {
114781  		Xsqlite3_result_int(tls, _context, Xsqlite3_compileoption_used(tls, _zOptName))
114782  	}
114783  }
114784  
114785  var _compileoptionusedFuncØ00__func__Ø000 [22]int8
114786  
114787  func init() {
114788  	crt.Xstrncpy(nil, &_compileoptionusedFuncØ00__func__Ø000[0], str(130320), 22)
114789  }
114790  
114791  func _compileoptiongetFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
114792  	var _n int32
114793  	func() {
114794  		if _argc != int32(1) {
114795  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106507), unsafe.Pointer(&_compileoptiongetFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
114796  			crt.X__builtin_abort(tls)
114797  		}
114798  	}()
114799  
114800  	_n = Xsqlite3_value_int(tls, *elem19(_argv, 0))
114801  	Xsqlite3_result_text(tls, _context, Xsqlite3_compileoption_get(tls, _n), int32(-1), nil)
114802  }
114803  
114804  var _compileoptiongetFuncØ00__func__Ø000 [21]int8
114805  
114806  func init() {
114807  	crt.Xstrncpy(nil, &_compileoptiongetFuncØ00__func__Ø000[0], str(130342), 21)
114808  }
114809  
114810  // C comment
114811  //  /*
114812  //  ** Implementation of the sqlite_version() function.  The result is the version
114813  //  ** of the SQLite library that is running.
114814  //  */
114815  func _versionFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
114816  	_ = _NotUsed2
114817  
114818  	Xsqlite3_result_text(tls, _context, Xsqlite3_libversion(tls), int32(-1), nil)
114819  }
114820  
114821  // C comment
114822  //  /*
114823  //  ** Implementation of the TRIM(), LTRIM(), and RTRIM() functions.
114824  //  ** The userdata is 0x1 for left trim, 0x2 for right trim, 0x3 for both.
114825  //  */
114826  func _trimFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
114827  	var _nIn, _flags, _i, _nChar, _17_len, _20_len int32
114828  	var _zIn, _zCharSet, _aLen, _4_z *uint8
114829  	var _azChar **uint8
114830  	_aLen = nil
114831  	_azChar = nil
114832  	if Xsqlite3_value_type(tls, *elem19(_argv, 0)) == int32(5) {
114833  		return
114834  	}
114835  	_zIn = Xsqlite3_value_text(tls, *elem19(_argv, 0))
114836  	if _zIn == nil {
114837  		return
114838  	}
114839  	_nIn = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
114840  	func() {
114841  		if _zIn != Xsqlite3_value_text(tls, *elem19(_argv, 0)) {
114842  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106818), unsafe.Pointer(&_trimFuncØ00__func__Ø000), unsafe.Pointer(str(130363)))
114843  			crt.X__builtin_abort(tls)
114844  		}
114845  	}()
114846  	if _argc == int32(1) {
114847  		_nChar = int32(1)
114848  		_aLen = (*uint8)(unsafe.Pointer(&_trimFuncØ00lenOneØ001))
114849  		_azChar = (**uint8)(unsafe.Pointer(&_trimFuncØ00azOneØ002))
114850  		_zCharSet = nil
114851  		goto _7
114852  	}
114853  	if store15(&_zCharSet, Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))) == nil {
114854  		return
114855  	}
114856  	*func() *int32 { _4_z = _zCharSet; return &_nChar }() = int32(0)
114857  _8:
114858  	if (*_4_z) == 0 {
114859  		goto _11
114860  	}
114861  	if int32(*postInc15(&_4_z, 1)) < int32(192) {
114862  		goto _12
114863  	}
114864  _13:
114865  	if (int32(*_4_z) & int32(192)) == int32(128) {
114866  		*(*uintptr)(unsafe.Pointer(&_4_z)) += uintptr(1)
114867  		goto _13
114868  	}
114869  _12:
114870  	_nChar += 1
114871  	goto _8
114872  _11:
114873  	if _nChar <= int32(0) {
114874  		goto _15
114875  	}
114876  	_azChar = (**uint8)(_contextMalloc(tls, _context, int64(uint64(int64(_nChar))*uint64(9))))
114877  	if _azChar == nil {
114878  		return
114879  	}
114880  	_aLen = (*uint8)(unsafe.Pointer(elem89(_azChar, uintptr(_nChar))))
114881  	*func() *int32 { _4_z = _zCharSet; return &_nChar }() = int32(0)
114882  _17:
114883  	if (*_4_z) == 0 {
114884  		goto _20
114885  	}
114886  	*elem89(_azChar, uintptr(_nChar)) = _4_z
114887  	if int32(*postInc15(&_4_z, 1)) < int32(192) {
114888  		goto _21
114889  	}
114890  _22:
114891  	if (int32(*_4_z) & int32(192)) == int32(128) {
114892  		*(*uintptr)(unsafe.Pointer(&_4_z)) += uintptr(1)
114893  		goto _22
114894  	}
114895  _21:
114896  	*elem15(_aLen, uintptr(_nChar)) = uint8(int64(uintptr(unsafe.Pointer(_4_z)) - uintptr(unsafe.Pointer(*elem89(_azChar, uintptr(_nChar))))))
114897  	_nChar += 1
114898  	goto _17
114899  _20:
114900  _15:
114901  _7:
114902  	if _nChar <= int32(0) {
114903  		goto _24
114904  	}
114905  	_flags = int32(int64(crt.P2U(Xsqlite3_user_data(tls, _context))))
114906  	if (_flags & int32(1)) == 0 {
114907  		goto _25
114908  	}
114909  _26:
114910  	if _nIn <= int32(0) {
114911  		goto _27
114912  	}
114913  	_17_len = int32(0)
114914  	_i = int32(0)
114915  _28:
114916  	if _i >= _nChar {
114917  		goto _31
114918  	}
114919  	_17_len = int32(*elem15(_aLen, uintptr(_i)))
114920  	if (_17_len <= _nIn) && (crt.Xmemcmp(tls, unsafe.Pointer(_zIn), unsafe.Pointer(*elem89(_azChar, uintptr(_i))), uint64(_17_len)) == int32(0)) {
114921  		goto _31
114922  	}
114923  	_i += 1
114924  	goto _28
114925  _31:
114926  	if _i >= _nChar {
114927  		goto _27
114928  	}
114929  	*(*uintptr)(unsafe.Pointer(&_zIn)) += uintptr(_17_len)
114930  	_nIn -= _17_len
114931  	goto _26
114932  _27:
114933  _25:
114934  	if (_flags & int32(2)) == 0 {
114935  		goto _35
114936  	}
114937  _36:
114938  	if _nIn <= int32(0) {
114939  		goto _37
114940  	}
114941  	_20_len = int32(0)
114942  	_i = int32(0)
114943  _38:
114944  	if _i >= _nChar {
114945  		goto _41
114946  	}
114947  	_20_len = int32(*elem15(_aLen, uintptr(_i)))
114948  	if (_20_len <= _nIn) && (crt.Xmemcmp(tls, unsafe.Pointer(elem15(_zIn, uintptr(_nIn-_20_len))), unsafe.Pointer(*elem89(_azChar, uintptr(_i))), uint64(_20_len)) == int32(0)) {
114949  		goto _41
114950  	}
114951  	_i += 1
114952  	goto _38
114953  _41:
114954  	if _i >= _nChar {
114955  		goto _37
114956  	}
114957  	_nIn -= _20_len
114958  	goto _36
114959  _37:
114960  _35:
114961  	if _zCharSet != nil {
114962  		Xsqlite3_free(tls, unsafe.Pointer(_azChar))
114963  	}
114964  _24:
114965  	Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(_zIn)), _nIn, func() func(*crt.TLS, unsafe.Pointer) {
114966  		v := uint64(18446744073709551615)
114967  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114968  	}())
114969  }
114970  
114971  var _trimFuncØ00__func__Ø000 [9]int8
114972  
114973  func init() {
114974  	crt.Xstrncpy(nil, &_trimFuncØ00__func__Ø000[0], str(130396), 9)
114975  }
114976  
114977  var _trimFuncØ00lenOneØ001 [1]uint8
114978  
114979  func init() {
114980  	_trimFuncØ00lenOneØ001 = [1]uint8{1}
114981  }
114982  
114983  var _trimFuncØ00azOneØ002 [1]*uint8
114984  
114985  func init() {
114986  	_trimFuncØ00azOneØ002 = [1]*uint8{(*byte)(unsafe.Pointer(str(119962)))}
114987  }
114988  
114989  // C comment
114990  //  /*
114991  //  ** Allocate nByte bytes of space using sqlite3Malloc(). If the
114992  //  ** allocation fails, call sqlite3_result_error_nomem() to notify
114993  //  ** the database handle that malloc() has failed and return NULL.
114994  //  ** If nByte is larger than the maximum string or blob length, then
114995  //  ** raise an SQLITE_TOOBIG exception and return NULL.
114996  //  */
114997  func _contextMalloc(tls *crt.TLS, _context *Xsqlite3_context, _nByte int64) (r0 unsafe.Pointer) {
114998  	var _z *int8
114999  	var _db *Xsqlite3
115000  	_db = Xsqlite3_context_db_handle(tls, _context)
115001  	func() {
115002  		if _nByte <= (0) {
115003  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105944), unsafe.Pointer(&_contextMallocØ00__func__Ø000), unsafe.Pointer(str(130405)))
115004  			crt.X__builtin_abort(tls)
115005  		}
115006  	}()
115007  	if _nByte > int64(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
115008  		Xsqlite3_result_error_toobig(tls, _context)
115009  		_z = nil
115010  		goto _3
115011  	}
115012  	_z = (*int8)(_sqlite3Malloc(tls, uint64(_nByte)))
115013  	if _z == nil {
115014  		Xsqlite3_result_error_nomem(tls, _context)
115015  	}
115016  _3:
115017  	return unsafe.Pointer(_z)
115018  }
115019  
115020  var _contextMallocØ00__func__Ø000 [14]int8
115021  
115022  func init() {
115023  	crt.Xstrncpy(nil, &_contextMallocØ00__func__Ø000[0], str(130413), 14)
115024  }
115025  
115026  // C comment
115027  //  /*
115028  //  ** Implementation of the non-aggregate min() and max() functions
115029  //  */
115030  func _minmaxFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115031  	var _i, _mask, _iBest int32
115032  	var _pColl *XCollSeq
115033  	func() {
115034  		if _argc <= int32(1) {
115035  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105594), unsafe.Pointer(&_minmaxFuncØ00__func__Ø000), unsafe.Pointer(str(130427)))
115036  			crt.X__builtin_abort(tls)
115037  		}
115038  	}()
115039  	_mask = func() int32 {
115040  		if Xsqlite3_user_data(tls, _context) == nil {
115041  			return int32(0)
115042  		}
115043  		return int32(-1)
115044  	}()
115045  	_pColl = _sqlite3GetFuncCollSeq(tls, _context)
115046  	func() {
115047  		if _pColl == nil {
115048  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105597), unsafe.Pointer(&_minmaxFuncØ00__func__Ø000), unsafe.Pointer(str(130434)))
115049  			crt.X__builtin_abort(tls)
115050  		}
115051  	}()
115052  	func() {
115053  		if _mask != int32(-1) && _mask != int32(0) {
115054  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105598), unsafe.Pointer(&_minmaxFuncØ00__func__Ø000), unsafe.Pointer(str(130440)))
115055  			crt.X__builtin_abort(tls)
115056  		}
115057  	}()
115058  	_iBest = int32(0)
115059  	if Xsqlite3_value_type(tls, *elem19(_argv, 0)) == int32(5) {
115060  		return
115061  	}
115062  	_i = int32(1)
115063  _10:
115064  	if _i >= _argc {
115065  		goto _13
115066  	}
115067  	if Xsqlite3_value_type(tls, *elem19(_argv, uintptr(_i))) == int32(5) {
115068  		return
115069  	}
115070  	if (_sqlite3MemCompare(tls, *elem19(_argv, uintptr(_iBest)), *elem19(_argv, uintptr(_i)), _pColl) ^ _mask) >= int32(0) {
115071  		_iBest = _i
115072  	}
115073  	_i += 1
115074  	goto _10
115075  _13:
115076  	Xsqlite3_result_value(tls, _context, *elem19(_argv, uintptr(_iBest)))
115077  }
115078  
115079  var _minmaxFuncØ00__func__Ø000 [11]int8
115080  
115081  func init() {
115082  	crt.Xstrncpy(nil, &_minmaxFuncØ00__func__Ø000[0], str(130460), 11)
115083  }
115084  
115085  // C comment
115086  //  /*
115087  //  ** Return the collating function associated with a function.
115088  //  */
115089  func _sqlite3GetFuncCollSeq(tls *crt.TLS, _context *Xsqlite3_context) (r0 *XCollSeq) {
115090  	var _pOp *XVdbeOp
115091  	func() {
115092  		if (*TVdbe)(_context.XpVdbe) == nil {
115093  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105566), unsafe.Pointer(&_sqlite3GetFuncCollSeqØ00__func__Ø000), unsafe.Pointer(str(130471)))
115094  			crt.X__builtin_abort(tls)
115095  		}
115096  	}()
115097  	_pOp = elem63((*XVdbeOp)((*TVdbe)(_context.XpVdbe).XaOp), uintptr(_context.XiOp-int32(1)))
115098  	func() {
115099  		if int32(_pOp.Xopcode) != int32(68) {
115100  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105568), unsafe.Pointer(&_sqlite3GetFuncCollSeqØ00__func__Ø000), unsafe.Pointer(str(130489)))
115101  			crt.X__builtin_abort(tls)
115102  		}
115103  	}()
115104  	func() {
115105  		if int32(_pOp.Xp4type) != int32(-3) {
115106  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105569), unsafe.Pointer(&_sqlite3GetFuncCollSeqØ00__func__Ø000), unsafe.Pointer(str(62535)))
115107  			crt.X__builtin_abort(tls)
115108  		}
115109  	}()
115110  	return (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
115111  }
115112  
115113  var _sqlite3GetFuncCollSeqØ00__func__Ø000 [22]int8
115114  
115115  func init() {
115116  	crt.Xstrncpy(nil, &_sqlite3GetFuncCollSeqØ00__func__Ø000[0], str(130513), 22)
115117  }
115118  
115119  // C comment
115120  //  /*
115121  //  ** Routines to implement min() and max() aggregate functions.
115122  //  */
115123  func _minmaxStep(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
115124  	var _2_max, _2_cmp int32
115125  	var _pArg, _pBest *XMem
115126  	var _2_pColl *XCollSeq
115127  	_pArg = *elem19(_argv, 0)
115128  
115129  	_pBest = (*XMem)(Xsqlite3_aggregate_context(tls, _context, int32(72)))
115130  	if _pBest == nil {
115131  		return
115132  	}
115133  	if Xsqlite3_value_type(tls, *elem19(_argv, 0)) != int32(5) {
115134  		goto _1
115135  	}
115136  	if _pBest.Xflags != 0 {
115137  		_sqlite3SkipAccumulatorLoad(tls, _context)
115138  	}
115139  	goto _10
115140  _1:
115141  	if _pBest.Xflags == 0 {
115142  		goto _4
115143  	}
115144  	_2_pColl = _sqlite3GetFuncCollSeq(tls, _context)
115145  	_2_max = bool2int(Xsqlite3_user_data(tls, _context) != nil)
115146  	_2_cmp = _sqlite3MemCompare(tls, _pBest, _pArg, _2_pColl)
115147  	if (_2_max != 0 && (_2_cmp < int32(0))) || ((_2_max == 0) && (_2_cmp > int32(0))) {
115148  		_sqlite3VdbeMemCopy(tls, _pBest, _pArg)
115149  		goto _9
115150  	}
115151  	_sqlite3SkipAccumulatorLoad(tls, _context)
115152  _9:
115153  	goto _10
115154  _4:
115155  	*(**Xsqlite3)(unsafe.Pointer(&_pBest.Xdb)) = Xsqlite3_context_db_handle(tls, _context)
115156  	_sqlite3VdbeMemCopy(tls, _pBest, _pArg)
115157  _10:
115158  }
115159  
115160  // C comment
115161  //  /*
115162  //  ** Indicate that the accumulator load should be skipped on this
115163  //  ** iteration of the aggregate loop.
115164  //  */
115165  func _sqlite3SkipAccumulatorLoad(tls *crt.TLS, _context *Xsqlite3_context) {
115166  	_context.XskipFlag = uint8(1)
115167  }
115168  
115169  func _minMaxFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
115170  	var _pRes *XMem
115171  	_pRes = (*XMem)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
115172  	if _pRes == nil {
115173  		goto _0
115174  	}
115175  	if _pRes.Xflags != 0 {
115176  		Xsqlite3_result_value(tls, _context, _pRes)
115177  	}
115178  	_sqlite3VdbeMemRelease(tls, _pRes)
115179  _0:
115180  }
115181  
115182  // C comment
115183  //  /*
115184  //  ** Return the type of the argument.
115185  //  */
115186  func _typeofFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
115187  	var _z *int8
115188  	_z = nil
115189  
115190  	switch Xsqlite3_value_type(tls, *elem19(_argv, 0)) {
115191  	case int32(1):
115192  		goto _1
115193  	case int32(2):
115194  		goto _3
115195  	case int32(3):
115196  		goto _2
115197  	case int32(4):
115198  		goto _4
115199  	default:
115200  		goto _5
115201  	}
115202  
115203  _1:
115204  	_z = str(42830)
115205  	goto _6
115206  _2:
115207  	_z = str(42817)
115208  	goto _6
115209  _3:
115210  	_z = str(42838)
115211  	goto _6
115212  _4:
115213  	_z = str(42812)
115214  	goto _6
115215  _5:
115216  	_z = str(128774)
115217  	goto _6
115218  _6:
115219  	Xsqlite3_result_text(tls, _context, _z, int32(-1), nil)
115220  }
115221  
115222  // C comment
115223  //  /*
115224  //  ** Implementation of the length() function
115225  //  */
115226  func _lengthFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115227  	var _len int32
115228  	var _3_z *uint8
115229  	func() {
115230  		if _argc != int32(1) {
115231  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105642), unsafe.Pointer(&_lengthFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
115232  			crt.X__builtin_abort(tls)
115233  		}
115234  	}()
115235  
115236  	switch Xsqlite3_value_type(tls, *elem19(_argv, 0)) {
115237  	case int32(1):
115238  		goto _3
115239  	case int32(2):
115240  		goto _3
115241  	case int32(3):
115242  		goto _6
115243  	case int32(4):
115244  		goto _3
115245  	default:
115246  		goto _7
115247  	}
115248  
115249  _3:
115250  	Xsqlite3_result_int(tls, _context, Xsqlite3_value_bytes(tls, *elem19(_argv, 0)))
115251  	goto _8
115252  _6:
115253  	_3_z = Xsqlite3_value_text(tls, *elem19(_argv, 0))
115254  	if _3_z == nil {
115255  		return
115256  	}
115257  	_len = int32(0)
115258  _10:
115259  	if (*_3_z) == 0 {
115260  		goto _11
115261  	}
115262  	_len += 1
115263  	if int32(*postInc15(&_3_z, 1)) < int32(192) {
115264  		goto _12
115265  	}
115266  _13:
115267  	if (int32(*_3_z) & int32(192)) == int32(128) {
115268  		*(*uintptr)(unsafe.Pointer(&_3_z)) += uintptr(1)
115269  		goto _13
115270  	}
115271  _12:
115272  	goto _10
115273  _11:
115274  	Xsqlite3_result_int(tls, _context, _len)
115275  	goto _8
115276  _7:
115277  	Xsqlite3_result_null(tls, _context)
115278  	goto _8
115279  _8:
115280  }
115281  
115282  var _lengthFuncØ00__func__Ø000 [11]int8
115283  
115284  func init() {
115285  	crt.Xstrncpy(nil, &_lengthFuncØ00__func__Ø000[0], str(130535), 11)
115286  }
115287  
115288  // C comment
115289  //  /*
115290  //  ** Implementation of the instr() function.
115291  //  **
115292  //  ** instr(haystack,needle) finds the first occurrence of needle
115293  //  ** in haystack and returns the number of previous characters plus 1,
115294  //  ** or 0 if needle does not occur within haystack.
115295  //  **
115296  //  ** If both haystack and needle are BLOBs, then the result is one more than
115297  //  ** the number of bytes in haystack prior to the first occurrence of needle,
115298  //  ** or 0 if needle never occurs in haystack.
115299  //  */
115300  func _instrFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115301  	var _nHaystack, _nNeedle, _typeHaystack, _typeNeedle, _N, _isText int32
115302  	var _zHaystack, _zNeedle *uint8
115303  	_N = int32(1)
115304  
115305  	_typeHaystack = Xsqlite3_value_type(tls, *elem19(_argv, 0))
115306  	_typeNeedle = Xsqlite3_value_type(tls, *elem19(_argv, uintptr(1)))
115307  	if (_typeHaystack == int32(5)) || (_typeNeedle == int32(5)) {
115308  		return
115309  	}
115310  	_nHaystack = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115311  	_nNeedle = Xsqlite3_value_bytes(tls, *elem19(_argv, uintptr(1)))
115312  	if _nNeedle <= int32(0) {
115313  		goto _2
115314  	}
115315  	if (_typeHaystack == int32(4)) && (_typeNeedle == int32(4)) {
115316  		_zHaystack = (*uint8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
115317  		_zNeedle = (*uint8)(Xsqlite3_value_blob(tls, *elem19(_argv, uintptr(1))))
115318  		_isText = int32(0)
115319  		goto _5
115320  	}
115321  	_zHaystack = Xsqlite3_value_text(tls, *elem19(_argv, 0))
115322  	_zNeedle = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
115323  	_isText = int32(1)
115324  _5:
115325  	if (_zNeedle == nil) || (_nHaystack != 0 && (_zHaystack == nil)) {
115326  		return
115327  	}
115328  _8:
115329  	if _nNeedle > _nHaystack || crt.Xmemcmp(tls, unsafe.Pointer(_zHaystack), unsafe.Pointer(_zNeedle), uint64(_nNeedle)) == int32(0) {
115330  		goto _10
115331  	}
115332  	_N += 1
115333  _12:
115334  	_nHaystack -= 1
115335  	*(*uintptr)(unsafe.Pointer(&_zHaystack)) += uintptr(1)
115336  	if _isText != 0 && ((int32(*elem15(_zHaystack, 0)) & int32(192)) == int32(128)) {
115337  		goto _12
115338  	}
115339  	goto _8
115340  _10:
115341  	if _nNeedle > _nHaystack {
115342  		_N = int32(0)
115343  	}
115344  _2:
115345  	Xsqlite3_result_int(tls, _context, _N)
115346  }
115347  
115348  // C comment
115349  //  /*
115350  //  ** Implementation of the printf() function.
115351  //  */
115352  func _printfFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115353  	var _n int32
115354  	var _zFormat *int8
115355  	var _db *Xsqlite3
115356  	var _str XStrAccum
115357  	var _x XPrintfArguments
115358  	_db = Xsqlite3_context_db_handle(tls, _context)
115359  	if (_argc >= int32(1)) && (store1(&_zFormat, (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))) != nil) {
115360  		_x.XnArg = _argc - int32(1)
115361  		_x.XnUsed = int32(0)
115362  		*(***XMem)(unsafe.Pointer(&_x.XapArg)) = (**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(int32(1))*uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(8)))))))))))
115363  		_sqlite3StrAccumInit(tls, &_str, _db, nil, int32(0), *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0))
115364  		_str.XprintfFlags = uint8(2)
115365  		_sqlite3XPrintf(tls, &_str, _zFormat, unsafe.Pointer(&_x))
115366  		_n = int32(_str.XnChar)
115367  		Xsqlite3_result_text(tls, _context, _sqlite3StrAccumFinish(tls, &_str), _n, func() func(*crt.TLS, unsafe.Pointer) {
115368  			v := _sqlite3MallocSize
115369  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
115370  		}())
115371  	}
115372  }
115373  
115374  // C comment
115375  //  /*
115376  //  ** The unicode() function.  Return the integer unicode code-point value
115377  //  ** for the first character of the input string.
115378  //  */
115379  func _unicodeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115380  	var _z *uint8
115381  	_z = Xsqlite3_value_text(tls, *elem19(_argv, 0))
115382  
115383  	if (_z != nil) && ((*elem15(_z, 0)) != 0) {
115384  		Xsqlite3_result_int(tls, _context, int32(_sqlite3Utf8Read(tls, &_z)))
115385  	}
115386  }
115387  
115388  // C comment
115389  //  /*
115390  //  ** The char() function takes zero or more arguments, each of which is
115391  //  ** an integer.  It constructs a string where each character of the string
115392  //  ** is the unicode character for the corresponding integer argument.
115393  //  */
115394  func _charFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115395  	var _i int32
115396  	var _2_x int64
115397  	var _2_c uint32
115398  	var _z, _zOut *uint8
115399  	_zOut = store15(&_z, (*uint8)(Xsqlite3_malloc64(tls, uint64((_argc*int32(4))+int32(1)))))
115400  	if _z == nil {
115401  		Xsqlite3_result_error_nomem(tls, _context)
115402  		return
115403  	}
115404  	_i = int32(0)
115405  _1:
115406  	if _i >= _argc {
115407  		goto _4
115408  	}
115409  	_2_x = Xsqlite3_value_int64(tls, *elem19(_argv, uintptr(_i)))
115410  	if (_2_x < (0)) || (_2_x > int64(1114111)) {
115411  		_2_x = int64(65533)
115412  	}
115413  	_2_c = uint32(_2_x & int64(2097151))
115414  	if _2_c < uint32(128) {
115415  		*postInc15(&_zOut, 1) = uint8(_2_c & uint32(255))
115416  		goto _12
115417  	}
115418  	if _2_c < uint32(2048) {
115419  		*postInc15(&_zOut, 1) = uint8(int32(192) + int32(uint8((_2_c>>6)&uint32(31))))
115420  		*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8(_2_c&uint32(63))))
115421  		goto _12
115422  	}
115423  	if _2_c < uint32(65536) {
115424  		*postInc15(&_zOut, 1) = uint8(int32(224) + int32(uint8((_2_c>>12)&uint32(15))))
115425  		*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8((_2_c>>6)&uint32(63))))
115426  		*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8(_2_c&uint32(63))))
115427  		goto _12
115428  	}
115429  	*postInc15(&_zOut, 1) = uint8(int32(240) + int32(uint8((_2_c>>18)&uint32(7))))
115430  	*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8((_2_c>>12)&uint32(63))))
115431  	*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8((_2_c>>6)&uint32(63))))
115432  	*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8(_2_c&uint32(63))))
115433  _12:
115434  	_i += 1
115435  	goto _1
115436  _4:
115437  	Xsqlite3_result_text64(tls, _context, (*int8)(unsafe.Pointer(_z)), uint64(int64(uintptr(unsafe.Pointer(_zOut))-uintptr(unsafe.Pointer(_z)))), Xsqlite3_free, uint8(1))
115438  }
115439  
115440  // C comment
115441  //  /*
115442  //  ** Implementation of the abs() function.
115443  //  **
115444  //  ** IMP: R-23979-26855 The abs(X) function returns the absolute value of
115445  //  ** the numeric argument X.
115446  //  */
115447  func _absFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115448  	var _2_iVal int64
115449  	var _6_rVal float64
115450  	func() {
115451  		if _argc != int32(1) {
115452  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105676), unsafe.Pointer(&_absFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
115453  			crt.X__builtin_abort(tls)
115454  		}
115455  	}()
115456  
115457  	switch Xsqlite3_value_type(tls, *elem19(_argv, 0)) {
115458  	case int32(1):
115459  		goto _3
115460  	case int32(5):
115461  		goto _4
115462  	default:
115463  		goto _5
115464  	}
115465  
115466  _3:
115467  	_2_iVal = Xsqlite3_value_int64(tls, *elem19(_argv, 0))
115468  	if _2_iVal >= (0) {
115469  		goto _6
115470  	}
115471  	if _2_iVal == int64(-9223372036854775808) {
115472  		Xsqlite3_result_error(tls, _context, str(130546), int32(-1))
115473  		return
115474  	}
115475  	_2_iVal = -_2_iVal
115476  _6:
115477  	Xsqlite3_result_int64(tls, _context, _2_iVal)
115478  	goto _8
115479  _4:
115480  	Xsqlite3_result_null(tls, _context)
115481  	goto _8
115482  _5:
115483  	_6_rVal = Xsqlite3_value_double(tls, *elem19(_argv, 0))
115484  	if _6_rVal < (0) {
115485  		_6_rVal = -_6_rVal
115486  	}
115487  	Xsqlite3_result_double(tls, _context, _6_rVal)
115488  	goto _8
115489  _8:
115490  }
115491  
115492  var _absFuncØ00__func__Ø000 [8]int8
115493  
115494  func init() {
115495  	crt.Xstrncpy(nil, &_absFuncØ00__func__Ø000[0], str(130563), 8)
115496  }
115497  
115498  func _roundFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115499  	var _n int32
115500  	var _zBuf *int8
115501  	var _r float64
115502  	_n = int32(0)
115503  	func() {
115504  		if _argc != int32(1) && _argc != int32(2) {
115505  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105904), unsafe.Pointer(&_roundFuncØ00__func__Ø000), unsafe.Pointer(str(130571)))
115506  			crt.X__builtin_abort(tls)
115507  		}
115508  	}()
115509  	if _argc != int32(2) {
115510  		goto _3
115511  	}
115512  	if int32(5) == Xsqlite3_value_type(tls, *elem19(_argv, uintptr(1))) {
115513  		return
115514  	}
115515  	_n = Xsqlite3_value_int(tls, *elem19(_argv, uintptr(1)))
115516  	if _n > int32(30) {
115517  		_n = int32(30)
115518  	}
115519  	if _n < int32(0) {
115520  		_n = int32(0)
115521  	}
115522  _3:
115523  	if Xsqlite3_value_type(tls, *elem19(_argv, 0)) == int32(5) {
115524  		return
115525  	}
115526  	_r = Xsqlite3_value_double(tls, *elem19(_argv, 0))
115527  	if ((_n == int32(0)) && (_r >= (0))) && (_r < (9.223372036854776e+18)) {
115528  		_r = float64(int64(_r + (0.5)))
115529  		goto _15
115530  	}
115531  	if ((_n == int32(0)) && (_r < (0))) && ((-_r) < (9.223372036854776e+18)) {
115532  		_r = -float64(int64((-_r) + (0.5)))
115533  		goto _15
115534  	}
115535  	_zBuf = Xsqlite3_mprintf(tls, str(130590), _n, _r)
115536  	if _zBuf == nil {
115537  		Xsqlite3_result_error_nomem(tls, _context)
115538  		return
115539  	}
115540  	_sqlite3AtoF(tls, _zBuf, &_r, _sqlite3Strlen30(tls, _zBuf), uint8(1))
115541  	Xsqlite3_free(tls, unsafe.Pointer(_zBuf))
115542  _15:
115543  	Xsqlite3_result_double(tls, _context, _r)
115544  }
115545  
115546  var _roundFuncØ00__func__Ø000 [10]int8
115547  
115548  func init() {
115549  	crt.Xstrncpy(nil, &_roundFuncØ00__func__Ø000[0], str(130595), 10)
115550  }
115551  
115552  // C comment
115553  //  /*
115554  //  ** Implementation of the upper() and lower() SQL functions.
115555  //  */
115556  func _upperFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115557  	var _i, _n int32
115558  	var _z1, _z2 *int8
115559  
115560  	_z2 = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
115561  	_n = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115562  	func() {
115563  		if _z2 != (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0)))) {
115564  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105970), unsafe.Pointer(&_upperFuncØ00__func__Ø000), unsafe.Pointer(str(130605)))
115565  			crt.X__builtin_abort(tls)
115566  		}
115567  	}()
115568  	if _z2 == nil {
115569  		goto _2
115570  	}
115571  	_z1 = (*int8)(_contextMalloc(tls, _context, int64(_n)+int64(1)))
115572  	if _z1 == nil {
115573  		goto _3
115574  	}
115575  	_i = int32(0)
115576  _4:
115577  	if _i >= _n {
115578  		goto _7
115579  	}
115580  	*elem1(_z1, uintptr(_i)) = int8(int32(*elem1(_z2, uintptr(_i))) & (^(int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_z2, uintptr(_i)))))) & int32(32))))
115581  	_i += 1
115582  	goto _4
115583  _7:
115584  	Xsqlite3_result_text(tls, _context, _z1, _n, Xsqlite3_free)
115585  _3:
115586  _2:
115587  }
115588  
115589  var _upperFuncØ00__func__Ø000 [10]int8
115590  
115591  func init() {
115592  	crt.Xstrncpy(nil, &_upperFuncØ00__func__Ø000[0], str(130644), 10)
115593  }
115594  
115595  func _lowerFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115596  	var _i, _n int32
115597  	var _z1, _z2 *int8
115598  
115599  	_z2 = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
115600  	_n = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115601  	func() {
115602  		if _z2 != (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0)))) {
115603  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105989), unsafe.Pointer(&_lowerFuncØ00__func__Ø000), unsafe.Pointer(str(130605)))
115604  			crt.X__builtin_abort(tls)
115605  		}
115606  	}()
115607  	if _z2 == nil {
115608  		goto _2
115609  	}
115610  	_z1 = (*int8)(_contextMalloc(tls, _context, int64(_n)+int64(1)))
115611  	if _z1 == nil {
115612  		goto _3
115613  	}
115614  	_i = int32(0)
115615  _4:
115616  	if _i >= _n {
115617  		goto _7
115618  	}
115619  	*elem1(_z1, uintptr(_i)) = int8(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_z2, uintptr(_i))))))
115620  	_i += 1
115621  	goto _4
115622  _7:
115623  	Xsqlite3_result_text(tls, _context, _z1, _n, Xsqlite3_free)
115624  _3:
115625  _2:
115626  }
115627  
115628  var _lowerFuncØ00__func__Ø000 [10]int8
115629  
115630  func init() {
115631  	crt.Xstrncpy(nil, &_lowerFuncØ00__func__Ø000[0], str(130654), 10)
115632  }
115633  
115634  // C comment
115635  //  /*
115636  //  ** The hex() function.  Interpret the argument as a blob.  Return
115637  //  ** a hexadecimal rendering as text.
115638  //  */
115639  func _hexFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115640  	var _i, _n int32
115641  	var _zHex, _z *int8
115642  	var _2_c uint8
115643  	var _pBlob *uint8
115644  	func() {
115645  		if _argc != int32(1) {
115646  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106671), unsafe.Pointer(&_hexFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
115647  			crt.X__builtin_abort(tls)
115648  		}
115649  	}()
115650  
115651  	_pBlob = (*uint8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
115652  	_n = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115653  	func() {
115654  		if _pBlob != (*uint8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0))) {
115655  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106675), unsafe.Pointer(&_hexFuncØ00__func__Ø000), unsafe.Pointer(str(130664)))
115656  			crt.X__builtin_abort(tls)
115657  		}
115658  	}()
115659  	_z = store1(&_zHex, (*int8)(_contextMalloc(tls, _context, (int64(_n)*int64(2))+int64(1))))
115660  	if _zHex == nil {
115661  		goto _4
115662  	}
115663  	_i = int32(0)
115664  _5:
115665  	if _i >= _n {
115666  		goto _8
115667  	}
115668  	_2_c = *_pBlob
115669  	*postInc1(&_z, 1) = *elem1((*int8)(unsafe.Pointer(&_hexdigits)), uintptr((int32(_2_c)>>4)&int32(15)))
115670  	*postInc1(&_z, 1) = *elem1((*int8)(unsafe.Pointer(&_hexdigits)), uintptr(int32(_2_c)&int32(15)))
115671  	*(*uintptr)(unsafe.Pointer(func() **uint8 { _i += 1; return &_pBlob }())) += uintptr(1)
115672  	goto _5
115673  _8:
115674  	*_z = 0
115675  	Xsqlite3_result_text(tls, _context, _zHex, _n*int32(2), Xsqlite3_free)
115676  _4:
115677  }
115678  
115679  var _hexFuncØ00__func__Ø000 [8]int8
115680  
115681  func init() {
115682  	crt.Xstrncpy(nil, &_hexFuncØ00__func__Ø000[0], str(130699), 8)
115683  }
115684  
115685  // C comment
115686  //  /* Array for converting from half-bytes (nybbles) into ASCII hex
115687  //  ** digits. */
115688  var _hexdigits [16]int8
115689  
115690  func init() {
115691  	_hexdigits = [16]int8{48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70}
115692  }
115693  
115694  // C comment
115695  //  /*
115696  //  ** Implementation of random().  Return a random integer.
115697  //  */
115698  func _randomFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
115699  	var _r int64
115700  	_ = _NotUsed2
115701  
115702  	Xsqlite3_randomness(tls, int32(8), unsafe.Pointer(&_r))
115703  	if _r < (0) {
115704  		_r = -(_r & int64(9223372036854775807))
115705  	}
115706  	Xsqlite3_result_int64(tls, _context, _r)
115707  }
115708  
115709  // C comment
115710  //  /*
115711  //  ** Implementation of randomblob(N).  Return a random blob
115712  //  ** that is N bytes long.
115713  //  */
115714  func _randomBlob(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115715  	var _n int32
115716  	var _p *uint8
115717  	func() {
115718  		if _argc != int32(1) {
115719  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106047), unsafe.Pointer(&_randomBlobØ00__func__Ø000), unsafe.Pointer(str(125396)))
115720  			crt.X__builtin_abort(tls)
115721  		}
115722  	}()
115723  
115724  	_n = Xsqlite3_value_int(tls, *elem19(_argv, 0))
115725  	if _n < int32(1) {
115726  		_n = int32(1)
115727  	}
115728  	_p = (*uint8)(_contextMalloc(tls, _context, int64(_n)))
115729  	if _p != nil {
115730  		Xsqlite3_randomness(tls, _n, unsafe.Pointer(_p))
115731  		Xsqlite3_result_blob(tls, _context, unsafe.Pointer(_p), _n, Xsqlite3_free)
115732  	}
115733  }
115734  
115735  var _randomBlobØ00__func__Ø000 [11]int8
115736  
115737  func init() {
115738  	crt.Xstrncpy(nil, &_randomBlobØ00__func__Ø000[0], str(130707), 11)
115739  }
115740  
115741  // C comment
115742  //  /*
115743  //  ** Implementation of the NULLIF(x,y) function.  The result is the first
115744  //  ** argument if the arguments are different.  The result is NULL if the
115745  //  ** arguments are equal to each other.
115746  //  */
115747  func _nullifFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
115748  	var _pColl *XCollSeq
115749  	_pColl = _sqlite3GetFuncCollSeq(tls, _context)
115750  
115751  	if _sqlite3MemCompare(tls, *elem19(_argv, 0), *elem19(_argv, uintptr(1)), _pColl) != int32(0) {
115752  		Xsqlite3_result_value(tls, _context, *elem19(_argv, 0))
115753  	}
115754  }
115755  
115756  // C comment
115757  //  /*
115758  //  ** Implementation of the sqlite_source_id() function. The result is a string
115759  //  ** that identifies the particular version of the source code used to build
115760  //  ** SQLite.
115761  //  */
115762  func _sourceidFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
115763  	_ = _NotUsed2
115764  
115765  	Xsqlite3_result_text(tls, _context, Xsqlite3_sourceid(tls), int32(-1), nil)
115766  }
115767  
115768  // C comment
115769  //  /*
115770  //  ** Implementation of the sqlite_log() function.  This is a wrapper around
115771  //  ** sqlite3_log().  The return value is NULL.  The function exists purely for
115772  //  ** its side-effects.
115773  //  */
115774  func _errlogFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115775  	Xsqlite3_log(tls, Xsqlite3_value_int(tls, *elem19(_argv, 0)), str(24531), unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))))
115776  }
115777  
115778  // C comment
115779  //  /*
115780  //  ** Implementation of the QUOTE() function.  This function takes a single
115781  //  ** argument.  If the argument is numeric, the return value is the same as
115782  //  ** the argument.  If the argument is NULL, the return value is the string
115783  //  ** "NULL".  Otherwise, the argument is enclosed in single quotes with
115784  //  ** single-quote escapes.
115785  //  */
115786  func _quoteFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115787  	var _5_nBlob, _6_i, _8_i, _8_j int32
115788  	var _8_n uint64
115789  	var _5_zText, _5_zBlob, _8_z *int8
115790  	var _2_r1, _2_r2 float64
115791  	var _8_zArg *uint8
115792  	var _2_zBuf [50]int8
115793  	func() {
115794  		if _argc != int32(1) {
115795  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106532), unsafe.Pointer(&_quoteFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
115796  			crt.X__builtin_abort(tls)
115797  		}
115798  	}()
115799  
115800  	switch Xsqlite3_value_type(tls, *elem19(_argv, 0)) {
115801  	case int32(1):
115802  		goto _4
115803  	case int32(2):
115804  		goto _3
115805  	case int32(3):
115806  		goto _6
115807  	case int32(4):
115808  		goto _5
115809  	default:
115810  		goto _7
115811  	}
115812  
115813  _3:
115814  	_2_r1 = Xsqlite3_value_double(tls, *elem19(_argv, 0))
115815  	Xsqlite3_snprintf(tls, int32(50), (*int8)(unsafe.Pointer(&_2_zBuf)), str(6268), _2_r1)
115816  	_sqlite3AtoF(tls, (*int8)(unsafe.Pointer(&_2_zBuf)), &_2_r2, int32(20), uint8(1))
115817  	if _2_r1 != _2_r2 {
115818  		Xsqlite3_snprintf(tls, int32(50), (*int8)(unsafe.Pointer(&_2_zBuf)), str(130718), _2_r1)
115819  	}
115820  	Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_2_zBuf)), int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
115821  		v := uint64(18446744073709551615)
115822  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
115823  	}())
115824  	goto _9
115825  _4:
115826  	Xsqlite3_result_value(tls, _context, *elem19(_argv, 0))
115827  	goto _9
115828  _5:
115829  	_5_zText = nil
115830  	_5_zBlob = (*int8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
115831  	_5_nBlob = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115832  	func() {
115833  		if _5_zBlob != (*int8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0))) {
115834  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106555), unsafe.Pointer(&_quoteFuncØ00__func__Ø000), unsafe.Pointer(str(130725)))
115835  			crt.X__builtin_abort(tls)
115836  		}
115837  	}()
115838  	_5_zText = (*int8)(_contextMalloc(tls, _context, (int64(2)*int64(_5_nBlob))+int64(4)))
115839  	if _5_zText == nil {
115840  		goto _12
115841  	}
115842  	_6_i = int32(0)
115843  _13:
115844  	if _6_i >= _5_nBlob {
115845  		goto _16
115846  	}
115847  	*elem1(_5_zText, uintptr((_6_i*int32(2))+int32(2))) = *elem1((*int8)(unsafe.Pointer(&_hexdigits)), uintptr((int32(*elem1(_5_zBlob, uintptr(_6_i)))>>4)&int32(15)))
115848  	*elem1(_5_zText, uintptr((_6_i*int32(2))+int32(3))) = *elem1((*int8)(unsafe.Pointer(&_hexdigits)), uintptr(int32(*elem1(_5_zBlob, uintptr(_6_i)))&int32(15)))
115849  	_6_i += 1
115850  	goto _13
115851  _16:
115852  	*elem1(_5_zText, uintptr((_5_nBlob*int32(2))+int32(2))) = int8(39)
115853  	*elem1(_5_zText, uintptr((_5_nBlob*int32(2))+int32(3))) = 0
115854  	*elem1(_5_zText, 0) = int8(88)
115855  	*elem1(_5_zText, uintptr(1)) = int8(39)
115856  	Xsqlite3_result_text(tls, _context, _5_zText, int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
115857  		v := uint64(18446744073709551615)
115858  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
115859  	}())
115860  	Xsqlite3_free(tls, unsafe.Pointer(_5_zText))
115861  _12:
115862  	goto _9
115863  _6:
115864  	_8_zArg = Xsqlite3_value_text(tls, *elem19(_argv, 0))
115865  	if _8_zArg == nil {
115866  		return
115867  	}
115868  	*func() *uint64 { _8_i = int32(0); return &_8_n }() = 0
115869  _18:
115870  	if (*elem15(_8_zArg, uintptr(_8_i))) == 0 {
115871  		goto _21
115872  	}
115873  	if int32(*elem15(_8_zArg, uintptr(_8_i))) == int32(39) {
115874  		_8_n += 1
115875  	}
115876  	_8_i += 1
115877  	goto _18
115878  _21:
115879  	_8_z = (*int8)(_contextMalloc(tls, _context, (int64(_8_i)+int64(_8_n))+int64(3)))
115880  	if _8_z == nil {
115881  		goto _23
115882  	}
115883  	*elem1(_8_z, 0) = int8(39)
115884  	*func() *int32 { _8_i = int32(0); return &_8_j }() = int32(1)
115885  _24:
115886  	if (*elem15(_8_zArg, uintptr(_8_i))) == 0 {
115887  		goto _27
115888  	}
115889  	*elem1(_8_z, uintptr(postInc2(&_8_j, 1))) = int8(*elem15(_8_zArg, uintptr(_8_i)))
115890  	if int32(*elem15(_8_zArg, uintptr(_8_i))) == int32(39) {
115891  		*elem1(_8_z, uintptr(postInc2(&_8_j, 1))) = int8(39)
115892  	}
115893  	_8_i += 1
115894  	goto _24
115895  _27:
115896  	*elem1(_8_z, uintptr(postInc2(&_8_j, 1))) = int8(39)
115897  	*elem1(_8_z, uintptr(_8_j)) = 0
115898  	Xsqlite3_result_text(tls, _context, _8_z, _8_j, Xsqlite3_free)
115899  _23:
115900  	goto _9
115901  _7:
115902  	func() {
115903  		if Xsqlite3_value_type(tls, *elem19(_argv, 0)) != int32(5) {
115904  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106596), unsafe.Pointer(&_quoteFuncØ00__func__Ø000), unsafe.Pointer(str(130760)))
115905  			crt.X__builtin_abort(tls)
115906  		}
115907  	}()
115908  	Xsqlite3_result_text(tls, _context, str(285), int32(4), nil)
115909  	goto _9
115910  _9:
115911  	_ = _2_zBuf
115912  }
115913  
115914  var _quoteFuncØ00__func__Ø000 [10]int8
115915  
115916  func init() {
115917  	crt.Xstrncpy(nil, &_quoteFuncØ00__func__Ø000[0], str(130801), 10)
115918  }
115919  
115920  // C comment
115921  //  /*
115922  //  ** Implementation of the last_insert_rowid() SQL function.  The return
115923  //  ** value is the same as the sqlite3_last_insert_rowid() API function.
115924  //  */
115925  func _last_insert_rowid(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
115926  	var _db *Xsqlite3
115927  	_db = Xsqlite3_context_db_handle(tls, _context)
115928  	_ = _NotUsed2
115929  
115930  	Xsqlite3_result_int64(tls, _context, Xsqlite3_last_insert_rowid(tls, _db))
115931  }
115932  
115933  // C comment
115934  //  /*
115935  //  ** Implementation of the changes() SQL function.
115936  //  **
115937  //  ** IMP: R-62073-11209 The changes() SQL function is a wrapper
115938  //  ** around the sqlite3_changes() C/C++ function and hence follows the same
115939  //  ** rules for counting changes.
115940  //  */
115941  func _changes(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
115942  	var _db *Xsqlite3
115943  	_db = Xsqlite3_context_db_handle(tls, _context)
115944  	_ = _NotUsed2
115945  
115946  	Xsqlite3_result_int(tls, _context, Xsqlite3_changes(tls, _db))
115947  }
115948  
115949  // C comment
115950  //  /*
115951  //  ** Implementation of the total_changes() SQL function.  The return value is
115952  //  ** the same as the sqlite3_total_changes() API function.
115953  //  */
115954  func _total_changes(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
115955  	var _db *Xsqlite3
115956  	_db = Xsqlite3_context_db_handle(tls, _context)
115957  	_ = _NotUsed2
115958  
115959  	Xsqlite3_result_int(tls, _context, Xsqlite3_total_changes(tls, _db))
115960  }
115961  
115962  // C comment
115963  //  /*
115964  //  ** The replace() function.  Three arguments are all strings: call
115965  //  ** them A, B, and C. The result is also a string which is derived
115966  //  ** from A by replacing every occurrence of B with C.  The match
115967  //  ** must be exact.  Collating sequences are not used.
115968  //  */
115969  func _replaceFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115970  	var _nStr, _nPattern, _nRep, _loopLimit, _i, _j int32
115971  	var _nOut int64
115972  	var _zStr, _zPattern, _zRep, _zOut, _6_zOld *uint8
115973  	var _6_db *Xsqlite3
115974  	func() {
115975  		if _argc != int32(3) {
115976  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106730), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(50249)))
115977  			crt.X__builtin_abort(tls)
115978  		}
115979  	}()
115980  
115981  	_zStr = Xsqlite3_value_text(tls, *elem19(_argv, 0))
115982  	if _zStr == nil {
115983  		return
115984  	}
115985  	_nStr = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115986  	func() {
115987  		if _zStr != Xsqlite3_value_text(tls, *elem19(_argv, 0)) {
115988  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106735), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(130811)))
115989  			crt.X__builtin_abort(tls)
115990  		}
115991  	}()
115992  	_zPattern = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
115993  	if _zPattern == nil {
115994  		func() {
115995  			if Xsqlite3_value_type(tls, *elem19(_argv, uintptr(1))) != int32(5) && (Xsqlite3_context_db_handle(tls, _context).XmallocFailed) == 0 {
115996  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106738), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(130845)))
115997  				crt.X__builtin_abort(tls)
115998  			}
115999  		}()
116000  		return
116001  	}
116002  	if int32(*elem15(_zPattern, 0)) == int32(0) {
116003  		func() {
116004  			if Xsqlite3_value_type(tls, *elem19(_argv, uintptr(1))) == int32(5) {
116005  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106743), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(130938)))
116006  				crt.X__builtin_abort(tls)
116007  			}
116008  		}()
116009  		Xsqlite3_result_value(tls, _context, *elem19(_argv, 0))
116010  		return
116011  	}
116012  	_nPattern = Xsqlite3_value_bytes(tls, *elem19(_argv, uintptr(1)))
116013  	func() {
116014  		if _zPattern != Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1))) {
116015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106748), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(130979)))
116016  			crt.X__builtin_abort(tls)
116017  		}
116018  	}()
116019  	_zRep = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(2)))
116020  	if _zRep == nil {
116021  		return
116022  	}
116023  	_nRep = Xsqlite3_value_bytes(tls, *elem19(_argv, uintptr(2)))
116024  	func() {
116025  		if _zRep != Xsqlite3_value_text(tls, *elem19(_argv, uintptr(2))) {
116026  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106752), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(131017)))
116027  			crt.X__builtin_abort(tls)
116028  		}
116029  	}()
116030  	_nOut = int64(_nStr + int32(1))
116031  	func() {
116032  		if _nOut >= int64(1000000000) {
116033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106754), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(131051)))
116034  			crt.X__builtin_abort(tls)
116035  		}
116036  	}()
116037  	_zOut = (*uint8)(_contextMalloc(tls, _context, _nOut))
116038  	if _zOut == nil {
116039  		return
116040  	}
116041  	_loopLimit = _nStr - _nPattern
116042  	_i = store2(&_j, int32(0))
116043  _20:
116044  	if _i > _loopLimit {
116045  		goto _23
116046  	}
116047  	if (int32(*elem15(_zStr, uintptr(_i))) != int32(*elem15(_zPattern, 0))) || crt.Xmemcmp(tls, unsafe.Pointer(elem15(_zStr, uintptr(_i))), unsafe.Pointer(_zPattern), uint64(_nPattern)) != 0 {
116048  		*elem15(_zOut, uintptr(postInc2(&_j, 1))) = *elem15(_zStr, uintptr(_i))
116049  		goto _26
116050  	}
116051  	_6_db = Xsqlite3_context_db_handle(tls, _context)
116052  	_nOut += int64(_nRep - _nPattern)
116053  	if (_nOut - int64(1)) > int64(*elem8((*int32)(unsafe.Pointer(&_6_db.XaLimit)), 0)) {
116054  		Xsqlite3_result_error_toobig(tls, _context)
116055  		Xsqlite3_free(tls, unsafe.Pointer(_zOut))
116056  		return
116057  	}
116058  	_6_zOld = _zOut
116059  	_zOut = (*uint8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_zOut), uint64(int32(_nOut))))
116060  	if _zOut == nil {
116061  		Xsqlite3_result_error_nomem(tls, _context)
116062  		Xsqlite3_free(tls, unsafe.Pointer(_6_zOld))
116063  		return
116064  	}
116065  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_zOut, uintptr(_j))), unsafe.Pointer(_zRep), uint64(_nRep))
116066  	_j += _nRep
116067  	_i += _nPattern - int32(1)
116068  _26:
116069  	_i += 1
116070  	goto _20
116071  _23:
116072  	func() {
116073  		if int64(((_j+_nStr)-_i)+int32(1)) != _nOut {
116074  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106786), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(131074)))
116075  			crt.X__builtin_abort(tls)
116076  		}
116077  	}()
116078  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_zOut, uintptr(_j))), unsafe.Pointer(elem15(_zStr, uintptr(_i))), uint64(_nStr-_i))
116079  	_j += _nStr - _i
116080  	func() {
116081  		if int64(_j) > _nOut {
116082  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106789), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(131091)))
116083  			crt.X__builtin_abort(tls)
116084  		}
116085  	}()
116086  	*elem15(_zOut, uintptr(_j)) = 0
116087  	Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(_zOut)), _j, Xsqlite3_free)
116088  }
116089  
116090  var _replaceFuncØ00__func__Ø000 [12]int8
116091  
116092  func init() {
116093  	crt.Xstrncpy(nil, &_replaceFuncØ00__func__Ø000[0], str(131099), 12)
116094  }
116095  
116096  // C comment
116097  //  /*
116098  //  ** The zeroblob(N) function returns a zero-filled blob of size N bytes.
116099  //  */
116100  func _zeroblobFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
116101  	var _rc int32
116102  	var _n int64
116103  	func() {
116104  		if _argc != int32(1) {
116105  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106698), unsafe.Pointer(&_zeroblobFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
116106  			crt.X__builtin_abort(tls)
116107  		}
116108  	}()
116109  
116110  	_n = Xsqlite3_value_int64(tls, *elem19(_argv, 0))
116111  	if _n < (0) {
116112  		_n = 0
116113  	}
116114  	_rc = Xsqlite3_result_zeroblob64(tls, _context, uint64(_n))
116115  	if _rc != 0 {
116116  		Xsqlite3_result_error_code(tls, _context, _rc)
116117  	}
116118  }
116119  
116120  var _zeroblobFuncØ00__func__Ø000 [13]int8
116121  
116122  func init() {
116123  	crt.Xstrncpy(nil, &_zeroblobFuncØ00__func__Ø000[0], str(131111), 13)
116124  }
116125  
116126  // C comment
116127  //  /*
116128  //  ** Implementation of the substr() function.
116129  //  **
116130  //  ** substr(x,p1,p2)  returns p2 characters of x[] beginning with p1.
116131  //  ** p1 is 1-indexed.  So substr(x,1,1) returns the first character
116132  //  ** of x.  If x is text, then we actually count UTF-8 characters.
116133  //  ** If x is a blob, then we count bytes.
116134  //  **
116135  //  ** If p1 is negative, then we begin abs(p1) from the end of x[].
116136  //  **
116137  //  ** If p2 is negative, return the p2 characters preceding p1.
116138  //  */
116139  func _substrFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
116140  	var _len, _p0type, _negP2 int32
116141  	var _p1, _p2 int64
116142  	var _z, _z2 *uint8
116143  	_negP2 = int32(0)
116144  	func() {
116145  		if _argc != int32(3) && _argc != int32(2) {
116146  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105817), unsafe.Pointer(&_substrFuncØ00__func__Ø000), unsafe.Pointer(str(131124)))
116147  			crt.X__builtin_abort(tls)
116148  		}
116149  	}()
116150  	if (Xsqlite3_value_type(tls, *elem19(_argv, uintptr(1))) == int32(5)) || ((_argc == int32(3)) && (Xsqlite3_value_type(tls, *elem19(_argv, uintptr(2))) == int32(5))) {
116151  		return
116152  	}
116153  	_p0type = Xsqlite3_value_type(tls, *elem19(_argv, 0))
116154  	_p1 = int64(Xsqlite3_value_int(tls, *elem19(_argv, uintptr(1))))
116155  	if _p0type != int32(4) {
116156  		goto _6
116157  	}
116158  	_len = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
116159  	_z = (*uint8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
116160  	if _z == nil {
116161  		return
116162  	}
116163  	func() {
116164  		if _len != Xsqlite3_value_bytes(tls, *elem19(_argv, 0)) {
116165  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105829), unsafe.Pointer(&_substrFuncØ00__func__Ø000), unsafe.Pointer(str(131143)))
116166  			crt.X__builtin_abort(tls)
116167  		}
116168  	}()
116169  	goto _10
116170  _6:
116171  	_z = Xsqlite3_value_text(tls, *elem19(_argv, 0))
116172  	if _z == nil {
116173  		return
116174  	}
116175  	_len = int32(0)
116176  	if _p1 >= (0) {
116177  		goto _12
116178  	}
116179  	_z2 = _z
116180  _13:
116181  	if (*_z2) == 0 {
116182  		goto _16
116183  	}
116184  	if int32(*postInc15(&_z2, 1)) < int32(192) {
116185  		goto _17
116186  	}
116187  _18:
116188  	if (int32(*_z2) & int32(192)) == int32(128) {
116189  		*(*uintptr)(unsafe.Pointer(&_z2)) += uintptr(1)
116190  		goto _18
116191  	}
116192  _17:
116193  	_len += 1
116194  	goto _13
116195  _16:
116196  _12:
116197  _10:
116198  	if _argc != int32(3) {
116199  		goto _20
116200  	}
116201  	_p2 = int64(Xsqlite3_value_int(tls, *elem19(_argv, uintptr(2))))
116202  	if _p2 < (0) {
116203  		_p2 = -_p2
116204  		_negP2 = int32(1)
116205  	}
116206  	goto _22
116207  _20:
116208  	_p2 = int64(*elem8((*int32)(unsafe.Pointer(&(Xsqlite3_context_db_handle(tls, _context).XaLimit))), 0))
116209  _22:
116210  	if _p1 >= (0) {
116211  		goto _23
116212  	}
116213  	_p1 += int64(_len)
116214  	if _p1 >= (0) {
116215  		goto _24
116216  	}
116217  	_p2 += _p1
116218  	if _p2 < (0) {
116219  		_p2 = 0
116220  	}
116221  	_p1 = 0
116222  _24:
116223  	goto _29
116224  _23:
116225  	if _p1 > (0) {
116226  		_p1 -= 1
116227  		goto _29
116228  	}
116229  	if _p2 > (0) {
116230  		_p2 -= 1
116231  	}
116232  _29:
116233  	if _negP2 == 0 {
116234  		goto _30
116235  	}
116236  	_p1 -= _p2
116237  	if _p1 < (0) {
116238  		_p2 += _p1
116239  		_p1 = 0
116240  	}
116241  _30:
116242  	func() {
116243  		if _p1 < (0) || _p2 < (0) {
116244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105876), unsafe.Pointer(&_substrFuncØ00__func__Ø000), unsafe.Pointer(str(131177)))
116245  			crt.X__builtin_abort(tls)
116246  		}
116247  	}()
116248  	if _p0type == int32(4) {
116249  		goto _35
116250  	}
116251  _36:
116252  	if (*_z) == 0 || _p1 == 0 {
116253  		goto _37
116254  	}
116255  	if int32(*postInc15(&_z, 1)) < int32(192) {
116256  		goto _39
116257  	}
116258  _40:
116259  	if (int32(*_z) & int32(192)) == int32(128) {
116260  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
116261  		goto _40
116262  	}
116263  _39:
116264  	_p1 -= 1
116265  	goto _36
116266  _37:
116267  	_z2 = _z
116268  _42:
116269  	if (*_z2) == 0 || _p2 == 0 {
116270  		goto _46
116271  	}
116272  	if int32(*postInc15(&_z2, 1)) < int32(192) {
116273  		goto _47
116274  	}
116275  _48:
116276  	if (int32(*_z2) & int32(192)) == int32(128) {
116277  		*(*uintptr)(unsafe.Pointer(&_z2)) += uintptr(1)
116278  		goto _48
116279  	}
116280  _47:
116281  	_p2 -= 1
116282  	goto _42
116283  _46:
116284  	Xsqlite3_result_text64(tls, _context, (*int8)(unsafe.Pointer(_z)), uint64(int64(uintptr(unsafe.Pointer(_z2))-uintptr(unsafe.Pointer(_z)))), func() func(*crt.TLS, unsafe.Pointer) {
116285  		v := uint64(18446744073709551615)
116286  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
116287  	}(), uint8(1))
116288  	goto _50
116289  _35:
116290  	if (_p1 + _p2) <= int64(_len) {
116291  		goto _51
116292  	}
116293  	_p2 = int64(_len) - _p1
116294  	if _p2 < (0) {
116295  		_p2 = 0
116296  	}
116297  _51:
116298  	Xsqlite3_result_blob64(tls, _context, unsafe.Pointer(elem15(_z, uintptr(_p1))), uint64(_p2), func() func(*crt.TLS, unsafe.Pointer) {
116299  		v := uint64(18446744073709551615)
116300  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
116301  	}())
116302  _50:
116303  }
116304  
116305  var _substrFuncØ00__func__Ø000 [11]int8
116306  
116307  func init() {
116308  	crt.Xstrncpy(nil, &_substrFuncØ00__func__Ø000[0], str(131192), 11)
116309  }
116310  
116311  // C comment
116312  //  /*
116313  //  ** Routines used to compute the sum, average, and total.
116314  //  **
116315  //  ** The SUM() function follows the (broken) SQL standard which means
116316  //  ** that it returns NULL if it sums over no inputs.  TOTAL returns
116317  //  ** 0.0 in that case.  In addition, TOTAL always returns a float where
116318  //  ** SUM might return an integer if it never encounters a floating point
116319  //  ** value.  TOTAL never fails, but SUM might through an exception if
116320  //  ** it overflows an integer.
116321  //  */
116322  func _sumStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
116323  	var _type int32
116324  	var _2_v int64
116325  	var _p *XSumCtx
116326  	func() {
116327  		if _argc != int32(1) {
116328  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107016), unsafe.Pointer(&_sumStepØ00__func__Ø000), unsafe.Pointer(str(125396)))
116329  			crt.X__builtin_abort(tls)
116330  		}
116331  	}()
116332  
116333  	_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, int32(32)))
116334  	_type = Xsqlite3_value_numeric_type(tls, *elem19(_argv, 0))
116335  	if _p == nil || _type == int32(5) {
116336  		goto _3
116337  	}
116338  	_p.Xcnt += 1
116339  	if _type != int32(1) {
116340  		goto _4
116341  	}
116342  	_2_v = Xsqlite3_value_int64(tls, *elem19(_argv, 0))
116343  	_p.XrSum += float64(_2_v)
116344  	if ((int32(_p.Xapprox) | int32(_p.Xoverflow)) == int32(0)) && _sqlite3AddInt64(tls, &_p.XiSum, _2_v) != 0 {
116345  		_p.Xoverflow = uint8(1)
116346  	}
116347  	goto _7
116348  _4:
116349  	_p.XrSum += Xsqlite3_value_double(tls, *elem19(_argv, 0))
116350  	_p.Xapprox = uint8(1)
116351  _7:
116352  _3:
116353  }
116354  
116355  var _sumStepØ00__func__Ø000 [8]int8
116356  
116357  func init() {
116358  	crt.Xstrncpy(nil, &_sumStepØ00__func__Ø000[0], str(131203), 8)
116359  }
116360  
116361  func _sumFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
116362  	var _p *XSumCtx
116363  	_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
116364  	if _p == nil || _p.Xcnt <= (0) {
116365  		goto _1
116366  	}
116367  	if _p.Xoverflow != 0 {
116368  		Xsqlite3_result_error(tls, _context, str(130546), int32(-1))
116369  		goto _5
116370  	}
116371  	if _p.Xapprox != 0 {
116372  		Xsqlite3_result_double(tls, _context, _p.XrSum)
116373  		goto _5
116374  	}
116375  	Xsqlite3_result_int64(tls, _context, _p.XiSum)
116376  _5:
116377  _1:
116378  }
116379  
116380  func _totalFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
116381  	var _p *XSumCtx
116382  	_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
116383  	Xsqlite3_result_double(tls, _context, func() float64 {
116384  		if _p != nil {
116385  			return _p.XrSum
116386  		}
116387  		return float64(0)
116388  	}())
116389  }
116390  
116391  func _avgFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
116392  	var _p *XSumCtx
116393  	_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
116394  	if (_p != nil) && (_p.Xcnt > (0)) {
116395  		Xsqlite3_result_double(tls, _context, _p.XrSum/float64(_p.Xcnt))
116396  	}
116397  }
116398  
116399  // C comment
116400  //  /*
116401  //  ** Routines to implement the count() aggregate function.
116402  //  */
116403  func _countStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
116404  	var _p *XCountCtx
116405  	_p = (*XCountCtx)(Xsqlite3_aggregate_context(tls, _context, int32(8)))
116406  	if ((_argc == int32(0)) || (int32(5) != Xsqlite3_value_type(tls, *elem19(_argv, 0)))) && (_p != nil) {
116407  		_p.Xn += 1
116408  	}
116409  	func() {
116410  		if _argc != int32(1) && _p != nil && _p.Xn <= int64(2147483647) && _p.Xn != int64(Xsqlite3_aggregate_count(tls, _context)) {
116411  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107085), unsafe.Pointer(&_countStepØ00__func__Ø000), unsafe.Pointer(str(131211)))
116412  			crt.X__builtin_abort(tls)
116413  		}
116414  	}()
116415  }
116416  
116417  var _countStepØ00__func__Ø000 [10]int8
116418  
116419  func init() {
116420  	crt.Xstrncpy(nil, &_countStepØ00__func__Ø000[0], str(131288), 10)
116421  }
116422  
116423  func _countFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
116424  	var _p *XCountCtx
116425  	_p = (*XCountCtx)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
116426  	Xsqlite3_result_int64(tls, _context, func() int64 {
116427  		if _p != nil {
116428  			return _p.Xn
116429  		}
116430  		return (0)
116431  	}())
116432  }
116433  
116434  // C comment
116435  //  /*
116436  //  ** group_concat(EXPR, ?SEPARATOR?)
116437  //  */
116438  func _groupConcatStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
116439  	var _nVal, _nSep, _1_firstTerm int32
116440  	var _zVal, _zSep *int8
116441  	var _1_db *Xsqlite3
116442  	var _pAccum *XStrAccum
116443  	func() {
116444  		if _argc != int32(1) && _argc != int32(2) {
116445  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107159), unsafe.Pointer(&_groupConcatStepØ00__func__Ø000), unsafe.Pointer(str(130571)))
116446  			crt.X__builtin_abort(tls)
116447  		}
116448  	}()
116449  	if Xsqlite3_value_type(tls, *elem19(_argv, 0)) == int32(5) {
116450  		return
116451  	}
116452  	_pAccum = (*XStrAccum)(Xsqlite3_aggregate_context(tls, _context, int32(40)))
116453  	if _pAccum == nil {
116454  		goto _4
116455  	}
116456  	_1_db = Xsqlite3_context_db_handle(tls, _context)
116457  	_1_firstTerm = bool2int(_pAccum.XmxAlloc == (0))
116458  	_pAccum.XmxAlloc = uint32(*elem8((*int32)(unsafe.Pointer(&_1_db.XaLimit)), 0))
116459  	if _1_firstTerm != 0 {
116460  		goto _5
116461  	}
116462  	if _argc == int32(2) {
116463  		_zSep = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))))
116464  		_nSep = Xsqlite3_value_bytes(tls, *elem19(_argv, uintptr(1)))
116465  		goto _7
116466  	}
116467  	_zSep = str(107791)
116468  	_nSep = int32(1)
116469  _7:
116470  	if _zSep != nil {
116471  		_sqlite3StrAccumAppend(tls, _pAccum, _zSep, _nSep)
116472  	}
116473  _5:
116474  	_zVal = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
116475  	_nVal = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
116476  	if _zVal != nil {
116477  		_sqlite3StrAccumAppend(tls, _pAccum, _zVal, _nVal)
116478  	}
116479  _4:
116480  }
116481  
116482  var _groupConcatStepØ00__func__Ø000 [16]int8
116483  
116484  func init() {
116485  	crt.Xstrncpy(nil, &_groupConcatStepØ00__func__Ø000[0], str(131298), 16)
116486  }
116487  
116488  func _groupConcatFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
116489  	var _pAccum *XStrAccum
116490  	_pAccum = (*XStrAccum)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
116491  	if _pAccum == nil {
116492  		goto _0
116493  	}
116494  	if int32(_pAccum.XaccError) == int32(2) {
116495  		Xsqlite3_result_error_toobig(tls, _context)
116496  		goto _4
116497  	}
116498  	if int32(_pAccum.XaccError) == int32(1) {
116499  		Xsqlite3_result_error_nomem(tls, _context)
116500  		goto _4
116501  	}
116502  	Xsqlite3_result_text(tls, _context, _sqlite3StrAccumFinish(tls, _pAccum), int32(-1), Xsqlite3_free)
116503  _4:
116504  _0:
116505  }
116506  
116507  // C comment
116508  //  /*************************************************** General Interfaces ******
116509  //  **
116510  //  ** Initialize and shutdown the page cache subsystem. Neither of these
116511  //  ** functions are threadsafe.
116512  //  */
116513  func _sqlite3PcacheInitialize(tls *crt.TLS) (r0 int32) {
116514  	if (_sqlite3Config.Xpcache2.XxInit) == nil {
116515  		_sqlite3PCacheSetDefault(tls)
116516  	}
116517  	return (_sqlite3Config.Xpcache2.XxInit)(tls, _sqlite3Config.Xpcache2.XpArg)
116518  }
116519  
116520  // C comment
116521  //  /*
116522  //  ** This function is a wrapper around the OS specific implementation of
116523  //  ** sqlite3_os_init(). The purpose of the wrapper is to provide the
116524  //  ** ability to simulate a malloc failure, so that the handling of an
116525  //  ** error in sqlite3_os_init() by the upper layers can be tested.
116526  //  */
116527  func _sqlite3OsInit(tls *crt.TLS) (r0 int32) {
116528  	var _p unsafe.Pointer
116529  	_p = Xsqlite3_malloc(tls, int32(10))
116530  	if _p == nil {
116531  		return _sqlite3NomemError(tls, int32(20396))
116532  	}
116533  	Xsqlite3_free(tls, _p)
116534  	return Xsqlite3_os_init(tls)
116535  }
116536  
116537  // C comment
116538  //  /*
116539  //  ** Initialize the operating system interface.
116540  //  **
116541  //  ** This routine registers all VFS implementations for unix-like operating
116542  //  ** systems.  This routine, and the sqlite3_os_end() routine that follows,
116543  //  ** should be the only routines in this file that are visible from other
116544  //  ** files.
116545  //  **
116546  //  ** This routine is called once during SQLite initialization and by a
116547  //  ** single thread.  The memory allocation and mutex subsystems have not
116548  //  ** necessarily been initialized when this routine is called, and so they
116549  //  ** should not be used.
116550  //  */
116551  func Xsqlite3_os_init(tls *crt.TLS) (r0 int32) {
116552  	var _i uint32
116553  
116554  	_i = 0
116555  _0:
116556  	if uint64(_i) >= uint64(4) {
116557  		goto _3
116558  	}
116559  	Xsqlite3_vfs_register(tls, elem134((*Xsqlite3_vfs)(unsafe.Pointer(&_sqlite3_os_initØ00aVfsØ001)), uintptr(_i)), bool2int(_i == (0)))
116560  	_i += 1
116561  	goto _0
116562  _3:
116563  	return int32(0)
116564  }
116565  
116566  var _sqlite3_os_initØ00aVfsØ001 [4]Xsqlite3_vfs
116567  
116568  func init() {
116569  	_sqlite3_os_initØ00aVfsØ001 = [4]Xsqlite3_vfs{Xsqlite3_vfs{XiVersion: int32(3), XszOsFile: int32(120), XmxPathname: int32(512), XzName: str(131314), XpAppData: unsafe.Pointer(&_posixIoFinder), XxOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32)(unsafe.Pointer(&struct {
116570  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
116571  	}{_unixOpen})), XxDelete: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
116572  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
116573  	}{_unixDelete})), XxAccess: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
116574  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
116575  	}{_unixAccess})), XxFullPathname: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
116576  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
116577  	}{_unixFullPathname})), XxDlOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
116578  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
116579  	}{_unixDlOpen})), XxDlError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
116580  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
116581  	}{_unixDlError})), XxDlSym: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116582  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
116583  	}{_unixDlSym})), XxDlClose: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
116584  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
116585  	}{_unixDlClose})), XxRandomness: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116586  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116587  	}{_unixRandomness})), XxSleep: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116588  		f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
116589  	}{_unixSleep})), XxCurrentTime: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
116590  		f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
116591  	}{_unixCurrentTime})), XxGetLastError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116592  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116593  	}{_unixGetLastError})), XxCurrentTimeInt64: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
116594  		f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
116595  	}{_unixCurrentTimeInt64})), XxSetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
116596  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
116597  	}{_unixSetSystemCall})), XxGetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116598  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
116599  	}{_unixGetSystemCall})), XxNextSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
116600  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
116601  	}{_unixNextSystemCall}))}, Xsqlite3_vfs{XiVersion: int32(3), XszOsFile: int32(120), XmxPathname: int32(512), XzName: str(131319), XpAppData: unsafe.Pointer(&_nolockIoFinder), XxOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32)(unsafe.Pointer(&struct {
116602  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
116603  	}{_unixOpen})), XxDelete: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
116604  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
116605  	}{_unixDelete})), XxAccess: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
116606  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
116607  	}{_unixAccess})), XxFullPathname: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
116608  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
116609  	}{_unixFullPathname})), XxDlOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
116610  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
116611  	}{_unixDlOpen})), XxDlError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
116612  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
116613  	}{_unixDlError})), XxDlSym: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116614  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
116615  	}{_unixDlSym})), XxDlClose: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
116616  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
116617  	}{_unixDlClose})), XxRandomness: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116618  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116619  	}{_unixRandomness})), XxSleep: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116620  		f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
116621  	}{_unixSleep})), XxCurrentTime: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
116622  		f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
116623  	}{_unixCurrentTime})), XxGetLastError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116624  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116625  	}{_unixGetLastError})), XxCurrentTimeInt64: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
116626  		f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
116627  	}{_unixCurrentTimeInt64})), XxSetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
116628  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
116629  	}{_unixSetSystemCall})), XxGetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116630  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
116631  	}{_unixGetSystemCall})), XxNextSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
116632  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
116633  	}{_unixNextSystemCall}))}, Xsqlite3_vfs{XiVersion: int32(3), XszOsFile: int32(120), XmxPathname: int32(512), XzName: str(131329), XpAppData: unsafe.Pointer(&_dotlockIoFinder), XxOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32)(unsafe.Pointer(&struct {
116634  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
116635  	}{_unixOpen})), XxDelete: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
116636  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
116637  	}{_unixDelete})), XxAccess: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
116638  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
116639  	}{_unixAccess})), XxFullPathname: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
116640  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
116641  	}{_unixFullPathname})), XxDlOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
116642  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
116643  	}{_unixDlOpen})), XxDlError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
116644  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
116645  	}{_unixDlError})), XxDlSym: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116646  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
116647  	}{_unixDlSym})), XxDlClose: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
116648  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
116649  	}{_unixDlClose})), XxRandomness: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116650  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116651  	}{_unixRandomness})), XxSleep: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116652  		f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
116653  	}{_unixSleep})), XxCurrentTime: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
116654  		f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
116655  	}{_unixCurrentTime})), XxGetLastError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116656  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116657  	}{_unixGetLastError})), XxCurrentTimeInt64: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
116658  		f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
116659  	}{_unixCurrentTimeInt64})), XxSetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
116660  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
116661  	}{_unixSetSystemCall})), XxGetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116662  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
116663  	}{_unixGetSystemCall})), XxNextSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
116664  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
116665  	}{_unixNextSystemCall}))}, Xsqlite3_vfs{XiVersion: int32(3), XszOsFile: int32(120), XmxPathname: int32(512), XzName: str(131342), XpAppData: unsafe.Pointer(&_posixIoFinder), XxOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32)(unsafe.Pointer(&struct {
116666  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
116667  	}{_unixOpen})), XxDelete: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
116668  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
116669  	}{_unixDelete})), XxAccess: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
116670  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
116671  	}{_unixAccess})), XxFullPathname: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
116672  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
116673  	}{_unixFullPathname})), XxDlOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
116674  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
116675  	}{_unixDlOpen})), XxDlError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
116676  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
116677  	}{_unixDlError})), XxDlSym: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116678  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
116679  	}{_unixDlSym})), XxDlClose: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
116680  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
116681  	}{_unixDlClose})), XxRandomness: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116682  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116683  	}{_unixRandomness})), XxSleep: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116684  		f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
116685  	}{_unixSleep})), XxCurrentTime: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
116686  		f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
116687  	}{_unixCurrentTime})), XxGetLastError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116688  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116689  	}{_unixGetLastError})), XxCurrentTimeInt64: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
116690  		f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
116691  	}{_unixCurrentTimeInt64})), XxSetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
116692  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
116693  	}{_unixSetSystemCall})), XxGetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116694  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
116695  	}{_unixGetSystemCall})), XxNextSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
116696  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
116697  	}{_unixNextSystemCall}))}}
116698  }
116699  
116700  // C comment
116701  //  /*
116702  //  ** Here are all of the sqlite3_io_methods objects for each of the
116703  //  ** locking strategies.  Functions that return pointers to these methods
116704  //  ** are also created.
116705  //  */
116706  var _posixIoFinder func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods
116707  
116708  func init() {
116709  	_posixIoFinder = _posixIoFinderImpl
116710  }
116711  
116712  // C comment
116713  //  /*
116714  //  ** Here are all of the sqlite3_io_methods objects for each of the
116715  //  ** locking strategies.  Functions that return pointers to these methods
116716  //  ** are also created.
116717  //  */
116718  func _posixIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_io_methods) {
116719  	return &_posixIoMethods
116720  }
116721  
116722  // C comment
116723  //  /*
116724  //  ** Here are all of the sqlite3_io_methods objects for each of the
116725  //  ** locking strategies.  Functions that return pointers to these methods
116726  //  ** are also created.
116727  //  */
116728  var _posixIoMethods Xsqlite3_io_methods
116729  
116730  func init() {
116731  	_posixIoMethods = Xsqlite3_io_methods{XiVersion: int32(3), XxClose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116732  		f func(*crt.TLS, *Xsqlite3_file) int32
116733  	}{_unixClose})), XxRead: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
116734  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
116735  	}{_unixRead})), XxWrite: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
116736  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
116737  	}{_unixWrite})), XxTruncate: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
116738  		f func(*crt.TLS, *Xsqlite3_file, int64) int32
116739  	}{_unixTruncate})), XxSync: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116740  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
116741  	}{_unixSync})), XxFileSize: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
116742  		f func(*crt.TLS, *Xsqlite3_file, *int64) int32
116743  	}{_unixFileSize})), XxLock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116744  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
116745  	}{_unixLock})), XxUnlock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116746  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
116747  	}{_unixUnlock})), XxCheckReservedLock: *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&struct {
116748  		f func(*crt.TLS, *Xsqlite3_file, *int32) int32
116749  	}{_unixCheckReservedLock})), XxFileControl: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116750  		f func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32
116751  	}{_unixFileControl})), XxSectorSize: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116752  		f func(*crt.TLS, *Xsqlite3_file) int32
116753  	}{_unixSectorSize})), XxDeviceCharacteristics: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116754  		f func(*crt.TLS, *Xsqlite3_file) int32
116755  	}{_unixDeviceCharacteristics})), XxShmMap: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116756  		f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32
116757  	}{_unixShmMap})), XxShmLock: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&struct {
116758  		f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32
116759  	}{_unixShmLock})), XxShmBarrier: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
116760  		f func(*crt.TLS, *Xsqlite3_file)
116761  	}{_unixShmBarrier})), XxShmUnmap: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116762  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
116763  	}{_unixShmUnmap})), XxFetch: *(*func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116764  		f func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32
116765  	}{_unixFetch})), XxUnfetch: *(*func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116766  		f func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32
116767  	}{_unixUnfetch}))}
116768  }
116769  
116770  // C comment
116771  //  /*
116772  //  ** Close a file.
116773  //  */
116774  func _unixClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
116775  	var _rc int32
116776  	var _pFile *XunixFile
116777  	_rc = int32(0)
116778  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
116779  	_verifyDbFile(tls, _pFile)
116780  	_unixUnlock(tls, _id, int32(0))
116781  	_unixEnterMutex(tls)
116782  	func() {
116783  		if ((*XunixInodeInfo)(_pFile.XpInode).XnLock) <= int32(0) && int32((*XunixInodeInfo)(_pFile.XpInode).XbProcessLock) != int32(0) {
116784  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31867), unsafe.Pointer(&_unixCloseØ00__func__Ø000), unsafe.Pointer(str(131352)))
116785  			crt.X__builtin_abort(tls)
116786  		}
116787  	}()
116788  	if func() int32 {
116789  		if _pFile.XpInode != nil {
116790  			return int32(1)
116791  		}
116792  		return func() int32 {
116793  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31868), unsafe.Pointer(&_unixCloseØ00__func__Ø000), unsafe.Pointer(str(4809)))
116794  			crt.X__builtin_abort(tls)
116795  			return int32(0)
116796  		}()
116797  	}() != 0 && ((*XunixInodeInfo)(_pFile.XpInode).XnLock) != 0 {
116798  		_setPendingFd(tls, _pFile)
116799  	}
116800  	_releaseInodeInfo(tls, _pFile)
116801  	_rc = _closeUnixFile(tls, _id)
116802  	_unixLeaveMutex(tls)
116803  	return _rc
116804  }
116805  
116806  // C comment
116807  //  /*
116808  //  ** Check a unixFile that is a database.  Verify the following:
116809  //  **
116810  //  ** (1) There is exactly one hard link on the file
116811  //  ** (2) The file is not a symbolic link
116812  //  ** (3) The file has not been renamed or unlinked
116813  //  **
116814  //  ** Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right.
116815  //  */
116816  func _verifyDbFile(tls *crt.TLS, _pFile *XunixFile) {
116817  	var _rc int32
116818  	var _buf crt.Xstruct_stat64
116819  	if (int32(_pFile.XctrlFlags) & int32(128)) != 0 {
116820  		return
116821  	}
116822  	_rc = func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
116823  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
116824  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
116825  	}()(tls, _pFile.Xh, &_buf)
116826  	if _rc != int32(0) {
116827  		Xsqlite3_log(tls, int32(28), str(131409), unsafe.Pointer(_pFile.XzPath))
116828  		return
116829  	}
116830  	if _buf.Xst_nlink == (0) {
116831  		Xsqlite3_log(tls, int32(28), str(131433), unsafe.Pointer(_pFile.XzPath))
116832  		return
116833  	}
116834  	if _buf.Xst_nlink > uint64(1) {
116835  		Xsqlite3_log(tls, int32(28), str(131462), unsafe.Pointer(_pFile.XzPath))
116836  		return
116837  	}
116838  	if _fileHasMoved(tls, _pFile) != 0 {
116839  		Xsqlite3_log(tls, int32(28), str(131489), unsafe.Pointer(_pFile.XzPath))
116840  		return
116841  	}
116842  }
116843  
116844  // C comment
116845  //  /*
116846  //  ** Many system calls are accessed through pointer-to-functions so that
116847  //  ** they may be overridden at runtime to facilitate fault injection during
116848  //  ** testing and sandboxing.  The following array holds the names and pointers
116849  //  ** to all overrideable system calls.
116850  //  */
116851  var _aSyscall [28]Tunix_syscall
116852  
116853  func init() {
116854  	_aSyscall = [28]Tunix_syscall{Tunix_syscall{XzName: str(131517), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116855  		f func(*crt.TLS, *int8, int32, int32) int32
116856  	}{_posixOpen}))}, Tunix_syscall{XzName: str(131522), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct{ f func(*crt.TLS, int32) int32 }{crt.Xclose}))}, Tunix_syscall{XzName: str(124478), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116857  		f func(*crt.TLS, *int8, int32) int32
116858  	}{crt.Xaccess}))}, Tunix_syscall{XzName: str(131528), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116859  		f func(*crt.TLS, *int8, uint64) *int8
116860  	}{crt.Xgetcwd}))}, Tunix_syscall{XzName: str(131535), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116861  		f func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32
116862  	}{crt.Xstat64}))}, Tunix_syscall{XzName: str(131540), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116863  		f func(*crt.TLS, int32, *crt.Xstruct_stat64) int32
116864  	}{crt.Xfstat64}))}, Tunix_syscall{XzName: str(131546), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116865  		f func(*crt.TLS, int32, int64) int32
116866  	}{crt.Xftruncate64}))}, Tunix_syscall{XzName: str(131556), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116867  		f func(*crt.TLS, int32, int32, ...interface{}) int32
116868  	}{crt.Xfcntl}))}, Tunix_syscall{XzName: str(131562), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116869  		f func(*crt.TLS, int32, unsafe.Pointer, uint64) int64
116870  	}{crt.Xread}))}, Tunix_syscall{XzName: str(131567)}, Tunix_syscall{XzName: str(131573)}, Tunix_syscall{XzName: str(131581), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116871  		f func(*crt.TLS, int32, unsafe.Pointer, uint64) int64
116872  	}{crt.Xwrite}))}, Tunix_syscall{XzName: str(131587)}, Tunix_syscall{XzName: str(131594)}, Tunix_syscall{XzName: str(131603), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116873  		f func(*crt.TLS, int32, uint32) int32
116874  	}{crt.Xfchmod}))}, Tunix_syscall{XzName: str(131610)}, Tunix_syscall{XzName: str(131620), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct{ f func(*crt.TLS, *int8) int32 }{crt.Xunlink}))}, Tunix_syscall{XzName: str(131627), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116875  		f func(*crt.TLS, *int8, *int32) int32
116876  	}{_openDirectory}))}, Tunix_syscall{XzName: str(131641), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116877  		f func(*crt.TLS, *int8, uint32) int32
116878  	}{crt.Xmkdir}))}, Tunix_syscall{XzName: str(131647), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct{ f func(*crt.TLS, *int8) int32 }{crt.Xrmdir}))}, Tunix_syscall{XzName: str(131653), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116879  		f func(*crt.TLS, int32, uint32, uint32) int32
116880  	}{crt.Xfchown}))}, Tunix_syscall{XzName: str(131660), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct{ f func(*crt.TLS) uint32 }{crt.Xgeteuid}))}, Tunix_syscall{XzName: str(131668), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116881  		f func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer
116882  	}{crt.Xmmap64}))}, Tunix_syscall{XzName: str(131673), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116883  		f func(*crt.TLS, unsafe.Pointer, uint64) int32
116884  	}{crt.Xmunmap}))}, Tunix_syscall{XzName: str(131680)}, Tunix_syscall{XzName: str(131687), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct{ f func(*crt.TLS) int32 }{_unixGetpagesize}))}, Tunix_syscall{XzName: str(131699), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116885  		f func(*crt.TLS, *int8, *int8, uint64) int64
116886  	}{crt.Xreadlink}))}, Tunix_syscall{XzName: str(131708), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116887  		f func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32
116888  	}{crt.Xlstat64}))}}
116889  }
116890  
116891  // C comment
116892  //  /*
116893  //  ** Different Unix systems declare open() in different ways.  Same use
116894  //  ** open(const char*,int,mode_t).  Others use open(const char*,int,...).
116895  //  ** The difference is important when using a pointer to the function.
116896  //  **
116897  //  ** The safest way to deal with the problem is to always use this wrapper
116898  //  ** which always has the same well-defined interface.
116899  //  */
116900  func _posixOpen(tls *crt.TLS, _zFile *int8, _flags int32, _mode int32) (r0 int32) {
116901  	return crt.Xopen64(tls, _zFile, _flags, _mode)
116902  }
116903  
116904  // C comment
116905  //  /*
116906  //  ** Open a file descriptor to the directory containing file zFilename.
116907  //  ** If successful, *pFd is set to the opened file descriptor and
116908  //  ** SQLITE_OK is returned. If an error occurs, either SQLITE_NOMEM
116909  //  ** or SQLITE_CANTOPEN is returned and *pFd is set to an undefined
116910  //  ** value.
116911  //  **
116912  //  ** The directory file descriptor is used for only one thing - to
116913  //  ** fsync() a directory to make sure file creation and deletion events
116914  //  ** are flushed to disk.  Such fsyncs are not needed on newer
116915  //  ** journaling filesystems, but are required on older filesystems.
116916  //  **
116917  //  ** This routine can be overridden using the xSetSysCall interface.
116918  //  ** The ability to override this routine was added in support of the
116919  //  ** chromium sandbox.  Opening a directory is a security risk (we are
116920  //  ** told) so making it overrideable allows the chromium sandbox to
116921  //  ** replace this routine with a harmless no-op.  To make this routine
116922  //  ** a no-op, replace it with a stub that returns SQLITE_OK but leaves
116923  //  ** *pFd set to a negative number.
116924  //  **
116925  //  ** If SQLITE_OK is returned, the caller is responsible for closing
116926  //  ** the file descriptor *pFd using close().
116927  //  */
116928  func _openDirectory(tls *crt.TLS, _zFilename *int8, _pFd *int32) (r0 int32) {
116929  	var _ii, _fd int32
116930  	var _zDirname [513]int8
116931  	_fd = int32(-1)
116932  	Xsqlite3_snprintf(tls, int32(512), (*int8)(unsafe.Pointer(&_zDirname)), str(24531), unsafe.Pointer(_zFilename))
116933  	_ii = int32(crt.Xstrlen(tls, (*int8)(unsafe.Pointer(&_zDirname))))
116934  _0:
116935  	if _ii <= int32(0) || int32(*elem1((*int8)(unsafe.Pointer(&_zDirname)), uintptr(_ii))) == int32(47) {
116936  		goto _4
116937  	}
116938  	_ii -= 1
116939  	goto _0
116940  _4:
116941  	if _ii > int32(0) {
116942  		*elem1((*int8)(unsafe.Pointer(&_zDirname)), uintptr(_ii)) = 0
116943  		goto _6
116944  	}
116945  	if int32(*elem1((*int8)(unsafe.Pointer(&_zDirname)), 0)) != int32(47) {
116946  		*elem1((*int8)(unsafe.Pointer(&_zDirname)), 0) = int8(46)
116947  	}
116948  	*elem1((*int8)(unsafe.Pointer(&_zDirname)), uintptr(1)) = 0
116949  _6:
116950  	_fd = _robust_open(tls, (*int8)(unsafe.Pointer(&_zDirname)), int32(0), 0)
116951  	if _fd >= int32(0) {
116952  	}
116953  	*_pFd = _fd
116954  	if _fd >= int32(0) {
116955  		return int32(0)
116956  	}
116957  	return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(33419)), str(131627), (*int8)(unsafe.Pointer(&_zDirname)), int32(33419))
116958  
116959  	_ = _zDirname
116960  	panic(0)
116961  }
116962  
116963  // C comment
116964  //  /*
116965  //  ** Invoke open().  Do so multiple times, until it either succeeds or
116966  //  ** fails for some reason other than EINTR.
116967  //  **
116968  //  ** If the file creation mode "m" is 0 then set it to the default for
116969  //  ** SQLite.  The default is SQLITE_DEFAULT_FILE_PERMISSIONS (normally
116970  //  ** 0644) as modified by the system umask.  If m is not 0, then
116971  //  ** make the file creation mode be exactly m ignoring the umask.
116972  //  **
116973  //  ** The m parameter will be non-zero only when creating -wal, -journal,
116974  //  ** and -shm files.  We want those files to have *exactly* the same
116975  //  ** permissions as their original database, unadulterated by the umask.
116976  //  ** In that way, if a database file is -rw-rw-rw or -rw-rw-r-, and a
116977  //  ** transaction crashes and leaves behind hot journals, then any
116978  //  ** process that is able to write to the database will also be able to
116979  //  ** recover the hot journals.
116980  //  */
116981  func _robust_open(tls *crt.TLS, _z *int8, _f int32, _m uint32) (r0 int32) {
116982  	var _fd int32
116983  	var _m2 uint32
116984  	var _4_statbuf crt.Xstruct_stat64
116985  	_m2 = func() uint32 {
116986  		if _m != 0 {
116987  			return _m
116988  		}
116989  		return uint32(420)
116990  	}()
116991  _2:
116992  	_fd = func() func(*crt.TLS, *int8, int32, int32) int32 {
116993  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), 0).XpCurrent
116994  		return *(*func(*crt.TLS, *int8, int32, int32) int32)(unsafe.Pointer(&v))
116995  	}()(tls, _z, _f, int32(_m2))
116996  	if _fd >= int32(0) {
116997  		goto _4
116998  	}
116999  	if (*crt.X__errno_location(tls)) == int32(4) {
117000  		goto _2
117001  	}
117002  	goto _3
117003  _4:
117004  	if _fd >= int32(3) {
117005  		goto _3
117006  	}
117007  	func() func(*crt.TLS, int32) int32 {
117008  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(1)).XpCurrent
117009  		return *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&v))
117010  	}()(tls, _fd)
117011  	Xsqlite3_log(tls, int32(28), str(131714), unsafe.Pointer(_z), _fd)
117012  	_fd = int32(-1)
117013  	if func() func(*crt.TLS, *int8, int32, int32) int32 {
117014  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), 0).XpCurrent
117015  		return *(*func(*crt.TLS, *int8, int32, int32) int32)(unsafe.Pointer(&v))
117016  	}()(tls, str(131757), _f, int32(_m)) < int32(0) {
117017  		goto _3
117018  	}
117019  	goto _2
117020  _3:
117021  	if _fd < int32(0) {
117022  		goto _8
117023  	}
117024  	if _m == (0) {
117025  		goto _9
117026  	}
117027  	if ((func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
117028  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
117029  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
117030  	}()(tls, _fd, &_4_statbuf) == int32(0)) && (_4_statbuf.Xst_size == (0))) && ((_4_statbuf.Xst_mode & uint32(511)) != _m) {
117031  		func() func(*crt.TLS, int32, uint32) int32 {
117032  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(14)).XpCurrent
117033  			return *(*func(*crt.TLS, int32, uint32) int32)(unsafe.Pointer(&v))
117034  		}()(tls, _fd, _m)
117035  	}
117036  _9:
117037  	func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
117038  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
117039  		return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
117040  	}()(tls, _fd, int32(2), func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
117041  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
117042  		return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
117043  	}()(tls, _fd, int32(1), int32(0))|int32(1))
117044  _8:
117045  	return _fd
117046  }
117047  
117048  func _unixLogErrorAtLine(tls *crt.TLS, _errcode int32, _zFunc *int8, _zPath *int8, _iLine int32) (r0 int32) {
117049  	var _iErrno int32
117050  	var _zErr *int8
117051  	_iErrno = *crt.X__errno_location(tls)
117052  	_zErr = str(284)
117053  	if _zPath == nil {
117054  		_zPath = str(284)
117055  	}
117056  	Xsqlite3_log(tls, _errcode, str(131767), _iLine, _iErrno, unsafe.Pointer(_zFunc), unsafe.Pointer(_zPath), unsafe.Pointer(_zErr))
117057  	return _errcode
117058  }
117059  
117060  // C comment
117061  //  /*
117062  //  ** Return the system page size.
117063  //  **
117064  //  ** This function should not be called directly by other code in this file.
117065  //  ** Instead, it should be called via macro osGetpagesize().
117066  //  */
117067  func _unixGetpagesize(tls *crt.TLS) (r0 int32) {
117068  	return int32(crt.Xsysconf(tls, int32(30)))
117069  }
117070  
117071  // C comment
117072  //  /*
117073  //  ** Return TRUE if pFile has been renamed or unlinked since it was first opened.
117074  //  */
117075  func _fileHasMoved(tls *crt.TLS, _pFile *XunixFile) (r0 int32) {
117076  	var _buf crt.Xstruct_stat64
117077  	return bool2int(((*XunixInodeInfo)(_pFile.XpInode) != nil) && ((func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
117078  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(4)).XpCurrent
117079  		return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
117080  	}()(tls, _pFile.XzPath, &_buf) != int32(0)) || (_buf.Xst_ino != (((*XunixInodeInfo)(_pFile.XpInode).XfileId).Xino))))
117081  }
117082  
117083  // C comment
117084  //  /*
117085  //  ** Lower the locking level on file descriptor pFile to eFileLock.  eFileLock
117086  //  ** must be either NO_LOCK or SHARED_LOCK.
117087  //  **
117088  //  ** If the locking level of the file descriptor is already at or below
117089  //  ** the requested locking level, this routine is a no-op.
117090  //  */
117091  func _unixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
117092  	func() {
117093  		if _eFileLock != int32(1) && ((*XunixFile)(unsafe.Pointer(_id)).XnFetchOut) != int32(0) {
117094  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31802), unsafe.Pointer(&_unixUnlockØ00__func__Ø000), unsafe.Pointer(str(131798)))
117095  			crt.X__builtin_abort(tls)
117096  		}
117097  	}()
117098  	return _posixUnlock(tls, _id, _eFileLock, int32(0))
117099  }
117100  
117101  var _unixUnlockØ00__func__Ø000 [11]int8
117102  
117103  func init() {
117104  	crt.Xstrncpy(nil, &_unixUnlockØ00__func__Ø000[0], str(131855), 11)
117105  }
117106  
117107  // C comment
117108  //  /*
117109  //  ** Lower the locking level on file descriptor pFile to eFileLock.  eFileLock
117110  //  ** must be either NO_LOCK or SHARED_LOCK.
117111  //  **
117112  //  ** If the locking level of the file descriptor is already at or below
117113  //  ** the requested locking level, this routine is a no-op.
117114  //  **
117115  //  ** If handleNFSUnlock is true, then on downgrading an EXCLUSIVE_LOCK to SHARED
117116  //  ** the byte range is divided into 2 parts and the first part is unlocked then
117117  //  ** set to a read lock, then the other part is simply unlocked.  This works
117118  //  ** around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to
117119  //  ** remove the write lock on a region when a read lock is set.
117120  //  */
117121  func _posixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32, _handleNFSUnlock int32) (r0 int32) {
117122  	var _rc int32
117123  	var _pInode *XunixInodeInfo
117124  	var _pFile *XunixFile
117125  	var _lock Tflock
117126  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117127  	_rc = int32(0)
117128  	func() {
117129  		if _pFile == nil {
117130  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31646), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(58022)))
117131  			crt.X__builtin_abort(tls)
117132  		}
117133  	}()
117134  	func() {
117135  		if _eFileLock > int32(1) {
117136  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31651), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131866)))
117137  			crt.X__builtin_abort(tls)
117138  		}
117139  	}()
117140  	if int32(_pFile.XeFileLock) <= _eFileLock {
117141  		return int32(0)
117142  	}
117143  	_unixEnterMutex(tls)
117144  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
117145  	func() {
117146  		if _pInode.XnShared == int32(0) {
117147  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31657), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131889)))
117148  			crt.X__builtin_abort(tls)
117149  		}
117150  	}()
117151  	if int32(_pFile.XeFileLock) <= int32(1) {
117152  		goto _7
117153  	}
117154  	func() {
117155  		if int32(_pInode.XeFileLock) != int32(_pFile.XeFileLock) {
117156  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31659), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131908)))
117157  			crt.X__builtin_abort(tls)
117158  		}
117159  	}()
117160  	_pFile.XinNormalWrite = 0
117161  	if _eFileLock != int32(1) {
117162  		goto _10
117163  	}
117164  
117165  	func() {
117166  		if _handleNFSUnlock != int32(0) {
117167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31685), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131944)))
117168  			crt.X__builtin_abort(tls)
117169  		}
117170  	}()
117171  	_lock.Xl_type = 0
117172  	_lock.Xl_whence = 0
117173  	_lock.Xl_start = int64(_sqlite3PendingByte + int32(2))
117174  	_lock.Xl_len = int64(510)
117175  	if _unixFileLock(tls, _pFile, &_lock) != 0 {
117176  		_rc = int32(2314)
117177  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
117178  		goto _end_unlock
117179  	}
117180  _10:
117181  	_lock.Xl_type = int16(2)
117182  	_lock.Xl_whence = 0
117183  	_lock.Xl_start = int64(_sqlite3PendingByte)
117184  	_lock.Xl_len = int64(2)
117185  	func() {
117186  		if (_sqlite3PendingByte + int32(1)) != (_sqlite3PendingByte + int32(1)) {
117187  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31747), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131963)))
117188  			crt.X__builtin_abort(tls)
117189  		}
117190  	}()
117191  	if _unixFileLock(tls, _pFile, &_lock) == int32(0) {
117192  		_pInode.XeFileLock = uint8(1)
117193  		goto _17
117194  	}
117195  	_rc = int32(2058)
117196  	_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
117197  	goto _end_unlock
117198  _17:
117199  _7:
117200  	if _eFileLock != int32(0) {
117201  		goto _end_unlock
117202  	}
117203  	_pInode.XnShared -= 1
117204  	if _pInode.XnShared != int32(0) {
117205  		goto _19
117206  	}
117207  	_lock.Xl_type = int16(2)
117208  	_lock.Xl_whence = 0
117209  	_lock.Xl_start = store37(&_lock.Xl_len, int64(0))
117210  	if _unixFileLock(tls, _pFile, &_lock) == int32(0) {
117211  		_pInode.XeFileLock = 0
117212  		goto _21
117213  	}
117214  	_rc = int32(2058)
117215  	_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
117216  	_pInode.XeFileLock = 0
117217  	_pFile.XeFileLock = 0
117218  _21:
117219  _19:
117220  	_pInode.XnLock -= 1
117221  	func() {
117222  		if _pInode.XnLock < int32(0) {
117223  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31781), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131993)))
117224  			crt.X__builtin_abort(tls)
117225  		}
117226  	}()
117227  	if _pInode.XnLock == int32(0) {
117228  		_closePendingFds(tls, _pFile)
117229  	}
117230  _end_unlock:
117231  	_unixLeaveMutex(tls)
117232  	if _rc == int32(0) {
117233  		_pFile.XeFileLock = uint8(_eFileLock)
117234  	}
117235  	return _rc
117236  }
117237  
117238  var _posixUnlockØ00__func__Ø000 [12]int8
117239  
117240  func init() {
117241  	crt.Xstrncpy(nil, &_posixUnlockØ00__func__Ø000[0], str(132010), 12)
117242  }
117243  
117244  // C comment
117245  //  /*
117246  //  ** Helper functions to obtain and relinquish the global mutex. The
117247  //  ** global mutex is used to protect the unixInodeInfo and
117248  //  ** vxworksFileId objects used by this file, all of which may be
117249  //  ** shared by multiple threads.
117250  //  **
117251  //  ** Function unixMutexHeld() is used to assert() that the global mutex
117252  //  ** is held when required. This function is only used as part of assert()
117253  //  ** statements. e.g.
117254  //  **
117255  //  **   unixEnterMutex()
117256  //  **     assert( unixMutexHeld() );
117257  //  **   unixEnterLeave()
117258  //  */
117259  func _unixEnterMutex(tls *crt.TLS) {
117260  	Xsqlite3_mutex_enter(tls, _sqlite3MutexAlloc(tls, int32(11)))
117261  }
117262  
117263  // C comment
117264  //  /*
117265  //  ** Attempt to set a system-lock on the file pFile.  The lock is
117266  //  ** described by pLock.
117267  //  **
117268  //  ** If the pFile was opened read/write from unix-excl, then the only lock
117269  //  ** ever obtained is an exclusive lock, and it is obtained exactly once
117270  //  ** the first time any lock is attempted.  All subsequent system locking
117271  //  ** operations become no-ops.  Locking operations still happen internally,
117272  //  ** in order to coordinate access between separate database connections
117273  //  ** within this process, but all of that is handled in memory and the
117274  //  ** operating system does not participate.
117275  //  **
117276  //  ** This function is a pass-through to fcntl(F_SETLK) if pFile is using
117277  //  ** any VFS other than "unix-excl" or if pFile is opened on "unix-excl"
117278  //  ** and is read-only.
117279  //  **
117280  //  ** Zero is returned if the call completes successfully, or -1 if a call
117281  //  ** to fcntl() fails. In this case, errno is set appropriately (by fcntl()).
117282  //  */
117283  func _unixFileLock(tls *crt.TLS, _pFile *XunixFile, _pLock *Tflock) (r0 int32) {
117284  	var _rc int32
117285  	var _pInode *XunixInodeInfo
117286  	var _2_lock Tflock
117287  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
117288  	func() {
117289  		if _unixMutexHeld(tls) == 0 {
117290  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31344), unsafe.Pointer(&_unixFileLockØ00__func__Ø000), unsafe.Pointer(str(132022)))
117291  			crt.X__builtin_abort(tls)
117292  		}
117293  	}()
117294  	func() {
117295  		if _pInode == nil {
117296  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31345), unsafe.Pointer(&_unixFileLockØ00__func__Ø000), unsafe.Pointer(str(132038)))
117297  			crt.X__builtin_abort(tls)
117298  		}
117299  	}()
117300  	if (int32(_pFile.XctrlFlags) & int32(3)) != int32(1) {
117301  		goto _4
117302  	}
117303  	if int32(_pInode.XbProcessLock) != int32(0) {
117304  		goto _5
117305  	}
117306  	func() {
117307  		if _pInode.XnLock != int32(0) {
117308  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31349), unsafe.Pointer(&_unixFileLockØ00__func__Ø000), unsafe.Pointer(str(132048)))
117309  			crt.X__builtin_abort(tls)
117310  		}
117311  	}()
117312  	_2_lock.Xl_whence = 0
117313  	_2_lock.Xl_start = int64(_sqlite3PendingByte + int32(2))
117314  	_2_lock.Xl_len = int64(510)
117315  	_2_lock.Xl_type = int16(1)
117316  	_rc = func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
117317  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
117318  		return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
117319  	}()(tls, _pFile.Xh, int32(6), unsafe.Pointer(&_2_lock))
117320  	if _rc < int32(0) {
117321  		return _rc
117322  	}
117323  	_pInode.XbProcessLock = uint8(1)
117324  	_pInode.XnLock += 1
117325  	goto _9
117326  _5:
117327  	_rc = int32(0)
117328  _9:
117329  	goto _10
117330  _4:
117331  	_rc = func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
117332  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
117333  		return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
117334  	}()(tls, _pFile.Xh, int32(6), unsafe.Pointer(_pLock))
117335  _10:
117336  	return _rc
117337  }
117338  
117339  func _unixMutexHeld(tls *crt.TLS) (r0 int32) {
117340  	return Xsqlite3_mutex_held(tls, _sqlite3MutexAlloc(tls, int32(11)))
117341  }
117342  
117343  var _unixFileLockØ00__func__Ø000 [13]int8
117344  
117345  func init() {
117346  	crt.Xstrncpy(nil, &_unixFileLockØ00__func__Ø000[0], str(132065), 13)
117347  }
117348  
117349  // C comment
117350  //  /*
117351  //  ** Set the pFile->lastErrno.  Do this in a subroutine as that provides
117352  //  ** a convenient place to set a breakpoint.
117353  //  */
117354  func _storeLastErrno(tls *crt.TLS, _pFile *XunixFile, _error int32) {
117355  	_pFile.XlastErrno = _error
117356  }
117357  
117358  func _closePendingFds(tls *crt.TLS, _pFile *XunixFile) {
117359  	var _pInode *XunixInodeInfo
117360  	var _p, _pNext *XUnixUnusedFd
117361  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
117362  	_p = (*XUnixUnusedFd)(_pInode.XpUnused)
117363  _0:
117364  	if _p == nil {
117365  		goto _3
117366  	}
117367  	_pNext = (*XUnixUnusedFd)(_p.XpNext)
117368  	_robust_close(tls, _pFile, _p.Xfd, int32(31098))
117369  	Xsqlite3_free(tls, unsafe.Pointer(_p))
117370  	_p = _pNext
117371  	goto _0
117372  _3:
117373  	*(**XUnixUnusedFd)(unsafe.Pointer(&_pInode.XpUnused)) = nil
117374  }
117375  
117376  // C comment
117377  //  /*
117378  //  ** Close a file descriptor.
117379  //  **
117380  //  ** We assume that close() almost always works, since it is only in a
117381  //  ** very sick application or on a very sick platform that it might fail.
117382  //  ** If it does fail, simply leak the file descriptor, but do log the
117383  //  ** error.
117384  //  **
117385  //  ** Note that it is not safe to retry close() after EINTR since the
117386  //  ** file descriptor might have already been reused by another thread.
117387  //  ** So we don't even try to recover from an EINTR.  Just log the error
117388  //  ** and move on.
117389  //  */
117390  func _robust_close(tls *crt.TLS, _pFile *XunixFile, _h int32, _lineno int32) {
117391  	if func() func(*crt.TLS, int32) int32 {
117392  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(1)).XpCurrent
117393  		return *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&v))
117394  	}()(tls, _h) != 0 {
117395  		_unixLogErrorAtLine(tls, int32(4106), str(131522), func() *int8 {
117396  			if _pFile != nil {
117397  				return _pFile.XzPath
117398  			}
117399  			return nil
117400  		}(), _lineno)
117401  	}
117402  }
117403  
117404  func _unixLeaveMutex(tls *crt.TLS) {
117405  	Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(11)))
117406  }
117407  
117408  var _unixCloseØ00__func__Ø000 [10]int8
117409  
117410  func init() {
117411  	crt.Xstrncpy(nil, &_unixCloseØ00__func__Ø000[0], str(132078), 10)
117412  }
117413  
117414  // C comment
117415  //  /*
117416  //  ** Add the file descriptor used by file handle pFile to the corresponding
117417  //  ** pUnused list.
117418  //  */
117419  func _setPendingFd(tls *crt.TLS, _pFile *XunixFile) {
117420  	var _pInode *XunixInodeInfo
117421  	var _p *XUnixUnusedFd
117422  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
117423  	_p = (*XUnixUnusedFd)(_pFile.XpUnused)
117424  	*(**XUnixUnusedFd)(unsafe.Pointer(&_p.XpNext)) = (*XUnixUnusedFd)(_pInode.XpUnused)
117425  	*(**XUnixUnusedFd)(unsafe.Pointer(&_pInode.XpUnused)) = _p
117426  	_pFile.Xh = int32(-1)
117427  	*(**XUnixUnusedFd)(unsafe.Pointer(&_pFile.XpUnused)) = nil
117428  }
117429  
117430  // C comment
117431  //  /*
117432  //  ** Release a unixInodeInfo structure previously allocated by findInodeInfo().
117433  //  **
117434  //  ** The mutex entered using the unixEnterMutex() function must be held
117435  //  ** when this function is called.
117436  //  */
117437  func _releaseInodeInfo(tls *crt.TLS, _pFile *XunixFile) {
117438  	var _pInode *XunixInodeInfo
117439  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
117440  	func() {
117441  		if _unixMutexHeld(tls) == 0 {
117442  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31112), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132022)))
117443  			crt.X__builtin_abort(tls)
117444  		}
117445  	}()
117446  	if func() int32 {
117447  		if _pInode != nil {
117448  			return int32(1)
117449  		}
117450  		return func() int32 {
117451  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31113), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(4809)))
117452  			crt.X__builtin_abort(tls)
117453  			return int32(0)
117454  		}()
117455  	}() == 0 {
117456  		goto _4
117457  	}
117458  	_pInode.XnRef -= 1
117459  	if _pInode.XnRef != int32(0) {
117460  		goto _5
117461  	}
117462  	func() {
117463  		if (*XunixShmNode)(_pInode.XpShmNode) != nil {
117464  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31116), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132088)))
117465  			crt.X__builtin_abort(tls)
117466  		}
117467  	}()
117468  	_closePendingFds(tls, _pFile)
117469  	if _pInode.XpPrev != nil {
117470  		func() {
117471  			if (*XunixInodeInfo)((*XunixInodeInfo)(_pInode.XpPrev).XpNext) != _pInode {
117472  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31119), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132108)))
117473  				crt.X__builtin_abort(tls)
117474  			}
117475  		}()
117476  		*(**XunixInodeInfo)(unsafe.Pointer(&((*XunixInodeInfo)(_pInode.XpPrev).XpNext))) = (*XunixInodeInfo)(_pInode.XpNext)
117477  		goto _11
117478  	}
117479  	func() {
117480  		if _inodeList != _pInode {
117481  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31122), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132137)))
117482  			crt.X__builtin_abort(tls)
117483  		}
117484  	}()
117485  	_inodeList = (*XunixInodeInfo)(_pInode.XpNext)
117486  	bug20530(_inodeList)
117487  _11:
117488  	if _pInode.XpNext != nil {
117489  		func() {
117490  			if (*XunixInodeInfo)((*XunixInodeInfo)(_pInode.XpNext).XpPrev) != _pInode {
117491  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31126), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132155)))
117492  				crt.X__builtin_abort(tls)
117493  			}
117494  		}()
117495  		*(**XunixInodeInfo)(unsafe.Pointer(&((*XunixInodeInfo)(_pInode.XpNext).XpPrev))) = (*XunixInodeInfo)(_pInode.XpPrev)
117496  	}
117497  	Xsqlite3_free(tls, unsafe.Pointer(_pInode))
117498  _5:
117499  _4:
117500  }
117501  
117502  var _releaseInodeInfoØ00__func__Ø000 [17]int8
117503  
117504  func init() {
117505  	crt.Xstrncpy(nil, &_releaseInodeInfoØ00__func__Ø000[0], str(132184), 17)
117506  }
117507  
117508  // C comment
117509  //  /*
117510  //  ** A lists of all unixInodeInfo objects.
117511  //  */
117512  var _inodeList *XunixInodeInfo
117513  
117514  // C comment
117515  //  /*
117516  //  ** This function performs the parts of the "close file" operation
117517  //  ** common to all locking schemes. It closes the directory and file
117518  //  ** handles, if they are valid, and sets all fields of the unixFile
117519  //  ** structure to 0.
117520  //  **
117521  //  ** It is *not* necessary to hold the mutex when this routine is called,
117522  //  ** even on VxWorks.  A mutex will be acquired on VxWorks by the
117523  //  ** vxworksReleaseFileId() routine.
117524  //  */
117525  func _closeUnixFile(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
117526  	var _pFile *XunixFile
117527  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117528  	_unixUnmapfile(tls, _pFile)
117529  	if _pFile.Xh >= int32(0) {
117530  		_robust_close(tls, _pFile, _pFile.Xh, int32(31828))
117531  		_pFile.Xh = int32(-1)
117532  	}
117533  	Xsqlite3_free(tls, _pFile.XpUnused)
117534  	crt.Xmemset(tls, unsafe.Pointer(_pFile), int32(0), uint64(120))
117535  	return int32(0)
117536  }
117537  
117538  // C comment
117539  //  /*
117540  //  ** If it is currently memory mapped, unmap file pFd.
117541  //  */
117542  func _unixUnmapfile(tls *crt.TLS, _pFd *XunixFile) {
117543  	func() {
117544  		if _pFd.XnFetchOut != int32(0) {
117545  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34596), unsafe.Pointer(&_unixUnmapfileØ00__func__Ø000), unsafe.Pointer(str(132201)))
117546  			crt.X__builtin_abort(tls)
117547  		}
117548  	}()
117549  	if _pFd.XpMapRegion != nil {
117550  		func() func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer {
117551  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(23)).XpCurrent
117552  			return *(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&v))
117553  		}()(tls, _pFd.XpMapRegion, uint64(_pFd.XmmapSizeActual))
117554  		_pFd.XpMapRegion = nil
117555  		_pFd.XmmapSize = 0
117556  		_pFd.XmmapSizeActual = 0
117557  	}
117558  }
117559  
117560  var _unixUnmapfileØ00__func__Ø000 [14]int8
117561  
117562  func init() {
117563  	crt.Xstrncpy(nil, &_unixUnmapfileØ00__func__Ø000[0], str(132219), 14)
117564  }
117565  
117566  // C comment
117567  //  /*
117568  //  ** Read data from a file into a buffer.  Return SQLITE_OK if all
117569  //  ** bytes were read successfully and SQLITE_IOERR if anything goes
117570  //  ** wrong.
117571  //  */
117572  func _unixRead(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
117573  	var _got, _3_nCopy int32
117574  	var _pFile *XunixFile
117575  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117576  	func() {
117577  		if _id == nil {
117578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33063), unsafe.Pointer(&_unixReadØ00__func__Ø000), unsafe.Pointer(str(93813)))
117579  			crt.X__builtin_abort(tls)
117580  		}
117581  	}()
117582  	func() {
117583  		if _offset < (0) {
117584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33064), unsafe.Pointer(&_unixReadØ00__func__Ø000), unsafe.Pointer(str(132233)))
117585  			crt.X__builtin_abort(tls)
117586  		}
117587  	}()
117588  	func() {
117589  		if _amt <= int32(0) {
117590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33065), unsafe.Pointer(&_unixReadØ00__func__Ø000), unsafe.Pointer(str(132243)))
117591  			crt.X__builtin_abort(tls)
117592  		}
117593  	}()
117594  	if _offset >= _pFile.XmmapSize {
117595  		goto _6
117596  	}
117597  	if (_offset + int64(_amt)) <= _pFile.XmmapSize {
117598  		crt.Xmemcpy(tls, _pBuf, unsafe.Pointer(elem15((*uint8)(_pFile.XpMapRegion), uintptr(_offset))), uint64(_amt))
117599  		return int32(0)
117600  	}
117601  	_3_nCopy = int32(_pFile.XmmapSize - _offset)
117602  	crt.Xmemcpy(tls, _pBuf, unsafe.Pointer(elem15((*uint8)(_pFile.XpMapRegion), uintptr(_offset))), uint64(_3_nCopy))
117603  	_pBuf = unsafe.Pointer(elem15((*uint8)(_pBuf), uintptr(_3_nCopy)))
117604  	_amt -= _3_nCopy
117605  	_offset += int64(_3_nCopy)
117606  _6:
117607  	_got = _seekAndRead(tls, _pFile, _offset, _pBuf, _amt)
117608  	if _got == _amt {
117609  		return int32(0)
117610  	}
117611  	if _got < int32(0) {
117612  		return int32(266)
117613  	}
117614  	_storeLastErrno(tls, _pFile, int32(0))
117615  	crt.Xmemset(tls, unsafe.Pointer(elem1((*int8)(_pBuf), uintptr(_got))), int32(0), uint64(_amt-_got))
117616  	return int32(522)
117617  }
117618  
117619  var _unixReadØ00__func__Ø000 [9]int8
117620  
117621  func init() {
117622  	crt.Xstrncpy(nil, &_unixReadØ00__func__Ø000[0], str(132249), 9)
117623  }
117624  
117625  // C comment
117626  //  /*
117627  //  ** Seek to the offset passed as the second argument, then read cnt
117628  //  ** bytes into pBuf. Return the number of bytes actually read.
117629  //  **
117630  //  ** NB:  If you define USE_PREAD or USE_PREAD64, then it might also
117631  //  ** be necessary to define _XOPEN_SOURCE to be 500.  This varies from
117632  //  ** one system to another.  Since SQLite does not define USE_PREAD
117633  //  ** in any form by default, we will not attempt to define _XOPEN_SOURCE.
117634  //  ** See tickets #2741 and #2681.
117635  //  **
117636  //  ** To avoid stomping the errno value on a failed read the lastErrno value
117637  //  ** is set before returning.
117638  //  */
117639  func _seekAndRead(tls *crt.TLS, _id *XunixFile, _offset int64, _pBuf unsafe.Pointer, _cnt int32) (r0 int32) {
117640  	var _got, _prior int32
117641  	var _newOffset int64
117642  	_prior = int32(0)
117643  	func() {
117644  		if _cnt != (_cnt & int32(131071)) {
117645  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33013), unsafe.Pointer(&_seekAndReadØ00__func__Ø000), unsafe.Pointer(str(132258)))
117646  			crt.X__builtin_abort(tls)
117647  		}
117648  	}()
117649  	func() {
117650  		if _id.Xh <= int32(2) {
117651  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33014), unsafe.Pointer(&_seekAndReadØ00__func__Ø000), unsafe.Pointer(str(132277)))
117652  			crt.X__builtin_abort(tls)
117653  		}
117654  	}()
117655  _4:
117656  	_newOffset = crt.Xlseek64(tls, _id.Xh, _offset, int32(0))
117657  	if _newOffset < (0) {
117658  		_storeLastErrno(tls, _id, *crt.X__errno_location(tls))
117659  		return int32(-1)
117660  	}
117661  	_got = int32(func() func(*crt.TLS, int32, unsafe.Pointer, uint64) int64 {
117662  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(8)).XpCurrent
117663  		return *(*func(*crt.TLS, int32, unsafe.Pointer, uint64) int64)(unsafe.Pointer(&v))
117664  	}()(tls, _id.Xh, _pBuf, uint64(_cnt)))
117665  	if _got == _cnt {
117666  		goto _7
117667  	}
117668  	if _got >= int32(0) {
117669  		goto _8
117670  	}
117671  	if (*crt.X__errno_location(tls)) == int32(4) {
117672  		_got = int32(1)
117673  		goto _4
117674  	}
117675  	_prior = int32(0)
117676  	_storeLastErrno(tls, _id, *crt.X__errno_location(tls))
117677  	goto _7
117678  _8:
117679  	if _got > int32(0) {
117680  		_cnt -= _got
117681  		_offset += int64(_got)
117682  		_prior += _got
117683  		_pBuf = unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_got) + uintptr(_pBuf))))
117684  	}
117685  	if _got > int32(0) {
117686  		goto _4
117687  	}
117688  _7:
117689  	return _got + _prior
117690  }
117691  
117692  var _seekAndReadØ00__func__Ø000 [12]int8
117693  
117694  func init() {
117695  	crt.Xstrncpy(nil, &_seekAndReadØ00__func__Ø000[0], str(132285), 12)
117696  }
117697  
117698  // C comment
117699  //  /*
117700  //  ** Write data from a buffer into a file.  Return SQLITE_OK on success
117701  //  ** or some other error code on failure.
117702  //  */
117703  func _unixWrite(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
117704  	var _wrote, _2_rc int32
117705  	var _2_oldCntr [4]int8
117706  	var _pFile *XunixFile
117707  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117708  	_wrote = int32(0)
117709  	func() {
117710  		if _id == nil {
117711  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33177), unsafe.Pointer(&_unixWriteØ00__func__Ø000), unsafe.Pointer(str(93813)))
117712  			crt.X__builtin_abort(tls)
117713  		}
117714  	}()
117715  	func() {
117716  		if _amt <= int32(0) {
117717  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33178), unsafe.Pointer(&_unixWriteØ00__func__Ø000), unsafe.Pointer(str(132243)))
117718  			crt.X__builtin_abort(tls)
117719  		}
117720  	}()
117721  	if _pFile.XinNormalWrite == 0 {
117722  		goto _4
117723  	}
117724  	_pFile.XdbUpdate = uint8(1)
117725  	if _offset > int64(24) || (_offset+int64(_amt)) < int64(27) {
117726  		goto _6
117727  	}
117728  	_2_rc = _seekAndRead(tls, _pFile, int64(24), unsafe.Pointer(&_2_oldCntr), int32(4))
117729  	if (_2_rc != int32(4)) || (crt.Xmemcmp(tls, unsafe.Pointer(&_2_oldCntr), unsafe.Pointer(elem1((*int8)(_pBuf), uintptr(int64(24)-_offset))), uint64(4)) != int32(0)) {
117730  		_pFile.XtransCntrChng = uint8(1)
117731  	}
117732  _6:
117733  _4:
117734  	if (store2(&_wrote, _seekAndWrite(tls, _pFile, _offset, _pBuf, _amt)) < _amt) && (_wrote > int32(0)) {
117735  		_amt -= _wrote
117736  		_offset += int64(_wrote)
117737  		_pBuf = unsafe.Pointer(elem1((*int8)(_pBuf), uintptr(_wrote)))
117738  		goto _4
117739  	}
117740  	if _amt <= _wrote {
117741  		goto _12
117742  	}
117743  	if (_wrote < int32(0)) && (_pFile.XlastErrno != int32(28)) {
117744  		return int32(778)
117745  	}
117746  	_storeLastErrno(tls, _pFile, int32(0))
117747  	return int32(13)
117748  
117749  _12:
117750  	return int32(0)
117751  
117752  	_ = _2_oldCntr
117753  	panic(0)
117754  }
117755  
117756  var _unixWriteØ00__func__Ø000 [10]int8
117757  
117758  func init() {
117759  	crt.Xstrncpy(nil, &_unixWriteØ00__func__Ø000[0], str(132297), 10)
117760  }
117761  
117762  // C comment
117763  //  /*
117764  //  ** Seek to the offset in id->offset then read cnt bytes into pBuf.
117765  //  ** Return the number of bytes actually read.  Update the offset.
117766  //  **
117767  //  ** To avoid stomping the errno value on a failed write the lastErrno value
117768  //  ** is set before returning.
117769  //  */
117770  func _seekAndWrite(tls *crt.TLS, _id *XunixFile, _offset int64, _pBuf unsafe.Pointer, _cnt int32) (r0 int32) {
117771  	return _seekAndWriteFd(tls, _id.Xh, _offset, _pBuf, _cnt, &_id.XlastErrno)
117772  }
117773  
117774  // C comment
117775  //  /*
117776  //  ** Attempt to seek the file-descriptor passed as the first argument to
117777  //  ** absolute offset iOff, then attempt to write nBuf bytes of data from
117778  //  ** pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise,
117779  //  ** return the actual number of bytes written (which may be less than
117780  //  ** nBuf).
117781  //  */
117782  func _seekAndWriteFd(tls *crt.TLS, _fd int32, _iOff int64, _pBuf unsafe.Pointer, _nBuf int32, _piErrno *int32) (r0 int32) {
117783  	var _rc int32
117784  	var _1_iSeek int64
117785  	_rc = int32(0)
117786  	func() {
117787  		if _nBuf != (_nBuf & int32(131071)) {
117788  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33123), unsafe.Pointer(&_seekAndWriteFdØ00__func__Ø000), unsafe.Pointer(str(132307)))
117789  			crt.X__builtin_abort(tls)
117790  		}
117791  	}()
117792  	func() {
117793  		if _fd <= int32(2) {
117794  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33124), unsafe.Pointer(&_seekAndWriteFdØ00__func__Ø000), unsafe.Pointer(str(132328)))
117795  			crt.X__builtin_abort(tls)
117796  		}
117797  	}()
117798  	func() {
117799  		if _piErrno == nil {
117800  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33125), unsafe.Pointer(&_seekAndWriteFdØ00__func__Ø000), unsafe.Pointer(str(132333)))
117801  			crt.X__builtin_abort(tls)
117802  		}
117803  	}()
117804  	_nBuf &= int32(131071)
117805  _6:
117806  	_1_iSeek = crt.Xlseek64(tls, _fd, _iOff, int32(0))
117807  	if _1_iSeek < (0) {
117808  		_rc = int32(-1)
117809  		goto _8
117810  	}
117811  	_rc = int32(func() func(*crt.TLS, int32, unsafe.Pointer, uint64) int64 {
117812  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(11)).XpCurrent
117813  		return *(*func(*crt.TLS, int32, unsafe.Pointer, uint64) int64)(unsafe.Pointer(&v))
117814  	}()(tls, _fd, _pBuf, uint64(_nBuf)))
117815  	if (_rc < int32(0)) && ((*crt.X__errno_location(tls)) == int32(4)) {
117816  		goto _6
117817  	}
117818  _8:
117819  	if _rc < int32(0) {
117820  		*_piErrno = *crt.X__errno_location(tls)
117821  	}
117822  	return _rc
117823  }
117824  
117825  var _seekAndWriteFdØ00__func__Ø000 [15]int8
117826  
117827  func init() {
117828  	crt.Xstrncpy(nil, &_seekAndWriteFdØ00__func__Ø000[0], str(132344), 15)
117829  }
117830  
117831  // C comment
117832  //  /*
117833  //  ** Truncate an open file to a specified size
117834  //  */
117835  func _unixTruncate(tls *crt.TLS, _id *Xsqlite3_file, _nByte int64) (r0 int32) {
117836  	var _rc int32
117837  	var _pFile *XunixFile
117838  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117839  	func() {
117840  		if _pFile == nil {
117841  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33490), unsafe.Pointer(&_unixTruncateØ00__func__Ø000), unsafe.Pointer(str(58022)))
117842  			crt.X__builtin_abort(tls)
117843  		}
117844  	}()
117845  	if _pFile.XszChunk > int32(0) {
117846  		_nByte = (((_nByte + int64(_pFile.XszChunk)) - int64(1)) / int64(_pFile.XszChunk)) * int64(_pFile.XszChunk)
117847  	}
117848  	_rc = _robust_ftruncate(tls, _pFile.Xh, _nByte)
117849  	if _rc != 0 {
117850  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
117851  		return _unixLogErrorAtLine(tls, int32(1546), str(131546), _pFile.XzPath, int32(33505))
117852  	}
117853  	if (_pFile.XinNormalWrite != 0) && (_nByte == (0)) {
117854  		_pFile.XtransCntrChng = uint8(1)
117855  	}
117856  	if _nByte < _pFile.XmmapSize {
117857  		_pFile.XmmapSize = _nByte
117858  	}
117859  	return int32(0)
117860  }
117861  
117862  var _unixTruncateØ00__func__Ø000 [13]int8
117863  
117864  func init() {
117865  	crt.Xstrncpy(nil, &_unixTruncateØ00__func__Ø000[0], str(132359), 13)
117866  }
117867  
117868  // C comment
117869  //  /*
117870  //  ** Retry ftruncate() calls that fail due to EINTR
117871  //  **
117872  //  ** All calls to ftruncate() within this file should be made through
117873  //  ** this wrapper.  On the Android platform, bypassing the logic below
117874  //  ** could lead to a corrupt database.
117875  //  */
117876  func _robust_ftruncate(tls *crt.TLS, _h int32, _sz int64) (r0 int32) {
117877  	var _rc int32
117878  _0:
117879  	_rc = func() func(*crt.TLS, int32, int64) int32 {
117880  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(6)).XpCurrent
117881  		return *(*func(*crt.TLS, int32, int64) int32)(unsafe.Pointer(&v))
117882  	}()(tls, _h, _sz)
117883  	if (_rc < int32(0)) && ((*crt.X__errno_location(tls)) == int32(4)) {
117884  		goto _0
117885  	}
117886  	return _rc
117887  }
117888  
117889  // C comment
117890  //  /*
117891  //  ** Make sure all writes to a particular file are committed to disk.
117892  //  **
117893  //  ** If dataOnly==0 then both the file itself and its metadata (file
117894  //  ** size, access time, etc) are synced.  If dataOnly!=0 then only the
117895  //  ** file data is synced.
117896  //  **
117897  //  ** Under Unix, also make sure that the directory entry for the file
117898  //  ** has been created by fsync-ing the directory that contains the file.
117899  //  ** If we do not do this and we encounter a power failure, the directory
117900  //  ** entry for the journal might not exist after we reboot.  The next
117901  //  ** SQLite to access the file will not know that the journal exists (because
117902  //  ** the directory entry for the journal was never created) and the transaction
117903  //  ** will not roll back - possibly leading to database corruption.
117904  //  */
117905  func _unixSync(tls *crt.TLS, _id *Xsqlite3_file, _flags int32) (r0 int32) {
117906  	var _rc, _isDataOnly, _isFullsync, _2_dirfd int32
117907  	var _pFile *XunixFile
117908  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117909  	_isDataOnly = _flags & int32(16)
117910  	_isFullsync = bool2int((_flags & int32(15)) == int32(3))
117911  	func() {
117912  		if (_flags&int32(15)) != int32(2) && (_flags&int32(15)) != int32(3) {
117913  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33445), unsafe.Pointer(&_unixSyncØ00__func__Ø000), unsafe.Pointer(str(132372)))
117914  			crt.X__builtin_abort(tls)
117915  		}
117916  	}()
117917  	func() {
117918  		if _pFile == nil {
117919  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33454), unsafe.Pointer(&_unixSyncØ00__func__Ø000), unsafe.Pointer(str(58022)))
117920  			crt.X__builtin_abort(tls)
117921  		}
117922  	}()
117923  	_rc = _full_fsync(tls, _pFile.Xh, _isFullsync, _isDataOnly)
117924  	if _rc != 0 {
117925  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
117926  		return _unixLogErrorAtLine(tls, int32(1034), str(132439), _pFile.XzPath, int32(33460))
117927  	}
117928  	if (int32(_pFile.XctrlFlags) & int32(8)) == 0 {
117929  		goto _6
117930  	}
117931  	_rc = func() func(*crt.TLS, *int8, *int32) int32 {
117932  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(17)).XpCurrent
117933  		return *(*func(*crt.TLS, *int8, *int32) int32)(unsafe.Pointer(&v))
117934  	}()(tls, _pFile.XzPath, &_2_dirfd)
117935  	if _rc == int32(0) {
117936  		_full_fsync(tls, _2_dirfd, int32(0), int32(0))
117937  		_robust_close(tls, _pFile, _2_dirfd, int32(33474))
117938  		goto _8
117939  	}
117940  	func() {
117941  		if _rc != int32(14) {
117942  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33476), unsafe.Pointer(&_unixSyncØ00__func__Ø000), unsafe.Pointer(str(132450)))
117943  			crt.X__builtin_abort(tls)
117944  		}
117945  	}()
117946  	_rc = int32(0)
117947  _8:
117948  	{
117949  		p := &_pFile.XctrlFlags
117950  		*p = uint16(int32(*p) & int32(-9))
117951  	}
117952  _6:
117953  	return _rc
117954  }
117955  
117956  var _unixSyncØ00__func__Ø000 [9]int8
117957  
117958  func init() {
117959  	crt.Xstrncpy(nil, &_unixSyncØ00__func__Ø000[0], str(132470), 9)
117960  }
117961  
117962  // C comment
117963  //  /*
117964  //  ** The fsync() system call does not work as advertised on many
117965  //  ** unix systems.  The following procedure is an attempt to make
117966  //  ** it work better.
117967  //  **
117968  //  ** The SQLITE_NO_SYNC macro disables all fsync()s.  This is useful
117969  //  ** for testing when we want to run through the test suite quickly.
117970  //  ** You are strongly advised *not* to deploy with SQLITE_NO_SYNC
117971  //  ** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash
117972  //  ** or power failure will likely corrupt the database file.
117973  //  **
117974  //  ** SQLite sets the dataOnly flag if the size of the file is unchanged.
117975  //  ** The idea behind dataOnly is that it should only write the file content
117976  //  ** to disk, not the inode.  We only set dataOnly if the file size is
117977  //  ** unchanged since the file size is part of the inode.  However,
117978  //  ** Ted Ts'o tells us that fdatasync() will also write the inode if the
117979  //  ** file size has changed.  The only real difference between fdatasync()
117980  //  ** and fsync(), Ted tells us, is that fdatasync() will not flush the
117981  //  ** inode if the mtime or owner or other inode attributes have changed.
117982  //  ** We only care about the file size, not the other file attributes, so
117983  //  ** as far as SQLite is concerned, an fdatasync() is always adequate.
117984  //  ** So, we always use fdatasync() if it is available, regardless of
117985  //  ** the value of the dataOnly flag.
117986  //  */
117987  func _full_fsync(tls *crt.TLS, _fd int32, _fullSync int32, _dataOnly int32) (r0 int32) {
117988  	var _rc int32
117989  
117990  	_rc = crt.Xfsync(tls, _fd)
117991  	goto _0
117992  _0:
117993  	return _rc
117994  }
117995  
117996  // C comment
117997  //  /*
117998  //  ** Determine the current size of a file in bytes
117999  //  */
118000  func _unixFileSize(tls *crt.TLS, _id *Xsqlite3_file, _pSize *int64) (r0 int32) {
118001  	var _rc int32
118002  	var _buf crt.Xstruct_stat64
118003  	func() {
118004  		if _id == nil {
118005  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33540), unsafe.Pointer(&_unixFileSizeØ00__func__Ø000), unsafe.Pointer(str(93813)))
118006  			crt.X__builtin_abort(tls)
118007  		}
118008  	}()
118009  	_rc = func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
118010  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
118011  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
118012  	}()(tls, (*XunixFile)(unsafe.Pointer(_id)).Xh, &_buf)
118013  	if _rc != int32(0) {
118014  		_storeLastErrno(tls, (*XunixFile)(unsafe.Pointer(_id)), *crt.X__errno_location(tls))
118015  		return int32(1802)
118016  	}
118017  	*_pSize = _buf.Xst_size
118018  	if (*_pSize) == int64(1) {
118019  		*_pSize = 0
118020  	}
118021  	return int32(0)
118022  }
118023  
118024  var _unixFileSizeØ00__func__Ø000 [13]int8
118025  
118026  func init() {
118027  	crt.Xstrncpy(nil, &_unixFileSizeØ00__func__Ø000[0], str(132479), 13)
118028  }
118029  
118030  // C comment
118031  //  /*
118032  //  ** Lock the file with the lock specified by parameter eFileLock - one
118033  //  ** of the following:
118034  //  **
118035  //  **     (1) SHARED_LOCK
118036  //  **     (2) RESERVED_LOCK
118037  //  **     (3) PENDING_LOCK
118038  //  **     (4) EXCLUSIVE_LOCK
118039  //  **
118040  //  ** Sometimes when requesting one lock state, additional lock states
118041  //  ** are inserted in between.  The locking might fail on one of the later
118042  //  ** transitions leaving the lock state different from what it started but
118043  //  ** still short of its goal.  The following chart shows the allowed
118044  //  ** transitions and the inserted intermediate states:
118045  //  **
118046  //  **    UNLOCKED -> SHARED
118047  //  **    SHARED -> RESERVED
118048  //  **    SHARED -> (PENDING) -> EXCLUSIVE
118049  //  **    RESERVED -> (PENDING) -> EXCLUSIVE
118050  //  **    PENDING -> EXCLUSIVE
118051  //  **
118052  //  ** This routine will only increase a lock.  Use the sqlite3OsUnlock()
118053  //  ** routine to lower a locking level.
118054  //  */
118055  func _unixLock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
118056  	var _rc, _tErrno int32
118057  	var _pInode *XunixInodeInfo
118058  	var _pFile *XunixFile
118059  	var _lock Tflock
118060  	_rc = int32(0)
118061  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
118062  	_tErrno = int32(0)
118063  	func() {
118064  		if _pFile == nil {
118065  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31437), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(58022)))
118066  			crt.X__builtin_abort(tls)
118067  		}
118068  	}()
118069  	if int32(_pFile.XeFileLock) >= _eFileLock {
118070  		return int32(0)
118071  	}
118072  	func() {
118073  		if int32(_pFile.XeFileLock) == int32(0) && _eFileLock != int32(1) {
118074  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31458), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132492)))
118075  			crt.X__builtin_abort(tls)
118076  		}
118077  	}()
118078  	func() {
118079  		if _eFileLock == int32(3) {
118080  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31459), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132544)))
118081  			crt.X__builtin_abort(tls)
118082  		}
118083  	}()
118084  	func() {
118085  		if _eFileLock == int32(2) && int32(_pFile.XeFileLock) != int32(1) {
118086  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31460), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132568)))
118087  			crt.X__builtin_abort(tls)
118088  		}
118089  	}()
118090  	_unixEnterMutex(tls)
118091  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
118092  	if (int32(_pFile.XeFileLock) != int32(_pInode.XeFileLock)) && ((int32(_pInode.XeFileLock) >= int32(3)) || (_eFileLock > int32(1))) {
118093  		_rc = int32(5)
118094  		goto _end_lock
118095  	}
118096  	if (_eFileLock == int32(1)) && ((int32(_pInode.XeFileLock) == int32(1)) || (int32(_pInode.XeFileLock) == int32(2))) {
118097  		func() {
118098  			if _eFileLock != int32(1) {
118099  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31483), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132626)))
118100  				crt.X__builtin_abort(tls)
118101  			}
118102  		}()
118103  		func() {
118104  			if int32(_pFile.XeFileLock) != int32(0) {
118105  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31484), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132649)))
118106  				crt.X__builtin_abort(tls)
118107  			}
118108  		}()
118109  		func() {
118110  			if _pInode.XnShared <= int32(0) {
118111  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31485), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132669)))
118112  				crt.X__builtin_abort(tls)
118113  			}
118114  		}()
118115  		_pFile.XeFileLock = uint8(1)
118116  		_pInode.XnShared += 1
118117  		_pInode.XnLock += 1
118118  		goto _end_lock
118119  	}
118120  	_lock.Xl_len = int64(1)
118121  	_lock.Xl_whence = 0
118122  	if _eFileLock != int32(1) && (_eFileLock != int32(4) || int32(_pFile.XeFileLock) >= int32(3)) {
118123  		goto _25
118124  	}
118125  	_lock.Xl_type = int16(func() int32 {
118126  		if _eFileLock == int32(1) {
118127  			return int32(0)
118128  		}
118129  		return int32(1)
118130  	}())
118131  	_lock.Xl_start = int64(_sqlite3PendingByte)
118132  	if _unixFileLock(tls, _pFile, &_lock) == 0 {
118133  		goto _28
118134  	}
118135  	_tErrno = *crt.X__errno_location(tls)
118136  	_rc = _sqliteErrorFromPosixError(tls, _tErrno, int32(3850))
118137  	if _rc != int32(5) {
118138  		_storeLastErrno(tls, _pFile, _tErrno)
118139  	}
118140  	goto _end_lock
118141  _28:
118142  _25:
118143  	if _eFileLock != int32(1) {
118144  		goto _30
118145  	}
118146  	func() {
118147  		if _pInode.XnShared != int32(0) {
118148  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31519), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132687)))
118149  			crt.X__builtin_abort(tls)
118150  		}
118151  	}()
118152  	func() {
118153  		if int32(_pInode.XeFileLock) != int32(0) {
118154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31520), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132706)))
118155  			crt.X__builtin_abort(tls)
118156  		}
118157  	}()
118158  	func() {
118159  		if _rc != int32(0) {
118160  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31521), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(14967)))
118161  			crt.X__builtin_abort(tls)
118162  		}
118163  	}()
118164  	_lock.Xl_start = int64(_sqlite3PendingByte + int32(2))
118165  	_lock.Xl_len = int64(510)
118166  	if _unixFileLock(tls, _pFile, &_lock) != 0 {
118167  		_tErrno = *crt.X__errno_location(tls)
118168  		_rc = _sqliteErrorFromPosixError(tls, _tErrno, int32(3850))
118169  	}
118170  	_lock.Xl_start = int64(_sqlite3PendingByte)
118171  	_lock.Xl_len = int64(1)
118172  	_lock.Xl_type = int16(2)
118173  	if _unixFileLock(tls, _pFile, &_lock) != 0 && (_rc == int32(0)) {
118174  		_tErrno = *crt.X__errno_location(tls)
118175  		_rc = int32(2058)
118176  	}
118177  	if _rc == 0 {
118178  		goto _40
118179  	}
118180  	if _rc != int32(5) {
118181  		_storeLastErrno(tls, _pFile, _tErrno)
118182  	}
118183  	goto _end_lock
118184  _40:
118185  	_pFile.XeFileLock = uint8(1)
118186  	_pInode.XnLock += 1
118187  	_pInode.XnShared = int32(1)
118188  	goto _46
118189  _30:
118190  	if (_eFileLock == int32(4)) && (_pInode.XnShared > int32(1)) {
118191  		_rc = int32(5)
118192  		goto _46
118193  	}
118194  	func() {
118195  		if int32(0) == int32(_pFile.XeFileLock) {
118196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31560), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132727)))
118197  			crt.X__builtin_abort(tls)
118198  		}
118199  	}()
118200  	_lock.Xl_type = int16(1)
118201  	func() {
118202  		if _eFileLock != int32(2) && _eFileLock != int32(4) {
118203  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31563), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132747)))
118204  			crt.X__builtin_abort(tls)
118205  		}
118206  	}()
118207  	if _eFileLock == int32(2) {
118208  		_lock.Xl_start = int64(_sqlite3PendingByte + int32(1))
118209  		_lock.Xl_len = int64(1)
118210  		goto _53
118211  	}
118212  	_lock.Xl_start = int64(_sqlite3PendingByte + int32(2))
118213  	_lock.Xl_len = int64(510)
118214  _53:
118215  	if _unixFileLock(tls, _pFile, &_lock) == 0 {
118216  		goto _54
118217  	}
118218  	_tErrno = *crt.X__errno_location(tls)
118219  	_rc = _sqliteErrorFromPosixError(tls, _tErrno, int32(3850))
118220  	if _rc != int32(5) {
118221  		_storeLastErrno(tls, _pFile, _tErrno)
118222  	}
118223  _54:
118224  _46:
118225  	if ((_rc == int32(0)) && (int32(_pFile.XeFileLock) <= int32(1))) && (_eFileLock == int32(2)) {
118226  		_pFile.XtransCntrChng = 0
118227  		_pFile.XdbUpdate = 0
118228  		_pFile.XinNormalWrite = uint8(1)
118229  	}
118230  	if _rc == int32(0) {
118231  		_pFile.XeFileLock = uint8(_eFileLock)
118232  		_pInode.XeFileLock = uint8(_eFileLock)
118233  		goto _end_lock
118234  	}
118235  	if _eFileLock == int32(4) {
118236  		_pFile.XeFileLock = uint8(3)
118237  		_pInode.XeFileLock = uint8(3)
118238  	}
118239  _end_lock:
118240  	_unixLeaveMutex(tls)
118241  	return _rc
118242  }
118243  
118244  var _unixLockØ00__func__Ø000 [9]int8
118245  
118246  func init() {
118247  	crt.Xstrncpy(nil, &_unixLockØ00__func__Ø000[0], str(132801), 9)
118248  }
118249  
118250  // C comment
118251  //  /*
118252  //  ** This routine translates a standard POSIX errno code into something
118253  //  ** useful to the clients of the sqlite3 functions.  Specifically, it is
118254  //  ** intended to translate a variety of "try again" errors into SQLITE_BUSY
118255  //  ** and a variety of "please close the file descriptor NOW" errors into
118256  //  ** SQLITE_IOERR
118257  //  **
118258  //  ** Errors during initialization of locks, or file system support for locks,
118259  //  ** should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately.
118260  //  */
118261  func _sqliteErrorFromPosixError(tls *crt.TLS, _posixError int32, _sqliteIOErr int32) (r0 int32) {
118262  	func() {
118263  		if _sqliteIOErr != int32(3850) && _sqliteIOErr != int32(2058) && _sqliteIOErr != int32(2314) && _sqliteIOErr != int32(3594) {
118264  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(30686), unsafe.Pointer(&_sqliteErrorFromPosixErrorØ00__func__Ø000), unsafe.Pointer(str(132810)))
118265  			crt.X__builtin_abort(tls)
118266  		}
118267  	}()
118268  	switch _posixError {
118269  	case int32(1):
118270  		goto _12
118271  	case int32(4):
118272  		goto _6
118273  	case int32(11):
118274  		goto _6
118275  	case int32(13):
118276  		goto _6
118277  	case int32(16):
118278  		goto _6
118279  	case int32(37):
118280  		goto _6
118281  	case int32(110):
118282  		goto _6
118283  	default:
118284  		goto _13
118285  	}
118286  
118287  _6:
118288  	return int32(5)
118289  
118290  _12:
118291  	return int32(3)
118292  
118293  _13:
118294  	return _sqliteIOErr
118295  }
118296  
118297  var _sqliteErrorFromPosixErrorØ00__func__Ø000 [26]int8
118298  
118299  func init() {
118300  	crt.Xstrncpy(nil, &_sqliteErrorFromPosixErrorØ00__func__Ø000[0], str(132976), 26)
118301  }
118302  
118303  // C comment
118304  //  /*
118305  //  ** This routine checks if there is a RESERVED lock held on the specified
118306  //  ** file by this or any other process. If such a lock is held, set *pResOut
118307  //  ** to a non-zero value otherwise *pResOut is set to zero.  The return value
118308  //  ** is set to SQLITE_OK unless an I/O error occurs during lock checking.
118309  //  */
118310  func _unixCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) {
118311  	var _rc, _reserved int32
118312  	var _pFile *XunixFile
118313  	var _2_lock Tflock
118314  	_rc = int32(0)
118315  	_reserved = int32(0)
118316  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
118317  	func() {
118318  		if _pFile == nil {
118319  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31288), unsafe.Pointer(&_unixCheckReservedLockØ00__func__Ø000), unsafe.Pointer(str(58022)))
118320  			crt.X__builtin_abort(tls)
118321  		}
118322  	}()
118323  	func() {
118324  		if int32(_pFile.XeFileLock) > int32(1) {
118325  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31289), unsafe.Pointer(&_unixCheckReservedLockØ00__func__Ø000), unsafe.Pointer(str(133002)))
118326  			crt.X__builtin_abort(tls)
118327  		}
118328  	}()
118329  	_unixEnterMutex(tls)
118330  	if int32((*XunixInodeInfo)(_pFile.XpInode).XeFileLock) > int32(1) {
118331  		_reserved = int32(1)
118332  	}
118333  	if _reserved != 0 || ((*XunixInodeInfo)(_pFile.XpInode).XbProcessLock) != 0 {
118334  		goto _6
118335  	}
118336  	_2_lock.Xl_whence = 0
118337  	_2_lock.Xl_start = int64(_sqlite3PendingByte + int32(1))
118338  	_2_lock.Xl_len = int64(1)
118339  	_2_lock.Xl_type = int16(1)
118340  	if func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
118341  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
118342  		return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
118343  	}()(tls, _pFile.Xh, int32(5), unsafe.Pointer(&_2_lock)) != 0 {
118344  		_rc = int32(3594)
118345  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
118346  		goto _9
118347  	}
118348  	if int32(_2_lock.Xl_type) != int32(2) {
118349  		_reserved = int32(1)
118350  	}
118351  _9:
118352  _6:
118353  	_unixLeaveMutex(tls)
118354  	*_pResOut = _reserved
118355  	return _rc
118356  }
118357  
118358  var _unixCheckReservedLockØ00__func__Ø000 [22]int8
118359  
118360  func init() {
118361  	crt.Xstrncpy(nil, &_unixCheckReservedLockØ00__func__Ø000[0], str(133032), 22)
118362  }
118363  
118364  // C comment
118365  //  /*
118366  //  ** Information and control of an open file handle.
118367  //  */
118368  func _unixFileControl(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) (r0 int32) {
118369  	var _5_rc, _12_rc int32
118370  	var _12_newLimit int64
118371  	var _9_zTFile *int8
118372  	var _pFile *XunixFile
118373  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
118374  	switch _op {
118375  	case int32(-905363552):
118376  		goto _11
118377  	case int32(1):
118378  		goto _1
118379  	case int32(4):
118380  		goto _2
118381  	case int32(5):
118382  		goto _4
118383  	case int32(6):
118384  		goto _3
118385  	case int32(10):
118386  		goto _5
118387  	case int32(12):
118388  		goto _7
118389  	case int32(13):
118390  		goto _6
118391  	case int32(16):
118392  		goto _8
118393  	case int32(18):
118394  		goto _10
118395  	case int32(20):
118396  		goto _9
118397  	default:
118398  		goto _12
118399  	}
118400  
118401  _1:
118402  	*(*int32)(_pArg) = int32(_pFile.XeFileLock)
118403  	return int32(0)
118404  
118405  _2:
118406  	*(*int32)(_pArg) = _pFile.XlastErrno
118407  	return int32(0)
118408  
118409  _3:
118410  	_pFile.XszChunk = *(*int32)(_pArg)
118411  	return int32(0)
118412  
118413  _4:
118414  	_5_rc = _fcntlSizeHint(tls, _pFile, *(*int64)(_pArg))
118415  	return _5_rc
118416  
118417  _5:
118418  	_unixModeBit(tls, _pFile, uint8(4), (*int32)(_pArg))
118419  	return int32(0)
118420  
118421  _6:
118422  	_unixModeBit(tls, _pFile, uint8(16), (*int32)(_pArg))
118423  	return int32(0)
118424  
118425  _7:
118426  	*(**int8)(_pArg) = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer((*Xsqlite3_vfs)(_pFile.XpVfs).XzName))
118427  	return int32(0)
118428  
118429  _8:
118430  	_9_zTFile = (*int8)(Xsqlite3_malloc64(tls, uint64((*Xsqlite3_vfs)(_pFile.XpVfs).XmxPathname)))
118431  	if _9_zTFile != nil {
118432  		_unixGetTempname(tls, (*Xsqlite3_vfs)(_pFile.XpVfs).XmxPathname, _9_zTFile)
118433  		*(**int8)(_pArg) = _9_zTFile
118434  	}
118435  	return int32(0)
118436  
118437  _9:
118438  	*(*int32)(_pArg) = _fileHasMoved(tls, _pFile)
118439  	return int32(0)
118440  
118441  _10:
118442  	_12_newLimit = *(*int64)(_pArg)
118443  	_12_rc = int32(0)
118444  	if _12_newLimit > _sqlite3Config.XmxMmap {
118445  		_12_newLimit = _sqlite3Config.XmxMmap
118446  	}
118447  	*(*int64)(_pArg) = _pFile.XmmapSizeMax
118448  	if _12_newLimit < (0) || _12_newLimit == _pFile.XmmapSizeMax || _pFile.XnFetchOut != int32(0) {
118449  		goto _17
118450  	}
118451  	_pFile.XmmapSizeMax = _12_newLimit
118452  	if _pFile.XmmapSize > (0) {
118453  		_unixUnmapfile(tls, _pFile)
118454  		_12_rc = _unixMapfile(tls, _pFile, int64(-1))
118455  	}
118456  _17:
118457  	return _12_rc
118458  
118459  _11:
118460  	(*XunixFile)(unsafe.Pointer(_id)).XdbUpdate = 0
118461  	return int32(0)
118462  
118463  _12:
118464  	return int32(12)
118465  }
118466  
118467  // C comment
118468  //  /*
118469  //  ** This function is called to handle the SQLITE_FCNTL_SIZE_HINT
118470  //  ** file-control operation.  Enlarge the database to nBytes in size
118471  //  ** (rounded up to the next chunk-size).  If the database is already
118472  //  ** nBytes or larger, this routine is a no-op.
118473  //  */
118474  func _fcntlSizeHint(tls *crt.TLS, _pFile *XunixFile, _nByte int64) (r0 int32) {
118475  	var _3_nBlk, _3_nWrite, _5_rc int32
118476  	var _1_nSize, _3_iWrite int64
118477  	var _1_buf crt.Xstruct_stat64
118478  	if _pFile.XszChunk <= int32(0) {
118479  		goto _0
118480  	}
118481  	if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
118482  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
118483  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
118484  	}()(tls, _pFile.Xh, &_1_buf) != 0 {
118485  		return int32(1802)
118486  	}
118487  	_1_nSize = (((_nByte + int64(_pFile.XszChunk)) - int64(1)) / int64(_pFile.XszChunk)) * int64(_pFile.XszChunk)
118488  	if _1_nSize <= _1_buf.Xst_size {
118489  		goto _2
118490  	}
118491  	_3_nBlk = int32(_1_buf.Xst_blksize)
118492  	_3_nWrite = int32(0)
118493  	_3_iWrite = (((_1_buf.Xst_size / int64(_3_nBlk)) * int64(_3_nBlk)) + int64(_3_nBlk)) - int64(1)
118494  	func() {
118495  		if _3_iWrite < _1_buf.Xst_size {
118496  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33609), unsafe.Pointer(&_fcntlSizeHintØ00__func__Ø000), unsafe.Pointer(str(133054)))
118497  			crt.X__builtin_abort(tls)
118498  		}
118499  	}()
118500  	func() {
118501  		if ((_3_iWrite + int64(1)) % int64(_3_nBlk)) != (0) {
118502  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33610), unsafe.Pointer(&_fcntlSizeHintØ00__func__Ø000), unsafe.Pointer(str(133074)))
118503  			crt.X__builtin_abort(tls)
118504  		}
118505  	}()
118506  _7:
118507  	if _3_iWrite >= ((_1_nSize + int64(_3_nBlk)) - int64(1)) {
118508  		goto _10
118509  	}
118510  	if _3_iWrite >= _1_nSize {
118511  		_3_iWrite = _1_nSize - int64(1)
118512  	}
118513  	_3_nWrite = _seekAndWrite(tls, _pFile, _3_iWrite, unsafe.Pointer(str(284)), int32(1))
118514  	if _3_nWrite != int32(1) {
118515  		return int32(778)
118516  	}
118517  	_3_iWrite += int64(_3_nBlk)
118518  	goto _7
118519  _10:
118520  _2:
118521  _0:
118522  	if _pFile.XmmapSizeMax <= (0) || _nByte <= _pFile.XmmapSize {
118523  		goto _14
118524  	}
118525  	if _pFile.XszChunk > int32(0) {
118526  		goto _15
118527  	}
118528  	if _robust_ftruncate(tls, _pFile.Xh, _nByte) != 0 {
118529  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
118530  		return _unixLogErrorAtLine(tls, int32(1546), str(131546), _pFile.XzPath, int32(33626))
118531  	}
118532  _15:
118533  	_5_rc = _unixMapfile(tls, _pFile, _nByte)
118534  	return _5_rc
118535  
118536  _14:
118537  	return int32(0)
118538  }
118539  
118540  var _fcntlSizeHintØ00__func__Ø000 [14]int8
118541  
118542  func init() {
118543  	crt.Xstrncpy(nil, &_fcntlSizeHintØ00__func__Ø000[0], str(133095), 14)
118544  }
118545  
118546  // C comment
118547  //  /*
118548  //  ** Memory map or remap the file opened by file-descriptor pFd (if the file
118549  //  ** is already mapped, the existing mapping is replaced by the new). Or, if
118550  //  ** there already exists a mapping for this file, and there are still
118551  //  ** outstanding xFetch() references to it, this function is a no-op.
118552  //  **
118553  //  ** If parameter nByte is non-negative, then it is the requested size of
118554  //  ** the mapping to create. Otherwise, if nByte is less than zero, then the
118555  //  ** requested size is the size of the file on disk. The actual size of the
118556  //  ** created mapping is either the requested size or the value configured
118557  //  ** using SQLITE_FCNTL_MMAP_LIMIT, whichever is smaller.
118558  //  **
118559  //  ** SQLITE_OK is returned if no error occurs (even if the mapping is not
118560  //  ** recreated as a result of outstanding references) or an SQLite error
118561  //  ** code otherwise.
118562  //  */
118563  func _unixMapfile(tls *crt.TLS, _pFd *XunixFile, _nMap int64) (r0 int32) {
118564  	var _1_statbuf crt.Xstruct_stat64
118565  	func() {
118566  		if _nMap < (0) && _pFd.XnFetchOut != int32(0) {
118567  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34713), unsafe.Pointer(&_unixMapfileØ00__func__Ø000), unsafe.Pointer(str(133109)))
118568  			crt.X__builtin_abort(tls)
118569  		}
118570  	}()
118571  	func() {
118572  		if _nMap <= (0) && (_pFd.XmmapSize != (0) || _pFd.XpMapRegion != nil) {
118573  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34714), unsafe.Pointer(&_unixMapfileØ00__func__Ø000), unsafe.Pointer(str(133138)))
118574  			crt.X__builtin_abort(tls)
118575  		}
118576  	}()
118577  	if _pFd.XnFetchOut > int32(0) {
118578  		return int32(0)
118579  	}
118580  	if _nMap >= (0) {
118581  		goto _8
118582  	}
118583  	if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
118584  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
118585  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
118586  	}()(tls, _pFd.Xh, &_1_statbuf) != 0 {
118587  		return int32(1802)
118588  	}
118589  	_nMap = _1_statbuf.Xst_size
118590  _8:
118591  	if _nMap > _pFd.XmmapSizeMax {
118592  		_nMap = _pFd.XmmapSizeMax
118593  	}
118594  	func() {
118595  		if _nMap <= (0) && (_pFd.XmmapSize != (0) || _pFd.XpMapRegion != nil) {
118596  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34728), unsafe.Pointer(&_unixMapfileØ00__func__Ø000), unsafe.Pointer(str(133138)))
118597  			crt.X__builtin_abort(tls)
118598  		}
118599  	}()
118600  	if _nMap != _pFd.XmmapSize {
118601  		_unixRemapfile(tls, _pFd, _nMap)
118602  	}
118603  	return int32(0)
118604  }
118605  
118606  var _unixMapfileØ00__func__Ø000 [12]int8
118607  
118608  func init() {
118609  	crt.Xstrncpy(nil, &_unixMapfileØ00__func__Ø000[0], str(133189), 12)
118610  }
118611  
118612  // C comment
118613  //  /*
118614  //  ** Attempt to set the size of the memory mapping maintained by file
118615  //  ** descriptor pFd to nNew bytes. Any existing mapping is discarded.
118616  //  **
118617  //  ** If successful, this function sets the following variables:
118618  //  **
118619  //  **       unixFile.pMapRegion
118620  //  **       unixFile.mmapSize
118621  //  **       unixFile.mmapSizeActual
118622  //  **
118623  //  ** If unsuccessful, an error message is logged via sqlite3_log() and
118624  //  ** the three variables above are zeroed. In this case SQLite should
118625  //  ** continue accessing the database using the xRead() and xWrite()
118626  //  ** methods.
118627  //  */
118628  func _unixRemapfile(tls *crt.TLS, _pFd *XunixFile, _nNew int64) {
118629  	var _h, _flags, _1_szSyspage int32
118630  	var _nOrig, _1_nReuse int64
118631  	var _zErr *int8
118632  	var _pOrig, _pNew, _1_pReq *uint8
118633  	_zErr = str(131668)
118634  	_h = _pFd.Xh
118635  	_pOrig = (*uint8)(_pFd.XpMapRegion)
118636  	_nOrig = _pFd.XmmapSizeActual
118637  	_pNew = nil
118638  	_flags = int32(1)
118639  	func() {
118640  		if _pFd.XnFetchOut != int32(0) {
118641  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34631), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(132201)))
118642  			crt.X__builtin_abort(tls)
118643  		}
118644  	}()
118645  	func() {
118646  		if _nNew <= _pFd.XmmapSize {
118647  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34632), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(133201)))
118648  			crt.X__builtin_abort(tls)
118649  		}
118650  	}()
118651  	func() {
118652  		if _nNew > _pFd.XmmapSizeMax {
118653  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34633), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(133220)))
118654  			crt.X__builtin_abort(tls)
118655  		}
118656  	}()
118657  	func() {
118658  		if _nNew <= (0) {
118659  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34634), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(82808)))
118660  			crt.X__builtin_abort(tls)
118661  		}
118662  	}()
118663  	func() {
118664  		if _pFd.XmmapSizeActual < _pFd.XmmapSize {
118665  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34635), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(133243)))
118666  			crt.X__builtin_abort(tls)
118667  		}
118668  	}()
118669  	func() {
118670  		if crt.U2P(uintptr(uint64(18446744073709551615))) == nil {
118671  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34636), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(133278)))
118672  			crt.X__builtin_abort(tls)
118673  		}
118674  	}()
118675  	if _pOrig == nil {
118676  		goto _12
118677  	}
118678  	_1_szSyspage = func() func(*crt.TLS) int32 {
118679  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(25)).XpCurrent
118680  		return *(*func(*crt.TLS) int32)(unsafe.Pointer(&v))
118681  	}()(tls)
118682  	_1_nReuse = _pFd.XmmapSize & int64(^(_1_szSyspage - int32(1)))
118683  	_1_pReq = elem15(_pOrig, uintptr(_1_nReuse))
118684  	if _1_nReuse != _nOrig {
118685  		func() func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer {
118686  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(23)).XpCurrent
118687  			return *(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&v))
118688  		}()(tls, unsafe.Pointer(_1_pReq), uint64(_nOrig-_1_nReuse))
118689  	}
118690  	_pNew = (*uint8)(func() func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer {
118691  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(22)).XpCurrent
118692  		return *(*func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&v))
118693  	}()(tls, unsafe.Pointer(_1_pReq), uint64(_nNew-_1_nReuse), _flags, int32(1), _h, _1_nReuse))
118694  	if _pNew == (*uint8)(crt.U2P(uintptr(uint64(18446744073709551615)))) {
118695  		goto _14
118696  	}
118697  	if _pNew != _1_pReq {
118698  		func() func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer {
118699  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(23)).XpCurrent
118700  			return *(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&v))
118701  		}()(tls, unsafe.Pointer(_pNew), uint64(_nNew-_1_nReuse))
118702  		_pNew = nil
118703  		goto _16
118704  	}
118705  	_pNew = _pOrig
118706  _16:
118707  _14:
118708  	if (_pNew == (*uint8)(crt.U2P(uintptr(uint64(18446744073709551615))))) || (_pNew == nil) {
118709  		func() func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer {
118710  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(23)).XpCurrent
118711  			return *(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&v))
118712  		}()(tls, unsafe.Pointer(_pOrig), uint64(_1_nReuse))
118713  	}
118714  _12:
118715  	if _pNew == nil {
118716  		_pNew = (*uint8)(func() func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer {
118717  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(22)).XpCurrent
118718  			return *(*func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&v))
118719  		}()(tls, nil, uint64(_nNew), _flags, int32(1), _h, 0))
118720  	}
118721  	if _pNew == (*uint8)(crt.U2P(uintptr(uint64(18446744073709551615)))) {
118722  		_pNew = nil
118723  		_nNew = 0
118724  		_unixLogErrorAtLine(tls, int32(0), _zErr, _pFd.XzPath, int32(34685))
118725  		_pFd.XmmapSizeMax = 0
118726  	}
118727  	_pFd.XpMapRegion = unsafe.Pointer(_pNew)
118728  	_pFd.XmmapSize = store37(&_pFd.XmmapSizeActual, _nNew)
118729  }
118730  
118731  var _unixRemapfileØ00__func__Ø000 [14]int8
118732  
118733  func init() {
118734  	crt.Xstrncpy(nil, &_unixRemapfileØ00__func__Ø000[0], str(133292), 14)
118735  }
118736  
118737  // C comment
118738  //  /*
118739  //  ** If *pArg is initially negative then this is a query.  Set *pArg to
118740  //  ** 1 or 0 depending on whether or not bit mask of pFile->ctrlFlags is set.
118741  //  **
118742  //  ** If *pArg is 0 or 1, then clear or set the mask bit of pFile->ctrlFlags.
118743  //  */
118744  func _unixModeBit(tls *crt.TLS, _pFile *XunixFile, _mask uint8, _pArg *int32) {
118745  	if (*_pArg) < int32(0) {
118746  		*_pArg = bool2int((int32(_pFile.XctrlFlags) & int32(_mask)) != int32(0))
118747  		goto _3
118748  	}
118749  	if (*_pArg) == int32(0) {
118750  		{
118751  			p := &_pFile.XctrlFlags
118752  			*p = uint16(int32(*p) & (^int32(_mask)))
118753  		}
118754  		goto _3
118755  	}
118756  	{
118757  		p := &_pFile.XctrlFlags
118758  		*p = uint16(int32(*p) | int32(_mask))
118759  	}
118760  _3:
118761  }
118762  
118763  // C comment
118764  //  /*
118765  //  ** Create a temporary file name in zBuf.  zBuf must be allocated
118766  //  ** by the calling process and must be big enough to hold at least
118767  //  ** pVfs->mxPathname bytes.
118768  //  */
118769  func _unixGetTempname(tls *crt.TLS, _nBuf int32, _zBuf *int8) (r0 int32) {
118770  	var _iLimit int32
118771  	var _1_r uint64
118772  	var _zDir *int8
118773  	_iLimit = int32(0)
118774  	*elem1(_zBuf, 0) = 0
118775  	_zDir = _unixTempFileDir(tls)
118776  	if _zDir == nil {
118777  		return int32(6410)
118778  	}
118779  _0:
118780  	Xsqlite3_randomness(tls, int32(8), unsafe.Pointer(&_1_r))
118781  	func() {
118782  		if _nBuf <= int32(2) {
118783  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35347), unsafe.Pointer(&_unixGetTempnameØ00__func__Ø000), unsafe.Pointer(str(133306)))
118784  			crt.X__builtin_abort(tls)
118785  		}
118786  	}()
118787  	*elem1(_zBuf, uintptr(_nBuf-int32(2))) = 0
118788  	Xsqlite3_snprintf(tls, _nBuf, _zBuf, str(133313), unsafe.Pointer(_zDir), _1_r, int32(0))
118789  	if (int32(*elem1(_zBuf, uintptr(_nBuf-int32(2)))) != int32(0)) || (postInc2(&_iLimit, 1) > int32(10)) {
118790  		return int32(1)
118791  	}
118792  	if func() func(*crt.TLS, *int8, int32) int32 {
118793  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(2)).XpCurrent
118794  		return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v))
118795  	}()(tls, _zBuf, int32(0)) == int32(0) {
118796  		goto _0
118797  	}
118798  	return int32(0)
118799  
118800  	_ = _iLimit
118801  	panic(0)
118802  }
118803  
118804  // C comment
118805  //  /*
118806  //  ** Return the name of a directory in which to put temporary files.
118807  //  ** If no suitable temporary file directory can be found, return NULL.
118808  //  */
118809  func _unixTempFileDir(tls *crt.TLS) (r0 *int8) {
118810  	var _i uint32
118811  	var _zDir *int8
118812  	var _buf crt.Xstruct_stat64
118813  	_i = uint32(0)
118814  	_zDir = Xsqlite3_temp_directory
118815  	if (*elem0((**int8)(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)), 0)) == nil {
118816  		*elem0((**int8)(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)), 0) = crt.Xgetenv(tls, str(133330))
118817  	}
118818  	if (*elem0((**int8)(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)), uintptr(1))) == nil {
118819  		*elem0((**int8)(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)), uintptr(1)) = crt.Xgetenv(tls, str(133344))
118820  	}
118821  _1:
118822  	if (((_zDir != nil) && (func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
118823  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(4)).XpCurrent
118824  		return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
118825  	}()(tls, _zDir, &_buf) == int32(0))) && ((_buf.Xst_mode & uint32(61440)) == uint32(16384))) && (func() func(*crt.TLS, *int8, int32) int32 {
118826  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(2)).XpCurrent
118827  		return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v))
118828  	}()(tls, _zDir, int32(3)) == int32(0)) {
118829  		return _zDir
118830  	}
118831  	if uint64(_i) >= uint64(6) {
118832  		goto _3
118833  	}
118834  	_zDir = *elem0((**int8)(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)), uintptr(postInc34(&_i, uint32(1))))
118835  	goto _1
118836  _3:
118837  	return nil
118838  }
118839  
118840  var _unixTempFileDirØ00azDirsØ001 [6]*int8
118841  
118842  func init() {
118843  	_unixTempFileDirØ00azDirsØ001 = [6]*int8{nil, nil, str(133351), str(133360), str(133369), str(330)}
118844  }
118845  
118846  var _unixGetTempnameØ00__func__Ø000 [16]int8
118847  
118848  func init() {
118849  	crt.Xstrncpy(nil, &_unixGetTempnameØ00__func__Ø000[0], str(133374), 16)
118850  }
118851  
118852  func _unixSectorSize(tls *crt.TLS, _NotUsed *Xsqlite3_file) (r0 int32) {
118853  	return int32(4096)
118854  }
118855  
118856  // C comment
118857  //  /*
118858  //  ** Return the device characteristics for the file.
118859  //  **
118860  //  ** This VFS is set up to return SQLITE_IOCAP_POWERSAFE_OVERWRITE by default.
118861  //  ** However, that choice is controversial since technically the underlying
118862  //  ** file system does not always provide powersafe overwrites.  (In other
118863  //  ** words, after a power-loss event, parts of the file that were never
118864  //  ** written might end up being altered.)  However, non-PSOW behavior is very,
118865  //  ** very rare.  And asserting PSOW makes a large reduction in the amount
118866  //  ** of required I/O for journaling, since a lot of padding is eliminated.
118867  //  **  Hence, while POWERSAFE_OVERWRITE is on by default, there is a file-control
118868  //  ** available to turn it off and URI query parameter available to turn it off.
118869  //  */
118870  func _unixDeviceCharacteristics(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
118871  	var _rc int32
118872  	var _p *XunixFile
118873  	_p = (*XunixFile)(unsafe.Pointer(_id))
118874  	_rc = int32(0)
118875  	if (int32(_p.XctrlFlags) & int32(16)) != 0 {
118876  		_rc |= int32(4096)
118877  	}
118878  	return _rc
118879  }
118880  
118881  // C comment
118882  //  /*
118883  //  ** This function is called to obtain a pointer to region iRegion of the
118884  //  ** shared-memory associated with the database file fd. Shared-memory regions
118885  //  ** are numbered starting from zero. Each shared-memory region is szRegion
118886  //  ** bytes in size.
118887  //  **
118888  //  ** If an error occurs, an error code is returned and *pp is set to NULL.
118889  //  **
118890  //  ** Otherwise, if the bExtend parameter is 0 and the requested shared-memory
118891  //  ** region has not been allocated (by any client, including one running in a
118892  //  ** separate process), then *pp is set to NULL and SQLITE_OK returned. If
118893  //  ** bExtend is non-zero and the requested shared-memory region has not yet
118894  //  ** been allocated, it is allocated by this function.
118895  //  **
118896  //  ** If the shared-memory region has already been allocated or is allocated by
118897  //  ** this call as described above, then it is mapped into this processes
118898  //  ** address space (if it is not already), *pp is set to point to the mapped
118899  //  ** memory and SQLITE_OK returned.
118900  //  */
118901  func _unixShmMap(tls *crt.TLS, _fd *Xsqlite3_file, _iRegion int32, _szRegion int32, _bExtend int32, _pp *unsafe.Pointer) (r0 int32) {
118902  	var _rc, _nShmPerMap, _nReqRegion, _2_nByte, _7_iPg, _8_x, _11_nMap, _11_i int32
118903  	var _9_zFile *int8
118904  	var _11_pMem unsafe.Pointer
118905  	var _2_sStat crt.Xstruct_stat64
118906  	var _2_apNew **int8
118907  	var _pDbFd *XunixFile
118908  	var _pShmNode *XunixShmNode
118909  	var _p *TunixShm
118910  	_pDbFd = (*XunixFile)(unsafe.Pointer(_fd))
118911  	_rc = int32(0)
118912  	_nShmPerMap = _unixShmRegionPerMap(tls)
118913  	if (*TunixShm)(_pDbFd.XpShm) != nil {
118914  		goto _0
118915  	}
118916  	_rc = _unixOpenSharedMemory(tls, _pDbFd)
118917  	if _rc != int32(0) {
118918  		return _rc
118919  	}
118920  _0:
118921  	_p = (*TunixShm)(_pDbFd.XpShm)
118922  	_pShmNode = (*XunixShmNode)(_p.XpShmNode)
118923  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
118924  	func() {
118925  		if _szRegion != _pShmNode.XszRegion && int32(_pShmNode.XnRegion) != int32(0) {
118926  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34296), unsafe.Pointer(&_unixShmMapØ00__func__Ø000), unsafe.Pointer(str(133390)))
118927  			crt.X__builtin_abort(tls)
118928  		}
118929  	}()
118930  	func() {
118931  		if (*XunixInodeInfo)(_pShmNode.XpInode) != (*XunixInodeInfo)(_pDbFd.XpInode) {
118932  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34297), unsafe.Pointer(&_unixShmMapØ00__func__Ø000), unsafe.Pointer(str(133443)))
118933  			crt.X__builtin_abort(tls)
118934  		}
118935  	}()
118936  	func() {
118937  		if _pShmNode.Xh < int32(0) && int32((*XunixInodeInfo)(_pDbFd.XpInode).XbProcessLock) != int32(1) {
118938  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34298), unsafe.Pointer(&_unixShmMapØ00__func__Ø000), unsafe.Pointer(str(133475)))
118939  			crt.X__builtin_abort(tls)
118940  		}
118941  	}()
118942  	func() {
118943  		if _pShmNode.Xh >= int32(0) && int32((*XunixInodeInfo)(_pDbFd.XpInode).XbProcessLock) != int32(0) {
118944  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34299), unsafe.Pointer(&_unixShmMapØ00__func__Ø000), unsafe.Pointer(str(133524)))
118945  			crt.X__builtin_abort(tls)
118946  		}
118947  	}()
118948  	_nReqRegion = ((_iRegion + _nShmPerMap) / _nShmPerMap) * _nShmPerMap
118949  	if int32(_pShmNode.XnRegion) >= _nReqRegion {
118950  		goto _shmpage_out
118951  	}
118952  	_2_nByte = _nReqRegion * _szRegion
118953  	_pShmNode.XszRegion = _szRegion
118954  	if _pShmNode.Xh < int32(0) {
118955  		goto _14
118956  	}
118957  	if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
118958  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
118959  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
118960  	}()(tls, _pShmNode.Xh, &_2_sStat) != 0 {
118961  		_rc = int32(4874)
118962  		goto _shmpage_out
118963  	}
118964  	if _2_sStat.Xst_size >= int64(_2_nByte) {
118965  		goto _16
118966  	}
118967  	if _bExtend == 0 {
118968  		goto _shmpage_out
118969  	}
118970  	func() {
118971  		if (_2_nByte % _unixShmMapØ00pgszØ001) != int32(0) {
118972  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34341), unsafe.Pointer(&_unixShmMapØ00__func__Ø000), unsafe.Pointer(str(133572)))
118973  			crt.X__builtin_abort(tls)
118974  		}
118975  	}()
118976  	_7_iPg = int32(_2_sStat.Xst_size / int64(_unixShmMapØ00pgszØ001))
118977  _21:
118978  	if _7_iPg >= (_2_nByte / _unixShmMapØ00pgszØ001) {
118979  		goto _24
118980  	}
118981  	_8_x = int32(0)
118982  	if _seekAndWriteFd(tls, _pShmNode.Xh, int64(((_7_iPg*_unixShmMapØ00pgszØ001)+_unixShmMapØ00pgszØ001)-int32(1)), unsafe.Pointer(str(284)), int32(1), &_8_x) != int32(1) {
118983  		_9_zFile = _pShmNode.XzFilename
118984  		_rc = _unixLogErrorAtLine(tls, int32(4874), str(131581), _9_zFile, int32(34346))
118985  		goto _shmpage_out
118986  	}
118987  	_7_iPg += 1
118988  	goto _21
118989  _24:
118990  _16:
118991  _14:
118992  	_2_apNew = (**int8)(Xsqlite3_realloc(tls, unsafe.Pointer(_pShmNode.XapRegion), int32(uint64(_nReqRegion)*uint64(8))))
118993  	if _2_apNew == nil {
118994  		_rc = _sqlite3IoerrnomemError(tls, int32(34359))
118995  		goto _shmpage_out
118996  	}
118997  	_pShmNode.XapRegion = _2_apNew
118998  _27:
118999  	if int32(_pShmNode.XnRegion) >= _nReqRegion {
119000  		goto _28
119001  	}
119002  	_11_nMap = _szRegion * _nShmPerMap
119003  	if _pShmNode.Xh < int32(0) {
119004  		goto _29
119005  	}
119006  	_11_pMem = func() func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer {
119007  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(22)).XpCurrent
119008  		return *(*func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&v))
119009  	}()(tls, nil, uint64(_11_nMap), func() int32 {
119010  		if _pShmNode.XisReadonly != 0 {
119011  			return int32(1)
119012  		}
119013  		return int32(3)
119014  	}(), int32(1), _pShmNode.Xh, int64(_szRegion)*int64(_pShmNode.XnRegion))
119015  	if _11_pMem == crt.U2P(uintptr(uint64(18446744073709551615))) {
119016  		_rc = _unixLogErrorAtLine(tls, int32(5386), str(131668), _pShmNode.XzFilename, int32(34373))
119017  		goto _shmpage_out
119018  	}
119019  	goto _33
119020  _29:
119021  	_11_pMem = Xsqlite3_malloc64(tls, uint64(_szRegion))
119022  	if _11_pMem == nil {
119023  		_rc = _sqlite3NomemError(tls, int32(34379))
119024  		goto _shmpage_out
119025  	}
119026  	crt.Xmemset(tls, _11_pMem, int32(0), uint64(_szRegion))
119027  _33:
119028  	_11_i = int32(0)
119029  _35:
119030  	if _11_i >= _nShmPerMap {
119031  		goto _38
119032  	}
119033  	*elem0(_pShmNode.XapRegion, uintptr(int32(_pShmNode.XnRegion)+_11_i)) = elem1((*int8)(_11_pMem), uintptr(_szRegion*_11_i))
119034  	_11_i += 1
119035  	goto _35
119036  _38:
119037  	{
119038  		p := &_pShmNode.XnRegion
119039  		*p = uint16(int32(*p) + _nShmPerMap)
119040  	}
119041  	goto _27
119042  _28:
119043  _shmpage_out:
119044  	if int32(_pShmNode.XnRegion) > _iRegion {
119045  		*_pp = unsafe.Pointer(*elem0(_pShmNode.XapRegion, uintptr(_iRegion)))
119046  		goto _40
119047  	}
119048  	*_pp = nil
119049  _40:
119050  	if (_pShmNode.XisReadonly != 0) && (_rc == int32(0)) {
119051  		_rc = int32(8)
119052  	}
119053  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119054  	return _rc
119055  }
119056  
119057  // C comment
119058  //  /*
119059  //  ** Return the minimum number of 32KB shm regions that should be mapped at
119060  //  ** a time, assuming that each mapping must be an integer multiple of the
119061  //  ** current system page-size.
119062  //  **
119063  //  ** Usually, this is 1. The exception seems to be systems that are configured
119064  //  ** to use 64KB pages - in this case each mapping must cover at least two
119065  //  ** shm regions.
119066  //  */
119067  func _unixShmRegionPerMap(tls *crt.TLS) (r0 int32) {
119068  	var _shmsz, _pgsz int32
119069  	_shmsz = int32(32768)
119070  	_pgsz = func() func(*crt.TLS) int32 {
119071  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(25)).XpCurrent
119072  		return *(*func(*crt.TLS) int32)(unsafe.Pointer(&v))
119073  	}()(tls)
119074  	func() {
119075  		if ((_pgsz - int32(1)) & _pgsz) != int32(0) {
119076  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34053), unsafe.Pointer(&_unixShmRegionPerMapØ00__func__Ø000), unsafe.Pointer(str(133590)))
119077  			crt.X__builtin_abort(tls)
119078  		}
119079  	}()
119080  	if _pgsz < _shmsz {
119081  		return int32(1)
119082  	}
119083  	return _pgsz / _shmsz
119084  }
119085  
119086  var _unixShmRegionPerMapØ00__func__Ø000 [20]int8
119087  
119088  func init() {
119089  	crt.Xstrncpy(nil, &_unixShmRegionPerMapØ00__func__Ø000[0], str(133609), 20)
119090  }
119091  
119092  // C comment
119093  //  /*
119094  //  ** Open a shared-memory area associated with open database file pDbFd.
119095  //  ** This particular implementation uses mmapped files.
119096  //  **
119097  //  ** The file used to implement shared-memory is in the same directory
119098  //  ** as the open database file and has the same name as the open database
119099  //  ** file with the "-shm" suffix added.  For example, if the database file
119100  //  ** is "/home/user1/config.db" then the file that is created and mmapped
119101  //  ** for shared memory will be called "/home/user1/config.db-shm".
119102  //  **
119103  //  ** Another approach to is to use files in /dev/shm or /dev/tmp or an
119104  //  ** some other tmpfs mount. But if a file in a different directory
119105  //  ** from the database file is used, then differing access permissions
119106  //  ** or a chroot() might cause two different processes on the same
119107  //  ** database to end up using different files for shared memory -
119108  //  ** meaning that their memory would not really be shared - resulting
119109  //  ** in database corruption.  Nevertheless, this tmpfs file usage
119110  //  ** can be enabled at compile-time using -DSQLITE_SHM_DIRECTORY="/dev/shm"
119111  //  ** or the equivalent.  The use of the SQLITE_SHM_DIRECTORY compile-time
119112  //  ** option results in an incompatible build of SQLite;  builds of SQLite
119113  //  ** that with differing SQLITE_SHM_DIRECTORY settings attempt to use the
119114  //  ** same database file at the same time, database corruption will likely
119115  //  ** result. The SQLITE_SHM_DIRECTORY compile-time option is considered
119116  //  ** "unsupported" and may go away in a future SQLite release.
119117  //  **
119118  //  ** When opening a new shared-memory file, if no other instances of that
119119  //  ** file are currently open, in this process or in other processes, then
119120  //  ** the file must be truncated to zero length or have its header cleared.
119121  //  **
119122  //  ** If the original database file (pDbFd) is using the "unix-excl" VFS
119123  //  ** that means that an exclusive lock is held on the database file and
119124  //  ** that no other processes are able to read or write the database.  In
119125  //  ** that case, we do not really need shared memory.  No shared memory
119126  //  ** file is created.  The shared memory will be simulated with heap memory.
119127  //  */
119128  func _unixOpenSharedMemory(tls *crt.TLS, _pDbFd *XunixFile) (r0 int32) {
119129  	var _rc, _nShmFilename, _6_openFlags int32
119130  	var _zShmFilename, _1_zBasePath *int8
119131  	var _1_sStat crt.Xstruct_stat64
119132  	var _pInode *XunixInodeInfo
119133  	var _pShmNode *XunixShmNode
119134  	var _p *TunixShm
119135  	_p = nil
119136  	_p = (*TunixShm)(Xsqlite3_malloc64(tls, uint64(24)))
119137  	if _p == nil {
119138  		return _sqlite3NomemError(tls, int32(34134))
119139  	}
119140  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(24))
119141  	func() {
119142  		if (*TunixShm)(_pDbFd.XpShm) != nil {
119143  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34136), unsafe.Pointer(&_unixOpenSharedMemoryØ00__func__Ø000), unsafe.Pointer(str(133629)))
119144  			crt.X__builtin_abort(tls)
119145  		}
119146  	}()
119147  	_unixEnterMutex(tls)
119148  	_pInode = (*XunixInodeInfo)(_pDbFd.XpInode)
119149  	_pShmNode = (*XunixShmNode)(_pInode.XpShmNode)
119150  	if _pShmNode != nil {
119151  		goto _3
119152  	}
119153  	_1_zBasePath = _pDbFd.XzPath
119154  	if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
119155  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
119156  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
119157  	}()(tls, _pDbFd.Xh, &_1_sStat) != 0 {
119158  		_rc = int32(1802)
119159  		goto _shm_open_err
119160  	}
119161  	_nShmFilename = int32(6) + int32(crt.Xstrlen(tls, _1_zBasePath))
119162  	_pShmNode = (*XunixShmNode)(Xsqlite3_malloc64(tls, uint64(72)+uint64(_nShmFilename)))
119163  	if _pShmNode == nil {
119164  		_rc = _sqlite3NomemError(tls, int32(34166))
119165  		goto _shm_open_err
119166  	}
119167  	crt.Xmemset(tls, unsafe.Pointer(_pShmNode), int32(0), uint64(72)+uint64(_nShmFilename))
119168  	_zShmFilename = store1(&_pShmNode.XzFilename, (*int8)(unsafe.Pointer(elem136(_pShmNode, uintptr(1)))))
119169  	Xsqlite3_snprintf(tls, _nShmFilename, _zShmFilename, str(133644), unsafe.Pointer(_1_zBasePath))
119170  	_pShmNode.Xh = int32(-1)
119171  	*(**XunixShmNode)(unsafe.Pointer(&((*XunixInodeInfo)(_pDbFd.XpInode).XpShmNode))) = _pShmNode
119172  	*(**XunixInodeInfo)(unsafe.Pointer(&_pShmNode.XpInode)) = (*XunixInodeInfo)(_pDbFd.XpInode)
119173  	if _sqlite3Config.XbCoreMutex == 0 {
119174  		goto _6
119175  	}
119176  	*(**Xsqlite3_mutex)(unsafe.Pointer(&_pShmNode.Xmutex)) = Xsqlite3_mutex_alloc(tls, int32(0))
119177  	if (*Xsqlite3_mutex)(_pShmNode.Xmutex) == nil {
119178  		_rc = _sqlite3NomemError(tls, int32(34185))
119179  		goto _shm_open_err
119180  	}
119181  _6:
119182  	if int32(_pInode.XbProcessLock) != int32(0) {
119183  		goto _8
119184  	}
119185  	_6_openFlags = int32(66)
119186  	if Xsqlite3_uri_boolean(tls, _pDbFd.XzPath, str(133651), int32(0)) != 0 {
119187  		_6_openFlags = int32(0)
119188  		_pShmNode.XisReadonly = uint8(1)
119189  	}
119190  	_pShmNode.Xh = _robust_open(tls, _zShmFilename, _6_openFlags, _1_sStat.Xst_mode&uint32(511))
119191  	if _pShmNode.Xh < int32(0) {
119192  		_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(34198)), str(131517), _zShmFilename, int32(34198))
119193  		goto _shm_open_err
119194  	}
119195  	_robustFchown(tls, _pShmNode.Xh, _1_sStat.Xst_uid, _1_sStat.Xst_gid)
119196  	_rc = int32(0)
119197  	if _unixShmSystemLock(tls, _pDbFd, int32(1), int32(128), int32(1)) != int32(0) {
119198  		goto _11
119199  	}
119200  	if _robust_ftruncate(tls, _pShmNode.Xh, 0) != 0 {
119201  		_rc = _unixLogErrorAtLine(tls, int32(4618), str(131546), _zShmFilename, int32(34214))
119202  	}
119203  _11:
119204  	if _rc == int32(0) {
119205  		_rc = _unixShmSystemLock(tls, _pDbFd, int32(0), int32(128), int32(1))
119206  	}
119207  	if _rc != 0 {
119208  		goto _shm_open_err
119209  	}
119210  _8:
119211  _3:
119212  	*(**XunixShmNode)(unsafe.Pointer(&_p.XpShmNode)) = _pShmNode
119213  	_p.Xid = postInc3(&_pShmNode.XnextShmId, byte(1))
119214  	_pShmNode.XnRef += 1
119215  	*(**TunixShm)(unsafe.Pointer(&_pDbFd.XpShm)) = _p
119216  	_unixLeaveMutex(tls)
119217  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119218  	*(**TunixShm)(unsafe.Pointer(&_p.XpNext)) = (*TunixShm)(_pShmNode.XpFirst)
119219  	*(**TunixShm)(unsafe.Pointer(&_pShmNode.XpFirst)) = _p
119220  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119221  	return int32(0)
119222  
119223  _shm_open_err:
119224  	_unixShmPurge(tls, _pDbFd)
119225  	Xsqlite3_free(tls, unsafe.Pointer(_p))
119226  	_unixLeaveMutex(tls)
119227  	return _rc
119228  }
119229  
119230  var _unixOpenSharedMemoryØ00__func__Ø000 [21]int8
119231  
119232  func init() {
119233  	crt.Xstrncpy(nil, &_unixOpenSharedMemoryØ00__func__Ø000[0], str(133664), 21)
119234  }
119235  
119236  // C comment
119237  //  /*
119238  //  ** On some systems, calls to fchown() will trigger a message in a security
119239  //  ** log if they come from non-root processes.  So avoid calling fchown() if
119240  //  ** we are not running as root.
119241  //  */
119242  func _robustFchown(tls *crt.TLS, _fd int32, _uid uint32, _gid uint32) (r0 int32) {
119243  	return func() int32 {
119244  		if func() func(*crt.TLS) uint32 {
119245  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(21)).XpCurrent
119246  			return *(*func(*crt.TLS) uint32)(unsafe.Pointer(&v))
119247  		}()(tls) != 0 {
119248  			return int32(0)
119249  		}
119250  		return func() func(*crt.TLS, int32, uint32, uint32) int32 {
119251  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(20)).XpCurrent
119252  			return *(*func(*crt.TLS, int32, uint32, uint32) int32)(unsafe.Pointer(&v))
119253  		}()(tls, _fd, _uid, _gid)
119254  	}()
119255  }
119256  
119257  // C comment
119258  //  /*
119259  //  ** Apply posix advisory locks for all bytes from ofst through ofst+n-1.
119260  //  **
119261  //  ** Locks block if the mask is exactly UNIX_SHM_C and are non-blocking
119262  //  ** otherwise.
119263  //  */
119264  func _unixShmSystemLock(tls *crt.TLS, _pFile *XunixFile, _lockType int32, _ofst int32, _n int32) (r0 int32) {
119265  	var _rc int32
119266  	var _2_mask uint16
119267  	var _pShmNode *XunixShmNode
119268  	var _f Tflock
119269  	_rc = int32(0)
119270  	_pShmNode = (*XunixShmNode)((*XunixInodeInfo)(_pFile.XpInode).XpShmNode)
119271  	func() {
119272  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex)) == 0 && _pShmNode.XnRef != int32(0) {
119273  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33983), unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000), unsafe.Pointer(str(133685)))
119274  			crt.X__builtin_abort(tls)
119275  		}
119276  	}()
119277  	func() {
119278  		if _n != int32(1) && _lockType == int32(0) {
119279  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33986), unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000), unsafe.Pointer(str(133742)))
119280  			crt.X__builtin_abort(tls)
119281  		}
119282  	}()
119283  	func() {
119284  		if _n < int32(1) || _n > int32(8) {
119285  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33989), unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000), unsafe.Pointer(str(133768)))
119286  			crt.X__builtin_abort(tls)
119287  		}
119288  	}()
119289  	if _pShmNode.Xh >= int32(0) {
119290  		crt.Xmemset(tls, unsafe.Pointer(&_f), int32(0), uint64(32))
119291  		_f.Xl_type = int16(_lockType)
119292  		_f.Xl_whence = 0
119293  		_f.Xl_start = int64(_ofst)
119294  		_f.Xl_len = int64(_n)
119295  		_rc = func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
119296  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
119297  			return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
119298  		}()(tls, _pShmNode.Xh, int32(6), unsafe.Pointer(&_f))
119299  		_rc = func() int32 {
119300  			if _rc != int32(-1) {
119301  				return int32(0)
119302  			}
119303  			return int32(5)
119304  		}()
119305  	}
119306  	_2_mask = uint16(func() int32 {
119307  		if _ofst > int32(31) {
119308  			return int32(65535)
119309  		}
119310  		return ((int32(1) << uint(_ofst+_n)) - (int32(1) << uint(_ofst)))
119311  	}())
119312  	if _rc != int32(0) {
119313  		goto _14
119314  	}
119315  	if _lockType == int32(2) {
119316  		{
119317  			p := &_pShmNode.XexclMask
119318  			*p = uint8(int32(*p) & (^int32(_2_mask)))
119319  		}
119320  		{
119321  			p := &_pShmNode.XsharedMask
119322  			*p = uint8(int32(*p) & (^int32(_2_mask)))
119323  		}
119324  		goto _18
119325  	}
119326  	if _lockType == int32(0) {
119327  		{
119328  			p := &_pShmNode.XexclMask
119329  			*p = uint8(int32(*p) & (^int32(_2_mask)))
119330  		}
119331  		{
119332  			p := &_pShmNode.XsharedMask
119333  			*p = uint8(int32(*p) | int32(_2_mask))
119334  		}
119335  		goto _18
119336  	}
119337  	func() {
119338  		if _lockType != int32(1) {
119339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34018), unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000), unsafe.Pointer(str(133796)))
119340  			crt.X__builtin_abort(tls)
119341  		}
119342  	}()
119343  	{
119344  		p := &_pShmNode.XexclMask
119345  		*p = uint8(int32(*p) | int32(_2_mask))
119346  	}
119347  	{
119348  		p := &_pShmNode.XsharedMask
119349  		*p = uint8(int32(*p) & (^int32(_2_mask)))
119350  	}
119351  _18:
119352  	goto _21
119353  _14:
119354  	if _lockType == int32(2) {
119355  		goto _25
119356  	}
119357  	if _lockType == int32(0) {
119358  		goto _25
119359  	}
119360  	func() {
119361  		if _lockType != int32(1) {
119362  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34029), unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000), unsafe.Pointer(str(133796)))
119363  			crt.X__builtin_abort(tls)
119364  		}
119365  	}()
119366  _25:
119367  _21:
119368  	return _rc
119369  }
119370  
119371  var _unixShmSystemLockØ00__func__Ø000 [18]int8
119372  
119373  func init() {
119374  	crt.Xstrncpy(nil, &_unixShmSystemLockØ00__func__Ø000[0], str(133814), 18)
119375  }
119376  
119377  // C comment
119378  //  /*
119379  //  ** Purge the unixShmNodeList list of all entries with unixShmNode.nRef==0.
119380  //  **
119381  //  ** This is not a VFS shared-memory method; it is a utility function called
119382  //  ** by VFS shared-memory methods.
119383  //  */
119384  func _unixShmPurge(tls *crt.TLS, _pFd *XunixFile) {
119385  	var _1_nShmPerMap, _1_i int32
119386  	var _p *XunixShmNode
119387  	_p = (*XunixShmNode)((*XunixInodeInfo)(_pFd.XpInode).XpShmNode)
119388  	func() {
119389  		if _unixMutexHeld(tls) == 0 {
119390  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34066), unsafe.Pointer(&_unixShmPurgeØ00__func__Ø000), unsafe.Pointer(str(132022)))
119391  			crt.X__builtin_abort(tls)
119392  		}
119393  	}()
119394  	if _p == nil || func() int32 {
119395  		if _p.XnRef == int32(0) {
119396  			return int32(1)
119397  		}
119398  		return func() int32 {
119399  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34067), unsafe.Pointer(&_unixShmPurgeØ00__func__Ø000), unsafe.Pointer(str(4809)))
119400  			crt.X__builtin_abort(tls)
119401  			return int32(0)
119402  		}()
119403  	}() == 0 {
119404  		goto _5
119405  	}
119406  	_1_nShmPerMap = _unixShmRegionPerMap(tls)
119407  	func() {
119408  		if (*XunixInodeInfo)(_p.XpInode) != (*XunixInodeInfo)(_pFd.XpInode) {
119409  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34070), unsafe.Pointer(&_unixShmPurgeØ00__func__Ø000), unsafe.Pointer(str(133832)))
119410  			crt.X__builtin_abort(tls)
119411  		}
119412  	}()
119413  	Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_p.Xmutex))
119414  	_1_i = int32(0)
119415  _8:
119416  	if _1_i >= int32(_p.XnRegion) {
119417  		goto _11
119418  	}
119419  	if _p.Xh >= int32(0) {
119420  		func() func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer {
119421  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(23)).XpCurrent
119422  			return *(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&v))
119423  		}()(tls, unsafe.Pointer(*elem0(_p.XapRegion, uintptr(_1_i))), uint64(_p.XszRegion))
119424  		goto _13
119425  	}
119426  	Xsqlite3_free(tls, unsafe.Pointer(*elem0(_p.XapRegion, uintptr(_1_i))))
119427  _13:
119428  	_1_i += _1_nShmPerMap
119429  	goto _8
119430  _11:
119431  	Xsqlite3_free(tls, unsafe.Pointer(_p.XapRegion))
119432  	if _p.Xh >= int32(0) {
119433  		_robust_close(tls, _pFd, _p.Xh, int32(34081))
119434  		_p.Xh = int32(-1)
119435  	}
119436  	*(**XunixShmNode)(unsafe.Pointer(&((*XunixInodeInfo)(_p.XpInode).XpShmNode))) = nil
119437  	Xsqlite3_free(tls, unsafe.Pointer(_p))
119438  _5:
119439  }
119440  
119441  var _unixShmPurgeØ00__func__Ø000 [13]int8
119442  
119443  func init() {
119444  	crt.Xstrncpy(nil, &_unixShmPurgeØ00__func__Ø000[0], str(133855), 13)
119445  }
119446  
119447  var _unixShmMapØ00__func__Ø000 [11]int8
119448  
119449  func init() {
119450  	crt.Xstrncpy(nil, &_unixShmMapØ00__func__Ø000[0], str(133868), 11)
119451  }
119452  
119453  var _unixShmMapØ00pgszØ001 int32
119454  
119455  func init() {
119456  	_unixShmMapØ00pgszØ001 = int32(4096)
119457  }
119458  
119459  // C comment
119460  //  /*
119461  //  ** Change the lock state for a shared-memory segment.
119462  //  **
119463  //  ** Note that the relationship between SHAREd and EXCLUSIVE locks is a little
119464  //  ** different here than in posix.  In xShmLock(), one can go from unlocked
119465  //  ** to shared and back or from unlocked to exclusive and back.  But one may
119466  //  ** not go from shared to exclusive or from exclusive to shared.
119467  //  */
119468  func _unixShmLock(tls *crt.TLS, _fd *Xsqlite3_file, _ofst int32, _n int32, _flags int32) (r0 int32) {
119469  	var _rc int32
119470  	var _mask, _1_allMask, _6_allShared uint16
119471  	var _pDbFd *XunixFile
119472  	var _pShmNode *XunixShmNode
119473  	var _p, _pX *TunixShm
119474  	_pDbFd = (*XunixFile)(unsafe.Pointer(_fd))
119475  	_p = (*TunixShm)(_pDbFd.XpShm)
119476  	_pShmNode = (*XunixShmNode)(_p.XpShmNode)
119477  	_rc = int32(0)
119478  	func() {
119479  		if _pShmNode != (*XunixShmNode)((*XunixInodeInfo)(_pDbFd.XpInode).XpShmNode) {
119480  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34424), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133879)))
119481  			crt.X__builtin_abort(tls)
119482  		}
119483  	}()
119484  	func() {
119485  		if (*XunixInodeInfo)(_pShmNode.XpInode) != (*XunixInodeInfo)(_pDbFd.XpInode) {
119486  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34425), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133443)))
119487  			crt.X__builtin_abort(tls)
119488  		}
119489  	}()
119490  	func() {
119491  		if _ofst < int32(0) || (_ofst+_n) > int32(8) {
119492  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34426), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133913)))
119493  			crt.X__builtin_abort(tls)
119494  		}
119495  	}()
119496  	func() {
119497  		if _n < int32(1) {
119498  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34427), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133949)))
119499  			crt.X__builtin_abort(tls)
119500  		}
119501  	}()
119502  	func() {
119503  		if _flags != int32(6) && _flags != int32(10) && _flags != int32(5) && _flags != int32(9) {
119504  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34428), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133954)))
119505  			crt.X__builtin_abort(tls)
119506  		}
119507  	}()
119508  	func() {
119509  		if _n != int32(1) && (_flags&int32(8)) == int32(0) {
119510  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34432), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(134153)))
119511  			crt.X__builtin_abort(tls)
119512  		}
119513  	}()
119514  	func() {
119515  		if _pShmNode.Xh < int32(0) && int32((*XunixInodeInfo)(_pDbFd.XpInode).XbProcessLock) != int32(1) {
119516  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34433), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133475)))
119517  			crt.X__builtin_abort(tls)
119518  		}
119519  	}()
119520  	func() {
119521  		if _pShmNode.Xh >= int32(0) && int32((*XunixInodeInfo)(_pDbFd.XpInode).XbProcessLock) != int32(0) {
119522  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34434), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133524)))
119523  			crt.X__builtin_abort(tls)
119524  		}
119525  	}()
119526  	_mask = uint16((int32(1) << uint(_ofst+_n)) - (int32(1) << uint(_ofst)))
119527  	func() {
119528  		if _n <= int32(1) && int32(_mask) != (int32(1)<<uint(_ofst)) {
119529  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34437), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(134195)))
119530  			crt.X__builtin_abort(tls)
119531  		}
119532  	}()
119533  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119534  	if (_flags & int32(1)) == 0 {
119535  		goto _26
119536  	}
119537  	_1_allMask = uint16(0)
119538  	_pX = (*TunixShm)(_pShmNode.XpFirst)
119539  _27:
119540  	if _pX == nil {
119541  		goto _30
119542  	}
119543  	if _pX == _p {
119544  		goto _28
119545  	}
119546  	func() {
119547  		if (int32(_pX.XexclMask) & (int32(_p.XexclMask) | int32(_p.XsharedMask))) != int32(0) {
119548  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34445), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(134218)))
119549  			crt.X__builtin_abort(tls)
119550  		}
119551  	}()
119552  	{
119553  		p := &_1_allMask
119554  		*p = uint16(int32(*p) | int32(_pX.XsharedMask))
119555  	}
119556  _28:
119557  	_pX = (*TunixShm)(_pX.XpNext)
119558  	goto _27
119559  _30:
119560  	if (int32(_mask) & int32(_1_allMask)) == int32(0) {
119561  		_rc = _unixShmSystemLock(tls, _pDbFd, int32(2), _ofst+int32(120), _n)
119562  		goto _35
119563  	}
119564  	_rc = int32(0)
119565  _35:
119566  	if _rc == int32(0) {
119567  		{
119568  			p := &_p.XexclMask
119569  			*p = uint16(int32(*p) & (^int32(_mask)))
119570  		}
119571  		{
119572  			p := &_p.XsharedMask
119573  			*p = uint16(int32(*p) & (^int32(_mask)))
119574  		}
119575  	}
119576  	goto _48
119577  _26:
119578  	if (_flags & int32(4)) == 0 {
119579  		goto _38
119580  	}
119581  	_6_allShared = uint16(0)
119582  	_pX = (*TunixShm)(_pShmNode.XpFirst)
119583  _39:
119584  	if _pX == nil {
119585  		goto _42
119586  	}
119587  	if (int32(_pX.XexclMask) & int32(_mask)) != int32(0) {
119588  		_rc = int32(5)
119589  		goto _42
119590  	}
119591  	{
119592  		p := &_6_allShared
119593  		*p = uint16(int32(*p) | int32(_pX.XsharedMask))
119594  	}
119595  	_pX = (*TunixShm)(_pX.XpNext)
119596  	goto _39
119597  _42:
119598  	if _rc != int32(0) {
119599  		goto _44
119600  	}
119601  	if (int32(_6_allShared) & int32(_mask)) == int32(0) {
119602  		_rc = _unixShmSystemLock(tls, _pDbFd, int32(0), _ofst+int32(120), _n)
119603  		goto _46
119604  	}
119605  	_rc = int32(0)
119606  _46:
119607  _44:
119608  	if _rc == int32(0) {
119609  		{
119610  			p := &_p.XsharedMask
119611  			*p = uint16(int32(*p) | int32(_mask))
119612  		}
119613  	}
119614  	goto _48
119615  _38:
119616  	_pX = (*TunixShm)(_pShmNode.XpFirst)
119617  _49:
119618  	if _pX == nil {
119619  		goto _52
119620  	}
119621  	if ((int32(_pX.XexclMask) & int32(_mask)) != int32(0)) || ((int32(_pX.XsharedMask) & int32(_mask)) != int32(0)) {
119622  		_rc = int32(5)
119623  		goto _52
119624  	}
119625  	_pX = (*TunixShm)(_pX.XpNext)
119626  	goto _49
119627  _52:
119628  	if _rc != int32(0) {
119629  		goto _55
119630  	}
119631  	_rc = _unixShmSystemLock(tls, _pDbFd, int32(1), _ofst+int32(120), _n)
119632  	if _rc == int32(0) {
119633  		func() {
119634  			if (int32(_p.XsharedMask) & int32(_mask)) != int32(0) {
119635  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34506), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(134266)))
119636  				crt.X__builtin_abort(tls)
119637  			}
119638  		}()
119639  		{
119640  			p := &_p.XexclMask
119641  			*p = uint16(int32(*p) | int32(_mask))
119642  		}
119643  	}
119644  _55:
119645  _48:
119646  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119647  	return _rc
119648  }
119649  
119650  var _unixShmLockØ00__func__Ø000 [12]int8
119651  
119652  func init() {
119653  	crt.Xstrncpy(nil, &_unixShmLockØ00__func__Ø000[0], str(134292), 12)
119654  }
119655  
119656  // C comment
119657  //  /*
119658  //  ** Implement a memory barrier or memory fence on shared memory.
119659  //  **
119660  //  ** All loads and stores begun before the barrier must complete before
119661  //  ** any load or store begun after the barrier.
119662  //  */
119663  func _unixShmBarrier(tls *crt.TLS, _fd *Xsqlite3_file) {
119664  	_sqlite3MemoryBarrier(tls)
119665  	_unixEnterMutex(tls)
119666  	_unixLeaveMutex(tls)
119667  }
119668  
119669  // C comment
119670  //  /*
119671  //  ** Close a connection to shared-memory.  Delete the underlying
119672  //  ** storage if deleteFlag is true.
119673  //  **
119674  //  ** If there is no shared memory associated with the connection then this
119675  //  ** routine is a harmless no-op.
119676  //  */
119677  func _unixShmUnmap(tls *crt.TLS, _fd *Xsqlite3_file, _deleteFlag int32) (r0 int32) {
119678  	var _pDbFd *XunixFile
119679  	var _pShmNode *XunixShmNode
119680  	var _p *TunixShm
119681  	var _pp **TunixShm
119682  	_pDbFd = (*XunixFile)(unsafe.Pointer(_fd))
119683  	_p = (*TunixShm)(_pDbFd.XpShm)
119684  	if _p == nil {
119685  		return int32(0)
119686  	}
119687  	_pShmNode = (*XunixShmNode)(_p.XpShmNode)
119688  	func() {
119689  		if _pShmNode != (*XunixShmNode)((*XunixInodeInfo)(_pDbFd.XpInode).XpShmNode) {
119690  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34553), unsafe.Pointer(&_unixShmUnmapØ00__func__Ø000), unsafe.Pointer(str(133879)))
119691  			crt.X__builtin_abort(tls)
119692  		}
119693  	}()
119694  	func() {
119695  		if (*XunixInodeInfo)(_pShmNode.XpInode) != (*XunixInodeInfo)(_pDbFd.XpInode) {
119696  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34554), unsafe.Pointer(&_unixShmUnmapØ00__func__Ø000), unsafe.Pointer(str(133443)))
119697  			crt.X__builtin_abort(tls)
119698  		}
119699  	}()
119700  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119701  	_pp = (**TunixShm)(unsafe.Pointer(&_pShmNode.XpFirst))
119702  _5:
119703  	if (*_pp) == _p {
119704  		goto _8
119705  	}
119706  	_pp = (**TunixShm)(unsafe.Pointer(&((*_pp).XpNext)))
119707  	goto _5
119708  _8:
119709  	*_pp = (*TunixShm)(_p.XpNext)
119710  	Xsqlite3_free(tls, unsafe.Pointer(_p))
119711  	*(**TunixShm)(unsafe.Pointer(&_pDbFd.XpShm)) = nil
119712  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119713  	_unixEnterMutex(tls)
119714  	func() {
119715  		if _pShmNode.XnRef <= int32(0) {
119716  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34570), unsafe.Pointer(&_unixShmUnmapØ00__func__Ø000), unsafe.Pointer(str(134304)))
119717  			crt.X__builtin_abort(tls)
119718  		}
119719  	}()
119720  	_pShmNode.XnRef -= 1
119721  	if _pShmNode.XnRef != int32(0) {
119722  		goto _11
119723  	}
119724  	if _deleteFlag != 0 && (_pShmNode.Xh >= int32(0)) {
119725  		func() func(*crt.TLS, *int8) int32 {
119726  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(16)).XpCurrent
119727  			return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v))
119728  		}()(tls, _pShmNode.XzFilename)
119729  	}
119730  	_unixShmPurge(tls, _pDbFd)
119731  _11:
119732  	_unixLeaveMutex(tls)
119733  	return int32(0)
119734  }
119735  
119736  var _unixShmUnmapØ00__func__Ø000 [13]int8
119737  
119738  func init() {
119739  	crt.Xstrncpy(nil, &_unixShmUnmapØ00__func__Ø000[0], str(134321), 13)
119740  }
119741  
119742  // C comment
119743  //  /*
119744  //  ** If possible, return a pointer to a mapping of file fd starting at offset
119745  //  ** iOff. The mapping must be valid for at least nAmt bytes.
119746  //  **
119747  //  ** If such a pointer can be obtained, store it in *pp and return SQLITE_OK.
119748  //  ** Or, if one cannot but no error occurs, set *pp to 0 and return SQLITE_OK.
119749  //  ** Finally, if an error does occur, return an SQLite error code. The final
119750  //  ** value of *pp is undefined in this case.
119751  //  **
119752  //  ** If this function does return a pointer, the caller must eventually
119753  //  ** release the reference by calling unixUnfetch().
119754  //  */
119755  func _unixFetch(tls *crt.TLS, _fd *Xsqlite3_file, _iOff int64, _nAmt int32, _pp *unsafe.Pointer) (r0 int32) {
119756  	var _2_rc int32
119757  	var _pFd *XunixFile
119758  	_pFd = (*XunixFile)(unsafe.Pointer(_fd))
119759  	*_pp = nil
119760  	if _pFd.XmmapSizeMax <= (0) {
119761  		goto _0
119762  	}
119763  	if _pFd.XpMapRegion != nil {
119764  		goto _1
119765  	}
119766  	_2_rc = _unixMapfile(tls, _pFd, int64(-1))
119767  	if _2_rc != int32(0) {
119768  		return _2_rc
119769  	}
119770  _1:
119771  	if _pFd.XmmapSize >= (_iOff + int64(_nAmt)) {
119772  		*_pp = unsafe.Pointer(elem15((*uint8)(_pFd.XpMapRegion), uintptr(_iOff)))
119773  		_pFd.XnFetchOut += 1
119774  	}
119775  _0:
119776  	return int32(0)
119777  }
119778  
119779  // C comment
119780  //  /*
119781  //  ** If the third argument is non-NULL, then this function releases a
119782  //  ** reference obtained by an earlier call to unixFetch(). The second
119783  //  ** argument passed to this function must be the same as the corresponding
119784  //  ** argument that was passed to the unixFetch() invocation.
119785  //  **
119786  //  ** Or, if the third argument is NULL, then this function is being called
119787  //  ** to inform the VFS layer that, according to POSIX, any existing mapping
119788  //  ** may now be invalid and should be unmapped.
119789  //  */
119790  func _unixUnfetch(tls *crt.TLS, _fd *Xsqlite3_file, _iOff int64, _p unsafe.Pointer) (r0 int32) {
119791  	var _pFd *XunixFile
119792  	_pFd = (*XunixFile)(unsafe.Pointer(_fd))
119793  
119794  	func() {
119795  		if (_p == nil) != (_pFd.XnFetchOut == int32(0)) {
119796  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34788), unsafe.Pointer(&_unixUnfetchØ00__func__Ø000), unsafe.Pointer(str(134334)))
119797  			crt.X__builtin_abort(tls)
119798  		}
119799  	}()
119800  	func() {
119801  		if _p != nil && _p != unsafe.Pointer(elem15((*uint8)(_pFd.XpMapRegion), uintptr(_iOff))) {
119802  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34791), unsafe.Pointer(&_unixUnfetchØ00__func__Ø000), unsafe.Pointer(str(134362)))
119803  			crt.X__builtin_abort(tls)
119804  		}
119805  	}()
119806  	if _p != nil {
119807  		_pFd.XnFetchOut -= 1
119808  		goto _6
119809  	}
119810  	_unixUnmapfile(tls, _pFd)
119811  _6:
119812  	func() {
119813  		if _pFd.XnFetchOut < int32(0) {
119814  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34799), unsafe.Pointer(&_unixUnfetchØ00__func__Ø000), unsafe.Pointer(str(134404)))
119815  			crt.X__builtin_abort(tls)
119816  		}
119817  	}()
119818  	return int32(0)
119819  }
119820  
119821  var _unixUnfetchØ00__func__Ø000 [12]int8
119822  
119823  func init() {
119824  	crt.Xstrncpy(nil, &_unixUnfetchØ00__func__Ø000[0], str(134422), 12)
119825  }
119826  
119827  // C comment
119828  //  /*
119829  //  ** Open the file zPath.
119830  //  **
119831  //  ** Previously, the SQLite OS layer used three functions in place of this
119832  //  ** one:
119833  //  **
119834  //  **     sqlite3OsOpenReadWrite();
119835  //  **     sqlite3OsOpenReadOnly();
119836  //  **     sqlite3OsOpenExclusive();
119837  //  **
119838  //  ** These calls correspond to the following combinations of flags:
119839  //  **
119840  //  **     ReadWrite() ->     (READWRITE | CREATE)
119841  //  **     ReadOnly()  ->     (READONLY)
119842  //  **     OpenExclusive() -> (READWRITE | CREATE | EXCLUSIVE)
119843  //  **
119844  //  ** The old OpenExclusive() accepted a boolean argument - "delFlag". If
119845  //  ** true, the file was configured to be automatically deleted when the
119846  //  ** file handle closed. To achieve the same effect using this new
119847  //  ** interface, add the DELETEONCLOSE flag to those specified above for
119848  //  ** OpenExclusive().
119849  //  */
119850  func _unixOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _pFile *Xsqlite3_file, _flags int32, _pOutFlags *int32) (r0 int32) {
119851  	var _fd, _openFlags, _eType, _noLock, _rc, _ctrlFlags, _isExclusive, _isDelete, _isCreate, _isReadonly, _isReadWrite, _syncDir int32
119852  	var _8_openMode, _8_uid, _8_gid uint32
119853  	var _zName *int8
119854  	var _p *XunixFile
119855  	var _2_pUnused *XUnixUnusedFd
119856  	var _zTmpname [514]int8
119857  	_p = (*XunixFile)(unsafe.Pointer(_pFile))
119858  	_fd = int32(-1)
119859  	_openFlags = int32(0)
119860  	_eType = int32(uint32(_flags) & uint32(4294967040))
119861  	_rc = int32(0)
119862  	_ctrlFlags = int32(0)
119863  	_isExclusive = _flags & int32(16)
119864  	_isDelete = _flags & int32(8)
119865  	_isCreate = _flags & int32(4)
119866  	_isReadonly = _flags & int32(1)
119867  	_isReadWrite = _flags & int32(2)
119868  	_syncDir = bool2int(_isCreate != 0 && (((_eType == int32(16384)) || (_eType == int32(2048))) || (_eType == int32(524288))))
119869  	_zName = _zPath
119870  	func() {
119871  		if _isReadonly != int32(0) && _isReadWrite != int32(0) || _isReadWrite == 0 && _isReadonly == 0 {
119872  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35597), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134434)))
119873  			crt.X__builtin_abort(tls)
119874  		}
119875  	}()
119876  	func() {
119877  		if _isCreate != int32(0) && _isReadWrite == 0 {
119878  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35598), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134499)))
119879  			crt.X__builtin_abort(tls)
119880  		}
119881  	}()
119882  	func() {
119883  		if _isExclusive != int32(0) && _isCreate == 0 {
119884  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35599), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134526)))
119885  			crt.X__builtin_abort(tls)
119886  		}
119887  	}()
119888  	func() {
119889  		if _isDelete != int32(0) && _isCreate == 0 {
119890  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35600), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134553)))
119891  			crt.X__builtin_abort(tls)
119892  		}
119893  	}()
119894  	func() {
119895  		if (_isDelete != 0 || _zName == nil) && _eType == int32(256) {
119896  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35604), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134577)))
119897  			crt.X__builtin_abort(tls)
119898  		}
119899  	}()
119900  	func() {
119901  		if (_isDelete != 0 || _zName == nil) && _eType == int32(2048) {
119902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35605), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134628)))
119903  			crt.X__builtin_abort(tls)
119904  		}
119905  	}()
119906  	func() {
119907  		if (_isDelete != 0 || _zName == nil) && _eType == int32(16384) {
119908  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35606), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134684)))
119909  			crt.X__builtin_abort(tls)
119910  		}
119911  	}()
119912  	func() {
119913  		if (_isDelete != 0 || _zName == nil) && _eType == int32(524288) {
119914  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35607), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134742)))
119915  			crt.X__builtin_abort(tls)
119916  		}
119917  	}()
119918  	func() {
119919  		if _eType != int32(256) && _eType != int32(512) && _eType != int32(2048) && _eType != int32(4096) && _eType != int32(8192) && _eType != int32(16384) && _eType != int32(1024) && _eType != int32(524288) {
119920  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35610), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134789)))
119921  			crt.X__builtin_abort(tls)
119922  		}
119923  	}()
119924  	if _randomnessPid != crt.Xgetpid(tls) {
119925  		_randomnessPid = crt.Xgetpid(tls)
119926  		bug20530(_randomnessPid)
119927  		Xsqlite3_randomness(tls, int32(0), nil)
119928  	}
119929  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(120))
119930  	if _eType != int32(256) {
119931  		goto _43
119932  	}
119933  	_2_pUnused = _findReusableFd(tls, _zName, _flags)
119934  	if _2_pUnused != nil {
119935  		_fd = _2_pUnused.Xfd
119936  		goto _45
119937  	}
119938  	_2_pUnused = (*XUnixUnusedFd)(Xsqlite3_malloc64(tls, uint64(16)))
119939  	if _2_pUnused == nil {
119940  		return _sqlite3NomemError(tls, int32(35636))
119941  	}
119942  _45:
119943  	*(**XUnixUnusedFd)(unsafe.Pointer(&_p.XpUnused)) = _2_pUnused
119944  	func() {
119945  		if (_flags&int32(64)) == 0 && int32(*elem1(_zName, uintptr(crt.Xstrlen(tls, _zName)+uint64(1)))) != int32(0) {
119946  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35644), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135047)))
119947  			crt.X__builtin_abort(tls)
119948  		}
119949  	}()
119950  	goto _51
119951  _43:
119952  	if _zName != nil {
119953  		goto _51
119954  	}
119955  	func() {
119956  		if _isDelete == 0 || _syncDir != 0 {
119957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35648), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135102)))
119958  			crt.X__builtin_abort(tls)
119959  		}
119960  	}()
119961  	_rc = _unixGetTempname(tls, _pVfs.XmxPathname, (*int8)(unsafe.Pointer(&_zTmpname)))
119962  	if _rc != int32(0) {
119963  		return _rc
119964  	}
119965  	_zName = (*int8)(unsafe.Pointer(&_zTmpname))
119966  	func() {
119967  		if int32(*elem1(_zName, uintptr(crt.Xstrlen(tls, _zName)+uint64(1)))) != int32(0) {
119968  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35657), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135123)))
119969  			crt.X__builtin_abort(tls)
119970  		}
119971  	}()
119972  _51:
119973  	if _isReadonly != 0 {
119974  		_openFlags |= int32(0)
119975  	}
119976  	if _isReadWrite != 0 {
119977  		_openFlags |= int32(2)
119978  	}
119979  	if _isCreate != 0 {
119980  		_openFlags |= int32(64)
119981  	}
119982  	if _isExclusive != 0 {
119983  		_openFlags |= int32(128)
119984  	}
119985  	_openFlags |= int32(0)
119986  	if _fd >= int32(0) {
119987  		goto _62
119988  	}
119989  	_rc = _findCreateFileMode(tls, _zName, _flags, &_8_openMode, &_8_uid, &_8_gid)
119990  	if _rc != int32(0) {
119991  		func() {
119992  			if _p.XpUnused != nil {
119993  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35676), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135149)))
119994  				crt.X__builtin_abort(tls)
119995  			}
119996  		}()
119997  		func() {
119998  			if _eType != int32(524288) && _eType != int32(2048) {
119999  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35677), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135161)))
120000  				crt.X__builtin_abort(tls)
120001  			}
120002  		}()
120003  		return _rc
120004  	}
120005  	_fd = _robust_open(tls, _zName, _openFlags, _8_openMode)
120006  	func() {
120007  		if _isExclusive != 0 && (_openFlags&int32(64)) == int32(0) {
120008  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35682), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135219)))
120009  			crt.X__builtin_abort(tls)
120010  		}
120011  	}()
120012  	if ((_fd < int32(0)) && ((*crt.X__errno_location(tls)) != int32(21))) && _isReadWrite != 0 {
120013  		_flags &= int32(-7)
120014  		_openFlags &= int32(-67)
120015  		_flags |= int32(1)
120016  		_openFlags |= int32(0)
120017  		_isReadonly = int32(1)
120018  		_fd = _robust_open(tls, _zName, _openFlags, _8_openMode)
120019  	}
120020  	if _fd < int32(0) {
120021  		_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(35693)), str(131517), _zName, int32(35693))
120022  		goto _open_finished
120023  	}
120024  	if (_flags & int32(526336)) != 0 {
120025  		_robustFchown(tls, _fd, _8_uid, _8_gid)
120026  	}
120027  _62:
120028  	func() {
120029  		if _fd < int32(0) {
120030  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35705), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135260)))
120031  			crt.X__builtin_abort(tls)
120032  		}
120033  	}()
120034  	if _pOutFlags != nil {
120035  		*_pOutFlags = _flags
120036  	}
120037  	if _p.XpUnused != nil {
120038  		(*XUnixUnusedFd)(_p.XpUnused).Xfd = _fd
120039  		(*XUnixUnusedFd)(_p.XpUnused).Xflags = _flags
120040  	}
120041  	if _isDelete != 0 {
120042  		func() func(*crt.TLS, *int8) int32 {
120043  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(16)).XpCurrent
120044  			return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v))
120045  		}()(tls, _zName)
120046  	}
120047  	if _isDelete != 0 {
120048  		_ctrlFlags |= int32(32)
120049  	}
120050  	if _isReadonly != 0 {
120051  		_ctrlFlags |= int32(2)
120052  	}
120053  	_noLock = bool2int(_eType != int32(256))
120054  	if _noLock != 0 {
120055  		_ctrlFlags |= int32(128)
120056  	}
120057  	if _syncDir != 0 {
120058  		_ctrlFlags |= int32(8)
120059  	}
120060  	if (_flags & int32(64)) != 0 {
120061  		_ctrlFlags |= int32(64)
120062  	}
120063  	_rc = _fillInUnixFile(tls, _pVfs, _fd, _pFile, _zPath, _ctrlFlags)
120064  _open_finished:
120065  	if _rc != int32(0) {
120066  		Xsqlite3_free(tls, _p.XpUnused)
120067  	}
120068  	return _rc
120069  
120070  	_ = _zTmpname
120071  	panic(0)
120072  }
120073  
120074  var _unixOpenØ00__func__Ø000 [9]int8
120075  
120076  func init() {
120077  	crt.Xstrncpy(nil, &_unixOpenØ00__func__Ø000[0], str(135266), 9)
120078  }
120079  
120080  // C comment
120081  //  /* This variable holds the process id (pid) from when the xRandomness()
120082  //  ** method was called.  If xOpen() is called from a different process id,
120083  //  ** indicating that a fork() has occurred, the PRNG will be reset.
120084  //  */
120085  var _randomnessPid int32
120086  
120087  // C comment
120088  //  /*
120089  //  ** Search for an unused file descriptor that was opened on the database
120090  //  ** file (not a journal or master-journal file) identified by pathname
120091  //  ** zPath with SQLITE_OPEN_XXX flags matching those passed as the second
120092  //  ** argument to this function.
120093  //  **
120094  //  ** Such a file descriptor may exist if a database connection was closed
120095  //  ** but the associated file descriptor could not be closed because some
120096  //  ** other file descriptor open on the same file is holding a file-lock.
120097  //  ** Refer to comments in the unixClose() function and the lengthy comment
120098  //  ** describing "Posix Advisory Locking" at the start of this file for
120099  //  ** further details. Also, ticket #4018.
120100  //  **
120101  //  ** If a suitable file descriptor is found, then it is returned. If no
120102  //  ** such file descriptor is located, -1 is returned.
120103  //  */
120104  func _findReusableFd(tls *crt.TLS, _zPath *int8, _flags int32) (r0 *XUnixUnusedFd) {
120105  	var _sStat crt.Xstruct_stat64
120106  	var _1_pInode *XunixInodeInfo
120107  	var _pUnused *XUnixUnusedFd
120108  	var _3_pp **XUnixUnusedFd
120109  	_pUnused = nil
120110  	if int32(0) != func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
120111  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(4)).XpCurrent
120112  		return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
120113  	}()(tls, _zPath, &_sStat) {
120114  		goto _0
120115  	}
120116  	_unixEnterMutex(tls)
120117  	_1_pInode = _inodeList
120118  _1:
120119  	if (_1_pInode != nil) && (((_1_pInode.XfileId.Xdev) != _sStat.Xst_dev) || ((_1_pInode.XfileId.Xino) != _sStat.Xst_ino)) {
120120  		_1_pInode = (*XunixInodeInfo)(_1_pInode.XpNext)
120121  		goto _1
120122  	}
120123  	if _1_pInode == nil {
120124  		goto _5
120125  	}
120126  	_3_pp = (**XUnixUnusedFd)(unsafe.Pointer(&_1_pInode.XpUnused))
120127  _6:
120128  	if (*_3_pp) == nil || ((*_3_pp).Xflags) == _flags {
120129  		goto _10
120130  	}
120131  	_3_pp = (**XUnixUnusedFd)(unsafe.Pointer(&((*_3_pp).XpNext)))
120132  	goto _6
120133  _10:
120134  	_pUnused = *_3_pp
120135  	if _pUnused != nil {
120136  		*_3_pp = (*XUnixUnusedFd)(_pUnused.XpNext)
120137  	}
120138  _5:
120139  	_unixLeaveMutex(tls)
120140  _0:
120141  	return _pUnused
120142  }
120143  
120144  // C comment
120145  //  /*
120146  //  ** This function is called by unixOpen() to determine the unix permissions
120147  //  ** to create new files with. If no error occurs, then SQLITE_OK is returned
120148  //  ** and a value suitable for passing as the third argument to open(2) is
120149  //  ** written to *pMode. If an IO error occurs, an SQLite error code is
120150  //  ** returned and the value of *pMode is not modified.
120151  //  **
120152  //  ** In most cases, this routine sets *pMode to 0, which will become
120153  //  ** an indication to robust_open() to create the file using
120154  //  ** SQLITE_DEFAULT_FILE_PERMISSIONS adjusted by the umask.
120155  //  ** But if the file being opened is a WAL or regular journal file, then
120156  //  ** this function queries the file-system for the permissions on the
120157  //  ** corresponding database file and sets *pMode to this value. Whenever
120158  //  ** possible, WAL and journal files are created using the same permissions
120159  //  ** as the associated database file.
120160  //  **
120161  //  ** If the SQLITE_ENABLE_8_3_NAMES option is enabled, then the
120162  //  ** original filename is unavailable.  But 8_3_NAMES is only used for
120163  //  ** FAT filesystems and permissions do not matter there, so just use
120164  //  ** the default permissions.
120165  //  */
120166  func _findCreateFileMode(tls *crt.TLS, _zPath *int8, _flags int32, _pMode *uint32, _pUid *uint32, _pGid *uint32) (r0 int32) {
120167  	var _rc, _1_nDb int32
120168  	var _4_z *int8
120169  	var _1_zDb [513]int8
120170  	_rc = int32(0)
120171  	*_pMode = 0
120172  	*_pUid = 0
120173  	*_pGid = 0
120174  	if (_flags & int32(526336)) == 0 {
120175  		goto _0
120176  	}
120177  	_1_nDb = _sqlite3Strlen30(tls, _zPath) - int32(1)
120178  _1:
120179  	if int32(*elem1(_zPath, uintptr(_1_nDb))) != int32(45) {
120180  		func() {
120181  			if _1_nDb <= int32(0) {
120182  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35497), unsafe.Pointer(&_findCreateFileModeØ00__func__Ø000), unsafe.Pointer(str(135275)))
120183  				crt.X__builtin_abort(tls)
120184  			}
120185  		}()
120186  		func() {
120187  			if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zPath, uintptr(_1_nDb)))))) & int32(6)) == 0 {
120188  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35498), unsafe.Pointer(&_findCreateFileModeØ00__func__Ø000), unsafe.Pointer(str(135281)))
120189  				crt.X__builtin_abort(tls)
120190  			}
120191  		}()
120192  		_1_nDb -= 1
120193  		goto _1
120194  	}
120195  	crt.Xmemcpy(tls, unsafe.Pointer(&_1_zDb), unsafe.Pointer(_zPath), uint64(_1_nDb))
120196  	*elem1((*int8)(unsafe.Pointer(&_1_zDb)), uintptr(_1_nDb)) = 0
120197  	_rc = _getFileMode(tls, (*int8)(unsafe.Pointer(&_1_zDb)), _pMode, _pUid, _pGid)
120198  	goto _10
120199  _0:
120200  	if (_flags & int32(8)) != 0 {
120201  		*_pMode = uint32(384)
120202  		goto _10
120203  	}
120204  	if (_flags & int32(64)) == 0 {
120205  		goto _10
120206  	}
120207  	_4_z = Xsqlite3_uri_parameter(tls, _zPath, str(135308))
120208  	if _4_z != nil {
120209  		_rc = _getFileMode(tls, _4_z, _pMode, _pUid, _pGid)
120210  	}
120211  _10:
120212  	return _rc
120213  
120214  	_ = _1_zDb
120215  	panic(0)
120216  }
120217  
120218  var _findCreateFileModeØ00__func__Ø000 [19]int8
120219  
120220  func init() {
120221  	crt.Xstrncpy(nil, &_findCreateFileModeØ00__func__Ø000[0], str(135315), 19)
120222  }
120223  
120224  // C comment
120225  //  /*
120226  //  ** Find the mode, uid and gid of file zFile.
120227  //  */
120228  func _getFileMode(tls *crt.TLS, _zFile *int8, _pMode *uint32, _pUid *uint32, _pGid *uint32) (r0 int32) {
120229  	var _rc int32
120230  	var _sStat crt.Xstruct_stat64
120231  	_rc = int32(0)
120232  	if int32(0) == func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
120233  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(4)).XpCurrent
120234  		return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
120235  	}()(tls, _zFile, &_sStat) {
120236  		*_pMode = _sStat.Xst_mode & uint32(511)
120237  		*_pUid = _sStat.Xst_uid
120238  		*_pGid = _sStat.Xst_gid
120239  		goto _1
120240  	}
120241  	_rc = int32(1802)
120242  _1:
120243  	return _rc
120244  }
120245  
120246  // C comment
120247  //  /*
120248  //  ** Initialize the contents of the unixFile structure pointed to by pId.
120249  //  */
120250  func _fillInUnixFile(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _h int32, _pId *Xsqlite3_file, _zFilename *int8, _ctrlFlags int32) (r0 int32) {
120251  	var _rc, _7_nFilename int32
120252  	var _7_zLockFile *int8
120253  	var _pLockingStyle *Xsqlite3_io_methods
120254  	var _pNew *XunixFile
120255  	_pNew = (*XunixFile)(unsafe.Pointer(_pId))
120256  	_rc = int32(0)
120257  	func() {
120258  		if (*XunixInodeInfo)(_pNew.XpInode) != nil {
120259  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35121), unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000), unsafe.Pointer(str(135334)))
120260  			crt.X__builtin_abort(tls)
120261  		}
120262  	}()
120263  	func() {
120264  		if _zFilename != nil && int32(*elem1(_zFilename, 0)) != int32(47) {
120265  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35131), unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000), unsafe.Pointer(str(135353)))
120266  			crt.X__builtin_abort(tls)
120267  		}
120268  	}()
120269  	func() {
120270  		if _zFilename == nil && (_ctrlFlags&int32(128)) == int32(0) {
120271  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35135), unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000), unsafe.Pointer(str(135387)))
120272  			crt.X__builtin_abort(tls)
120273  		}
120274  	}()
120275  	_pNew.Xh = _h
120276  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_pNew.XpVfs)) = _pVfs
120277  	_pNew.XzPath = _zFilename
120278  	_pNew.XctrlFlags = uint16(uint8(_ctrlFlags))
120279  	_pNew.XmmapSizeMax = _sqlite3Config.XszMmap
120280  	if Xsqlite3_uri_boolean(tls, func() *int8 {
120281  		if (_ctrlFlags & int32(64)) != 0 {
120282  			return _zFilename
120283  		}
120284  		return nil
120285  	}(), str(135436), int32(1)) != 0 {
120286  		{
120287  			p := &_pNew.XctrlFlags
120288  			*p = uint16(int32(*p) | int32(16))
120289  		}
120290  	}
120291  	if crt.Xstrcmp(tls, _pVfs.XzName, str(131342)) == int32(0) {
120292  		{
120293  			p := &_pNew.XctrlFlags
120294  			*p = uint16(int32(*p) | int32(1))
120295  		}
120296  	}
120297  	if (_ctrlFlags & int32(128)) != 0 {
120298  		_pLockingStyle = &_nolockIoMethods
120299  		goto _13
120300  	}
120301  	_pLockingStyle = (*(*func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods)(_pVfs.XpAppData))(tls, _zFilename, _pNew)
120302  _13:
120303  	if _pLockingStyle != &_posixIoMethods {
120304  		goto _14
120305  	}
120306  	_unixEnterMutex(tls)
120307  	_rc = _findInodeInfo(tls, _pNew, (**XunixInodeInfo)(unsafe.Pointer(&_pNew.XpInode)))
120308  	if _rc != int32(0) {
120309  		_robust_close(tls, _pNew, _h, int32(35199))
120310  		_h = int32(-1)
120311  	}
120312  	_unixLeaveMutex(tls)
120313  	goto _17
120314  _14:
120315  	if _pLockingStyle != &_dotlockIoMethods {
120316  		goto _17
120317  	}
120318  	func() {
120319  		if _zFilename == nil {
120320  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35239), unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000), unsafe.Pointer(str(135441)))
120321  			crt.X__builtin_abort(tls)
120322  		}
120323  	}()
120324  	_7_nFilename = int32(crt.Xstrlen(tls, _zFilename)) + int32(6)
120325  	_7_zLockFile = (*int8)(Xsqlite3_malloc64(tls, uint64(_7_nFilename)))
120326  	if _7_zLockFile == nil {
120327  		_rc = _sqlite3NomemError(tls, int32(35243))
120328  		goto _21
120329  	}
120330  	Xsqlite3_snprintf(tls, _7_nFilename, _7_zLockFile, str(135454), unsafe.Pointer(_zFilename))
120331  _21:
120332  	_pNew.XlockingContext = unsafe.Pointer(_7_zLockFile)
120333  _17:
120334  	_storeLastErrno(tls, _pNew, int32(0))
120335  	if _rc == int32(0) {
120336  		goto _22
120337  	}
120338  	if _h >= int32(0) {
120339  		_robust_close(tls, _pNew, _h, int32(35284))
120340  	}
120341  	goto _24
120342  _22:
120343  	*(**Xsqlite3_io_methods)(unsafe.Pointer(&_pNew.XpMethod)) = _pLockingStyle
120344  	_verifyDbFile(tls, _pNew)
120345  _24:
120346  	return _rc
120347  }
120348  
120349  var _fillInUnixFileØ00__func__Ø000 [15]int8
120350  
120351  func init() {
120352  	crt.Xstrncpy(nil, &_fillInUnixFileØ00__func__Ø000[0], str(135462), 15)
120353  }
120354  
120355  var _nolockIoMethods Xsqlite3_io_methods
120356  
120357  func init() {
120358  	_nolockIoMethods = Xsqlite3_io_methods{XiVersion: int32(3), XxClose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120359  		f func(*crt.TLS, *Xsqlite3_file) int32
120360  	}{_nolockClose})), XxRead: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
120361  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
120362  	}{_unixRead})), XxWrite: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
120363  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
120364  	}{_unixWrite})), XxTruncate: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
120365  		f func(*crt.TLS, *Xsqlite3_file, int64) int32
120366  	}{_unixTruncate})), XxSync: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120367  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120368  	}{_unixSync})), XxFileSize: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
120369  		f func(*crt.TLS, *Xsqlite3_file, *int64) int32
120370  	}{_unixFileSize})), XxLock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120371  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120372  	}{_nolockLock})), XxUnlock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120373  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120374  	}{_nolockUnlock})), XxCheckReservedLock: *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&struct {
120375  		f func(*crt.TLS, *Xsqlite3_file, *int32) int32
120376  	}{_nolockCheckReservedLock})), XxFileControl: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120377  		f func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32
120378  	}{_unixFileControl})), XxSectorSize: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120379  		f func(*crt.TLS, *Xsqlite3_file) int32
120380  	}{_unixSectorSize})), XxDeviceCharacteristics: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120381  		f func(*crt.TLS, *Xsqlite3_file) int32
120382  	}{_unixDeviceCharacteristics})), XxShmLock: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&struct {
120383  		f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32
120384  	}{_unixShmLock})), XxShmBarrier: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
120385  		f func(*crt.TLS, *Xsqlite3_file)
120386  	}{_unixShmBarrier})), XxShmUnmap: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120387  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120388  	}{_unixShmUnmap})), XxFetch: *(*func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120389  		f func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32
120390  	}{_unixFetch})), XxUnfetch: *(*func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120391  		f func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32
120392  	}{_unixUnfetch}))}
120393  }
120394  
120395  // C comment
120396  //  /*
120397  //  ** Close the file.
120398  //  */
120399  func _nolockClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
120400  	return _closeUnixFile(tls, _id)
120401  }
120402  
120403  func _nolockLock(tls *crt.TLS, _NotUsed *Xsqlite3_file, _NotUsed2 int32) (r0 int32) {
120404  	_ = _NotUsed2
120405  	return int32(0)
120406  }
120407  
120408  func _nolockUnlock(tls *crt.TLS, _NotUsed *Xsqlite3_file, _NotUsed2 int32) (r0 int32) {
120409  	_ = _NotUsed2
120410  	return int32(0)
120411  }
120412  
120413  func _nolockCheckReservedLock(tls *crt.TLS, _NotUsed *Xsqlite3_file, _pResOut *int32) (r0 int32) {
120414  	*_pResOut = int32(0)
120415  	return int32(0)
120416  }
120417  
120418  // C comment
120419  //  /*
120420  //  ** Given a file descriptor, locate the unixInodeInfo object that
120421  //  ** describes that file descriptor.  Create a new one if necessary.  The
120422  //  ** return value might be uninitialized if an error occurs.
120423  //  **
120424  //  ** The mutex entered using the unixEnterMutex() function must be held
120425  //  ** when this function is called.
120426  //  **
120427  //  ** Return an appropriate error code.
120428  //  */
120429  func _findInodeInfo(tls *crt.TLS, _pFile *XunixFile, _ppInode **XunixInodeInfo) (r0 int32) {
120430  	var _rc, _fd int32
120431  	var _statbuf crt.Xstruct_stat64
120432  	var _pInode *XunixInodeInfo
120433  	var _fileId TunixFileId
120434  	_pInode = nil
120435  	func() {
120436  		if _unixMutexHeld(tls) == 0 {
120437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31154), unsafe.Pointer(&_findInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132022)))
120438  			crt.X__builtin_abort(tls)
120439  		}
120440  	}()
120441  	_fd = _pFile.Xh
120442  	_rc = func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
120443  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
120444  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
120445  	}()(tls, _fd, &_statbuf)
120446  	if _rc != int32(0) {
120447  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
120448  		return int32(10)
120449  	}
120450  	crt.Xmemset(tls, unsafe.Pointer(&_fileId), int32(0), uint64(16))
120451  	_fileId.Xdev = _statbuf.Xst_dev
120452  	_fileId.Xino = _statbuf.Xst_ino
120453  	_pInode = _inodeList
120454  _3:
120455  	if (_pInode != nil) && crt.Xmemcmp(tls, unsafe.Pointer(&_fileId), unsafe.Pointer(&_pInode.XfileId), uint64(16)) != 0 {
120456  		_pInode = (*XunixInodeInfo)(_pInode.XpNext)
120457  		goto _3
120458  	}
120459  	if _pInode != nil {
120460  		goto _6
120461  	}
120462  	_pInode = (*XunixInodeInfo)(Xsqlite3_malloc64(tls, uint64(72)))
120463  	if _pInode == nil {
120464  		return _sqlite3NomemError(tls, int32(31208))
120465  	}
120466  	crt.Xmemset(tls, unsafe.Pointer(_pInode), int32(0), uint64(72))
120467  	crt.Xmemcpy(tls, unsafe.Pointer(&_pInode.XfileId), unsafe.Pointer(&_fileId), uint64(16))
120468  	_pInode.XnRef = int32(1)
120469  	*(**XunixInodeInfo)(unsafe.Pointer(&_pInode.XpNext)) = _inodeList
120470  	*(**XunixInodeInfo)(unsafe.Pointer(&_pInode.XpPrev)) = nil
120471  	if _inodeList != nil {
120472  		*(**XunixInodeInfo)(unsafe.Pointer(&_inodeList.XpPrev)) = _pInode
120473  	}
120474  	_inodeList = _pInode
120475  	bug20530(_inodeList)
120476  	goto _9
120477  _6:
120478  	_pInode.XnRef += 1
120479  _9:
120480  	*_ppInode = _pInode
120481  	return int32(0)
120482  }
120483  
120484  var _findInodeInfoØ00__func__Ø000 [14]int8
120485  
120486  func init() {
120487  	crt.Xstrncpy(nil, &_findInodeInfoØ00__func__Ø000[0], str(135477), 14)
120488  }
120489  
120490  var _dotlockIoMethods Xsqlite3_io_methods
120491  
120492  func init() {
120493  	_dotlockIoMethods = Xsqlite3_io_methods{XiVersion: int32(1), XxClose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120494  		f func(*crt.TLS, *Xsqlite3_file) int32
120495  	}{_dotlockClose})), XxRead: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
120496  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
120497  	}{_unixRead})), XxWrite: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
120498  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
120499  	}{_unixWrite})), XxTruncate: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
120500  		f func(*crt.TLS, *Xsqlite3_file, int64) int32
120501  	}{_unixTruncate})), XxSync: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120502  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120503  	}{_unixSync})), XxFileSize: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
120504  		f func(*crt.TLS, *Xsqlite3_file, *int64) int32
120505  	}{_unixFileSize})), XxLock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120506  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120507  	}{_dotlockLock})), XxUnlock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120508  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120509  	}{_dotlockUnlock})), XxCheckReservedLock: *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&struct {
120510  		f func(*crt.TLS, *Xsqlite3_file, *int32) int32
120511  	}{_dotlockCheckReservedLock})), XxFileControl: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120512  		f func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32
120513  	}{_unixFileControl})), XxSectorSize: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120514  		f func(*crt.TLS, *Xsqlite3_file) int32
120515  	}{_unixSectorSize})), XxDeviceCharacteristics: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120516  		f func(*crt.TLS, *Xsqlite3_file) int32
120517  	}{_unixDeviceCharacteristics})), XxShmLock: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&struct {
120518  		f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32
120519  	}{_unixShmLock})), XxShmBarrier: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
120520  		f func(*crt.TLS, *Xsqlite3_file)
120521  	}{_unixShmBarrier})), XxShmUnmap: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120522  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120523  	}{_unixShmUnmap})), XxFetch: *(*func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120524  		f func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32
120525  	}{_unixFetch})), XxUnfetch: *(*func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120526  		f func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32
120527  	}{_unixUnfetch}))}
120528  }
120529  
120530  // C comment
120531  //  /*
120532  //  ** Close a file.  Make sure the lock has been released before closing.
120533  //  */
120534  func _dotlockClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
120535  	var _pFile *XunixFile
120536  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
120537  	func() {
120538  		if _id == nil {
120539  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(32100), unsafe.Pointer(&_dotlockCloseØ00__func__Ø000), unsafe.Pointer(str(135491)))
120540  			crt.X__builtin_abort(tls)
120541  		}
120542  	}()
120543  	_dotlockUnlock(tls, _id, int32(0))
120544  	Xsqlite3_free(tls, _pFile.XlockingContext)
120545  	return _closeUnixFile(tls, _id)
120546  }
120547  
120548  var _dotlockCloseØ00__func__Ø000 [13]int8
120549  
120550  func init() {
120551  	crt.Xstrncpy(nil, &_dotlockCloseØ00__func__Ø000[0], str(135497), 13)
120552  }
120553  
120554  // C comment
120555  //  /*
120556  //  ** Lower the locking level on file descriptor pFile to eFileLock.  eFileLock
120557  //  ** must be either NO_LOCK or SHARED_LOCK.
120558  //  **
120559  //  ** If the locking level of the file descriptor is already at or below
120560  //  ** the requested locking level, this routine is a no-op.
120561  //  **
120562  //  ** When the locking level reaches NO_LOCK, delete the lock file.
120563  //  */
120564  func _dotlockUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
120565  	var _rc, _3_tErrno int32
120566  	var _zLockFile *int8
120567  	var _pFile *XunixFile
120568  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
120569  	_zLockFile = (*int8)(_pFile.XlockingContext)
120570  	func() {
120571  		if _pFile == nil {
120572  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(32060), unsafe.Pointer(&_dotlockUnlockØ00__func__Ø000), unsafe.Pointer(str(58022)))
120573  			crt.X__builtin_abort(tls)
120574  		}
120575  	}()
120576  	func() {
120577  		if _eFileLock > int32(1) {
120578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(32063), unsafe.Pointer(&_dotlockUnlockØ00__func__Ø000), unsafe.Pointer(str(131866)))
120579  			crt.X__builtin_abort(tls)
120580  		}
120581  	}()
120582  	if int32(_pFile.XeFileLock) == _eFileLock {
120583  		return int32(0)
120584  	}
120585  	if _eFileLock == int32(1) {
120586  		_pFile.XeFileLock = uint8(1)
120587  		return int32(0)
120588  	}
120589  	func() {
120590  		if _eFileLock != int32(0) {
120591  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(32079), unsafe.Pointer(&_dotlockUnlockØ00__func__Ø000), unsafe.Pointer(str(135510)))
120592  			crt.X__builtin_abort(tls)
120593  		}
120594  	}()
120595  	_rc = func() func(*crt.TLS, *int8) int32 {
120596  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(19)).XpCurrent
120597  		return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v))
120598  	}()(tls, _zLockFile)
120599  	if _rc >= int32(0) {
120600  		goto _8
120601  	}
120602  	_3_tErrno = *crt.X__errno_location(tls)
120603  	if _3_tErrno == int32(2) {
120604  		_rc = int32(0)
120605  		goto _10
120606  	}
120607  	_rc = int32(2058)
120608  	_storeLastErrno(tls, _pFile, _3_tErrno)
120609  _10:
120610  	return _rc
120611  
120612  _8:
120613  	_pFile.XeFileLock = 0
120614  	return int32(0)
120615  }
120616  
120617  var _dotlockUnlockØ00__func__Ø000 [14]int8
120618  
120619  func init() {
120620  	crt.Xstrncpy(nil, &_dotlockUnlockØ00__func__Ø000[0], str(135529), 14)
120621  }
120622  
120623  // C comment
120624  //  /*
120625  //  ** Lock the file with the lock specified by parameter eFileLock - one
120626  //  ** of the following:
120627  //  **
120628  //  **     (1) SHARED_LOCK
120629  //  **     (2) RESERVED_LOCK
120630  //  **     (3) PENDING_LOCK
120631  //  **     (4) EXCLUSIVE_LOCK
120632  //  **
120633  //  ** Sometimes when requesting one lock state, additional lock states
120634  //  ** are inserted in between.  The locking might fail on one of the later
120635  //  ** transitions leaving the lock state different from what it started but
120636  //  ** still short of its goal.  The following chart shows the allowed
120637  //  ** transitions and the inserted intermediate states:
120638  //  **
120639  //  **    UNLOCKED -> SHARED
120640  //  **    SHARED -> RESERVED
120641  //  **    SHARED -> (PENDING) -> EXCLUSIVE
120642  //  **    RESERVED -> (PENDING) -> EXCLUSIVE
120643  //  **    PENDING -> EXCLUSIVE
120644  //  **
120645  //  ** This routine will only increase a lock.  Use the sqlite3OsUnlock()
120646  //  ** routine to lower a locking level.
120647  //  **
120648  //  ** With dotfile locking, we really only support state (4): EXCLUSIVE.
120649  //  ** But we track the other locking levels internally.
120650  //  */
120651  func _dotlockLock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
120652  	var _rc, _2_tErrno int32
120653  	var _zLockFile *int8
120654  	var _pFile *XunixFile
120655  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
120656  	_zLockFile = (*int8)(_pFile.XlockingContext)
120657  	_rc = int32(0)
120658  	if int32(_pFile.XeFileLock) > int32(0) {
120659  		_pFile.XeFileLock = uint8(_eFileLock)
120660  		crt.Xutimes(tls, _zLockFile, nil)
120661  		return int32(0)
120662  	}
120663  	_rc = func() func(*crt.TLS, *int8, uint32) int32 {
120664  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(18)).XpCurrent
120665  		return *(*func(*crt.TLS, *int8, uint32) int32)(unsafe.Pointer(&v))
120666  	}()(tls, _zLockFile, uint32(511))
120667  	if _rc >= int32(0) {
120668  		goto _1
120669  	}
120670  	_2_tErrno = *crt.X__errno_location(tls)
120671  	if int32(17) == _2_tErrno {
120672  		_rc = int32(5)
120673  		goto _3
120674  	}
120675  	_rc = _sqliteErrorFromPosixError(tls, _2_tErrno, int32(3850))
120676  	if _rc != int32(5) {
120677  		_storeLastErrno(tls, _pFile, _2_tErrno)
120678  	}
120679  _3:
120680  	return _rc
120681  
120682  _1:
120683  	_pFile.XeFileLock = uint8(_eFileLock)
120684  	return _rc
120685  }
120686  
120687  // C comment
120688  //  /*
120689  //  ** This routine checks if there is a RESERVED lock held on the specified
120690  //  ** file by this or any other process. If such a lock is held, set *pResOut
120691  //  ** to a non-zero value otherwise *pResOut is set to zero.  The return value
120692  //  ** is set to SQLITE_OK unless an I/O error occurs during lock checking.
120693  //  **
120694  //  ** In dotfile locking, either a lock exists or it does not.  So in this
120695  //  ** variation of CheckReservedLock(), *pResOut is set to true if any lock
120696  //  ** is held on the file and false if the file is unlocked.
120697  //  */
120698  func _dotlockCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) {
120699  	var _rc, _reserved int32
120700  	var _pFile *XunixFile
120701  	_rc = int32(0)
120702  	_reserved = int32(0)
120703  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
120704  	func() {
120705  		if _pFile == nil {
120706  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31971), unsafe.Pointer(&_dotlockCheckReservedLockØ00__func__Ø000), unsafe.Pointer(str(58022)))
120707  			crt.X__builtin_abort(tls)
120708  		}
120709  	}()
120710  	_reserved = bool2int(func() func(*crt.TLS, *int8, int32) int32 {
120711  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(2)).XpCurrent
120712  		return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v))
120713  	}()(tls, (*int8)(_pFile.XlockingContext), int32(0)) == int32(0))
120714  	*_pResOut = _reserved
120715  	return _rc
120716  }
120717  
120718  var _dotlockCheckReservedLockØ00__func__Ø000 [25]int8
120719  
120720  func init() {
120721  	crt.Xstrncpy(nil, &_dotlockCheckReservedLockØ00__func__Ø000[0], str(135543), 25)
120722  }
120723  
120724  // C comment
120725  //  /*
120726  //  ** Delete the file at zPath. If the dirSync argument is true, fsync()
120727  //  ** the directory after deleting the file.
120728  //  */
120729  func _unixDelete(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zPath *int8, _dirSync int32) (r0 int32) {
120730  	var _rc, _4_fd int32
120731  	_rc = int32(0)
120732  
120733  	if func() func(*crt.TLS, *int8) int32 {
120734  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(16)).XpCurrent
120735  		return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v))
120736  	}()(tls, _zPath) != int32(-1) {
120737  		goto _0
120738  	}
120739  	if (*crt.X__errno_location(tls)) == int32(2) {
120740  		_rc = int32(5898)
120741  		goto _2
120742  	}
120743  	_rc = _unixLogErrorAtLine(tls, int32(2570), str(131620), _zPath, int32(35819))
120744  _2:
120745  	return _rc
120746  
120747  _0:
120748  	if (_dirSync & int32(1)) == int32(0) {
120749  		goto _3
120750  	}
120751  	_rc = func() func(*crt.TLS, *int8, *int32) int32 {
120752  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(17)).XpCurrent
120753  		return *(*func(*crt.TLS, *int8, *int32) int32)(unsafe.Pointer(&v))
120754  	}()(tls, _zPath, &_4_fd)
120755  	if _rc != int32(0) {
120756  		goto _4
120757  	}
120758  	if _full_fsync(tls, _4_fd, int32(0), int32(0)) != 0 {
120759  		_rc = _unixLogErrorAtLine(tls, int32(1290), str(135568), _zPath, int32(35829))
120760  	}
120761  	_robust_close(tls, nil, _4_fd, int32(35831))
120762  	goto _6
120763  _4:
120764  	func() {
120765  		if _rc != int32(14) {
120766  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35833), unsafe.Pointer(&_unixDeleteØ00__func__Ø000), unsafe.Pointer(str(132450)))
120767  			crt.X__builtin_abort(tls)
120768  		}
120769  	}()
120770  	_rc = int32(0)
120771  _6:
120772  _3:
120773  	return _rc
120774  }
120775  
120776  var _unixDeleteØ00__func__Ø000 [11]int8
120777  
120778  func init() {
120779  	crt.Xstrncpy(nil, &_unixDeleteØ00__func__Ø000[0], str(135574), 11)
120780  }
120781  
120782  // C comment
120783  //  /*
120784  //  ** Test the existence of or access permissions of file zPath. The
120785  //  ** test performed depends on the value of flags:
120786  //  **
120787  //  **     SQLITE_ACCESS_EXISTS: Return 1 if the file exists
120788  //  **     SQLITE_ACCESS_READWRITE: Return 1 if the file is read and writable.
120789  //  **     SQLITE_ACCESS_READONLY: Return 1 if the file is readable.
120790  //  **
120791  //  ** Otherwise return 0.
120792  //  */
120793  func _unixAccess(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zPath *int8, _flags int32, _pResOut *int32) (r0 int32) {
120794  	var _1_buf crt.Xstruct_stat64
120795  
120796  	func() {
120797  		if _pResOut == nil {
120798  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35859), unsafe.Pointer(&_unixAccessØ00__func__Ø000), unsafe.Pointer(str(135585)))
120799  			crt.X__builtin_abort(tls)
120800  		}
120801  	}()
120802  	func() {
120803  		if _flags != int32(0) && _flags != int32(1) {
120804  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35863), unsafe.Pointer(&_unixAccessØ00__func__Ø000), unsafe.Pointer(str(135596)))
120805  			crt.X__builtin_abort(tls)
120806  		}
120807  	}()
120808  	if _flags == int32(0) {
120809  		*_pResOut = bool2int((int32(0) == func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
120810  			v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(4)).XpCurrent
120811  			return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
120812  		}()(tls, _zPath, &_1_buf)) && (_1_buf.Xst_size > (0)))
120813  		goto _7
120814  	}
120815  	*_pResOut = bool2int(func() func(*crt.TLS, *int8, int32) int32 {
120816  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(2)).XpCurrent
120817  		return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v))
120818  	}()(tls, _zPath, int32(6)) == int32(0))
120819  _7:
120820  	return int32(0)
120821  }
120822  
120823  var _unixAccessØ00__func__Ø000 [11]int8
120824  
120825  func init() {
120826  	crt.Xstrncpy(nil, &_unixAccessØ00__func__Ø000[0], str(135658), 11)
120827  }
120828  
120829  // C comment
120830  //  /*
120831  //  ** Turn a relative pathname into a full pathname. The relative path
120832  //  ** is stored as a nul-terminated string in the buffer pointed to by
120833  //  ** zPath.
120834  //  **
120835  //  ** zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes
120836  //  ** (in this case, MAX_PATHNAME bytes). The full-path is written to
120837  //  ** this buffer before returning.
120838  //  */
120839  func _unixFullPathname(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _nOut int32, _zOut *int8) (r0 int32) {
120840  	var _rc, _nByte, _nLink, _1_bLink, _11_n int32
120841  	var _zIn, _zDel *int8
120842  	var _1_buf crt.Xstruct_stat64
120843  	_rc = int32(0)
120844  	_nLink = int32(1)
120845  	_zIn = _zPath
120846  	_zDel = nil
120847  	func() {
120848  		if _pVfs.XmxPathname != int32(512) {
120849  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35925), unsafe.Pointer(&_unixFullPathnameØ00__func__Ø000), unsafe.Pointer(str(135669)))
120850  			crt.X__builtin_abort(tls)
120851  		}
120852  	}()
120853  
120854  _2:
120855  	_1_bLink = int32(0)
120856  	if func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
120857  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(27)).XpCurrent
120858  		return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
120859  	}()(tls, _zIn, &_1_buf) == int32(0) {
120860  		goto _3
120861  	}
120862  	if (*crt.X__errno_location(tls)) != int32(2) {
120863  		_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(35943)), str(131708), _zIn, int32(35943))
120864  	}
120865  	goto _5
120866  _3:
120867  	_1_bLink = bool2int((_1_buf.Xst_mode & uint32(61440)) == uint32(40960))
120868  _5:
120869  	if _1_bLink == 0 {
120870  		goto _6
120871  	}
120872  	if _zDel != nil {
120873  		goto _7
120874  	}
120875  	_zDel = (*int8)(Xsqlite3_malloc(tls, _nOut))
120876  	if _zDel == nil {
120877  		_rc = _sqlite3NomemError(tls, int32(35952))
120878  	}
120879  	goto _10
120880  _7:
120881  	if preInc2(&_nLink, 1) > int32(100) {
120882  		_rc = _sqlite3CantopenError(tls, int32(35954))
120883  	}
120884  _10:
120885  	if _rc != int32(0) {
120886  		goto _11
120887  	}
120888  	_nByte = int32(func() func(*crt.TLS, *int8, *int8, uint64) int64 {
120889  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(26)).XpCurrent
120890  		return *(*func(*crt.TLS, *int8, *int8, uint64) int64)(unsafe.Pointer(&v))
120891  	}()(tls, _zIn, _zDel, uint64(_nOut-int32(1))))
120892  	if _nByte < int32(0) {
120893  		_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(35960)), str(131699), _zIn, int32(35960))
120894  		goto _13
120895  	}
120896  	if int32(*elem1(_zDel, 0)) == int32(47) {
120897  		goto _14
120898  	}
120899  	_11_n = _sqlite3Strlen30(tls, _zIn)
120900  _15:
120901  	if _11_n <= int32(0) || int32(*elem1(_zIn, uintptr(_11_n-int32(1)))) == int32(47) {
120902  		goto _19
120903  	}
120904  	_11_n -= 1
120905  	goto _15
120906  _19:
120907  	if ((_nByte + _11_n) + int32(1)) > _nOut {
120908  		_rc = _sqlite3CantopenError(tls, int32(35966))
120909  		goto _21
120910  	}
120911  	crt.Xmemmove(tls, unsafe.Pointer(elem1(_zDel, uintptr(_11_n))), unsafe.Pointer(_zDel), uint64(_nByte+int32(1)))
120912  	crt.Xmemcpy(tls, unsafe.Pointer(_zDel), unsafe.Pointer(_zIn), uint64(_11_n))
120913  	_nByte += _11_n
120914  _21:
120915  _14:
120916  	*elem1(_zDel, uintptr(_nByte)) = 0
120917  _13:
120918  _11:
120919  	_zIn = _zDel
120920  _6:
120921  	func() {
120922  		if _rc == int32(0) && _zIn == _zOut && int32(*elem1(_zIn, 0)) != int32(47) {
120923  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35980), unsafe.Pointer(&_unixFullPathnameØ00__func__Ø000), unsafe.Pointer(str(135700)))
120924  			crt.X__builtin_abort(tls)
120925  		}
120926  	}()
120927  	if (_rc == int32(0)) && (_zIn != _zOut) {
120928  		_rc = _mkFullPathname(tls, _zIn, _zOut, _nOut)
120929  	}
120930  	if _1_bLink == int32(0) {
120931  		goto _29
120932  	}
120933  	_zIn = _zOut
120934  	if _rc == int32(0) {
120935  		goto _2
120936  	}
120937  _29:
120938  	Xsqlite3_free(tls, unsafe.Pointer(_zDel))
120939  	return _rc
120940  
120941  	_ = _nLink
120942  	panic(0)
120943  }
120944  
120945  var _unixFullPathnameØ00__func__Ø000 [17]int8
120946  
120947  func init() {
120948  	crt.Xstrncpy(nil, &_unixFullPathnameØ00__func__Ø000[0], str(135742), 17)
120949  }
120950  
120951  // C comment
120952  //  /*
120953  //  **
120954  //  */
120955  func _mkFullPathname(tls *crt.TLS, _zPath *int8, _zOut *int8, _nOut int32) (r0 int32) {
120956  	var _nPath, _iOff int32
120957  	_nPath = _sqlite3Strlen30(tls, _zPath)
120958  	_iOff = int32(0)
120959  	if int32(*elem1(_zPath, 0)) == int32(47) {
120960  		goto _0
120961  	}
120962  	if func() func(*crt.TLS, *int8, uint64) *int8 {
120963  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(3)).XpCurrent
120964  		return *(*func(*crt.TLS, *int8, uint64) *int8)(unsafe.Pointer(&v))
120965  	}()(tls, _zOut, uint64(_nOut-int32(2))) == nil {
120966  		return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(35886)), str(131528), _zPath, int32(35886))
120967  	}
120968  	_iOff = _sqlite3Strlen30(tls, _zOut)
120969  	*elem1(_zOut, uintptr(postInc2(&_iOff, 1))) = int8(47)
120970  _0:
120971  	if ((_iOff + _nPath) + int32(1)) > _nOut {
120972  		*elem1(_zOut, uintptr(_iOff)) = 0
120973  		return _sqlite3CantopenError(tls, int32(35895))
120974  	}
120975  	Xsqlite3_snprintf(tls, _nOut-_iOff, elem1(_zOut, uintptr(_iOff)), str(24531), unsafe.Pointer(_zPath))
120976  	return int32(0)
120977  }
120978  
120979  func _unixDlOpen(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zFilename *int8) (r0 unsafe.Pointer) {
120980  	return crt.Xdlopen(tls, _zFilename, int32(258))
120981  }
120982  
120983  // C comment
120984  //  /*
120985  //  ** SQLite calls this function immediately after a call to unixDlSym() or
120986  //  ** unixDlOpen() fails (returns a null pointer). If a more detailed error
120987  //  ** message is available, it is written to zBufOut. If no error message
120988  //  ** is available, zBufOut is left unmodified and SQLite uses a default
120989  //  ** error message.
120990  //  */
120991  func _unixDlError(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBufOut *int8) {
120992  	var _zErr *int8
120993  
120994  	_unixEnterMutex(tls)
120995  	_zErr = crt.Xdlerror(tls)
120996  	if _zErr != nil {
120997  		Xsqlite3_snprintf(tls, _nBuf, _zBufOut, str(24531), unsafe.Pointer(_zErr))
120998  	}
120999  	_unixLeaveMutex(tls)
121000  }
121001  
121002  func _unixDlSym(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _p unsafe.Pointer, _zSym *int8) (r0 func(*crt.TLS)) {
121003  	var _x func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS)
121004  
121005  	_x = func() func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS) {
121006  		v := crt.Xdlsym
121007  		return *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&v))
121008  	}()
121009  	return _x(tls, _p, _zSym)
121010  }
121011  
121012  func _unixDlClose(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _pHandle unsafe.Pointer) {
121013  	crt.Xdlclose(tls, _pHandle)
121014  }
121015  
121016  // C comment
121017  //  /*
121018  //  ** Write nBuf bytes of random data to the supplied buffer zBuf.
121019  //  */
121020  func _unixRandomness(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBuf *int8) (r0 int32) {
121021  	var _1_fd, _1_got int32
121022  	var _2_t int64
121023  
121024  	func() {
121025  		if uint64(_nBuf) < uint64(12) {
121026  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(36061), unsafe.Pointer(&_unixRandomnessØ00__func__Ø000), unsafe.Pointer(str(135759)))
121027  			crt.X__builtin_abort(tls)
121028  		}
121029  	}()
121030  	crt.Xmemset(tls, unsafe.Pointer(_zBuf), int32(0), uint64(_nBuf))
121031  	_randomnessPid = crt.Xgetpid(tls)
121032  	bug20530(_randomnessPid)
121033  	_1_fd = _robust_open(tls, str(135802), int32(0), 0)
121034  	if _1_fd < int32(0) {
121035  		crt.Xtime(tls, &_2_t)
121036  		crt.Xmemcpy(tls, unsafe.Pointer(_zBuf), unsafe.Pointer(&_2_t), uint64(8))
121037  		crt.Xmemcpy(tls, unsafe.Pointer(elem1(_zBuf, uintptr(8))), unsafe.Pointer(&_randomnessPid), uint64(4))
121038  		func() {
121039  			if uint64(12) > uint64(_nBuf) {
121040  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(36086), unsafe.Pointer(&_unixRandomnessØ00__func__Ø000), unsafe.Pointer(str(135815)))
121041  				crt.X__builtin_abort(tls)
121042  			}
121043  		}()
121044  		_nBuf = int32(12)
121045  		goto _5
121046  	}
121047  _6:
121048  	_1_got = int32(func() func(*crt.TLS, int32, unsafe.Pointer, uint64) int64 {
121049  		v := elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(8)).XpCurrent
121050  		return *(*func(*crt.TLS, int32, unsafe.Pointer, uint64) int64)(unsafe.Pointer(&v))
121051  	}()(tls, _1_fd, unsafe.Pointer(_zBuf), uint64(_nBuf)))
121052  	if (_1_got < int32(0)) && ((*crt.X__errno_location(tls)) == int32(4)) {
121053  		goto _6
121054  	}
121055  	_robust_close(tls, nil, _1_fd, int32(36090))
121056  _5:
121057  	return _nBuf
121058  }
121059  
121060  var _unixRandomnessØ00__func__Ø000 [15]int8
121061  
121062  func init() {
121063  	crt.Xstrncpy(nil, &_unixRandomnessØ00__func__Ø000[0], str(135861), 15)
121064  }
121065  
121066  // C comment
121067  //  /*
121068  //  ** Sleep for a little while.  Return the amount of time slept.
121069  //  ** The argument is the number of microseconds we want to sleep.
121070  //  ** The return value is the number of microseconds of sleep actually
121071  //  ** requested from the underlying operating system, a number which
121072  //  ** might be greater than or equal to the argument, but not less
121073  //  ** than the argument.
121074  //  */
121075  func _unixSleep(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _microseconds int32) (r0 int32) {
121076  	crt.Xusleep(tls, uint32(_microseconds))
121077  	return _microseconds
121078  }
121079  
121080  // C comment
121081  //  /*
121082  //  ** Find the current time (in Universal Coordinated Time).  Write the
121083  //  ** current time and date as a Julian Day number into *prNow and
121084  //  ** return 0.  Return 1 if the time and date cannot be found.
121085  //  */
121086  func _unixCurrentTime(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _prNow *float64) (r0 int32) {
121087  	var _rc int32
121088  	var _i int64
121089  	_i = int64(0)
121090  
121091  	_rc = _unixCurrentTimeInt64(tls, nil, &_i)
121092  	*_prNow = float64(_i) / (8.64e+07)
121093  	return _rc
121094  }
121095  
121096  // C comment
121097  //  /*
121098  //  ** Find the current time (in Universal Coordinated Time).  Write into *piNow
121099  //  ** the current time and date as a Julian Day number times 86_400_000.  In
121100  //  ** other words, write into *piNow the number of milliseconds since the Julian
121101  //  ** epoch of noon in Greenwich on November 24, 4714 B.C according to the
121102  //  ** proleptic Gregorian calendar.
121103  //  **
121104  //  ** On success, return SQLITE_OK.  Return SQLITE_ERROR if the time and date
121105  //  ** cannot be found.
121106  //  */
121107  func _unixCurrentTimeInt64(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _piNow *int64) (r0 int32) {
121108  	var _rc int32
121109  	var _sNow crt.Xstruct_timeval
121110  	_rc = int32(0)
121111  	crt.Xgettimeofday(tls, &_sNow, nil)
121112  	*_piNow = (_unixCurrentTimeInt64Ø00unixEpochØ001 + (int64(1000) * _sNow.Xtv_sec)) + (_sNow.Xtv_usec / int64(1000))
121113  	return _rc
121114  }
121115  
121116  var _unixCurrentTimeInt64Ø00unixEpochØ001 int64
121117  
121118  func init() {
121119  	_unixCurrentTimeInt64Ø00unixEpochØ001 = int64(210866760000000)
121120  }
121121  
121122  // C comment
121123  //  /*
121124  //  ** The xGetLastError() method is designed to return a better
121125  //  ** low-level error message when operating-system problems come up
121126  //  ** during SQLite operation.  Only the integer return code is currently
121127  //  ** used.
121128  //  */
121129  func _unixGetLastError(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _NotUsed2 int32, _NotUsed3 *int8) (r0 int32) {
121130  	return *crt.X__errno_location(tls)
121131  }
121132  
121133  // C comment
121134  //  /*
121135  //  ** This is the xSetSystemCall() method of sqlite3_vfs for all of the
121136  //  ** "unix" VFSes.  Return SQLITE_OK opon successfully updating the
121137  //  ** system call pointer, or SQLITE_NOTFOUND if there is no configurable
121138  //  ** system call named zName.
121139  //  */
121140  func _unixSetSystemCall(tls *crt.TLS, _pNotUsed *Xsqlite3_vfs, _zName *int8, _pNewFunc func(*crt.TLS)) (r0 int32) {
121141  	var _rc int32
121142  	var _i uint32
121143  	_rc = int32(12)
121144  
121145  	if _zName != nil {
121146  		goto _0
121147  	}
121148  	_rc = int32(0)
121149  	_i = 0
121150  _1:
121151  	if uint64(_i) >= uint64(28) {
121152  		goto _4
121153  	}
121154  	if (elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpDefault) != nil {
121155  		elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpCurrent = elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpDefault
121156  	}
121157  	_i += 1
121158  	goto _1
121159  _4:
121160  	goto _6
121161  _0:
121162  	_i = 0
121163  _7:
121164  	if uint64(_i) >= uint64(28) {
121165  		goto _10
121166  	}
121167  	if crt.Xstrcmp(tls, _zName, elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XzName) != int32(0) {
121168  		goto _11
121169  	}
121170  	if (elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpDefault) == nil {
121171  		elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpDefault = elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpCurrent
121172  	}
121173  	_rc = int32(0)
121174  	if _pNewFunc == nil {
121175  		_pNewFunc = elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpDefault
121176  	}
121177  	elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpCurrent = _pNewFunc
121178  	goto _10
121179  _11:
121180  	_i += 1
121181  	goto _7
121182  _10:
121183  _6:
121184  	return _rc
121185  }
121186  
121187  // C comment
121188  //  /*
121189  //  ** Return the value of a system call.  Return NULL if zName is not a
121190  //  ** recognized system call name.  NULL is also returned if the system call
121191  //  ** is currently undefined.
121192  //  */
121193  func _unixGetSystemCall(tls *crt.TLS, _pNotUsed *Xsqlite3_vfs, _zName *int8) (r0 func(*crt.TLS)) {
121194  	var _i uint32
121195  
121196  	_i = 0
121197  _0:
121198  	if uint64(_i) >= uint64(28) {
121199  		goto _3
121200  	}
121201  	if crt.Xstrcmp(tls, _zName, elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XzName) == int32(0) {
121202  		return elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpCurrent
121203  	}
121204  	_i += 1
121205  	goto _0
121206  _3:
121207  	return nil
121208  }
121209  
121210  // C comment
121211  //  /*
121212  //  ** Return the name of the first system call after zName.  If zName==NULL
121213  //  ** then return the name of the first system call.  Return NULL if zName
121214  //  ** is the last system call or if zName is not the name of a valid
121215  //  ** system call.
121216  //  */
121217  func _unixNextSystemCall(tls *crt.TLS, _p *Xsqlite3_vfs, _zName *int8) (r0 *int8) {
121218  	var _i int32
121219  	_i = int32(-1)
121220  
121221  	if _zName == nil {
121222  		goto _0
121223  	}
121224  	_i = int32(0)
121225  _1:
121226  	if _i >= int32(27) {
121227  		goto _4
121228  	}
121229  	if crt.Xstrcmp(tls, _zName, elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XzName) == int32(0) {
121230  		goto _4
121231  	}
121232  	_i += 1
121233  	goto _1
121234  _4:
121235  _0:
121236  	_i += 1
121237  _6:
121238  	if _i >= int32(28) {
121239  		goto _9
121240  	}
121241  	if (elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpCurrent) != nil {
121242  		return elem135((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XzName
121243  	}
121244  	_i += 1
121245  	goto _6
121246  _9:
121247  	return nil
121248  }
121249  
121250  var _nolockIoFinder func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods
121251  
121252  func init() {
121253  	_nolockIoFinder = _nolockIoFinderImpl
121254  }
121255  
121256  func _nolockIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_io_methods) {
121257  	return &_nolockIoMethods
121258  }
121259  
121260  var _dotlockIoFinder func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods
121261  
121262  func init() {
121263  	_dotlockIoFinder = _dotlockIoFinderImpl
121264  }
121265  
121266  func _dotlockIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_io_methods) {
121267  	return &_dotlockIoMethods
121268  }
121269  
121270  // C comment
121271  //  /*
121272  //  ** This function is called during initialization if a static buffer is
121273  //  ** supplied to use for the page-cache by passing the SQLITE_CONFIG_PAGECACHE
121274  //  ** verb to sqlite3_config(). Parameter pBuf points to an allocation large
121275  //  ** enough to contain 'n' buffers of 'sz' bytes each.
121276  //  **
121277  //  ** This routine is called from sqlite3_initialize() and so it is guaranteed
121278  //  ** to be serialized already.  There is no need for further mutexing.
121279  //  */
121280  func _sqlite3PCacheBufferSetup(tls *crt.TLS, _pBuf unsafe.Pointer, _sz int32, _n int32) {
121281  	var _1_p *XScratchFreeslot
121282  	if _pcache1_g.XisInit == 0 {
121283  		goto _0
121284  	}
121285  	if _pBuf == nil {
121286  		_sz = store2(&_n, int32(0))
121287  	}
121288  	_sz = _sz & int32(-8)
121289  	_pcache1_g.XszSlot = _sz
121290  	_pcache1_g.XnSlot = store2(&_pcache1_g.XnFreeSlot, _n)
121291  	_pcache1_g.XnReserve = func() int32 {
121292  		if _n > int32(90) {
121293  			return int32(10)
121294  		}
121295  		return ((_n / int32(10)) + int32(1))
121296  	}()
121297  	_pcache1_g.XpStart = _pBuf
121298  	*(**XScratchFreeslot)(unsafe.Pointer(&_pcache1_g.XpFree)) = nil
121299  	_pcache1_g.XbUnderPressure = int32(0)
121300  _4:
121301  	if postInc2(&_n, -1) != 0 {
121302  		_1_p = (*XScratchFreeslot)(_pBuf)
121303  		*(**XScratchFreeslot)(unsafe.Pointer(&_1_p.XpNext)) = (*XScratchFreeslot)(_pcache1_g.XpFree)
121304  		*(**XScratchFreeslot)(unsafe.Pointer(&_pcache1_g.XpFree)) = _1_p
121305  		_pBuf = unsafe.Pointer(elem1((*int8)(_pBuf), uintptr(_sz)))
121306  		goto _4
121307  	}
121308  	_pcache1_g.XpEnd = _pBuf
121309  _0:
121310  }
121311  
121312  var _sqlite3_initializeØ00__func__Ø000 [19]int8
121313  
121314  func init() {
121315  	crt.Xstrncpy(nil, &_sqlite3_initializeØ00__func__Ø000[0], str(135876), 19)
121316  }
121317  
121318  var _enlargeAndAppendØ00__func__Ø000 [17]int8
121319  
121320  func init() {
121321  	crt.Xstrncpy(nil, &_enlargeAndAppendØ00__func__Ø000[0], str(135895), 17)
121322  }
121323  
121324  // C comment
121325  //  /*
121326  //  ** Extra argument values from a PrintfArguments object
121327  //  */
121328  func _getIntArg(tls *crt.TLS, _p *XPrintfArguments) (r0 int64) {
121329  	if _p.XnArg <= _p.XnUsed {
121330  		return 0
121331  	}
121332  	return Xsqlite3_value_int64(tls, *elem19((**XMem)(unsafe.Pointer(_p.XapArg)), uintptr(postInc2(&_p.XnUsed, 1))))
121333  }
121334  
121335  var _sqlite3VXPrintfØ00__func__Ø000 [16]int8
121336  
121337  func init() {
121338  	crt.Xstrncpy(nil, &_sqlite3VXPrintfØ00__func__Ø000[0], str(135912), 16)
121339  }
121340  
121341  var _fmtinfo [23]Xet_info
121342  
121343  func init() {
121344  	_fmtinfo = [23]Xet_info{Xet_info{Xfmttype: int8(100), Xbase: uint8(10), Xflags: uint8(1), Xtype: uint8(16)}, Xet_info{Xfmttype: int8(115), Xflags: uint8(4), Xtype: uint8(5)}, Xet_info{Xfmttype: int8(103), Xflags: uint8(1), Xtype: uint8(3), Xcharset: uint8(30)}, Xet_info{Xfmttype: int8(122), Xflags: uint8(4), Xtype: uint8(6)}, Xet_info{Xfmttype: int8(113), Xflags: uint8(4), Xtype: uint8(9)}, Xet_info{Xfmttype: int8(81), Xflags: uint8(4), Xtype: uint8(10)}, Xet_info{Xfmttype: int8(119), Xflags: uint8(4), Xtype: uint8(14)}, Xet_info{Xfmttype: int8(99), Xtype: uint8(8)}, Xet_info{Xfmttype: int8(111), Xbase: uint8(8), Xprefix: uint8(2)}, Xet_info{Xfmttype: int8(117), Xbase: uint8(10), Xtype: uint8(16)}, Xet_info{Xfmttype: int8(120), Xbase: uint8(16), Xcharset: uint8(16), Xprefix: uint8(1)}, Xet_info{Xfmttype: int8(88), Xbase: uint8(16), Xprefix: uint8(4)}, Xet_info{Xfmttype: int8(102), Xflags: uint8(1), Xtype: uint8(1)}, Xet_info{Xfmttype: int8(101), Xflags: uint8(1), Xtype: uint8(2), Xcharset: uint8(30)}, Xet_info{Xfmttype: int8(69), Xflags: uint8(1), Xtype: uint8(2), Xcharset: uint8(14)}, Xet_info{Xfmttype: int8(71), Xflags: uint8(1), Xtype: uint8(3), Xcharset: uint8(14)}, Xet_info{Xfmttype: int8(105), Xbase: uint8(10), Xflags: uint8(1), Xtype: uint8(16)}, Xet_info{Xfmttype: int8(110), Xtype: uint8(4)}, Xet_info{Xfmttype: int8(37), Xtype: uint8(7)}, Xet_info{Xfmttype: int8(112), Xbase: uint8(16), Xtype: uint8(13), Xprefix: uint8(1)}, Xet_info{Xfmttype: int8(84), Xtype: uint8(11)}, Xet_info{Xfmttype: int8(83), Xtype: uint8(12)}, Xet_info{Xfmttype: int8(114), Xbase: uint8(10), Xflags: uint8(1), Xtype: uint8(15)}}
121345  }
121346  
121347  var _sqlite3VXPrintfØ00zOrdØ001 [9]int8
121348  
121349  func init() {
121350  	crt.Xstrncpy(nil, &_sqlite3VXPrintfØ00zOrdØ001[0], str(135928), 9)
121351  }
121352  
121353  // C comment
121354  //  /*
121355  //  ** The following table is searched linearly, so it is good to put the
121356  //  ** most frequently used conversion types first.
121357  //  */
121358  var _aDigits [33]int8
121359  
121360  func init() {
121361  	crt.Xstrncpy(nil, &_aDigits[0], str(135937), 33)
121362  }
121363  
121364  var _aPrefix [7]int8
121365  
121366  func init() {
121367  	crt.Xstrncpy(nil, &_aPrefix[0], str(135970), 7)
121368  }
121369  
121370  func _getDoubleArg(tls *crt.TLS, _p *XPrintfArguments) (r0 float64) {
121371  	if _p.XnArg <= _p.XnUsed {
121372  		return float64(0)
121373  	}
121374  	return Xsqlite3_value_double(tls, *elem19((**XMem)(unsafe.Pointer(_p.XapArg)), uintptr(postInc2(&_p.XnUsed, 1))))
121375  }
121376  
121377  // C comment
121378  //  /*
121379  //  ** "*val" is a double such that 0.1 <= *val < 10.0
121380  //  ** Return the ascii code for the leading digit of *val, then
121381  //  ** multiply "*val" by 10.0 to renormalize.
121382  //  **
121383  //  ** Example:
121384  //  **     input:     *val = 3.14159
121385  //  **     output:    *val = 1.4159    function return = '3'
121386  //  **
121387  //  ** The counter *cnt is incremented each time.  After counter exceeds
121388  //  ** 16 (the number of significant digits in a 64-bit float) '0' is
121389  //  ** always returned.
121390  //  */
121391  func _et_getdigit(tls *crt.TLS, _val *float64, _cnt *int32) (r0 int8) {
121392  	var _digit int32
121393  	var _d float64
121394  	if (*_cnt) <= int32(0) {
121395  		return int8(48)
121396  	}
121397  	*_cnt -= 1
121398  	_digit = int32(*_val)
121399  	_d = float64(_digit)
121400  	_digit += int32(48)
121401  	*_val = ((*_val) - _d) * float64(10)
121402  	return int8(_digit)
121403  }
121404  
121405  func _getTextArg(tls *crt.TLS, _p *XPrintfArguments) (r0 *int8) {
121406  	if _p.XnArg <= _p.XnUsed {
121407  		return nil
121408  	}
121409  	return (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19((**XMem)(unsafe.Pointer(_p.XapArg)), uintptr(postInc2(&_p.XnUsed, 1))))))
121410  }
121411  
121412  // C comment
121413  //  /*
121414  //  ** Append N copies of character c to the given string buffer.
121415  //  */
121416  func _sqlite3AppendChar(tls *crt.TLS, _p *XStrAccum, _N int32, _c int8) {
121417  	if ((int64(_p.XnChar) + int64(_N)) >= int64(_p.XnAlloc)) && (store2(&_N, _sqlite3StrAccumEnlarge(tls, _p, _N)) <= int32(0)) {
121418  		return
121419  	}
121420  	func() {
121421  		if (_p.XzText == _p.XzBase) != ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
121422  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25886), unsafe.Pointer(&_sqlite3AppendCharØ00__func__Ø000), unsafe.Pointer(str(6455)))
121423  			crt.X__builtin_abort(tls)
121424  		}
121425  	}()
121426  _4:
121427  	if postInc2(&_N, -1) > int32(0) {
121428  		*elem1(_p.XzText, uintptr(postInc34(&_p.XnChar, uint32(1)))) = _c
121429  		goto _4
121430  	}
121431  }
121432  
121433  var _sqlite3AppendCharØ00__func__Ø000 [18]int8
121434  
121435  func init() {
121436  	crt.Xstrncpy(nil, &_sqlite3AppendCharØ00__func__Ø000[0], str(135977), 18)
121437  }
121438  
121439  func _sqlite3IsIdChar(tls *crt.TLS, _c uint8) (r0 int32) {
121440  	return bool2int((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(_c))) & int32(70)) != int32(0))
121441  }
121442  
121443  // C comment
121444  //  /*
121445  //  ** Undo the effects of sqlite3_initialize().  Must not be called while
121446  //  ** there are outstanding database connections or memory allocations or
121447  //  ** while any part of SQLite is otherwise in use in any thread.  This
121448  //  ** routine is not threadsafe.  But it is safe to invoke this routine
121449  //  ** on when SQLite is already shut down.  If SQLite is already shut down
121450  //  ** when this routine is invoked, then this routine is a harmless no-op.
121451  //  */
121452  func Xsqlite3_shutdown(tls *crt.TLS) (r0 int32) {
121453  	if _sqlite3Config.XisInit != 0 {
121454  		Xsqlite3_os_end(tls)
121455  		Xsqlite3_reset_auto_extension(tls)
121456  		_sqlite3Config.XisInit = int32(0)
121457  	}
121458  	if _sqlite3Config.XisPCacheInit != 0 {
121459  		_sqlite3PcacheShutdown(tls)
121460  		_sqlite3Config.XisPCacheInit = int32(0)
121461  	}
121462  	if _sqlite3Config.XisMallocInit != 0 {
121463  		_sqlite3MallocEnd(tls)
121464  		_sqlite3Config.XisMallocInit = int32(0)
121465  		Xsqlite3_data_directory = nil
121466  		bug20530(Xsqlite3_data_directory)
121467  		Xsqlite3_temp_directory = nil
121468  		bug20530(Xsqlite3_temp_directory)
121469  	}
121470  	if _sqlite3Config.XisMutexInit != 0 {
121471  		_sqlite3MutexEnd(tls)
121472  		_sqlite3Config.XisMutexInit = int32(0)
121473  	}
121474  	return int32(0)
121475  }
121476  
121477  // C comment
121478  //  /*
121479  //  ** Shutdown the operating system interface.
121480  //  **
121481  //  ** Some operating systems might need to do some cleanup in this routine,
121482  //  ** to release dynamically allocated objects.  But not on unix.
121483  //  ** This routine is a no-op for unix.
121484  //  */
121485  func Xsqlite3_os_end(tls *crt.TLS) (r0 int32) {
121486  	return int32(0)
121487  }
121488  
121489  func _sqlite3PcacheShutdown(tls *crt.TLS) {
121490  	if (_sqlite3Config.Xpcache2.XxShutdown) != nil {
121491  		(_sqlite3Config.Xpcache2.XxShutdown)(tls, _sqlite3Config.Xpcache2.XpArg)
121492  	}
121493  }
121494  
121495  // C comment
121496  //  /*
121497  //  ** Deinitialize the memory allocation subsystem.
121498  //  */
121499  func _sqlite3MallocEnd(tls *crt.TLS) {
121500  	if (_sqlite3Config.Xm.XxShutdown) != nil {
121501  		(_sqlite3Config.Xm.XxShutdown)(tls, _sqlite3Config.Xm.XpAppData)
121502  	}
121503  	crt.Xmemset(tls, unsafe.Pointer(&_mem0), int32(0), uint64(40))
121504  }
121505  
121506  // C comment
121507  //  /*
121508  //  ** CAPI3REF: Name Of The Folder Holding Database Files
121509  //  **
121510  //  ** ^(If this global variable is made to point to a string which is
121511  //  ** the name of a folder (a.k.a. directory), then all database files
121512  //  ** specified with a relative pathname and created or accessed by
121513  //  ** SQLite when using a built-in windows [sqlite3_vfs | VFS] will be assumed
121514  //  ** to be relative to that directory.)^ ^If this variable is a NULL
121515  //  ** pointer, then SQLite assumes that all database files specified
121516  //  ** with a relative pathname are relative to the current directory
121517  //  ** for the process.  Only the windows VFS makes use of this global
121518  //  ** variable; it is ignored by the unix VFS.
121519  //  **
121520  //  ** Changing the value of this variable while a database connection is
121521  //  ** open can result in a corrupt database.
121522  //  **
121523  //  ** It is not safe to read or modify this variable in more than one
121524  //  ** thread at a time.  It is not safe to read or modify this variable
121525  //  ** if a [database connection] is being used at the same time in a separate
121526  //  ** thread.
121527  //  ** It is intended that this variable be set once
121528  //  ** as part of process initialization and before any SQLite interface
121529  //  ** routines have been called and that this variable remain unchanged
121530  //  ** thereafter.
121531  //  **
121532  //  ** ^The [data_store_directory pragma] may modify this variable and cause
121533  //  ** it to point to memory obtained from [sqlite3_malloc].  ^Furthermore,
121534  //  ** the [data_store_directory pragma] always assumes that any string
121535  //  ** that this variable points to is held in memory obtained from
121536  //  ** [sqlite3_malloc] and the pragma may attempt to free that memory
121537  //  ** using [sqlite3_free].
121538  //  ** Hence, if this variable is modified directly, either it should be
121539  //  ** made NULL or made to point to memory obtained from [sqlite3_malloc]
121540  //  ** or else the use of the [data_store_directory pragma] should be avoided.
121541  //  */
121542  var Xsqlite3_data_directory *int8
121543  
121544  // C comment
121545  //  /*
121546  //  ** Shutdown the mutex system. This call frees resources allocated by
121547  //  ** sqlite3MutexInit().
121548  //  */
121549  func _sqlite3MutexEnd(tls *crt.TLS) (r0 int32) {
121550  	var _rc int32
121551  	_rc = int32(0)
121552  	if (_sqlite3Config.Xmutex.XxMutexEnd) != nil {
121553  		_rc = (_sqlite3Config.Xmutex.XxMutexEnd)(tls)
121554  	}
121555  	_mutexIsInit = int32(0)
121556  	bug20530(_mutexIsInit)
121557  	return _rc
121558  }
121559  
121560  // C comment
121561  //  /*
121562  //  ** This function is now an anachronism. It used to be used to recover from a
121563  //  ** malloc() failure, but SQLite now does this automatically.
121564  //  */
121565  func Xsqlite3_global_recover(tls *crt.TLS) (r0 int32) {
121566  	return int32(0)
121567  }
121568  
121569  // C comment
121570  //  /*
121571  //  ** Deprecated external interface.  It used to set an alarm callback
121572  //  ** that was invoked when memory usage grew too large.  Now it is a
121573  //  ** no-op.
121574  //  */
121575  func Xsqlite3_memory_alarm(tls *crt.TLS, _xCallback func(*crt.TLS, unsafe.Pointer, int64, int32), _pArg unsafe.Pointer, _iThreshold int64) (r0 int32) {
121576  	return int32(0)
121577  }
121578  
121579  // C comment
121580  //  /*
121581  //  ** Enable or disable extension loading.  Extension loading is disabled by
121582  //  ** default so as not to open security holes in older applications.
121583  //  */
121584  func Xsqlite3_enable_load_extension(tls *crt.TLS, _db *Xsqlite3, _onoff int32) (r0 int32) {
121585  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
121586  	if _onoff != 0 {
121587  		_db.Xflags |= int32(12582912)
121588  		goto _1
121589  	}
121590  	_db.Xflags &= int32(-12582913)
121591  _1:
121592  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
121593  	return int32(0)
121594  }
121595  
121596  var Xsqlite3WhereTrace int32
121597  
121598  func bool2int(b bool) int32 {
121599  	if b {
121600  		return 1
121601  	}
121602  	return 0
121603  }
121604  func bug20530(interface{}) {} //TODO remove when https://github.com/golang/go/issues/20530 is fixed.
121605  func init()                { nzf32 *= -1; nzf64 *= -1 }
121606  
121607  var inf = math.Inf(1)
121608  var nzf32 float32 // -0.0
121609  var nzf64 float64 // -0.0
121610  func elem131(a *func(*crt.TLS), index uintptr) *func(*crt.TLS) {
121611  	return (*func(*crt.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121612  }
121613  func elem0(a **int8, index uintptr) **int8 {
121614  	return (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121615  }
121616  func elem65(a **XSubProgram, index uintptr) **XSubProgram {
121617  	return (**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121618  }
121619  func elem28(a **XVTable, index uintptr) **XVTable {
121620  	return (**XVTable)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121621  }
121622  func elem79(a **XVdbeCursor, index uintptr) **XVdbeCursor {
121623  	return (**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121624  }
121625  func elem33(a **XBitvec, index uintptr) **XBitvec {
121626  	return (**XBitvec)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121627  }
121628  func elem30(a **XMemPage, index uintptr) **XMemPage {
121629  	return (**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121630  }
121631  func elem18(a **XFuncDef, index uintptr) **XFuncDef {
121632  	return (**XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121633  }
121634  func elem91(a **XSorterRecord, index uintptr) **XSorterRecord {
121635  	return (**XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121636  }
121637  func elem105(a **XWhereTerm, index uintptr) **XWhereTerm {
121638  	return (**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121639  }
121640  func elem39(a **XPgHdr, index uintptr) **XPgHdr {
121641  	return (**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121642  }
121643  func elem14(a **XPgHdr1, index uintptr) **XPgHdr1 {
121644  	return (**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121645  }
121646  func elem113(a **XWhereLoop, index uintptr) **XWhereLoop {
121647  	return (**XWhereLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121648  }
121649  func elem19(a **XMem, index uintptr) **XMem {
121650  	return (**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121651  }
121652  func elem95(a **TRowSetEntry, index uintptr) **TRowSetEntry {
121653  	return (**TRowSetEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121654  }
121655  func elem123(a **XToken, index uintptr) **XToken {
121656  	return (**XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121657  }
121658  func elem61(a **XTable, index uintptr) **XTable {
121659  	return (**XTable)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121660  }
121661  func elem64(a **XCollSeq, index uintptr) **XCollSeq {
121662  	return (**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121663  }
121664  func elem42(a **XTrigger, index uintptr) **XTrigger {
121665  	return (**XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121666  }
121667  func elem24(a *unsafe.Pointer, index uintptr) *unsafe.Pointer {
121668  	return (*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121669  }
121670  func elem38(a **uint32, index uintptr) **uint32 {
121671  	return (**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121672  }
121673  func elem89(a **uint8, index uintptr) **uint8 {
121674  	return (**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121675  }
121676  func elem49(a *[8]uint8, index uintptr) *[8]uint8 {
121677  	return (*[8]uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121678  }
121679  func elem52(a *int16, index uintptr) *int16 {
121680  	return (*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 2*index))
121681  }
121682  func elem8(a *int32, index uintptr) *int32 {
121683  	return (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121684  }
121685  func elem7(a *int64, index uintptr) *int64 {
121686  	return (*int64)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121687  }
121688  func elem1(a *int8, index uintptr) *int8 {
121689  	return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 1*index))
121690  }
121691  func elem97(a *Tsqlite3_index_constraint_usage, index uintptr) *Tsqlite3_index_constraint_usage {
121692  	return (*Tsqlite3_index_constraint_usage)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121693  }
121694  func elem41(a *T_ht, index uintptr) *T_ht {
121695  	return (*T_ht)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121696  }
121697  func elem21(a *t22, index uintptr) *t22 {
121698  	return (*t22)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121699  }
121700  func elem4(a *Xet_info, index uintptr) *Xet_info {
121701  	return (*Xet_info)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 6*index))
121702  }
121703  func elem124(a *t125, index uintptr) *t125 {
121704  	return (*t125)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 3*index))
121705  }
121706  func elem109(a *Tsqlite3_index_orderby, index uintptr) *Tsqlite3_index_orderby {
121707  	return (*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121708  }
121709  func elem107(a *Tsqlite3_index_constraint, index uintptr) *Tsqlite3_index_constraint {
121710  	return (*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 12*index))
121711  }
121712  func elem116(a *TInLoop, index uintptr) *TInLoop {
121713  	return (*TInLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 12*index))
121714  }
121715  func elem66(a *XTableLock, index uintptr) *XTableLock {
121716  	return (*XTableLock)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 24*index))
121717  }
121718  func elem117(a *t118, index uintptr) *t118 {
121719  	return (*t118)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121720  }
121721  func elem100(a *XWhereLevel, index uintptr) *XWhereLevel {
121722  	return (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 88*index))
121723  }
121724  func elem47(a *TWalSegment, index uintptr) *TWalSegment {
121725  	return (*TWalSegment)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121726  }
121727  func elem32(a *XPagerSavepoint, index uintptr) *XPagerSavepoint {
121728  	return (*XPagerSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 48*index))
121729  }
121730  func elem82(a *XPmaReader, index uintptr) *XPmaReader {
121731  	return (*XPmaReader)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 80*index))
121732  }
121733  func elem71(a *TyColCache, index uintptr) *TyColCache {
121734  	return (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 20*index))
121735  }
121736  func elem134(a *Xsqlite3_vfs, index uintptr) *Xsqlite3_vfs {
121737  	return (*Xsqlite3_vfs)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 168*index))
121738  }
121739  func elem46(a *XWalIndexHdr, index uintptr) *XWalIndexHdr {
121740  	return (*XWalIndexHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 48*index))
121741  }
121742  func elem11(a *Xsqlite3_debug_mutex, index uintptr) *Xsqlite3_debug_mutex {
121743  	return (*Xsqlite3_debug_mutex)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121744  }
121745  func elem54(a *t55, index uintptr) *t55 {
121746  	return (*t55)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 2*index))
121747  }
121748  func elem112(a *XWherePath, index uintptr) *XWherePath {
121749  	return (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121750  }
121751  func elem10(a *Xsqlite3_mutex, index uintptr) *Xsqlite3_mutex {
121752  	return (*Xsqlite3_mutex)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 64*index))
121753  }
121754  func elem17(a *XFuncDef, index uintptr) *XFuncDef {
121755  	return (*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 56*index))
121756  }
121757  func elem108(a *Xsqlite3_index_info, index uintptr) *Xsqlite3_index_info {
121758  	return (*Xsqlite3_index_info)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 96*index))
121759  }
121760  func elem48(a *TSublist, index uintptr) *TSublist {
121761  	return (*TSublist)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121762  }
121763  func elem67(a *XKeyInfo, index uintptr) *XKeyInfo {
121764  	return (*XKeyInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 40*index))
121765  }
121766  func elem130(a *XStat4Accum, index uintptr) *XStat4Accum {
121767  	return (*XStat4Accum)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 88*index))
121768  }
121769  func elem93(a *XMergeEngine, index uintptr) *XMergeEngine {
121770  	return (*XMergeEngine)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121771  }
121772  func elem132(a *t133, index uintptr) *t133 {
121773  	return (*t133)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121774  }
121775  func elem60(a *XExpr, index uintptr) *XExpr {
121776  	return (*XExpr)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 72*index))
121777  }
121778  func elem121(a *XTriggerStep, index uintptr) *XTriggerStep {
121779  	return (*XTriggerStep)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 72*index))
121780  }
121781  func elem63(a *XVdbeOp, index uintptr) *XVdbeOp {
121782  	return (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121783  }
121784  func elem69(a *TAggInfo_func, index uintptr) *TAggInfo_func {
121785  	return (*TAggInfo_func)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 24*index))
121786  }
121787  func elem101(a *XWhereTerm, index uintptr) *XWhereTerm {
121788  	return (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 64*index))
121789  }
121790  func elem59(a *TExprList_item, index uintptr) *TExprList_item {
121791  	return (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121792  }
121793  func elem81(a *XSorterFile, index uintptr) *XSorterFile {
121794  	return (*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121795  }
121796  func elem12(a *XPCache1, index uintptr) *XPCache1 {
121797  	return (*XPCache1)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 80*index))
121798  }
121799  func elem136(a *XunixShmNode, index uintptr) *XunixShmNode {
121800  	return (*XunixShmNode)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 72*index))
121801  }
121802  func elem50(a *XModule, index uintptr) *XModule {
121803  	return (*XModule)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 40*index))
121804  }
121805  func elem9(a *XScratchFreeslot, index uintptr) *XScratchFreeslot {
121806  	return (*XScratchFreeslot)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121807  }
121808  func elem36(a *XPgHdr, index uintptr) *XPgHdr {
121809  	return (*XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 72*index))
121810  }
121811  func elem6(a *TSrcList_item, index uintptr) *TSrcList_item {
121812  	return (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 112*index))
121813  }
121814  func elem68(a *TAggInfo_col, index uintptr) *TAggInfo_col {
121815  	return (*TAggInfo_col)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121816  }
121817  func elem80(a *XSortSubtask, index uintptr) *XSortSubtask {
121818  	return (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 104*index))
121819  }
121820  func elem76(a *XWal, index uintptr) *XWal {
121821  	return (*XWal)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 144*index))
121822  }
121823  func elem13(a *XPgHdr1, index uintptr) *XPgHdr1 {
121824  	return (*XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 56*index))
121825  }
121826  func elem111(a *XWhereOrCost, index uintptr) *XWhereOrCost {
121827  	return (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121828  }
121829  func elem51(a *XyyStackEntry, index uintptr) *XyyStackEntry {
121830  	return (*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121831  }
121832  func elem25(a *XMem, index uintptr) *XMem {
121833  	return (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 72*index))
121834  }
121835  func elem127(a *TOpenMode, index uintptr) *TOpenMode {
121836  	return (*TOpenMode)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121837  }
121838  func elem58(a *XToken, index uintptr) *XToken {
121839  	return (*XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121840  }
121841  func elem27(a *XDb, index uintptr) *XDb {
121842  	return (*XDb)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121843  }
121844  func elem96(a *XPragmaName, index uintptr) *XPragmaName {
121845  	return (*XPragmaName)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121846  }
121847  func elem29(a *XCollSeq, index uintptr) *XCollSeq {
121848  	return (*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 40*index))
121849  }
121850  func elem126(a *TEncName, index uintptr) *TEncName {
121851  	return (*TEncName)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121852  }
121853  func elem44(a *TIdList_item, index uintptr) *TIdList_item {
121854  	return (*TIdList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121855  }
121856  func elem84(a *XSavepoint, index uintptr) *XSavepoint {
121857  	return (*XSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121858  }
121859  func elem45(a *TCte, index uintptr) *TCte {
121860  	return (*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121861  }
121862  func elem135(a *Tunix_syscall, index uintptr) *Tunix_syscall {
121863  	return (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 24*index))
121864  }
121865  func elem43(a *XColumn, index uintptr) *XColumn {
121866  	return (*XColumn)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121867  }
121868  func elem122(a *XTrigger, index uintptr) *XTrigger {
121869  	return (*XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 72*index))
121870  }
121871  func elem128(a *t129, index uintptr) *t129 {
121872  	return (*t129)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121873  }
121874  func elem104(a *TOp2, index uintptr) *TOp2 {
121875  	return (*TOp2)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121876  }
121877  func elem20(a *uint16, index uintptr) *uint16 {
121878  	return (*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 2*index))
121879  }
121880  func elem31(a *uint32, index uintptr) *uint32 {
121881  	return (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121882  }
121883  func elem15(a *uint8, index uintptr) *uint8 {
121884  	return (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 1*index))
121885  }
121886  func postInc52(p **int16, d int) *int16 {
121887  	q := (*uintptr)(unsafe.Pointer(p))
121888  	v := *q
121889  	*q += uintptr(d)
121890  	return (*int16)(unsafe.Pointer(v))
121891  }
121892  func postInc1(p **int8, d int) *int8 {
121893  	q := (*uintptr)(unsafe.Pointer(p))
121894  	v := *q
121895  	*q += uintptr(d)
121896  	return (*int8)(unsafe.Pointer(v))
121897  }
121898  func postInc51(p **XyyStackEntry, d int) *XyyStackEntry {
121899  	q := (*uintptr)(unsafe.Pointer(p))
121900  	v := *q
121901  	*q += uintptr(d)
121902  	return (*XyyStackEntry)(unsafe.Pointer(v))
121903  }
121904  func postInc25(p **XMem, d int) *XMem {
121905  	q := (*uintptr)(unsafe.Pointer(p))
121906  	v := *q
121907  	*q += uintptr(d)
121908  	return (*XMem)(unsafe.Pointer(v))
121909  }
121910  func postInc94(p **TRowSetEntry, d int) *TRowSetEntry {
121911  	q := (*uintptr)(unsafe.Pointer(p))
121912  	v := *q
121913  	*q += uintptr(d)
121914  	return (*TRowSetEntry)(unsafe.Pointer(v))
121915  }
121916  func postInc31(p **uint32, d int) *uint32 {
121917  	q := (*uintptr)(unsafe.Pointer(p))
121918  	v := *q
121919  	*q += uintptr(d)
121920  	return (*uint32)(unsafe.Pointer(v))
121921  }
121922  func postInc15(p **uint8, d int) *uint8 {
121923  	q := (*uintptr)(unsafe.Pointer(p))
121924  	v := *q
121925  	*q += uintptr(d)
121926  	return (*uint8)(unsafe.Pointer(v))
121927  }
121928  func postInc2(p *int32, d int32) int32     { v := *p; *p += d; return v }
121929  func postInc37(p *int64, d int64) int64    { v := *p; *p += d; return v }
121930  func postInc5(p *int8, d int8) int8        { v := *p; *p += d; return v }
121931  func postInc78(p *uint16, d uint16) uint16 { v := *p; *p += d; return v }
121932  func postInc34(p *uint32, d uint32) uint32 { v := *p; *p += d; return v }
121933  func postInc23(p *uint64, d uint64) uint64 { v := *p; *p += d; return v }
121934  func postInc3(p *uint8, d uint8) uint8     { v := *p; *p += d; return v }
121935  func preInc1(p **int8, d int) *int8 {
121936  	q := (*uintptr)(unsafe.Pointer(p))
121937  	v := *q + uintptr(d)
121938  	*q = v
121939  	return (*int8)(unsafe.Pointer(v))
121940  }
121941  func preInc25(p **XMem, d int) *XMem {
121942  	q := (*uintptr)(unsafe.Pointer(p))
121943  	v := *q + uintptr(d)
121944  	*q = v
121945  	return (*XMem)(unsafe.Pointer(v))
121946  }
121947  func preInc15(p **uint8, d int) *uint8 {
121948  	q := (*uintptr)(unsafe.Pointer(p))
121949  	v := *q + uintptr(d)
121950  	*q = v
121951  	return (*uint8)(unsafe.Pointer(v))
121952  }
121953  func preInc26(p *int16, d int16) int16    { v := *p + d; *p = v; return v }
121954  func preInc2(p *int32, d int32) int32     { v := *p + d; *p = v; return v }
121955  func preInc78(p *uint16, d uint16) uint16 { v := *p + d; *p = v; return v }
121956  func preInc34(p *uint32, d uint32) uint32 { v := *p + d; *p = v; return v }
121957  func preInc3(p *uint8, d uint8) uint8     { v := *p + d; *p = v; return v }
121958  func storebits26(p *int16, v int16, m uint64, o uint) int16 {
121959  	*p = *p&^int16(m) | (v << o & int16(m))
121960  	return v
121961  }
121962  func storebits5(p *int8, v int8, m uint64, o uint) int8 {
121963  	*p = *p&^int8(m) | (v << o & int8(m))
121964  	return v
121965  }
121966  func store83(p *func(*crt.TLS, *Xsqlite3_vtab) int32, v func(*crt.TLS, *Xsqlite3_vtab) int32) func(*crt.TLS, *Xsqlite3_vtab) int32 {
121967  	*p = v
121968  	return v
121969  }
121970  func store1(p **int8, v *int8) *int8                                     { *p = v; return v }
121971  func store120(p **XSubProgram, v *XSubProgram) *XSubProgram              { *p = v; return v }
121972  func store88(p **XBtree, v *XBtree) *XBtree                              { *p = v; return v }
121973  func store62(p **TVdbe, v *TVdbe) *TVdbe                                 { *p = v; return v }
121974  func store87(p **XVdbeCursor, v *XVdbeCursor) *XVdbeCursor               { *p = v; return v }
121975  func store86(p **XMemPage, v *XMemPage) *XMemPage                        { *p = v; return v }
121976  func store17(p **XFuncDef, v *XFuncDef) *XFuncDef                        { *p = v; return v }
121977  func store72(p **XExprList, v *XExprList) *XExprList                     { *p = v; return v }
121978  func store67(p **XKeyInfo, v *XKeyInfo) *XKeyInfo                        { *p = v; return v }
121979  func store99(p **XSrcList, v *XSrcList) *XSrcList                        { *p = v; return v }
121980  func store93(p **XMergeEngine, v *XMergeEngine) *XMergeEngine            { *p = v; return v }
121981  func store60(p **XExpr, v *XExpr) *XExpr                                 { *p = v; return v }
121982  func store121(p **XTriggerStep, v *XTriggerStep) *XTriggerStep           { *p = v; return v }
121983  func store63(p **XVdbeOp, v *XVdbeOp) *XVdbeOp                           { *p = v; return v }
121984  func store40(p **Xsqlite3_backup, v *Xsqlite3_backup) *Xsqlite3_backup   { *p = v; return v }
121985  func store98(p **XSelect, v *XSelect) *XSelect                           { *p = v; return v }
121986  func store101(p **XWhereTerm, v *XWhereTerm) *XWhereTerm                 { *p = v; return v }
121987  func store119(p **XFKey, v *XFKey) *XFKey                                { *p = v; return v }
121988  func store85(p **XUnpackedRecord, v *XUnpackedRecord) *XUnpackedRecord   { *p = v; return v }
121989  func store35(p **XFileChunk, v *XFileChunk) *XFileChunk                  { *p = v; return v }
121990  func store9(p **XScratchFreeslot, v *XScratchFreeslot) *XScratchFreeslot { *p = v; return v }
121991  func store36(p **XPgHdr, v *XPgHdr) *XPgHdr                              { *p = v; return v }
121992  func store92(p **XIncrMerger, v *XIncrMerger) *XIncrMerger               { *p = v; return v }
121993  func store13(p **XPgHdr1, v *XPgHdr1) *XPgHdr1                           { *p = v; return v }
121994  func store110(p **XWhereLoop, v *XWhereLoop) *XWhereLoop                 { *p = v; return v }
121995  func store25(p **XMem, v *XMem) *XMem                                    { *p = v; return v }
121996  func store94(p **TRowSetEntry, v *TRowSetEntry) *TRowSetEntry            { *p = v; return v }
121997  func store103(p **XWhereOrInfo, v *XWhereOrInfo) *XWhereOrInfo           { *p = v; return v }
121998  func store74(p **XTable, v *XTable) *XTable                              { *p = v; return v }
121999  func store114(p **XIndex, v *XIndex) *XIndex                             { *p = v; return v }
122000  func store43(p **XColumn, v *XColumn) *XColumn                           { *p = v; return v }
122001  func store16(p *unsafe.Pointer, v unsafe.Pointer) unsafe.Pointer         { *p = v; return v }
122002  func store15(p **uint8, v *uint8) *uint8                                 { *p = v; return v }
122003  func store2(p *int32, v int32) int32                                     { *p = v; return v }
122004  func store37(p *int64, v int64) int64                                    { *p = v; return v }
122005  func store5(p *int8, v int8) int8                                        { *p = v; return v }
122006  func store78(p *uint16, v uint16) uint16                                 { *p = v; return v }
122007  func store34(p *uint32, v uint32) uint32                                 { *p = v; return v }
122008  func store23(p *uint64, v uint64) uint64                                 { *p = v; return v }
122009  func store3(p *uint8, v uint8) uint8                                     { *p = v; return v }
122010  
122011  type Xva_list struct{ X_ t137 } // t138 struct{_ struct{}}
122012  
122013  type TSqlite3Config struct {
122014  	XbMemstat            int32
122015  	XbCoreMutex          int32
122016  	XbFullMutex          int32
122017  	XbOpenUri            int32
122018  	XbUseCis             int32
122019  	XmxStrlen            int32
122020  	XneverCorrupt        int32
122021  	XszLookaside         int32
122022  	XnLookaside          int32
122023  	XnStmtSpill          int32
122024  	Xm                   Xsqlite3_mem_methods
122025  	Xmutex               Xsqlite3_mutex_methods
122026  	Xpcache2             Xsqlite3_pcache_methods2
122027  	XpHeap               unsafe.Pointer
122028  	XnHeap               int32
122029  	XmnReq               int32
122030  	XmxReq               int32
122031  	XszMmap              int64
122032  	XmxMmap              int64
122033  	XpScratch            unsafe.Pointer
122034  	XszScratch           int32
122035  	XnScratch            int32
122036  	XpPage               unsafe.Pointer
122037  	XszPage              int32
122038  	XnPage               int32
122039  	XmxParserStack       int32
122040  	XsharedCacheEnabled  int32
122041  	XszPma               uint32
122042  	XisInit              int32
122043  	XinProgress          int32
122044  	XisMutexInit         int32
122045  	XisMallocInit        int32
122046  	XisPCacheInit        int32
122047  	XnRefInitMutex       int32
122048  	XpInitMutex          unsafe.Pointer
122049  	XxLog                func(*crt.TLS, unsafe.Pointer, int32, *int8)
122050  	XpLogArg             unsafe.Pointer
122051  	XxTestCallback       func(*crt.TLS, int32) int32
122052  	XbLocaltimeFault     int32
122053  	XiOnceResetThreshold int32
122054  } // t139 struct{bMemstat int32,bCoreMutex int32,bFullMutex int32,bOpenUri int32,bUseCis int32,mxStrlen int32,neverCorrupt int32,szLookaside int32,nLookaside int32,nStmtSpill int32,m struct{xMalloc *func(int32)*struct{},xFree *func(*struct{}),xRealloc *func(*struct{},int32)*struct{},xSize *func(*struct{})int32,xRoundup *func(int32)int32,xInit *func(*struct{})int32,xShutdown *func(*struct{}),pAppData *struct{}},mutex struct{xMutexInit *func()int32,xMutexEnd *func()int32,xMutexAlloc *func(int32)*struct{},xMutexFree *func(*struct{}),xMutexEnter *func(*struct{}),xMutexTry *func(*struct{})int32,xMutexLeave *func(*struct{}),xMutexHeld *func(*struct{})int32,xMutexNotheld *func(*struct{})int32},pcache2 struct{iVersion int32,pArg *struct{},xInit *func(*struct{})int32,xShutdown *func(*struct{}),xCreate *func(int32,int32,int32)*struct{},xCachesize *func(*struct{},int32),xPagecount *func(*struct{})int32,xFetch *func(*struct{},uint32,int32)*struct{},xUnpin *func(*struct{},*struct{},int32),xRekey *func(*struct{},*struct{},uint32,uint32),xTruncate *func(*struct{},uint32),xDestroy *func(*struct{}),xShrink *func(*struct{})},pHeap *struct{},nHeap int32,mnReq int32,mxReq int32,szMmap int64,mxMmap int64,pScratch *struct{},szScratch int32,nScratch int32,pPage *struct{},szPage int32,nPage int32,mxParserStack int32,sharedCacheEnabled int32,szPma uint32,isInit int32,inProgress int32,isMutexInit int32,isMallocInit int32,isPCacheInit int32,nRefInitMutex int32,pInitMutex *struct{},xLog *func(*struct{},int32,*int8),pLogArg *struct{},xTestCallback *func(int32)int32,bLocaltimeFault int32,iOnceResetThreshold int32}
122055  
122056  type Xsqlite3_mem_methods struct {
122057  	XxMalloc   func(*crt.TLS, int32) unsafe.Pointer
122058  	XxFree     func(*crt.TLS, unsafe.Pointer)
122059  	XxRealloc  func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
122060  	XxSize     func(*crt.TLS, unsafe.Pointer) int32
122061  	XxRoundup  func(*crt.TLS, int32) int32
122062  	XxInit     func(*crt.TLS, unsafe.Pointer) int32
122063  	XxShutdown func(*crt.TLS, unsafe.Pointer)
122064  	XpAppData  unsafe.Pointer
122065  } // t140 struct{xMalloc *func(int32)*struct{},xFree *func(*struct{}),xRealloc *func(*struct{},int32)*struct{},xSize *func(*struct{})int32,xRoundup *func(int32)int32,xInit *func(*struct{})int32,xShutdown *func(*struct{}),pAppData *struct{}}
122066  
122067  type Xsqlite3_mutex_methods struct {
122068  	XxMutexInit    func(*crt.TLS) int32
122069  	XxMutexEnd     func(*crt.TLS) int32
122070  	XxMutexAlloc   func(*crt.TLS, int32) unsafe.Pointer
122071  	XxMutexFree    func(*crt.TLS, unsafe.Pointer)
122072  	XxMutexEnter   func(*crt.TLS, unsafe.Pointer)
122073  	XxMutexTry     func(*crt.TLS, unsafe.Pointer) int32
122074  	XxMutexLeave   func(*crt.TLS, unsafe.Pointer)
122075  	XxMutexHeld    func(*crt.TLS, unsafe.Pointer) int32
122076  	XxMutexNotheld func(*crt.TLS, unsafe.Pointer) int32
122077  } // t141 struct{xMutexInit *func()int32,xMutexEnd *func()int32,xMutexAlloc *func(int32)*struct{},xMutexFree *func(*struct{}),xMutexEnter *func(*struct{}),xMutexTry *func(*struct{})int32,xMutexLeave *func(*struct{}),xMutexHeld *func(*struct{})int32,xMutexNotheld *func(*struct{})int32}
122078  
122079  type Xsqlite3_pcache_methods2 struct {
122080  	XiVersion   int32
122081  	XpArg       unsafe.Pointer
122082  	XxInit      func(*crt.TLS, unsafe.Pointer) int32
122083  	XxShutdown  func(*crt.TLS, unsafe.Pointer)
122084  	XxCreate    func(*crt.TLS, int32, int32, int32) unsafe.Pointer
122085  	XxCachesize func(*crt.TLS, unsafe.Pointer, int32)
122086  	XxPagecount func(*crt.TLS, unsafe.Pointer) int32
122087  	XxFetch     func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer
122088  	XxUnpin     func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32)
122089  	XxRekey     func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint32, uint32)
122090  	XxTruncate  func(*crt.TLS, unsafe.Pointer, uint32)
122091  	XxDestroy   func(*crt.TLS, unsafe.Pointer)
122092  	XxShrink    func(*crt.TLS, unsafe.Pointer)
122093  } // t142 struct{iVersion int32,pArg *struct{},xInit *func(*struct{})int32,xShutdown *func(*struct{}),xCreate *func(int32,int32,int32)*struct{},xCachesize *func(*struct{},int32),xPagecount *func(*struct{})int32,xFetch *func(*struct{},uint32,int32)*struct{},xUnpin *func(*struct{},*struct{},int32),xRekey *func(*struct{},*struct{},uint32,uint32),xTruncate *func(*struct{},uint32),xDestroy *func(*struct{}),xShrink *func(*struct{})}
122094  
122095  type XFuncDefHash struct{ Xa [23]unsafe.Pointer } // t143 struct{a [23]*struct{}}
122096  
122097  type XToken struct {
122098  	Xz *int8
122099  	Xn uint32
122100  } // t144 struct{z *int8,n uint32}
122101  
122102  type Tsqlite3StatType struct {
122103  	XnowValue [10]int64
122104  	XmxValue  [10]int64
122105  } // t145 struct{nowValue [10]int64,mxValue [10]int64}
122106  
122107  type Xsqlite3_mutex struct {
122108  	Xmutex crt.Xpthread_mutex_t
122109  	Xid    int32
122110  	XnRef  int32
122111  	Xowner uint64
122112  	Xtrace int32
122113  } // t146 struct{mutex union{__data struct{__lock int32,__count uint32,__owner int32,__nusers uint32,__kind int32,__spins int16,__elision int16,__list struct{__prev *struct{},__next *struct{}}},__size [40]int8,__align int64},id int32,nRef int32,owner uint64,trace int32}
122114  
122115  type XHash struct {
122116  	Xhtsize uint32
122117  	Xcount  uint32
122118  	Xfirst  unsafe.Pointer
122119  	Xht     unsafe.Pointer
122120  } // t147 struct{htsize uint32,count uint32,first *struct{},ht *struct{}}
122121  
122122  type XDb struct {
122123  	XzDbSName     *int8
122124  	XpBt          unsafe.Pointer
122125  	Xsafety_level uint8
122126  	XbSyncSet     uint8
122127  	XpSchema      unsafe.Pointer
122128  } // t148 struct{zDbSName *int8,pBt *struct{},safety_level uint8,bSyncSet uint8,pSchema *struct{}}
122129  
122130  type Xsqlite3 struct {
122131  	XpVfs                   unsafe.Pointer
122132  	XpVdbe                  unsafe.Pointer
122133  	XpDfltColl              unsafe.Pointer
122134  	Xmutex                  unsafe.Pointer
122135  	XaDb                    unsafe.Pointer
122136  	XnDb                    int32
122137  	Xflags                  int32
122138  	XlastRowid              int64
122139  	XszMmap                 int64
122140  	XopenFlags              uint32
122141  	XerrCode                int32
122142  	XerrMask                int32
122143  	XiSysErrno              int32
122144  	XdbOptFlags             uint16
122145  	Xenc                    uint8
122146  	XautoCommit             uint8
122147  	Xtemp_store             uint8
122148  	XmallocFailed           uint8
122149  	XbBenignMalloc          uint8
122150  	XdfltLockMode           uint8
122151  	XnextAutovac            int8
122152  	XsuppressErr            uint8
122153  	XvtabOnConflict         uint8
122154  	XisTransactionSavepoint uint8
122155  	XmTrace                 uint8
122156  	XskipBtreeMutex         uint8
122157  	XnSqlExec               uint8
122158  	XnextPagesize           int32
122159  	Xmagic                  uint32
122160  	XnChange                int32
122161  	XnTotalChange           int32
122162  	XaLimit                 [12]int32
122163  	XnMaxSorterMmap         int32
122164  	Xinit                   t149
122165  	XnVdbeActive            int32
122166  	XnVdbeRead              int32
122167  	XnVdbeWrite             int32
122168  	XnVdbeExec              int32
122169  	XnVDestroy              int32
122170  	XnExtension             int32
122171  	XaExtension             *unsafe.Pointer
122172  	XxTrace                 func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32
122173  	XpTraceArg              unsafe.Pointer
122174  	XxProfile               func(*crt.TLS, unsafe.Pointer, *int8, uint64)
122175  	XpProfileArg            unsafe.Pointer
122176  	XpCommitArg             unsafe.Pointer
122177  	XxCommitCallback        func(*crt.TLS, unsafe.Pointer) int32
122178  	XpRollbackArg           unsafe.Pointer
122179  	XxRollbackCallback      func(*crt.TLS, unsafe.Pointer)
122180  	XpUpdateArg             unsafe.Pointer
122181  	XxUpdateCallback        func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64)
122182  	XxWalCallback           func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32
122183  	XpWalArg                unsafe.Pointer
122184  	XxCollNeeded            func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)
122185  	XxCollNeeded16          func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)
122186  	XpCollNeededArg         unsafe.Pointer
122187  	XpErr                   unsafe.Pointer
122188  	Xu1                     t150
122189  	Xlookaside              t151
122190  	XxAuth                  func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
122191  	XpAuthArg               unsafe.Pointer
122192  	XxProgress              func(*crt.TLS, unsafe.Pointer) int32
122193  	XpProgressArg           unsafe.Pointer
122194  	XnProgressOps           uint32
122195  	XnVTrans                int32
122196  	XaModule                XHash
122197  	XpVtabCtx               unsafe.Pointer
122198  	XaVTrans                *unsafe.Pointer
122199  	XpDisconnect            unsafe.Pointer
122200  	XaFunc                  XHash
122201  	XaCollSeq               XHash
122202  	XbusyHandler            t77
122203  	XaDbStatic              [2]XDb
122204  	XpSavepoint             unsafe.Pointer
122205  	XbusyTimeout            int32
122206  	XnSavepoint             int32
122207  	XnStatement             int32
122208  	XnDeferredCons          int64
122209  	XnDeferredImmCons       int64
122210  	XpnBytesFreed           *int32
122211  } // t152 struct{pVfs *struct{},pVdbe *struct{},pDfltColl *struct{},mutex *struct{},aDb *struct{},nDb int32,flags int32,lastRowid int64,szMmap int64,openFlags uint32,errCode int32,errMask int32,iSysErrno int32,dbOptFlags uint16,enc uint8,autoCommit uint8,temp_store uint8,mallocFailed uint8,bBenignMalloc uint8,dfltLockMode uint8,nextAutovac int8,suppressErr uint8,vtabOnConflict uint8,isTransactionSavepoint uint8,mTrace uint8,skipBtreeMutex uint8,nSqlExec uint8,nextPagesize int32,magic uint32,nChange int32,nTotalChange int32,aLimit [12]int32,nMaxSorterMmap int32,init struct{newTnum int32,iDb uint8,busy uint8,orphanTrigger uint8,imposterTable uint8},nVdbeActive int32,nVdbeRead int32,nVdbeWrite int32,nVdbeExec int32,nVDestroy int32,nExtension int32,aExtension **struct{},xTrace *func(uint32,*struct{},*struct{},*struct{})int32,pTraceArg *struct{},xProfile *func(*struct{},*int8,uint64),pProfileArg *struct{},pCommitArg *struct{},xCommitCallback *func(*struct{})int32,pRollbackArg *struct{},xRollbackCallback *func(*struct{}),pUpdateArg *struct{},xUpdateCallback *func(*struct{},int32,*int8,*int8,int64),xWalCallback *func(*struct{},*struct{},*int8,int32)int32,pWalArg *struct{},xCollNeeded *func(*struct{},*struct{},int32,*int8),xCollNeeded16 *func(*struct{},*struct{},int32,*struct{}),pCollNeededArg *struct{},pErr *struct{},u1 union{isInterrupted int32,notUsed1 float64},lookaside struct{bDisable uint32,sz uint16,bMalloced uint8,nOut int32,mxOut int32,anStat [3]int32,pFree *struct{},pStart *struct{},pEnd *struct{}},xAuth *func(*struct{},int32,*int8,*int8,*int8,*int8)int32,pAuthArg *struct{},xProgress *func(*struct{})int32,pProgressArg *struct{},nProgressOps uint32,nVTrans int32,aModule struct{htsize uint32,count uint32,first *struct{},ht *struct{}},pVtabCtx *struct{},aVTrans **struct{},pDisconnect *struct{},aFunc struct{htsize uint32,count uint32,first *struct{},ht *struct{}},aCollSeq struct{htsize uint32,count uint32,first *struct{},ht *struct{}},busyHandler struct{xFunc *func(*struct{},int32)int32,pArg *struct{},nBusy int32},aDbStatic [2]struct{zDbSName *int8,pBt *struct{},safety_level uint8,bSyncSet uint8,pSchema *struct{}},pSavepoint *struct{},busyTimeout int32,nSavepoint int32,nStatement int32,nDeferredCons int64,nDeferredImmCons int64,pnBytesFreed *int32}
122212  
122213  type XBtLock struct {
122214  	XpBtree unsafe.Pointer
122215  	XiTable uint32
122216  	XeLock  uint8
122217  	XpNext  unsafe.Pointer
122218  } // t153 struct{pBtree *struct{},iTable uint32,eLock uint8,pNext *struct{}}
122219  
122220  type XBtree struct {
122221  	Xdb             unsafe.Pointer
122222  	XpBt            unsafe.Pointer
122223  	XinTrans        uint8
122224  	Xsharable       uint8
122225  	Xlocked         uint8
122226  	XhasIncrblobCur uint8
122227  	XwantToLock     int32
122228  	XnBackup        int32
122229  	XiDataVersion   uint32
122230  	XpNext          unsafe.Pointer
122231  	XpPrev          unsafe.Pointer
122232  	Xlock           XBtLock
122233  } // t154 struct{db *struct{},pBt *struct{},inTrans uint8,sharable uint8,locked uint8,hasIncrblobCur uint8,wantToLock int32,nBackup int32,iDataVersion uint32,pNext *struct{},pPrev *struct{},lock struct{pBtree *struct{},iTable uint32,eLock uint8,pNext *struct{}}}
122234  
122235  type XPager struct {
122236  	XpVfs              unsafe.Pointer
122237  	XexclusiveMode     uint8
122238  	XjournalMode       uint8
122239  	XuseJournal        uint8
122240  	XnoSync            uint8
122241  	XfullSync          uint8
122242  	XextraSync         uint8
122243  	XckptSyncFlags     uint8
122244  	XwalSyncFlags      uint8
122245  	XsyncFlags         uint8
122246  	XtempFile          uint8
122247  	XnoLock            uint8
122248  	XreadOnly          uint8
122249  	XmemDb             uint8
122250  	XeState            uint8
122251  	XeLock             uint8
122252  	XchangeCountDone   uint8
122253  	XsetMaster         uint8
122254  	XdoNotSpill        uint8
122255  	XsubjInMemory      uint8
122256  	XbUseFetch         uint8
122257  	XhasHeldSharedLock uint8
122258  	XdbSize            uint32
122259  	XdbOrigSize        uint32
122260  	XdbFileSize        uint32
122261  	XdbHintSize        uint32
122262  	XerrCode           int32
122263  	XnRec              int32
122264  	XcksumInit         uint32
122265  	XnSubRec           uint32
122266  	XpInJournal        unsafe.Pointer
122267  	Xfd                unsafe.Pointer
122268  	Xjfd               unsafe.Pointer
122269  	Xsjfd              unsafe.Pointer
122270  	XjournalOff        int64
122271  	XjournalHdr        int64
122272  	XpBackup           unsafe.Pointer
122273  	XaSavepoint        unsafe.Pointer
122274  	XnSavepoint        int32
122275  	XiDataVersion      uint32
122276  	XdbFileVers        [16]int8
122277  	XnMmapOut          int32
122278  	XszMmap            int64
122279  	XpMmapFreelist     unsafe.Pointer
122280  	XnExtra            uint16
122281  	XnReserve          int16
122282  	XvfsFlags          uint32
122283  	XsectorSize        uint32
122284  	XpageSize          int32
122285  	XmxPgno            uint32
122286  	XjournalSizeLimit  int64
122287  	XzFilename         *int8
122288  	XzJournal          *int8
122289  	XxBusyHandler      func(*crt.TLS, unsafe.Pointer) int32
122290  	XpBusyHandlerArg   unsafe.Pointer
122291  	XaStat             [3]int32
122292  	XxReiniter         func(*crt.TLS, unsafe.Pointer)
122293  	XxGet              func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32
122294  	XpTmpSpace         *int8
122295  	XpPCache           unsafe.Pointer
122296  	XpWal              unsafe.Pointer
122297  	XzWal              *int8
122298  } // t155 struct{pVfs *struct{},exclusiveMode uint8,journalMode uint8,useJournal uint8,noSync uint8,fullSync uint8,extraSync uint8,ckptSyncFlags uint8,walSyncFlags uint8,syncFlags uint8,tempFile uint8,noLock uint8,readOnly uint8,memDb uint8,eState uint8,eLock uint8,changeCountDone uint8,setMaster uint8,doNotSpill uint8,subjInMemory uint8,bUseFetch uint8,hasHeldSharedLock uint8,dbSize uint32,dbOrigSize uint32,dbFileSize uint32,dbHintSize uint32,errCode int32,nRec int32,cksumInit uint32,nSubRec uint32,pInJournal *struct{},fd *struct{},jfd *struct{},sjfd *struct{},journalOff int64,journalHdr int64,pBackup *struct{},aSavepoint *struct{},nSavepoint int32,iDataVersion uint32,dbFileVers [16]int8,nMmapOut int32,szMmap int64,pMmapFreelist *struct{},nExtra uint16,nReserve int16,vfsFlags uint32,sectorSize uint32,pageSize int32,mxPgno uint32,journalSizeLimit int64,zFilename *int8,zJournal *int8,xBusyHandler *func(*struct{})int32,pBusyHandlerArg *struct{},aStat [3]int32,xReiniter *func(*struct{}),xGet *func(*struct{},uint32,**struct{},int32)int32,pTmpSpace *int8,pPCache *struct{},pWal *struct{},zWal *int8}
122299  
122300  type XSchema struct {
122301  	Xschema_cookie int32
122302  	XiGeneration   int32
122303  	XtblHash       XHash
122304  	XidxHash       XHash
122305  	XtrigHash      XHash
122306  	XfkeyHash      XHash
122307  	XpSeqTab       unsafe.Pointer
122308  	Xfile_format   uint8
122309  	Xenc           uint8
122310  	XschemaFlags   uint16
122311  	Xcache_size    int32
122312  } // t156 struct{schema_cookie int32,iGeneration int32,tblHash struct{htsize uint32,count uint32,first *struct{},ht *struct{}},idxHash struct{htsize uint32,count uint32,first *struct{},ht *struct{}},trigHash struct{htsize uint32,count uint32,first *struct{},ht *struct{}},fkeyHash struct{htsize uint32,count uint32,first *struct{},ht *struct{}},pSeqTab *struct{},file_format uint8,enc uint8,schemaFlags uint16,cache_size int32}
122313  
122314  type XHashElem struct {
122315  	Xnext unsafe.Pointer
122316  	Xprev unsafe.Pointer
122317  	Xdata unsafe.Pointer
122318  	XpKey *int8
122319  } // t157 struct{next *struct{},prev *struct{},data *struct{},pKey *int8}
122320  
122321  type T_ht struct {
122322  	Xcount int32
122323  	Xchain unsafe.Pointer
122324  } // t158 struct{count int32,chain *struct{}}
122325  
122326  type XTrigger struct {
122327  	XzName      *int8
122328  	Xtable      *int8
122329  	Xop         uint8
122330  	Xtr_tm      uint8
122331  	XpWhen      unsafe.Pointer
122332  	XpColumns   unsafe.Pointer
122333  	XpSchema    unsafe.Pointer
122334  	XpTabSchema unsafe.Pointer
122335  	Xstep_list  unsafe.Pointer
122336  	XpNext      unsafe.Pointer
122337  } // t159 struct{zName *int8,table *int8,op uint8,tr_tm uint8,pWhen *struct{},pColumns *struct{},pSchema *struct{},pTabSchema *struct{},step_list *struct{},pNext *struct{}}
122338  
122339  type XTable struct {
122340  	XzName        *int8
122341  	XaCol         unsafe.Pointer
122342  	XpIndex       unsafe.Pointer
122343  	XpSelect      unsafe.Pointer
122344  	XpFKey        unsafe.Pointer
122345  	XzColAff      *int8
122346  	XpCheck       unsafe.Pointer
122347  	Xtnum         int32
122348  	XnTabRef      uint32
122349  	XtabFlags     uint32
122350  	XiPKey        int16
122351  	XnCol         int16
122352  	XnRowLogEst   int16
122353  	XszTabRow     int16
122354  	XkeyConf      uint8
122355  	XaddColOffset int32
122356  	XnModuleArg   int32
122357  	XazModuleArg  **int8
122358  	XpVTable      unsafe.Pointer
122359  	XpTrigger     unsafe.Pointer
122360  	XpSchema      unsafe.Pointer
122361  	XpNextZombie  unsafe.Pointer
122362  } // t160 struct{zName *int8,aCol *struct{},pIndex *struct{},pSelect *struct{},pFKey *struct{},zColAff *int8,pCheck *struct{},tnum int32,nTabRef uint32,tabFlags uint32,iPKey int16,nCol int16,nRowLogEst int16,szTabRow int16,keyConf uint8,addColOffset int32,nModuleArg int32,azModuleArg **int8,pVTable *struct{},pTrigger *struct{},pSchema *struct{},pNextZombie *struct{}}
122363  
122364  type TVdbe struct {
122365  	Xdb                 unsafe.Pointer
122366  	XpPrev              unsafe.Pointer
122367  	XpNext              unsafe.Pointer
122368  	XpParse             unsafe.Pointer
122369  	XnVar               int16
122370  	Xmagic              uint32
122371  	XnMem               int32
122372  	XnCursor            int32
122373  	XcacheCtr           uint32
122374  	Xpc                 int32
122375  	Xrc                 int32
122376  	XnChange            int32
122377  	XiStatement         int32
122378  	XiCurrentTime       int64
122379  	XnFkConstraint      int64
122380  	XnStmtDefCons       int64
122381  	XnStmtDefImmCons    int64
122382  	XaOp                unsafe.Pointer
122383  	XaMem               unsafe.Pointer
122384  	XapArg              *unsafe.Pointer
122385  	XaColName           unsafe.Pointer
122386  	XpResultSet         unsafe.Pointer
122387  	XzErrMsg            *int8
122388  	XapCsr              *unsafe.Pointer
122389  	XaVar               unsafe.Pointer
122390  	XpVList             *int32
122391  	XstartTime          int64
122392  	XnOp                int32
122393  	XrcApp              int32
122394  	XnResColumn         uint16
122395  	XerrorAction        uint8
122396  	XminWriteFileFormat uint8
122397  	Xexpired            int16
122398  	XbtreeMask          uint32
122399  	XlockMask           uint32
122400  	XaCounter           [5]uint32
122401  	XzSql               *int8
122402  	XpFree              unsafe.Pointer
122403  	XpFrame             unsafe.Pointer
122404  	XpDelFrame          unsafe.Pointer
122405  	XnFrame             int32
122406  	Xexpmask            uint32
122407  	XpProgram           unsafe.Pointer
122408  	XpAuxData           unsafe.Pointer
122409  } // t161 struct{db *struct{},pPrev *struct{},pNext *struct{},pParse *struct{},nVar int16,magic uint32,nMem int32,nCursor int32,cacheCtr uint32,pc int32,rc int32,nChange int32,iStatement int32,iCurrentTime int64,nFkConstraint int64,nStmtDefCons int64,nStmtDefImmCons int64,aOp *struct{},aMem *struct{},apArg **struct{},aColName *struct{},pResultSet *struct{},zErrMsg *int8,apCsr **struct{},aVar *struct{},pVList *int32,startTime int64,nOp int32,rcApp int32,nResColumn uint16,errorAction uint8,minWriteFileFormat uint8,expired int16,btreeMask uint32,lockMask uint32,aCounter [5]uint32,zSql *int8,pFree *struct{},pFrame *struct{},pDelFrame *struct{},nFrame int32,expmask uint32,pProgram *struct{},pAuxData *struct{}}
122410  
122411  type XDateTime struct {
122412  	XiJD      int64
122413  	XY        int32
122414  	XM        int32
122415  	XD        int32
122416  	Xh        int32
122417  	Xm        int32
122418  	Xtz       int32
122419  	Xs        float64
122420  	XvalidJD  int8
122421  	XrawS     int8
122422  	XvalidYMD int8
122423  	XvalidHMS int8
122424  	XvalidTZ  int8
122425  	XtzSet    int8
122426  	XisError  int8
122427  } // t162 struct{iJD int64,Y int32,M int32,D int32,h int32,m int32,tz int32,s float64,validJD int8,rawS int8,validYMD int8,validHMS int8,validTZ int8,tzSet int8,isError int8}
122428  
122429  type Xsqlite3_context struct {
122430  	XpOut        unsafe.Pointer
122431  	XpFunc       unsafe.Pointer
122432  	XpMem        unsafe.Pointer
122433  	XpVdbe       unsafe.Pointer
122434  	XiOp         int32
122435  	XisError     int32
122436  	XskipFlag    uint8
122437  	XfErrorOrAux uint8
122438  	Xargc        uint8
122439  	Xargv        [1]unsafe.Pointer
122440  } // t163 struct{pOut *struct{},pFunc *struct{},pMem *struct{},pVdbe *struct{},iOp int32,isError int32,skipFlag uint8,fErrorOrAux uint8,argc uint8,argv [1]*struct{}}
122441  
122442  type XMem struct {
122443  	Xu          t164
122444  	Xflags      uint16
122445  	Xenc        uint8
122446  	XeSubtype   uint8
122447  	Xn          int32
122448  	Xz          *int8
122449  	XzMalloc    *int8
122450  	XszMalloc   int32
122451  	XuTemp      uint32
122452  	Xdb         unsafe.Pointer
122453  	XxDel       func(*crt.TLS, unsafe.Pointer)
122454  	XpScopyFrom unsafe.Pointer
122455  	XpFiller    unsafe.Pointer
122456  } // t165 struct{u union{r float64,i int64,nZero int32,pDef *struct{},pRowSet *struct{},pFrame *struct{}},flags uint16,enc uint8,eSubtype uint8,n int32,z *int8,zMalloc *int8,szMalloc int32,uTemp uint32,db *struct{},xDel *func(*struct{}),pScopyFrom *struct{},pFiller *struct{}}
122457  
122458  type XFuncDef struct {
122459  	XnArg      int8
122460  	XfuncFlags uint16
122461  	XpUserData unsafe.Pointer
122462  	XpNext     unsafe.Pointer
122463  	XxSFunc    func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer)
122464  	XxFinalize func(*crt.TLS, unsafe.Pointer)
122465  	XzName     *int8
122466  	Xu         t166
122467  } // t167 struct{nArg int8,funcFlags uint16,pUserData *struct{},pNext *struct{},xSFunc *func(*struct{},int32,**struct{}),xFinalize *func(*struct{}),zName *int8,u union{pHash *struct{},pDestructor *struct{}}}
122468  
122469  type Xsqlite3_file struct{ XpMethods unsafe.Pointer } // t168 struct{pMethods *struct{}}
122470  
122471  type Xsqlite3_io_methods struct {
122472  	XiVersion               int32
122473  	XxClose                 func(*crt.TLS, unsafe.Pointer) int32
122474  	XxRead                  func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32
122475  	XxWrite                 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32
122476  	XxTruncate              func(*crt.TLS, unsafe.Pointer, int64) int32
122477  	XxSync                  func(*crt.TLS, unsafe.Pointer, int32) int32
122478  	XxFileSize              func(*crt.TLS, unsafe.Pointer, *int64) int32
122479  	XxLock                  func(*crt.TLS, unsafe.Pointer, int32) int32
122480  	XxUnlock                func(*crt.TLS, unsafe.Pointer, int32) int32
122481  	XxCheckReservedLock     func(*crt.TLS, unsafe.Pointer, *int32) int32
122482  	XxFileControl           func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32
122483  	XxSectorSize            func(*crt.TLS, unsafe.Pointer) int32
122484  	XxDeviceCharacteristics func(*crt.TLS, unsafe.Pointer) int32
122485  	XxShmMap                func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32
122486  	XxShmLock               func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32
122487  	XxShmBarrier            func(*crt.TLS, unsafe.Pointer)
122488  	XxShmUnmap              func(*crt.TLS, unsafe.Pointer, int32) int32
122489  	XxFetch                 func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32
122490  	XxUnfetch               func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32
122491  } // t169 struct{iVersion int32,xClose *func(*struct{})int32,xRead *func(*struct{},*struct{},int32,int64)int32,xWrite *func(*struct{},*struct{},int32,int64)int32,xTruncate *func(*struct{},int64)int32,xSync *func(*struct{},int32)int32,xFileSize *func(*struct{},*int64)int32,xLock *func(*struct{},int32)int32,xUnlock *func(*struct{},int32)int32,xCheckReservedLock *func(*struct{},*int32)int32,xFileControl *func(*struct{},int32,*struct{})int32,xSectorSize *func(*struct{})int32,xDeviceCharacteristics *func(*struct{})int32,xShmMap *func(*struct{},int32,int32,int32,**struct{})int32,xShmLock *func(*struct{},int32,int32,int32)int32,xShmBarrier *func(*struct{}),xShmUnmap *func(*struct{},int32)int32,xFetch *func(*struct{},int64,int32,**struct{})int32,xUnfetch *func(*struct{},int64,*struct{})int32}
122492  
122493  type Xsqlite3_vfs struct {
122494  	XiVersion          int32
122495  	XszOsFile          int32
122496  	XmxPathname        int32
122497  	XpNext             unsafe.Pointer
122498  	XzName             *int8
122499  	XpAppData          unsafe.Pointer
122500  	XxOpen             func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32
122501  	XxDelete           func(*crt.TLS, unsafe.Pointer, *int8, int32) int32
122502  	XxAccess           func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32
122503  	XxFullPathname     func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32
122504  	XxDlOpen           func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer
122505  	XxDlError          func(*crt.TLS, unsafe.Pointer, int32, *int8)
122506  	XxDlSym            func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS)
122507  	XxDlClose          func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
122508  	XxRandomness       func(*crt.TLS, unsafe.Pointer, int32, *int8) int32
122509  	XxSleep            func(*crt.TLS, unsafe.Pointer, int32) int32
122510  	XxCurrentTime      func(*crt.TLS, unsafe.Pointer, *float64) int32
122511  	XxGetLastError     func(*crt.TLS, unsafe.Pointer, int32, *int8) int32
122512  	XxCurrentTimeInt64 func(*crt.TLS, unsafe.Pointer, *int64) int32
122513  	XxSetSystemCall    func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32
122514  	XxGetSystemCall    func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS)
122515  	XxNextSystemCall   func(*crt.TLS, unsafe.Pointer, *int8) *int8
122516  } // t170 struct{iVersion int32,szOsFile int32,mxPathname int32,pNext *struct{},zName *int8,pAppData *struct{},xOpen *func(*struct{},*int8,*struct{},int32,*int32)int32,xDelete *func(*struct{},*int8,int32)int32,xAccess *func(*struct{},*int8,int32,*int32)int32,xFullPathname *func(*struct{},*int8,int32,*int8)int32,xDlOpen *func(*struct{},*int8)*struct{},xDlError *func(*struct{},int32,*int8),xDlSym *func(*struct{},*struct{},*int8)*func(),xDlClose *func(*struct{},*struct{}),xRandomness *func(*struct{},int32,*int8)int32,xSleep *func(*struct{},int32)int32,xCurrentTime *func(*struct{},*float64)int32,xGetLastError *func(*struct{},int32,*int8)int32,xCurrentTimeInt64 *func(*struct{},*int64)int32,xSetSystemCall *func(*struct{},*int8,*func())int32,xGetSystemCall *func(*struct{},*int8)*func(),xNextSystemCall *func(*struct{},*int8)*int8}
122517  
122518  type TBenignMallocHooks struct {
122519  	XxBenignBegin func(*crt.TLS)
122520  	XxBenignEnd   func(*crt.TLS)
122521  } // t171 struct{xBenignBegin *func(),xBenignEnd *func()}
122522  
122523  type Xsqlite3_debug_mutex struct {
122524  	Xid  int32
122525  	Xcnt int32
122526  } // t172 struct{id int32,cnt int32}
122527  
122528  type TMem0Global struct {
122529  	Xmutex          unsafe.Pointer
122530  	XalarmThreshold int64
122531  	XpScratchEnd    unsafe.Pointer
122532  	XpScratchFree   unsafe.Pointer
122533  	XnScratchFree   uint32
122534  	XnearlyFull     int32
122535  } // t173 struct{mutex *struct{},alarmThreshold int64,pScratchEnd *struct{},pScratchFree *struct{},nScratchFree uint32,nearlyFull int32}
122536  
122537  type XScratchFreeslot struct{ XpNext unsafe.Pointer } // t174 struct{pNext *struct{}}
122538  
122539  type Xet_info struct {
122540  	Xfmttype int8
122541  	Xbase    uint8
122542  	Xflags   uint8
122543  	Xtype    uint8
122544  	Xcharset uint8
122545  	Xprefix  uint8
122546  } // t175 struct{fmttype int8,base uint8,flags uint8,type uint8,charset uint8,prefix uint8}
122547  
122548  type XStrAccum struct {
122549  	Xdb          unsafe.Pointer
122550  	XzBase       *int8
122551  	XzText       *int8
122552  	XnChar       uint32
122553  	XnAlloc      uint32
122554  	XmxAlloc     uint32
122555  	XaccError    uint8
122556  	XprintfFlags uint8
122557  } // t176 struct{db *struct{},zBase *int8,zText *int8,nChar uint32,nAlloc uint32,mxAlloc uint32,accError uint8,printfFlags uint8}
122558  
122559  type XPrintfArguments struct {
122560  	XnArg  int32
122561  	XnUsed int32
122562  	XapArg *unsafe.Pointer
122563  } // t177 struct{nArg int32,nUsed int32,apArg **struct{}}
122564  
122565  type TSrcList_item struct {
122566  	XpSchema     unsafe.Pointer
122567  	XzDatabase   *int8
122568  	XzName       *int8
122569  	XzAlias      *int8
122570  	XpTab        unsafe.Pointer
122571  	XpSelect     unsafe.Pointer
122572  	XaddrFillSub int32
122573  	XregReturn   int32
122574  	XregResult   int32
122575  	Xfg          t178
122576  	XiSelectId   uint8
122577  	XiCursor     int32
122578  	XpOn         unsafe.Pointer
122579  	XpUsing      unsafe.Pointer
122580  	XcolUsed     uint64
122581  	Xu1          t179
122582  	XpIBIndex    unsafe.Pointer
122583  } // t180 struct{pSchema *struct{},zDatabase *int8,zName *int8,zAlias *int8,pTab *struct{},pSelect *struct{},addrFillSub int32,regReturn int32,regResult int32,fg struct{jointype uint8,notIndexed int8},iSelectId uint8,iCursor int32,pOn *struct{},pUsing *struct{},colUsed uint64,u1 union{zIndexedBy *int8,pFuncArg *struct{}},pIBIndex *struct{}}
122584  
122585  type XSrcList struct {
122586  	XnSrc   int32
122587  	XnAlloc uint32
122588  	Xa      [1]TSrcList_item
122589  } // t181 struct{nSrc int32,nAlloc uint32,a [1]struct{pSchema *struct{},zDatabase *int8,zName *int8,zAlias *int8,pTab *struct{},pSelect *struct{},addrFillSub int32,regReturn int32,regResult int32,fg struct{jointype uint8,notIndexed int8},iSelectId uint8,iCursor int32,pOn *struct{},pUsing *struct{},colUsed uint64,u1 union{zIndexedBy *int8,pFuncArg *struct{}},pIBIndex *struct{}}}
122590  
122591  type TCte struct {
122592  	XzName   *int8
122593  	XpCols   unsafe.Pointer
122594  	XpSelect unsafe.Pointer
122595  	XzCteErr *int8
122596  } // t182 struct{zName *int8,pCols *struct{},pSelect *struct{},zCteErr *int8}
122597  
122598  type XWith struct {
122599  	XnCte   int32
122600  	XpOuter unsafe.Pointer
122601  	Xa      [1]TCte
122602  } // t183 struct{nCte int32,pOuter *struct{},a [1]struct{zName *int8,pCols *struct{},pSelect *struct{},zCteErr *int8}}
122603  
122604  type TExprList_item struct {
122605  	XpExpr     unsafe.Pointer
122606  	XzName     *int8
122607  	XzSpan     *int8
122608  	XsortOrder uint8
122609  	Xdone      int8
122610  	Xu         t184
122611  } // t185 struct{pExpr *struct{},zName *int8,zSpan *int8,sortOrder uint8,done int8,u union{x struct{iOrderByCol uint16,iAlias uint16},iConstExprReg int32}}
122612  
122613  type XExprList struct {
122614  	XnExpr  int32
122615  	XnAlloc int32
122616  	Xa      [1]TExprList_item
122617  } // t186 struct{nExpr int32,nAlloc int32,a [1]struct{pExpr *struct{},zName *int8,zSpan *int8,sortOrder uint8,done int8,u union{x struct{iOrderByCol uint16,iAlias uint16},iConstExprReg int32}}}
122618  
122619  type XSelect struct {
122620  	XpEList       unsafe.Pointer
122621  	Xop           uint8
122622  	XnSelectRow   int16
122623  	XselFlags     uint32
122624  	XiLimit       int32
122625  	XiOffset      int32
122626  	XzSelName     [12]int8
122627  	XaddrOpenEphm [2]int32
122628  	XpSrc         unsafe.Pointer
122629  	XpWhere       unsafe.Pointer
122630  	XpGroupBy     unsafe.Pointer
122631  	XpHaving      unsafe.Pointer
122632  	XpOrderBy     unsafe.Pointer
122633  	XpPrior       unsafe.Pointer
122634  	XpNext        unsafe.Pointer
122635  	XpLimit       unsafe.Pointer
122636  	XpOffset      unsafe.Pointer
122637  	XpWith        unsafe.Pointer
122638  } // t187 struct{pEList *struct{},op uint8,nSelectRow int16,selFlags uint32,iLimit int32,iOffset int32,zSelName [12]int8,addrOpenEphm [2]int32,pSrc *struct{},pWhere *struct{},pGroupBy *struct{},pHaving *struct{},pOrderBy *struct{},pPrior *struct{},pNext *struct{},pLimit *struct{},pOffset *struct{},pWith *struct{}}
122639  
122640  type XExpr struct {
122641  	Xop              uint8
122642  	Xaffinity        int8
122643  	Xflags           uint32
122644  	Xu               t188
122645  	XpLeft           unsafe.Pointer
122646  	XpRight          unsafe.Pointer
122647  	Xx               t189
122648  	XnHeight         int32
122649  	XiTable          int32
122650  	XiColumn         int16
122651  	XiAgg            int16
122652  	XiRightJoinTable int16
122653  	Xop2             uint8
122654  	XpAggInfo        unsafe.Pointer
122655  	XpTab            unsafe.Pointer
122656  } // t190 struct{op uint8,affinity int8,flags uint32,u union{zToken *int8,iValue int32},pLeft *struct{},pRight *struct{},x union{pList *struct{},pSelect *struct{}},nHeight int32,iTable int32,iColumn int16,iAgg int16,iRightJoinTable int16,op2 uint8,pAggInfo *struct{},pTab *struct{}}
122657  
122658  type Tsqlite3PrngType struct {
122659  	XisInit uint8
122660  	Xi      uint8
122661  	Xj      uint8
122662  	Xs      [256]uint8
122663  } // t191 struct{isInit uint8,i uint8,j uint8,s [256]uint8}
122664  
122665  type XSQLiteThread struct {
122666  	Xtid   uint64
122667  	Xdone  int32
122668  	XpOut  unsafe.Pointer
122669  	XxTask func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
122670  	XpIn   unsafe.Pointer
122671  } // t192 struct{tid uint64,done int32,pOut *struct{},xTask *func(*struct{})*struct{},pIn *struct{}}
122672  
122673  type XColumn struct {
122674  	XzName    *int8
122675  	XpDflt    unsafe.Pointer
122676  	XzColl    *int8
122677  	XnotNull  uint8
122678  	Xaffinity int8
122679  	XszEst    uint8
122680  	XcolFlags uint8
122681  } // t193 struct{zName *int8,pDflt *struct{},zColl *int8,notNull uint8,affinity int8,szEst uint8,colFlags uint8}
122682  
122683  type TyColCache struct {
122684  	XiTable  int32
122685  	XiColumn int16
122686  	XtempReg uint8
122687  	XiLevel  int32
122688  	XiReg    int32
122689  	Xlru     int32
122690  } // t194 struct{iTable int32,iColumn int16,tempReg uint8,iLevel int32,iReg int32,lru int32}
122691  
122692  type XParse struct {
122693  	Xdb               unsafe.Pointer
122694  	XzErrMsg          *int8
122695  	XpVdbe            unsafe.Pointer
122696  	Xrc               int32
122697  	XcolNamesSet      uint8
122698  	XcheckSchema      uint8
122699  	Xnested           uint8
122700  	XnTempReg         uint8
122701  	XisMultiWrite     uint8
122702  	XmayAbort         uint8
122703  	XhasCompound      uint8
122704  	XokConstFactor    uint8
122705  	XdisableLookaside uint8
122706  	XnColCache        uint8
122707  	XnRangeReg        int32
122708  	XiRangeReg        int32
122709  	XnErr             int32
122710  	XnTab             int32
122711  	XnMem             int32
122712  	XnOpAlloc         int32
122713  	XszOpAlloc        int32
122714  	XckBase           int32
122715  	XiSelfTab         int32
122716  	XiCacheLevel      int32
122717  	XiCacheCnt        int32
122718  	XnLabel           int32
122719  	XaLabel           *int32
122720  	XpConstExpr       unsafe.Pointer
122721  	XconstraintName   XToken
122722  	XwriteMask        uint32
122723  	XcookieMask       uint32
122724  	XregRowid         int32
122725  	XregRoot          int32
122726  	XnMaxArg          int32
122727  	XnSelect          int32
122728  	XnSelectIndent    int32
122729  	XnTableLock       int32
122730  	XaTableLock       unsafe.Pointer
122731  	XpAinc            unsafe.Pointer
122732  	XpToplevel        unsafe.Pointer
122733  	XpTriggerTab      unsafe.Pointer
122734  	XaddrCrTab        int32
122735  	XnQueryLoop       uint32
122736  	Xoldmask          uint32
122737  	Xnewmask          uint32
122738  	XeTriggerOp       uint8
122739  	XeOrconf          uint8
122740  	XdisableTriggers  uint8
122741  	XaColCache        [10]TyColCache
122742  	XaTempReg         [8]int32
122743  	XsNameToken       XToken
122744  	XsLastToken       XToken
122745  	XnVar             int16
122746  	XiPkSortOrder     uint8
122747  	Xexplain          uint8
122748  	XdeclareVtab      uint8
122749  	XnVtabLock        int32
122750  	XnHeight          int32
122751  	XiSelectId        int32
122752  	XiNextSelectId    int32
122753  	XpVList           *int32
122754  	XpReprepare       unsafe.Pointer
122755  	XzTail            *int8
122756  	XpNewTable        unsafe.Pointer
122757  	XpNewTrigger      unsafe.Pointer
122758  	XzAuthContext     *int8
122759  	XsArg             XToken
122760  	XapVtabLock       *unsafe.Pointer
122761  	XpZombieTab       unsafe.Pointer
122762  	XpTriggerPrg      unsafe.Pointer
122763  	XpWith            unsafe.Pointer
122764  	XpWithToFree      unsafe.Pointer
122765  } // t195 struct{db *struct{},zErrMsg *int8,pVdbe *struct{},rc int32,colNamesSet uint8,checkSchema uint8,nested uint8,nTempReg uint8,isMultiWrite uint8,mayAbort uint8,hasCompound uint8,okConstFactor uint8,disableLookaside uint8,nColCache uint8,nRangeReg int32,iRangeReg int32,nErr int32,nTab int32,nMem int32,nOpAlloc int32,szOpAlloc int32,ckBase int32,iSelfTab int32,iCacheLevel int32,iCacheCnt int32,nLabel int32,aLabel *int32,pConstExpr *struct{},constraintName struct{z *int8,n uint32},writeMask uint32,cookieMask uint32,regRowid int32,regRoot int32,nMaxArg int32,nSelect int32,nSelectIndent int32,nTableLock int32,aTableLock *struct{},pAinc *struct{},pToplevel *struct{},pTriggerTab *struct{},addrCrTab int32,nQueryLoop uint32,oldmask uint32,newmask uint32,eTriggerOp uint8,eOrconf uint8,disableTriggers uint8,aColCache [10]struct{iTable int32,iColumn int16,tempReg uint8,iLevel int32,iReg int32,lru int32},aTempReg [8]int32,sNameToken struct{z *int8,n uint32},sLastToken struct{z *int8,n uint32},nVar int16,iPkSortOrder uint8,explain uint8,declareVtab uint8,nVtabLock int32,nHeight int32,iSelectId int32,iNextSelectId int32,pVList *int32,pReprepare *struct{},zTail *int8,pNewTable *struct{},pNewTrigger *struct{},zAuthContext *int8,sArg struct{z *int8,n uint32},apVtabLock **struct{},pZombieTab *struct{},pTriggerPrg *struct{},pWith *struct{},pWithToFree *struct{}}
122766  
122767  type Tunix_syscall struct {
122768  	XzName    *int8
122769  	XpCurrent func(*crt.TLS)
122770  	XpDefault func(*crt.TLS)
122771  } // t196 struct{zName *int8,pCurrent *func(),pDefault *func()}
122772  
122773  type TunixFileId struct {
122774  	Xdev uint64
122775  	Xino uint64
122776  } // t197 struct{dev uint64,ino uint64}
122777  
122778  type XunixInodeInfo struct {
122779  	XfileId       TunixFileId
122780  	XnShared      int32
122781  	XeFileLock    uint8
122782  	XbProcessLock uint8
122783  	XnRef         int32
122784  	XpShmNode     unsafe.Pointer
122785  	XnLock        int32
122786  	XpUnused      unsafe.Pointer
122787  	XpNext        unsafe.Pointer
122788  	XpPrev        unsafe.Pointer
122789  } // t198 struct{fileId struct{dev uint64,ino uint64},nShared int32,eFileLock uint8,bProcessLock uint8,nRef int32,pShmNode *struct{},nLock int32,pUnused *struct{},pNext *struct{},pPrev *struct{}}
122790  
122791  type XunixFile struct {
122792  	XpMethod        unsafe.Pointer
122793  	XpVfs           unsafe.Pointer
122794  	XpInode         unsafe.Pointer
122795  	Xh              int32
122796  	XeFileLock      uint8
122797  	XctrlFlags      uint16
122798  	XlastErrno      int32
122799  	XlockingContext unsafe.Pointer
122800  	XpUnused        unsafe.Pointer
122801  	XzPath          *int8
122802  	XpShm           unsafe.Pointer
122803  	XszChunk        int32
122804  	XnFetchOut      int32
122805  	XmmapSize       int64
122806  	XmmapSizeActual int64
122807  	XmmapSizeMax    int64
122808  	XpMapRegion     unsafe.Pointer
122809  	XtransCntrChng  uint8
122810  	XdbUpdate       uint8
122811  	XinNormalWrite  uint8
122812  } // t199 struct{pMethod *struct{},pVfs *struct{},pInode *struct{},h int32,eFileLock uint8,ctrlFlags uint16,lastErrno int32,lockingContext *struct{},pUnused *struct{},zPath *int8,pShm *struct{},szChunk int32,nFetchOut int32,mmapSize int64,mmapSizeActual int64,mmapSizeMax int64,pMapRegion *struct{},transCntrChng uint8,dbUpdate uint8,inNormalWrite uint8}
122813  
122814  type XUnixUnusedFd struct {
122815  	Xfd    int32
122816  	Xflags int32
122817  	XpNext unsafe.Pointer
122818  } // t200 struct{fd int32,flags int32,pNext *struct{}}
122819  
122820  type XunixShmNode struct {
122821  	XpInode     unsafe.Pointer
122822  	Xmutex      unsafe.Pointer
122823  	XzFilename  *int8
122824  	Xh          int32
122825  	XszRegion   int32
122826  	XnRegion    uint16
122827  	XisReadonly uint8
122828  	XapRegion   **int8
122829  	XnRef       int32
122830  	XpFirst     unsafe.Pointer
122831  	XexclMask   uint8
122832  	XsharedMask uint8
122833  	XnextShmId  uint8
122834  } // t201 struct{pInode *struct{},mutex *struct{},zFilename *int8,h int32,szRegion int32,nRegion uint16,isReadonly uint8,apRegion **int8,nRef int32,pFirst *struct{},exclMask uint8,sharedMask uint8,nextShmId uint8}
122835  
122836  type Tflock struct {
122837  	Xl_type   int16
122838  	Xl_whence int16
122839  	Xl_start  int64
122840  	Xl_len    int64
122841  	Xl_pid    int32
122842  } // t202 struct{l_type int16,l_whence int16,l_start int64,l_len int64,l_pid int32}
122843  
122844  type TunixShm struct {
122845  	XpShmNode   unsafe.Pointer
122846  	XpNext      unsafe.Pointer
122847  	XhasMutex   uint8
122848  	Xid         uint8
122849  	XsharedMask uint16
122850  	XexclMask   uint16
122851  } // t203 struct{pShmNode *struct{},pNext *struct{},hasMutex uint8,id uint8,sharedMask uint16,exclMask uint16}
122852  
122853  type XBitvec struct {
122854  	XiSize    uint32
122855  	XnSet     uint32
122856  	XiDivisor uint32
122857  	Xu        t204
122858  } // t205 struct{iSize uint32,nSet uint32,iDivisor uint32,u union{aBitmap [496]uint8,aHash [124]uint32,apSub [62]*struct{}}}
122859  
122860  type XPgHdr struct {
122861  	XpPage      unsafe.Pointer
122862  	XpData      unsafe.Pointer
122863  	XpExtra     unsafe.Pointer
122864  	XpDirty     unsafe.Pointer
122865  	XpPager     unsafe.Pointer
122866  	Xpgno       uint32
122867  	Xflags      uint16
122868  	XnRef       int16
122869  	XpCache     unsafe.Pointer
122870  	XpDirtyNext unsafe.Pointer
122871  	XpDirtyPrev unsafe.Pointer
122872  } // t206 struct{pPage *struct{},pData *struct{},pExtra *struct{},pDirty *struct{},pPager *struct{},pgno uint32,flags uint16,nRef int16,pCache *struct{},pDirtyNext *struct{},pDirtyPrev *struct{}}
122873  
122874  type XPCache struct {
122875  	XpDirty     unsafe.Pointer
122876  	XpDirtyTail unsafe.Pointer
122877  	XpSynced    unsafe.Pointer
122878  	XnRefSum    int32
122879  	XszCache    int32
122880  	XszSpill    int32
122881  	XszPage     int32
122882  	XszExtra    int32
122883  	XbPurgeable uint8
122884  	XeCreate    uint8
122885  	XxStress    func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
122886  	XpStress    unsafe.Pointer
122887  	XpCache     unsafe.Pointer
122888  } // t207 struct{pDirty *struct{},pDirtyTail *struct{},pSynced *struct{},nRefSum int32,szCache int32,szSpill int32,szPage int32,szExtra int32,bPurgeable uint8,eCreate uint8,xStress *func(*struct{},*struct{})int32,pStress *struct{},pCache *struct{}}
122889  
122890  type Xsqlite3_pcache_page struct {
122891  	XpBuf   unsafe.Pointer
122892  	XpExtra unsafe.Pointer
122893  } // t208 struct{pBuf *struct{},pExtra *struct{}}
122894  
122895  type TPCacheGlobal struct {
122896  	Xgrp            XPGroup
122897  	XisInit         int32
122898  	XseparateCache  int32
122899  	XnInitPage      int32
122900  	XszSlot         int32
122901  	XnSlot          int32
122902  	XnReserve       int32
122903  	XpStart         unsafe.Pointer
122904  	XpEnd           unsafe.Pointer
122905  	Xmutex          unsafe.Pointer
122906  	XpFree          unsafe.Pointer
122907  	XnFreeSlot      int32
122908  	XbUnderPressure int32
122909  } // t209 struct{grp struct{mutex *struct{},nMaxPage uint32,nMinPage uint32,mxPinned uint32,nCurrentPage uint32,lru struct{page struct{pBuf *struct{},pExtra *struct{}},iKey uint32,isPinned uint8,isBulkLocal uint8,isAnchor uint8,pNext *struct{},pCache *struct{},pLruNext *struct{},pLruPrev *struct{}}},isInit int32,separateCache int32,nInitPage int32,szSlot int32,nSlot int32,nReserve int32,pStart *struct{},pEnd *struct{},mutex *struct{},pFree *struct{},nFreeSlot int32,bUnderPressure int32}
122910  
122911  type XPgHdr1 struct {
122912  	Xpage        Xsqlite3_pcache_page
122913  	XiKey        uint32
122914  	XisPinned    uint8
122915  	XisBulkLocal uint8
122916  	XisAnchor    uint8
122917  	XpNext       unsafe.Pointer
122918  	XpCache      unsafe.Pointer
122919  	XpLruNext    unsafe.Pointer
122920  	XpLruPrev    unsafe.Pointer
122921  } // t210 struct{page struct{pBuf *struct{},pExtra *struct{}},iKey uint32,isPinned uint8,isBulkLocal uint8,isAnchor uint8,pNext *struct{},pCache *struct{},pLruNext *struct{},pLruPrev *struct{}}
122922  
122923  type XPGroup struct {
122924  	Xmutex        unsafe.Pointer
122925  	XnMaxPage     uint32
122926  	XnMinPage     uint32
122927  	XmxPinned     uint32
122928  	XnCurrentPage uint32
122929  	Xlru          XPgHdr1
122930  } // t211 struct{mutex *struct{},nMaxPage uint32,nMinPage uint32,mxPinned uint32,nCurrentPage uint32,lru struct{page struct{pBuf *struct{},pExtra *struct{}},iKey uint32,isPinned uint8,isBulkLocal uint8,isAnchor uint8,pNext *struct{},pCache *struct{},pLruNext *struct{},pLruPrev *struct{}}}
122931  
122932  type XPCache1 struct {
122933  	XpGroup      unsafe.Pointer
122934  	XszPage      int32
122935  	XszExtra     int32
122936  	XszAlloc     int32
122937  	XbPurgeable  int32
122938  	XnMin        uint32
122939  	XnMax        uint32
122940  	Xn90pct      uint32
122941  	XiMaxKey     uint32
122942  	XnRecyclable uint32
122943  	XnPage       uint32
122944  	XnHash       uint32
122945  	XapHash      *unsafe.Pointer
122946  	XpFree       unsafe.Pointer
122947  	XpBulk       unsafe.Pointer
122948  } // t212 struct{pGroup *struct{},szPage int32,szExtra int32,szAlloc int32,bPurgeable int32,nMin uint32,nMax uint32,n90pct uint32,iMaxKey uint32,nRecyclable uint32,nPage uint32,nHash uint32,apHash **struct{},pFree *struct{},pBulk *struct{}}
122949  
122950  type XRowSet struct {
122951  	XpChunk  unsafe.Pointer
122952  	Xdb      unsafe.Pointer
122953  	XpEntry  unsafe.Pointer
122954  	XpLast   unsafe.Pointer
122955  	XpFresh  unsafe.Pointer
122956  	XpForest unsafe.Pointer
122957  	XnFresh  uint16
122958  	XrsFlags uint16
122959  	XiBatch  int32
122960  } // t213 struct{pChunk *struct{},db *struct{},pEntry *struct{},pLast *struct{},pFresh *struct{},pForest *struct{},nFresh uint16,rsFlags uint16,iBatch int32}
122961  
122962  type TRowSetEntry struct {
122963  	Xv      int64
122964  	XpRight unsafe.Pointer
122965  	XpLeft  unsafe.Pointer
122966  } // t214 struct{v int64,pRight *struct{},pLeft *struct{}}
122967  
122968  type TRowSetChunk struct {
122969  	XpNextChunk unsafe.Pointer
122970  	XaEntry     [42]TRowSetEntry
122971  } // t215 struct{pNextChunk *struct{},aEntry [42]struct{v int64,pRight *struct{},pLeft *struct{}}}
122972  
122973  type XWalIndexHdr struct {
122974  	XiVersion    uint32
122975  	Xunused      uint32
122976  	XiChange     uint32
122977  	XisInit      uint8
122978  	XbigEndCksum uint8
122979  	XszPage      uint16
122980  	XmxFrame     uint32
122981  	XnPage       uint32
122982  	XaFrameCksum [2]uint32
122983  	XaSalt       [2]uint32
122984  	XaCksum      [2]uint32
122985  } // t216 struct{iVersion uint32,unused uint32,iChange uint32,isInit uint8,bigEndCksum uint8,szPage uint16,mxFrame uint32,nPage uint32,aFrameCksum [2]uint32,aSalt [2]uint32,aCksum [2]uint32}
122986  
122987  type XWal struct {
122988  	XpVfs                unsafe.Pointer
122989  	XpDbFd               unsafe.Pointer
122990  	XpWalFd              unsafe.Pointer
122991  	XiCallback           uint32
122992  	XmxWalSize           int64
122993  	XnWiData             int32
122994  	XszFirstBlock        int32
122995  	XapWiData            **uint32
122996  	XszPage              uint32
122997  	XreadLock            int16
122998  	XsyncFlags           uint8
122999  	XexclusiveMode       uint8
123000  	XwriteLock           uint8
123001  	XckptLock            uint8
123002  	XreadOnly            uint8
123003  	XtruncateOnCommit    uint8
123004  	XsyncHeader          uint8
123005  	XpadToSectorBoundary uint8
123006  	Xhdr                 XWalIndexHdr
123007  	XminFrame            uint32
123008  	XiReCksum            uint32
123009  	XzWalName            *int8
123010  	XnCkpt               uint32
123011  	XlockError           uint8
123012  } // t217 struct{pVfs *struct{},pDbFd *struct{},pWalFd *struct{},iCallback uint32,mxWalSize int64,nWiData int32,szFirstBlock int32,apWiData **uint32,szPage uint32,readLock int16,syncFlags uint8,exclusiveMode uint8,writeLock uint8,ckptLock uint8,readOnly uint8,truncateOnCommit uint8,syncHeader uint8,padToSectorBoundary uint8,hdr struct{iVersion uint32,unused uint32,iChange uint32,isInit uint8,bigEndCksum uint8,szPage uint16,mxFrame uint32,nPage uint32,aFrameCksum [2]uint32,aSalt [2]uint32,aCksum [2]uint32},minFrame uint32,iReCksum uint32,zWalName *int8,nCkpt uint32,lockError uint8}
123013  
123014  type XPagerSavepoint struct {
123015  	XiOffset      int64
123016  	XiHdrOffset   int64
123017  	XpInSavepoint unsafe.Pointer
123018  	XnOrig        uint32
123019  	XiSubRec      uint32
123020  	XaWalData     [4]uint32
123021  } // t218 struct{iOffset int64,iHdrOffset int64,pInSavepoint *struct{},nOrig uint32,iSubRec uint32,aWalData [4]uint32}
123022  
123023  type Xsqlite3_backup struct {
123024  	XpDestDb     unsafe.Pointer
123025  	XpDest       unsafe.Pointer
123026  	XiDestSchema uint32
123027  	XbDestLocked int32
123028  	XiNext       uint32
123029  	XpSrcDb      unsafe.Pointer
123030  	XpSrc        unsafe.Pointer
123031  	Xrc          int32
123032  	XnRemaining  uint32
123033  	XnPagecount  uint32
123034  	XisAttached  int32
123035  	XpNext       unsafe.Pointer
123036  } // t219 struct{pDestDb *struct{},pDest *struct{},iDestSchema uint32,bDestLocked int32,iNext uint32,pSrcDb *struct{},pSrc *struct{},rc int32,nRemaining uint32,nPagecount uint32,isAttached int32,pNext *struct{}}
123037  
123038  type XWalCkptInfo struct {
123039  	XnBackfill          uint32
123040  	XaReadMark          [5]uint32
123041  	XaLock              [8]uint8
123042  	XnBackfillAttempted uint32
123043  	XnotUsed0           uint32
123044  } // t220 struct{nBackfill uint32,aReadMark [5]uint32,aLock [8]uint8,nBackfillAttempted uint32,notUsed0 uint32}
123045  
123046  type TWalSegment struct {
123047  	XiNext  int32
123048  	XaIndex *uint16
123049  	XaPgno  *uint32
123050  	XnEntry int32
123051  	XiZero  int32
123052  } // t221 struct{iNext int32,aIndex *uint16,aPgno *uint32,nEntry int32,iZero int32}
123053  
123054  type XWalIterator struct {
123055  	XiPrior   int32
123056  	XnSegment int32
123057  	XaSegment [1]TWalSegment
123058  } // t222 struct{iPrior int32,nSegment int32,aSegment [1]struct{iNext int32,aIndex *uint16,aPgno *uint32,nEntry int32,iZero int32}}
123059  
123060  type TSublist struct {
123061  	XnList int32
123062  	XaList *uint16
123063  } // t223 struct{nList int32,aList *uint16}
123064  
123065  type XWalWriter struct {
123066  	XpWal       unsafe.Pointer
123067  	XpFd        unsafe.Pointer
123068  	XiSyncPoint int64
123069  	XsyncFlags  int32
123070  	XszPage     int32
123071  } // t224 struct{pWal *struct{},pFd *struct{},iSyncPoint int64,syncFlags int32,szPage int32}
123072  
123073  type XBtShared struct {
123074  	XpPager          unsafe.Pointer
123075  	Xdb              unsafe.Pointer
123076  	XpCursor         unsafe.Pointer
123077  	XpPage1          unsafe.Pointer
123078  	XopenFlags       uint8
123079  	XautoVacuum      uint8
123080  	XincrVacuum      uint8
123081  	XbDoTruncate     uint8
123082  	XinTransaction   uint8
123083  	Xmax1bytePayload uint8
123084  	XbtsFlags        uint16
123085  	XmaxLocal        uint16
123086  	XminLocal        uint16
123087  	XmaxLeaf         uint16
123088  	XminLeaf         uint16
123089  	XpageSize        uint32
123090  	XusableSize      uint32
123091  	XnTransaction    int32
123092  	XnPage           uint32
123093  	XpSchema         unsafe.Pointer
123094  	XxFreeSchema     func(*crt.TLS, unsafe.Pointer)
123095  	Xmutex           unsafe.Pointer
123096  	XpHasContent     unsafe.Pointer
123097  	XnRef            int32
123098  	XpNext           unsafe.Pointer
123099  	XpLock           unsafe.Pointer
123100  	XpWriter         unsafe.Pointer
123101  	XpTmpSpace       *uint8
123102  } // t225 struct{pPager *struct{},db *struct{},pCursor *struct{},pPage1 *struct{},openFlags uint8,autoVacuum uint8,incrVacuum uint8,bDoTruncate uint8,inTransaction uint8,max1bytePayload uint8,btsFlags uint16,maxLocal uint16,minLocal uint16,maxLeaf uint16,minLeaf uint16,pageSize uint32,usableSize uint32,nTransaction int32,nPage uint32,pSchema *struct{},xFreeSchema *func(*struct{}),mutex *struct{},pHasContent *struct{},nRef int32,pNext *struct{},pLock *struct{},pWriter *struct{},pTmpSpace *uint8}
123103  
123104  type XCellInfo struct {
123105  	XnKey     int64
123106  	XpPayload *uint8
123107  	XnPayload uint32
123108  	XnLocal   uint16
123109  	XnSize    uint16
123110  } // t226 struct{nKey int64,pPayload *uint8,nPayload uint32,nLocal uint16,nSize uint16}
123111  
123112  type XBtCursor struct {
123113  	XpBtree        unsafe.Pointer
123114  	XpBt           unsafe.Pointer
123115  	XpNext         unsafe.Pointer
123116  	XaOverflow     *uint32
123117  	Xinfo          XCellInfo
123118  	XnKey          int64
123119  	XpKey          unsafe.Pointer
123120  	XpgnoRoot      uint32
123121  	XnOvflAlloc    int32
123122  	XskipNext      int32
123123  	XcurFlags      uint8
123124  	XcurPagerFlags uint8
123125  	XeState        uint8
123126  	Xhints         uint8
123127  	XiPage         int8
123128  	XcurIntKey     uint8
123129  	Xix            uint16
123130  	XaiIdx         [19]uint16
123131  	XpKeyInfo      unsafe.Pointer
123132  	XapPage        [20]unsafe.Pointer
123133  } // t227 struct{pBtree *struct{},pBt *struct{},pNext *struct{},aOverflow *uint32,info struct{nKey int64,pPayload *uint8,nPayload uint32,nLocal uint16,nSize uint16},nKey int64,pKey *struct{},pgnoRoot uint32,nOvflAlloc int32,skipNext int32,curFlags uint8,curPagerFlags uint8,eState uint8,hints uint8,iPage int8,curIntKey uint8,ix uint16,aiIdx [19]uint16,pKeyInfo *struct{},apPage [20]*struct{}}
123134  
123135  type XIndex struct {
123136  	XzName         *int8
123137  	XaiColumn      *int16
123138  	XaiRowLogEst   *int16
123139  	XpTable        unsafe.Pointer
123140  	XzColAff       *int8
123141  	XpNext         unsafe.Pointer
123142  	XpSchema       unsafe.Pointer
123143  	XaSortOrder    *uint8
123144  	XazColl        **int8
123145  	XpPartIdxWhere unsafe.Pointer
123146  	XaColExpr      unsafe.Pointer
123147  	Xtnum          int32
123148  	XszIdxRow      int16
123149  	XnKeyCol       uint16
123150  	XnColumn       uint16
123151  	XonError       uint8
123152  	XidxType       int8
123153  } // t228 struct{zName *int8,aiColumn *int16,aiRowLogEst *int16,pTable *struct{},zColAff *int8,pNext *struct{},pSchema *struct{},aSortOrder *uint8,azColl **int8,pPartIdxWhere *struct{},aColExpr *struct{},tnum int32,szIdxRow int16,nKeyCol uint16,nColumn uint16,onError uint8,idxType int8}
123154  
123155  type XMemPage struct {
123156  	XisInit          uint8
123157  	XbBusy           uint8
123158  	XintKey          uint8
123159  	XintKeyLeaf      uint8
123160  	Xpgno            uint32
123161  	Xleaf            uint8
123162  	XhdrOffset       uint8
123163  	XchildPtrSize    uint8
123164  	Xmax1bytePayload uint8
123165  	XnOverflow       uint8
123166  	XmaxLocal        uint16
123167  	XminLocal        uint16
123168  	XcellOffset      uint16
123169  	XnFree           uint16
123170  	XnCell           uint16
123171  	XmaskPage        uint16
123172  	XaiOvfl          [4]uint16
123173  	XapOvfl          [4]*uint8
123174  	XpBt             unsafe.Pointer
123175  	XaData           *uint8
123176  	XaDataEnd        *uint8
123177  	XaCellIdx        *uint8
123178  	XaDataOfst       *uint8
123179  	XpDbPage         unsafe.Pointer
123180  	XxCellSize       func(*crt.TLS, unsafe.Pointer, *uint8) uint16
123181  	XxParseCell      func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
123182  } // t229 struct{isInit uint8,bBusy uint8,intKey uint8,intKeyLeaf uint8,pgno uint32,leaf uint8,hdrOffset uint8,childPtrSize uint8,max1bytePayload uint8,nOverflow uint8,maxLocal uint16,minLocal uint16,cellOffset uint16,nFree uint16,nCell uint16,maskPage uint16,aiOvfl [4]uint16,apOvfl [4]*uint8,pBt *struct{},aData *uint8,aDataEnd *uint8,aCellIdx *uint8,aDataOfst *uint8,pDbPage *struct{},xCellSize *func(*struct{},*uint8)uint16,xParseCell *func(*struct{},*uint8,*struct{})}
123183  
123184  type XUnpackedRecord struct {
123185  	XpKeyInfo   unsafe.Pointer
123186  	XaMem       unsafe.Pointer
123187  	XnField     uint16
123188  	Xdefault_rc int8
123189  	XerrCode    uint8
123190  	Xr1         int8
123191  	Xr2         int8
123192  	XeqSeen     uint8
123193  } // t230 struct{pKeyInfo *struct{},aMem *struct{},nField uint16,default_rc int8,errCode uint8,r1 int8,r2 int8,eqSeen uint8}
123194  
123195  type XKeyInfo struct {
123196  	XnRef       uint32
123197  	Xenc        uint8
123198  	XnField     uint16
123199  	XnXField    uint16
123200  	Xdb         unsafe.Pointer
123201  	XaSortOrder *uint8
123202  	XaColl      [1]unsafe.Pointer
123203  } // t231 struct{nRef uint32,enc uint8,nField uint16,nXField uint16,db *struct{},aSortOrder *uint8,aColl [1]*struct{}}
123204  
123205  type XBtreePayload struct {
123206  	XpKey  unsafe.Pointer
123207  	XnKey  int64
123208  	XpData unsafe.Pointer
123209  	XaMem  unsafe.Pointer
123210  	XnMem  uint16
123211  	XnData int32
123212  	XnZero int32
123213  } // t232 struct{pKey *struct{},nKey int64,pData *struct{},aMem *struct{},nMem uint16,nData int32,nZero int32}
123214  
123215  type XCellArray struct {
123216  	XnCell  int32
123217  	XpRef   unsafe.Pointer
123218  	XapCell **uint8
123219  	XszCell *uint16
123220  } // t233 struct{nCell int32,pRef *struct{},apCell **uint8,szCell *uint16}
123221  
123222  type XIntegrityCk struct {
123223  	XpBt          unsafe.Pointer
123224  	XpPager       unsafe.Pointer
123225  	XaPgRef       *uint8
123226  	XnPage        uint32
123227  	XmxErr        int32
123228  	XnErr         int32
123229  	XmallocFailed int32
123230  	XzPfx         *int8
123231  	Xv1           int32
123232  	Xv2           int32
123233  	XerrMsg       XStrAccum
123234  	Xheap         *uint32
123235  } // t234 struct{pBt *struct{},pPager *struct{},aPgRef *uint8,nPage uint32,mxErr int32,nErr int32,mallocFailed int32,zPfx *int8,v1 int32,v2 int32,errMsg struct{db *struct{},zBase *int8,zText *int8,nChar uint32,nAlloc uint32,mxAlloc uint32,accError uint8,printfFlags uint8},heap *uint32}
123236  
123237  type XVdbeFrame struct {
123238  	Xv         unsafe.Pointer
123239  	XpParent   unsafe.Pointer
123240  	XaOp       unsafe.Pointer
123241  	XanExec    *int64
123242  	XaMem      unsafe.Pointer
123243  	XapCsr     *unsafe.Pointer
123244  	XaOnce     *uint8
123245  	Xtoken     unsafe.Pointer
123246  	XlastRowid int64
123247  	XpAuxData  unsafe.Pointer
123248  	XnCursor   int32
123249  	Xpc        int32
123250  	XnOp       int32
123251  	XnMem      int32
123252  	XnChildMem int32
123253  	XnChildCsr int32
123254  	XnChange   int32
123255  	XnDbChange int32
123256  } // t235 struct{v *struct{},pParent *struct{},aOp *struct{},anExec *int64,aMem *struct{},apCsr **struct{},aOnce *uint8,token *struct{},lastRowid int64,pAuxData *struct{},nCursor int32,pc int32,nOp int32,nMem int32,nChildMem int32,nChildCsr int32,nChange int32,nDbChange int32}
123257  
123258  type XVdbeOp struct {
123259  	Xopcode   uint8
123260  	Xp4type   int8
123261  	Xp5       uint16
123262  	Xp1       int32
123263  	Xp2       int32
123264  	Xp3       int32
123265  	Xp4       t236
123266  	XzComment *int8
123267  } // t237 struct{opcode uint8,p4type int8,p5 uint16,p1 int32,p2 int32,p3 int32,p4 union{i int32,p *struct{},z *int8,pI64 *int64,pReal *float64,pFunc *struct{},pCtx *struct{},pColl *struct{},pMem *struct{},pVtab *struct{},pKeyInfo *struct{},ai *int32,pProgram *struct{},pTab *struct{},xAdvance *func(*struct{},*int32)int32},zComment *int8}
123268  
123269  type XVdbeOpIter struct {
123270  	Xv     unsafe.Pointer
123271  	XapSub *unsafe.Pointer
123272  	XnSub  int32
123273  	XiAddr int32
123274  	XiSub  int32
123275  } // t238 struct{v *struct{},apSub **struct{},nSub int32,iAddr int32,iSub int32}
123276  
123277  type XSubProgram struct {
123278  	XaOp   unsafe.Pointer
123279  	XnOp   int32
123280  	XnMem  int32
123281  	XnCsr  int32
123282  	XaOnce *uint8
123283  	Xtoken unsafe.Pointer
123284  	XpNext unsafe.Pointer
123285  } // t239 struct{aOp *struct{},nOp int32,nMem int32,nCsr int32,aOnce *uint8,token *struct{},pNext *struct{}}
123286  
123287  type XVdbeOpList struct {
123288  	Xopcode uint8
123289  	Xp1     int8
123290  	Xp2     int8
123291  	Xp3     int8
123292  } // t240 struct{opcode uint8,p1 int8,p2 int8,p3 int8}
123293  
123294  type XVTable struct {
123295  	Xdb          unsafe.Pointer
123296  	XpMod        unsafe.Pointer
123297  	XpVtab       unsafe.Pointer
123298  	XnRef        int32
123299  	XbConstraint uint8
123300  	XiSavepoint  int32
123301  	XpNext       unsafe.Pointer
123302  } // t241 struct{db *struct{},pMod *struct{},pVtab *struct{},nRef int32,bConstraint uint8,iSavepoint int32,pNext *struct{}}
123303  
123304  type XCollSeq struct {
123305  	XzName *int8
123306  	Xenc   uint8
123307  	XpUser unsafe.Pointer
123308  	XxCmp  func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32
123309  	XxDel  func(*crt.TLS, unsafe.Pointer)
123310  } // t242 struct{zName *int8,enc uint8,pUser *struct{},xCmp *func(*struct{},int32,*struct{},int32,*struct{})int32,xDel *func(*struct{})}
123311  
123312  type Xsqlite3_vtab struct {
123313  	XpModule unsafe.Pointer
123314  	XnRef    int32
123315  	XzErrMsg *int8
123316  } // t243 struct{pModule *struct{},nRef int32,zErrMsg *int8}
123317  
123318  type XVdbeCursor struct {
123319  	XeCurType       uint8
123320  	XiDb            int8
123321  	XnullRow        uint8
123322  	XdeferredMoveto uint8
123323  	XisTable        uint8
123324  	XseekOp         uint8
123325  	XwrFlag         uint8
123326  	XisEphemeral    int8
123327  	XpBtx           unsafe.Pointer
123328  	XseqCount       int64
123329  	XaAltMap        *int32
123330  	XcacheStatus    uint32
123331  	XseekResult     int32
123332  	XpAltCursor     unsafe.Pointer
123333  	Xuc             t244
123334  	XpKeyInfo       unsafe.Pointer
123335  	XiHdrOffset     uint32
123336  	XpgnoRoot       uint32
123337  	XnField         int16
123338  	XnHdrParsed     uint16
123339  	XmovetoTarget   int64
123340  	XaOffset        *uint32
123341  	XaRow           *uint8
123342  	XpayloadSize    uint32
123343  	XszRow          uint32
123344  	XaType          [1]uint32
123345  } // t245 struct{eCurType uint8,iDb int8,nullRow uint8,deferredMoveto uint8,isTable uint8,seekOp uint8,wrFlag uint8,isEphemeral int8,pBtx *struct{},seqCount int64,aAltMap *int32,cacheStatus uint32,seekResult int32,pAltCursor *struct{},uc union{pCursor *struct{},pVCur *struct{},pseudoTableReg int32,pSorter *struct{}},pKeyInfo *struct{},iHdrOffset uint32,pgnoRoot uint32,nField int16,nHdrParsed uint16,movetoTarget int64,aOffset *uint32,aRow *uint8,payloadSize uint32,szRow uint32,aType [1]uint32}
123346  
123347  type XAuxData struct {
123348  	XiAuxOp     int32
123349  	XiAuxArg    int32
123350  	XpAux       unsafe.Pointer
123351  	XxDeleteAux func(*crt.TLS, unsafe.Pointer)
123352  	XpNextAux   unsafe.Pointer
123353  } // t246 struct{iAuxOp int32,iAuxArg int32,pAux *struct{},xDeleteAux *func(*struct{}),pNextAux *struct{}}
123354  
123355  type TReusableSpace struct {
123356  	XpSpace  *uint8
123357  	XnFree   int32
123358  	XnNeeded int32
123359  } // t247 struct{pSpace *uint8,nFree int32,nNeeded int32}
123360  
123361  type Xsqlite3_vtab_cursor struct{ XpVtab unsafe.Pointer } // t248 struct{pVtab *struct{}}
123362  
123363  type Xsqlite3_module struct {
123364  	XiVersion      int32
123365  	XxCreate       func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
123366  	XxConnect      func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
123367  	XxBestIndex    func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
123368  	XxDisconnect   func(*crt.TLS, unsafe.Pointer) int32
123369  	XxDestroy      func(*crt.TLS, unsafe.Pointer) int32
123370  	XxOpen         func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32
123371  	XxClose        func(*crt.TLS, unsafe.Pointer) int32
123372  	XxFilter       func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, *unsafe.Pointer) int32
123373  	XxNext         func(*crt.TLS, unsafe.Pointer) int32
123374  	XxEof          func(*crt.TLS, unsafe.Pointer) int32
123375  	XxColumn       func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) int32
123376  	XxRowid        func(*crt.TLS, unsafe.Pointer, *int64) int32
123377  	XxUpdate       func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32
123378  	XxBegin        func(*crt.TLS, unsafe.Pointer) int32
123379  	XxSync         func(*crt.TLS, unsafe.Pointer) int32
123380  	XxCommit       func(*crt.TLS, unsafe.Pointer) int32
123381  	XxRollback     func(*crt.TLS, unsafe.Pointer) int32
123382  	XxFindFunction func(*crt.TLS, unsafe.Pointer, int32, *int8, *func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), *unsafe.Pointer) int32
123383  	XxRename       func(*crt.TLS, unsafe.Pointer, *int8) int32
123384  	XxSavepoint    func(*crt.TLS, unsafe.Pointer, int32) int32
123385  	XxRelease      func(*crt.TLS, unsafe.Pointer, int32) int32
123386  	XxRollbackTo   func(*crt.TLS, unsafe.Pointer, int32) int32
123387  } // t249 struct{iVersion int32,xCreate *func(*struct{},*struct{},int32,**int8,**struct{},**int8)int32,xConnect *func(*struct{},*struct{},int32,**int8,**struct{},**int8)int32,xBestIndex *func(*struct{},*struct{})int32,xDisconnect *func(*struct{})int32,xDestroy *func(*struct{})int32,xOpen *func(*struct{},**struct{})int32,xClose *func(*struct{})int32,xFilter *func(*struct{},int32,*int8,int32,**struct{})int32,xNext *func(*struct{})int32,xEof *func(*struct{})int32,xColumn *func(*struct{},*struct{},int32)int32,xRowid *func(*struct{},*int64)int32,xUpdate *func(*struct{},int32,**struct{},*int64)int32,xBegin *func(*struct{})int32,xSync *func(*struct{})int32,xCommit *func(*struct{})int32,xRollback *func(*struct{})int32,xFindFunction *func(*struct{},int32,*int8,**func(*struct{},int32,**struct{}),**struct{})int32,xRename *func(*struct{},*int8)int32,xSavepoint *func(*struct{},int32)int32,xRelease *func(*struct{},int32)int32,xRollbackTo *func(*struct{},int32)int32}
123388  
123389  type XSavepoint struct {
123390  	XzName            *int8
123391  	XnDeferredCons    int64
123392  	XnDeferredImmCons int64
123393  	XpNext            unsafe.Pointer
123394  } // t250 struct{zName *int8,nDeferredCons int64,nDeferredImmCons int64,pNext *struct{}}
123395  
123396  type XSorterFile struct {
123397  	XpFd  unsafe.Pointer
123398  	XiEof int64
123399  } // t251 struct{pFd *struct{},iEof int64}
123400  
123401  type XSortSubtask struct {
123402  	XpThread   unsafe.Pointer
123403  	XbDone     int32
123404  	XpSorter   unsafe.Pointer
123405  	XpUnpacked unsafe.Pointer
123406  	Xlist      t90
123407  	XnPMA      int32
123408  	XxCompare  func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32
123409  	Xfile      XSorterFile
123410  	Xfile2     XSorterFile
123411  } // t252 struct{pThread *struct{},bDone int32,pSorter *struct{},pUnpacked *struct{},list struct{pList *struct{},aMemory *uint8,szPMA int32},nPMA int32,xCompare *func(*struct{},*int32,*struct{},int32,*struct{},int32)int32,file struct{pFd *struct{},iEof int64},file2 struct{pFd *struct{},iEof int64}}
123412  
123413  type XVdbeSorter struct {
123414  	XmnPmaSize   int32
123415  	XmxPmaSize   int32
123416  	XmxKeysize   int32
123417  	Xpgsz        int32
123418  	XpReader     unsafe.Pointer
123419  	XpMerger     unsafe.Pointer
123420  	Xdb          unsafe.Pointer
123421  	XpKeyInfo    unsafe.Pointer
123422  	XpUnpacked   unsafe.Pointer
123423  	Xlist        t90
123424  	XiMemory     int32
123425  	XnMemory     int32
123426  	XbUsePMA     uint8
123427  	XbUseThreads uint8
123428  	XiPrev       uint8
123429  	XnTask       uint8
123430  	XtypeMask    uint8
123431  	XaTask       [1]XSortSubtask
123432  } // t253 struct{mnPmaSize int32,mxPmaSize int32,mxKeysize int32,pgsz int32,pReader *struct{},pMerger *struct{},db *struct{},pKeyInfo *struct{},pUnpacked *struct{},list struct{pList *struct{},aMemory *uint8,szPMA int32},iMemory int32,nMemory int32,bUsePMA uint8,bUseThreads uint8,iPrev uint8,nTask uint8,typeMask uint8,aTask [1]struct{pThread *struct{},bDone int32,pSorter *struct{},pUnpacked *struct{},list struct{pList *struct{},aMemory *uint8,szPMA int32},nPMA int32,xCompare *func(*struct{},*int32,*struct{},int32,*struct{},int32)int32,file struct{pFd *struct{},iEof int64},file2 struct{pFd *struct{},iEof int64}}}
123433  
123434  type XInitData struct {
123435  	Xdb       unsafe.Pointer
123436  	XpzErrMsg **int8
123437  	XiDb      int32
123438  	Xrc       int32
123439  } // t254 struct{db *struct{},pzErrMsg **int8,iDb int32,rc int32}
123440  
123441  type XIncrblob struct {
123442  	XnByte   int32
123443  	XiOffset int32
123444  	XiCol    uint16
123445  	XpCsr    unsafe.Pointer
123446  	XpStmt   unsafe.Pointer
123447  	Xdb      unsafe.Pointer
123448  	XzDb     *int8
123449  	XpTab    unsafe.Pointer
123450  } // t255 struct{nByte int32,iOffset int32,iCol uint16,pCsr *struct{},pStmt *struct{},db *struct{},zDb *int8,pTab *struct{}}
123451  
123452  type XFKey struct {
123453  	XpFrom      unsafe.Pointer
123454  	XpNextFrom  unsafe.Pointer
123455  	XzTo        *int8
123456  	XpNextTo    unsafe.Pointer
123457  	XpPrevTo    unsafe.Pointer
123458  	XnCol       int32
123459  	XisDeferred uint8
123460  	XaAction    [2]uint8
123461  	XapTrigger  [2]unsafe.Pointer
123462  	XaCol       [1]t118
123463  } // t256 struct{pFrom *struct{},pNextFrom *struct{},zTo *int8,pNextTo *struct{},pPrevTo *struct{},nCol int32,isDeferred uint8,aAction [2]uint8,apTrigger [2]*struct{},aCol [1]struct{iFrom int32,zCol *int8}}
123464  
123465  type XPmaReader struct {
123466  	XiReadOff int64
123467  	XiEof     int64
123468  	XnAlloc   int32
123469  	XnKey     int32
123470  	XpFd      unsafe.Pointer
123471  	XaAlloc   *uint8
123472  	XaKey     *uint8
123473  	XaBuffer  *uint8
123474  	XnBuffer  int32
123475  	XaMap     *uint8
123476  	XpIncr    unsafe.Pointer
123477  } // t257 struct{iReadOff int64,iEof int64,nAlloc int32,nKey int32,pFd *struct{},aAlloc *uint8,aKey *uint8,aBuffer *uint8,nBuffer int32,aMap *uint8,pIncr *struct{}}
123478  
123479  type XIncrMerger struct {
123480  	XpTask      unsafe.Pointer
123481  	XpMerger    unsafe.Pointer
123482  	XiStartOff  int64
123483  	XmxSz       int32
123484  	XbEof       int32
123485  	XbUseThread int32
123486  	XaFile      [2]XSorterFile
123487  } // t258 struct{pTask *struct{},pMerger *struct{},iStartOff int64,mxSz int32,bEof int32,bUseThread int32,aFile [2]struct{pFd *struct{},iEof int64}}
123488  
123489  type XSorterRecord struct {
123490  	XnVal int32
123491  	Xu    t259
123492  } // t260 struct{nVal int32,u union{pNext *struct{},iNext int32}}
123493  
123494  type XMergeEngine struct {
123495  	XnTree  int32
123496  	XpTask  unsafe.Pointer
123497  	XaTree  *int32
123498  	XaReadr unsafe.Pointer
123499  } // t261 struct{nTree int32,pTask *struct{},aTree *int32,aReadr *struct{}}
123500  
123501  type XPmaWriter struct {
123502  	XeFWErr    int32
123503  	XaBuffer   *uint8
123504  	XnBuffer   int32
123505  	XiBufStart int32
123506  	XiBufEnd   int32
123507  	XiWriteOff int64
123508  	XpFd       unsafe.Pointer
123509  } // t262 struct{eFWErr int32,aBuffer *uint8,nBuffer int32,iBufStart int32,iBufEnd int32,iWriteOff int64,pFd *struct{}}
123510  
123511  type XMemJournal struct {
123512  	XpMethod    unsafe.Pointer
123513  	XnChunkSize int32
123514  	XnSpill     int32
123515  	XnSize      int32
123516  	XpFirst     unsafe.Pointer
123517  	Xendpoint   t263
123518  	Xreadpoint  t263
123519  	Xflags      int32
123520  	XpVfs       unsafe.Pointer
123521  	XzJournal   *int8
123522  } // t264 struct{pMethod *struct{},nChunkSize int32,nSpill int32,nSize int32,pFirst *struct{},endpoint struct{iOffset int64,pChunk *struct{}},readpoint struct{iOffset int64,pChunk *struct{}},flags int32,pVfs *struct{},zJournal *int8}
123523  
123524  type XFileChunk struct {
123525  	XpNext  unsafe.Pointer
123526  	XzChunk [8]uint8
123527  } // t265 struct{pNext *struct{},zChunk [8]uint8}
123528  
123529  type XWalker struct {
123530  	XpParse           unsafe.Pointer
123531  	XxExprCallback    func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
123532  	XxSelectCallback  func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
123533  	XxSelectCallback2 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
123534  	XwalkerDepth      int32
123535  	XeCode            uint8
123536  	Xu                t266
123537  } // t267 struct{pParse *struct{},xExprCallback *func(*struct{},*struct{})int32,xSelectCallback *func(*struct{},*struct{})int32,xSelectCallback2 *func(*struct{},*struct{}),walkerDepth int32,eCode uint8,u union{pNC *struct{},n int32,iCur int32,pSrcList *struct{},pSrcCount *struct{},pCCurHint *struct{},aiCol *int32,pIdxCover *struct{},pIdxTrans *struct{},pGroupBy *struct{},pHavingCtx *struct{}}}
123538  
123539  type XIdList struct {
123540  	Xa   unsafe.Pointer
123541  	XnId int32
123542  } // t268 struct{a *struct{},nId int32}
123543  
123544  type TIdList_item struct {
123545  	XzName *int8
123546  	Xidx   int32
123547  } // t269 struct{zName *int8,idx int32}
123548  
123549  type XNameContext struct {
123550  	XpParse   unsafe.Pointer
123551  	XpSrcList unsafe.Pointer
123552  	XpEList   unsafe.Pointer
123553  	XpAggInfo unsafe.Pointer
123554  	XpNext    unsafe.Pointer
123555  	XnRef     int32
123556  	XnErr     int32
123557  	XncFlags  uint16
123558  } // t270 struct{pParse *struct{},pSrcList *struct{},pEList *struct{},pAggInfo *struct{},pNext *struct{},nRef int32,nErr int32,ncFlags uint16}
123559  
123560  type XExprSpan struct {
123561  	XpExpr  unsafe.Pointer
123562  	XzStart *int8
123563  	XzEnd   *int8
123564  } // t271 struct{pExpr *struct{},zStart *int8,zEnd *int8}
123565  
123566  type XSelectDest struct {
123567  	XeDest    uint8
123568  	XzAffSdst *int8
123569  	XiSDParm  int32
123570  	XiSdst    int32
123571  	XnSdst    int32
123572  	XpOrderBy unsafe.Pointer
123573  } // t272 struct{eDest uint8,zAffSdst *int8,iSDParm int32,iSdst int32,nSdst int32,pOrderBy *struct{}}
123574  
123575  type XAggInfo struct {
123576  	XdirectMode     uint8
123577  	XuseSortingIdx  uint8
123578  	XsortingIdx     int32
123579  	XsortingIdxPTab int32
123580  	XnSortingColumn int32
123581  	XmnReg          int32
123582  	XmxReg          int32
123583  	XpGroupBy       unsafe.Pointer
123584  	XaCol           unsafe.Pointer
123585  	XnColumn        int32
123586  	XnAccumulator   int32
123587  	XaFunc          unsafe.Pointer
123588  	XnFunc          int32
123589  } // t273 struct{directMode uint8,useSortingIdx uint8,sortingIdx int32,sortingIdxPTab int32,nSortingColumn int32,mnReg int32,mxReg int32,pGroupBy *struct{},aCol *struct{},nColumn int32,nAccumulator int32,aFunc *struct{},nFunc int32}
123590  
123591  type TAggInfo_col struct {
123592  	XpTab          unsafe.Pointer
123593  	XiTable        int32
123594  	XiColumn       int32
123595  	XiSorterColumn int32
123596  	XiMem          int32
123597  	XpExpr         unsafe.Pointer
123598  } // t274 struct{pTab *struct{},iTable int32,iColumn int32,iSorterColumn int32,iMem int32,pExpr *struct{}}
123599  
123600  type TAggInfo_func struct {
123601  	XpExpr     unsafe.Pointer
123602  	XpFunc     unsafe.Pointer
123603  	XiMem      int32
123604  	XiDistinct int32
123605  } // t275 struct{pExpr *struct{},pFunc *struct{},iMem int32,iDistinct int32}
123606  
123607  type TIdxCover struct {
123608  	XpIdx unsafe.Pointer
123609  	XiCur int32
123610  } // t276 struct{pIdx *struct{},iCur int32}
123611  
123612  type TSrcCount struct {
123613  	XpSrc   unsafe.Pointer
123614  	XnThis  int32
123615  	XnOther int32
123616  } // t277 struct{pSrc *struct{},nThis int32,nOther int32}
123617  
123618  type XStat4Accum struct {
123619  	XnRow       uint32
123620  	XnPSample   uint32
123621  	XnCol       int32
123622  	XnKeyCol    int32
123623  	XmxSample   int32
123624  	Xcurrent    t278
123625  	XiPrn       uint32
123626  	XaBest      unsafe.Pointer
123627  	XiMin       int32
123628  	XnSample    int32
123629  	XnMaxEqZero int32
123630  	XiGet       int32
123631  	Xa          unsafe.Pointer
123632  	Xdb         unsafe.Pointer
123633  } // t279 struct{nRow uint32,nPSample uint32,nCol int32,nKeyCol int32,mxSample int32,current struct{anEq *uint32,anDLt *uint32},iPrn uint32,aBest *struct{},iMin int32,nSample int32,nMaxEqZero int32,iGet int32,a *struct{},db *struct{}}
123634  
123635  type XanalysisInfo struct {
123636  	Xdb        unsafe.Pointer
123637  	XzDatabase *int8
123638  } // t280 struct{db *struct{},zDatabase *int8}
123639  
123640  type XDbFixer struct {
123641  	XpParse   unsafe.Pointer
123642  	XpSchema  unsafe.Pointer
123643  	XbVarOnly int32
123644  	XzDb      *int8
123645  	XzType    *int8
123646  	XpName    unsafe.Pointer
123647  } // t281 struct{pParse *struct{},pSchema *struct{},bVarOnly int32,zDb *int8,zType *int8,pName *struct{}}
123648  
123649  type XTriggerStep struct {
123650  	Xop        uint8
123651  	Xorconf    uint8
123652  	XpTrig     unsafe.Pointer
123653  	XpSelect   unsafe.Pointer
123654  	XzTarget   *int8
123655  	XpWhere    unsafe.Pointer
123656  	XpExprList unsafe.Pointer
123657  	XpIdList   unsafe.Pointer
123658  	XpNext     unsafe.Pointer
123659  	XpLast     unsafe.Pointer
123660  } // t282 struct{op uint8,orconf uint8,pTrig *struct{},pSelect *struct{},zTarget *int8,pWhere *struct{},pExprList *struct{},pIdList *struct{},pNext *struct{},pLast *struct{}}
123661  
123662  type XAuthContext struct {
123663  	XzAuthContext *int8
123664  	XpParse       unsafe.Pointer
123665  } // t283 struct{zAuthContext *int8,pParse *struct{}}
123666  
123667  type XTableLock struct {
123668  	XiDb         int32
123669  	XiTab        int32
123670  	XisWriteLock uint8
123671  	XzLockName   *int8
123672  } // t284 struct{iDb int32,iTab int32,isWriteLock uint8,zLockName *int8}
123673  
123674  type XAutoincInfo struct {
123675  	XpNext  unsafe.Pointer
123676  	XpTab   unsafe.Pointer
123677  	XiDb    int32
123678  	XregCtr int32
123679  } // t285 struct{pNext *struct{},pTab *struct{},iDb int32,regCtr int32}
123680  
123681  type XModule struct {
123682  	XpModule  unsafe.Pointer
123683  	XzName    *int8
123684  	XpAux     unsafe.Pointer
123685  	XxDestroy func(*crt.TLS, unsafe.Pointer)
123686  	XpEpoTab  unsafe.Pointer
123687  } // t286 struct{pModule *struct{},zName *int8,pAux *struct{},xDestroy *func(*struct{}),pEpoTab *struct{}}
123688  
123689  type XWhereTerm struct {
123690  	XpExpr       unsafe.Pointer
123691  	XpWC         unsafe.Pointer
123692  	XtruthProb   int16
123693  	XwtFlags     uint16
123694  	XeOperator   uint16
123695  	XnChild      uint8
123696  	XeMatchOp    uint8
123697  	XiParent     int32
123698  	XleftCursor  int32
123699  	XiField      int32
123700  	Xu           t287
123701  	XprereqRight uint64
123702  	XprereqAll   uint64
123703  } // t288 struct{pExpr *struct{},pWC *struct{},truthProb int16,wtFlags uint16,eOperator uint16,nChild uint8,eMatchOp uint8,iParent int32,leftCursor int32,iField int32,u union{leftColumn int32,pOrInfo *struct{},pAndInfo *struct{}},prereqRight uint64,prereqAll uint64}
123704  
123705  type XWhereClause struct {
123706  	XpWInfo  unsafe.Pointer
123707  	XpOuter  unsafe.Pointer
123708  	Xop      uint8
123709  	XnTerm   int32
123710  	XnSlot   int32
123711  	Xa       unsafe.Pointer
123712  	XaStatic [8]XWhereTerm
123713  } // t289 struct{pWInfo *struct{},pOuter *struct{},op uint8,nTerm int32,nSlot int32,a *struct{},aStatic [8]struct{pExpr *struct{},pWC *struct{},truthProb int16,wtFlags uint16,eOperator uint16,nChild uint8,eMatchOp uint8,iParent int32,leftCursor int32,iField int32,u union{leftColumn int32,pOrInfo *struct{},pAndInfo *struct{}},prereqRight uint64,prereqAll uint64}}
123714  
123715  type XWhereMaskSet struct {
123716  	Xn  int32
123717  	Xix [64]int32
123718  } // t290 struct{n int32,ix [64]int32}
123719  
123720  type XWhereLevel struct {
123721  	XiLeftJoin    int32
123722  	XiTabCur      int32
123723  	XiIdxCur      int32
123724  	XaddrBrk      int32
123725  	XaddrNxt      int32
123726  	XaddrSkip     int32
123727  	XaddrCont     int32
123728  	XaddrFirst    int32
123729  	XaddrBody     int32
123730  	XiLikeRepCntr uint32
123731  	XaddrLikeRep  int32
123732  	XiFrom        uint8
123733  	Xop           uint8
123734  	Xp3           uint8
123735  	Xp5           uint8
123736  	Xp1           int32
123737  	Xp2           int32
123738  	Xu            t291
123739  	XpWLoop       unsafe.Pointer
123740  	XnotReady     uint64
123741  } // t292 struct{iLeftJoin int32,iTabCur int32,iIdxCur int32,addrBrk int32,addrNxt int32,addrSkip int32,addrCont int32,addrFirst int32,addrBody int32,iLikeRepCntr uint32,addrLikeRep int32,iFrom uint8,op uint8,p3 uint8,p5 uint8,p1 int32,p2 int32,u union{in struct{nIn int32,aInLoop *struct{}},pCovidx *struct{}},pWLoop *struct{},notReady uint64}
123742  
123743  type XWhereInfo struct {
123744  	XpParse            unsafe.Pointer
123745  	XpTabList          unsafe.Pointer
123746  	XpOrderBy          unsafe.Pointer
123747  	XpResultSet        unsafe.Pointer
123748  	XpWhere            unsafe.Pointer
123749  	XiLimit            int16
123750  	XaiCurOnePass      [2]int32
123751  	XiContinue         int32
123752  	XiBreak            int32
123753  	XsavedNQueryLoop   int32
123754  	XwctrlFlags        uint16
123755  	XnLevel            uint8
123756  	XnOBSat            int8
123757  	Xsorted            uint8
123758  	XeOnePass          uint8
123759  	XuntestedTerms     uint8
123760  	XeDistinct         uint8
123761  	XbOrderedInnerLoop uint8
123762  	XiTop              int32
123763  	XpLoops            unsafe.Pointer
123764  	XrevMask           uint64
123765  	XnRowOut           int16
123766  	XsWC               XWhereClause
123767  	XsMaskSet          XWhereMaskSet
123768  	Xa                 [1]XWhereLevel
123769  } // t293 struct{pParse *struct{},pTabList *struct{},pOrderBy *struct{},pResultSet *struct{},pWhere *struct{},iLimit int16,aiCurOnePass [2]int32,iContinue int32,iBreak int32,savedNQueryLoop int32,wctrlFlags uint16,nLevel uint8,nOBSat int8,sorted uint8,eOnePass uint8,untestedTerms uint8,eDistinct uint8,bOrderedInnerLoop uint8,iTop int32,pLoops *struct{},revMask uint64,nRowOut int16,sWC struct{pWInfo *struct{},pOuter *struct{},op uint8,nTerm int32,nSlot int32,a *struct{},aStatic [8]struct{pExpr *struct{},pWC *struct{},truthProb int16,wtFlags uint16,eOperator uint16,nChild uint8,eMatchOp uint8,iParent int32,leftCursor int32,iField int32,u union{leftColumn int32,pOrInfo *struct{},pAndInfo *struct{}},prereqRight uint64,prereqAll uint64}},sMaskSet struct{n int32,ix [64]int32},a [1]struct{iLeftJoin int32,iTabCur int32,iIdxCur int32,addrBrk int32,addrNxt int32,addrSkip int32,addrCont int32,addrFirst int32,addrBody int32,iLikeRepCntr uint32,addrLikeRep int32,iFrom uint8,op uint8,p3 uint8,p5 uint8,p1 int32,p2 int32,u union{in struct{nIn int32,aInLoop *struct{}},pCovidx *struct{}},pWLoop *struct{},notReady uint64}}
123770  
123771  type TcompareInfo struct {
123772  	XmatchAll uint8
123773  	XmatchOne uint8
123774  	XmatchSet uint8
123775  	XnoCase   uint8
123776  } // t294 struct{matchAll uint8,matchOne uint8,matchSet uint8,noCase uint8}
123777  
123778  type XSumCtx struct {
123779  	XrSum     float64
123780  	XiSum     int64
123781  	Xcnt      int64
123782  	Xoverflow uint8
123783  	Xapprox   uint8
123784  } // t295 struct{rSum float64,iSum int64,cnt int64,overflow uint8,approx uint8}
123785  
123786  type XCountCtx struct{ Xn int64 } // t296 struct{n int64}
123787  
123788  type XFuncDestructor struct {
123789  	XnRef      int32
123790  	XxDestroy  func(*crt.TLS, unsafe.Pointer)
123791  	XpUserData unsafe.Pointer
123792  } // t297 struct{nRef int32,xDestroy *func(*struct{}),pUserData *struct{}}
123793  
123794  type XTriggerPrg struct {
123795  	XpTrigger unsafe.Pointer
123796  	XpNext    unsafe.Pointer
123797  	XpProgram unsafe.Pointer
123798  	Xorconf   int32
123799  	XaColmask [2]uint32
123800  } // t298 struct{pTrigger *struct{},pNext *struct{},pProgram *struct{},orconf int32,aColmask [2]uint32}
123801  
123802  type Xsqlite3_api_routines struct {
123803  	Xaggregate_context      func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123804  	Xaggregate_count        func(*crt.TLS, unsafe.Pointer) int32
123805  	Xbind_blob              func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)) int32
123806  	Xbind_double            func(*crt.TLS, unsafe.Pointer, int32, float64) int32
123807  	Xbind_int               func(*crt.TLS, unsafe.Pointer, int32, int32) int32
123808  	Xbind_int64             func(*crt.TLS, unsafe.Pointer, int32, int64) int32
123809  	Xbind_null              func(*crt.TLS, unsafe.Pointer, int32) int32
123810  	Xbind_parameter_count   func(*crt.TLS, unsafe.Pointer) int32
123811  	Xbind_parameter_index   func(*crt.TLS, unsafe.Pointer, *int8) int32
123812  	Xbind_parameter_name    func(*crt.TLS, unsafe.Pointer, int32) *int8
123813  	Xbind_text              func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, func(*crt.TLS, unsafe.Pointer)) int32
123814  	Xbind_text16            func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)) int32
123815  	Xbind_value             func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32
123816  	Xbusy_handler           func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32) int32, unsafe.Pointer) int32
123817  	Xbusy_timeout           func(*crt.TLS, unsafe.Pointer, int32) int32
123818  	Xchanges                func(*crt.TLS, unsafe.Pointer) int32
123819  	Xclose                  func(*crt.TLS, unsafe.Pointer) int32
123820  	Xcollation_needed       func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)) int32
123821  	Xcollation_needed16     func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)) int32
123822  	Xcolumn_blob            func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123823  	Xcolumn_bytes           func(*crt.TLS, unsafe.Pointer, int32) int32
123824  	Xcolumn_bytes16         func(*crt.TLS, unsafe.Pointer, int32) int32
123825  	Xcolumn_count           func(*crt.TLS, unsafe.Pointer) int32
123826  	Xcolumn_database_name   func(*crt.TLS, unsafe.Pointer, int32) *int8
123827  	Xcolumn_database_name16 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123828  	Xcolumn_decltype        func(*crt.TLS, unsafe.Pointer, int32) *int8
123829  	Xcolumn_decltype16      func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123830  	Xcolumn_double          func(*crt.TLS, unsafe.Pointer, int32) float64
123831  	Xcolumn_int             func(*crt.TLS, unsafe.Pointer, int32) int32
123832  	Xcolumn_int64           func(*crt.TLS, unsafe.Pointer, int32) int64
123833  	Xcolumn_name            func(*crt.TLS, unsafe.Pointer, int32) *int8
123834  	Xcolumn_name16          func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123835  	Xcolumn_origin_name     func(*crt.TLS, unsafe.Pointer, int32) *int8
123836  	Xcolumn_origin_name16   func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123837  	Xcolumn_table_name      func(*crt.TLS, unsafe.Pointer, int32) *int8
123838  	Xcolumn_table_name16    func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123839  	Xcolumn_text            func(*crt.TLS, unsafe.Pointer, int32) *uint8
123840  	Xcolumn_text16          func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123841  	Xcolumn_type            func(*crt.TLS, unsafe.Pointer, int32) int32
123842  	Xcolumn_value           func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123843  	Xcommit_hook            func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer) unsafe.Pointer
123844  	Xcomplete               func(*crt.TLS, *int8) int32
123845  	Xcomplete16             func(*crt.TLS, unsafe.Pointer) int32
123846  	Xcreate_collation       func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
123847  	Xcreate_collation16     func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
123848  	Xcreate_function        func(*crt.TLS, unsafe.Pointer, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32
123849  	Xcreate_function16      func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32
123850  	Xcreate_module          func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer) int32
123851  	Xdata_count             func(*crt.TLS, unsafe.Pointer) int32
123852  	Xdb_handle              func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123853  	Xdeclare_vtab           func(*crt.TLS, unsafe.Pointer, *int8) int32
123854  	Xenable_shared_cache    func(*crt.TLS, int32) int32
123855  	Xerrcode                func(*crt.TLS, unsafe.Pointer) int32
123856  	Xerrmsg                 func(*crt.TLS, unsafe.Pointer) *int8
123857  	Xerrmsg16               func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123858  	Xexec                   func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, unsafe.Pointer, **int8) int32
123859  	Xexpired                func(*crt.TLS, unsafe.Pointer) int32
123860  	Xfinalize               func(*crt.TLS, unsafe.Pointer) int32
123861  	Xfree                   func(*crt.TLS, unsafe.Pointer)
123862  	Xfree_table             func(*crt.TLS, **int8)
123863  	Xget_autocommit         func(*crt.TLS, unsafe.Pointer) int32
123864  	Xget_auxdata            func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123865  	Xget_table              func(*crt.TLS, unsafe.Pointer, *int8, ***int8, *int32, *int32, **int8) int32
123866  	Xglobal_recover         func(*crt.TLS) int32
123867  	Xinterruptx             func(*crt.TLS, unsafe.Pointer)
123868  	Xlast_insert_rowid      func(*crt.TLS, unsafe.Pointer) int64
123869  	Xlibversion             func(*crt.TLS) *int8
123870  	Xlibversion_number      func(*crt.TLS) int32
123871  	Xmalloc                 func(*crt.TLS, int32) unsafe.Pointer
123872  	Xmprintf                func(*crt.TLS, *int8, ...interface{}) *int8
123873  	Xopen64                 func(*crt.TLS, *int8, *unsafe.Pointer) int32
123874  	Xopen16                 func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32
123875  	Xprepare                func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32
123876  	Xprepare16              func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
123877  	Xprofile                func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8, uint64), unsafe.Pointer) unsafe.Pointer
123878  	Xprogress_handler       func(*crt.TLS, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer)
123879  	Xrealloc                func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123880  	Xreset                  func(*crt.TLS, unsafe.Pointer) int32
123881  	Xresult_blob            func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
123882  	Xresult_double          func(*crt.TLS, unsafe.Pointer, float64)
123883  	Xresult_error           func(*crt.TLS, unsafe.Pointer, *int8, int32)
123884  	Xresult_error16         func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32)
123885  	Xresult_int             func(*crt.TLS, unsafe.Pointer, int32)
123886  	Xresult_int64           func(*crt.TLS, unsafe.Pointer, int64)
123887  	Xresult_null            func(*crt.TLS, unsafe.Pointer)
123888  	Xresult_text            func(*crt.TLS, unsafe.Pointer, *int8, int32, func(*crt.TLS, unsafe.Pointer))
123889  	Xresult_text16          func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
123890  	Xresult_text16be        func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
123891  	Xresult_text16le        func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
123892  	Xresult_value           func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
123893  	Xrollback_hook          func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer), unsafe.Pointer) unsafe.Pointer
123894  	Xset_authorizer         func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, unsafe.Pointer) int32
123895  	Xset_auxdata            func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer))
123896  	Xsnprintf               func(*crt.TLS, int32, *int8, *int8, ...interface{}) *int8
123897  	Xstep                   func(*crt.TLS, unsafe.Pointer) int32
123898  	Xtable_column_metadata  func(*crt.TLS, unsafe.Pointer, *int8, *int8, *int8, **int8, **int8, *int32, *int32, *int32) int32
123899  	Xthread_cleanup         func(*crt.TLS)
123900  	Xtotal_changes          func(*crt.TLS, unsafe.Pointer) int32
123901  	Xtrace                  func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8), unsafe.Pointer) unsafe.Pointer
123902  	Xtransfer_bindings      func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
123903  	Xupdate_hook            func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), unsafe.Pointer) unsafe.Pointer
123904  	Xuser_data              func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123905  	Xvalue_blob             func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123906  	Xvalue_bytes            func(*crt.TLS, unsafe.Pointer) int32
123907  	Xvalue_bytes16          func(*crt.TLS, unsafe.Pointer) int32
123908  	Xvalue_double           func(*crt.TLS, unsafe.Pointer) float64
123909  	Xvalue_int              func(*crt.TLS, unsafe.Pointer) int32
123910  	Xvalue_int64            func(*crt.TLS, unsafe.Pointer) int64
123911  	Xvalue_numeric_type     func(*crt.TLS, unsafe.Pointer) int32
123912  	Xvalue_text             func(*crt.TLS, unsafe.Pointer) *uint8
123913  	Xvalue_text16           func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123914  	Xvalue_text16be         func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123915  	Xvalue_text16le         func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123916  	Xvalue_type             func(*crt.TLS, unsafe.Pointer) int32
123917  	Xvmprintf               func(*crt.TLS, *int8, unsafe.Pointer) *int8
123918  	Xoverload_function      func(*crt.TLS, unsafe.Pointer, *int8, int32) int32
123919  	Xprepare_v2             func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32
123920  	Xprepare16_v2           func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
123921  	Xclear_bindings         func(*crt.TLS, unsafe.Pointer) int32
123922  	Xcreate_module_v2       func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)) int32
123923  	Xbind_zeroblob          func(*crt.TLS, unsafe.Pointer, int32, int32) int32
123924  	Xblob_bytes             func(*crt.TLS, unsafe.Pointer) int32
123925  	Xblob_close             func(*crt.TLS, unsafe.Pointer) int32
123926  	Xblob_open              func(*crt.TLS, unsafe.Pointer, *int8, *int8, *int8, int64, int32, *unsafe.Pointer) int32
123927  	Xblob_read              func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int32) int32
123928  	Xblob_write             func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int32) int32
123929  	Xcreate_collation_v2    func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, func(*crt.TLS, unsafe.Pointer)) int32
123930  	Xfile_control           func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer) int32
123931  	Xmemory_highwater       func(*crt.TLS, int32) int64
123932  	Xmemory_used            func(*crt.TLS) int64
123933  	Xmutex_alloc            func(*crt.TLS, int32) unsafe.Pointer
123934  	Xmutex_enter            func(*crt.TLS, unsafe.Pointer)
123935  	Xmutex_free             func(*crt.TLS, unsafe.Pointer)
123936  	Xmutex_leave            func(*crt.TLS, unsafe.Pointer)
123937  	Xmutex_try              func(*crt.TLS, unsafe.Pointer) int32
123938  	Xopen_v2                func(*crt.TLS, *int8, *unsafe.Pointer, int32, *int8) int32
123939  	Xrelease_memory         func(*crt.TLS, int32) int32
123940  	Xresult_error_nomem     func(*crt.TLS, unsafe.Pointer)
123941  	Xresult_error_toobig    func(*crt.TLS, unsafe.Pointer)
123942  	Xsleep                  func(*crt.TLS, int32) int32
123943  	Xsoft_heap_limit        func(*crt.TLS, int32)
123944  	Xvfs_find               func(*crt.TLS, *int8) unsafe.Pointer
123945  	Xvfs_register           func(*crt.TLS, unsafe.Pointer, int32) int32
123946  	Xvfs_unregister         func(*crt.TLS, unsafe.Pointer) int32
123947  	Xxthreadsafe            func(*crt.TLS) int32
123948  	Xresult_zeroblob        func(*crt.TLS, unsafe.Pointer, int32)
123949  	Xresult_error_code      func(*crt.TLS, unsafe.Pointer, int32)
123950  	Xtest_control           func(*crt.TLS, int32, ...interface{}) int32
123951  	Xrandomness             func(*crt.TLS, int32, unsafe.Pointer)
123952  	Xcontext_db_handle      func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123953  	Xextended_result_codes  func(*crt.TLS, unsafe.Pointer, int32) int32
123954  	Xlimit                  func(*crt.TLS, unsafe.Pointer, int32, int32) int32
123955  	Xnext_stmt              func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) unsafe.Pointer
123956  	Xsql                    func(*crt.TLS, unsafe.Pointer) *int8
123957  	Xstatus                 func(*crt.TLS, int32, *int32, *int32, int32) int32
123958  	Xbackup_finish          func(*crt.TLS, unsafe.Pointer) int32
123959  	Xbackup_init            func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, *int8) unsafe.Pointer
123960  	Xbackup_pagecount       func(*crt.TLS, unsafe.Pointer) int32
123961  	Xbackup_remaining       func(*crt.TLS, unsafe.Pointer) int32
123962  	Xbackup_step            func(*crt.TLS, unsafe.Pointer, int32) int32
123963  	Xcompileoption_get      func(*crt.TLS, int32) *int8
123964  	Xcompileoption_used     func(*crt.TLS, *int8) int32
123965  	Xcreate_function_v2     func(*crt.TLS, unsafe.Pointer, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32
123966  	Xdb_config              func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32
123967  	Xdb_mutex               func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123968  	Xdb_status              func(*crt.TLS, unsafe.Pointer, int32, *int32, *int32, int32) int32
123969  	Xextended_errcode       func(*crt.TLS, unsafe.Pointer) int32
123970  	Xlog                    func(*crt.TLS, int32, *int8, ...interface{})
123971  	Xsoft_heap_limit64      func(*crt.TLS, int64) int64
123972  	Xsourceid               func(*crt.TLS) *int8
123973  	Xstmt_status            func(*crt.TLS, unsafe.Pointer, int32, int32) int32
123974  	Xstrnicmp               func(*crt.TLS, *int8, *int8, int32) int32
123975  	Xunlock_notify          func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, *unsafe.Pointer, int32), unsafe.Pointer) int32
123976  	Xwal_autocheckpoint     func(*crt.TLS, unsafe.Pointer, int32) int32
123977  	Xwal_checkpoint         func(*crt.TLS, unsafe.Pointer, *int8) int32
123978  	Xwal_hook               func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32, unsafe.Pointer) unsafe.Pointer
123979  	Xblob_reopen            func(*crt.TLS, unsafe.Pointer, int64) int32
123980  	Xvtab_config            func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32
123981  	Xvtab_on_conflict       func(*crt.TLS, unsafe.Pointer) int32
123982  	Xclose_v2               func(*crt.TLS, unsafe.Pointer) int32
123983  	Xdb_filename            func(*crt.TLS, unsafe.Pointer, *int8) *int8
123984  	Xdb_readonly            func(*crt.TLS, unsafe.Pointer, *int8) int32
123985  	Xdb_release_memory      func(*crt.TLS, unsafe.Pointer) int32
123986  	Xerrstr                 func(*crt.TLS, int32) *int8
123987  	Xstmt_busy              func(*crt.TLS, unsafe.Pointer) int32
123988  	Xstmt_readonly          func(*crt.TLS, unsafe.Pointer) int32
123989  	Xstricmp                func(*crt.TLS, *int8, *int8) int32
123990  	Xuri_boolean            func(*crt.TLS, *int8, *int8, int32) int32
123991  	Xuri_int64              func(*crt.TLS, *int8, *int8, int64) int64
123992  	Xuri_parameter          func(*crt.TLS, *int8, *int8) *int8
123993  	Xvsnprintf              func(*crt.TLS, int32, *int8, *int8, unsafe.Pointer) *int8
123994  	Xwal_checkpoint_v2      func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32, *int32) int32
123995  	Xauto_extension         func(*crt.TLS, func(*crt.TLS)) int32
123996  	Xbind_blob64            func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer)) int32
123997  	Xbind_text64            func(*crt.TLS, unsafe.Pointer, int32, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8) int32
123998  	Xcancel_auto_extension  func(*crt.TLS, func(*crt.TLS)) int32
123999  	Xload_extension         func(*crt.TLS, unsafe.Pointer, *int8, *int8, **int8) int32
124000  	Xmalloc64               func(*crt.TLS, uint64) unsafe.Pointer
124001  	Xmsize                  func(*crt.TLS, unsafe.Pointer) uint64
124002  	Xrealloc64              func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer
124003  	Xreset_auto_extension   func(*crt.TLS)
124004  	Xresult_blob64          func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer))
124005  	Xresult_text64          func(*crt.TLS, unsafe.Pointer, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8)
124006  	Xstrglob                func(*crt.TLS, *int8, *int8) int32
124007  	Xvalue_dup              func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
124008  	Xvalue_free             func(*crt.TLS, unsafe.Pointer)
124009  	Xresult_zeroblob64      func(*crt.TLS, unsafe.Pointer, uint64) int32
124010  	Xbind_zeroblob64        func(*crt.TLS, unsafe.Pointer, int32, uint64) int32
124011  	Xvalue_subtype          func(*crt.TLS, unsafe.Pointer) uint32
124012  	Xresult_subtype         func(*crt.TLS, unsafe.Pointer, uint32)
124013  	Xstatus64               func(*crt.TLS, int32, *int64, *int64, int32) int32
124014  	Xstrlike                func(*crt.TLS, *int8, *int8, uint32) int32
124015  	Xdb_cacheflush          func(*crt.TLS, unsafe.Pointer) int32
124016  	Xsystem_errno           func(*crt.TLS, unsafe.Pointer) int32
124017  	Xtrace_v2               func(*crt.TLS, unsafe.Pointer, uint32, func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, unsafe.Pointer) int32
124018  	Xexpanded_sql           func(*crt.TLS, unsafe.Pointer) *int8
124019  	Xset_last_insert_rowid  func(*crt.TLS, unsafe.Pointer, int64)
124020  } // t299 struct{aggregate_context *func(*struct{},int32)*struct{},aggregate_count *func(*struct{})int32,bind_blob *func(*struct{},int32,*struct{},int32,*func(*struct{}))int32,bind_double *func(*struct{},int32,float64)int32,bind_int *func(*struct{},int32,int32)int32,bind_int64 *func(*struct{},int32,int64)int32,bind_null *func(*struct{},int32)int32,bind_parameter_count *func(*struct{})int32,bind_parameter_index *func(*struct{},*int8)int32,bind_parameter_name *func(*struct{},int32)*int8,bind_text *func(*struct{},int32,*int8,int32,*func(*struct{}))int32,bind_text16 *func(*struct{},int32,*struct{},int32,*func(*struct{}))int32,bind_value *func(*struct{},int32,*struct{})int32,busy_handler *func(*struct{},*func(*struct{},int32)int32,*struct{})int32,busy_timeout *func(*struct{},int32)int32,changes *func(*struct{})int32,close *func(*struct{})int32,collation_needed *func(*struct{},*struct{},*func(*struct{},*struct{},int32,*int8))int32,collation_needed16 *func(*struct{},*struct{},*func(*struct{},*struct{},int32,*struct{}))int32,column_blob *func(*struct{},int32)*struct{},column_bytes *func(*struct{},int32)int32,column_bytes16 *func(*struct{},int32)int32,column_count *func(*struct{})int32,column_database_name *func(*struct{},int32)*int8,column_database_name16 *func(*struct{},int32)*struct{},column_decltype *func(*struct{},int32)*int8,column_decltype16 *func(*struct{},int32)*struct{},column_double *func(*struct{},int32)float64,column_int *func(*struct{},int32)int32,column_int64 *func(*struct{},int32)int64,column_name *func(*struct{},int32)*int8,column_name16 *func(*struct{},int32)*struct{},column_origin_name *func(*struct{},int32)*int8,column_origin_name16 *func(*struct{},int32)*struct{},column_table_name *func(*struct{},int32)*int8,column_table_name16 *func(*struct{},int32)*struct{},column_text *func(*struct{},int32)*uint8,column_text16 *func(*struct{},int32)*struct{},column_type *func(*struct{},int32)int32,column_value *func(*struct{},int32)*struct{},commit_hook *func(*struct{},*func(*struct{})int32,*struct{})*struct{},complete *func(*int8)int32,complete16 *func(*struct{})int32,create_collation *func(*struct{},*int8,int32,*struct{},*func(*struct{},int32,*struct{},int32,*struct{})int32)int32,create_collation16 *func(*struct{},*struct{},int32,*struct{},*func(*struct{},int32,*struct{},int32,*struct{})int32)int32,create_function *func(*struct{},*int8,int32,int32,*struct{},*func(*struct{},int32,**struct{}),*func(*struct{},int32,**struct{}),*func(*struct{}))int32,create_function16 *func(*struct{},*struct{},int32,int32,*struct{},*func(*struct{},int32,**struct{}),*func(*struct{},int32,**struct{}),*func(*struct{}))int32,create_module *func(*struct{},*int8,*struct{},*struct{})int32,data_count *func(*struct{})int32,db_handle *func(*struct{})*struct{},declare_vtab *func(*struct{},*int8)int32,enable_shared_cache *func(int32)int32,errcode *func(*struct{})int32,errmsg *func(*struct{})*int8,errmsg16 *func(*struct{})*struct{},exec *func(*struct{},*int8,*func(*struct{},int32,**int8,**int8)int32,*struct{},**int8)int32,expired *func(*struct{})int32,finalize *func(*struct{})int32,free *func(*struct{}),free_table *func(**int8),get_autocommit *func(*struct{})int32,get_auxdata *func(*struct{},int32)*struct{},get_table *func(*struct{},*int8,***int8,*int32,*int32,**int8)int32,global_recover *func()int32,interruptx *func(*struct{}),last_insert_rowid *func(*struct{})int64,libversion *func()*int8,libversion_number *func()int32,malloc *func(int32)*struct{},mprintf *func(*int8...)*int8,open64 *func(*int8,**struct{})int32,open16 *func(*struct{},**struct{})int32,prepare *func(*struct{},*int8,int32,**struct{},**int8)int32,prepare16 *func(*struct{},*struct{},int32,**struct{},**struct{})int32,profile *func(*struct{},*func(*struct{},*int8,uint64),*struct{})*struct{},progress_handler *func(*struct{},int32,*func(*struct{})int32,*struct{}),realloc *func(*struct{},int32)*struct{},reset *func(*struct{})int32,result_blob *func(*struct{},*struct{},int32,*func(*struct{})),result_double *func(*struct{},float64),result_error *func(*struct{},*int8,int32),result_error16 *func(*struct{},*struct{},int32),result_int *func(*struct{},int32),result_int64 *func(*struct{},int64),result_null *func(*struct{}),result_text *func(*struct{},*int8,int32,*func(*struct{})),result_text16 *func(*struct{},*struct{},int32,*func(*struct{})),result_text16be *func(*struct{},*struct{},int32,*func(*struct{})),result_text16le *func(*struct{},*struct{},int32,*func(*struct{})),result_value *func(*struct{},*struct{}),rollback_hook *func(*struct{},*func(*struct{}),*struct{})*struct{},set_authorizer *func(*struct{},*func(*struct{},int32,*int8,*int8,*int8,*int8)int32,*struct{})int32,set_auxdata *func(*struct{},int32,*struct{},*func(*struct{})),snprintf *func(int32,*int8,*int8...)*int8,step *func(*struct{})int32,table_column_metadata *func(*struct{},*int8,*int8,*int8,**int8,**int8,*int32,*int32,*int32)int32,thread_cleanup *func(),total_changes *func(*struct{})int32,trace *func(*struct{},*func(*struct{},*int8),*struct{})*struct{},transfer_bindings *func(*struct{},*struct{})int32,update_hook *func(*struct{},*func(*struct{},int32,*int8,*int8,int64),*struct{})*struct{},user_data *func(*struct{})*struct{},value_blob *func(*struct{})*struct{},value_bytes *func(*struct{})int32,value_bytes16 *func(*struct{})int32,value_double *func(*struct{})float64,value_int *func(*struct{})int32,value_int64 *func(*struct{})int64,value_numeric_type *func(*struct{})int32,value_text *func(*struct{})*uint8,value_text16 *func(*struct{})*struct{},value_text16be *func(*struct{})*struct{},value_text16le *func(*struct{})*struct{},value_type *func(*struct{})int32,vmprintf *func(*int8,*struct{})*int8,overload_function *func(*struct{},*int8,int32)int32,prepare_v2 *func(*struct{},*int8,int32,**struct{},**int8)int32,prepare16_v2 *func(*struct{},*struct{},int32,**struct{},**struct{})int32,clear_bindings *func(*struct{})int32,create_module_v2 *func(*struct{},*int8,*struct{},*struct{},*func(*struct{}))int32,bind_zeroblob *func(*struct{},int32,int32)int32,blob_bytes *func(*struct{})int32,blob_close *func(*struct{})int32,blob_open *func(*struct{},*int8,*int8,*int8,int64,int32,**struct{})int32,blob_read *func(*struct{},*struct{},int32,int32)int32,blob_write *func(*struct{},*struct{},int32,int32)int32,create_collation_v2 *func(*struct{},*int8,int32,*struct{},*func(*struct{},int32,*struct{},int32,*struct{})int32,*func(*struct{}))int32,file_control *func(*struct{},*int8,int32,*struct{})int32,memory_highwater *func(int32)int64,memory_used *func()int64,mutex_alloc *func(int32)*struct{},mutex_enter *func(*struct{}),mutex_free *func(*struct{}),mutex_leave *func(*struct{}),mutex_try *func(*struct{})int32,open_v2 *func(*int8,**struct{},int32,*int8)int32,release_memory *func(int32)int32,result_error_nomem *func(*struct{}),result_error_toobig *func(*struct{}),sleep *func(int32)int32,soft_heap_limit *func(int32),vfs_find *func(*int8)*struct{},vfs_register *func(*struct{},int32)int32,vfs_unregister *func(*struct{})int32,xthreadsafe *func()int32,result_zeroblob *func(*struct{},int32),result_error_code *func(*struct{},int32),test_control *func(int32...)int32,randomness *func(int32,*struct{}),context_db_handle *func(*struct{})*struct{},extended_result_codes *func(*struct{},int32)int32,limit *func(*struct{},int32,int32)int32,next_stmt *func(*struct{},*struct{})*struct{},sql *func(*struct{})*int8,status *func(int32,*int32,*int32,int32)int32,backup_finish *func(*struct{})int32,backup_init *func(*struct{},*int8,*struct{},*int8)*struct{},backup_pagecount *func(*struct{})int32,backup_remaining *func(*struct{})int32,backup_step *func(*struct{},int32)int32,compileoption_get *func(int32)*int8,compileoption_used *func(*int8)int32,create_function_v2 *func(*struct{},*int8,int32,int32,*struct{},*func(*struct{},int32,**struct{}),*func(*struct{},int32,**struct{}),*func(*struct{}),*func(*struct{}))int32,db_config *func(*struct{},int32...)int32,db_mutex *func(*struct{})*struct{},db_status *func(*struct{},int32,*int32,*int32,int32)int32,extended_errcode *func(*struct{})int32,log *func(int32,*int8...),soft_heap_limit64 *func(int64)int64,sourceid *func()*int8,stmt_status *func(*struct{},int32,int32)int32,strnicmp *func(*int8,*int8,int32)int32,unlock_notify *func(*struct{},*func(**struct{},int32),*struct{})int32,wal_autocheckpoint *func(*struct{},int32)int32,wal_checkpoint *func(*struct{},*int8)int32,wal_hook *func(*struct{},*func(*struct{},*struct{},*int8,int32)int32,*struct{})*struct{},blob_reopen *func(*struct{},int64)int32,vtab_config *func(*struct{},int32...)int32,vtab_on_conflict *func(*struct{})int32,close_v2 *func(*struct{})int32,db_filename *func(*struct{},*int8)*int8,db_readonly *func(*struct{},*int8)int32,db_release_memory *func(*struct{})int32,errstr *func(int32)*int8,stmt_busy *func(*struct{})int32,stmt_readonly *func(*struct{})int32,stricmp *func(*int8,*int8)int32,uri_boolean *func(*int8,*int8,int32)int32,uri_int64 *func(*int8,*int8,int64)int64,uri_parameter *func(*int8,*int8)*int8,vsnprintf *func(int32,*int8,*int8,*struct{})*int8,wal_checkpoint_v2 *func(*struct{},*int8,int32,*int32,*int32)int32,auto_extension *func(*func())int32,bind_blob64 *func(*struct{},int32,*struct{},uint64,*func(*struct{}))int32,bind_text64 *func(*struct{},int32,*int8,uint64,*func(*struct{}),uint8)int32,cancel_auto_extension *func(*func())int32,load_extension *func(*struct{},*int8,*int8,**int8)int32,malloc64 *func(uint64)*struct{},msize *func(*struct{})uint64,realloc64 *func(*struct{},uint64)*struct{},reset_auto_extension *func(),result_blob64 *func(*struct{},*struct{},uint64,*func(*struct{})),result_text64 *func(*struct{},*int8,uint64,*func(*struct{}),uint8),strglob *func(*int8,*int8)int32,value_dup *func(*struct{})*struct{},value_free *func(*struct{}),result_zeroblob64 *func(*struct{},uint64)int32,bind_zeroblob64 *func(*struct{},int32,uint64)int32,value_subtype *func(*struct{})uint32,result_subtype *func(*struct{},uint32),status64 *func(int32,*int64,*int64,int32)int32,strlike *func(*int8,*int8,uint32)int32,db_cacheflush *func(*struct{})int32,system_errno *func(*struct{})int32,trace_v2 *func(*struct{},uint32,*func(uint32,*struct{},*struct{},*struct{})int32,*struct{})int32,expanded_sql *func(*struct{})*int8,set_last_insert_rowid *func(*struct{},int64)}
124021  
124022  type Tsqlite3AutoExtList struct {
124023  	XnExt uint32
124024  	XaExt *func(*crt.TLS)
124025  } // t300 struct{nExt uint32,aExt **func()}
124026  
124027  type XPragmaName struct {
124028  	XzName      *int8
124029  	XePragTyp   uint8
124030  	XmPragFlg   uint8
124031  	XiPragCName uint8
124032  	XnPragCName uint8
124033  	XiArg       uint32
124034  } // t301 struct{zName *int8,ePragTyp uint8,mPragFlg uint8,iPragCName uint8,nPragCName uint8,iArg uint32}
124035  
124036  type TEncName struct {
124037  	XzName *int8
124038  	Xenc   uint8
124039  } // t302 struct{zName *int8,enc uint8}
124040  
124041  type XPragmaVtab struct {
124042  	Xbase    Xsqlite3_vtab
124043  	Xdb      unsafe.Pointer
124044  	XpName   unsafe.Pointer
124045  	XnHidden uint8
124046  	XiHidden uint8
124047  } // t303 struct{base struct{pModule *struct{},nRef int32,zErrMsg *int8},db *struct{},pName *struct{},nHidden uint8,iHidden uint8}
124048  
124049  type Xsqlite3_index_info struct {
124050  	XnConstraint      int32
124051  	XaConstraint      unsafe.Pointer
124052  	XnOrderBy         int32
124053  	XaOrderBy         unsafe.Pointer
124054  	XaConstraintUsage unsafe.Pointer
124055  	XidxNum           int32
124056  	XidxStr           *int8
124057  	XneedToFreeIdxStr int32
124058  	XorderByConsumed  int32
124059  	XestimatedCost    float64
124060  	XestimatedRows    int64
124061  	XidxFlags         int32
124062  	XcolUsed          uint64
124063  } // t304 struct{nConstraint int32,aConstraint *struct{},nOrderBy int32,aOrderBy *struct{},aConstraintUsage *struct{},idxNum int32,idxStr *int8,needToFreeIdxStr int32,orderByConsumed int32,estimatedCost float64,estimatedRows int64,idxFlags int32,colUsed uint64}
124064  
124065  type Tsqlite3_index_constraint struct {
124066  	XiColumn     int32
124067  	Xop          uint8
124068  	Xusable      uint8
124069  	XiTermOffset int32
124070  } // t305 struct{iColumn int32,op uint8,usable uint8,iTermOffset int32}
124071  
124072  type Tsqlite3_index_constraint_usage struct {
124073  	XargvIndex int32
124074  	Xomit      uint8
124075  } // t306 struct{argvIndex int32,omit uint8}
124076  
124077  type XPragmaVtabCursor struct {
124078  	Xbase    Xsqlite3_vtab_cursor
124079  	XpPragma unsafe.Pointer
124080  	XiRowid  int64
124081  	XazArg   [2]*int8
124082  } // t307 struct{base struct{pVtab *struct{}},pPragma *struct{},iRowid int64,azArg [2]*int8}
124083  
124084  type XSortCtx struct {
124085  	XpOrderBy          unsafe.Pointer
124086  	XnOBSat            int32
124087  	XiECursor          int32
124088  	XregReturn         int32
124089  	XlabelBkOut        int32
124090  	XaddrSortIndex     int32
124091  	XlabelDone         int32
124092  	XsortFlags         uint8
124093  	XbOrderedInnerLoop uint8
124094  } // t308 struct{pOrderBy *struct{},nOBSat int32,iECursor int32,regReturn int32,labelBkOut int32,addrSortIndex int32,labelDone int32,sortFlags uint8,bOrderedInnerLoop uint8}
124095  
124096  type XDistinctCtx struct {
124097  	XisTnct    uint8
124098  	XeTnctType uint8
124099  	XtabTnct   int32
124100  	XaddrTnct  int32
124101  } // t309 struct{isTnct uint8,eTnctType uint8,tabTnct int32,addrTnct int32}
124102  
124103  type XSubstContext struct {
124104  	XpParse     unsafe.Pointer
124105  	XiTable     int32
124106  	XiNewTable  int32
124107  	XisLeftJoin int32
124108  	XpEList     unsafe.Pointer
124109  } // t310 struct{pParse *struct{},iTable int32,iNewTable int32,isLeftJoin int32,pEList *struct{}}
124110  
124111  type THavingToWhereCtx struct {
124112  	XppWhere  *unsafe.Pointer
124113  	XpGroupBy unsafe.Pointer
124114  } // t311 struct{ppWhere **struct{},pGroupBy *struct{}}
124115  
124116  type XTabResult struct {
124117  	XazResult **int8
124118  	XzErrMsg  *int8
124119  	XnAlloc   uint32
124120  	XnRow     uint32
124121  	XnColumn  uint32
124122  	XnData    uint32
124123  	Xrc       int32
124124  } // t312 struct{azResult **int8,zErrMsg *int8,nAlloc uint32,nRow uint32,nColumn uint32,nData uint32,rc int32}
124125  
124126  type XVtabCtx struct {
124127  	XpVTable   unsafe.Pointer
124128  	XpTab      unsafe.Pointer
124129  	XpPrior    unsafe.Pointer
124130  	XbDeclared int32
124131  } // t313 struct{pVTable *struct{},pTab *struct{},pPrior *struct{},bDeclared int32}
124132  
124133  type XWhereLoop struct {
124134  	Xprereq      uint64
124135  	XmaskSelf    uint64
124136  	XcId         int8
124137  	XiTab        uint8
124138  	XiSortIdx    uint8
124139  	XrSetup      int16
124140  	XrRun        int16
124141  	XnOut        int16
124142  	Xu           t314
124143  	XwsFlags     uint32
124144  	XnLTerm      uint16
124145  	XnSkip       uint16
124146  	XnLSlot      uint16
124147  	XaLTerm      *unsafe.Pointer
124148  	XpNextLoop   unsafe.Pointer
124149  	XaLTermSpace [3]unsafe.Pointer
124150  } // t315 struct{prereq uint64,maskSelf uint64,cId int8,iTab uint8,iSortIdx uint8,rSetup int16,rRun int16,nOut int16,u union{btree struct{nEq uint16,nBtm uint16,nTop uint16,nIdxCol uint16,pIndex *struct{}},vtab struct{idxNum int32,needFree uint8,isOrdered int8,omitMask uint16,idxStr *int8}},wsFlags uint32,nLTerm uint16,nSkip uint16,nLSlot uint16,aLTerm **struct{},pNextLoop *struct{},aLTermSpace [3]*struct{}}
124151  
124152  type TInLoop struct {
124153  	XiCur       int32
124154  	XaddrInTop  int32
124155  	XeEndLoopOp uint8
124156  } // t316 struct{iCur int32,addrInTop int32,eEndLoopOp uint8}
124157  
124158  type XIdxExprTrans struct {
124159  	XpIdxExpr unsafe.Pointer
124160  	XiTabCur  int32
124161  	XiIdxCur  int32
124162  	XiIdxCol  int32
124163  } // t317 struct{pIdxExpr *struct{},iTabCur int32,iIdxCur int32,iIdxCol int32}
124164  
124165  type XWhereOrInfo struct {
124166  	Xwc        XWhereClause
124167  	Xindexable uint64
124168  } // t318 struct{wc struct{pWInfo *struct{},pOuter *struct{},op uint8,nTerm int32,nSlot int32,a *struct{},aStatic [8]struct{pExpr *struct{},pWC *struct{},truthProb int16,wtFlags uint16,eOperator uint16,nChild uint8,eMatchOp uint8,iParent int32,leftCursor int32,iField int32,u union{leftColumn int32,pOrInfo *struct{},pAndInfo *struct{}},prereqRight uint64,prereqAll uint64}},indexable uint64}
124169  
124170  type XWhereAndInfo struct{ Xwc XWhereClause } // t319 struct{wc struct{pWInfo *struct{},pOuter *struct{},op uint8,nTerm int32,nSlot int32,a *struct{},aStatic [8]struct{pExpr *struct{},pWC *struct{},truthProb int16,wtFlags uint16,eOperator uint16,nChild uint8,eMatchOp uint8,iParent int32,leftCursor int32,iField int32,u union{leftColumn int32,pOrInfo *struct{},pAndInfo *struct{}},prereqRight uint64,prereqAll uint64}}}
124171  
124172  type TOp2 struct {
124173  	XzOp  *int8
124174  	XeOp2 uint8
124175  } // t320 struct{zOp *int8,eOp2 uint8}
124176  
124177  type XWhereOrCost struct {
124178  	Xprereq uint64
124179  	XrRun   int16
124180  	XnOut   int16
124181  } // t321 struct{prereq uint64,rRun int16,nOut int16}
124182  
124183  type XWhereOrSet struct {
124184  	Xn uint16
124185  	Xa [3]XWhereOrCost
124186  } // t322 struct{n uint16,a [3]struct{prereq uint64,rRun int16,nOut int16}}
124187  
124188  type XWhereScan struct {
124189  	XpOrigWC   unsafe.Pointer
124190  	XpWC       unsafe.Pointer
124191  	XzCollName *int8
124192  	XpIdxExpr  unsafe.Pointer
124193  	Xidxaff    int8
124194  	XnEquiv    uint8
124195  	XiEquiv    uint8
124196  	XopMask    uint32
124197  	Xk         int32
124198  	XaiCur     [11]int32
124199  	XaiColumn  [11]int16
124200  } // t323 struct{pOrigWC *struct{},pWC *struct{},zCollName *int8,pIdxExpr *struct{},idxaff int8,nEquiv uint8,iEquiv uint8,opMask uint32,k int32,aiCur [11]int32,aiColumn [11]int16}
124201  
124202  type Tsqlite3_index_orderby struct {
124203  	XiColumn int32
124204  	Xdesc    uint8
124205  } // t324 struct{iColumn int32,desc uint8}
124206  
124207  type XWhereLoopBuilder struct {
124208  	XpWInfo   unsafe.Pointer
124209  	XpWC      unsafe.Pointer
124210  	XpOrderBy unsafe.Pointer
124211  	XpNew     unsafe.Pointer
124212  	XpOrSet   unsafe.Pointer
124213  	XbldFlags uint32
124214  } // t325 struct{pWInfo *struct{},pWC *struct{},pOrderBy *struct{},pNew *struct{},pOrSet *struct{},bldFlags uint32}
124215  
124216  type XWherePath struct {
124217  	XmaskLoop  uint64
124218  	XrevLoop   uint64
124219  	XnRow      int16
124220  	XrCost     int16
124221  	XrUnsorted int16
124222  	XisOrdered int8
124223  	XaLoop     *unsafe.Pointer
124224  } // t326 struct{maskLoop uint64,revLoop uint64,nRow int16,rCost int16,rUnsorted int16,isOrdered int8,aLoop **struct{}}
124225  
124226  type XYYMINORTYPE struct {
124227  	X [0]struct {
124228  		Xyyinit int32
124229  		Xyy0    XToken
124230  		Xyy72   unsafe.Pointer
124231  		Xyy145  unsafe.Pointer
124232  		Xyy148  unsafe.Pointer
124233  		Xyy185  unsafe.Pointer
124234  		Xyy190  XExprSpan
124235  		Xyy194  int32
124236  		Xyy243  unsafe.Pointer
124237  		Xyy254  unsafe.Pointer
124238  		Xyy285  unsafe.Pointer
124239  		Xyy332  t53
124240  		Xyy354  t57
124241  		Xyy497  t56
124242  	}
124243  	U [24]byte
124244  } // t327 union{yyinit int32,yy0 struct{z *int8,n uint32},yy72 *struct{},yy145 *struct{},yy148 *struct{},yy185 *struct{},yy190 struct{pExpr *struct{},zStart *int8,zEnd *int8},yy194 int32,yy243 *struct{},yy254 *struct{},yy285 *struct{},yy332 struct{a int32,b *struct{}},yy354 struct{pLimit *struct{},pOffset *struct{}},yy497 struct{value int32,mask int32}}
124245  
124246  type XyyStackEntry struct {
124247  	Xstateno uint16
124248  	Xmajor   uint8
124249  	Xminor   XYYMINORTYPE
124250  } // t328 struct{stateno uint16,major uint8,minor union{yyinit int32,yy0 struct{z *int8,n uint32},yy72 *struct{},yy145 *struct{},yy148 *struct{},yy185 *struct{},yy190 struct{pExpr *struct{},zStart *int8,zEnd *int8},yy194 int32,yy243 *struct{},yy254 *struct{},yy285 *struct{},yy332 struct{a int32,b *struct{}},yy354 struct{pLimit *struct{},pOffset *struct{}},yy497 struct{value int32,mask int32}}}
124251  
124252  type XyyParser struct {
124253  	Xyytos   unsafe.Pointer
124254  	XpParse  unsafe.Pointer
124255  	Xyystack [100]XyyStackEntry
124256  } // t329 struct{yytos *struct{},pParse *struct{},yystack [100]struct{stateno uint16,major uint8,minor union{yyinit int32,yy0 struct{z *int8,n uint32},yy72 *struct{},yy145 *struct{},yy148 *struct{},yy185 *struct{},yy190 struct{pExpr *struct{},zStart *int8,zEnd *int8},yy194 int32,yy243 *struct{},yy254 *struct{},yy285 *struct{},yy332 struct{a int32,b *struct{}},yy354 struct{pLimit *struct{},pOffset *struct{}},yy497 struct{value int32,mask int32}}}}
124257  
124258  type TOpenMode struct {
124259  	Xz    *int8
124260  	Xmode int32
124261  } // t330 struct{z *int8,mode int32}
124262  
124263  type t137 struct{} // struct{}
124264  
124265  type t149 struct {
124266  	XnewTnum       int32
124267  	XiDb           uint8
124268  	Xbusy          uint8
124269  	XorphanTrigger uint8
124270  	XimposterTable uint8
124271  } // struct{newTnum int32,iDb uint8,busy uint8,orphanTrigger uint8,imposterTable uint8}
124272  
124273  type t150 struct {
124274  	X [0]struct {
124275  		XisInterrupted int32
124276  		XnotUsed1      float64
124277  	}
124278  	U [8]byte
124279  } // union{isInterrupted int32,notUsed1 float64}
124280  
124281  type t151 struct {
124282  	XbDisable  uint32
124283  	Xsz        uint16
124284  	XbMalloced uint8
124285  	XnOut      int32
124286  	XmxOut     int32
124287  	XanStat    [3]int32
124288  	XpFree     unsafe.Pointer
124289  	XpStart    unsafe.Pointer
124290  	XpEnd      unsafe.Pointer
124291  } // struct{bDisable uint32,sz uint16,bMalloced uint8,nOut int32,mxOut int32,anStat [3]int32,pFree *struct{},pStart *struct{},pEnd *struct{}}
124292  
124293  type t77 struct {
124294  	XxFunc func(*crt.TLS, unsafe.Pointer, int32) int32
124295  	XpArg  unsafe.Pointer
124296  	XnBusy int32
124297  } // struct{xFunc *func(*struct{},int32)int32,pArg *struct{},nBusy int32}
124298  
124299  type t22 struct {
124300  	XeType  uint8
124301  	XnName  uint8
124302  	XzName  *int8
124303  	XrLimit float64
124304  	XrXform float64
124305  } // struct{eType uint8,nName uint8,zName *int8,rLimit float64,rXform float64}
124306  
124307  type t164 struct {
124308  	X [0]struct {
124309  		Xr       float64
124310  		Xi       int64
124311  		XnZero   int32
124312  		XpDef    unsafe.Pointer
124313  		XpRowSet unsafe.Pointer
124314  		XpFrame  unsafe.Pointer
124315  	}
124316  	U [8]byte
124317  } // union{r float64,i int64,nZero int32,pDef *struct{},pRowSet *struct{},pFrame *struct{}}
124318  
124319  type t166 struct {
124320  	X [0]struct {
124321  		XpHash       unsafe.Pointer
124322  		XpDestructor unsafe.Pointer
124323  	}
124324  	U [8]byte
124325  } // union{pHash *struct{},pDestructor *struct{}}
124326  
124327  type t178 struct {
124328  	Xjointype   uint8
124329  	XnotIndexed int8
124330  } // struct{jointype uint8,notIndexed int8}
124331  
124332  type t179 struct {
124333  	X [0]struct {
124334  		XzIndexedBy *int8
124335  		XpFuncArg   unsafe.Pointer
124336  	}
124337  	U [8]byte
124338  } // union{zIndexedBy *int8,pFuncArg *struct{}}
124339  
124340  type t75 struct {
124341  	XiLevel int32
124342  	XbLine  [100]uint8
124343  } // struct{iLevel int32,bLine [100]uint8}
124344  
124345  type t73 struct {
124346  	XiOrderByCol uint16
124347  	XiAlias      uint16
124348  } // struct{iOrderByCol uint16,iAlias uint16}
124349  
124350  type t184 struct {
124351  	X [0]struct {
124352  		Xx             t73
124353  		XiConstExprReg int32
124354  	}
124355  	U [4]byte
124356  } // union{x struct{iOrderByCol uint16,iAlias uint16},iConstExprReg int32}
124357  
124358  type t188 struct {
124359  	X [0]struct {
124360  		XzToken *int8
124361  		XiValue int32
124362  	}
124363  	U [8]byte
124364  } // union{zToken *int8,iValue int32}
124365  
124366  type t189 struct {
124367  	X [0]struct {
124368  		XpList   unsafe.Pointer
124369  		XpSelect unsafe.Pointer
124370  	}
124371  	U [8]byte
124372  } // union{pList *struct{},pSelect *struct{}}
124373  
124374  type t204 struct {
124375  	X [0]struct {
124376  		XaBitmap [496]uint8
124377  		XaHash   [124]uint32
124378  		XapSub   [62]unsafe.Pointer
124379  	}
124380  	U [496]byte
124381  } // union{aBitmap [496]uint8,aHash [124]uint32,apSub [62]*struct{}}
124382  
124383  type t70 struct {
124384  	XpParse unsafe.Pointer
124385  	XpIdx   unsafe.Pointer
124386  	XppRec  *unsafe.Pointer
124387  	XiVal   int32
124388  } // struct{pParse *struct{},pIdx *struct{},ppRec **struct{},iVal int32}
124389  
124390  type t236 struct {
124391  	X [0]struct {
124392  		Xi        int32
124393  		Xp        unsafe.Pointer
124394  		Xz        *int8
124395  		XpI64     *int64
124396  		XpReal    *float64
124397  		XpFunc    unsafe.Pointer
124398  		XpCtx     unsafe.Pointer
124399  		XpColl    unsafe.Pointer
124400  		XpMem     unsafe.Pointer
124401  		XpVtab    unsafe.Pointer
124402  		XpKeyInfo unsafe.Pointer
124403  		Xai       *int32
124404  		XpProgram unsafe.Pointer
124405  		XpTab     unsafe.Pointer
124406  		XxAdvance func(*crt.TLS, unsafe.Pointer, *int32) int32
124407  	}
124408  	U [8]byte
124409  } // union{i int32,p *struct{},z *int8,pI64 *int64,pReal *float64,pFunc *struct{},pCtx *struct{},pColl *struct{},pMem *struct{},pVtab *struct{},pKeyInfo *struct{},ai *int32,pProgram *struct{},pTab *struct{},xAdvance *func(*struct{},*int32)int32}
124410  
124411  type t244 struct {
124412  	X [0]struct {
124413  		XpCursor        unsafe.Pointer
124414  		XpVCur          unsafe.Pointer
124415  		XpseudoTableReg int32
124416  		XpSorter        unsafe.Pointer
124417  	}
124418  	U [8]byte
124419  } // union{pCursor *struct{},pVCur *struct{},pseudoTableReg int32,pSorter *struct{}}
124420  
124421  type t90 struct {
124422  	XpList   unsafe.Pointer
124423  	XaMemory *uint8
124424  	XszPMA   int32
124425  } // struct{pList *struct{},aMemory *uint8,szPMA int32}
124426  
124427  type t118 struct {
124428  	XiFrom int32
124429  	XzCol  *int8
124430  } // struct{iFrom int32,zCol *int8}
124431  
124432  type t259 struct {
124433  	X [0]struct {
124434  		XpNext unsafe.Pointer
124435  		XiNext int32
124436  	}
124437  	U [8]byte
124438  } // union{pNext *struct{},iNext int32}
124439  
124440  type t263 struct {
124441  	XiOffset int64
124442  	XpChunk  unsafe.Pointer
124443  } // struct{iOffset int64,pChunk *struct{}}
124444  
124445  type t266 struct {
124446  	X [0]struct {
124447  		XpNC        unsafe.Pointer
124448  		Xn          int32
124449  		XiCur       int32
124450  		XpSrcList   unsafe.Pointer
124451  		XpSrcCount  unsafe.Pointer
124452  		XpCCurHint  unsafe.Pointer
124453  		XaiCol      *int32
124454  		XpIdxCover  unsafe.Pointer
124455  		XpIdxTrans  unsafe.Pointer
124456  		XpGroupBy   unsafe.Pointer
124457  		XpHavingCtx unsafe.Pointer
124458  	}
124459  	U [8]byte
124460  } // union{pNC *struct{},n int32,iCur int32,pSrcList *struct{},pSrcCount *struct{},pCCurHint *struct{},aiCol *int32,pIdxCover *struct{},pIdxTrans *struct{},pGroupBy *struct{},pHavingCtx *struct{}}
124461  
124462  type t129 struct {
124463  	XzName *int8
124464  	XzCols *int8
124465  } // struct{zName *int8,zCols *int8}
124466  
124467  type t278 struct {
124468  	XanEq  *uint32
124469  	XanDLt *uint32
124470  } // struct{anEq *uint32,anDLt *uint32}
124471  
124472  type t287 struct {
124473  	X [0]struct {
124474  		XleftColumn int32
124475  		XpOrInfo    unsafe.Pointer
124476  		XpAndInfo   unsafe.Pointer
124477  	}
124478  	U [8]byte
124479  } // union{leftColumn int32,pOrInfo *struct{},pAndInfo *struct{}}
124480  
124481  type t115 struct {
124482  	XnIn     int32
124483  	XaInLoop unsafe.Pointer
124484  } // struct{nIn int32,aInLoop *struct{}}
124485  
124486  type t291 struct {
124487  	X [0]struct {
124488  		Xin      t115
124489  		XpCovidx unsafe.Pointer
124490  	}
124491  	U [16]byte
124492  } // union{in struct{nIn int32,aInLoop *struct{}},pCovidx *struct{}}
124493  
124494  type t125 struct {
124495  	Xi     uint8
124496  	XnChar uint8
124497  	Xcode  uint8
124498  } // struct{i uint8,nChar uint8,code uint8}
124499  
124500  type t102 struct {
124501  	XnEq     uint16
124502  	XnBtm    uint16
124503  	XnTop    uint16
124504  	XnIdxCol uint16
124505  	XpIndex  unsafe.Pointer
124506  } // struct{nEq uint16,nBtm uint16,nTop uint16,nIdxCol uint16,pIndex *struct{}}
124507  
124508  type t106 struct {
124509  	XidxNum    int32
124510  	XneedFree  uint8
124511  	XisOrdered int8
124512  	XomitMask  uint16
124513  	XidxStr    *int8
124514  } // struct{idxNum int32,needFree uint8,isOrdered int8,omitMask uint16,idxStr *int8}
124515  
124516  type t314 struct {
124517  	X [0]struct {
124518  		Xbtree t102
124519  		Xvtab  t106
124520  	}
124521  	U [16]byte
124522  } // union{btree struct{nEq uint16,nBtm uint16,nTop uint16,nIdxCol uint16,pIndex *struct{}},vtab struct{idxNum int32,needFree uint8,isOrdered int8,omitMask uint16,idxStr *int8}}
124523  
124524  type t53 struct {
124525  	Xa int32
124526  	Xb unsafe.Pointer
124527  } // struct{a int32,b *struct{}}
124528  
124529  type t57 struct {
124530  	XpLimit  unsafe.Pointer
124531  	XpOffset unsafe.Pointer
124532  } // struct{pLimit *struct{},pOffset *struct{}}
124533  
124534  type t56 struct {
124535  	Xvalue int32
124536  	Xmask  int32
124537  } // struct{value int32,mask int32}
124538  
124539  type t55 struct {
124540  	Xlhs  uint8
124541  	Xnrhs uint8
124542  } // struct{lhs uint8,nrhs uint8}
124543  
124544  type t133 struct {
124545  	Xop   int32
124546  	Xmask uint32
124547  }                       // struct{op int32,mask uint32}
124548  func str(n int) *int8   { return (*int8)(unsafe.Pointer(&strTab[n])) }
124549  func wstr(n int) *int32 { return (*int32)(unsafe.Pointer(&strTab[n])) }
124550  
124551  var strTab = []byte("3.19.3\x002017-06-08 14:26:16 0ee482a1e0eae22e08edc8978c9733a96603d4509645f348ebf55b579e89636b\x00SQLITE_\x00misuse\x00%s at line %d of [%.10s]\x00%\x00%s:%i: assertion failure in %s: %s\x0a\x00../../../sqlite.org/sqlite-amalgamation-3190300/sqlite3.c\x00width>=0\x00precision>=(-1)\x00NaN\x00Inf\x00precision>0\x00bufpt>zOut\x00\x00NULL\x00(NULL)\x00bArgList==0\x00k>=0 && k<pSrc->nSrc\x00.\x00xtype==etINVALID\x00z!=0 || N==0\x00p->zText!=0 || p->nChar==0 || p->accError\x00N>=0\x00p->accError==0 || p->nAlloc==0\x00p->zText\x00sqlite3StrAccumAppend\x00(p->zText==0 || p->zText==p->zBase)==!isMalloced(p)\x00p->nChar+(i64)N >= p->nAlloc\x00p->zText!=0 || p->nChar==0\x00sqlite3StrAccumEnlarge\x00eError==STRACCUM_NOMEM || eError==STRACCUM_TOOBIG\x00setStrAccumError\x00sqlite3StrAccumReset\x00db==0 || sqlite3_mutex_held(db->mutex)\x00p==0 || sqlite3GlobalConfig.mutex.xMutexHeld\x00sqlite3_mutex_held\x00sqlite3DbFree\x00p!=0\x00db!=0 || sqlite3MemdebugNoType(p, MEMTYPE_LOOKASIDE)\x00sqlite3DbFreeNN\x00sqlite3_mutex_held(db->mutex)\x00sqlite3DbMallocSize\x00sqlite3GlobalConfig.mutex.xMutexEnter\x00sqlite3_mutex_enter\x00op>=0 && op<ArraySize(statMutex)\x00sqlite3_mutex_held(statMutex[op] ? sqlite3Pcache1Mutex() : sqlite3MallocMutex())\x00op>=0 && op<ArraySize(wsdStat.nowValue)\x00sqlite3StatusDown\x00sqlite3GlobalConfig.mutex.xMutexLeave\x00sqlite3_mutex_leave\x00db!=0\x00sqlite3DbRealloc\x00db->pnBytesFreed==0\x00db->mallocFailed==0\x00sqlite3DbMallocRawNN\x00dbMallocRawFinish\x00EIGHT_BYTE_ALIGNMENT(p)\x00sqlite3_mutex_held(mem0.mutex)\x00n>0\x00mallocWithAlarm\x00X>=0\x00op==SQLITE_STATUS_MALLOC_SIZE || op==SQLITE_STATUS_PAGECACHE_SIZE || op==SQLITE_STATUS_SCRATCH_SIZE || op==SQLITE_STATUS_PARSER_STACK\x00sqlite3StatusHighwater\x00sqlite3StatusValue\x00sqlite3StatusUp\x00sqlite3Malloc\x00dbReallocFinish\x00sqlite3GlobalConfig.nRefInitMutex==0\x00sqlite3IsNaN(y)\x00sqlite3GlobalConfig.mutex.xMutexInit\x00p->nRef==0\x00pthreadMutexFree\x00p->id==SQLITE_MUTEX_RECURSIVE || pthreadMutexNotheld(p)\x00p->nRef>0 || p->owner==0\x00enter mutex %p (%d) with nRef=%d\x0a\x00pthreadMutexEnter\x00pthreadMutexTry\x00pthreadMutexHeld(p)\x00p->nRef==0 || p->id==SQLITE_MUTEX_RECURSIVE\x00leave mutex %p (%d) with nRef=%d\x0a\x00pthreadMutexLeave\x00p->cnt==0\x00debugMutexFree\x00p->id==SQLITE_MUTEX_RECURSIVE || debugMutexNotheld(pX)\x00debugMutexEnter\x00debugMutexTry\x00debugMutexHeld(pX)\x00debugMutexLeave\x00sqlite3MutexInit\x00GLOBAL(int, mutexIsInit)\x00sqlite3GlobalConfig.mutex.xMutexAlloc\x00sqlite3MutexAlloc\x00pcache1.isInit==0\x00pcache1Init\x00pcache1.isInit!=0\x00pcache1Shutdown\x00(szPage & (szPage-1))==0 && szPage>=512 && szPage<=65536\x00szExtra < 300\x00(pGroup)->mutex==0\x00pcache1Create\x00sqlite3_mutex_held(p->pGroup->mutex)\x00(p->pGroup)->mutex==0\x00pcache1ResizeHash\x00pCache->bPurgeable || (pCache->nMax==0 && pCache->nMin==0)\x00pGroup->nMaxPage >= pCache->nMax\x00pGroup->nMinPage >= pCache->nMin\x00pcache1Destroy\x00sqlite3_mutex_held(pCache->pGroup->mutex)\x00pCache->iMaxKey >= iLimit\x00pCache->nHash > 0\x00h<pCache->nHash\x00nPage<0 || pCache->nPage==(unsigned)nPage\x00pcache1TruncateUnsafe\x00pPage!=0\x00pPage->isPinned==0\x00pPage->pLruNext\x00pPage->pLruPrev\x00pPage->isAnchor==0\x00pCache->pGroup->lru.isAnchor==1\x00pcache1PinPage\x00sqlite3_mutex_held(p->pCache->pGroup->mutex)\x00pcache1FreePage\x00pcache1.nFreeSlot<=pcache1.nSlot\x00pcache1Free\x00sqlite3_mutex_held(pGroup->mutex)\x00p->pCache->pGroup==pGroup\x00p->isPinned==0\x00pcache1EnforceMaxPage\x00pcache1RemoveFromHash\x00pcache1Cachesize\x00(pCache->pGroup)->mutex==0\x00pcache1Pagecount\x00pCache->bPurgeable || createFlag!=1\x00pCache->bPurgeable || pCache->nMin==0\x00pCache->bPurgeable==0 || pCache->nMin==10\x00pCache->nMin==0 || pCache->bPurgeable\x00pCache->nHash>0\x00pcache1Fetch\x00pCache->nPage >= pCache->nRecyclable\x00pGroup->mxPinned == pGroup->nMaxPage + 10 - pGroup->nMinPage\x00pCache->n90pct == pCache->nMax*9/10\x00pCache->nHash>0 && pCache->apHash\x00pcache1FetchStage2\x00pcache1AllocPage\x00sqlite3_mutex_notheld(pcache1.grp.mutex)\x00pcache1.nFreeSlot>=0\x00p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld\x00sqlite3_mutex_notheld\x00pcache1Alloc\x00pPage->pCache==pCache\x00pPage->pLruPrev==0 && pPage->pLruNext==0\x00pPage->isPinned==1\x00pcache1Unpin\x00pPage->iKey==iOld\x00pcache1Rekey\x00pcache1Truncate\x00pcache1Shrink\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00pPrior!=0\x00sqlite3MemSize\x00OOM\x00pOther!=&aDef[i] && pOther->pNext!=&aDef[i]\x00sqlite3InsertBuiltinFuncs\x00sqlite_rename_table\x00sqlite_rename_trigger\x00sqlite_rename_parent\x00len>0\x00%.*s\"%w\"%s\x00pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex)\x00(enc&3)==(enc&~SQLITE_UTF16_ALIGNED)\x00(pVal->flags & MEM_RowSet)==0\x00sqlite3ValueText\x00pVal!=0\x00(pVal->flags & (MEM_Null))==0\x00(pVal->flags & (MEM_Ephem|MEM_Static))!=0\x000==(1&SQLITE_PTR_TO_INT(pVal->z))\x00pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || pVal->db==0 || pVal->db->mallocFailed\x00valueToText\x00pMem->flags & MEM_Zero\x00pMem->flags&MEM_Blob\x00(pMem->flags&MEM_RowSet)==0\x00pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex)\x00sqlite3VdbeMemExpandBlob\x00sqlite3VdbeCheckMemInvariants(pMem)\x00bPreserve==0 || pMem->flags&(MEM_Blob|MEM_Str)\x00pMem->szMalloc==0 || pMem->szMalloc==sqlite3DbMallocSize(pMem->db, pMem->zMalloc)\x000\x00pMem->xDel!=0 && pMem->xDel!=SQLITE_DYNAMIC\x00(p->flags & MEM_Dyn)==0 || p->xDel!=0\x00(p->flags & MEM_Dyn)==0 || p->szMalloc==0\x00(p->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real)\x00(p->flags & MEM_Null)==0 || (p->flags & (MEM_Int|MEM_Real|MEM_Str|MEM_Blob))==0\x00p->szMalloc==0 || p->szMalloc==sqlite3DbMallocSize(p->db,p->zMalloc)\x00((p->szMalloc>0 && p->z==p->zMalloc)? 1 : 0) + ((p->flags&MEM_Dyn)!=0 ? 1 : 0) + ((p->flags&MEM_Ephem)!=0 ? 1 : 0) + ((p->flags&MEM_Static)!=0 ? 1 : 0) == 1\x00sqlite3VdbeCheckMemInvariants\x00sqlite3VdbeMemGrow\x00p->db==0 || sqlite3_mutex_held(p->db->mutex)\x00VdbeMemDynamic(p)\x00(p->flags & MEM_Agg)==0\x00(p->flags&MEM_RowSet)==0\x00p->xDel!=SQLITE_DYNAMIC && p->xDel!=0\x00vdbeMemClearExternAndSetNull\x00(pMem->flags & MEM_Null)!=0 || pFunc==pMem->u.pDef\x00(pMem->flags & MEM_Dyn)==0\x00sqlite3VdbeMemFinalize\x00desiredEnc==SQLITE_UTF8 || desiredEnc==SQLITE_UTF16LE || desiredEnc==SQLITE_UTF16BE\x00rc==SQLITE_OK || rc==SQLITE_NOMEM\x00rc==SQLITE_OK || pMem->enc!=desiredEnc\x00rc==SQLITE_NOMEM || pMem->enc==desiredEnc\x00sqlite3VdbeChangeEncoding\x00pMem->flags&MEM_Str\x00pMem->enc!=desiredEnc\x00pMem->enc!=0\x00pMem->n>=0\x00rc==SQLITE_NOMEM\x00desiredEnc==SQLITE_UTF16BE\x00desiredEnc==SQLITE_UTF8\x00(pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len\x00sqlite3VdbeMemTranslate\x00sqlite3VdbeMemMakeWriteable\x00sqlite3VdbeCheckMemInvariants(p)\x00sqlite3VdbeMemRelease\x00sqlite3VdbeMemNulTerminate\x00!(fg&MEM_Zero)\x00!(fg&(MEM_Str|MEM_Blob))\x00fg&(MEM_Int|MEM_Real)\x00EIGHT_BYTE_ALIGNMENT(pMem)\x00%lld\x00fg & MEM_Real\x00%!.15g\x00sqlite3VdbeMemStringify\x00szNew>0\x00(pMem->flags & MEM_Dyn)==0 || pMem->szMalloc==0\x00sqlite3VdbeMemClearAndResize\x00p && p->pOut\x00sqlite3_context_db_handle\x00renameTableFunc\x00sqlite3VMPrintf\x00(p->zText==p->zBase)==!isMalloced(p)\x00sqlite3StrAccumFinish\x00p->mxAlloc>0 && !isMalloced(p)\x00strAccumFinishRealloc\x00sqlite3_mutex_held(pCtx->pOut->db->mutex)\x00sqlite3_result_text\x00(pMem->flags & MEM_RowSet)==0\x00enc!=0\x00sqlite3VdbeMemSetStr\x00sqlite3VdbeMemHandleBom\x00string or blob too big\x00sqlite3_result_error_toobig\x00renameTriggerFunc\x00%s%.*s\"%w\"\x00%s%s\x00(n&0x7fffffff)==n\x00sqlite3DbStrNDup\x00z[i]\x00sqlite3Dequote\x00julianday\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00p->pVdbe!=0\x00sqlite3StmtCurrentTime\x00sqlite3VdbeRealValue\x00enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE\x00e>=342\x00sqlite3AtoF\x00now\x0040f-21a-21d\x00zFormat[2]>='a' && zFormat[2]<='f'\x00getDigits\x0020c:20e\x0020e\x0020b:20e\x00(p->flags & MEM_Null)==0 || (p->flags & (MEM_Str|MEM_Blob))==0\x00sqlite3ValueBytes\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x00local time unavailable\x00sqlite3_result_error\x00second\x00minute\x00hour\x00sqlite3_result_double\x00%04d-%02d-%02d\x00%02d:%02d:%02d\x00%04d-%02d-%02d %02d:%02d:%02d\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%04d\x00sqlite3_result_error_nomem\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00affinity\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00length\x00instr\x00printf\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00sum\x00total\x00avg\x00count\x00group_concat\x00glob\x00like\x00coalesce\x00not authorized\x00sqlite3_extension_init\x00%s.%s\x00unable to open shared library [%s]\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00so\x00p && p->pFunc && p->pFunc->xFinalize\x00sqlite3_mutex_held(p->pOut->db->mutex)\x00sqlite3_aggregate_context\x00(pMem->flags & MEM_Agg)==0\x00createAggContext\x00p && p->pMem && p->pFunc && p->pFunc->xFinalize\x00sqlite3_aggregate_count\x00bind on a busy prepared statement: [%s]\x00p->isPrepareV2 || p->expmask==0\x00API called with NULL prepared statement\x00API called with finalized prepared statement\x00sqlite3Error\x00vdbeUnbind\x00sqlite3ApiExit\x00db->lookaside.bDisable>0\x00sqlite3OomClear\x00unopened\x00API call with %s database connection pointer\x00invalid\x00count>=0\x00sqliteDefaultBusyCallback\x00unable to close due to unfinalized statements or unfinished backups\x00btreeEnterAll\x00p->pNext==0 || p->pNext->pBt>p->pBt\x00p->pPrev==0 || p->pPrev->pBt<p->pBt\x00p->pNext==0 || p->pNext->db==p->db\x00p->pPrev==0 || p->pPrev->db==p->db\x00p->sharable || (p->pNext==0 && p->pPrev==0)\x00!p->locked || p->wantToLock>0\x00p->sharable || p->wantToLock==0\x00sqlite3_mutex_held(p->db->mutex)\x00(p->locked==0 && p->sharable) || p->pBt->db==p->db\x00sqlite3BtreeEnter\x00pLater->sharable\x00pLater->pNext==0 || pLater->pNext->pBt>pLater->pBt\x00!pLater->locked || pLater->wantToLock>0\x00sqlite3GlobalConfig.mutex.xMutexTry\x00sqlite3_mutex_try\x00btreeLockCarefully\x00p->locked==1\x00sqlite3_mutex_held(pBt->mutex)\x00p->db==pBt->db\x00unlockBtreeMutex\x00p->locked==0\x00sqlite3_mutex_notheld(p->pBt->mutex)\x00lockBtreeMutex\x00IsVirtual(p)\x00sqlite3BtreeHoldsAllMutexes(db)\x00sqlite3VtabDisconnect\x00db\x00pVTab->nRef>0\x00db->magic==SQLITE_MAGIC_OPEN || db->magic==SQLITE_MAGIC_ZOMBIE\x00sqlite3VtabUnlock\x00sqlite3VtabUnlockList\x00btreeLeaveAll\x00p->wantToLock>0\x00sqlite3BtreeLeave\x00connectionIsBusy\x00p\x00sqlite3BtreeIsInBackup\x00sqlite3ErrorWithMsg\x00db->nDb<=2\x00db->aDb==db->aDbStatic\x00db->lookaside.nOut==0\x00sqlite3RollbackAll\x00p==0 || sqlite3_mutex_held(p->db->mutex)\x00sqlite3BtreeIsInTrans\x00writeOnly==1 || writeOnly==0\x00tripCode==SQLITE_ABORT_ROLLBACK || tripCode==SQLITE_OK\x00rc==SQLITE_OK || (writeOnly==0 && rc2==SQLITE_OK)\x00p->pBt->inTransaction!=TRANS_NONE || p->pBt->nTransaction==0\x00p->pBt->inTransaction>=p->inTrans\x00TRANS_WRITE==pBt->inTransaction\x00countValidCursors(pBt, 1)==0\x00sqlite3BtreeRollback\x00pExcept==0 || pExcept->pBt==pBt\x00saveAllCursors\x00CURSOR_VALID==pCur->eState || CURSOR_SKIPNEXT==pCur->eState\x000==pCur->pKey\x00cursorHoldsMutex(pCur)\x00saveCursorPosition\x00CURSOR_VALID==pCur->eState\x00!pCur->curIntKey || !pCur->pKey\x00saveCursorKey\x00pCur->eState==CURSOR_VALID\x00pCur->curIntKey\x00sqlite3BtreeIntegerKey\x00CORRUPT_DB || memcmp(&info, &pCur->info, sizeof(info))==0\x00assertCellInfo\x00sqlite3BtreePayloadSize\x00pCur->iPage>=0 && pCur->apPage[pCur->iPage]\x00pCur->ix<pCur->apPage[pCur->iPage]->nCell\x00sqlite3BtreePayload\x00pPage\x00eOp==0 || eOp==1\x00pCur->ix<pPage->nCell\x00offset+amt <= pCur->info.nPayload\x00aPayload > pPage->aData\x00rc==SQLITE_OK && amt>0\x00pCur->aOverflow[iIdx]==0 || pCur->aOverflow[iIdx]==nextPage || CORRUPT_DB\x00pCur->curFlags & BTCF_ValidOvfl\x00pCur->pBtree->db==pBt->db\x00accessPayload\x00database corruption\x00(pPg->flags & PGHDR_MMAP)==0\x00pPager->eState>=PAGER_WRITER_LOCKED\x00assert_pager_state(pPager)\x00pPager->tempFile==0\x00sqlite3PagerWrite\x00p->eState==PAGER_OPEN || p->eState==PAGER_READER || p->eState==PAGER_WRITER_LOCKED || p->eState==PAGER_WRITER_CACHEMOD || p->eState==PAGER_WRITER_DBMOD || p->eState==PAGER_WRITER_FINISHED || p->eState==PAGER_ERROR\x00p->tempFile==0 || p->eLock==EXCLUSIVE_LOCK\x00p->tempFile==0 || pPager->changeCountDone\x00p->journalMode==PAGER_JOURNALMODE_OFF || p->useJournal\x00p->journalMode!=PAGER_JOURNALMODE_OFF || !isOpen(p->jfd)\x00!isOpen(p->fd)\x00p->noSync\x00p->journalMode==PAGER_JOURNALMODE_OFF || p->journalMode==PAGER_JOURNALMODE_MEMORY\x00p->eState!=PAGER_ERROR && p->eState!=PAGER_OPEN\x00pagerUseWal(p)==0\x00pPager->changeCountDone==0 || pPager->eLock>=RESERVED_LOCK\x00p->eLock!=PENDING_LOCK\x00!MEMDB\x00pPager->errCode==SQLITE_OK\x00sqlite3PcacheRefCount(pPager->pPCache)==0 || pPager->tempFile\x00p->eLock!=UNKNOWN_LOCK\x00p->eLock>=SHARED_LOCK\x00p->eLock>=RESERVED_LOCK\x00pPager->dbSize==pPager->dbOrigSize\x00pPager->dbOrigSize==pPager->dbFileSize\x00pPager->dbOrigSize==pPager->dbHintSize\x00pPager->setMaster==0\x00isOpen(p->jfd) || p->journalMode==PAGER_JOURNALMODE_OFF || p->journalMode==PAGER_JOURNALMODE_WAL\x00p->eLock==EXCLUSIVE_LOCK\x00!pagerUseWal(pPager)\x00p->eLock>=EXCLUSIVE_LOCK\x00pPager->dbOrigSize<=pPager->dbHintSize\x00pPager->errCode!=SQLITE_OK\x00sqlite3PcacheRefCount(pPager->pPCache)>0 || pPager->tempFile\x00assert_pager_state\x00sqlite3BitvecTestNotNull\x00pPager->useJournal\x00isOpen(pPager->jfd) || pagerUseWal(pPager)\x00isOpen(pPager->sjfd) || pPager->nSubRec==0\x00pagerUseWal(pPager) || pageInJournal(pPager, pPg) || pPg->pgno>pPager->dbOrigSize\x00pPager->nSavepoint>0\x00subjournalPage\x00MEMJOURNAL_DFLT_FILECHUNKSIZE==fileChunkSize(p->nChunkSize)\x00rc==SQLITE_OK || pFile->pMethods==0\x00sqlite3OsOpen\x00sqlite3JournalOpen\x00(iAmt+iOfst)<=p->endpoint.iOffset\x00p->readpoint.iOffset==0 || p->readpoint.pChunk!=0\x00pChunk!=0\x00memjrnlRead\x00iOfst==p->endpoint.iOffset || iOfst==0\x00iOfst>0 || p->pFirst==0\x00p->pFirst\x00!p->pFirst\x00memjrnlWrite\x00I/O OOM error\x00memjrnlTruncate\x00i>0\x00i<=p->iSize\x00sqlite3BitvecSet\x00addToSavepointBitvecs\x00(pPager->doNotSpill & SPILLFLAG_NOSYNC)==0\x00nPage>0\x00pg1<=pPg->pgno\x00(pg1+nPage)>pPg->pgno\x00(pPager->doNotSpill & SPILLFLAG_NOSYNC)!=0\x00pagerWriteLargeSector\x00pPager->eState==PAGER_WRITER_LOCKED || pPager->eState==PAGER_WRITER_CACHEMOD || pPager->eState==PAGER_WRITER_DBMOD\x00pPager->errCode==0\x00pPager->readOnly==0\x00pPager->eState>=PAGER_WRITER_CACHEMOD\x00(pPager->pInJournal!=0) == isOpen(pPager->jfd)\x00pagerUseWal(pPager)==0\x00pager_write\x00pPager->eState==PAGER_WRITER_LOCKED\x00pPager->pInJournal==0\x00rc!=SQLITE_OK || isOpen(pPager->jfd)\x00pager_open_journal\x00pPager->zFilename && pPager->zFilename[0]\x00databaseIsUnmoved\x00isOpen(pPager->jfd)\x00isOpen(pPager->fd) || pPager->noSync\x00pPager->journalHdr <= pPager->journalOff\x00writeJournalHdr\x00offset%JOURNAL_HDR_SZ(pPager)==0\x00offset>=c\x00(offset-c)<JOURNAL_HDR_SZ(pPager)\x00journalHdrOffset\x00N>0\x00sqlite3_randomness\x00p->nRef>0\x00sqlite3PcachePageSanity(p)\x00(p->flags & (PGHDR_DIRTY|PGHDR_CLEAN))==PGHDR_DIRTY\x00sqlite3PcacheMakeDirty\x00pPg!=0\x00pPg->pgno>0 || pPg->pPager==0\x00pCache!=0\x00(pPg->flags & PGHDR_DIRTY)==0\x00pCache->pDirty!=pPg\x00pCache->pDirtyTail!=pPg\x00pPg->flags & PGHDR_DIRTY\x00sqlite3PcachePageSanity\x00pPage->pDirtyNext || pPage==p->pDirtyTail\x00pPage->pDirtyPrev || pPage==p->pDirty\x00pPage==p->pDirtyTail\x00pPage==p->pDirty\x00p->bPurgeable || p->eCreate==2\x00p->bPurgeable==0 || p->eCreate==1\x00pPage->pDirtyNext==0 && pPage->pDirtyPrev==0 && p->pDirty!=pPage\x00pPage->pDirtyNext->pDirtyPrev==0\x00p->eCreate==2\x00pcacheManageDirtyList\x00pPg->pgno!=PAGER_MJ_PGNO(pPager)\x00pPager->journalHdr<=pPager->journalOff\x00pPager->pInJournal!=0\x00pagerAddPageToRollbackJournal\x00sqlite3PagerUnrefNotNull\x00pPager->fd->pMethods->iVersion>=3\x00pagerReleaseMapPage\x00sqlite3PcacheRelease\x00pPager->eState==PAGER_READER\x00pagerUnlockAndRollback\x00pPager->eState==PAGER_READER || rc!=SQLITE_OK\x00rc==SQLITE_OK || rc==SQLITE_FULL || rc==SQLITE_CORRUPT || rc==SQLITE_NOMEM || (rc&0xFF)==SQLITE_IOERR || rc==SQLITE_CANTOPEN\x00sqlite3PagerRollback\x00op==SAVEPOINT_RELEASE || op==SAVEPOINT_ROLLBACK\x00iSavepoint>=0 || op==SAVEPOINT_ROLLBACK\x00rc==SQLITE_OK\x00rc!=SQLITE_DONE\x00sqlite3PagerSavepoint\x00pPager->eState!=PAGER_ERROR\x00pagerUseWal(pPager)==0 || szJ==0\x00rc!=SQLITE_OK || pPager->journalOff>=szJ\x00offset==(i64)ii*(4+pPager->pageSize)\x00pagerPlaybackSavepoint\x00walFramePgno(pWal, iFrame)!=1\x00sqlite3WalUndo\x00pWal->nWiData>0 && pWal->apWiData[0]\x00walIndexHdr\x00(iHash==0 || iFrame>HASHTABLE_NPAGE_ONE) && (iHash>=1 || iFrame<=HASHTABLE_NPAGE_ONE) && (iHash<=1 || iFrame>(HASHTABLE_NPAGE_ONE+HASHTABLE_NPAGE)) && (iHash>=2 || iFrame<=HASHTABLE_NPAGE_ONE+HASHTABLE_NPAGE) && (iHash<=2 || iFrame>(HASHTABLE_NPAGE_ONE+2*HASHTABLE_NPAGE))\x00walFramePage\x00pWal->writeLock\x00pWal->nWiData>walFramePage(pWal->hdr.mxFrame)\x00pWal->apWiData[walFramePage(pWal->hdr.mxFrame)]\x00iLimit>0\x00walCleanupHash\x00rc==SQLITE_OK || iHash>0\x00iPage==0 || *ppPage || rc!=SQLITE_OK\x00walIndexPage\x00walHashGet\x00pagerUseWal(pPager)\x00pagerUndoCallback\x00pPager!=0\x00pgno!=0\x00pPager->pPCache!=0\x00pPage==0 || pPager->hasHeldSharedLock\x00sqlite3PagerLookup\x00pCache->pCache!=0\x00createFlag==3 || createFlag==0\x00pCache->eCreate==((pCache->bPurgeable && pCache->pDirty) ? 1 : 2)\x00eCreate==0 || eCreate==1 || eCreate==2\x00createFlag==0 || pCache->eCreate==eCreate\x00createFlag==0 || eCreate==1+(!pCache->bPurgeable||!pCache->pDirty)\x00sqlite3PcacheFetch\x00sqlite3PcachePageSanity(pPgHdr)\x00sqlite3PcacheFetchFinish\x00pPgHdr->pPage==0\x00pcacheFetchFinishWithInit\x00p->nRef==1\x00sqlite3PcacheDrop\x00pWal->readLock>=0 || pWal->lockError\x00iFrame>iRead || CORRUPT_DB\x00sqlite3WalFindFrame\x00iPage>0\x00walHash\x00pPager->eState>=PAGER_READER && !MEMDB\x00isOpen(pPager->fd)\x00readDbPage\x00sqlite3_mutex_held(p->pSrc->pBt->mutex)\x00sqlite3BackupRestart\x00pcacheSortDirtyList\x00pA!=0 && pB!=0\x00pcacheMergeDirtyList\x00(isMainJrnl&~1)==0\x00(isSavepnt&~1)==0\x00isMainJrnl || pDone\x00isSavepnt || pDone==0\x00aData\x00pagerUseWal(pPager)==0 || (!isMainJrnl && isSavepnt)\x00pPager->eState>=PAGER_WRITER_CACHEMOD || (pPager->eState==PAGER_OPEN && pPager->eLock==EXCLUSIVE_LOCK)\x00pPager->eState>=PAGER_WRITER_CACHEMOD || isMainJrnl\x00!isSavepnt\x00pPg || !MEMDB\x00pPager->eState!=PAGER_OPEN || pPg==0 || pPager->tempFile\x00isSavepnt\x00(pPager->doNotSpill & SPILLFLAG_ROLLBACK)==0\x00(pPager->doNotSpill & SPILLFLAG_ROLLBACK)!=0\x00pager_playback_one_page\x00p->pDestDb\x00rc!=SQLITE_BUSY && rc!=SQLITE_LOCKED\x00backupUpdate\x00isFatalError\x00sqlite3BtreeGetReserveNoMutex(p->pSrc)>=0\x00p->bDestLocked\x00!isFatalError(p->rc)\x00iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt)\x00zSrcData\x00sqlite3_mutex_held(p->pBt->mutex)\x00sqlite3BtreeGetReserveNoMutex\x00backupOnePage\x00pPg->nRef>0 || pPg->pPager->memDb\x00sqlite3PagerGetData\x00sqlite3BtreeHoldsMutex(p)\x00((p->pBt->nPage)&0x8000000)==0\x00p->sharable==0 || p->locked==0 || p->wantToLock>0\x00p->sharable==0 || p->locked==0 || p->db==p->pBt->db\x00p->sharable==0 || p->locked==0 || sqlite3_mutex_held(p->pBt->mutex)\x00p->sharable==0 || p->locked==0 || sqlite3_mutex_held(p->db->mutex)\x00sqlite3BtreeHoldsMutex\x00sqlite3BtreeLastPage\x00readJournalHdr\x00pageSize==0 || (pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE)\x00nReserve>=0 && nReserve<1000\x00sqlite3PagerSetPagesize\x00p->pgno>0\x00p->flags&PGHDR_DIRTY\x00sqlite3PcacheTruncate\x00(p->flags & PGHDR_CLEAN)==0\x00sqlite3PcacheMakeClean\x00pCache->nRefSum==0 && pCache->pDirty==0\x00sqlite3PcacheSetPageSize\x00getPageError\x00USEFETCH(pPager)\x00pPager->eState>=PAGER_READER\x00pPager->hasHeldSharedLock==1\x00getPageMMap\x00pPager->nExtra>=8\x00p->pExtra==(void *)&p[1]\x00p->pPage==0\x00p->flags==PGHDR_MMAP\x00p->pPager==pPager\x00pagerAcquireMapPage\x00pPg==(*ppPage)\x00pPg->pgno==pgno\x00pPg->pPager==pPager || pPg->pPager==0\x00pgno<=PAGER_MAX_PGNO && pgno!=PAGER_MJ_PGNO(pPager)\x00!isOpen(pPager->fd) || !MEMDB\x00pPg->pPager==pPager\x00rc!=SQLITE_OK\x00getPageNormal\x00sqlite3PcachePagecount\x00aWalData[3]!=pWal->nCkpt || aWalData[0]<=pWal->hdr.mxFrame\x00sqlite3WalSavepointUndo\x00isOpen(pPager->jfd) || pPager->pInJournal==0\x00sqlite3JournalIsInMemory(pPager->jfd)==0\x00pPager->journalMode==PAGER_JOURNALMODE_DELETE || pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->journalMode==PAGER_JOURNALMODE_WAL\x00rc2==SQLITE_OK\x00pPager->eLock==EXCLUSIVE_LOCK\x00pager_end_transaction\x00!sqlite3JournalIsInMemory(pPager->jfd)\x00zeroJournalHdr\x00dirSync==0 || dirSync==1\x00sqlite3OsDelete\x00pPager->eState!=PAGER_READER\x00pager_truncate\x00pWal->writeLock==0\x00pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE || op==-1\x00pWal->readLock>=0 || (op<=0 && pWal->exclusiveMode==0)\x00pWal->exclusiveMode==0\x00pWal->readLock>=0\x00sqlite3WalExclusiveMode\x00!pPager->exclusiveMode || pPager->eLock==eLock\x00eLock==NO_LOCK || eLock==SHARED_LOCK\x00eLock!=NO_LOCK || pagerUseWal(pPager)==0\x00pPager->eLock>=eLock\x00pagerUnlockDb\x00pPager->journalOff==JOURNAL_HDR_SZ(pPager)\x00recovered %d pages from %s\x00pager_playback\x00sqlite3PagerSync\x00!isOpen(pJournal)\x00pager_delmaster\x00isOpen(pPager->fd) || pPager->tempFile\x00setSectorSize\x00rc==SQLITE_OK || !MEMDB\x00pPager->errCode==SQLITE_FULL || pPager->errCode==SQLITE_OK || (pPager->errCode & 0xff)==SQLITE_IOERR\x00pager_error\x00pPager->eState==PAGER_READER || pPager->eState==PAGER_OPEN || pPager->eState==PAGER_ERROR\x00!isOpen(pPager->jfd)\x00pPager->errCode || pPager->eState!=PAGER_ERROR\x00pPager->errCode==SQLITE_OK || !MEMDB\x00pager_unlock\x00EIGHT_BYTE_ALIGNMENT(pNew)\x00sqlite3Realloc\x00pPgnoNext\x00next==0 || rc==SQLITE_DONE\x00rc==SQLITE_OK || pPage==0\x00getOverflowPage\x00ptrmapPageno\x00offset <= (int)pBt->usableSize-5\x00pEType!=0\x00ptrmapGet\x00flags==0 || flags==PAGER_GET_NOCONTENT || flags==PAGER_GET_READONLY\x00btreeGetPage\x00pPage->aData==sqlite3PagerGetData(pDbPage)\x00btreePageFromDbPage\x00pPage->aData\x00pPage->pBt\x00pPage->pDbPage!=0\x00sqlite3PagerGetExtra(pPage->pDbPage) == (void*)pPage\x00sqlite3PagerGetData(pPage->pDbPage)==pPage->aData\x00sqlite3_mutex_held(pPage->pBt->mutex)\x00releasePageNotNull\x00(writeOnly==0 || writeOnly==1) && BTCF_WriteFlag==1\x00sqlite3BtreeTripAllCursors\x00sqlite3BtreeClearCursor\x00pPager->eState!=PAGER_WRITER_FINISHED\x00sqlite3PagerPagecount\x00btreeEndTransaction\x00pLock->eLock==READ_LOCK || pLock->pBtree==p\x00downgradeAllSharedCacheTableLocks\x00p->sharable || 0==*ppIter\x00p->inTrans>0\x00(pBt->btsFlags & BTS_EXCLUSIVE)==0 || pBt->pWriter==pLock->pBtree\x00pLock->pBtree->inTrans>=pLock->eLock\x00pLock->iTable!=1 || pLock==&p->lock\x00(pBt->btsFlags & BTS_PENDING)==0 || pBt->pWriter\x00clearAllSharedCacheTableLocks\x00countValidCursors(pBt,0)==0 || pBt->inTransaction>TRANS_NONE\x00pPage1->aData\x00sqlite3PagerRefcount(pBt->pPager)==1\x00unlockBtreeIfUnused\x00pNew!=0\x00sqlite3HashInit\x00pH!=0\x00sqlite3HashClear\x00!ExprHasProperty(p, EP_IntValue) || p->u.iValue>=0\x00p->pLeft==0\x00p->pRight==0\x00p->x.pSelect==0\x00p->x.pList==0 || p->pRight==0\x00sqlite3ExprDeleteNN\x00pList->nExpr>0\x00exprListDeleteNN\x00pIndex->pSchema==pTable->pSchema || (IsVirtual(pTable) && pIndex->idxType!=SQLITE_IDXTYPE_APPDEF)\x00db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema)\x00pOld==pIndex || pOld==0\x00nLookaside==0 || nLookaside==db->lookaside.nOut\x00deleteTable\x00pKey!=0\x00pH->htsize>0\x00sqlite3HashInsert\x00elem!=0\x00findElementWithHash\x00pEntry->count>=0\x00pH->first==0\x00pH->count==0\x00removeElementGivenHash\x00iDb>=0 && iDb<db->nDb\x00sqlite3SchemaMutexHeld\x00i>=0 && i<db->nDb\x00sqlite3SchemaToIndex\x00db==0 || IsVirtual(pTab) || sqlite3SchemaMutexHeld(db, 0, pTab->pSchema)\x00pFKey->isDeferred==0 || pFKey->isDeferred==1\x00sqlite3FkDelete\x00pTable!=0\x00sqlite3DeleteColumnNames\x00db==0 || sqlite3SchemaMutexHeld(db, 0, p->pSchema)\x00db2\x00!db || pRet\x00vtabDisconnectAll\x00p->wantToLock==0 && p->locked==0\x00!pBt->pCursor\x00p->wantToLock==0\x00sqlite3BtreeClose\x00pBt->pCursor!=0\x00sqlite3BtreeCloseCursor\x00sqlite3_mutex_notheld(pBt->mutex)\x00removeFromSharingList\x00sqlite3GlobalConfig.mutex.xMutexFree\x00sqlite3_mutex_free\x00db || pagerUseWal(pPager)==0\x00db || pPager->pWal==0\x00!pPager->aSavepoint && !pPager->pInJournal\x00!isOpen(pPager->jfd) && !isOpen(pPager->sjfd)\x00sqlite3PagerClose\x00pWal->ckptLock==0\x00eMode!=SQLITE_CHECKPOINT_PASSIVE || xBusy==0\x00sqlite3WalCheckpoint\x00pChanged\x00page0 || pWal->writeLock==0\x00badHdr==0 || pWal->writeLock==0\x00walIndexReadHdr\x00walIndexTryHdr\x00nByte>=8\x00(nByte&0x00000007)==0\x00walChecksumBytes\x00pWal->ckptLock==1 || pWal->ckptLock==0\x00recovered %d frames from WAL file %s\x00walIndexRecover\x00cannot open file\x00idx <= HASHTABLE_NSLOT/2 + 1\x00!aPgno[idx]\x00walIndexAppend\x00walIndexWriteHdr\x00walCkptInfo\x00pIter\x00y<=pWal->hdr.mxFrame\x00walFramePgno(pWal, iFrame)==iDbpage\x00pInfo->nBackfill==pWal->hdr.mxFrame\x00pWal->ckptLock && pWal->hdr.mxFrame>0\x00walIteratorInit\x00nList<=HASHTABLE_NPAGE && nList>0\x00iSub<ArraySize(aSub)\x00p->aList && p->nList<=(1<<iSub)\x00p->aList==&aList[iList&~((2<<iSub)-1)]\x00p->nList<=(1<<iSub)\x00p->aList==&aList[nList&~((2<<iSub)-1)]\x00aMerge==aList\x00aContent[aList[i]] > aContent[aList[i-1]]\x00walMergesort\x00nLeft>0 && nRight>0\x00iLeft>=nLeft || aContent[aLeft[iLeft]]>dbpage\x00iRight>=nRight || aContent[aRight[iRight]]>dbpage\x00walMerge\x00walCheckpoint\x00iMin<0xffffffff\x00walIteratorNext\x00pInfo->aReadMark[0]==0\x00walRestartHdr\x00cannot limit WAL size: %s\x00sqlite3PcacheClose\x00sqlite3LeaveMutexAndCloseZombie\x00sqlite3CloseExtensions\x00p->flags==MEM_Null && p->z==0\x00sqlite3_value_blob\x00pVm->db\x00columnMem\x00p->db!=0\x00columnMallocFailure\x00columnName\x00pMem->z || pMem->n==0\x00sqlite3VdbeIntValue\x00u<=LARGEST_INT64\x00u-1==LARGEST_INT64\x00sqlite3Atoi64\x00922337203685477580\x00create\x00trigger\x00temp\x00temporary\x00end\x00explain\x00!db->mallocFailed\x00sqlite3_create_collation_v2\x00unable to delete/modify collation sequence due to active statements\x00createCollation\x00enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE\x00pDel==0 || pDel==pColl\x00sqlite3HashFind\x00findCollSeqEntry\x00sqlite3FindCollSeq\x00sqlite3_create_collation16\x00(m.flags & MEM_Term)!=0 || db->mallocFailed\x00(m.flags & MEM_Str)!=0 || db->mallocFailed\x00m.z || db->mallocFailed\x00sqlite3Utf16to8\x00unable to delete/modify user-function due to active statements\x00p || db->mallocFailed\x00sqlite3CreateFunc\x00nArg>=(-2)\x00nArg>=(-1) || createFlag==0\x00sqlite3FindFunction\x00sqlite3_create_function_v2\x00sqlite3_create_function16\x00pDel==0 || pDel==pMod\x00sqlite3VtabCreateModule\x00IsVirtual(pTab)\x00pTab->pIndex==0\x00pIdx->pNext==0\x00%s\x00(rc&0xff)==rc\x00sqlite3_declare_vtab\x00zSql!=0\x00pzErrMsg!=0\x00pParse->pNewTable==0\x00pParse->pNewTrigger==0\x00pParse->nVar==0\x00pParse->pVList==0\x00tokenType==TK_SPACE || tokenType==TK_ILLEGAL\x00unrecognized token: \"%.*s\"\x00nErr==0\x00nErr==0 || pParse->rc!=SQLITE_OK\x00sqlite3RunParser\x00yypParser->yytos!=0\x00%sInput '%s'\x0a\x00yyact == YY_ERROR_ACTION\x00%sSyntax Error!\x0a\x00%sReturn. Stack=\x00%c%s\x00]\x0a\x00sqlite3Parser\x00$\x00SEMI\x00EXPLAIN\x00QUERY\x00PLAN\x00BEGIN\x00TRANSACTION\x00DEFERRED\x00IMMEDIATE\x00EXCLUSIVE\x00COMMIT\x00END\x00ROLLBACK\x00SAVEPOINT\x00RELEASE\x00TO\x00TABLE\x00CREATE\x00IF\x00NOT\x00EXISTS\x00TEMP\x00LP\x00RP\x00AS\x00WITHOUT\x00COMMA\x00ID\x00ABORT\x00ACTION\x00AFTER\x00ANALYZE\x00ASC\x00ATTACH\x00BEFORE\x00BY\x00CASCADE\x00CAST\x00COLUMNKW\x00CONFLICT\x00DATABASE\x00DESC\x00DETACH\x00EACH\x00FAIL\x00FOR\x00IGNORE\x00INITIALLY\x00INSTEAD\x00LIKE_KW\x00MATCH\x00NO\x00KEY\x00OF\x00OFFSET\x00PRAGMA\x00RAISE\x00RECURSIVE\x00REPLACE\x00RESTRICT\x00ROW\x00TRIGGER\x00VACUUM\x00VIEW\x00VIRTUAL\x00WITH\x00REINDEX\x00RENAME\x00CTIME_KW\x00ANY\x00OR\x00AND\x00IS\x00BETWEEN\x00IN\x00ISNULL\x00NOTNULL\x00NE\x00EQ\x00GT\x00LE\x00LT\x00GE\x00ESCAPE\x00BITAND\x00BITOR\x00LSHIFT\x00RSHIFT\x00PLUS\x00MINUS\x00STAR\x00SLASH\x00REM\x00CONCAT\x00COLLATE\x00BITNOT\x00INDEXED\x00STRING\x00JOIN_KW\x00CONSTRAINT\x00DEFAULT\x00PRIMARY\x00UNIQUE\x00CHECK\x00REFERENCES\x00AUTOINCR\x00ON\x00INSERT\x00DELETE\x00UPDATE\x00SET\x00DEFERRABLE\x00FOREIGN\x00DROP\x00UNION\x00ALL\x00EXCEPT\x00INTERSECT\x00SELECT\x00VALUES\x00DISTINCT\x00DOT\x00FROM\x00JOIN\x00USING\x00ORDER\x00GROUP\x00HAVING\x00LIMIT\x00WHERE\x00INTO\x00FLOAT\x00BLOB\x00INTEGER\x00VARIABLE\x00CASE\x00WHEN\x00THEN\x00ELSE\x00INDEX\x00ALTER\x00ADD\x00error\x00input\x00cmdlist\x00ecmd\x00cmdx\x00cmd\x00transtype\x00trans_opt\x00nm\x00savepoint_opt\x00create_table\x00create_table_args\x00createkw\x00ifnotexists\x00dbnm\x00columnlist\x00conslist_opt\x00table_options\x00select\x00columnname\x00carglist\x00typetoken\x00typename\x00signed\x00plus_num\x00minus_num\x00ccons\x00term\x00expr\x00onconf\x00sortorder\x00autoinc\x00eidlist_opt\x00refargs\x00defer_subclause\x00refarg\x00refact\x00init_deferred_pred_opt\x00conslist\x00tconscomma\x00tcons\x00sortlist\x00eidlist\x00defer_subclause_opt\x00orconf\x00resolvetype\x00raisetype\x00ifexists\x00fullname\x00selectnowith\x00oneselect\x00with\x00multiselect_op\x00distinct\x00selcollist\x00from\x00where_opt\x00groupby_opt\x00having_opt\x00orderby_opt\x00limit_opt\x00values\x00nexprlist\x00exprlist\x00sclp\x00as\x00seltablist\x00stl_prefix\x00joinop\x00indexed_opt\x00on_opt\x00using_opt\x00idlist\x00setlist\x00insert_cmd\x00idlist_opt\x00likeop\x00between_op\x00in_op\x00paren_exprlist\x00case_operand\x00case_exprlist\x00case_else\x00uniqueflag\x00collate\x00nmnum\x00trigger_decl\x00trigger_cmd_list\x00trigger_time\x00trigger_event\x00foreach_clause\x00when_clause\x00trigger_cmd\x00trnm\x00tridxby\x00database_kw_opt\x00key_opt\x00add_column_fullname\x00kwcolumn_opt\x00create_vtab\x00vtabarglist\x00vtabarg\x00vtabargtoken\x00lp\x00anylist\x00wqlist\x00stateno <= YY_SHIFT_COUNT\x00iLookAhead!=YYNOCODE\x00%sFALLBACK %s => %s\x0a\x00yyFallback[iFallback]==0\x00%sWILDCARD %s => %s\x0a\x00yy_find_shift_action\x00%sStack Overflow!\x0a\x00parser stack overflow\x00pParser->yytos!=0\x00pParser->yytos > pParser->yystack\x00%sPopping %s\x0a\x00yy_pop_parser_stack\x00%sShift '%s', go to state %d\x0a\x00%sShift '%s'\x0a\x00%sReduce [%s], go to state %d.\x0a\x00rowid\x00unknown table option: %.*s\x00#%d\x00%.*s\x00set list\x00t.n>=2\x00near \"%T\": syntax error\x00too many arguments on function %T\x00yymsp[-2].minor.yy145!=0\x00yymsp[-1].minor.yy145!=0\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00yyruleno!=277\x00yyruleno!=294\x00yyruleno!=295\x00yyruleno!=301\x00yyruleno!=303\x00yyruleno!=304\x00yyruleno!=305\x00yyruleno!=309\x00yyruleno!=312\x00yyruleno!=313\x00yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0])\x00yyact == YY_ACCEPT_ACTION\x00explain ::= EXPLAIN\x00explain ::= EXPLAIN QUERY PLAN\x00cmdx ::= cmd\x00cmd ::= BEGIN transtype trans_opt\x00transtype ::=\x00transtype ::= DEFERRED\x00transtype ::= IMMEDIATE\x00transtype ::= EXCLUSIVE\x00cmd ::= COMMIT trans_opt\x00cmd ::= END trans_opt\x00cmd ::= ROLLBACK trans_opt\x00cmd ::= SAVEPOINT nm\x00cmd ::= RELEASE savepoint_opt nm\x00cmd ::= ROLLBACK trans_opt TO savepoint_opt nm\x00create_table ::= createkw temp TABLE ifnotexists nm dbnm\x00createkw ::= CREATE\x00ifnotexists ::=\x00ifnotexists ::= IF NOT EXISTS\x00temp ::= TEMP\x00temp ::=\x00create_table_args ::= LP columnlist conslist_opt RP table_options\x00create_table_args ::= AS select\x00table_options ::=\x00table_options ::= WITHOUT nm\x00columnname ::= nm typetoken\x00typetoken ::=\x00typetoken ::= typename LP signed RP\x00typetoken ::= typename LP signed COMMA signed RP\x00typename ::= typename ID|STRING\x00ccons ::= CONSTRAINT nm\x00ccons ::= DEFAULT term\x00ccons ::= DEFAULT LP expr RP\x00ccons ::= DEFAULT PLUS term\x00ccons ::= DEFAULT MINUS term\x00ccons ::= DEFAULT ID|INDEXED\x00ccons ::= NOT NULL onconf\x00ccons ::= PRIMARY KEY sortorder onconf autoinc\x00ccons ::= UNIQUE onconf\x00ccons ::= CHECK LP expr RP\x00ccons ::= REFERENCES nm eidlist_opt refargs\x00ccons ::= defer_subclause\x00ccons ::= COLLATE ID|STRING\x00autoinc ::=\x00autoinc ::= AUTOINCR\x00refargs ::=\x00refargs ::= refargs refarg\x00refarg ::= MATCH nm\x00refarg ::= ON INSERT refact\x00refarg ::= ON DELETE refact\x00refarg ::= ON UPDATE refact\x00refact ::= SET NULL\x00refact ::= SET DEFAULT\x00refact ::= CASCADE\x00refact ::= RESTRICT\x00refact ::= NO ACTION\x00defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt\x00defer_subclause ::= DEFERRABLE init_deferred_pred_opt\x00init_deferred_pred_opt ::=\x00init_deferred_pred_opt ::= INITIALLY DEFERRED\x00init_deferred_pred_opt ::= INITIALLY IMMEDIATE\x00conslist_opt ::=\x00tconscomma ::= COMMA\x00tcons ::= CONSTRAINT nm\x00tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf\x00tcons ::= UNIQUE LP sortlist RP onconf\x00tcons ::= CHECK LP expr RP onconf\x00tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt\x00defer_subclause_opt ::=\x00onconf ::=\x00onconf ::= ON CONFLICT resolvetype\x00orconf ::=\x00orconf ::= OR resolvetype\x00resolvetype ::= IGNORE\x00resolvetype ::= REPLACE\x00cmd ::= DROP TABLE ifexists fullname\x00ifexists ::= IF EXISTS\x00ifexists ::=\x00cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select\x00cmd ::= DROP VIEW ifexists fullname\x00cmd ::= select\x00select ::= with selectnowith\x00selectnowith ::= selectnowith multiselect_op oneselect\x00multiselect_op ::= UNION\x00multiselect_op ::= UNION ALL\x00multiselect_op ::= EXCEPT|INTERSECT\x00oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt\x00values ::= VALUES LP nexprlist RP\x00values ::= values COMMA LP exprlist RP\x00distinct ::= DISTINCT\x00distinct ::= ALL\x00distinct ::=\x00sclp ::=\x00selcollist ::= sclp expr as\x00selcollist ::= sclp STAR\x00selcollist ::= sclp nm DOT STAR\x00as ::= AS nm\x00as ::=\x00from ::=\x00from ::= FROM seltablist\x00stl_prefix ::= seltablist joinop\x00stl_prefix ::=\x00seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt\x00seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt\x00seltablist ::= stl_prefix LP select RP as on_opt using_opt\x00seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt\x00dbnm ::=\x00dbnm ::= DOT nm\x00fullname ::= nm dbnm\x00joinop ::= COMMA|JOIN\x00joinop ::= JOIN_KW JOIN\x00joinop ::= JOIN_KW nm JOIN\x00joinop ::= JOIN_KW nm nm JOIN\x00on_opt ::= ON expr\x00on_opt ::=\x00indexed_opt ::=\x00indexed_opt ::= INDEXED BY nm\x00indexed_opt ::= NOT INDEXED\x00using_opt ::= USING LP idlist RP\x00using_opt ::=\x00orderby_opt ::=\x00orderby_opt ::= ORDER BY sortlist\x00sortlist ::= sortlist COMMA expr sortorder\x00sortlist ::= expr sortorder\x00sortorder ::= ASC\x00sortorder ::= DESC\x00sortorder ::=\x00groupby_opt ::=\x00groupby_opt ::= GROUP BY nexprlist\x00having_opt ::=\x00having_opt ::= HAVING expr\x00limit_opt ::=\x00limit_opt ::= LIMIT expr\x00limit_opt ::= LIMIT expr OFFSET expr\x00limit_opt ::= LIMIT expr COMMA expr\x00cmd ::= with DELETE FROM fullname indexed_opt where_opt\x00where_opt ::=\x00where_opt ::= WHERE expr\x00cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt\x00setlist ::= setlist COMMA nm EQ expr\x00setlist ::= setlist COMMA LP idlist RP EQ expr\x00setlist ::= nm EQ expr\x00setlist ::= LP idlist RP EQ expr\x00cmd ::= with insert_cmd INTO fullname idlist_opt select\x00cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES\x00insert_cmd ::= INSERT orconf\x00insert_cmd ::= REPLACE\x00idlist_opt ::=\x00idlist_opt ::= LP idlist RP\x00idlist ::= idlist COMMA nm\x00idlist ::= nm\x00expr ::= LP expr RP\x00term ::= NULL\x00expr ::= ID|INDEXED\x00expr ::= JOIN_KW\x00expr ::= nm DOT nm\x00expr ::= nm DOT nm DOT nm\x00term ::= FLOAT|BLOB\x00term ::= STRING\x00term ::= INTEGER\x00expr ::= VARIABLE\x00expr ::= expr COLLATE ID|STRING\x00expr ::= CAST LP expr AS typetoken RP\x00expr ::= ID|INDEXED LP distinct exprlist RP\x00expr ::= ID|INDEXED LP STAR RP\x00term ::= CTIME_KW\x00expr ::= LP nexprlist COMMA expr RP\x00expr ::= expr AND expr\x00expr ::= expr OR expr\x00expr ::= expr LT|GT|GE|LE expr\x00expr ::= expr EQ|NE expr\x00expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr\x00expr ::= expr PLUS|MINUS expr\x00expr ::= expr STAR|SLASH|REM expr\x00expr ::= expr CONCAT expr\x00likeop ::= NOT LIKE_KW|MATCH\x00expr ::= expr likeop expr\x00expr ::= expr likeop expr ESCAPE expr\x00expr ::= expr ISNULL|NOTNULL\x00expr ::= expr NOT NULL\x00expr ::= expr IS expr\x00expr ::= expr IS NOT expr\x00expr ::= NOT expr\x00expr ::= BITNOT expr\x00expr ::= MINUS expr\x00expr ::= PLUS expr\x00between_op ::= BETWEEN\x00between_op ::= NOT BETWEEN\x00expr ::= expr between_op expr AND expr\x00in_op ::= IN\x00in_op ::= NOT IN\x00expr ::= expr in_op LP exprlist RP\x00expr ::= LP select RP\x00expr ::= expr in_op LP select RP\x00expr ::= expr in_op nm dbnm paren_exprlist\x00expr ::= EXISTS LP select RP\x00expr ::= CASE case_operand case_exprlist case_else END\x00case_exprlist ::= case_exprlist WHEN expr THEN expr\x00case_exprlist ::= WHEN expr THEN expr\x00case_else ::= ELSE expr\x00case_else ::=\x00case_operand ::= expr\x00case_operand ::=\x00exprlist ::=\x00nexprlist ::= nexprlist COMMA expr\x00nexprlist ::= expr\x00paren_exprlist ::=\x00paren_exprlist ::= LP exprlist RP\x00cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt\x00uniqueflag ::= UNIQUE\x00uniqueflag ::=\x00eidlist_opt ::=\x00eidlist_opt ::= LP eidlist RP\x00eidlist ::= eidlist COMMA nm collate sortorder\x00eidlist ::= nm collate sortorder\x00collate ::=\x00collate ::= COLLATE ID|STRING\x00cmd ::= DROP INDEX ifexists fullname\x00cmd ::= VACUUM\x00cmd ::= VACUUM nm\x00cmd ::= PRAGMA nm dbnm\x00cmd ::= PRAGMA nm dbnm EQ nmnum\x00cmd ::= PRAGMA nm dbnm LP nmnum RP\x00cmd ::= PRAGMA nm dbnm EQ minus_num\x00cmd ::= PRAGMA nm dbnm LP minus_num RP\x00plus_num ::= PLUS INTEGER|FLOAT\x00minus_num ::= MINUS INTEGER|FLOAT\x00cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END\x00trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause\x00trigger_time ::= BEFORE\x00trigger_time ::= AFTER\x00trigger_time ::= INSTEAD OF\x00trigger_time ::=\x00trigger_event ::= DELETE|INSERT\x00trigger_event ::= UPDATE\x00trigger_event ::= UPDATE OF idlist\x00when_clause ::=\x00when_clause ::= WHEN expr\x00trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI\x00trigger_cmd_list ::= trigger_cmd SEMI\x00trnm ::= nm DOT nm\x00tridxby ::= INDEXED BY nm\x00tridxby ::= NOT INDEXED\x00trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt\x00trigger_cmd ::= insert_cmd INTO trnm idlist_opt select\x00trigger_cmd ::= DELETE FROM trnm tridxby where_opt\x00trigger_cmd ::= select\x00expr ::= RAISE LP IGNORE RP\x00expr ::= RAISE LP raisetype COMMA nm RP\x00raisetype ::= ROLLBACK\x00raisetype ::= ABORT\x00raisetype ::= FAIL\x00cmd ::= DROP TRIGGER ifexists fullname\x00cmd ::= ATTACH database_kw_opt expr AS expr key_opt\x00cmd ::= DETACH database_kw_opt expr\x00key_opt ::=\x00key_opt ::= KEY expr\x00cmd ::= REINDEX\x00cmd ::= REINDEX nm dbnm\x00cmd ::= ANALYZE\x00cmd ::= ANALYZE nm dbnm\x00cmd ::= ALTER TABLE fullname RENAME TO nm\x00cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist\x00add_column_fullname ::= fullname\x00cmd ::= create_vtab\x00cmd ::= create_vtab LP vtabarglist RP\x00create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm\x00vtabarg ::=\x00vtabargtoken ::= ANY\x00vtabargtoken ::= lp anylist RP\x00lp ::= LP\x00with ::=\x00with ::= WITH wqlist\x00with ::= WITH RECURSIVE wqlist\x00wqlist ::= nm eidlist_opt AS LP select RP\x00wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP\x00input ::= cmdlist\x00cmdlist ::= cmdlist ecmd\x00cmdlist ::= ecmd\x00ecmd ::= SEMI\x00ecmd ::= explain cmdx SEMI\x00explain ::=\x00trans_opt ::=\x00trans_opt ::= TRANSACTION\x00trans_opt ::= TRANSACTION nm\x00savepoint_opt ::= SAVEPOINT\x00savepoint_opt ::=\x00cmd ::= create_table create_table_args\x00columnlist ::= columnlist COMMA columnname carglist\x00columnlist ::= columnname carglist\x00nm ::= ID|INDEXED\x00nm ::= STRING\x00nm ::= JOIN_KW\x00typetoken ::= typename\x00typename ::= ID|STRING\x00signed ::= plus_num\x00signed ::= minus_num\x00carglist ::= carglist ccons\x00carglist ::=\x00ccons ::= NULL onconf\x00conslist_opt ::= COMMA conslist\x00conslist ::= conslist tconscomma tcons\x00conslist ::= tcons\x00tconscomma ::=\x00defer_subclause_opt ::= defer_subclause\x00resolvetype ::= raisetype\x00selectnowith ::= oneselect\x00oneselect ::= values\x00sclp ::= selcollist COMMA\x00as ::= ID|STRING\x00expr ::= term\x00likeop ::= LIKE_KW|MATCH\x00exprlist ::= nexprlist\x00nmnum ::= plus_num\x00nmnum ::= nm\x00nmnum ::= ON\x00nmnum ::= DELETE\x00nmnum ::= DEFAULT\x00plus_num ::= INTEGER|FLOAT\x00foreach_clause ::=\x00foreach_clause ::= FOR EACH ROW\x00trnm ::= nm\x00tridxby ::=\x00database_kw_opt ::= DATABASE\x00database_kw_opt ::=\x00kwcolumn_opt ::=\x00kwcolumn_opt ::= COLUMNKW\x00vtabarglist ::= vtabarg\x00vtabarglist ::= vtabarglist COMMA vtabarg\x00vtabarg ::= vtabarg vtabargtoken\x00anylist ::=\x00anylist ::= anylist LP anylist RP\x00anylist ::= anylist ANY\x00pParse->pToplevel==0\x00!pParse->isMultiWrite || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort)\x00sqlite3VdbeGetOp(v, 0)->opcode==OP_Init\x00usesStmtJournal=%d\x00pParse->iCacheLevel==0\x00sqlite3FinishCoding\x00pParse->aLabel==0\x00pParse->nLabel==0\x00pParse->nOpAlloc==0\x00pParse->szOpAlloc==0\x00sqlite3VdbeCreate\x00p->magic==VDBE_MAGIC_INIT\x00op>=0 && op<0xff\x00 r[%d]={%d:%d}\x00\x0a\x00sqlite3VdbeAddOp3\x00p->pParse->nOpAlloc<=p->nOp\x00p->pParse->nOpAlloc>p->nOp\x00growOp3\x00nOp<=(1024/sizeof(Op))\x00nNew>=(p->nOpAlloc+nOp)\x00growOpArray\x00nTemp>=20\x00pKeyInfo->aSortOrder!=0\x00k(%d\x00BINARY\x00B\x00,%s%s\x00-\x00)\x00(%.20s)\x00%s(%d)\x00%d\x00pMem->flags & MEM_Blob\x00(blob)\x00vtab:%p\x00,%d\x00]\x00program\x00zP4!=0\x00displayP4\x00IF \x00r[P2] = (%s)\x00if %s goto P2\x00@P\x00+1\x00..%d\x00..P3\x00; %s\x00Savepoint\x00\x00AutoCommit\x00\x00Transaction\x00\x00SorterNext\x00\x00PrevIfOpen\x00\x00NextIfOpen\x00\x00Prev\x00\x00Next\x00\x00Checkpoint\x00\x00JournalMode\x00\x00Vacuum\x00\x00VFilter\x00iplan=r[P3] zplan='P4'\x00VUpdate\x00data=r[P3@P2]\x00Goto\x00\x00Gosub\x00\x00InitCoroutine\x00\x00Yield\x00\x00MustBeInt\x00\x00Jump\x00\x00Not\x00r[P2]= !r[P1]\x00Once\x00\x00If\x00\x00IfNot\x00\x00IfNullRow\x00if P1.nullRow then r[P3]=NULL, goto P2\x00SeekLT\x00key=r[P3@P4]\x00SeekLE\x00key=r[P3@P4]\x00SeekGE\x00key=r[P3@P4]\x00SeekGT\x00key=r[P3@P4]\x00NoConflict\x00key=r[P3@P4]\x00NotFound\x00key=r[P3@P4]\x00Found\x00key=r[P3@P4]\x00SeekRowid\x00intkey=r[P3]\x00NotExists\x00intkey=r[P3]\x00Last\x00\x00IfSmaller\x00\x00SorterSort\x00\x00Sort\x00\x00Rewind\x00\x00IdxLE\x00key=r[P3@P4]\x00IdxGT\x00key=r[P3@P4]\x00IdxLT\x00key=r[P3@P4]\x00IdxGE\x00key=r[P3@P4]\x00RowSetRead\x00r[P3]=rowset(P1)\x00RowSetTest\x00if r[P3] in rowset(P1) goto P2\x00Program\x00\x00FkIfZero\x00if fkctr[P1]==0 goto P2\x00IfPos\x00if r[P1]>0 then r[P1]-=P3, goto P2\x00IfNotZero\x00if r[P1]!=0 then r[P1]--, goto P2\x00DecrJumpZero\x00if (--r[P1])==0 goto P2\x00IncrVacuum\x00\x00VNext\x00\x00Init\x00Start at P2\x00Return\x00\x00EndCoroutine\x00\x00HaltIfNull\x00if r[P3]=null halt\x00Halt\x00\x00Integer\x00r[P2]=P1\x00Int64\x00r[P2]=P4\x00String\x00r[P2]='P4' (len=P1)\x00Null\x00r[P2..P3]=NULL\x00SoftNull\x00r[P1]=NULL\x00Blob\x00r[P2]=P4 (len=P1)\x00Variable\x00r[P2]=parameter(P1,P4)\x00Move\x00r[P2@P3]=r[P1@P3]\x00Copy\x00r[P2@P3+1]=r[P1@P3+1]\x00SCopy\x00r[P2]=r[P1]\x00IntCopy\x00r[P2]=r[P1]\x00ResultRow\x00output=r[P1@P2]\x00CollSeq\x00\x00Function0\x00r[P3]=func(r[P2@P5])\x00Or\x00r[P3]=(r[P1] || r[P2])\x00And\x00r[P3]=(r[P1] && r[P2])\x00Function\x00r[P3]=func(r[P2@P5])\x00AddImm\x00r[P1]=r[P1]+P2\x00RealAffinity\x00\x00IsNull\x00if r[P1]==NULL goto P2\x00NotNull\x00if r[P1]!=NULL goto P2\x00Ne\x00IF r[P3]!=r[P1]\x00Eq\x00IF r[P3]==r[P1]\x00Gt\x00IF r[P3]>r[P1]\x00Le\x00IF r[P3]<=r[P1]\x00Lt\x00IF r[P3]<r[P1]\x00Ge\x00IF r[P3]>=r[P1]\x00ElseNotEq\x00\x00BitAnd\x00r[P3]=r[P1]&r[P2]\x00BitOr\x00r[P3]=r[P1]|r[P2]\x00ShiftLeft\x00r[P3]=r[P2]<<r[P1]\x00ShiftRight\x00r[P3]=r[P2]>>r[P1]\x00Add\x00r[P3]=r[P1]+r[P2]\x00Subtract\x00r[P3]=r[P2]-r[P1]\x00Multiply\x00r[P3]=r[P1]*r[P2]\x00Divide\x00r[P3]=r[P2]/r[P1]\x00Remainder\x00r[P3]=r[P2]%r[P1]\x00Concat\x00r[P3]=r[P2]+r[P1]\x00Cast\x00affinity(r[P1])\x00BitNot\x00r[P1]= ~r[P1]\x00Permutation\x00\x00String8\x00r[P2]='P4'\x00Compare\x00r[P1@P3] <-> r[P2@P3]\x00Column\x00r[P3]=PX\x00Affinity\x00affinity(r[P1@P2])\x00MakeRecord\x00r[P3]=mkrec(r[P1@P2])\x00Count\x00r[P2]=count()\x00ReadCookie\x00\x00SetCookie\x00\x00ReopenIdx\x00root=P2 iDb=P3\x00OpenRead\x00root=P2 iDb=P3\x00OpenWrite\x00root=P2 iDb=P3\x00OpenDup\x00\x00OpenAutoindex\x00nColumn=P2\x00OpenEphemeral\x00nColumn=P2\x00SorterOpen\x00\x00SequenceTest\x00if( cursor[P1].ctr++ ) pc = P2\x00OpenPseudo\x00P3 columns in r[P2]\x00Close\x00\x00ColumnsUsed\x00\x00Sequence\x00r[P2]=cursor[P1].ctr++\x00NewRowid\x00r[P2]=rowid\x00Insert\x00intkey=r[P3] data=r[P2]\x00InsertInt\x00intkey=P3 data=r[P2]\x00Delete\x00\x00ResetCount\x00\x00SorterCompare\x00if key(P1)!=trim(r[P3],P4) goto P2\x00SorterData\x00r[P2]=data\x00RowData\x00r[P2]=data\x00Rowid\x00r[P2]=rowid\x00NullRow\x00\x00SorterInsert\x00key=r[P2]\x00IdxInsert\x00key=r[P2]\x00IdxDelete\x00key=r[P2@P3]\x00Seek\x00Move P3 to P1.rowid\x00IdxRowid\x00r[P2]=rowid\x00Real\x00r[P2]=P4\x00Destroy\x00\x00Clear\x00\x00ResetSorter\x00\x00CreateIndex\x00r[P2]=root iDb=P1\x00CreateTable\x00r[P2]=root iDb=P1\x00SqlExec\x00\x00ParseSchema\x00\x00LoadAnalysis\x00\x00DropTable\x00\x00DropIndex\x00\x00DropTrigger\x00\x00IntegrityCk\x00\x00RowSetAdd\x00rowset(P1)=r[P2]\x00Param\x00\x00FkCounter\x00fkctr[P1]+=P2\x00MemMax\x00r[P1]=max(r[P1],r[P2])\x00OffsetLimit\x00if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)\x00AggStep0\x00accum=r[P3] step(r[P2@P5])\x00AggStep\x00accum=r[P3] step(r[P2@P5])\x00AggFinal\x00accum=r[P1] N=P2\x00Expire\x00\x00TableLock\x00iDb=P1 root=P2 write=P3\x00VBegin\x00\x00VCreate\x00\x00VDestroy\x00\x00VOpen\x00\x00VColumn\x00r[P3]=vcolumn(P2)\x00VRename\x00\x00Pagecount\x00\x00MaxPgcnt\x00\x00CursorHint\x00\x00Noop\x00\x00Explain\x00\x00%4d %-13s %4d %4d %4d %-13s %.2X %s\x0a\x00p->iAddr<nOp\x00opIterNext\x00(addr>=0 && addr<p->nOp) || p->db->mallocFailed\x00sqlite3VdbeGetOp\x00i>=0 && i<p->db->nDb && i<(int)sizeof(yDbMask)*8\x00i<(int)sizeof(p->btreeMask)*8\x00sqlite3VdbeUsesBtree\x00p->nOp>0 || p->db->mallocFailed\x00sqlite3VdbeChangeP5\x00p->nOp>0 || p->aOp==0\x00p->aOp==0 || p->aOp[p->nOp-1].zComment==0 || p->db->mallocFailed\x00p->aOp\x00vdbeVComment\x00sqlite3GetVTable\x00p->aOp!=0 || db->mallocFailed\x00p->nOp>0\x00addr<p->nOp\x00n<0\x00sqlite3VdbeChangeP4\x00freeP4\x00sqlite3KeyInfoUnref\x00pVdbe!=0\x00codeTableLocks\x00pParse->pTriggerTab==0\x00sqlite3IsToplevel(pParse)\x00v\x00sqlite3SchemaMutexHeld(db, 0, pDb->pSchema)\x00sqlite3AutoincrementBegin\x00!IsVirtual(pTab)\x00opcode==OP_OpenWrite || opcode==OP_OpenRead\x00pPk!=0\x00pPk->tnum==pTab->tnum\x00sqlite3OpenTable\x00iDb>=0\x00sqlite3TableLock\x00v!=0\x00pIdx!=0\x00sqlite3VdbeSetP4KeyInfo\x00sqlite3KeyInfoIsWriteable(pKey)\x00sqlite3KeyInfoOfIndex\x00!p || p->xCmp\x00no such collation sequence: %s\x00!db->xCollNeeded || !db->xCollNeeded16\x00callCollNeeded\x00sqlite3GetCollSeq\x00n!=P4_INT32 && n!=P4_VTAB\x00n<=0\x00pP4!=0\x00pOp->p4type==P4_NOTUSED\x00sqlite3VdbeAppendP4\x00nOp>0\x00aOp->p2>=0\x00sqlite3VdbeAddOpList\x00target>0 && target<=pParse->nMem\x00pParse->pVdbe!=0 || pParse->db->mallocFailed\x00sqlite3ExprCode\x00pParse->db->mallocFailed\x00pCol->iMem>0\x00!ExprHasProperty(pExpr, EP_IntValue)\x00pExpr->u.zToken[0]=='x' || pExpr->u.zToken[0]=='X'\x00pExpr->u.zToken[1]=='\\''\x00z[n]=='\\''\x00pExpr->u.zToken!=0\x00pExpr->u.zToken[0]!=0\x00pExpr->u.zToken[0]=='?' || strcmp(pExpr->u.zToken, z)==0\x00pLeft\x00misuse of aggregate: %s()\x00!ExprHasProperty(pExpr, EP_xIsSelect)\x00unknown function: %s()\x00nFarg>=2\x00nFarg>=1\x00blob\x00text\x00numeric\x00integer\x00real\x00nFarg==1\x00none\x00pFarg->a[0].pExpr!=0\x00pExpr->iTable==0 || pExpr->pLeft->op==TK_SELECT\x00%d columns assigned %d values\x00pExpr->iTable==0 || pExpr->iTable==1\x00pExpr->iColumn>=-1 && pExpr->iColumn<pTab->nCol\x00pTab->iPKey<0 || pExpr->iColumn!=pTab->iPKey\x00p1>=0 && p1<(pTab->nCol*2+2)\x00%s.%s -> $%d\x00new\x00old\x00row value misused\x00op==TK_CASE\x00!ExprHasProperty(pExpr, EP_xIsSelect) && pExpr->x.pList\x00pExpr->x.pList->nExpr > 0\x00pTest!=0\x00pParse->db->mallocFailed || pParse->nErr>0 || pParse->iCacheLevel==iCacheLevel\x00pExpr->affinity==OE_Rollback || pExpr->affinity==OE_Abort || pExpr->affinity==OE_Fail || pExpr->affinity==OE_Ignore\x00RAISE() may only be used within a trigger-program\x00sqlite3ExprCodeTarget\x00sqlite3ExprCodeGetColumn\x00pTab!=0\x00i<pTab->nCol\x00sqlite3ColumnDefault\x00pExpr!=0\x00(pExpr->flags & EP_TokenOnly)==0 || pCtx==0\x00zVal[nVal]=='\\''\x00*ppVal==0\x00pCtx==0\x00valueFromExpr\x00zIn!=0\x00sqlite3AffinityType\x00(h>='0' && h<='9') || (h>='a' && h<='f') || (h>='A' && h<='F')\x00sqlite3HexToInt\x00pMem->flags & MEM_Str || pMem->db->mallocFailed\x00aff==SQLITE_AFF_TEXT\x00affinity==SQLITE_AFF_INTEGER || affinity==SQLITE_AFF_REAL || affinity==SQLITE_AFF_NUMERIC\x00applyAffinity\x00(pRec->flags & (MEM_Str|MEM_Int|MEM_Real))==MEM_Str\x00applyNumericAffinity\x00pMem->flags & MEM_Real\x00sqlite3VdbeIntegerAffinity\x00sqlite3VdbeMemCast\x00(pMem->flags & (MEM_Blob|MEM_Str))!=0\x00(pMem->flags & (MEM_Int|MEM_Real|MEM_Null))!=0\x00sqlite3VdbeMemNumerify\x00sqlite3VdbeMemIntegerify\x00sqlite3VdbeMemRealify\x00iReg>0 || pParse->nErr || pParse->db->mallocFailed\x00iCol>=-1 && iCol<32768\x00p->iTable!=iTab || p->iColumn!=iCol\x00sqlite3ExprCacheStore\x00i>=0\x00z!=0\x000x\x00hex literal too big: %s%s\x00codeInteger\x00!sqlite3IsNaN(value)\x00codeReal\x00pExpr->op==TK_EQ || pExpr->op==TK_NE || pExpr->op==TK_IS || pExpr->op==TK_ISNOT || pExpr->op==TK_LT || pExpr->op==TK_GT || pExpr->op==TK_LE || pExpr->op==TK_GE\x00pExpr->op==op || (pExpr->op==TK_IS && op==TK_EQ) || (pExpr->op==TK_ISNOT && op==TK_NE)\x00p5==0 || pExpr->op!=op\x00p5==SQLITE_NULLEQ || pExpr->op==op\x00i>=0 && i<nLeft\x00op==TK_LT || op==TK_GT || op==TK_LE || op==TK_GE\x00v->magic==VDBE_MAGIC_INIT\x00sqlite3VdbeMakeLabel\x00codeVectorCompare\x00EXECUTE %s%s SUBQUERY %d\x00CORRELATED \x00LIST\x00SCALAR\x00!isRowid || nVal==1\x00!isRowid\x00pKeyInfo!=0\x00pEList!=0\x00pEList->nExpr>0\x00sqlite3KeyInfoIsWriteable(pKeyInfo)\x00pExpr->op==TK_EXISTS || pExpr->op==TK_SELECT\x00ExprHasProperty(pExpr, EP_xIsSelect)\x00Init subquery result\x00Init EXISTS result\x00sqlite3CodeSubselect\x00PUSH to %d\x0a\x00pExpr->op==TK_IN\x00exprINAffinity\x00i<sqlite3ExprVectorSize(pVector)\x00pVector->op2==0 || pVector->op==TK_REGISTER\x00sqlite3VectorFieldSubexpr\x00pExpr->flags&EP_xIsSelect\x00pExpr->pLeft->flags&EP_xIsSelect\x00pExpr->x.pList->nExpr>0\x00pExpr->op==TK_FUNCTION\x00pExpr->op==TK_COLLATE\x00sqlite3ExprSkipCollate\x00sqlite3ExprAffinity\x00iCol<pTab->nCol\x00sqlite3TableColumnAffinity\x00aff1==0 || aff2==0\x00sqlite3CompareAffinity\x00%*s%s.%p: \x00begin processing:\x0a\x00p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo\x00p->pOrderBy==0 || pDest->eDest!=SRT_Fifo\x00p->pOrderBy==0 || pDest->eDest!=SRT_DistQueue\x00p->pOrderBy==0 || pDest->eDest!=SRT_Queue\x00pDest->eDest==SRT_Exists || pDest->eDest==SRT_Union || pDest->eDest==SRT_Except || pDest->eDest==SRT_Discard || pDest->eDest==SRT_Queue || pDest->eDest==SRT_DistFifo || pDest->eDest==SRT_DistQueue || pDest->eDest==SRT_Fifo\x00p->pEList!=0\x00after name resolution:\x0a\x00expected %d columns for '%s' but got %d\x00end compound-select processing\x0a\x00After WHERE-clause push-down:\x0a\x00pItem->addrFillSub==0\x00materialize \"%s\"\x00end %s\x00After all FROM-clause analysis:\x0a\x00sDistinct.isTnct\x00Transform DISTINCT into GROUP BY:\x0a\x0066==sqlite3LogEst(100)\x000==sqlite3LogEst(1)\x00pWhere==p->pWhere\x00!ExprHasProperty(sAggInfo.aFunc[i].pExpr, EP_xIsSelect)\x00clear abort flag\x00indicate accumulator empty\x00GROUP BY\x00GROUP BY sort\x00output one row\x00check abort flag\x00reset accumulator\x00indicate data in accumulator\x00output final row\x00set abort flag\x00Groupby result generator entry point\x00end groupby result generator\x00p->pGroupBy==0\x00flag==0\x00flag==0 || (pMinMax!=0 && pMinMax->nExpr==1)\x00db->mallocFailed || pMinMax!=0\x00pMinMax==0 || pMinMax->nExpr==1\x00%s() by index\x00RIGHT PART OF ORDER BY\x00ORDER BY\x00end processing\x0a\x00authorizer malfunction\x00nil-SELECT\x00SELECT%s%s (0x%p) selFlags=0x%x nSelectRow=%d\x00 DISTINCT\x00 agg_flag\x00result-set\x00{%d,*}\x00 %s.%s\x00 %s\x00 tabname=%Q\x00 (AS %s)\x00 LEFT-JOIN\x00func-args:\x00GROUPBY\x00ORDERBY\x00UNION ALL\x00|   \x00    \x00|-- \x00'-- \x00acc.nChar>0\x00sqlite3TreeViewLine\x00moreToFollow==0 || moreToFollow==1\x00sqlite3TreeViewPush\x00WITH (0x%p, pOuter=0x%p)\x00WITH (0x%p)\x00 AS\x00%s (empty)\x00iOrderByCol=%d\x00nil\x00  flags=0x%x iRJT=%d\x00  flags=0x%x\x00AGG{%d:%d}%s\x00COLUMN(%d)%s\x00{%d:%d}%s\x00%Q\x00VARIABLE(%s,%d)\x00REGISTER(%d)\x00ID \"%w\"\x00CAST %Q\x00ISNOT\x00MUL\x00SUB\x00DIV\x00UMINUS\x00UPLUS\x00SPAN %Q\x00COLLATE %Q\x00AGG_FUNCTION%d %Q\x00FUNCTION %Q\x00EXISTS-expr\x00SELECT-expr\x00NEW\x00OLD\x00unk\x00rollback\x00abort\x00fail\x00ignore\x00RAISE %s(%Q)\x00MATCH {%d:%d}%s\x00VECTOR\x00SELECT-COLUMN %d\x00IF-NULL-ROW %d\x00op=%d\x00sqlite3Select\x00sqlite3SelectPrep\x00(p->selFlags & SF_Converted)==0\x00pNew->pPrior!=0\x00a JOIN clause is required before %s\x00pAlias!=0\x00p==0\x00pDatabase==0 || pTable!=0\x00sqlite3SrcListAppend\x00iStart>=0\x00nExtra>=1\x00pSrc!=0\x00iStart<=pSrc->nSrc\x00db->mallocFailed\x00sqlite3SrcListEnlarge\x00sqlite3SrcListAppendFromTerm\x00sqlite3ExprListAppend\x00iValue>=0\x00pToken->z!=0 || pToken->n==0\x00sqlite3ExprAlloc\x00convertCompoundSelectToSubquery\x00sqlite3WalkSelectFrom\x00pFrom->fg.isRecursive==0 || pFrom->pTab!=0\x00pFrom->pTab==0\x00pSel!=0\x00sqlite_sq_%p\x00200==sqlite3LogEst(1048576)\x00too many references to \"%s\": max 65535\x00pFrom->pSelect==0\x00pE->op!=TK_DOT || pE->pRight!=0\x00pE->op!=TK_DOT || (pE->pLeft!=0 && pE->pLeft->op==TK_ID)\x00pE->op!=TK_DOT || pRight!=0\x00pE->pLeft!=0\x00!ExprHasProperty(pE->pLeft, EP_IntValue)\x00*\x00zName\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00selectExpander\x00bFree==0 || (pParse->pWith==0 && pParse->pWithToFree==0)\x00pParse->pWith!=pWith\x00sqlite3WithPush\x00pList || pParse->db->mallocFailed\x00sqlite3SrcListAssignCursors\x00pFrom->pSelect\x00multiple references to recursive table: %s\x00pTab->nTabRef==1 || ((pSel->selFlags&SF_Recursive) && pTab->nTabRef==2 )\x00circular reference: %s\x00pPrior->pWith==0\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00withExpand\x00'%s' is not a function\x00sqlite3SelectDup\x00pNewExpr->iColumn==0 || i>0\x00pOldExpr->pLeft==pOldExpr->pRight\x00pItem[-1].pExpr!=0\x00pNewExpr->iColumn==pItem[-1].pExpr->iColumn+1\x00pPriorSelectCol==pItem[-1].pExpr->pLeft\x00sqlite3ExprListDup\x00flags==0 || flags==EXPRDUP_REDUCE\x00sqlite3ExprDup\x00dupFlags==0 || dupFlags==EXPRDUP_REDUCE\x00pzBuffer==0 || dupFlags==EXPRDUP_REDUCE\x00ExprHasProperty(p, EP_Reduced)==0\x00p->iColumn==0 || p->pRight==0\x00p->pRight==0 || p->pRight==p->pLeft\x00exprDup\x00flags==EXPRDUP_REDUCE || flags==0\x00!ExprHasProperty(p, EP_TokenOnly|EP_Reduced)\x00!ExprHasProperty(p, EP_FromJoin)\x00!ExprHasProperty(p, EP_MemToken)\x00!ExprHasProperty(p, EP_NoReduce)\x00dupedExprStructSize\x00sqlite3SrcListDup\x00sqlite3IdListDup\x00nCol==(i16)nCol\x00pColExpr!=0\x00!ExprHasProperty(pColExpr, EP_IntValue)\x00%.*z:%u\x00sqlite3ColumnsFromExprList\x00p->pSchema==0 || p->zDatabase==0\x00sqlite3LocateTableItem\x00no such view\x00no such table\x00pragma_\x00%s: %s.%s\x00%s: %s\x00sqlite3ReadSchema\x00sqlite3BtreeHoldsMutex(db->aDb[0].pBt)\x00db->init.busy==0\x00db->nDb>1\x00sqlite3Init\x00db->aDb[iDb].pSchema\x00iDb==1 || sqlite3BtreeHoldsMutex(db->aDb[iDb].pBt)\x00sqlite_temp_master\x00sqlite_master\x001\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage integer,sql text)\x00attached databases must use the same text encoding as main database\x00unsupported file format\x00db->init.busy\x00SELECT name, rootpage, sql FROM \"%w\".%s ORDER BY rowid\x00sqlite3InitOne\x00argc==3\x00create \x00(rc&0xFF)==(rcp&0xFF)\x00saved_iDb==0 || (db->flags & SQLITE_Vacuum)!=0\x00iDb==1\x00invalid rootpage\x00sqlite3InitCallback\x00?\x00malformed database schema (%s)\x00%z - %s\x00rc==SQLITE_OK || ppStmt==0 || *ppStmt==0\x00rc==SQLITE_OK || *ppStmt==0\x00ppStmt && *ppStmt==0\x00sqlite3BtreeHoldsMutex(pBt)\x00database schema is locked: %s\x00statement too long\x000==sParse.nQueryLoop\x00!(*ppStmt)\x00(rc&db->errMask)==rc\x00sqlite3Prepare\x00rc==SQLITE_OK || rc==SQLITE_LOCKED_SHAREDCACHE\x00sqlite3BtreeSchemaLocked\x00eLock==READ_LOCK || eLock==WRITE_LOCK\x00!(p->db->flags&SQLITE_ReadUncommitted)||eLock==WRITE_LOCK||iTab==1\x00eLock==READ_LOCK || (p==pBt->pWriter && p->inTrans==TRANS_WRITE)\x00eLock==READ_LOCK || pBt->inTransaction==TRANS_WRITE\x00pIter->eLock==READ_LOCK || pIter->eLock==WRITE_LOCK\x00eLock==READ_LOCK || pIter->pBtree==p || pIter->eLock==READ_LOCK\x00p==pBt->pWriter\x00querySharedCacheTableLock\x00pParse->checkSchema\x00sqlite3SchemaMutexHeld(db, iDb, 0)\x00schemaIsValid\x00sqlite3BtreeIsInReadTrans\x00pBt->inTransaction==TRANS_WRITE || IfNotOmitAV(pBt->bDoTruncate)==0\x00p->lock.pBtree==p && p->lock.iTable==1\x00!pBt->pWriter\x00sqlite3BtreeBeginTrans\x00pBt->pPage1==0\x00@  \x00(pageSize & 7)==0\x00pBt->maxLeaf + 23 <= MX_CELL_SIZE(pBt)\x00lockBtree\x00sqlite3PcacheRefCount(pPager->pPCache)==0\x00pPager->eState==PAGER_OPEN || pPager->eState==PAGER_READER\x00pPager->tempFile==0 || pPager->eLock==EXCLUSIVE_LOCK\x00pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK\x00!pPager->tempFile\x00pPager->eState==PAGER_OPEN\x00(pPager->eLock==SHARED_LOCK) || (pPager->exclusiveMode && pPager->eLock>SHARED_LOCK)\x00pPager->pWal==0 || rc==SQLITE_OK\x00sqlite3PagerSharedLock\x00(pPager->eLock>=locktype) || (pPager->eLock==NO_LOCK && locktype==SHARED_LOCK) || (pPager->eLock==RESERVED_LOCK && locktype==EXCLUSIVE_LOCK)\x00pager_wait_on_lock\x00eLock==SHARED_LOCK || eLock==RESERVED_LOCK || eLock==EXCLUSIVE_LOCK\x00pagerLockDb\x00jrnlOpen==0 || ( sqlite3OsDeviceCharacteristics(pPager->jfd) & SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN )\x00hasHotJournal\x00pPager->eLock>=SHARED_LOCK\x00pagerPagecount\x00sqlite3WalDbsize\x00pagerOpenWalIfPresent\x00pPager->eState==PAGER_OPEN || pbOpen\x00pPager->eState==PAGER_READER || !pbOpen\x00pbOpen==0 || *pbOpen==0\x00pbOpen!=0 || (!pPager->tempFile && !pPager->pWal)\x00sqlite3PagerOpenWal\x00pPager->pWal==0 && pPager->tempFile==0\x00pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK\x00pagerOpenWal\x00pagerExclusiveLock\x00zWalName && zWalName[0]\x00pDbFd\x00sqlite3WalOpen\x00pagerBeginReadTransaction\x00pWal->readLock<0\x00thisMark!=READMARK_NOT_USED\x00rc==SQLITE_BUSY || (pWal->readOnly & WAL_SHM_RDONLY)!=0\x00mxReadMark<=pWal->hdr.mxFrame\x00walTryBeginRead\x00SQLite format 3\x00pPager->eState>=PAGER_READER && pPager->eState<PAGER_ERROR\x00rc==SQLITE_OK || pPager->eState==PAGER_READER\x00rc!=SQLITE_OK || pPager->eState==PAGER_WRITER_LOCKED\x00sqlite3PagerBegin\x00pWal->writeLock==0 && pWal->iReCksum==0\x00sqlite3WalBeginWriteTransaction\x00pP1!=0\x00pBt->usableSize<=pBt->pageSize && pBt->usableSize+255>=pBt->pageSize\x00pBt->autoVacuum==1 || pBt->autoVacuum==0\x00pBt->incrVacuum==1 || pBt->incrVacuum==0\x00newDatabase\x00sqlite3PagerPagenumber(pPage->pDbPage)==pPage->pgno\x00sqlite3PagerGetData(pPage->pDbPage) == data\x00sqlite3PagerIswriteable(pPage->pDbPage)\x00pBt->pageSize>=512 && pBt->pageSize<=65536\x00zeroPage\x00pPage->hdrOffset==(pPage->pgno==1 ? 100 : 0)\x00decodeFlags\x00nSize==debuginfo.nSize || CORRUPT_DB\x00cellSizePtr\x00pPage->leaf==0 || pPage->leaf==1\x00pPage->intKeyLeaf\x00pPage->childPtrSize==0\x00btreeParseCellPtr\x00pPage->childPtrSize==4\x00debuginfo.nSize==(u16)(pIter - pCell) || CORRUPT_DB\x00cellSizePtrNoPayload\x00pPage->leaf==0\x00btreeParseCellPtrNoPayload\x00pPage->intKeyLeaf==0\x00btreeParseCellPtrIndex\x00pBt->db\x00sqlite3_mutex_held(pBt->db->mutex)\x00btreeInvokeBusyHandler\x00sqlite3InvokeBusyHandler\x00sqlite3PagerOpenSavepoint\x00nSavepoint>nCurrent && pPager->useJournal\x00pPager->nSavepoint==nSavepoint\x00pagerOpenSavepoint\x00sqlite3WalSavepoint\x00pPg->flags&PGHDR_DIRTY\x00!subjRequiresPage(pPg) || pPg->pgno<=pPg->pPager->dbSize\x00assertTruncateConstraintCb\x00p->inTrans>TRANS_NONE\x00SQLITE_OK==querySharedCacheTableLock(p, MASTER_ROOT, READ_LOCK)\x00pBt->pPage1\x00idx>=0 && idx<=15\x00sqlite3BtreeGetMeta\x00pPager->eState>PAGER_OPEN\x00sqlite3PagerDataVersion\x00iDb<db->nDb\x00pDb->pSchema!=0\x00sqlite3ResetOneSchema\x00pBt->autoVacuum\x00nRef>=sqlite3PagerRefcount(pPager)\x00autoVacuumCommit\x00invalidateAllOverflowCache\x00iLastPg>nFin\x00iFreePg==iLastPg\x00iFreePg<iLastPg\x00incrVacuumStep\x00eMode==BTALLOC_ANY || (nearby>0 && IfNotOmitAV(pBt->autoVacuum))\x00nearby>0\x00pTrunk!=0\x00pTrunk->aData!=0\x00pPrevTrunk==0\x00sqlite3PagerIswriteable(pPage1->pDbPage)\x00pBt->nPage!=PENDING_BYTE_PAGE(pBt)\x00*pPgno!=PENDING_BYTE_PAGE(pBt)\x00rc!=SQLITE_OK || sqlite3PagerPageRefcount((*ppPage)->pDbPage)<=1\x00rc!=SQLITE_OK || (*ppPage)->isInit==0\x00allocateBtreePage\x00eType==PTRMAP_OVERFLOW2 || eType==PTRMAP_OVERFLOW1 || eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE\x00pDbPage->pBt==pBt\x00relocatePage\x00pPg->nRef>0\x00pPager->eState==PAGER_WRITER_CACHEMOD || pPager->eState==PAGER_WRITER_DBMOD\x00pPager->tempFile || !MEMDB\x00pPager->journalMode==PAGER_JOURNALMODE_OFF || pageInJournal(pPager, pPg) || pPg->pgno>pPager->dbOrigSize\x00!pPgOld || pPgOld->nRef==1\x00pPager->pTmpSpace!=0\x00sqlite3PagerMovepage\x00newPgno>0\x00sqlite3PcacheMove\x00sqlite3BitvecClear\x00setChildPtrmaps\x00pPage->pBt!=0\x00pPage->pBt->db!=0\x00pPage->pgno==sqlite3PagerPagenumber(pPage->pDbPage)\x00pPage == sqlite3PagerGetExtra(pPage->pDbPage)\x00pPage->aData == sqlite3PagerGetData(pPage->pDbPage)\x00pPage->nCell>0 || top==usableSize || CORRUPT_DB\x00btreeInitPage\x00pCell!=0\x00ptrmapPutOvflPtr\x000==PTRMAP_ISPAGE(pBt, PENDING_BYTE_PAGE(pBt))\x00ptrmapPut\x00modifyPagePointer\x00pPager->dbSize>=nPage\x00sqlite3PagerTruncateImage\x00pPager->eState==PAGER_WRITER_LOCKED || pPager->eState==PAGER_WRITER_CACHEMOD || pPager->eState==PAGER_WRITER_DBMOD || pPager->eState==PAGER_ERROR\x00MEMDB==0 || pPager->tempFile\x00rc!=SQLITE_IOERR_BLOCKED\x00pPager->eState==PAGER_WRITER_DBMOD\x00sqlite3PagerCommitPhaseOne\x00pPager->pWal\x00pList\x00p->pgno < p->pDirty->pgno\x00pList->pDirty==0 || isCommit\x00pagerWalFrames\x00(isCommit!=0)==(nTruncate!=0)\x00(int)pWal->szPage==szPage\x00rc==SQLITE_OK || iWrite==0\x00iOffset==walFrameOffset(iFrame, szPage)\x00sqlite3WalFrames\x00(rc&0xff)!=SQLITE_BUSY\x00walRestartLog\x00p->syncFlags & (SQLITE_SYNC_NORMAL|SQLITE_SYNC_FULL)\x00walWriteToLog\x00pWal->iReCksum>0\x00walRewriteChecksums\x00isDirectMode==0\x00!pPager->tempFile && isOpen(pPager->fd)\x00pPgHdr==0 || rc==SQLITE_OK\x00pager_incr_changecounter\x00writeMasterJournal\x00syncJournal\x00pPager->eState==PAGER_WRITER_CACHEMOD || pPager->eState==PAGER_WRITER_DBMOD || pPager->eState==PAGER_WRITER_LOCKED\x00sqlite3PagerExclusiveLock\x00pPager->tempFile || pPager->eState==PAGER_WRITER_DBMOD\x00isOpen(pPager->fd) || pList->pDirty==0\x00pPager->tempFile && rc==SQLITE_OK\x00rc!=SQLITE_OK || isOpen(pPager->fd)\x00(pList->flags&PGHDR_NEED_SYNC)==0\x00pager_write_pagelist\x00rc!=SQLITE_OK || isOpen(pFile)\x00pagerOpentemp\x00pBt->inTransaction==TRANS_WRITE\x00pBt->nTransaction>0\x00sqlite3BtreeCommitPhaseTwo\x00pPager->eState==PAGER_WRITER_LOCKED || pPager->eState==PAGER_WRITER_FINISHED || (pagerUseWal(pPager) && pPager->eState==PAGER_WRITER_CACHEMOD)\x00pPager->journalOff==JOURNAL_HDR_SZ(pPager) || !pPager->journalOff\x00sqlite3PagerCommitPhaseTwo\x00(&p[1])==pEnd || p[0].db==p[1].db\x00releaseMemArray\x00idx<p->nResColumn\x00var<COLNAME_N\x00!zName || xDel!=SQLITE_DYNAMIC\x00p->aColName!=0\x00rc!=0 || !zName || (pColName->flags&MEM_Term)!=0\x00sqlite3VdbeSetColName\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00selectid\x00order\x00detail\x00isPrepareV2==1 || isPrepareV2==0\x00p->zSql==0\x00sqlite3VdbeSetSql\x00(rc & p->db->errMask)==rc\x00db->nVdbeActive>=db->nVdbeRead\x00db->nVdbeRead>=db->nVdbeWrite\x00db->nVdbeWrite>=0\x00db->nVdbeActive>0 || db->autoCommit==0 || db->nStatement==0\x00p->nFrame==0\x00p->pAuxData==0\x00pCx->pBtx==0 || pCx->eCurType==CURTYPE_BTREE\x00pCx->uc.pCursor!=0\x00pVCur->pVtab->nRef>0\x00sqlite3VdbeFreeCursor\x00pCsr->eCurType==CURTYPE_SORTER\x00sqlite3VdbeSorterClose\x00pSorter->bUseThreads || pSorter->pReader==0\x00pTask->bDone==1\x00ppOut!=0\x00sqlite3ThreadJoin\x00vdbeSorterJoinThread\x00sqlite3VdbeSorterReset\x00pFile\x00sqlite3OsCloseFree\x00pTask->list.aMemory==0\x00vdbeSortSubtaskCleanup\x00closeAllCursors\x00cnt==db->nVdbeActive\x00nWrite==db->nVdbeWrite\x00nRead==db->nVdbeRead\x00checkActiveVdbeCnt\x00sqlite3VdbeEnter\x00FOREIGN KEY constraint failed\x00sqlite3VdbeHalt\x00vdbeLeave\x00i!=1\x00%s-mjXXXXXX9XXz\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00zMaster[sqlite3Strlen30(zMaster)-3]=='9'\x00zFile[0]!=0\x00rc!=SQLITE_BUSY\x00vdbeCommit\x00p->pBt->pPager!=0\x00sqlite3BtreeGetFilename\x00sqlite3BtreeGetJournalname\x00eOp==SAVEPOINT_ROLLBACK || eOp==SAVEPOINT_RELEASE\x00db->nStatement>0\x00p->iStatement==(db->nStatement+db->nSavepoint)\x00vdbeCloseStatement\x00iSavepoint>=0 || (iSavepoint==-1 && op==SAVEPOINT_ROLLBACK)\x00pBt->nPage>0\x00sqlite3BtreeSavepoint\x00op==SAVEPOINT_RELEASE||op==SAVEPOINT_ROLLBACK||op==SAVEPOINT_BEGIN\x00iSavepoint>=-1\x00sqlite3VtabSavepoint\x00sqlite3VdbeSetChanges\x00p->apCsr[i]==0\x00p->aMem[i].flags==MEM_Undefined\x00Cleanup\x00sqlite3VdbeFinalize\x00db->pVdbe==p\x00sqlite3VdbeDelete\x00p->db==0 || p->db==db\x00sqlite3VdbeClearObject\x00db->lookaside.bDisable >= pParse->disableLookaside\x00sqlite3ParserReset\x00p->startTime>0\x00db->xProfile!=0 || (db->mTrace & SQLITE_TRACE_PROFILE)!=0\x00p->zSql!=0\x00invokeProfileCallback\x00sqlite3LockAndPrepare\x00sqlite3_prepare\x00unknown error\x00abort due to ROLLBACK\x00sqlite3ErrStr\x00not an error\x00SQL logic error or missing database\x00access permission denied\x00callback requested query abort\x00database is locked\x00database table is locked\x00out of memory\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00table contains no data\x00database schema has changed\x00constraint failed\x00datatype mismatch\x00library routine called out of sequence\x00large file support is disabled\x00authorization denied\x00auxiliary database format error\x00bind or column index out of range\x00file is encrypted or is not a database\x00sqlite3_errmsg\x00zDb!=0 || sqlite3BtreeHoldsAllMutexes(db)\x00pSchema\x00sqlite3SchemaMutexHeld(db, j, 0)\x00sqlite3FindIndex\x00sqlite3BtreeSetCacheSize\x00sqlite3PcacheSetCachesize\x00rc==SQLITE_OK || pStmt==0\x00azCols[i]!=0\x00sqlite3_prepare_v2\x00sqlite3_exec\x00v->expired==0\x00db->nVdbeWrite>0 || db->autoCommit==0 || (db->nDeferredCons==0 && db->nDeferredImmCons==0)\x00p->startTime==0\x00p->rc==SQLITE_OK\x00rc==SQLITE_ROW || rc==SQLITE_DONE || rc==SQLITE_ERROR || (rc&0xff)==SQLITE_BUSY || rc==SQLITE_MISUSE\x00(p->rc!=SQLITE_ROW && p->rc!=SQLITE_DONE) || p->rc==p->rcApp\x00sqlite3Step\x00(rc & (db->errMask))==rc\x00p->magic==VDBE_MAGIC_INIT || p->magic==VDBE_MAGIC_RESET\x00p->aMem[i].db==p->db\x00sqlite3VdbeRewind\x00sqlite3_reset\x00p->explain\x00p->magic==VDBE_MAGIC_RUN\x00p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM\x00p->nMem>9\x00pMem->z!=0\x00p->db->mallocFailed\x00%.2x\x00sqlite3VdbeList\x00p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY\x00p->bIsReader || p->readOnly!=0\x00p->explain==0\x000 < db->nProgressOps\x00VDBE Program Listing:\x0a\x00VDBE Query Plan:\x0a\x00%s\x0a\x00VDBE Trace:\x0a\x00pOp>=aOp && pOp<&aOp[p->nOp]\x00pOp->p1>0\x00pOp->p1<=(p->nMem+1 - p->nCursor)\x00memIsValid(&aMem[pOp->p1])\x00sqlite3VdbeCheckMemInvariants(&aMem[pOp->p1])\x00pOp->p2>0\x00pOp->p2<=(p->nMem+1 - p->nCursor)\x00memIsValid(&aMem[pOp->p2])\x00sqlite3VdbeCheckMemInvariants(&aMem[pOp->p2])\x00pOp->p3>0\x00pOp->p3<=(p->nMem+1 - p->nCursor)\x00memIsValid(&aMem[pOp->p3])\x00sqlite3VdbeCheckMemInvariants(&aMem[pOp->p3])\x00db->nProgressOps!=0\x00pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor)\x00VdbeMemDynamic(pIn1)==0\x00pIn1->flags==MEM_Int\x00pOp->p2>=0 && pOp->p2<p->nOp\x00pOp->p3>=0 && pOp->p3<p->nOp\x00!VdbeMemDynamic(pOut)\x00pIn1->u.i>=0 && pIn1->u.i<p->nOp\x00pCaller->opcode==OP_Yield\x00pCaller->p2>=0 && pCaller->p2<p->nOp\x00pOp->p5<=4\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR\x00rc==SQLITE_OK || (p->rc&0xff)==SQLITE_CONSTRAINT\x00rc==SQLITE_OK || db->nDeferredCons>0 || db->nDeferredImmCons>0\x00pOp->p4.pI64!=0\x00!sqlite3IsNaN(*pOp->p4.pReal)\x00pOp->p4.z!=0\x00rc==SQLITE_OK || rc==SQLITE_TOOBIG\x00pOut->szMalloc>0 && pOut->zMalloc==pOut->z\x00VdbeMemDynamic(pOut)==0\x00pIn3->flags & MEM_Int\x00pOp->p1 <= SQLITE_MAX_LENGTH\x00pOp->p1>0 && pOp->p1<=p->nVar\x00pOp->p4.z==0 || pOp->p4.z==sqlite3VListNumToName(p->pVList,pOp->p1)\x00n>0 && p1>0 && p2>0\x00p1+n<=p2 || p2+n<=p1\x00pOut<=&aMem[(p->nMem+1 - p->nCursor)]\x00pIn1<=&aMem[(p->nMem+1 - p->nCursor)]\x00memIsValid(pIn1)\x00pOut!=pIn1\x00(pIn1->flags & MEM_Int)!=0\x00p->nResColumn==pOp->p2\x00pOp->p1+pOp->p2<=(p->nMem+1 - p->nCursor)+1\x00db->flags&SQLITE_CountRows\x00p->usesStmtJournal\x00p->iStatement==0 || db->flags&SQLITE_CountRows\x00memIsValid(&pMem[i])\x00(pMem[i].flags & MEM_Ephem)==0 || (pMem[i].flags & (MEM_Str|MEM_Blob))==0\x00pIn1!=pOut\x00pOp->p4type==P4_COLLSEQ\x00pOp->p4type==P4_FUNCDEF\x00pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor)\x00n==0 || (pOp->p2>0 && pOp->p2+n<=(p->nMem+1 - p->nCursor)+1)\x00pOp->p3<pOp->p2 || pOp->p3>=pOp->p2+n\x00pOp->p4type==P4_FUNCCTX\x00memIsValid(pCtx->argv[i])\x00op==OP_ShiftRight || op==OP_ShiftLeft\x00pOp->p2>=SQLITE_AFF_BLOB && pOp->p2<=SQLITE_AFF_REAL\x00pOp->opcode==OP_Eq || pOp->opcode==OP_Ne\x00(flags1 & MEM_Cleared)==0\x00(pOp->p5 & SQLITE_JUMPIFNULL)==0\x00pIn1!=pIn3\x00pOp->p4type==P4_COLLSEQ || pOp->p4.pColl==0\x00(pIn1->flags & MEM_Dyn) == (flags1 & MEM_Dyn)\x00(pIn3->flags & MEM_Dyn) == (flags3 & MEM_Dyn)\x00pOp->opcode==OP_Ne || pOp->opcode==OP_Eq\x00res2==0 || res2==1\x00pOp>aOp\x00pOp[-1].opcode==OP_Lt || pOp[-1].opcode==OP_Gt\x00pOp[-1].p5 & SQLITE_STOREP2\x00pOp->p4type==P4_INTARRAY\x00pOp->p4.ai\x00pOp[1].opcode==OP_Compare\x00pOp[1].p5 & OPFLAG_PERMUTE\x00pOp[-1].opcode==OP_Permutation\x00pOp[-1].p4type==P4_INTARRAY\x00aPermute!=0\x00p1>0 && p1+mx<=(p->nMem+1 - p->nCursor)+1\x00p2>0 && p2+mx<=(p->nMem+1 - p->nCursor)+1\x00p1>0 && p1+n<=(p->nMem+1 - p->nCursor)+1\x00p2>0 && p2+n<=(p->nMem+1 - p->nCursor)+1\x00memIsValid(&aMem[p1+idx])\x00memIsValid(&aMem[p2+idx])\x00i<pKeyInfo->nField\x00p->aOp[0].opcode==OP_Init\x00pOp->p1>=0 && pOp->p1<p->nCursor\x00p->apCsr[pOp->p1]!=0\x00pC!=0\x00p2<pC->nField\x00pC->eCurType!=CURTYPE_VTAB\x00pC->eCurType!=CURTYPE_PSEUDO || pC->nullRow\x00pC->eCurType!=CURTYPE_SORTER\x00pC->uc.pseudoTableReg>0\x00pReg->flags & MEM_Blob\x00memIsValid(pReg)\x00pC->eCurType==CURTYPE_BTREE\x00pCrsr\x00sqlite3BtreeCursorIsValid(pCrsr)\x00avail<=65536\x00pC->nHdrParsed<=p2\x00p2<pC->nHdrParsed\x00sqlite3VdbeCheckMemInvariants(pDest)\x00t==pC->aType[p2]\x00zAffinity!=0\x00zAffinity[pOp->p2]==0\x00pIn1 <= &p->aMem[(p->nMem+1 - p->nCursor)]\x00nField>0 && pOp->p2>0 && pOp->p2+nField<=(p->nMem+1 - p->nCursor)+1\x00pOp->p3<pOp->p1 || pOp->p3>=pOp->p1+pOp->p2\x00pData0<=pLast\x00zAffinity[0]==0 || pRec<=pLast\x00memIsValid(pRec)\x00i==nHdr\x00j==nByte\x00p->apCsr[pOp->p1]->eCurType==CURTYPE_BTREE\x00db->pSavepoint==0 || db->autoCommit==0\x00p1==SAVEPOINT_BEGIN||p1==SAVEPOINT_RELEASE||p1==SAVEPOINT_ROLLBACK\x00db->pSavepoint || db->isTransactionSavepoint==0\x00checkSavepointCount(db)\x00p->bIsReader\x00cannot open savepoint - SQL statements in progress\x00db->autoCommit==0 || db->nVTrans==0\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00pSavepoint==db->pSavepoint\x00desiredAutoCommit==1 || desiredAutoCommit==0\x00desiredAutoCommit==1 || iRollback==0\x00db->nVdbeActive>0\x00desiredAutoCommit==1\x00cannot commit transaction - SQL statements in progress\x00db->nStatement==0\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00p->readOnly==0 || pOp->p2==0\x00pOp->p1>=0 && pOp->p1<db->nDb\x00DbMaskTest(p->btreeMask, pOp->p1)\x00sqlite3BtreeIsInTrans(pBt)\x00db->nStatement>=0 && db->nSavepoint>=0\x00pOp->p5==0 || pOp->p4type==P4_INT32\x00pOp->p3<SQLITE_N_BTREE_META\x00db->aDb[iDb].pBt!=0\x00DbMaskTest(p->btreeMask, iDb)\x00pOp->p2<SQLITE_N_BTREE_META\x00p->readOnly==0\x00pDb->pBt!=0\x00sqlite3SchemaMutexHeld(db, pOp->p1, 0)\x00pOp->p5==0 || pOp->p5==OPFLAG_SEEKEQ\x00pOp->p4type==P4_KEYINFO\x00pCur->iDb==pOp->p3\x00pOp->opcode==OP_OpenWrite || pOp->p5==0 || pOp->p5==OPFLAG_SEEKEQ\x00pOp->opcode==OP_OpenRead || pOp->opcode==OP_ReopenIdx || p->readOnly==0\x00pX!=0\x00p2>0\x00p2<=(p->nMem+1 - p->nCursor)\x00memIsValid(pIn2)\x00(pIn2->flags & MEM_Int)!=0\x00p2>=2\x00pKeyInfo->enc==ENC(db)\x00pKeyInfo->db==db\x00pOp->p1>=0\x00nField>=0\x00pOrig->pBtx!=0\x00pOp->p2>=0\x00pgno==MASTER_ROOT+1\x00pCx->pKeyInfo->db==db\x00pCx->pKeyInfo->enc==ENC(db)\x00isSorter(pC)\x00pOp->p3>=0\x00pOp->p5==0\x00pOp->p2!=0\x00pC->isOrdered\x00pC->uc.pCursor!=0\x00sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0 || CORRUPT_DB\x00pOp->opcode==OP_SeekGE || pOp->opcode==OP_SeekLE\x00pOp[1].opcode==OP_IdxLT || pOp[1].opcode==OP_IdxGT\x00pOp[1].p1==pOp[0].p1\x00pOp[1].p2==pOp[0].p2\x00pOp[1].p3==pOp[0].p3\x00pOp[1].p4.i==pOp[0].p4.i\x00pOp->p4type==P4_INT32\x00nField>0\x00oc!=OP_SeekGT || r.default_rc==-1\x00oc!=OP_SeekLE || r.default_rc==-1\x00oc!=OP_SeekGE || r.default_rc==+1\x00oc!=OP_SeekLT || r.default_rc==+1\x00memIsValid(&r.aMem[i])\x00res!=0\x00oc==OP_SeekGE || oc==OP_SeekGT\x00oc==OP_SeekLT || oc==OP_SeekLE\x00pC->isTable==0\x00memIsValid(&r.aMem[ii])\x00(r.aMem[ii].flags & MEM_Zero)==0 || r.aMem[ii].n==0\x00pIn3->flags & MEM_Blob\x00pC->isTable\x00pCrsr!=0\x00rc==SQLITE_OK || res==0\x00p->apCsr[pOp->p1]->eCurType!=CURTYPE_VTAB\x00sqlite3BtreeCursorIsValid(pC->uc.pCursor)\x00pOp->p3<=pFrame->nMem\x00memIsValid(pMem)\x00(pMem->flags & MEM_Int)!=0\x00pOp->p3==0\x00v>0\x00memIsValid(pData)\x00(pOp->p5 & OPFLAG_ISNOOP) || pC->isTable\x00pOp->p4type==P4_TABLE || pOp->p4type>=P4_STATIC\x00pKey->flags & MEM_Int\x00memIsValid(pKey)\x00pOp->opcode==OP_InsertInt\x00pC->iDb>=0\x00(pOp->p5 & OPFLAG_ISNOOP) || HasRowid(pTab)\x00pData->flags & (MEM_Blob|MEM_Str)\x00pC->deferredMoveto==0\x00pC->movetoTarget==iKey\x00pOp->p4.pTab!=0\x00(pOp->p5 & ~(OPFLAG_SAVEPOSITION|OPFLAG_AUXDELETE))==0\x00rc!=SQLITE_OK || (pOut->flags & MEM_Blob)\x00isSorter(pC)==0\x00pC->nullRow==0\x00pC->uc.pVCur!=0\x00pModule->xRowid\x00pOp->p2==0\x00isSorter(pC)==(pOp->opcode==OP_SorterSort)\x00pOp->p2>0 && pOp->p2<p->nOp\x00pOp->p5<ArraySize(p->aCounter)\x00res==0 || (res==1 && pC->isTable==0)\x00pOp->opcode!=OP_Next || pOp->p4.xAdvance==sqlite3BtreeNext\x00pOp->opcode!=OP_Prev || pOp->p4.xAdvance==sqlite3BtreePrevious\x00pOp->opcode!=OP_NextIfOpen || pOp->p4.xAdvance==sqlite3BtreeNext\x00pOp->opcode!=OP_PrevIfOpen || pOp->p4.xAdvance==sqlite3BtreePrevious\x00pOp->opcode!=OP_Next || pOp->opcode!=OP_NextIfOpen || pC->seekOp==OP_SeekGT || pC->seekOp==OP_SeekGE || pC->seekOp==OP_Rewind || pC->seekOp==OP_Found\x00pOp->opcode!=OP_Prev || pOp->opcode!=OP_PrevIfOpen || pC->seekOp==OP_SeekLT || pC->seekOp==OP_SeekLE || pC->seekOp==OP_Last\x00isSorter(pC)==(pOp->opcode==OP_SorterInsert)\x00pIn2->flags & MEM_Blob\x00pC->eCurType==CURTYPE_BTREE || pOp->opcode==OP_SorterInsert\x00pOp->p2>0 && pOp->p2+pOp->p3<=(p->nMem+1 - p->nCursor)+1\x00!pC->nullRow || pOp->opcode==OP_IdxRowid\x00pOp->p3>=0 && pOp->p3<p->nCursor\x00pTabCur!=0\x00pTabCur->eCurType==CURTYPE_BTREE\x00pTabCur->uc.pCursor!=0\x00pTabCur->isTable\x00pOp->p4type==P4_INTARRAY || pOp->p4.ai==0\x00pOp->opcode==OP_IdxRowid\x00pOp->p5==0 || pOp->p5==1\x00pOp->opcode==OP_IdxLE || pOp->opcode==OP_IdxGT\x00pOp->opcode==OP_IdxGE || pOp->opcode==OP_IdxLT\x00pOp->opcode==OP_IdxLE || pOp->opcode==OP_IdxLT\x00pOp->opcode==OP_IdxGE || pOp->opcode==OP_IdxGT\x00pOp->p1>1\x00resetSchemaOnFault==0 || resetSchemaOnFault==iDb+1\x00DbMaskTest(p->btreeMask, pOp->p2)\x00pC->isEphemeral\x00DbHasProperty(db, iDb, DB_SchemaLoaded)\x00SELECT name, rootpage, sql FROM '%q'.%s WHERE %s ORDER BY rowid\x00nRoot>0\x00aRoot[nRoot]==0\x00(pnErr->flags & MEM_Int)!=0\x00(pnErr->flags & (MEM_Str|MEM_Blob))==0\x00pOp->p5<db->nDb\x00DbMaskTest(p->btreeMask, pOp->p5)\x00z==0\x00pIn3->flags&MEM_Int\x00iSet==-1 || iSet>=0\x00pProgram->nOp>0\x00too many levels of trigger recursion\x00nMem>0\x00pProgram->nMem+pProgram->nCsr==pFrame->nChildMem || (pProgram->nCsr==0 && pProgram->nMem+1==pFrame->nChildMem)\x00pProgram->nCsr==pFrame->nChildCsr\x00(int)(pOp - aOp)==pFrame->pc\x00pFrame->pAuxData==0\x00pIn1->flags&MEM_Int\x00pIn1->flags & MEM_Int\x00t.flags==MEM_Null\x00pOp[-1].opcode==OP_CollSeq\x00(pMem->flags & ~(MEM_Null|MEM_Agg))==0\x00pOp->p2==SQLITE_CHECKPOINT_PASSIVE || pOp->p2==SQLITE_CHECKPOINT_FULL || pOp->p2==SQLITE_CHECKPOINT_RESTART || pOp->p2==SQLITE_CHECKPOINT_TRUNCATE\x00eNew==PAGER_JOURNALMODE_DELETE || eNew==PAGER_JOURNALMODE_TRUNCATE || eNew==PAGER_JOURNALMODE_PERSIST || eNew==PAGER_JOURNALMODE_OFF || eNew==PAGER_JOURNALMODE_MEMORY || eNew==PAGER_JOURNALMODE_WAL || eNew==PAGER_JOURNALMODE_QUERY\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00sqlite3BtreeIsInTrans(pBt)==0\x00p1>=0 && p1<db->nDb\x00DbMaskTest(p->btreeMask, p1)\x00isWriteLock==0 || isWriteLock==1\x00database table is locked: %s\x00(aMem[pOp->p2].flags & MEM_Str)!=0\x00(aMem[pOp->p2].flags & MEM_Static)!=0\x00zTab || db->mallocFailed\x00memIsValid(pQuery)\x00pCur->eCurType==CURTYPE_VTAB\x00(pQuery->flags&MEM_Int)!=0 && pArgc->flags==MEM_Int\x00pModule->xColumn\x00pModule->xNext\x00pVtab->pModule->xRename\x00memIsValid(pName)\x00pName->flags & MEM_Str\x00pOp->p2==1 || pOp->p5==OE_Fail || pOp->p5==OE_Rollback || pOp->p5==OE_Abort || pOp->p5==OE_Ignore || pOp->p5==OE_Replace\x00pOp->p4type==P4_VTAB\x00memIsValid(pX)\x00nArg>1 && apArg[0] && (apArg[0]->flags&MEM_Null)\x00-- \x00pOp->p4.z==0 || strncmp(pOp->p4.z, \"-\" \"- \", 3)==0\x00pOp==p->aOp\x00-- %s\x00SQL-trace: %s\x0a\x00pOp->opcode==OP_Noop || pOp->opcode==OP_Explain\x00pOp>=&aOp[-1] && pOp<&aOp[p->nOp-1]\x00rc=%d\x0a\x00rc\x00statement aborts at %d: [%s] %s\x00DELETE%\x00rc!=SQLITE_OK || nExtraDelete==0 || sqlite3_strlike(\"DELETE%\",p->zSql,0)!=0\x00db->u1.isInterrupted\x00sqlite3VdbeExec\x00SQL: [%s]\x0a\x00REG[%d] = \x00 undefined\x00 NULL\x00 si:%lld\x00 i:%lld\x00 r:%g\x00 (rowset)\x00 subtype=0x%02x\x00(f & (MEM_Static|MEM_Ephem))==0\x00(f & (MEM_Dyn|MEM_Ephem))==0\x00(f & (MEM_Static|MEM_Dyn))==0\x00%d[\x00%02X\x00+%dz\x00sqlite3VdbeMemPrettyPrint\x00(X)\x00(8)\x00(16LE)\x00(16BE)\x00NOT NULL\x00FOREIGN KEY\x00out2Prerelease\x00sqlite3VdbeMemTooBig\x00(pFrom->flags & MEM_RowSet)==0\x00pTo->db==pFrom->db\x00srcType==MEM_Ephem || srcType==MEM_Static\x00sqlite3VdbeMemShallowCopy\x00!VdbeMemDynamic(pTo)\x00vdbeClrCopy\x00pFrom->db==0 || sqlite3_mutex_held(pFrom->db->mutex)\x00pTo->db==0 || sqlite3_mutex_held(pTo->db->mutex)\x00pFrom->db==0 || pTo->db==0 || pFrom->db==pTo->db\x00sqlite3VdbeMemMove\x00(pMem->flags & (MEM_Int|MEM_Real))==0\x00(pMem->flags & (MEM_Str|MEM_Blob))!=0\x00computeNumericType\x00(combined_flags & MEM_RowSet)==0\x00pMem1->enc==pMem2->enc || pMem1->db->mallocFailed\x00pMem1->enc==SQLITE_UTF8 || pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE\x00!pColl || pColl->xCmp\x00sqlite3MemCompare\x00(flags & ~MEM_TypeMask)==0\x00sqlite3VdbeMemInit\x00(pB1->flags & MEM_Zero)==0 || n1==0\x00(pB2->flags & MEM_Zero)==0 || n2==0\x00sqlite3BlobCompare\x00p->deferredMoveto\x00p->isTable\x00p->eCurType==CURTYPE_BTREE\x00handleDeferredMoveto\x00cursorOwnsBtShared(pCur)\x00sqlite3_mutex_held(pCur->pBtree->db->mutex)\x00pRes\x00(pIdxKey==0)==(pCur->pKeyInfo==0)\x00pCur->eState!=CURSOR_VALID || (pIdxKey==0)==(pCur->curIntKey!=0)\x00pIdxKey->default_rc==1 || pIdxKey->default_rc==0 || pIdxKey->default_rc==-1\x00pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]\x00pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->isInit\x00pCur->eState==CURSOR_INVALID || pCur->apPage[pCur->iPage]->nCell>0\x00pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->nCell==0\x00pCur->apPage[0]->intKey==pCur->curIntKey\x00pCur->curIntKey || pIdxKey\x00pPage->nCell>0\x00pPage->intKey==(pIdxKey==0)\x00biasRight==0 || biasRight==1\x00nCellKey==intKey\x00lwr+upr>=0\x00(pIdxKey->errCode!=SQLITE_CORRUPT || c==0) && (pIdxKey->errCode!=SQLITE_NOMEM || pCur->pBtree->db->mallocFailed)\x00c==0\x00lwr==upr+1 || (pPage->intKey && !pPage->leaf)\x00pPage->isInit\x00(pCur->curFlags & BTCF_ValidOvfl)==0\x00cursorHoldsMutex(p)\x00cursorOwnsBtShared\x00sqlite3BtreeMovetoUnpacked\x00pRes!=0\x00*pRes==0 || *pRes==1\x00pCur->skipNext==0 || pCur->eState!=CURSOR_VALID\x00sqlite3BtreeNext\x00*pRes==0\x00pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_SKIPNEXT\x00btreeNext\x00pCur->eState>=CURSOR_REQUIRESEEK\x00pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_INVALID\x00btreeRestoreCursorPosition\x00nKey==(i64)(int)nKey\x00btreeMoveto\x00sqlite3VdbeAllocUnpackedRecord\x00u<=pKeyInfo->nField + 1\x00sqlite3VdbeRecordUnpack\x00n>3 && n<=9\x00sqlite3GetVarint32\x00sizeof(r1)==sizeof(t2) && memcmp(&r1, &t2, sizeof(r1))==0\x00serialGet\x00pCur->iPage<BTCURSOR_MAX_DEPTH\x00pCur->iPage>=0\x00moveToChild\x00pCur==0 || ppPage==&pCur->apPage[pCur->iPage]\x00pCur==0 || bReadOnly==pCur->curPagerFlags\x00pCur==0 || pCur->iPage>0\x00(*ppPage)->pgno==pgno\x00(*ppPage)->aData==sqlite3PagerGetData(pDbPage)\x00pgno!=0 || rc==SQLITE_CORRUPT\x00getAndInitPage\x00moveToLeftmost\x00pCur->iPage>0\x00pCur->apPage[pCur->iPage]\x00moveToParent\x00iIdx<=pParent->nCell\x00get4byte(&pParent->aData[pParent->hdrOffset+8])==iChild\x00get4byte(findCell(pParent, iIdx))==iChild\x00assertParentIndex\x00flags & MEM_Str\x00(*(u8*)pKey1)<=0x3F || CORRUPT_DB\x00vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, res)\x00nKey>=0\x00szHdr<=(u32)nKey\x00nField <= pKeyInfo->nField+pKeyInfo->nXField\x00vdbeAssertFieldCountWithinLimits\x00vdbeRecordCompareInt\x00pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField || CORRUPT_DB\x00pPKey2->pKeyInfo->aSortOrder!=0\x00pPKey2->pKeyInfo->nField>0\x00idx1<=szHdr1 || CORRUPT_DB\x00(pRhs->flags & MEM_Zero)==0 || pRhs->n==0\x00vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, rc)\x00mem1.szMalloc==0\x00CORRUPT_DB || vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, pPKey2->default_rc) || pKeyInfo->db->mallocFailed\x00serial_type<12 || sqlite3SmallTypeSizes[serial_type]==(serial_type - 12)/2\x00sqlite3VdbeSerialTypeLen\x00sqlite3VdbeRecordCompareWithSkip\x00CORRUPT_DB || (serial_type>=1 && serial_type<=9 && serial_type!=7)\x00vdbeRecordDecodeInt\x00pKeyInfo->nField+pKeyInfo->nXField>=pPKey2->nField || CORRUPT_DB\x00pKeyInfo->nField>0\x00vdbeRecordCompareDebug\x00i<10\x00sqlite3VarintLen\x00sqlite3VdbeFindCompare\x00pPKey2->aMem[0].flags & MEM_Str\x00vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, res) || CORRUPT_DB || pPKey2->pKeyInfo->db->mallocFailed\x00vdbeRecordCompareString\x00pCur->skipNext!=SQLITE_OK\x00pCur->apPage[pCur->iPage]!=0\x00pCur->iPage==(-1)\x00pRoot->pgno==pCur->pgnoRoot\x00pRoot->intKey==1 || pRoot->intKey==0\x00moveToRoot\x00p->uc.pCursor!=0\x00sqlite3BtreeCursorHasMoved(p->uc.pCursor)\x00handleMovedCursor\x00pCur!=0\x00pCur->eState!=CURSOR_VALID\x00pCur->skipNext==0\x00sqlite3BtreeCursorRestore\x00pCur!=0 && pCur->iPage>=0 && pCur->apPage[pCur->iPage]\x00pCur->info.nSize>0\x00pCur->info.pPayload>pCur->apPage[pCur->iPage]->aData || CORRUPT_DB\x00pCur->info.pPayload<pCur->apPage[pCur->iPage]->aDataEnd ||CORRUPT_DB\x00fetchPayload\x00sqlite3BtreeCursorIsValid(pCur)\x00!VdbeMemDynamic(pMem)\x00zData!=0\x00sqlite3VdbeMemFromBtree\x00serial_type<128\x00sqlite3VdbeOneByteSerialTypeLen\x00pLen!=0\x00pMem->db->mallocFailed || flags&(MEM_Str|MEM_Blob)\x00sqlite3VdbeSerialType\x00n<=9\x00putVarint64\x00pMem->n + ((pMem->flags & MEM_Zero)?pMem->u.nZero:0) == (int)sqlite3VdbeSerialTypeLen(serial_type)\x00sqlite3VdbeSerialPut\x00n==(db->nSavepoint + db->isTransactionSavepoint)\x00checkSavepointCount\x00p->inTrans==TRANS_WRITE\x00(pBt->btsFlags & BTS_READ_ONLY)==0\x00iStatement>0\x00iStatement>p->db->nSavepoint\x00sqlite3BtreeBeginStmt\x00idx>=1 && idx<=15\x00pBt->pPage1!=0\x00pBt->autoVacuum || iMeta==0\x00iMeta==0 || iMeta==1\x00sqlite3BtreeUpdateMeta\x00iCur>=0 && iCur<p->nCursor\x00allocateCursor\x00wrFlag==0 || wrFlag==BTREE_WRCSR || wrFlag==(BTREE_WRCSR|BTREE_FORDELETE)\x00hasSharedCacheTableLock(p, iTable, pKeyInfo!=0, (wrFlag?2:1))\x00wrFlag==0 || !hasReadConflicts(p, iTable)\x00wrFlag==0 || p->inTrans==TRANS_WRITE\x00pBt->pPage1 && pBt->pPage1->aData\x00wrFlag==0 || (pBt->btsFlags & BTS_READ_ONLY)==0\x00wrFlag==0\x00btreeCursor\x00x==BTREE_SEEK_EQ || x==BTREE_BULKLOAD || x==0\x00sqlite3BtreeCursorHintFlags\x00:memory:\x00pVfs!=0\x00(flags&0xff)==flags\x00(flags & BTREE_UNORDERED)==0 || (flags & BTREE_SINGLE)!=0\x00(flags & BTREE_SINGLE)==0 || isTempDb\x00pBt->nRef>0\x00(pBt->pageSize & 7)==0\x00sqlite3_mutex_held(mutexOpen)\x00rc!=SQLITE_OK || sqlite3BtreeConnectionCount(*ppBtree)>0\x00sqlite3BtreeOpen\x00nUri>=0\x00EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize))\x00EIGHT_BYTE_ALIGNMENT(pPager->jfd)\x00nPathname>0\x00-journal\x00\x00-wal\x00\x00!memDb\x00nolock\x00immutable\x00pPager->memDb==0\x00nExtra>=8 && nExtra<1000\x00tempFile==PAGER_LOCKINGMODE_NORMAL || tempFile==PAGER_LOCKINGMODE_EXCLUSIVE\x00useJournal || pPager->tempFile\x00pPager->fullSync==0\x00pPager->extraSync==0\x00pPager->syncFlags==0\x00pPager->walSyncFlags==0\x00pPager->ckptSyncFlags==0\x00isOpen(pPager->fd) || tempFile\x00sqlite3PagerOpen\x00onoffalseyestruextrafull\x00szExtra>=8\x00sqlite3PcacheOpen\x00(pPg->flags&PGHDR_NEED_SYNC)==0\x00pagerStress\x00sqlite3PagerPageRefcount(pData)>0\x00pageReinit\x00sqlite3PagerReadFileheader\x00((int(*)(void *))(ap[0]))==xBusyHandler\x00ap[1]==pBusyHandlerArg\x00sqlite3PagerSetBusyhandler\x00pgnoRoot>=3 || CORRUPT_DB\x00eType!=PTRMAP_ROOTPAGE\x00eType!=PTRMAP_FREEPAGE\x00sqlite3PagerIswriteable(pBt->pPage1->pDbPage)\x00sqlite3PagerIswriteable(pRoot->pDbPage)\x00(pBt->openFlags & BTREE_SINGLE)==0 || pgnoRoot==2\x00btreeCreateTable\x00pCsr->pKeyInfo && pCsr->pBtx==0\x00pSorter->iMemory==0\x00sqlite3VdbeSorterInit\x00sqlite3BtreePrevious\x00(pCur->curFlags & (BTCF_AtLast|BTCF_ValidOvfl|BTCF_ValidNKey))==0\x00pCur->info.nSize==0\x00(pCur->curFlags & (BTCF_ValidOvfl))==0\x00btreePrevious\x00(pCur->curFlags & BTCF_ValidNKey)==0\x00moveToRightmost\x00pCur->aiIdx[ii]==pCur->apPage[ii]->nCell\x00pCur->ix==pCur->apPage[pCur->iPage]->nCell-1\x00pCur->apPage[pCur->iPage]->leaf\x00sqlite3BtreeLast\x00(flags & (BTREE_SAVEPOSITION|BTREE_APPEND))==flags\x00(pCur->curFlags & BTCF_WriteFlag)!=0 && pBt->inTransaction==TRANS_WRITE && (pBt->btsFlags & BTS_READ_ONLY)==0\x00hasSharedCacheTableLock(p, pCur->pgnoRoot, pCur->pKeyInfo!=0, 2)\x00(pX->pKey==0)==(pCur->pKeyInfo==0)\x00pX->pKey==0\x00(flags & BTREE_SAVEPOSITION)==0 || ((pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey)\x00pCur->eState==CURSOR_VALID || (pCur->eState==CURSOR_INVALID && loc)\x00pPage->intKey || pX->nKey>=0\x00pPage->leaf || !pPage->intKey\x00newCell!=0\x00szNew==pPage->xCellSize(pPage, newCell)\x00szNew <= MX_CELL_SIZE(pBt)\x00idx<pPage->nCell\x00pPage->leaf\x00pPage->nOverflow==0 || rc==SQLITE_OK\x00rc!=SQLITE_OK || pPage->nCell>0 || pPage->nOverflow>0\x00pCur->pKey==0\x00pCur->apPage[pCur->iPage]->nOverflow==0\x00sqlite3BtreeInsert\x00sqlite3BtreeHoldsMutex(pBtree)\x00invalidateIncrblobCursors\x00pCell<pPage->aData || pCell>=&pPage->aData[pBt->pageSize] || sqlite3PagerIswriteable(pPage->pDbPage)\x00pX->nKey<=0x7fffffff && pX->pKey!=0\x00nHeader==(int)(info.pPayload - pCell)\x00info.nKey==pX->nKey\x00*pnSize == info.nSize\x00spaceLeft == info.nLocal\x00pToRelease==0 || sqlite3PagerIswriteable(pToRelease->pDbPage)\x00pPrior<pPage->aData || pPrior>=&pPage->aData[pBt->pageSize] || sqlite3PagerIswriteable(pPage->pDbPage)\x00pPayload<pPage->aData || pPayload>=&pPage->aData[pBt->pageSize] || sqlite3PagerIswriteable(pPage->pDbPage)\x00pSrc\x00fillInCell\x00pBt->usableSize > 4\x00nOvfl>0 || (CORRUPT_DB && (pInfo->nPayload + ovflPageSize)<ovflPageSize)\x00clearCell\x00btreePageLookup\x00CORRUPT_DB || iPage>1\x00!pMemPage || pMemPage->pgno==iPage\x00pBt->usableSize>32\x00freePage2\x00sqlite3PcacheRef\x00pgno<=pBt->nPage\x00btreeSetHasContent\x00idx>=0 && idx<pPage->nCell\x00CORRUPT_DB || sz==cellSize(pPage, idx)\x00dropCell\x00CORRUPT_DB || iStart>=pPage->hdrOffset+6+pPage->childPtrSize\x00CORRUPT_DB || iEnd <= pPage->pBt->usableSize\x00iSize>=4\x00iStart<=iLast\x00iFreeBlk>iPtr || iFreeBlk==0\x00freeSpace\x00*pRC==SQLITE_OK\x00i>=0 && i<=pPage->nCell+pPage->nOverflow\x00MX_CELL(pPage->pBt)<=10921\x00pPage->nCell<=MX_CELL(pPage->pBt) || CORRUPT_DB\x00pPage->nOverflow<=ArraySize(pPage->apOvfl)\x00sz==pPage->xCellSize(pPage, pCell) || (sz==8 && iChild>0)\x00j < ArraySize(pPage->apOvfl)-1\x00j==0 || pPage->aiOvfl[j-1]<(u16)i\x00j==0 || i==pPage->aiOvfl[j-1]+1\x00&data[pPage->cellOffset]==pPage->aCellIdx\x00idx >= 0\x00idx >= pPage->cellOffset+2*pPage->nCell+2 || CORRUPT_DB\x00idx+sz <= (int)pPage->pBt->usableSize\x00get2byte(&data[pPage->hdrOffset+3])==pPage->nCell\x00insertCell\x00nByte>=0\x00pPage->nFree>=nByte\x00pPage->nOverflow==0\x00nByte < (int)(pPage->pBt->usableSize-8)\x00pPage->cellOffset == hdr + 12 - 4*pPage->leaf\x00gap<=65536\x00top<=(int)pPage->pBt->usableSize\x00pSpace>=data && (pSpace - data)<65536\x00pPage->nCell>0 || CORRUPT_DB\x00gap+2+nByte<=top\x00top+nByte <= (int)pPage->pBt->usableSize\x00allocateSpace\x00pc>0\x00pageFindSlot\x00pPage->pBt->usableSize <= SQLITE_MAX_PAGE_SIZE\x00nCell==get2byte(&data[hdr+3])\x00iFree2==0 || iFree2>iFree\x00iFree+get2byte(&data[iFree+2]) <= usableSize\x00iFree2==0 || iFree2+get2byte(&data[iFree2+2]) <= usableSize\x00iFree+sz+sz2+iFree2-(iFree+sz) <= usableSize\x00cbrk+(iFree-top) <= usableSize\x00pc>=iCellFirst && pc<=iCellLast\x00cbrk+size<=usableSize && cbrk>=iCellFirst\x00cbrk>=iCellFirst\x00defragmentPage\x00balance_deeper_called==0\x00pCur->apPage[1]->nOverflow\x00balance_quick_called==0\x00balance\x00pRoot->nOverflow>0\x00sqlite3PagerIswriteable(pChild->pDbPage)\x00pChild->nCell==pRoot->nCell\x00balance_deeper\x00pFrom->isInit\x00pFrom->nFree>=iToHdr\x00get2byte(&aFrom[iFromHdr+5]) <= (int)pBt->usableSize\x00copyNodeContent\x00sqlite3PagerIswriteable(pParent->pDbPage)\x00pPage->nOverflow==1\x00sqlite3PagerIswriteable(pNew->pDbPage)\x00pPage->aData[0]==(PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF)\x00balance_quick\x00szCell[i]==pPg->xCellSize(pPg, pCell) || CORRUPT_DB\x00rebuildPage\x00pParent->nOverflow==0 || pParent->nOverflow==1\x00pParent->nOverflow==0 || pParent->aiOvfl[0]==iParentIdx\x00bBulk==0 || bBulk==1\x00szScratch<=6*(int)pBt->pageSize\x00EIGHT_BYTE_ALIGNMENT(aSpace1)\x00k==0 || pOld->aiOvfl[k-1]+1==pOld->aiOvfl[k]\x00b.nCell<nMaxCells\x00sz<=pBt->maxLocal+23\x00iSpace1 <= (int)pBt->pageSize\x00leafCorrection==0 || leafCorrection==4\x00leafCorrection==0\x00pOld->hdrOffset==0\x00leafCorrection==4\x00b.szCell[b.nCell]==3 || CORRUPT_DB\x00b.apCell[b.nCell]==&aSpace1[iSpace1-3] || CORRUPT_DB\x00d<nMaxCells\x00r<nMaxCells\x00cntNew[0]>0 || (pParent->pgno==1 && pParent->nCell==0) || CORRUPT_DB\x00CORRUPT_DB\x00j<nMaxCells\x00b.apCell[j]!=0\x00iOvflSpace <= (int)pBt->pageSize\x00iPg>=0 && iPg<nNew\x00iPg==0 || cntOld[iPg-1]>=cntNew[iPg-1] || abDone[iPg-1]\x00cntNew[iPg]>=cntOld[iPg] || abDone[iPg+1]\x00apNew[iPg]->nOverflow==0\x00apNew[iPg]->nCell==nNewCell\x00\x01\x01\x01\x01\x01\x00memcmp(abDone, \"\\01\\01\\01\\01\\01\", nNew)==0\x00nOld>0\x00nNew>0\x00nNew==1 || CORRUPT_DB\x00apNew[0]->nFree == (get2byte(&apNew[0]->aData[5])-apNew[0]->cellOffset-apNew[0]->nCell*2) || rc!=SQLITE_OK\x00pParent->isInit\x00balance_nonroot\x00sqlite3_mutex_notheld(mem0.mutex)\x00sqlite3ScratchMalloc\x00N>=0 && N<p->nCell\x00cachedCellSize\x00p->szCell[N]==0\x00computeCellSize\x00pPg->pgno!=iNew\x00sqlite3PagerRekey\x00(iOld-iNew)<nNew || nCell==0 || CORRUPT_DB\x000==memcmp(pCell, &aData[iOff], pCArray->pRef->xCellSize(pCArray->pRef, pCArray->apCell[i+iNew]))\x00sz>0\x00pFree>aData && (pFree - aData)<65536\x00pageFreeArray\x00editPage\x00CORRUPT_DB || pPg->hdrOffset==0\x00(pSlot+sz)<=pCArray->apCell[i] || pSlot>=(pCArray->apCell[i]+sz) || CORRUPT_DB\x00pageInsertArray\x00idx>=0 && idx+N<=p->nCell\x00p->apCell[idx]!=0\x00CORRUPT_DB || p->szCell[idx]==p->pRef->xCellSize(p->pRef, p->apCell[idx])\x00populateCellCache\x00mem0.nScratchFree <= (u32)sqlite3GlobalConfig.nScratch\x00sqlite3ScratchFree\x00pCur->curFlags & BTCF_WriteFlag\x00!hasReadConflicts(p, pCur->pgnoRoot)\x00(flags & ~(BTREE_SAVEPOSITION | BTREE_AUXDELETE))==0\x00MX_CELL_SIZE(pBt) >= nCell\x00pTmp!=0\x00bPreserve && (pCur->iPage==iCellDepth || CORRUPT_DB)\x00pPage==pCur->apPage[pCur->iPage] || CORRUPT_DB\x00(pPage->nCell>0 || CORRUPT_DB) && iCellIdx<=pPage->nCell\x00sqlite3BtreeDelete\x00r2->nField==nKeyCol\x00sqlite3VdbeSorterCompare\x00sqlite3VdbeSorterRowkey\x00sqlite3VdbeCursorRestore\x00sqlite3BtreeCursorIsValidNN\x00pCur->apPage[pCur->iPage]->nCell>0\x00sqlite3BtreeFirst\x00sqlite3BtreeRowCountEst\x00pSorter\x00pSorter->list.pList\x00pSorter->pReader==0\x00sqlite3VdbeSorterRewind\x00p->u.iNext<sqlite3MallocSize(pList->aMemory)\x00pTask->pUnpacked->errCode==SQLITE_OK || pTask->pUnpacked->errCode==SQLITE_NOMEM\x00(s1>0 && s1<7) || s1==8 || s1==9\x00(s2>0 && s2<7) || s2==8 || s2==9\x00vdbeSorterCompareInt\x00vdbeSorterSort\x00p1!=0 && p2!=0\x00vdbeSorterMerge\x00pTask->pThread==0 && pTask->bDone==0\x00pTask->list.pList==0\x00pTask->list.aMemory==0 || pSorter->list.aMemory!=0\x00pList->szPMA>0\x00rc!=SQLITE_OK || pTask->file.pFd\x00pTask->file.iEof==0\x00pTask->nPMA==0\x00rc!=SQLITE_OK || pList->pList==0\x00rc!=SQLITE_OK || pTask->file.iEof==iSz\x00vdbeSorterListToPMA\x00p->iBufEnd<p->nBuffer\x00vdbePmaWriteBlob\x00vdbePmaWriterFinish\x00vdbeSorterFlushPMA\x00vdbeSorterCreateThread\x00ppThread!=0\x00xTask!=0\x00sqlite3GlobalConfig.bCoreMutex!=0\x00sqlite3ThreadCreate\x00pTask->bDone==0\x00vdbeSorterFlushThread\x00pSorter->bUseThreads==0 || pSorter->nTask>1\x00pIncr->pTask!=pLast\x00p->pIncr==0 || ( (p->pIncr->pTask==&pSorter->aTask[iTask]) && (iTask!=pSorter->nTask-1 || p->pIncr->bUseThread==0) )\x00pSorter->bUseThreads || pSorter->nTask==1\x00pTask->nPMA>0 || SQLITE_MAX_WORKER_THREADS>0\x00pMain==0\x00vdbeSorterMergeTreeBuild\x00nReader<=SORTER_MAX_MERGE_COUNT\x00vdbeMergeEngineNew\x00pFile->iEof>iStart\x00pReadr->aAlloc==0 && pReadr->nAlloc==0\x00pReadr->aBuffer==0\x00pReadr->aMap==0\x00vdbePmaReaderInit\x00pReadr->pIncr==0 || pReadr->pIncr->bEof==0\x00vdbePmaReaderSeek\x00p->aBuffer\x00nRead>0\x00rc!=SQLITE_IOERR_SHORT_READ\x00aNext!=p->aAlloc\x00vdbePmaReadBlob\x00pIncr->bUseThread\x00vdbeIncrBgPopulate\x00pIncr->bEof==0\x00pIncr->pMerger->pTask==pTask\x00vdbeIncrPopulate\x00vdbeSorterSetupMerge\x00pIncr->bUseThread==0 || eMode==INCRINIT_TASK\x00vdbePmaReaderIncrInit\x00pTask->file2.iEof>0\x00eMode==INCRINIT_ROOT || eMode==INCRINIT_TASK\x00pMerger->pTask==0\x00vdbeMergeEngineInit\x00iOut<pMerger->nTree && iOut>0\x00pTask->pUnpacked!=0\x00vdbeMergeEngineCompare\x00vdbePmaReaderIncrMergeInit\x00pSorter->bUsePMA || (pSorter->pReader==0 && pSorter->pMerger==0)\x00pSorter->pReader==0 || pSorter->pMerger==0\x00pSorter->bUseThreads==0 || pSorter->pReader\x00pSorter->bUseThreads==1 || pSorter->pMerger\x00pSorter->pMerger!=0\x00pSorter->pMerger->pTask==(&pSorter->aTask[0])\x00sqlite3VdbeSorterNext\x00rc!=SQLITE_OK || pSorter->list.pList==0\x00sqlite3VdbeSorterWrite\x00(nCellKey & SQLITE_MAX_U32)==(u64)nCellKey\x00sqlite3VdbeIdxRowid\x00sqlite3VdbeIdxKeyCompare\x00iTable>=2\x00maxRootPgno!=PENDING_BYTE_PAGE(pBt)\x00btreeDropTable\x00sqlite3BtreeClearTable\x00pPage->intKey || CORRUPT_DB\x00clearDatabasePage\x00sqlite3RootPageMoved\x00sqlite_stat1\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00sqlite3AnalysisLoad\x00zDatabase!=0 || sqlite3BtreeHoldsAllMutexes(db)\x00sqlite3FindTable\x00analysisLoader\x00aOut==0\x00aLog!=0\x00pIndex!=0\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00decodeIntArray\x00matchOther<0x80\x00patternCompare\x00!pIdx->hasStat1\x0010==sqlite3LogEst(2)\x0033==sqlite3LogEst(10)\x0023==sqlite3LogEst(5)\x00sqlite3DefaultRowEst\x00zTabName\x00sqlite3UnlinkAndDeleteTable\x00sqlite3UnlinkAndDeleteIndex\x00sqlite3UnlinkAndDeleteTrigger\x00p->inTrans>TRANS_NONE && pBt->inTransaction>TRANS_NONE\x00nRef>=0\x00Main freelist: \x00Page %d is never used\x00Pointer map page %d is referenced\x00nRef==sqlite3PagerRefcount(pBt->pPager)\x00sqlite3BtreeIntegrityCheck\x00iPg<=pCheck->nPage && sizeof(pCheck->aPgRef[0])==1\x00setPageReferenced\x00%d of %d pages missing from overflow list starting at %d\x00failed to get page %d\x00freelist leaf count too big on page %d\x00free-page count in header is too small\x00invalid page number %d\x002nd reference to page %d\x00getPageReferenced\x00Failed to read ptrmap key=%d\x00Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)\x00Page %d: \x00unable to get the page. error code=%d\x00rc==SQLITE_CORRUPT\x00btreeInitPage() returns error code %d\x00On tree page %d cell %d: \x00contentOffset<=usableSize\x00pPage->nCell==nCell\x00pPage->aCellIdx==&data[cellStart]\x00On page %d at right child: \x00pCellIdx==&data[cellStart + i*2]\x00Offset %d out of range %d..%d\x00Extends off end of page\x00Rowid %lld out of order\x00pc + info.nSize - 4 <= usableSize\x00Child page depth differs\x00(u32)i<=usableSize-4\x00(u32)(i+size)<=usableSize\x00j==0 || j>i+size\x00(u32)j<=usableSize-4\x00Multiple uses for byte %u of page %d\x00Fragmentation of %d bytes reported as %d on page %d\x00checkTreePage\x00pMem->zMalloc\x00pMem->u.pRowSet!=0\x00sqlite3VdbeMemSetRowSet\x00N >= ROUND8(sizeof(*p))\x00sqlite3RowSetInit\x00p!=0 && (p->rsFlags & ROWSET_NEXT)==0\x00sqlite3RowSetInsert\x00rowSetEntryAlloc\x00p->pForest==0\x00sqlite3RowSetNext\x00pA->pRight==0 || pA->v<=pA->pRight->v\x00pB->pRight==0 || pB->v<=pB->pRight->v\x00rowSetEntryMerge\x00pRowSet!=0 && (pRowSet->rsFlags & ROWSET_NEXT)==0\x00sqlite3RowSetTest\x00pList!=0\x00rowSetListToTree\x00pIn!=0\x00(*ppLast)->pRight==0\x00rowSetTreeToList\x00!pnLog || *pnLog==-1\x00!pnCkpt || *pnCkpt==-1\x00sqlite3Checkpoint\x00sqlite3PagerOkToChangeJournalMode\x00pPager->journalMode==PAGER_JOURNALMODE_WAL\x00sqlite3PagerCloseWal\x00eMode==PAGER_JOURNALMODE_DELETE || eMode==PAGER_JOURNALMODE_TRUNCATE || eMode==PAGER_JOURNALMODE_PERSIST || eMode==PAGER_JOURNALMODE_OFF || eMode==PAGER_JOURNALMODE_WAL || eMode==PAGER_JOURNALMODE_MEMORY\x00pPager->tempFile==0 || eMode!=PAGER_JOURNALMODE_WAL\x00eOld==PAGER_JOURNALMODE_MEMORY || eOld==PAGER_JOURNALMODE_OFF\x00isOpen(pPager->fd) || pPager->exclusiveMode\x00state==PAGER_OPEN || state==PAGER_READER\x00state==pPager->eState\x00Filename:      %s\x0aState:         %s errCode=%d\x0aLock:          %s\x0aLocking mode:  locking_mode=%s\x0aJournal mode:  journal_mode=%s\x0aBacking store: tempFile=%d memDb=%d useJournal=%d\x0aJournal:       journalOff=%lld journalHdr=%lld\x0aSize:          dbsize=%d dbOrigSize=%d dbFileSize=%d\x0a\x00OPEN\x00READER\x00WRITER_LOCKED\x00WRITER_CACHEMOD\x00WRITER_DBMOD\x00WRITER_FINISHED\x00ERROR\x00?error?\x00NO_LOCK\x00RESERVED\x00SHARED\x00UNKNOWN\x00exclusive\x00normal\x00memory\x00off\x00delete\x00persist\x00truncate\x00wal\x00sqlite3PagerSetJournalMode\x00iVersion==1 || iVersion==2\x00sqlite3BtreeSetVersion\x00eMode>=0 && eMode<=ArraySize(azModeName)\x00sqlite3JournalModename\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00ATTACH''AS vacuum_db\x00(db->nDb-1)==nDb\x00vacuum_db\x00strcmp(pDb->zDbSName,\"vacuum_db\")==0\x00SELECT sql FROM \"%w\".sqlite_master WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_master WHERE type='index' AND length(sql)>10\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_master WHERE type='table'AND coalesce(rootpage,1)>0\x00(db->flags & SQLITE_Vacuum)!=0\x00INSERT INTO vacuum_db.sqlite_master SELECT*FROM \"%w\".sqlite_master WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x001==sqlite3BtreeIsInTrans(pTemp)\x001==sqlite3BtreeIsInTrans(pMain)\x00sqlite3_strnicmp(zSql,\"SELECT\",6)==0\x00zSubSql[0]!='S'\x00rc!=SQLITE_ROW\x00execSql\x00sqlite3RunVacuum\x00sqlite3BtreeSetSpillSize\x00p->pCache!=0\x00sqlite3PcacheSetSpillsize\x00sqlite3BtreeSetPagerFlags\x00nReserve>=-1 && nReserve<=255\x00nReserve>=0 && nReserve<=255\x00sqlite3BtreeSetPageSize\x00sqlite3BtreeIsInTrans(pTo)\x00b.rc!=SQLITE_OK\x00sqlite3BtreeIsInTrans(pTo)==0\x00sqlite3BtreeCopyFile\x00nSrcPage>=0\x00pgszSrc==sqlite3BtreeGetPageSize(p->pSrc)\x00pgszDest==sqlite3BtreeGetPageSize(p->pDest)\x00nDestTruncate>0\x00nDestTruncate==0 || (i64)nDestTruncate*(i64)pgszDest >= iSize || ( nDestTruncate==(int)(PENDING_BYTE_PAGE(p->pDest->pBt)-1) && iSize>=PENDING_BYTE && iSize<=PENDING_BYTE+pgszDest )\x00sqlite3_backup_step\x00sqlite3BtreeHoldsMutex(p->pSrc)\x00attachBackupObject\x00sqlite3PagerClearCache\x00pBt->inTransaction==TRANS_WRITE && p->inTrans==TRANS_WRITE\x00sqlite3BtreeIncrVacuum\x00p->inTrans!=TRANS_NONE\x00sqlite3BtreeLockTable\x000==(p->db->flags&SQLITE_ReadUncommitted) || eLock==WRITE_LOCK\x00p->sharable\x00SQLITE_OK==querySharedCacheTableLock(p, iTable, eLock)\x00setSharedCacheTableLock\x00sqlite3VdbeMemCopy\x00pTab && IsVirtual(pTab) && !pTab->pVTable\x00no such module: %s\x00sqlite3VtabCallCreate\x00vtable constructor called recursively: %s\x00&db->pVtabCtx\x00xConstruct\x00sCtx.pTab==pTab\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00hidden\x00zType[i-1]==' '\x00vtabCallConstructor\x00p->pVtab\x00xDestroy!=0\x00pTab->pVTable==p && p->pNext==0\x00sqlite3VtabCallDestroy\x00pPager->eState!=PAGER_OPEN\x00pPager->mxPgno>=pPager->dbSize\x00sqlite3PagerMaxPageCount\x00(zRawSql - zStart) > 0\x00zRawSql[0] || nToken==0\x00sqlite3Isdigit(zRawSql[1])\x00zRawSql[0]==':' || zRawSql[0]=='$' || zRawSql[0]=='@' || zRawSql[0]=='#'\x00idx>0\x00idx>0 && idx<=p->nVar\x00'%.*q'\x00zeroblob(%d)\x00pVar->flags & MEM_Blob\x00x'\x00%02x\x00'\x00sqlite3VdbeExpandSql\x00n>0 && tokenType!=TK_ILLEGAL\x00findNextHostParameter\x00sqlite3_mutex_held(sqlite3VdbeDb(p)->mutex)\x00pNew==0\x00sqlite3Reprepare\x00pA->db==pB->db\x00sqlite3VdbeSwap\x00pTo->nVar==pFrom->nVar\x00sqlite3TransferBindings\x00sqlite3_step\x00main\x00sqlite3_strnicmp(zName, \"pragma_\", 7)==0\x00sqlite3HashFind(&db->aModule, zName)==0\x00sqlite3PragmaVtabRegister\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_size\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_file_format\x00lock_status\x00locking_mode\x00max_page_count\x00mmap_size\x00optimize\x00page_count\x00page_size\x00parser_trace\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00sql_trace\x00stats\x00synchronous\x00table_info\x00temp_store\x00temp_store_directory\x00threads\x00user_version\x00vdbe_addoptrace\x00vdbe_debug\x00vdbe_eqp\x00vdbe_listing\x00vdbe_trace\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00strlen(zBuf) < sizeof(zBuf)-1\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00tbl\x00idx\x00wdth\x00hght\x00flgs\x00seqno\x00desc\x00coll\x00key\x00seq\x00unique\x00origin\x00partial\x00file\x00id\x00table\x00to\x00on_update\x00on_delete\x00match\x00parent\x00fkid\x00busy\x00log\x00checkpointed\x00timeout\x00database\x00status\x00pragmaVtabConnect\x00j < 2\x00pragmaVtabBestIndex\x00j<ArraySize(pCsr->azArg)\x00PRAGMA \x00%Q.\x00=%Q\x00pragmaVtabFilter\x00pCsr->pPragma\x00pragmaVtabNext\x00sqlite3_result_value\x00pTab->nModuleArg==0\x00sqlite3VtabEponymousTableInit\x00pTable\x00view %s is circularly defined\x00pTable->nCol>=0\x00pTable->pSelect\x00pTable->aCol==0\x00sqlite3SchemaMutexHeld(db, 0, pTable->pSchema)\x00sqlite3ViewGetColumnNames\x00pTab\x00sqlite3VtabCallConnect\x00db->lookaside.bDisable\x00sqlite3ResultSetOfSelect\x00pSelect!=0\x00(pSelect->selFlags & SF_Resolved)!=0\x00pTab->nCol==pSelect->pEList->nExpr || db->mallocFailed\x00sqlite3SelectAddColumnTypeAndCollation\x00pNC->pSrcList!=0\x00pTab && pExpr->pTab==pTab\x00!pS\x00iCol==-1 || (iCol>=0 && iCol<pTab->nCol)\x00columnTypeImpl\x00sqlite3ExprCollSeq\x00p==pColl\x00sqlite3CheckCollSeq\x00no such index: %s\x00a NATURAL join may not have an ON or USING clause\x00cannot have both ON and USING clauses in the same join\x00cannot join using column %s - column not present in both tables\x00sqliteProcessJoin\x00(piTab==0)==(piCol==0)\x00tableAndColumnIndex\x00iLeft<iRight\x00pSrc->nSrc>iRight\x00pSrc->a[iLeft].pTab\x00pSrc->a[iRight].pTab\x00!ExprHasProperty(pEq, EP_TokenOnly|EP_Reduced)\x00addWhereTerm\x00p->op!=TK_INTEGER || (p->flags & EP_IntValue)!=0 || sqlite3GetInt32(p->u.zToken, &rc)==0\x00v!=(-2147483647-1)\x00sqlite3ExprIsInteger\x00sqlite3ExprAttachSubtrees\x00sqlite3ExprListFlags\x00Expression tree is too large (maximum depth %d)\x00setJoinExpr\x00sqlite3MatchSpanName\x00pList!=0 || pParse->db->mallocFailed!=0\x00pItem->zName==0\x00sqlite3ExprListSetName\x00pParse->pWith==pWith\x00selectPopWith\x00sqlite3ResolveSelectNames\x00pNC!=0\x00pParse==pWalker->pParse\x00pSrcList->a[i].iCursor>=0 && pSrcList->a[i].iCursor<pParse->nTab\x00the \".\" operator\x00pRight->op==TK_DOT\x00second argument to likelihood() must be a constant between 0.0 and 1.0\x00not authorized to use function: %s\x00non-deterministic functions\x00misuse of aggregate function %.*s()\x00no such function: %.*s\x00wrong number of arguments to function %.*s()\x00pDef!=0\x00subqueries\x00pNC->nRef>=nRef\x00parameters\x00pExpr->pLeft!=0\x00pExpr->pRight!=0\x00resolveExprStep\x00(validMask&~(NC_IsCheck|NC_PartIdx|NC_IdxExpr))==0\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00%s prohibited in %s\x00notValid\x00pNC\x00zCol\x00!ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced)\x00db->aDb[i].zDbSName\x00pNC && cnt==0\x00pTab!=0 && pTab->zName!=0\x00pTab->nCol>0\x00zTabName!=0\x00(pMatch->fg.jointype & JT_RIGHT)==0\x00op==TK_DELETE || op==TK_UPDATE || op==TK_INSERT\x00pExpr->pLeft==0 && pExpr->pRight==0\x00pExpr->x.pList==0\x00pExpr->x.pSelect==0\x00misuse of aliased aggregate %s\x00zTab==0 && zDb==0\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00pMatch->iCursor==pExpr->iTable\x00pTopNC!=0\x00lookupName\x00_ROWID_\x00ROWID\x00OID\x00iCol>=0 && iCol<pEList->nExpr\x00pOrig!=0\x00(pExpr->flags & (EP_Reduced|EP_TokenOnly))==0\x00resolveAlias\x00zC!=0\x00sqlite3ExprAddCollateString\x00pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER\x00pTabList\x00pTab->iPKey<pTab->nCol\x00sqlite3AuthRead\x00access to %s.%s.%s is prohibited\x00access to %s.%s is prohibited\x00r>=0.0\x00exprProbability\x00pExpr->op==TK_AGG_FUNCTION\x00sqlite3FunctionUsesThisSrc\x00exprSrcCount\x00(p->selFlags & SF_Expanded)!=0\x00(p->selFlags & SF_Resolved)==0\x00p->pSrc->nSrc==1 && p->pOrderBy\x00pSub->pPrior && pSub->pOrderBy==0\x00pItem->fg.isCorrelated==0 && nRef<=0\x00(p->selFlags & SF_Aggregate)==0\x00a GROUP BY clause is required before HAVING\x00aggregate functions are not allowed in the GROUP BY clause\x00resolveSelectStep\x00%r %s BY term out of range - should be between 1 and %d\x00sqlite3ExprCompare\x00too many terms in %s BY clause\x00sqlite3ResolveOrderGroupBy\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00too many terms in ORDER BY clause\x00pDup\x00pParent->op==TK_COLLATE\x00pParent->pLeft==pE\x00%r ORDER BY term does not match any column in the result set\x00resolveCompoundOrderBy\x00sqlite3ExprIsInteger(pE, &i)==0\x00resolveOrderByTermToExprList\x00p->selFlags & SF_Resolved\x00(p->selFlags & SF_HasTypeInfo)==0\x00selectAddSubqueryTypeInfo\x00p->pPrior==0\x00pSrc && iFrom>=0 && iFrom<pSrc->nSrc\x00pSub!=0\x00pSubSrc\x00pSub->pSrc!=0\x00pSub->pEList->nExpr==pSub1->pEList->nExpr\x00flatten %s.%p from term %d\x0a\x00compound-subquery flattener creates %s.%p as peer\x0a\x00pParent==p\x00pParent!=p\x00pSrc->a[i+iFrom].fg.isTabFunc==0\x00pParent->pOrderBy==0\x00pSub->pPrior==0\x00pParent->pHaving==0\x00pParent->pGroupBy==0\x00After flattening:\x0a\x00flattenSubquery\x00pSubst->pEList!=0 && pExpr->iColumn<pSubst->pEList->nExpr\x00substExpr\x00sub-select returns %d columns - expected %d\x00substSelect\x00p && p->pPrior\x00(p->selFlags & SF_Recursive)==0 || p->op==TK_ALL || p->op==TK_UNION\x00ORDER BY clause should come after %s not before\x00LIMIT clause should come after %s not before\x00p->pEList\x00p->pEList && pPrior->pEList\x00p->pEList->nExpr==pPrior->pEList->nExpr\x00!pPrior->pLimit\x00Jump ahead if LIMIT reached\x00p->pLimit==0\x00p->pOffset==0\x00p->pOrderBy==0\x00p->addrOpenEphm[0] == -1\x00!pPrior->pOrderBy\x00p->op==TK_UNION\x00unionTab==dest.iSDParm || dest.eDest!=priorOp\x00p->op==TK_INTERSECT\x00p->addrOpenEphm[1] == -1\x00p->pNext==0\x00pLoop->addrOpenEphm[1]<0\x00multiSelect\x00p->selFlags & SF_MultiValue\x00p->selFlags & SF_Values\x00p->op==TK_ALL || (p->op==TK_SELECT && p->pPrior==0)\x00p->pNext==0 || p->pEList->nExpr==p->pNext->pEList->nExpr\x00p->pPrior->pNext==p\x00multiSelectValues\x00Queue table\x00recursive aggregate queries not supported\x00p->pOffset==0 || p->pLimit!=0\x00LIMIT counter\x00OFFSET counter\x00LIMIT+OFFSET\x00CLEAR\x0a\x00computeLimitRegisters\x00generateWithRecursiveQuery\x00sqlite3KeyInfoIsWriteable(pRet)\x00iCol>=0\x00multiSelectCollSeq\x00multiSelectOrderByKeyInfo\x00iContinue!=0\x00eDest==SRT_Set || eDest==SRT_Mem || eDest==SRT_Coroutine || eDest==SRT_Output\x00sqlite3VdbeCurrentAddr(v)==iJump || pParse->db->mallocFailed\x00pDistinct->eTnctType==WHERE_DISTINCT_UNORDERED\x00pSort==0\x00sqlite3Strlen30(pDest->zAffSdst)==nResultCol\x00nResultCol<=pDest->nSdst\x00nResultCol==pDest->nSdst\x00regResult==iParm\x00pSO\x00eDest==SRT_Discard\x00selectInnerLoop\x00target>0\x00pParse->pVdbe!=0\x00sqlite3ExprCodeExprList\x00ConstFactorOk(pParse)\x00sqlite3ExprCodeAtInit\x00addr>=0 && addr<p->nOp\x00sqlite3VdbeChangeToNoop\x00sqlite3VdbeCurrentAddr\x00!usedAsColumnCache(pParse, i, i+n-1)\x00sqlite3GetTempRange\x00bSeq==0 || bSeq==1\x00nData==1 || regData==regOrigData || regOrigData==0\x00nPrefixReg==nExpr+bSeq\x00pSelect->iOffset==0 || pSelect->iLimit!=0\x00pushOntoSorter\x00iFrom>=iTo+nReg || iFrom+nReg<=iTo\x00sqlite3ExprCodeMove\x00sqlite3KeyInfoIsWriteable(pInfo)\x00keyInfoFromExprList\x00j<p->nLabel\x00j>=0\x00sqlite3VdbeResolveLabel\x00p->pOrderBy!=0\x00pKeyDup==0\x00pPrior->pOrderBy==0\x00pOrderBy\x00pItem->u.x.iOrderByCol>0\x00pItem->u.x.iOrderByCol<=p->pEList->nExpr\x00nOrderBy>=nExpr || db->mallocFailed\x00sqlite3KeyInfoIsWriteable(pKeyDup)\x00left SELECT\x00right SELECT\x00Output routine for A\x00Output routine for B\x00eof-A subroutine\x00eof-B subroutine\x00A-lt-B subroutine\x00A-eq-B subroutine\x00A-gt-B subroutine\x00multiSelectOrderBy\x00pDest->eDest!=SRT_Exists\x00pDest->eDest!=SRT_Table\x00pIn->nSdst==1 || pParse->nErr>0\x00pDest->eDest==SRT_Output\x00sqlite3KeyInfoRef\x00generateOutputSubroutine\x00pTabList!=0\x00column%d\x00generateColumnNames\x00op==TK_UNION || op==TK_EXCEPT || op==TK_INTERSECT || op==TK_ALL\x00COMPOUND SUBQUERIES %d AND %d %s(%s)\x00USING TEMP B-TREE \x00explainComposite\x00(wctrlFlags & WHERE_ONEPASS_MULTIROW)==0 || ( (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 && (wctrlFlags & WHERE_OR_SUBCLAUSE)==0 )\x00(wctrlFlags & WHERE_OR_SUBCLAUSE)==0 || (wctrlFlags & WHERE_USE_LIMIT)==0\x00at most %d tables in a join\x00pWInfo->eOnePass==ONEPASS_OFF\x00EIGHT_BYTE_ALIGNMENT(sWLB.pNew)\x00m==MASKBIT(ii)\x00(wctrlFlags & WHERE_ONEPASS_DESIRED)==0 || pWInfo->nLevel==1\x00pTabItem->iCursor==pLevel->iTabCur\x00n<=pTab->nCol\x00iAuxArg!=0 || (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0\x00wctrlFlags & WHERE_ONEPASS_DESIRED\x00pIx->pSchema==pTab->pSchema\x00iIndexCur>=0\x00sqlite3WhereBegin\x00jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0\x00pExpr->op!=TK_ISNULL || op==OP_NotNull\x00pExpr->op!=TK_NOTNULL || op==OP_IsNull\x00pExpr->op!=TK_NE || op==OP_Eq\x00pExpr->op!=TK_EQ || op==OP_Ne\x00pExpr->op!=TK_LT || op==OP_Ge\x00pExpr->op!=TK_LE || op==OP_Gt\x00pExpr->op!=TK_GT || op==OP_Le\x00pExpr->op!=TK_GE || op==OP_Lt\x00sqlite3ExprIfFalse\x00pParse->iCacheLevel>=1\x00POP  to %d\x0a\x00sqlite3ExprCachePop\x00sqlite3ExprIfTrue\x00sqlite3BinaryCompareCollSeq\x00exprCodeBetween\x00begin IN expr\x00pParse->nErr || nVector==1 || eType==IN_INDEX_EPH || eType==IN_INDEX_INDEX_ASC || eType==IN_INDEX_INDEX_DESC\x00cnt==1\x00destIfNull==destIfFalse\x00end IN expr\x00sqlite3ExprCodeIN\x00pX->op==TK_IN\x00p->pEList->a[0].pExpr!=0\x00p->pSrc!=0\x00idxaff==SQLITE_AFF_TEXT\x00pReq!=0 || pRhs->iColumn==XN_ROWID || pParse->nErr\x00pIdx->azColl[j]\x00i==nExpr || colUsed!=(MASKBIT(nExpr)-1)\x00USING INDEX %s FOR IN-OPERATOR\x00sqlite3FindInIndex\x00p->pTab!=0\x00sqlite3ExprCanBeNull\x00pTab->pSelect==0\x00pRes->iTable==pSrc->a[0].iCursor\x00isCandidateForInOpt\x00iDb>=0 && iDb<pParse->db->nDb\x00pParse->db->aDb[iDb].pBt!=0 || iDb==1\x00iDb<SQLITE_MAX_ATTACHED+2\x00sqlite3SchemaMutexHeld(pParse->db, iDb, 0)\x00sqlite3CodeVerifySchema\x00unable to open a temporary database file for storing temporary tables\x00db->aDb[1].pSchema\x00sqlite3OpenTempDatabase\x00first_entry_in(%d)\x00!ExprHasProperty(pIn, EP_xIsSelect)\x00sqlite3InRhsIsConstant\x00pMaskSet->n < ArraySize(pMaskSet->ix)\x00createMask\x00too many arguments on %s() - max %d\x00sqlite3WhereTabFuncArgs\x00pMaskSet->n<=(int)sizeof(Bitmask)*8\x00sqlite3WhereGetMask\x00pExpr->op!=TK_AS && pExpr->op!=TK_COLLATE\x00pExpr->pRight==0\x00ON clause references tables to its right\x00op==TK_IN\x00pLeft->op==TK_VECTOR\x00pTerm->iField==0\x00pList->nExpr==2\x00pWC->op==TK_AND\x00NOCASE\x00exprAnalyze\x00!ExprHasProperty(p, EP_TokenOnly)\x00sqlite3WhereExprUsage\x00exprSelectUsage\x00op<=TK_GE\x00exprMightBeIndexed\x00allowedOp(op)\x00(WO_EQ<<(op-TK_EQ)) < 0x7fff\x00op!=TK_ISNULL || c==WO_ISNULL\x00op!=TK_IN || c==WO_IN\x00op!=TK_EQ || c==WO_EQ\x00op!=TK_LT || c==WO_LT\x00op!=TK_LE || c==WO_LE\x00op!=TK_GT || c==WO_GT\x00op!=TK_GE || c==WO_GE\x00op!=TK_IS || c==WO_IS\x00operatorMask\x00allowedOp(pExpr->op) && pExpr->op!=TK_IN\x00pExpr->op>=TK_GT && pExpr->op<=TK_GE\x00exprCommute\x00(pTerm->wtFlags & (TERM_DYNAMIC|TERM_ORINFO|TERM_ANDINFO))==0\x00pExpr->op==TK_OR\x00pOrWc->nTerm>=2\x00(pOrTerm->wtFlags & (TERM_ANDINFO|TERM_ORINFO))==0\x00pAndTerm->pExpr\x00pOrTerm->eOperator & WO_EQ\x00j==1\x00pOrTerm->wtFlags & (TERM_COPIED|TERM_VIRTUAL)\x00IsPowerOfTwo(chngToIN)\x00chngToIN==sqlite3WhereGetMask(&pWInfo->sMaskSet, iCursor)\x00pOrTerm->leftCursor==iCursor\x00pOrTerm->u.leftColumn==iColumn\x00pLeft!=0\x00!ExprHasProperty(pNew, EP_xIsSelect)\x00exprAnalyzeOrTerm\x00pOne->pExpr->pLeft!=0 && pOne->pExpr->pRight!=0\x00pTwo->pExpr->pLeft!=0 && pTwo->pExpr->pRight!=0\x00eOp & (WO_GT|WO_GE)\x00op<TK_GE\x00whereCombineDisjuncts\x00pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER\x00(char*)&likeInfoAlt == (char*)&likeInfoAlt.matchAll\x00&((char*)&likeInfoAlt)[1] == (char*)&likeInfoAlt.matchOne\x00&((char*)&likeInfoAlt)[2] == (char*)&likeInfoAlt.matchSet\x00sqlite3IsLikeFunction\x00iVar>0\x00sqlite3VdbeGetBoundValue\x00sqlite3VdbeSetVarmask\x00isLikeOrGlob\x00regexp\x00pVector->flags & EP_xIsSelect\x00pRet==0 || pRet->iTable==0\x00sqlite3ExprForVectorField\x00pScan->iEquiv<=pScan->nEquiv\x00pWC!=0\x00pX->pLeft\x00whereScanNext\x00pExpr->op==TK_EQ || pExpr->op==TK_IN || pExpr->op==TK_LT || pExpr->op==TK_GT || pExpr->op==TK_GE || pExpr->op==TK_LE || pExpr->op==TK_NE || pExpr->op==TK_IS || pExpr->op==TK_ISNOT\x00pExpr->pLeft\x00comparisonAffinity\x00iCol>=0 && iCol<pIdx->nColumn\x00j==(-2)\x00indexColumnNotNull\x00pWInfo->pTabList->nSrc>=1\x00pLoop->aLTermSpace==pLoop->aLTerm\x00pWInfo->sMaskSet.n==1 && iCur==pWInfo->sMaskSet.ix[0]\x00whereShortCut\x00(mPrereq & mUnusable)==0\x00IsVirtual(pSrc->pTab)\x00bIn==0\x00mNext>0\x00whereLoopAddVirtual\x00IsPowerOfTwo(pTerm->eOperator & ~WO_EQUIV)\x00pTerm->u.leftColumn>=(-1)\x00pTerm->eOperator & (WO_IN|WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_MATCH)\x00allocateIndexInfo\x00(mUsable & mPrereq)==mPrereq\x00pIdxInfo->needToFreeIdxStr==0\x00pNew->nLSlot>=nConstraint\x00%s.xBestIndex malfunction\x00iTerm<pNew->nLSlot\x00(mExclude & WO_IN)==0\x00pNew->nLTerm<=pNew->nLSlot\x00whereLoopAddVirtualOne\x00p->rSetup==0 || pTemplate->rSetup==0 || p->rSetup==pTemplate->rSetup\x00p->rSetup>=pTemplate->rSetup\x00whereLoopFindLesser\x00!IsVirtual(pSrc->pTab)\x0043==sqlite3LogEst(20)\x00(pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0 || b==0\x00whereLoopAddBtree\x00(pLoop->wsFlags & WHERE_AUTO_INDEX)==0\x00whereLoopOutputAdjust\x00(pNew->wsFlags & WHERE_VIRTUALTABLE)==0\x00(pNew->wsFlags & WHERE_TOP_LIMIT)==0\x00pNew->u.btree.nBtm==0\x00pNew->u.btree.nEq<pProbe->nColumn\x00nInMul==0 || (pNew->wsFlags & WHERE_COLUMN_NULL)!=0 || (pNew->wsFlags & WHERE_COLUMN_IN)!=0 || (pNew->wsFlags & WHERE_SKIPSCAN)!=0\x0046==sqlite3LogEst(25)\x00nIn>0\x00saved_nEq==pNew->u.btree.nEq\x00(pTop-(pTerm->pWC->a))<pTerm->pWC->nTerm\x00pTop->wtFlags & TERM_LIKEOPT\x00pTop->eOperator==WO_LT\x00eOp & (WO_LT|WO_LE)\x00pNew->nOut==saved_nOut\x00eOp & (WO_ISNULL|WO_EQ|WO_IN|WO_IS)\x00(eOp & WO_IN) || nIn==0\x0042==sqlite3LogEst(18)\x00whereLoopAddBtreeIndex\x00pLower || pUpper\x00pUpper==0 || (pUpper->wtFlags & TERM_VNULL)==0\x00whereRangeScanEst\x0020==sqlite3LogEst(4)\x00whereRangeAdjust\x00rc==SQLITE_OK || sCur.n==0\x00whereLoopAddOr\x00nLoop<=pWInfo->pTabList->nSrc\x00aSortCost==0 || &pSpace[nSpace]==(char*)&aSortCost[nOrderBy]\x00aSortCost!=0 || &pSpace[nSpace]==(char*)pX\x0048==sqlite3LogEst(28)\x00aFrom[0].isOrdered==0\x00no query solution\x00pWInfo->nLevel==nLoop\x00pWInfo->sorted==0\x00wherePathSolver\x00pOrderBy!=0\x00wctrlFlags & WHERE_ORDERBY_LIMIT\x00nColumn==nKeyCol+1 || !HasRowid(pIndex->pTable)\x00pIndex->aiColumn[nColumn-1]==XN_ROWID || !HasRowid(pIndex->pTable)\x00j>=pLoop->u.btree.nEq || (pLoop->aLTerm[j]==0)==(j<pLoop->nSkip)\x00(pLoop->aLTerm[i]->eOperator & WO_IN)\x00wherePathSatisfiesOrderBy\x00nOrderBy>0 && 66==sqlite3LogEst(100)\x00whereSortingCost\x00!ExprHasProperty(pExpr, EP_FromJoin) || pExpr->iRightJoinTable!=pSrc->iCursor || pLoop->prereq!=0\x00automatic index on %s(%s)\x00nKeyCol>0\x00auto-index\x00(u32)n==pLoop->u.btree.nEq\x00n==nKeyCol\x00pLevel->iIdxCur>=0\x00for %s\x00next row of \"%s\"\x00constructAutomaticIndex\x00pIdx->aColExpr\x00pIdx->aColExpr->nExpr>iIdxCol\x00sqlite3ExprCodeLoadIndexColumn\x00x==XN_EXPR\x00pIdx->aColExpr!=0\x00sqlite3IndexAffinityStr\x00SEARCH\x00SCAN\x00 SUBQUERY %d\x00 TABLE %s\x00 AS %s\x00pLoop->u.btree.pIndex!=0\x00!(flags&WHERE_AUTO_INDEX) || (flags&WHERE_IDX_ONLY)\x00PRIMARY KEY\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00=\x00>? AND rowid<\x00>\x00flags&WHERE_TOP_LIMIT\x00<\x00 USING INTEGER PRIMARY KEY (rowid%s?)\x00 VIRTUAL TABLE INDEX %d:%s\x00sqlite3WhereExplainOneScan\x00 (\x00 AND \x00%s=?\x00ANY(%s)\x00<expr>\x00nTerm>=1\x00(\x00,\x00explainAppendTerm\x00init LEFT JOIN no-match flag\x00pLevel->u.in.aInLoop!=0 || db->mallocFailed\x00iIn>0\x00pOp->opcode==OP_Column || pOp->opcode==OP_Rowid\x00pOp->opcode!=OP_Column || pOp->p3==iReg+j+2\x00pOp->opcode!=OP_Rowid || pOp->p2==iReg+j+2\x00pCompare!=0 || db->mallocFailed\x00pLoop->u.btree.nEq==1\x00pTerm!=0\x00pTerm->pExpr!=0\x00omitTable==0\x00pStart!=0 || pEnd!=0\x00(pStart->wtFlags & TERM_VNULL)==0\x00(pEnd->wtFlags & TERM_VNULL)==0\x00pLevel->p5==0\x00nEq>=pLoop->nSkip\x00pWInfo->pOrderBy==0 || pWInfo->pOrderBy->nExpr==1 || (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0\x00pLoop->nSkip==0\x00(pRangeStart->wtFlags & TERM_LIKEOPT)==0 || (pLoop->wsFlags & WHERE_TOP_LIMIT)!=0\x00pRangeStart!=0\x00pRangeStart->wtFlags & TERM_LIKEOPT\x00LIKE loop counter\x00(bRev & ~1)==0\x00pRangeEnd==0 || (pRangeEnd->wtFlags & TERM_VNULL)==0\x00zStartAff==0 || sqlite3Strlen30(zStartAff)>=nEq\x00op!=0\x00pTerm->eOperator & WO_OR\x00(pTerm->wtFlags & TERM_ORINFO)!=0\x00pSubWInfo || pParse->nErr || db->mallocFailed\x00(pSubLoop->wsFlags & WHERE_AUTO_INDEX)==0\x00pSubWInfo->a[0].iIdxCur==iCovCur\x00bRev==0 || bRev==1\x00pE!=0\x00x>0\x00!ExprHasProperty(pE, EP_FromJoin)\x00(pTerm->prereqRight & pLevel->notReady)!=0\x00record LEFT JOIN hit\x00pWInfo->untestedTerms\x00pTerm->pExpr\x00sqlite3WhereCodeOneLoopStart\x00pLevel->pWLoop->aLTerm[iEq]==pTerm\x00iTarget>0\x00(pLoop->wsFlags & WHERE_MULTI_OR)==0\x00codeEqualityTerm\x00disableTerm\x00nReg>0\x00nReg<=pList->nExpr\x00nReg==1\x00codeExprOrVector\x00(pLoop->wsFlags & WHERE_VIRTUALTABLE)==0\x00zAff!=0 || pParse->db->mallocFailed\x00begin skip-scan on %s\x00zAff==0 || (int)strlen(zAff)>=nEq\x00codeAllEqualityTerms\x00p->iTable>=0\x00sqlite3ExprNeedsNoAffinityChange\x00pLevel->iLikeRepCntr>0\x00pOp!=0\x00pOp->opcode==OP_String8 || pTerm->pWC->pWInfo->pParse->db->mallocFailed\x00whereLikeOptimizationStringFixup\x00codeApplyAffinity\x00iIdxCur>0\x00pIdx->aiColumn[pIdx->nColumn-1]==-1\x00pIdx->aiColumn[i]<pTab->nCol\x00codeDeferredSeek\x00aColExpr->a[iIdxCol].pExpr!=0\x00whereIndexExprTrans\x00next skip-scan on %s\x00(ws & WHERE_IDX_ONLY)==0 || (ws & WHERE_INDEXED)!=0\x00pWInfo->nLevel<=pTabList->nSrc\x00pIdx->pTable==pTab\x00x>=0\x00(pLoop->wsFlags & WHERE_IDX_ONLY)==0 || x>=0 || pWInfo->eOnePass\x00sqlite3WhereEnd\x00whereInfoFree\x00pWInfo->iContinue!=0\x00sqlite3WhereContinueLabel\x00analyzeAggregate\x00sqlite3ExprAnalyzeAggregates\x00USE TEMP B-TREE FOR %s\x00pWInfo->wctrlFlags & WHERE_GROUPBY\x00pWInfo->wctrlFlags & WHERE_SORTBYGROUP\x00sqlite3WhereIsSorted\x00!ExprHasProperty(pF->pExpr, EP_xIsSelect)\x00updateAccumulator\x00finalizeAggFunctions\x00nReg==pAggInfo->mxReg-pAggInfo->mnReg+1\x00pAggInfo->aCol[i].iMem>=pAggInfo->mnReg && pAggInfo->aCol[i].iMem<=pAggInfo->mxReg\x00pAggInfo->aFunc[i].iMem>=pAggInfo->mnReg && pAggInfo->aFunc[i].iMem<=pAggInfo->mxReg\x00!ExprHasProperty(pE, EP_xIsSelect)\x00DISTINCT aggregates must have exactly one argument\x00resetAccumulator\x00!p->pGroupBy\x00pTab && !pTab->pSelect && pExpr\x00isSimpleCount\x00SCAN TABLE %s%s%s\x00 USING COVERING INDEX \x00*ppMinMax==0 || (*ppMinMax)->nExpr==1\x00minMaxQuery\x00addrBreak<0\x00nColumn==sqlite3Strlen30(pDest->zAffSdst)\x00eDest==SRT_Output || eDest==SRT_Coroutine\x00generateSortTail\x00op==TK_VECTOR || op==TK_REGISTER || op==TK_SELECT\x00exprVectorRegister\x00pVtab!=0\x00pVtab->pModule!=0\x00sqlite3VtabOverloadFunction\x00(errCode&0xff)==SQLITE_CONSTRAINT\x00sqlite3HaltConstraint\x00pParse!=0\x00pParse==p->pParse\x00EIGHT_BYTE_ALIGNMENT(x.pSpace)\x00x.nFree>=0\x00EIGHT_BYTE_ALIGNMENT(&x.pSpace[x.nFree])\x00sqlite3VdbeMakeReady\x00(pOp - p->aOp) >= 3\x00pOp[-1].opcode==OP_Integer\x00ADDR(pOp->p2)<pParse->nLabel\x00p->bIsReader!=0 || DbMaskAllZero(p->btreeMask)\x00resolveP2Values\x00EIGHT_BYTE_ALIGNMENT(p->pSpace)\x00EIGHT_BYTE_ALIGNMENT(pBuf)\x00allocSpace\x00sqlite3BeginTransaction\x00pParse->db!=0\x00sqlite3CommitTransaction\x00sqlite3RollbackTransaction\x00temporary table name must be unqualified\x00isTemp==0 || isTemp==1\x00isView==0 || isView==1\x00table %T already exists\x00!db->init.busy || CORRUPT_DB\x00there is already an index named %s\x00sqlite_sequence\x00pName2!=0\x00corrupt database\x00unknown database %T\x00db->init.iDb==0 || db->init.busy || (db->flags & SQLITE_Vacuum)!=0\x00sqlite3TwoPartName\x00sqlite_\x00object name reserved for internal use: %s\x00sqlite3StartTable\x00!db->init.busy || !pSelect\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00view\x00pParse->nTab==1\x00p->aCol==0\x00CREATE %s %.*s\x00UPDATE %Q.%s SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00p==pOld\x00!pSelect && pCons && pEnd\x00sqlite3EndTable\x00pParse->pNewTable==pTab\x00pIdx->nColumn>=pIdx->nKeyCol+n\x00pIdx->nColumn>=j\x00j<pPk->nColumn\x00pPk->nColumn==j\x00pTab->nCol==j\x00convertToWithoutRowidTable\x00pName1 && pName2\x00pName && pName->z\x00index\x00db->mallocFailed==0 || pTab==0\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00pName==0\x00pStart==0\x00pParse->nErr==0\x00altertab_\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00pName->z!=0\x00there is already a table named %s\x00index %s already exists\x00!db->init.busy\x00sqlite_autoindex_%s_%d\x00pList->nExpr==1\x00EIGHT_BYTE_ALIGNMENT(pIndex->aiRowLogEst)\x00EIGHT_BYTE_ALIGNMENT(pIndex->azColl)\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00pCopy!=0\x00j<=0x7fff\x00nExtra>=nColl\x00i==pIndex->nColumn\x00HasRowid(pTab) || pTab->iPKey<0 || sqlite3ColumnOfIndex(pIndex, pTab->iPKey)>=0\x00IsUniqueIndex(pIdx)\x00pIdx->idxType!=SQLITE_IDXTYPE_APPDEF\x00IsUniqueIndex(pIndex)\x00pIdx->aiColumn[k]>=0\x00conflicting ON CONFLICT clauses specified\x00!IN_DECLARE_VTAB\x00sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema)\x00p==pIndex\x00CREATE%s INDEX %.*s\x00 UNIQUE\x00INSERT INTO %Q.%s VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00sqlite3CreateIndex\x00pItem && pSrc->nSrc==1\x00sqlite3SrcListLookup\x00db->nDb>iDb\x00sqlite3FixInit\x00%s %T cannot reference objects in database %s\x00sqlite3FixSrcList\x00%s cannot use variables\x00p->nExpr>0\x00p->a[p->nExpr-1].sortOrder==SQLITE_SO_ASC\x00sqlite3ExprListSetSortOrder\x00too many columns in %s\x00type==NC_IsCheck || type==NC_PartIdx || type==NC_IdxExpr\x00sqlite3ResolveSelfReference\x00x<pIdx->pTable->nCol\x00estimateIndexWidth\x00pParse->nested<10\x00sqlite3NestedParse\x00pKey!=0 || db->mallocFailed || pParse->nErr\x00sqlite3RefillIndex\x00index '%q'\x00pIdx->aiColumn[j]>=0\x00, \x00sqlite3UniqueConstraint\x00sqlite3ChangeCookie\x00pIdx->isResized==0\x00resizeIndexObject\x00\x0a  \x00,\x0a  \x00\x0a)\x00CREATE TABLE \x00pCol->affinity-SQLITE_AFF_BLOB >= 0\x00pCol->affinity-SQLITE_AFF_BLOB < ArraySize(azType)\x00pCol->affinity==SQLITE_AFF_BLOB || pCol->affinity==sqlite3AffinityType(zType, 0)\x00k<=n\x00createTableStmt\x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00z<=zTerm\x00sqlite3Utf8CharLen\x00too many columns on %s\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00isInit==0 || isInit==1\x00sqlite3ExprIsConstantOrFunction\x00sqlite3AddNotNull\x00table \"%s\" has more than one primary key\x00pCExpr!=0\x00autoInc==0 || autoInc==1\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00sqlite3AddPrimaryKey\x00pTo!=0\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00sqlite3SchemaMutexHeld(db, 0, p->pSchema)\x00pNextTo->pPrevTo==0\x00sqlite3CreateForeignKey\x00isDeferred==0 || isDeferred==1\x00sqlite3DeferForeignKey\x00pIdx->nKeyCol==1\x00sqlite3AddCollateType\x00pName->nSrc==1\x00isView==0 || isView==LOCATE_VIEW\x00sqlite_stat\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00sqlite3DropTable\x00sqlite_stat%d\x00DELETE FROM %Q.%s WHERE %s=%Q\x00sqlite3FkDropTable\x00pTabList->nSrc==1\x00rcauth==SQLITE_OK || rcauth==SQLITE_DENY || rcauth==SQLITE_IGNORE\x00!isView || pTrigger\x00!isView\x00pIdx->pSchema==pTab->pSchema\x00IsVirtual(pTab)==0 || eOnePass!=ONEPASS_MULTI\x00IsVirtual(pTab) || bComplex || eOnePass!=ONEPASS_OFF\x00pPk->aiColumn[i]>=0\x00pPk || IsVirtual(pTab) || iDataCur==iTabCur\x00pPk || IsVirtual(pTab) || iIdxCur==iDataCur+1\x00nKey==nPk\x00pPk!=0 || pTab->pSelect!=0\x00nKey==0\x00nKey==1\x00eOnePass==ONEPASS_OFF || eOnePass==ONEPASS_SINGLE\x00rows deleted\x00sqlite3DeleteFrom\x00pList==0 || IsVirtual(pTab)==0\x00sqlite3SchemaMutexHeld(pParse->db, 0, pTmpSchema)\x00sqlite3TriggerList\x00sqlite3TriggersExist\x00checkColumnOverlap\x00table %s may not be modified\x00cannot modify %s because it is a view\x00pParse\x00sqlite3AuthContextPush\x00pFrom->nSrc==1\x00pFrom->a[0].pOn==0\x00pFrom->a[0].pUsing==0\x00sqlite3MaterializeView\x00pOffset==0 || pLimit!=0 || pParse->nErr>0 || pParse->db->mallocFailed!=0\x00pNew->pSrc!=0 || pParse->nErr>0\x00pNew!=&standin\x00sqlite3SelectNew\x00op==OP_OpenRead || op==OP_OpenWrite\x00op==OP_OpenWrite || p5==0\x00sqlite3OpenTableAndIndices\x00sqlite3VtabMakeWritable\x00sqlite3GenerateRowDelete\x00isNew==1 || isNew==0\x00sqlite3TriggerColmask\x00pTrigger->zName==0 || pTab==tableOfTrigger(pTrigger)\x00getRowTrigger\x00pTop->pVdbe\x00Start: %s.%s (%s %s%s%s ON %s)\x00-- TRIGGER %s\x00End: %s.%s\x00!pSubParse->pAinc && !pSubParse->pZombieTab\x00!pSubParse->pTriggerPrg && !pSubParse->nMaxArg\x00codeRowTrigger\x00default\x00n/a\x00pParse->pTriggerTab && pParse->pToplevel\x00pStepList\x00pParse->okConstFactor==0\x00pStep->op==TK_SELECT\x00codeTriggerProgram\x00pTrigger || tmask==0\x00no such column: %s\x00(chngRowid & chngPk)==0\x00chngRowid==0 || chngRowid==1\x00chngPk==0 || chngPk==1\x00iCur!=iDataCur || !HasRowid(pTab)\x00pPk\x00chngKey || pTrigger || hasFK || regOldRowid==regNewRowid\x00regOldRowid>0\x00regNew==regNewRowid+1\x00rows updated\x00sqlite3Update\x00updateVirtualTable\x00pIdx->aiColumn[i]>=0\x00ppIdx && *ppIdx==0\x00!paiCol || *paiCol==0\x00nCol>1\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00sqlite3FkLocateIndex\x00sqlite3FkOldmask\x00op==TK_UPDATE || op==TK_INSERT || op==TK_DELETE\x00tr_tm==TRIGGER_BEFORE || tr_tm==TRIGGER_AFTER\x00(op==TK_UPDATE)==(pChanges!=0)\x00p->pSchema!=0\x00p->pTabSchema!=0\x00p->pSchema==p->pTabSchema || p->pSchema==pParse->db->aDb[1].pSchema\x00sqlite3CodeRowTrigger\x00pPrg || pParse->nErr || pParse->db->mallocFailed\x00Call: %s.%s\x00fkey\x00sqlite3CodeRowTriggerDirect\x00onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail || onError==OE_Ignore || onError==OE_Replace\x00onError==OE_Replace\x00%s column %d\x00sqlite3GenerateConstraintChecks\x00pExpr->iColumn>=0 || pExpr->iColumn==-1\x00checkConstraintExprNode\x00%s.rowid\x00iIdxCur+i!=iDataCur || pPk==pIdx\x00sqlite3GenerateRowIndexDelete\x00(regOld==0)!=(regNew==0)\x00isIgnoreErrors==0 || (regOld!=0 && regNew==0)\x00pFKey->nCol==1 || (aiFree && pIdx)\x00pIdx==0 || pIdx->aiColumn[i]>=0\x00regOld==0 && regNew!=0\x00aiCol || pFKey->nCol==1\x00sqlite3FkCheck\x00aiCol[i]!=pTab->iPKey\x00nIncr==1\x00fkLookupParent\x00pIdx==0 || pIdx->pTable==pTab\x00pIdx==0 || pIdx->nKeyCol==pFKey->nCol\x00pIdx!=0 || pFKey->nCol==1\x00pIdx!=0 || HasRowid(pTab)\x00fkScanChildren\x00update_flags==0 || update_flags==OPFLAG_ISUPDATE || update_flags==(OPFLAG_ISUPDATE|OPFLAG_SAVEPOSITION)\x00pParse->nested==0\x00sqlite3CompleteInsertion\x00iFromCol>=0\x00pIdx!=0 || (pTab->iPKey>=0 && pTab->iPKey<pTab->nCol)\x00pStep!=0\x00fkActionTrigger\x00autoIncrementEnd\x00pSrc->nSrc>0\x00targetSrcList\x00(pTrigger && tmask) || (pTrigger==0 && tmask==0)\x00!pTrigger\x00pList==0\x00!withoutRowid\x00table %S has no column named %s\x00pSelect->pEList\x00useTempTable==0\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00pIdx\x00pSelect==0\x00rows inserted\x00sqlite3Insert\x00pSelect->pSrc\x00pSelect->pOffset==0\x00pEList->a[0].pExpr\x00pDestCol->pDflt==0 || pDestCol->pDflt->op==TK_SPAN\x00pSrcCol->pDflt==0 || pSrcCol->pDflt->op==TK_SPAN\x00HasRowid(pDest) || destHasUniqueIdx\x00(pDest->tabFlags & TF_Autoincrement)==0\x00pSrcIdx\x00xferOptimization\x00pDest && pSrc\x00pDest->pTable!=pSrc->pTable\x00pSrc->aColExpr!=0 && pDest->aColExpr!=0\x00xferCompatibleIndex\x00pOp->p4.pVtab!=0\x00readsTable\x00pExpr->op!=TK_REGISTER\x00sqlite3ExprCodeAndCache\x00pFrom->zErrMsg==0 || pFrom->nErr\x00pTo->zErrMsg==0 || pTo->nErr\x00transferParseError\x00aOp && !p->db->mallocFailed\x00DbMaskAllZero(p->btreeMask)\x00sqlite3VdbeTakeOpArray\x00pTrigger->pSchema==pTab->pSchema || pTrigger->pSchema==db->aDb[1].pSchema\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'\x00sqlite3CodeDropTable\x00pTable->pSchema==pTrigger->pSchema || iDb==1\x00DELETE FROM %Q.%s WHERE name=%Q AND type='trigger'\x00sqlite3DropTriggerPtr\x00destroyTable\x00iTable>1\x00UPDATE %Q.%s SET rootpage=%d WHERE #%d AND rootpage=#%d\x00destroyRootPage\x00sqlite3SchemaMutexHeld(db, idx, 0)\x00sqliteViewResetAll\x00parameters are not allowed in views\x00sEnd.z[0]!=0\x00sqlite3CreateView\x00too many terms in compound SELECT\x00yy_reduce\x00pList!=0 || db->mallocFailed!=0\x00db->mallocFailed || pItem->pExpr==pSpan->pExpr\x00sqlite3ExprListSetSpan\x00pIndexedBy!=0\x00pItem->fg.notIndexed==0\x00pItem->fg.isIndexedBy==0\x00pItem->fg.isTabFunc==0\x00sqlite3SrcListIndexedBy\x00sqlite3SrcListFuncArgs\x00 \x00pB!=0\x00unknown or unsupported join type: %T %T%s%T\x00RIGHT and FULL OUTER JOINs are not currently supported\x00naturaleftouterightfullinnercross\x00sqlite3JoinType\x00pList->nExpr==iFirst+i+1\x00pFirst!=0\x00pFirst->op==TK_SELECT_COLUMN\x00sqlite3ExprListAppendVector\x00!ExprHasProperty(pExpr, EP_IntValue|EP_Reduced|EP_TokenOnly)\x00z[0]!=0\x00n==(u32)sqlite3Strlen30(z)\x00z[0]=='?'\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00sqlite3ExprAssignVarNumber\x00pIn==0 || pIn[0]>=3\x00pIn[1]<=pIn[0]\x00sqlite3VListAdd\x00pToken\x00sqlite3ExprFunction\x00sqlite3PExprAddSelect\x00syntax error after column name \"%.*s\"\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.%s WHERE name=%Q AND type='index'\x00sqlite3DropIndex\x00-%T\x00pId2\x00pBt!=0\x00pDb==&db->aDb[0]\x00eMode==PAGER_LOCKINGMODE_NORMAL || eMode==PAGER_LOCKINGMODE_EXCLUSIVE\x00eAuto>=0 && eAuto<=2\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00pCol->pDflt==0 || pCol->pDflt->op==TK_SPAN\x00issisi\x00ssiii\x00siii\x00pParse->nMem<=pPragma->nPragCName\x00iis\x00isi\x00c\x00u\x00isisi\x00db->aDb[i].zDbSName!=0\x00iss\x00is\x00iissssss\x00NONE\x00pParse->nErr>0 || pFK==0\x00x==0\x00pFK->nCol==1\x00si\x00parser: \x00iDb==0 || pId2->z\x00sqlite3SchemaMutexHeld(db, i, 0)\x00*** in database %s ***\x0a\x00pParse->nMem>=8+j\x00sqlite3NoTempsInRange(pParse,1,7+j)\x00NULL value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00iCol!=XN_ROWID && iCol<pTab->nCol\x00non-unique entry in index \x00wrong # of entries in index \x00ok\x00encnames[SQLITE_UTF8].enc==SQLITE_UTF8\x00encnames[SQLITE_UTF16LE].enc==SQLITE_UTF16LE\x00encnames[SQLITE_UTF16BE].enc==SQLITE_UTF16BE\x00unsupported encoding: %s\x00full\x00restart\x00sqlite3LogEst(25)==46\x00ANALYZE \"%w\".\"%w\"\x00pPragma->ePragTyp==PragTyp_BUSY_TIMEOUT\x00unknown\x00closed\x00ss\x00sqlite3Pragma\x00fd!=0\x00sqlite3_file_control\x00p->nOp + N <= p->pParse->nOpAlloc\x00sqlite3VdbeVerifyNoMallocRequired\x00eMode==PAGER_LOCKINGMODE_QUERY || eMode==PAGER_LOCKINGMODE_NORMAL || eMode==PAGER_LOCKINGMODE_EXCLUSIVE\x00pPager->exclusiveMode || 0==sqlite3WalHeapMemory(pPager->pWal)\x00sqlite3PagerLockingMode\x00incremental\x00(pDb->safety_level & PAGER_SYNCHRONOUS_MASK)==pDb->safety_level\x00setAllPagerFlags\x00sqlite3BtreeSetMmapLimit\x00temporary storage cannot be changed from within a transaction\x00c=='i'\x00sqlite3VdbeMultiLoad\x00SET NULL\x00SET DEFAULT\x00NO ACTION\x00action==OE_None\x00actionName\x00LIKE or GLOB pattern too complex\x00zB==sqlite3_value_text(argv[0])\x00ESCAPE expression must be a single character\x00p && p->pFunc\x00sqlite3_user_data\x00likeFunc\x00sqlite3_result_int\x00setLikeOptFlag\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00DEBUG\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_SYNCHRONOUS=2\x00ENABLE_API_ARMOR\x00SYSTEM_MALLOC\x00THREADSAFE=1\x00unknown database: %s\x00sqlite3PcacheShrink\x00aHardLimit[SQLITE_LIMIT_LENGTH]==SQLITE_MAX_LENGTH\x00aHardLimit[SQLITE_LIMIT_SQL_LENGTH]==SQLITE_MAX_SQL_LENGTH\x00aHardLimit[SQLITE_LIMIT_COLUMN]==SQLITE_MAX_COLUMN\x00aHardLimit[SQLITE_LIMIT_EXPR_DEPTH]==SQLITE_MAX_EXPR_DEPTH\x00aHardLimit[SQLITE_LIMIT_COMPOUND_SELECT]==SQLITE_MAX_COMPOUND_SELECT\x00aHardLimit[SQLITE_LIMIT_VDBE_OP]==SQLITE_MAX_VDBE_OP\x00aHardLimit[SQLITE_LIMIT_FUNCTION_ARG]==SQLITE_MAX_FUNCTION_ARG\x00aHardLimit[SQLITE_LIMIT_ATTACHED]==SQLITE_MAX_ATTACHED\x00aHardLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH]== SQLITE_MAX_LIKE_PATTERN_LENGTH\x00aHardLimit[SQLITE_LIMIT_VARIABLE_NUMBER]==SQLITE_MAX_VARIABLE_NUMBER\x00aHardLimit[SQLITE_LIMIT_TRIGGER_DEPTH]==SQLITE_MAX_TRIGGER_DEPTH\x00aHardLimit[SQLITE_LIMIT_WORKER_THREADS]==SQLITE_MAX_WORKER_THREADS\x00sqlite3_limit\x00unlocked\x00shared\x00reserved\x00pending\x00p->aOp[i].opcode!=OP_ResultRow\x00sqlite3VdbeVerifyNoResultRow\x00INSERT INTO %Q.%s VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00!pParse->pNewTrigger\x00sqlite3FinishTrigger\x00pName1!=0\x00op==TK_INSERT || op==TK_UPDATE || op==TK_DELETE\x00op>0 && op<0xff\x00temporary trigger may not have qualified name\x00pTableName->nSrc==1\x00cannot create triggers on virtual tables\x00trigger %T already exists\x00cannot create trigger on system table\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00pParse->pNewTrigger==pTrigger\x00sqlite3BeginTrigger\x00pSelect != 0 || db->mallocFailed\x00sqlite3TriggerInsertStep\x00no such trigger: %S\x00sqlite3DropTrigger\x00v || db->mallocFailed\x00pFunc->nArg==-1 || (pFunc->nArg&0xff)==pFunc->nArg\x00codeAttach\x00sqlite_attach\x00too many attached databases - max %d\x00cannot ATTACH database within transaction\x00z && zName\x00database %s is already in use\x00pVfs\x00database is already attached\x00iDb>=2\x00unable to open database: %s\x00attachFunc\x00*pzErrMsg==0\x00file:\x00localhost\x00invalid uri authority: %.*s\x00octet>=0 && octet<256\x00vfs\x00cache\x00mode\x00access\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00sqlite3ParseUri\x00private\x00ro\x00rw\x00rwc\x00sqlite_detach\x00no such database: %s\x00cannot detach database %s\x00cannot DETACH database within transaction\x00database %s is locked\x00pName1->z\x00unable to identify the object to be reindexed\x00pDb!=0\x00reindexDatabases\x00zColl!=0\x00z!=0 || pIndex->aiColumn[i]<0\x00collationMatch\x00sqlite3Reindex\x00sqlite3BtreeHoldsAllMutexes(pParse->db)\x00pName2!=0 || pName1==0\x00sqlite3Analyze\x00sqlite3VdbeDb(v)==db\x00CREATE TABLE %Q.%s(%s)\x00i<ArraySize(aTable)\x00openStatTable\x00tbl,idx,stat\x00sqlite_stat3\x00sqlite_stat4\x00analyzeDatabase\x00sqlite_%\x00Analysis for %s.%s\x00iDb==sqlite3SchemaToIndex(db, pIdx->pSchema)\x00regChng==(regStat4+1)\x00BBB\x00\"BBB\"[0]==SQLITE_AFF_TEXT\x00analyzeOneTable\x00stat_init\x00nCol>0\x00nKeyCol<=nCol\x00statInit\x00n>=0\x00sqlite3_result_blob\x00stat_push\x00p->nCol>0\x00iChng<p->nCol\x00statPush\x00regOut!=regStat4 && regOut!=regStat4+1\x00iParam==STAT_GET_STAT1\x00callStatGet\x00stat_get\x00argc==1\x00%llu\x00 %llu\x00p->current.anEq[i]\x00z[0]=='\\0' && z>zRet\x00statGet\x00analyzeTable\x00pSrc->nSrc==1\x00there is already another table or index with this name: %s\x00view %s may not be altered\x00UPDATE \"%w\".%s SET sql = sqlite_rename_parent(sql, %Q, %Q) WHERE %s;\x00UPDATE %Q.%s SET sql = CASE WHEN type = 'trigger' THEN sqlite_rename_trigger(sql, %Q)ELSE sqlite_rename_table(sql, %Q) END, tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_master SET sql = sqlite_rename_trigger(sql, %Q), tbl_name = %Q WHERE %s;\x00sqlite3AlterRenameTable\x00table %s may not be altered\x00name=%Q\x00%s OR name=%Q\x00type='trigger' AND (%s)\x00iTrigDb==iDb || iTrigDb==1\x00tbl_name=%Q\x00reloadTableSchema\x00pNew\x00pDflt==0 || pDflt->op==TK_SPAN\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00db->mallocFailed == 1\x00Cannot add a column with non-constant default\x00UPDATE \"%w\".%s SET sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d) WHERE type = 'table' AND name = %Q\x00sqlite3AlterFinishAddColumn\x00virtual tables may not be altered\x00Cannot add a column to a view\x00pTab->addColOffset>0\x00pNew->nCol>0\x00nAlloc>=pNew->nCol && nAlloc%8==0 && nAlloc-pNew->nCol<8\x00sqlite_altertab_%s\x00sqlite3AlterBeginAddColumn\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.%s SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name='%q' AND type='table'\x00sqlite3SchemaMutexHeld(db, 0, pSchema)\x00pTab==pOld\x00sqlite3VtabFinishParse\x000==pTable->pIndex\x00pTable->nModuleArg==0\x00(pParse->sNameToken.z==pName2->z && pName2->z!=0) || (pParse->sNameToken.z==pName1->z && pName2->z==0)\x00sqlite3VtabBeginParse\x00pArg->z <= p->z\x00sqlite3VtabArgExtend\x00duplicate WITH table name: %s\x00(pNew!=0 && zName!=0) || db->mallocFailed\x00sqlite3WithAdd\x00stateno<=YY_REDUCE_COUNT\x00i!=YY_REDUCE_USE_DFLT\x00i>=0 && i<YY_ACTTAB_COUNT\x00yy_lookahead[i]==iLookAhead\x00yy_find_reduce_action\x00%sAccept!\x0a\x00yypParser->yytos==yypParser->yystack\x00yy_accept\x00TOKEN.z[0]\x00yy_syntax_error\x00azResult!=0\x00sqlite3_free_table\x00pCtx->pVdbe!=0\x00sqlite3_get_auxdata\x00sqlite3_get_table() called with two or more incompatible queries\x00RTRIM\x00db->pDfltColl!=0\x00db->mutex!=0 || isThreadsafe==0 || sqlite3GlobalConfig.bFullMutex==0\x00db!=0 || rc==SQLITE_NOMEM\x00openDatabase\x00rc==SQLITE_NOMEM || rc==SQLITE_OK\x00unable to use function %s in the requested context\x00sqlite3RegisterPerConnectionBuiltinFunctions\x00automatic extension loading failed: %s\x00sz > (int)sizeof(LookasideSlot*)\x00setupLookaside\x00\x00\x00\x00*ppDb || rc==SQLITE_NOMEM\x00sqlite3_open16\x00sqlite3_prepare16\x00sqlite3_result_error16\x00sqlite3_result_int64\x00sqlite3_result_null\x00sqlite3_result_text16\x00sqlite3_result_text16be\x00sqlite3_result_text16le\x00sqlite3_set_auxdata\x00no such table column: %s.%s\x00pTo->isPrepareV2 || pTo->expmask==0\x00pFrom->isPrepareV2 || pFrom->expmask==0\x00sqlite3_transfer_bindings\x00sqlite3_prepare16_v2\x00sqlite3_clear_bindings\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00pBlob->pStmt || db->mallocFailed\x00aOp!=0\x00sqlite3_blob_open\x00cannot open value of type %s\x00null\x00no such rowid: %lld\x00rc!=SQLITE_OK || zErr==0\x00rc!=SQLITE_ROW && rc!=SQLITE_DONE\x00blobSeekToRow\x00db == v->db\x00blobReadWrite\x00sqlite3BtreePayloadChecked\x00accessPayloadChecked\x00cursorOwnsBtShared(pCsr)\x00sqlite3_mutex_held(pCsr->pBtree->db->mutex)\x00pCsr->curFlags & BTCF_Incrblob\x00pCsr->eState!=CURSOR_REQUIRESEEK\x00(pCsr->pBt->btsFlags & BTS_READ_ONLY)==0 && pCsr->pBt->inTransaction==TRANS_WRITE\x00hasSharedCacheTableLock(pCsr->pBtree, pCsr->pgnoRoot, 0, 2)\x00!hasReadConflicts(pCsr->pBtree, pCsr->pgnoRoot)\x00pCsr->apPage[pCsr->iPage]->intKey\x00sqlite3BtreePutData\x00sqlite3_mutex_alloc\x00vfsList\x00sqlite3_mutex_held(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER))\x00vfsUnlink\x00sqlite3_vfs_register\x00sqlite3_result_zeroblob\x00(x = va_arg(ap,int))!=0\x00sqlite3_test_control\x00source and destination must be distinct\x00unknown database %s\x00destination database is in use\x00(op-SQLITE_DBSTATUS_LOOKASIDE_HIT)>=0\x00(op-SQLITE_DBSTATUS_LOOKASIDE_HIT)<3\x00sqlite3_db_status\x00eStat==SQLITE_DBSTATUS_CACHE_HIT || eStat==SQLITE_DBSTATUS_CACHE_MISS || eStat==SQLITE_DBSTATUS_CACHE_WRITE\x00sqlite3PagerCacheStat\x00rc!=SQLITE_SCHEMA\x00rc==SQLITE_OK || p->pStmt==0\x00sqlite3_blob_reopen\x00p->pTab==0 || IsVirtual(p->pTab)\x00sqlite3_vtab_config\x00db->vtabOnConflict>=1 && db->vtabOnConflict<=5\x00sqlite3_vtab_on_conflict\x00sqlite3_auto_extension\x00xDel!=SQLITE_DYNAMIC\x00sqlite3_bind_blob64\x00invokeValueDestructor\x00sqlite3_bind_text64\x00sqlite3_result_blob64\x00sqlite3_result_text64\x00sqlite3_mutex_held(pOut->db->mutex)\x00sqlite3_result_zeroblob64\x00(n & 0x7FFFFFFF)==n\x00sqlite3_bind_zeroblob64\x00sqlite3_result_subtype\x00sqlite3PagerFlush\x00compileoptionusedFunc\x00compileoptiongetFunc\x00zIn==sqlite3_value_text(argv[0])\x00trimFunc\x00nByte>0\x00contextMalloc\x00argc>1\x00pColl\x00mask==-1 || mask==0\x00minmaxFunc\x00context->pVdbe!=0\x00pOp->opcode==OP_CollSeq\x00sqlite3GetFuncCollSeq\x00lengthFunc\x00integer overflow\x00absFunc\x00argc==1 || argc==2\x00%.*f\x00roundFunc\x00z2==(char*)sqlite3_value_text(argv[0])\x00upperFunc\x00lowerFunc\x00pBlob==sqlite3_value_blob(argv[0])\x00hexFunc\x00randomBlob\x00%!.20e\x00zBlob==sqlite3_value_blob(argv[0])\x00sqlite3_value_type(argv[0])==SQLITE_NULL\x00quoteFunc\x00zStr==sqlite3_value_text(argv[0])\x00sqlite3_value_type(argv[1])==SQLITE_NULL || sqlite3_context_db_handle(context)->mallocFailed\x00sqlite3_value_type(argv[1])!=SQLITE_NULL\x00zPattern==sqlite3_value_text(argv[1])\x00zRep==sqlite3_value_text(argv[2])\x00nOut<SQLITE_MAX_LENGTH\x00j+nStr-i+1==nOut\x00j<=nOut\x00replaceFunc\x00zeroblobFunc\x00argc==3 || argc==2\x00len==sqlite3_value_bytes(argv[0])\x00p1>=0 && p2>=0\x00substrFunc\x00sumStep\x00argc==1 || p==0 || p->n>0x7fffffff || p->n==sqlite3_aggregate_count(context)\x00countStep\x00groupConcatStep\x00unix\x00unix-none\x00unix-dotfile\x00unix-excl\x00pFile->pInode->nLock>0 || pFile->pInode->bProcessLock==0\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00open\x00close\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00eFileLock==SHARED_LOCK || ((unixFile *)id)->nFetchOut==0\x00unixUnlock\x00eFileLock<=SHARED_LOCK\x00pInode->nShared!=0\x00pInode->eFileLock==pFile->eFileLock\x00handleNFSUnlock==0\x00PENDING_BYTE+1==RESERVED_BYTE\x00pInode->nLock>=0\x00posixUnlock\x00unixMutexHeld()\x00pInode!=0\x00pInode->nLock==0\x00unixFileLock\x00unixClose\x00pInode->pShmNode==0\x00pInode->pPrev->pNext==pInode\x00inodeList==pInode\x00pInode->pNext->pPrev==pInode\x00releaseInodeInfo\x00pFd->nFetchOut==0\x00unixUnmapfile\x00offset>=0\x00amt>0\x00unixRead\x00cnt==(cnt&0x1ffff)\x00id->h>2\x00seekAndRead\x00unixWrite\x00nBuf==(nBuf&0x1ffff)\x00fd>2\x00piErrno!=0\x00seekAndWriteFd\x00unixTruncate\x00(flags&0x0F)==SQLITE_SYNC_NORMAL || (flags&0x0F)==SQLITE_SYNC_FULL\x00full_fsync\x00rc==SQLITE_CANTOPEN\x00unixSync\x00unixFileSize\x00pFile->eFileLock!=NO_LOCK || eFileLock==SHARED_LOCK\x00eFileLock!=PENDING_LOCK\x00eFileLock!=RESERVED_LOCK || pFile->eFileLock==SHARED_LOCK\x00eFileLock==SHARED_LOCK\x00pFile->eFileLock==0\x00pInode->nShared>0\x00pInode->nShared==0\x00pInode->eFileLock==0\x000!=pFile->eFileLock\x00eFileLock==RESERVED_LOCK || eFileLock==EXCLUSIVE_LOCK\x00unixLock\x00(sqliteIOErr == SQLITE_IOERR_LOCK) || (sqliteIOErr == SQLITE_IOERR_UNLOCK) || (sqliteIOErr == SQLITE_IOERR_RDLOCK) || (sqliteIOErr == SQLITE_IOERR_CHECKRESERVEDLOCK)\x00sqliteErrorFromPosixError\x00pFile->eFileLock<=SHARED_LOCK\x00unixCheckReservedLock\x00iWrite>=buf.st_size\x00((iWrite+1)%nBlk)==0\x00fcntlSizeHint\x00nMap>=0 || pFd->nFetchOut==0\x00nMap>0 || (pFd->mmapSize==0 && pFd->pMapRegion==0)\x00unixMapfile\x00nNew>pFd->mmapSize\x00nNew<=pFd->mmapSizeMax\x00pFd->mmapSizeActual>=pFd->mmapSize\x00MAP_FAILED!=0\x00unixRemapfile\x00nBuf>2\x00%s/etilqs_%llx%c\x00SQLITE_TMPDIR\x00TMPDIR\x00/var/tmp\x00/usr/tmp\x00/tmp\x00unixGetTempname\x00szRegion==pShmNode->szRegion || pShmNode->nRegion==0\x00pShmNode->pInode==pDbFd->pInode\x00pShmNode->h>=0 || pDbFd->pInode->bProcessLock==1\x00pShmNode->h<0 || pDbFd->pInode->bProcessLock==0\x00(nByte % pgsz)==0\x00((pgsz-1)&pgsz)==0\x00unixShmRegionPerMap\x00pDbFd->pShm==0\x00%s-shm\x00readonly_shm\x00unixOpenSharedMemory\x00sqlite3_mutex_held(pShmNode->mutex) || pShmNode->nRef==0\x00n==1 || lockType!=F_RDLCK\x00n>=1 && n<=SQLITE_SHM_NLOCK\x00lockType==F_WRLCK\x00unixShmSystemLock\x00p->pInode==pFd->pInode\x00unixShmPurge\x00unixShmMap\x00pShmNode==pDbFd->pInode->pShmNode\x00ofst>=0 && ofst+n<=SQLITE_SHM_NLOCK\x00n>=1\x00flags==(SQLITE_SHM_LOCK | SQLITE_SHM_SHARED) || flags==(SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE) || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED) || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE)\x00n==1 || (flags & SQLITE_SHM_EXCLUSIVE)!=0\x00n>1 || mask==(1<<ofst)\x00(pX->exclMask & (p->exclMask|p->sharedMask))==0\x00(p->sharedMask & mask)==0\x00unixShmLock\x00pShmNode->nRef>0\x00unixShmUnmap\x00(p==0)==(pFd->nFetchOut==0)\x00p==0 || p==&((u8 *)pFd->pMapRegion)[iOff]\x00pFd->nFetchOut>=0\x00unixUnfetch\x00(isReadonly==0 || isReadWrite==0) && (isReadWrite || isReadonly)\x00isCreate==0 || isReadWrite\x00isExclusive==0 || isCreate\x00isDelete==0 || isCreate\x00(!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_DB\x00(!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_JOURNAL\x00(!isDelete && zName) || eType!=SQLITE_OPEN_MASTER_JOURNAL\x00(!isDelete && zName) || eType!=SQLITE_OPEN_WAL\x00eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL || eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL\x00(flags & SQLITE_OPEN_URI) || zName[strlen(zName)+1]==0\x00isDelete && !syncDir\x00zName[strlen(zName)+1]==0\x00!p->pUnused\x00eType==SQLITE_OPEN_WAL || eType==SQLITE_OPEN_MAIN_JOURNAL\x00!isExclusive || (openFlags & O_CREAT)!=0\x00fd>=0\x00unixOpen\x00nDb>0\x00sqlite3Isalnum(zPath[nDb])\x00modeof\x00findCreateFileMode\x00pNew->pInode==NULL\x00zFilename==0 || zFilename[0]=='/'\x00zFilename!=0 || (ctrlFlags & UNIXFILE_NOLOCK)!=0\x00psow\x00zFilename!=0\x00%s.lock\x00fillInUnixFile\x00findInodeInfo\x00id!=0\x00dotlockClose\x00eFileLock==NO_LOCK\x00dotlockUnlock\x00dotlockCheckReservedLock\x00fsync\x00unixDelete\x00pResOut!=0\x00flags==SQLITE_ACCESS_EXISTS || flags==SQLITE_ACCESS_READWRITE\x00unixAccess\x00pVfs->mxPathname==MAX_PATHNAME\x00rc!=SQLITE_OK || zIn!=zOut || zIn[0]=='/'\x00unixFullPathname\x00(size_t)nBuf>=(sizeof(time_t)+sizeof(int))\x00/dev/urandom\x00sizeof(t)+sizeof(randomnessPid)<=(size_t)nBuf\x00unixRandomness\x00sqlite3_initialize\x00enlargeAndAppend\x00sqlite3VXPrintf\x00thstndrd\x000123456789ABCDEF0123456789abcdef\x00-x0\x00X0\x00sqlite3AppendChar\x00")